text stringlengths 6.04k 39.5k |
|---|
'''
Core image processing tools.
ETA uses OpenCV for some of its image-related processing. OpenCV stores its
images in BGR format. ETA stores its images in RGB format. This module's
contract is that it expects RGB to be passed to it and RGB to be expected from
it.
Copyright 2017-2018, Voxel51, LLC
voxel51.com
<NA... |
# =========================================================================
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (C) 2021. The Chinese University of Hong Kong. All rights reserved.
#
# Authors: <NAME> <The Chinese University of Hong Kong>
# <NAME> <Huawei No... |
"""Main file for search.
KD from RefineNet-Light-Weight-152 (args.do_kd => keep in memory):
Task0 - pre-computed
Task1 - on-the-fly
Polyak Averaging (args.do_polyak):
Task0 - only decoder
Task1 - encoder + decoder
Search:
Task0 - task0_epochs - validate every epoch
Task1 - task1_epochs - validate every e... |
__all__ = [
# Machine nodes
"Node"
, "CPUNode"
, "BusNode"
, "SystemBusNode"
, "PCIExpressBusNode"
, "ISABusNode"
, "IDEBusNode"
, "I2CBusNode"
, "IRQLine"
, "IRQHub"
, "DeviceNode"
, "SystemBusDeviceNode"
, "PCI... |
# Copyright 2020 Huawei Technologies 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
#
# Unless required by applicable law or agreed to... |
# -*- test-case-name: xquotient.test.test_mimepart -*-
import itertools
import quopri, binascii, rfc822
from zope.interface import implements
from twisted.python import log
from epsilon.extime import Time
from axiom import item, attributes, iaxiom
from xquotient import mimepart, equotient, mimeutil, exmess, iquot... |
import os
import re
import shutil
import demistomock as demisto # noqa: F401
import requests
from CommonServerPython import * # noqa: F401
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
VERSION = "v1.0.1"
USER_AGENT = "ReversingLabs... |
"""
This file contains the logic to generate the master dataset for the INDDEX reports
Overview
--------
Beneficiaries are asked about their diet in a "recall" session. This results in
a "foodrecall" case. Every food they mention results in the creation of a "food"
case that's a child of this foodrecall.
This dataset... |
# Copyright: © 2018 SIL International.
# Description: Lowlevel C style python API. Intended to be wrapped by a more
# Pythonic higher level API.
# Create Date: 18 Oct 2018
# Authors: <NAME> (TSE)
#
import ctypes
import ctypes.util
import operator
import os
from enum import auto, IntEnum, IntFla... |
"""High level parallel SNP and indel calling using multiple variant callers.
"""
import os
import collections
import copy
import pprint
import toolz as tz
from bcbio import bam, utils
from bcbio.cwl import cwlutils
from bcbio.distributed.split import (grouped_parallel_split_combine, parallel_split_combine)
from bcbio... |
from __future__ import absolute_import, division, print_function
import numpy as np
from itertools import count
import re
try:
from cytoolz import concat, merge, unique
except ImportError:
from toolz import concat, merge, unique
from .core import Array, asarray, atop, getitem
from .. import sharedict
from ..... |
import brica
import tensorflow as tf
import numpy as np
import random
import os
STEP_THRE = 10000
ESP_START = 0.7
ESP_END = 0.0
#--Env---------------------------------------------------------------------------
class Environment(object):
def __init__(self, fef_data, action_space):
self.fef_data = fef_data
... |
import pandas as pd
import generator_labeler.ExecutionPlanAnalyzer as EPAnalyzer
from IPython.display import display
import numpy as np
from scipy.stats import kurtosis, skew
import matplotlib.pyplot as plt
import seaborn as sns
import networkx as nx
import re
####################
## Table features ##
#############... |
#! /usr/bin/env python3
## import modules
from Bio import Entrez
from Bio.SeqIO import FastaIO
from tqdm import tqdm
from urllib.error import HTTPError
import time
from Bio import SeqIO
from Bio.Seq import Seq
import subprocess as sp
import os
from string import digits
import codecs
## functions NCBI
def wget_ncbi(... |
import os
import random
import logging
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
import numpy as np
from math import ceil, floor
from distutils.version import LooseVersion
from tensorboardX import SummaryWriter
from torchvision.u... |
# coding=utf-8
# Copyright 2019 The Google Research 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 applicab... |
#!/bin/python3
# ISO.org scrapper.
# Extracts a full list of country codes as specified in the ISO-3166,
# fetching the data from the Vaadin webap server located at:
# https://www.iso.org/obp/ui/UIDL
import os
import requests
import json
from copy import deepcopy
MAX_COUNTRY_CODES = 300 # Max limit of countries to ... |
# -*- coding: utf-8 -*-
""""
"""
from collections import namedtuple
from objects.seismic.rays import BoundaryType
from objects.seismic.waves import OWT
from fmodeling.seismic.dynamic.zoeppritz_coeffs import pdownpup, svdownsvup, pdownsvup
from fmodeling.seismic.dynamic.zoeppritz_coeffs_water import pdownpup_water
from ... |
"""Classes to work with sam and bam files"""
import struct, zlib, sys, re, itertools
from collections import namedtuple
import seqtools.format.sam
from seqtools.format.sam.header import SAMHeader
#from seqtools.sequence import rc
from cStringIO import StringIO
from string import maketrans
_bam_ops = maketrans('01234567... |
from tag import *
from tkinter.ttk import *
from tkinter import *
from PIL import ImageTk, Image
import threading
from time import sleep
import math
import datetime
import csv
minDistance = 5
t1name = "<NAME>"
t2name = "<NAME>"
t3name = "<NAME>"
t4name = "<NAME>"
t5name = "<NAME>"
t6name = "<NAME>"
nanCounts = [0,0... |
import uuid
from html import escape
from typing import Union, Optional, Iterable
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.query import QuerySet
from django.template import Library
from django.utils.safestring import mark_safe
from annotation.manual_variant_ent... |
import torch
import torch.nn.functional as F
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor, FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
from torchvision.models.detection.anchor_utils import AnchorGenerator
from torchvision.ops import... |
import pytest
import numpy as np
from file_handler import FileHandler
from filtered_signal import FilteredSignal
from detection_algorithm import ECGDetectionAlgorithm, Threshold
@pytest.fixture()
def test_1_data():
"""Normal signal, with noise"""
metrics = {"num_beats": 35, "duration": 27.775, "voltage_extrem... |
# cheese
import pygame as p
from math import cos, sin, radians # needed for turning the player
from os import path
from random import randint
p.font.init() # inialises pygame fonts
WIDTH, HEIGHT = 750, 750 # This will change depending on which machine it was being programmed
SHIP_SIZE_X, SHIP_SIZE_Y = 50, 50
DIS = p.d... |
import os
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import scipy.signal
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import LeaveOneGroupOut
def LoadWristPPGDataset():
"""Load the Wrist PPG Dataset.
Found on Physionet at https://p... |
import json
import random
import time
import traceback
import datetime
from urllib.parse import urljoin
import hydra_notebook
import os
import requests
from asgiref.sync import async_to_sync
from celery import shared_task, Task, task
from celery.utils.log import get_task_logger
from channels.layers import get_channe... |
"""
Common statistics from bag-of-words (BoW) matrices.
"""
import numpy as np
from scipy.sparse import issparse
from deprecation import deprecated
from .._pd_dt_compat import pd_dt_frame, pd_dt_concat
@deprecated(deprecated_in='0.9.0', removed_in='0.10.0',
details='This function was renamed to `doc_len... |
import numpy as np
import math
import argparse
import networkx as nx
import matplotlib.pyplot as plt
import itertools
parser = argparse.ArgumentParser()
parser.add_argument("-i", help="input file to process (path of results)")
parser.add_argument("-g", help="input file with graphs")
parser.add_argument("-o", help="outp... |
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.core.mail import EmailMultiAlternatives
from django.shortcuts import redirect, render
from django.utils.decor... |
from builtins import zip
import numpy as np
from .baseMetric import BaseMetric
__all__ = ['NChangesMetric',
'MinTimeBetweenStatesMetric', 'NStateChangesFasterThanMetric',
'MaxStateChangesWithinMetric',
'TeffMetric', 'OpenShutterFractionMetric',
'CompletenessMetric', 'FilterC... |
"""Text-record tools
"""
from array import array as Array
from binascii import hexlify, unhexlify
from io import BytesIO, StringIO
from os import stat, linesep, SEEK_END, SEEK_SET
from re import compile as re_compile
from struct import pack as spack
from .misc import group
from .term import is_term
# pylint: disable... |
#
# 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... |
#Integration testing for watershed deliniation
import traceback
import datetime
import time
import os
import argparse
import fnmatch
import json
import threading
from WIMLib.WiMLogging import WiMLogging
from WIMLib import Shared
from WIMLib.Config import Config
from ServiceAgents.StreamStatsServiceAgent import StreamSt... |
#
# Copyright (c) 2018, Salesforce, Inc.
# 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 an... |
""" Tools for building detector style neural nets
Subclass :py:class:`DetectorBase` implement :py:func:`make_detector`
API Documentation
-----------------
"""
# Imports
# Standard lib
import time
import json
import pathlib
import datetime
import traceback
import inspect
from typing import Optional, Dict, Callable
... |
import os
import sys
import warnings
from collections import defaultdict
from multiprocessing import cpu_count
from cytomine.models import Annotation, ImageInstance, ImageSequenceCollection, AnnotationCollection, Property
from cytomine.models.image import SliceInstanceCollection
from cytomine.models.track import Trac... |
import os
import shutil
import itertools
import numpy as np
import torch
import torchvision.models as models
import pretrainedmodels
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from torch.autograd import Variable
from random import shuffle
from torchvision import transforms
from torch.utils.... |
import pytest
def test_bgp_sr_te_policy_v4v6(api):
"""
Test BGP SRTE Policy V4V6 configuration applied properly on ixNetwork
Validate the configuration against RestPy
"""
BGPV4_SR_TE = {
"PolicyType": "ipv4",
"Distinguisher": 2,
"PolicyColor": 2,
"EndPointV4": "10... |
from flask import Blueprint, jsonify, request, send_file, session, Response
import csv
from uuid import uuid4
from tsx.api.util import db_session, get_user, get_roles
from tsx.api.permissions import permitted
from tsx.config import data_dir
import os
from threading import Thread, Lock
import shutil
import subprocess
im... |
# \brief Calculates the symbolic expression of the muscle moment arm for an
# OpenSim .osim model. The moment arm is sampled and approximated by a
# multivariate polynomial, so that higher order derivatives can be
# computed. This implementation works with OpenSim v3.3 API.
#
# Dependencies: opensim, matplotlib, num... |
#!/usr/bin/env python
"""
Generic python script.
"""
__author__ = "<NAME>"
import sys
import os
import glob
import yaml
import numpy as np
import healpy as hp
import scipy.interpolate
import simple_adl.survey
import simple_adl.isochrone
from simple_adl.coordinate_tools import distanceModulusToDistance, angsep
#-----... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import os
from typing import (
Iterator,
Any,
Callable,
Dict,
Iterable... |
# Get Python six functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from builtins import zip
import six
import warnings
warnings.filterwarnings("default", category=DeprecationWarning)
###############################################################################
###... |
"""Use this for combining rollouts together.
For individual runs, see `scripts/plot_rollouts.py`.
For the 'DAgger improvement over BC phase', I just used this:
In [9]: e1
Out[9]: [88.45, 94.84]
In [10]: e2
Out[10]: [89.43, 89.56]
In [11]: e3
Out[11]: [84.26, 91.24]
In [12]: e4
Out[12]: [76.69, 84.... |
__author__ = "<NAME>"
__version__ = "0.1"
from contextlib import contextmanager
from collections import namedtuple
import gc
import numpy as np
import gleam.matplotlibparams
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.inset_locator imp... |
import sys
import os.path as op
sys.path.append(op.abspath(op.join(op.dirname(__file__),"..")))
from __plugin__ import Plugin as _P
from __plugin__ import publicFun
from PySide2 import QtCore, QtWidgets, QtGui
import re
from collections.abc import Sequence
import inspect
from . import parsers
from .parsers import *
imp... |
"""Utility functions for the prover.
This module contains various utility functions that can be shared between
various theorem prover objects and other helper utilities.
"""
from __future__ import absolute_import
from __future__ import division
# Import Type Annotations
from __future__ import print_function
import ti... |
# Copyright 2019 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 unreal
import datetime
import sys
import json
import os
from datetime import datetime as dt
#My Library
import UtilObserver as uo
#pip install PySide2
from PySide2 import QtWidgets, QtCore, QtGui
#pip install websocket-client
from websocket import create_connection
Json_RequestCheckMap =\
{
"MessageN... |
"""
By <NAME>, Nov 27, 2019
"""
from .AStar import AStartPath
from .DistanceField import DistanceField, logging, np, embed
from typing import List, Union
import math
from scipy import interpolate
logger = logging.getLogger(__name__)
class Planner:
def __init__(self, learn_rate: float = 0.001, resolution=0.1, max... |
#!/usr/bin/env python
from peyotl.utility.dict_wrapper import FrozenDictAttrWrapper, FrozenDictWrapper
from peyotl.api.taxon import TaxonWrapper, TaxonHolder
from peyotl.utility import get_config_object, get_logger
from peyotl.api.wrapper import _WSWrapper, APIWrapper
import weakref
import anyjson
_LOG = get_logger(__... |
from __future__ import annotations
import datetime
import logging
import pytest
import re
import os
import xml.etree.ElementTree as ET
from lxml import etree
from . import elements_equal
from relaton_bib import BibliographicItem, BibliographicItemType
from relaton_bib import Address
from relaton_bib import Contact
f... |
from firedrake import *
import numpy as np
import math,sys
from Limiter.flux_limiter import *
import time as tm
formulation = sys.argv[1]
save_itr = 2
T = 800
num_steps = T*save_itr
dt = T / num_steps # time step size
#=====================================;
# Create mesh and identify boundary ;
#==================... |
from __future__ import annotations
import dataclasses
import html
import json
import logging
import os
import re
import shlex
import shutil
import subprocess
import sys
import textwrap
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field
from enum import En... |
import copy
import heapq
import typing
import argparse
import math
class SlidingPuzzle:
"""
Is used to manipulate square sliding puzzle.
It uses a Manhattan heuristic to solve the puzzle.
"""
def __init__(self, *args, **kwargs):
"""
Is used to build a sliding puzzle.
Thr... |
#!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
import neural_network_lyapunov.examples.pendulum.pendulum as pendulum
import neural_network_lyapunov.utils as utils
import neural_network_lyapunov.feedback_system as feedback_system
import neural_network_lyapunov.lyapunov as lyapunov
import neural_network_lyapunov.train_lyapunov as train_lyapunov
import neural_network_... |
#!/usr/bin/env python
'''
Generates SIPS by calling various microservices and functions.
'''
import os
import argparse
import sys
import shutil
import datetime
import copyit
import ififuncs
import package_update
import accession
import manifest
from masscopy import analyze_log
try:
from clairmeta.utils.xml import p... |
import os
import time
import json
from cryptography.fernet import Fernet as fn
from ftplib import FTP
ver_control = 0
software_name = 0
creator = 0
def globalVariable(ver="v1.1.0", soft_name="Project Ultra Backup", author="Anjal.P"):
global ver_control, software_name, creator
ver_control = ver
software_n... |
"""Low-level API for saving/loading responses from FE simulation.
This API is based on the 'bridge_sim.model.SimParams' class.
"""
from __future__ import annotations
import itertools
import os
from collections import deque
from copy import deepcopy
from timeit import default_timer as timer
from typing import Callab... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import datetime
from frappe import _
from datetime import datetime, timedelta, date, time
from club_crm.club_crm.utils.sms_notification import se... |
# Copyright (c) 2021 Agenium Scale
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dist... |
import datetime
from collections import namedtuple
from itertools import groupby
import arrow
import django.db.models as djdbm
import pytz
from django.db.models import Prefetch
from django.utils import timezone
from django.utils.dateformat import format
from psycopg2.extras import DateRange, DateTimeTZRange
from .mod... |
# ___________ ____ ___ __ _ _ _
### MAIN
# ___________ ____ ___ __ _ _ _
# ______________________________________________________________________________
# %% imports
import glob
import os.path
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from PIL import Image
from osgeo import o... |
r"""
calculate the paras similarity score matrix for given english text and chinese text
refer to playground\xxx-similarity\xxx_wu_ch3_proc.py
"""
from typing import List, Optional, Union
import os
import sys
from pathlib import Path
import re
import numpy as np
import pandas as pd # pylint: disable=unused-import
... |
from .argument import Argument, ArgSession
from ..responses import ResponseMsg
import requests, datetime, json, time, threading, traceback
COOKIE_STR = 'sepuser="123== "; vjuid=123; vjvd=123; vt=123'
COOKIE = {'Cookie': COOKIE_STR}
# 2021-12-06: 加入新的填报信息、多线程申报
# 2021-12-10: 适配类别1(集中教学)申报
def get_idendit... |
# Playing with the parameters of a classical SEIR models
# <NAME>, 20 February 2021, MIT-LICENSE
# The parameters are taken from the story from <NAME> about Hobbeland
# https://twitter.com/MinaCoen/status/1362910764739231745
# Alfa : 0.3333 / Beta : 1.25 / Gamma : 0.5 / R0 : 2.5
# If there are strange results, just cha... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
'''
This is an extra tool, not bundled with the default waf binary.
To add the boost tool to the waf file:
$ ./waf-light --tools=compat15,boost
or, if you have waf >= 1.6.2
$ ./waf update --files=b... |
"""
Parses the DUC 2001 single- and multi-document summarization datasets. These
correspond to task 1 and task 2 from the competition. There are several peculiarities
about the dataset which we have tried to address, but it's possible we did not
get everything.
"""
import argparse
import lxml.html
import os
import re
i... |
import numpy as np
import xarray as xr
# import analysis_tools.area_pkg_sara
from oas_erf.util.imports.get_fld_fixed import get_field_fixed
from oas_erf.util.imports.import_fields_xr_v2 import import_constants
from oas_erf.util.slice_average import area_mod
#from oas_erf.util.slice_average.avg_pkg import maps
# import ... |
"""
File: 2048_Game
Author: <NAME> , <NAME>
Date: 28.12.2018
This is a game of 2048 to be played on the Raspberry SenseHAT.
"""
# Importation des modules requis
from sense_hat import SenseHat
from random import randint
from time import sleep
from time import time
import games
sense = SenseHat()
sense.clear(0, 0, 0)
... |
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from asyncio import Future, InvalidStateError, ensure_future, gather, get_event_loop
from collections import defaultdict
from dataclasses import dataclass, field, replace
from da... |
from ..base import Option as _Option
from ..vanillaoptions import GreeksFDM as _GreeksFDM
import numpy as _np
from scipy.optimize import minimize as _minimize
from scipy.stats import norm as _norm
from dataclasses import dataclass
from scipy.integrate import quad as _quad
# from .hnGARCH import *
# def _HNGCharacteris... |
#!/usr/bin/env python
import inspect
import logging
import random
import sqlite3
import threading
import time
from typing import List, Optional, Dict, Callable, Tuple
from raft_messages import AppendEntriesMessage, VoteMessage, DbEntriesMessage
from raft_state_machine import StateMachine, DummyStateMachine
from raft_p... |
"""
this code is borrowed from https://github.com/jh-jeong/ContraD with few modifications
MIT License
Copyright (c) 2021 <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 restrictio... |
#!/bin/env python
"""Train a GAN.
Usage:
* Train a MNIST model:
`python train_gan.py`
* Train a Quickdraw model:
`python train_gan.py --task quickdraw`
"""
import argparse
import os
import numpy as np
import torch as th
from torch.utils.data import DataLoader
import ttools
import ttools.interfaces
import losse... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2020"
__version__ = "1.4"
__email__ = "<EMAIL>"
__status__ = "Production"
import datetime
from dateutil import tz
import os
import time
from shutil import copy2
print(f'events-from-html.py v.{__version__}')
# Last edited 2020-Apr-25 09:10
if os.path.isd... |
from moz_sql_parser import parse
#from sql_formatter import format
import json
# encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: <NAME> (<... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 15 21:18:26 2019
@author: <NAME>
"""
import time
import pandas as pd
from collections import Counter
import requests
from lxml import etree
from collections import namedtuple
from .publication import SSSPublication
class ScholarMiner:
def __init__(self, filename_pr... |
#!/bin/sh
'''which' python3 > /dev/null && exec python3 "$0" "$@" || exec python "$0" "$@"
'''
#
# Copyright (c) 2019, <NAME>
# This file is licensed under the terms of the MIT license.
#
#
# Tapping IEEE-802.11 Packet Sniffer on the Socks
#
import os, sys, socket, time, signal, argparse, enum, datetime
# ---------... |
#!/usr/bin/env python3
# Phoenix BIOS Dump
# 2021-09-29 version 0.1
# Copyright (c) 2021 @marbocub
# Released under the MIT license
# https://opensource.org/licenses/mit-license.php
import sys, os, io, struct, ctypes, copy
class MicrocodeImage():
class IntelMicrocodeHeader(ctypes.LittleEndianStructure):
_... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
from typing import Dict, Tuple
from yacs.config import CfgNode
import torch
import torch.nn as nn
from models.backbone.yolov4_p5 import Yolov4P5BackBone
from models.detector import Detector
from models.head.yolov4_head import Yolov4Head
from models.neck.yolov4... |
# OpenGym CartPole-v0 with A3C on GPU
# -----------------------------------
#
# A3C implementation with GPU optimizer threads.
#
# Made as part of blog series Let's make an A3C, available at
# https://jaromiru.com/2017/02/16/lets-make-an-a3c-theory/
#
# author: <NAME>, 2017
import numpy as np
import tensorf... |
#
# MIT License
#
# Copyright (c) 2020 <NAME>, @pablintino
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... |
"""MIT License
Copyright (c) 2019, 2020 Stanford Future Data Systems
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mod... |
#!/usr/bin/env python3
# Copyright 2017-18 TransitCenter http://transitcenter.org
# 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 requ... |
# ============================================================================
# main.py -- Linear Amorphous Thermoplastic CHain builder top level functions
# ----------------------------------------------------------------------------
# Author: <NAME>, <NAME>, Purdue University
# Copyright (c) 2012 Purdue University
#... |
#!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Trans... |
from collections import namedtuple
from copy import copy
from datetime import datetime, timedelta
import logging
import re
import discord
import typing
from discord.ext import tasks
from redbot.core import Config, commands, checks
from redbot.core.utils.chat_formatting import box
logger = logging.getLogger("red.RedAp... |
#!/bin/env python
import os
# from compile import *
import time
import numpy as np
import pandas as pd
import csv
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from scipy.stats import linregress
################### GLOBALS ###############################################... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Bootstraps a new miniconda installation and prepares it for development."""
import glob
import logging
import os
import platform
import shutil
import subprocess
import sys
import time
_BASE_CONDARC = """\
add_pip_as_python_dependency: false #!final
always_yes: true ... |
# Copyright (c) 2011 - 2017, 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 agre... |
# Various tools around backups, mostly to get info about them.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from flask import current_app, json
from glob import glob
from datetime import datetime, timedelta
import subprocess
import os
import pwd
import gr... |
# -*- coding: utf-8 -*-
'''
This module provides classes to store CapsulEngine settings for several execution environment and choose a configuration for a given execution environment. Setting management in Capsul has several features that makes it different from classical ways to deal with configuration:
* CapsulEngi... |
from typing import Tuple, List, Union
import math
import os
import re
import numpy as np
import tqdm
from scipy.linalg import sqrtm
import torch as th
import torchvision
import lpips
import PIL
import cv2
class AugmentPipe(th.nn.Module):
"""Adaptive Discriminator Augmentation. Only do gaussian noise and drop ou... |
# Copyright 2020 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
import numpy as np
import pandas as pd
from postprocess.image_process import get_image_file_names
def remove_on_size(gfrc_windows):
too_small = int(0.75*11)
too_big = int(1.25*163)
area_too_small = int(0.75*319)
area_too_big = int(1.25*24287)
gfrc_windows['xside'] = gfrc_windows.xmx - gfrc_windo... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, bleader
# Written by bleader <<EMAIL>>
# Based on pkgin module written by <NAME> <shaun.zinck at g<EMAIL>>
# that was based on pacman module written by Afterburn <https://github.com/afterburn>
# that was based on apt module written by <NAME> <<EMAIL>>
#
# GNU Gene... |
from __future__ import print_function, division, absolute_import
import numpy as np
from keras.preprocessing.image import Iterator
from scipy import linalg
from scipy.signal import resample
import keras.backend as K
import warnings
from scipy.ndimage.interpolation import shift
class NumpyArrayIterator(Iterator):
... |
#!/usr/bin/python3
#
# Copyright (c) 2011, Novell Inc.
#
# This program is licensed under the BSD license, read LICENSE.BSD
# for further information
#
import solv
import sys
import os
import tempfile
import time
import re
from urllib import request
#import gc
#gc.set_debug(gc.DEBUG_LEAK)
class repo_generic(dict):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.