text
stringlengths
3.07k
12.6k
# Copyright [2020] [Indian Institute of Science, Bangalore] # SPDX-License-Identifier: Apache-2.0 import cv2 from datetime import datetime import numpy as np import os from PIL import Image from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE_TYPE from pptx.util import Inches def read_img_file(file_lo...
from __future__ import print_function import numpy as np import torch import torch.nn.init import torch.nn as nn # ducha-aiki # / # LSUV-pytorch github gg = {} gg['hook_position'] = 0 gg['total_fc_conv_layers'] = 0 gg['done_counter'] = -1 gg['hook'] = None gg['act_dict'] = {} gg['counter_to_apply_correction'] = 0 gg...
# -*- coding: utf-8 -*- # Created by richie at 2018/11/23 import requests from lxml import html as hl import json import re BASE_DIMAIN = "http://www.ygdy8.net" # 定义基础域名 HEADERS = { "Referer": "http://www.ygdy8.net/html/tv/oumeitv/list_9_1.html", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1...
import os import sys import warnings from collections import defaultdict from copy import deepcopy from typing import Dict, Optional, Tuple import numpy as np import torch from loguru import logger from torch.types import Number from df.modules import GroupedLinearEinsum from df.utils import get_branch_name, get_comm...
""" bdosoa - SOAP processing routines """ import logging import urllib2 from lxml import etree from lxml.builder import ElementMaker # # XML # SOAP_ENV_NS = 'soapenv' SOAP_ENV_URI = 'http://schemas.xmlsoap.org/soap/envelope/' SOAP_NSMAP = { SOAP_ENV_NS: SOAP_ENV_URI, 'xsi': 'http://www.w3.org/2001/XMLSche...
#!/usr/bin/python3 import argparse import json import logging import time import openshift as oc from openshift import OpenShiftPythonException logging.basicConfig(level=logging.INFO, format='[%(asctime)s] %(message)s') logger = logging.getLogger('releaseTool') SUPPORTED_PRODUCTS = ['ocp', 'okd'] SUPPORTED_ARCHITEC...
""" This is the GPU implementation of regular CPAC-CNN model using pytorch. python train_mnist.py [number of filters] [filter_size] [rank] [epochs] [device]; python train_mnist.py 8 3 6 10 cuda:0 """ import torch import torchvision from torch import nn import torch.nn.functional as F import torch.optim as optim from ...
class HashTableEntry: """ Linked List hash table key/value pair """ def __init__(self, key, value): self.key = key self.value = value self.next = None # Hash table can't have fewer than this many slots MIN_CAPACITY = 8 class HashTable: """ A hash table that with `capa...
import pytest import struct, py, sys from jitlog.objects import (FlatOp, TraceForest, Trace, MergePoint, iter_ranges, PointInTrace) from jitlog import constants as const from vmlog.views import (LogMetaSerializer, TraceSerializer, VisualTraceTreeSerializer) PY3 = sys.version_info[0] >= 3 def test_to_j...
from _collections import deque import gc #from AppTestW_IterObjectApp def test_user_iter(): class C(object): def __next__(self): raise StopIteration def __iter__(self): return self assert list(C()) == [] def test_iter_getitem(): class C(object): def __getit...
# Copyright 2021 MosaicML. All Rights Reserved. from __future__ import annotations import logging from dataclasses import asdict, dataclass from functools import partial from typing import Optional, Tuple import torch import torch.nn.functional as F import yahp as hp from torchvision import transforms from composer...
import logging from django.http import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import FormView from django.views.generic.detail import SingleObjectMixin from djadyen import settings from .choices import Status from .forms import PaymentForm from .hpp imp...
from decimal import Decimal from enum import Enum from typing import Optional, List, Dict from rest_framework.request import Request from rest_framework.response import Response from elasticsearch_dsl import A, Q as ES_Q from usaspending_api.common.cache_decorator import cache_response from usaspending_api.common.ela...
from abc import abstractmethod from itertools import combinations from tqdm import tqdm import numpy as np from pgmpy.models import BayesianModel class BaseEliminationOrder: """ Base class for finding elimination orders. """ def __init__(self, model): """ Init method for the base cl...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2020, CTERA Networks Ltd. # 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 ANSIBLE_METADATA = { 'metadata_version': '1.1',...
import json __author__ = 'eric.r' SERVER_VERSION = '6.3.0' import re from zipfile import ZipFile from io import BytesIO import urllib.request, urllib.error def urlencode(s): return s.replace('+', '%2B').replace('/', '%2F').replace('=', '%3D') class QualiAPIClient(object): def __init__(self, ip, port, usern...
''' Created on 2015-7-12 @author: livepc ''' import datetime import math import config def distanceOfTwoDay(date1, date2): listdate1 = str(date1).split('-') listdate2 = str(date2).split('-') d1 = datetime.datetime(int(listdate1[0]), int(listdate1[1]), int(listdate1[2])) d2 = datetime.da...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 16 10:36:56 2021 @author: <NAME> <<EMAIL>> This script will upload data into smarter database starting from a couple of MAP/PED (plink) files and the archive file used for the dataset upload in the smarter database. Dataset country and species are ...
from django.contrib import admin from django.contrib.admin import SimpleListFilter from django.db import transaction from django.utils import timezone from clist.models import Banner, Contest, Problem, ProblemTag, Resource, TimingContest from pyclist.admin import BaseModelAdmin, admin_register from ranking.management....
''' Signal processing elements ''' import numpy as np from ..segments import Segment, SegmentCircle, SegmentText from ..elements import Element class Square(Element): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.segments.append(Segment([[0, 0], [0, .5], [1, .5], ...
#!/usr/bin/env python """Get new files using sftp from a project server Usage: dm-sftp.py [options] <study> Arguments: <study>: Short name of the study to process Options: -h --help Show this screen. -q --quiet Suppress output. -v --verbose Sho...
from happytransformer import ( HappyGeneration, ARGS_GEN_TRAIN, ARGS_GEN_EVAl, GENSettings, GENTrainArgs, GENEvalArgs ) from tests.shared_tests import run_save_load def test_default_simple(): happy_gen = HappyGeneration() args = GENSettings(min_length=5, max_length=5) output = happ...
import json import pandas as pd from functools import partial from datetime import datetime from bs4 import BeautifulSoup to_datetime = partial(pd.to_datetime, format="%d-%m-%Y") def to_price(price): return price/10 def identity(i): return i def to_numeric_float(series): try: if not series.empty...
from bisect import bisect_right, bisect_left import numpy as np from metrics.classification_metric import ClassificationMetric class HoppingWindow(ClassificationMetric): __abbrev__ = "Hop. Window" __parts__ = 10 __steps__ = 6 # 2, 12, ..., 52 def __init__(self, parts=__parts__): super().__i...
# These are the libraries will be used for this lab. # Using the following line code to install the torchvision library # !conda install -y torchvision import torch import torch.nn as nn import torchvision.transforms as transforms import torchvision.datasets as dsets import torch.nn.functional as F import matplotlib....
# -*- coding: utf-8 -*- import backports.lzma as lzma import os import random import string import tarfile import base from docker_registry.lib import layers from docker_registry import storage from docker_registry.core import compat json = compat.json StringIO = compat.StringIO # from mock import patch # from moc...
import os import argparse import torch import torchvision import torchvision.transforms as transforms import numpy as np from simclr import SimCLR from simclr.modules import LogisticRegression, get_resnet from simclr.modules.transformations import TransformsSimCLR from utils import yaml_config_hook def inference(lo...
import torch import numpy as np from pathlib import Path from torch.utils.data import Dataset, DataLoader from matplotlib import colors, pyplot as plt from numpy.fft import rfft, irfft from scipy.io import wavfile import torchaudio # Set Audio backend as Sounfile for windows and Sox for Linux torchaudio.set_audio_...
"""Provides connection to SQLite extended with UDFs needed by Logica.""" import csv import io import sys import sqlite3 import heapq import json def DeFactoType(value): if isinstance(value, int) or isinstance(value, float): return 'number' else: return 'string' class ArgMin: """ArgMin user defined aggr...
# Copyright 2020 Google 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 writing, ...
# Copyright 2021 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 applica...
import asyncio import logging import traceback from discord.ext import commands from .bilibili_api import NotBilibiliVideo from .bilibili_downloader import BilibiliVideo logger = logging.getLogger(__name__) class VoiceEntry: def __init__(self, message, player): self.requester = message.author sel...
from collections import defaultdict from typing import Any, DefaultDict, Dict, List, Set import bokeh.io import bokeh.plotting import numpy as np from bokeh.layouts import column, LayoutDOM from bokeh.models import CustomJS, HoverTool, Slider from bokeh.plotting import ColumnDataSource from l5kit.visualization.visual...
from typing import List import torch import torch.nn as nn import torch.nn.functional as F from models.scene_seg_PAConv.lib.pointops.functions import pointops from models.scene_seg_PAConv.util import block class _PointNet2SAModuleBase(nn.Module): def __init__(self): super().__init__() self.npoin...
import numpy as np import itertools import matplotlib.pyplot as plt import csv import sys import math import geopy.distance def create_nodes_array(N, seed=None): """ Creates array of random points of size N. """ if seed: print("seed", seed) np.random.seed(seed) nodes_list = [] ...
# encoding: utf-8 # gen_attack.py """ Implementation of GenAttack from https://arxiv.org/abs/1805.11090 for Machines Can See contest (https://competitions.codalab.org/competitions/19090#learn_the_details) held by organizers of Machines Can See 2018 (http://machinescansee.com/) """ import numpy as np import torch import...
from __future__ import unicode_literals import re from .amp import AMPIE from .common import InfoExtractor class FoxNewsIE(AMPIE): IE_NAME = 'foxnews' IE_DESC = 'Fox News and Fox Business Video' _VALID_URL = r'https?://(?P<host>video\.(?:insider\.)?fox(?:news|business)\.com)/v/(?:video-embed\.html\?vide...
# # 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 us...
#!/usr/bin/python # import argparse import collections import io import json import re import subunit import testtools class UrlParser(testtools.TestResult): uuid_re = re.compile(r'(^|[^0-9a-f])[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-' '[0-9a-f]{4}-[0-9a-f]{12}([^0-9a-f]|$)') id_re = r...
from typing import Dict, Union, Any, Optional import lightgbm as lgb import numpy as np import pandas as pd from lightgbm import Booster, LGBMClassifier from pandas import DataFrame from titania.trainers.generic_managers import BaseModelManager class LightGBMTrainingManager(BaseModelManager): """ Training m...
# Copyright (c) 2015-2020 by the parties listed in the AUTHORS file. # All rights reserved. Use of this source code is governed by # a BSD-style license that can be found in the LICENSE file. import os import sys import itertools import numpy as np from ._libtoast import Logger from .pshmem import MPIShared, MPILo...
import scrapy from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from GitClosedPRWebCrawler.items import GitItem import csv import json from collections import defaultdict #################################### #### REMOVE BLANK LINES FROM CSV ### ###############################...
#!/usr/bin/env python3 import re import sys import argparse import pprint from nrf5_cmake.library_description import LibraryDescription from nrf5_cmake.library_operations import libraries_load_from_file, libraries_save_to_file from nrf5_cmake.example_operations import library_from_example, examples_load_from_file fro...
#!/usr/local/bin/python3 ''' This is the version of using Tensorflow Dataset, instead of Tensorflow Queue, which is referred to tensorflow-wavenet repo. ''' import sys import os import tensorflow as tf import abc # use abc module to implement abstract class attribute import librosa import fnmatch import re import num...
import os import asyncio from uuid import uuid4 from typing import List from inspect import isclass from pydantic import BaseModel import jsonsh.aiojson as aiojson class Instance: def __init__(self, folder, *, cache_state=False, cache_capacity=100): self.main_folder = folder aiojson.setcache(on=ca...
# -*- coding: utf-8 -*- """ CIRpy Python interface for the Chemical Identifier Resolver (CIR) by the CADD Group at the NCI/NIH. https://github.com/mcs07/CIRpy """ import os from six.moves import urllib from xml.etree import ElementTree as ET __author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '1.0' __license...
import numpy as np from datetime import datetime as dt from solver import Solver from cube import Cube import algorithms.tools as tl def analyze_cross(perm): cube = Solver(perm) n = 0 lens, times, = np.empty(6), np.empty(6) opens, closeds = np.empty(6), np.empty(6) rotations = {(0, 0, -1): "x", ...
# 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 fro...
# SPDX-License-Identifier: Apache-2.0 # # http://nexb.com and https://github.com/nexB/scancode.io # The ScanCode.io software is licensed under the Apache License version 2.0. # Data generated with ScanCode.io is provided as-is without warranties. # ScanCode is a trademark of nexB Inc. # # You may not use this software ...
"""General interface of the visualization building blocks""" import itertools import logging from typing import List import torch from torch import Tensor import midnite from ..base.interface import LayerSplit from ..base.interface import NeuronSelector log = logging.getLogger(__name__) class Identity(LayerSplit):...
import os from tkinter import * from utility.io_utils import read_pdf_and_docx sys.path.append(os.path.join(os.path.dirname(__file__), '..')) line_labels = {0: 'experience', 1: 'skills', 2: 'education', 3: 'project', 4: 'others', 5: 'language'} class AnnotatorGui(Frame): def __init__(self, master, table_content...
# Copyright (C) 2017-2019 New York University, # University at Buffalo, # Illinois Institute of Technology. # # 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 th...
from __future__ import unicode_literals import django from django.core.exceptions import ImproperlyConfigured from django.db import models, transaction, router from django.db.models.signals import post_save, pre_save from django.utils.translation import ugettext_lazy as _ from model_utils.fields import ( AutoCrea...
# -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: MapServer # Purpose: Test harnass for testing via Python MapScript. # Author: <NAME>, <EMAIL> # ############################################################################### # Copyright (c)...
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
import math import torch from torch import nn class RCNNCell(nn.Module): """ RCNN Cell Used in "Rationalizing Neural Predictions" (Lei et al., 2016) This is the bigram version of the cell. """ def __init__(self, input_size, hidden_size): """ Initializer. :param input_s...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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...
# -*- coding: utf-8 -*- """ Created on Thu May 14 19:42:09 2020 @author: rishi """ # import the usual resources import matplotlib.pyplot as plt import numpy as np # import utilities to keep workspaces alive during model training # watch for any changes in model.py, if it changes, re-load it automatic...
""" Small Domain Mapper testing app """ import logging from flask import Flask, request from flask_restplus import Api, Resource from domain_mapper import DomainMapper app = Flask(__name__) api = Api(app) m = DomainMapper(api) # configure logging format_str = "[%(levelname)7s: %(asctime)s] %(message)s" logging.basic...
__dosya__ = "veriler.txt" # 170401062 Yiğit # Dosya çalıştığında aşağıdaki main() fonskiyonu çalışır. def main(): cevaplar = list() veriler = verileriOku() print('Soru 1e geçiliyor...') yaklastir(1, veriler, cevaplar) yaklastir(2, veriler, cevaplar) yaklastir(3, veriler, cevaplar) yaklas...
#!/usr/bin/env python # coding: utf-8 from astropy.coordinates import SkyCoord from astroquery.ned import Ned from astroquery.exceptions import RemoteServiceError from astropy import units as u from nuztf.ampel_api import ampel_api_catalog, ampel_api_name def query_ned_for_z( ra_deg: float, dec_deg: float, searc...
# Copyright (c) 2014 Catalyst IT Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/env python """Provide a command line tool to validate and transform tabular samplesheets.""" import os import sys import errno import argparse import pandas as pd def parse_args(args=None): Description = "Reformat nf-core/metapep samplesheet file and check its contents." Epilog = "Example usage:...
from qqbot.utf8logger import DEBUG from qqbot import qqbotsched from random import choice from abotcommon import Context,send from abotcmd import toolProcess import re import datetime def onStartupComplete(bot): glist = bot.List('group', ':like:Android') for g in glist: bot.SendTo(g,'QQBot被神秘力量复活,复活时间:...
# Copyright 2021 The Kubric 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 w...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import BaseHTTPServer import os import threading class Responder(object): """Sends a HTTP response. Used with TestWebServer.""" def __init__(self, han...
from __future__ import annotations import datetime import typing from math import radians, pi import numpy as np from scipy.optimize import root_scalar from .core import BasicPassInfo, PassType from .functions import make_utc, visual_pass_details from .._time import datetime2mjd from ..constants import R_EARTH from ....
#!/usr/bin/env python3 # encoding: utf-8 """Format the ill-formatted code.""" ## ============================================== ## GOAL : Format code, Update headers ## ============================================== import argparse import logging import os import re import sys import datetime import subprocess from f...
from celescope.tools.utils import add_log, parse_match_dir import pysam import os import pandas as pd import editdistance parentDir = os.path.dirname(__file__) def read_mut(mut_file): mut_dic = {} df = pd.read_csv(mut_file, sep="\t") def convert_row(row): gene = row["gene"] mut_type = ro...
""" run decoding of rnn-ext + abs + RL (+ rerank)""" import argparse import json import os from os.path import join from datetime import timedelta from time import time from collections import Counter, defaultdict from itertools import product from functools import reduce import operator as op from cytoolz import iden...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, 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 # # Unl...
import sys import random class Point(): def __init__(self, x, y): self.x = int(x) self.y = int(y) def printPoint(self): return "("+str(self.x)+", "+str(self.y)+")" class Board(): def __init__(self): self.NONE, self.X, self.O = 0, 1, 2 self.game =[[0,0,0] for _ in ra...
""" Author : <NAME> : Automatic licence plate detection and recognition """ from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.externals import joblib from matplotlib import pyplot as plt import scipy.ndimage import numpy as np import cv2 import os d...
import itertools import json import logging import os import random import runpy import time from typing import Any, Dict, Optional, Union import numpy as np import sqlalchemy as sa import torch import torch.nn as nn import torch.onnx import torch.optim as optim import pagnn.models from pagnn import init_gpu, setting...
import csv import clcert_chachagen import json import requests import io import argparse import hmac import hashlib import datetime def esc(code): return f'\033[{code}m' def format_date(s): date = datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.000Z') return date.strftime('%d/%m/%Y %H:%M:%S UTC') par...
import difflib import re from regparser.layer.graphics import Graphics from regparser.tree import struct INSERT = 'insert' DELETE = 'delete' REPLACE = 'replace' EQUAL = 'equal' def hash_nodes(reg_tree): """ Create a hash map to the nodes of a regulation tree. """ tree_hash = {} def per_node(node): ...
# coding: utf-8 # Copyright (c) Scanlon Materials Theory Group # Distributed under the terms of the MIT License. """ Module providing helper functions for generating k-points along a path. """ import sys import logging def get_path_data(structure, mode='bradcrack', symprec=0.01, spg=None, line_dens...
import hashlib import secrets import urllib.parse as urllib from django.contrib.auth.models import User from django.db import models from django.core import validators, exceptions from django.db.models.query import Q from django.utils import timezone from assets.models import Asset, VisualAsset # extension to djang...
import torch from torch import nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from modules.config import AppConfig from modules.hopfieldlayers import Hopfield, HopfieldPooling, HopfieldLayer from modules.utils.pad_sequences import get_seq_length_from_padded_seq class HopfieldLayerModel(n...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, argparse import numpy as np import xml.etree.ElementTree as ET from tqdm import tqdm from collections import OrderedDict sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test'), ('2012', 'train'), ('2012', 'val')] classes = ["aeroplane", "bicycle", "bird", "...
import time from threading import Event, Thread from donkey_gym.envs.vae_env import DonkeyVAEEnv from stable_baselines.common.vec_env import DummyVecEnv, VecNormalize, \ VecFrameStack from stable_baselines.bench import Monitor from donkeycar.parts.controller import PS3JoystickController from config import ...
# Import necessary libraries from random import shuffle class Suit: "Defines the unicode character for each suit: heart, club, diamond, spade." def __init__(self): "Initialize a new object with suit attributes." self.create_suits() def create_suits(self): "Create attributes to a...
""" collection of utility functions """ # Copyright (c) 2011 Yubico AB # See the file COPYING for licence statement. import struct __all__ = [ # constants # functions 'hexdump', 'group', 'key_handle_to_int', # classes ] import pyhsm.exception def hexdump(src, length=8): """ Produce a st...
""" Copyright (c) 2016-2020 The scikit-optimize developers. All rights reserved. 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 cond...
""" Programmer: <NAME> Purpose: Implementing the NMF techniques in [1], as well as plotting utilities [1] Driedger, Jonathan, <NAME>, and <NAME>. "Let it Bee-Towards NMF-Inspired Audio Mosaicing." ISMIR. 2015. """ import numpy as np import scipy.io as sio import scipy.ndimage import matplotlib.pyplot as plt import ti...
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2014 the Critic contributors, Opera Software ASA # # 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/LI...
""" API request handlers for managing and querying HMM data. """ import aiohttp from aiohttp.web_exceptions import ( HTTPBadGateway, HTTPBadRequest, HTTPConflict, HTTPNoContent, ) from aiohttp.web_fileresponse import FileResponse import virtool.hmm.db from virtool.api.response import NotFound, json_re...
import glob import itertools import logging import os import re import click import numpy as np import pandas as pd import pyspiel from open_spiel.python import rl_agent, rl_environment from open_spiel.python.policy import TabularPolicy, tabular_policy_from_policy def tabular_policy_from_csv(game, filename): cs...
#<pycode(py_typeinf)> import ida_idaapi ida_idaapi._listify_types( reginfovec_t) #</pycode(py_typeinf)> #<pycode_BC695(py_typeinf)> BFI_NOCONST=0 BFI_NOLOCS=0 NTF_NOIDB=0 PRVLOC_STKOFF=PRALOC_VERIFY PRVLOC_VERIFY=PRALOC_STKOFF TERR_TOOLONGNAME=TERR_WRONGNAME @bc695redef def add_til(name, flags=0): return _id...
# Copyright (c) 2022, NVIDIA CORPORATION. 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 appli...
# Copyright 2016 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 app...
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # @Author: oesteban # @Date: 2016-01-05 11:29:40 # @Email: <EMAIL> # @Last modified by: oesteban """ Visualization interfaces """ from __future__ import ...
import frappe from frappe.model.document import run_webhooks from latte.model.document import get_controller from functools import wraps from latte.utils.caching import cache_in_mem, cache_me_if_you_can import sys from frappe import local class Registry(object): @staticmethod def generate_handler(doctype, event): ...
""" ddupdate plugin updating data on cloudflare.com. See: ddupdate(8) See: https://api.cloudflare.com """ REQUESTS_NOT_FOUND = """ The Cloudflare plugin uses the python3-requests package which cannot be found. Please install python-requests or python3-requests. Giving up. """ try: from requests import Request,...
# -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 TU Wien. # # Invenio-Utilities-TUW is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Management commands for files.""" from collections import defaultdict import click from flask...
#! python3 import re import binascii import requests import csv import requests import json def cleannone(val): if val is None: val = ''; return val addressPattern = re.compile(r'<span style="padding-left:10px;">(.+)</span>') def get_ja_address(url): res = requests.get( url ) address = ''; ...
#!/usr/bin/env python # Copyright 2010 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...
from pyramid.paster import get_app import logging import json import time # DEBUG: timing from ..regulome_indexer import ( SUPPORTED_CHROMOSOMES, REGULOME_SUPPORTED_ASSEMBLIES ) from ..regulome_atlas import ( RegulomeAtlas ) from snovault.elasticsearch.interfaces import ( SNP_SEARCH_ES ) EPILOG = __...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # # /ai4e_api_tools has been added to the PYTHONPATH, so we can reference those # libraries directly. import json from flask import Flask, request, abort from ai4e_app_insights_wrapper import AI4EAppInsights from ai4e_service ...
import os,sys import torch import math import torch.nn as nn import torch.nn.functional as F from torch_connectomics.model.blocks import * class unetv1(nn.Module): def __init__(self, in_channel=1, out_channel=3, filters=[32,64,128,256,256]): super().__init__() # encoding path self.layer1_...