text
stringlengths
3.07k
22.1k
# Copyright 2019 The WPT Dashboard Project. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import unittest from unittest.mock import call, patch from werkzeug.datastructures import MultiDict import test_util import wptreport from...
import json import pickle import numpy as np import argparse from pathlib import Path from scipy.special import softmax import csv import statistics import sys import os from functools import partial import math sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))) import decim...
#!coding:utf8 #author:yqq #date:2019/12/26 0026 17:28 #description: EOS 相关的handler import logging import eospy import eospy.keys import pytz import json import sql import re from base_handler import BaseHandler from utils import decimal_default, get_linenumber from eospy.types import Transaction fr...
import base64 from datetime import datetime from io import BytesIO from http import HTTPStatus import pyotp import qrcode import six from django.conf import settings from django.db import transaction from django.http import HttpResponse from django.utils import timezone from django.utils.crypto import salted_hmac fro...
#extract_baseline_features.py from __future__ import unicode_literals import time, sys, ast from isc_tokenizer import Tokenizer from isc_tagger import Tagger from nltk import ngrams, pos_tag import numpy as np from collections import Counter#collections in python 3 import vocab_helpers as helper import pre_processing ...
from copy import deepcopy import jsonschema from django.contrib.postgres.fields.jsonb import JSONField from django.core import exceptions from django.db import DataError, connection, models from prettytable import from_db_cursor from rest_framework import exceptions from .utils import DefaultValidatingDraft4Validator...
#!/usr/bin/python from __future__ import print_function import argparse import hashlib import json import logging import os import pipes import sys READ_SIZE = 1024 * 4 if not sys.version_info > (3, 0): if not hasattr(sys, 'setdefaultencoding'): reload(sys) sys.setdefaultencoding('utf8') class Erro...
#!/usr/bin/env python3 # run: "python cveta.py" or "python3 cveta.py" # # requires: # python3 --> python --version to check or use python3 if have both # urllib for py3 -->pip3 install urllib # beautifulsoup for py 3 -> sudo pip3 install --upgrade beautifulsoup4 # # TO DO :analize pkg: option to enter a pckg name, outp...
""" Slack chat bot for secret santa """ from functools import lru_cache from operator import attrgetter from math import ceil import tabulate from jinja2 import Environment, FileSystemLoader, select_autoescape from sqlalchemy import Table, Column, Integer, String, Boolean, DateTime, \ Sequence, ForeignKey from...
#! /usr/bin/env python import os import pdb import time import yaml import json import random import shutil import argparse import numpy as np from collections import defaultdict # torch import torch import torch.nn as nn import torch.nn.functional as F from utils import AverageMeter from solvers import Solver __all...
import cv2 import copy import xxhash import numpy as np import imgui import OpenGL.GL as gl from .static_vars import * from timeit import default_timer as timer from . import imgui_ext import math from typing import * from dataclasses import dataclass _start = timer() USE_FAST_HASH = True LOG_GPU_USAGE = False """ ...
import logging from numpy import random import pajbot.models from pajbot.modules import BaseModule from pajbot.modules import ModuleSetting from pajbot.modules import QuestModule log = logging.getLogger(__name__) class Samples: valid_samples = { '4head': { 'length': 0 }, '4header': { 'l...
""" Run transfer learning on FashionProductImages dataset. This will first fine-tune a chosen model from the ImageNet model zoo on classifying the 20 most common product and then in a second pass will fine-tune the network further on the remaining, less common, product classes. """ import os import random import time i...
#!/usr/bin/python #coding:utf-8 ########################################################### ### A Python wrapper of Plexon.h ### Written by Huangxin ########################################################### import logging # available in Python 2.3 import logging.handlers ############# Logging ############# logge...
# # 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...
import random import itertools import argparse import time import copy class Playgame_vscode: def __init__(self,ans=None,mode="manual") -> None: self.digits = 5 self.count = 0 self.history = [] self.list_num_place = [] self.list_possible_ans_combination = [] self.lis...
import numpy as np import math import random import matplotlib.pyplot as plt # ref : http://outlace.com/rlpart3.html # TODO : add ploting method class QAgent: # TODO : inherit from some RL classes which implement alpha , gamma , etc and delete them from constructor # TODO : make growing strategy...
# coding=utf-8 # Copyright 2020 EM-NAT 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 agr...
from __future__ import print_function import click import json import os import cobra import re from gsmodutils.utils import StringIO class ParseError(Exception): pass def load_scrumpy_model(filepath_or_string, name=None, model_id=None, media=None, objective_reactions=None, obj_dir='mi...
from .base import AbstractDataloader from .negative_samplers import negative_sampler_factory import torch import torch.utils.data as data_utils class BertUserMtlDataloader(AbstractDataloader): def __init__(self, args, dataset): """ This is the data loader class for the personalised bidirectional ...
import urllib3 from MicrosoftApiModule import * urllib3.disable_warnings() OUTPUTS_PREFIX = "AADIdentityProtection" BASE_URL = 'https://graph.microsoft.com/beta' REQUIRED_PERMISSIONS = ( 'offline_access', # allows device-flow login 'IdentityRiskEvent.Read.All', 'IdentityRiskyUser.ReadWrite.All' ) DATE_FO...
""" This module abstract a single work date and deals with all the aspects of extracting data and meta data about and from this specific date: gps data, determining if work day, holiday etc. """ import os import datetime as dt import platform from random import randint from math import isclose import subprocess import...
import argparse import os import sys import codecs import gzip import time from operator import itemgetter from process_dict import * def clean_exit(config): """ Triggers a clean exit, with removal of in-process files, when Control-C is pressed. """ print("Canceling!\nRemoving partial files.\n") cleanup(c...
# Copyright IBM All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # ----------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------- # OptimizationEngine # -------------------------------------------------...
####################################################### #Reference: https://github.com/experiencor/keras-yolo3# ####################################################### import numpy as np import os import cv2 from scipy.special import expit class BoundBox: def __init__(self, xmin, ymin, xmax, ymax, c = None, class...
# coding: utf-8 # Copyright (c) Materials Virtual Lab # Distributed under the terms of the BSD License. from __future__ import division, print_function, unicode_literals, \ absolute_import import itertools import subprocess import io import re import numpy as np import pandas as pd from monty.io import zopen from...
# coding: utf-8 from dl_core import db import sqlalchemy.exc as SA def init_db(): db.create_all() def _already_exist(db_model, obj, data): row = db.session.using_bind("slave").query(db_model).filter(obj == data).first() if row: return True else: return False def already_exist(db_model, ...
#!/usr/bin/python import os import matplotlib.pyplot as plt import numpy as np from post_process import load # from scipy.stats import iqr class InformationCapacity(object): def __init__(self, foreign_directory="./", self_directory="./", estimator='fd', limiting='foreign'): self.num_steps = 1 ...
from hiyapyco import dump as hdump from mason.clients.airflow.airflow_client import AirflowClient from mason.clients.airflow.scheduler import AirflowSchedulerClient from mason.clients.athena.athena_client import AthenaClient from mason.clients.athena.execution import AthenaExecutionClient from mason.clients.athena.met...
from django import forms from django.contrib.auth.decorators import login_required from django.core.files.images import get_image_dimensions from django.urls import reverse from regex import regex from .models import UserProfile import json from django.core.mail import send_mail, BadHeaderError from django.http import ...
import asyncio import sqlite3 import re import os from datetime import datetime import secrets import discord from discord.ext import commands # This used to be included in kyb3r/modmail-plugins but it has been broken so Wanted to fix it uwu USER_CACHE = {} class Thread: statuses = {1: "open", 2: "closed", 3: ...
import torch from torch import nn from torch.nn import functional as F from torch.distributions.uniform import Uniform from networks.layers.non_linear import NonLinear, NonLinearType from networks.layers.conv_bn import ConvBN class DropConnect(nn.Module): def __init__(self, survival_prob): """ A m...
#https://www.wipo.int/classifications/ipc/en/ITsupport/Categorization/dataset/ import os, sys from os.path import exists, join from util.file import * from zipfile import ZipFile import xml.etree.ElementTree as ET from tqdm import tqdm import numpy as np import pickle from joblib import Parallel, delayed WIPO_URL= 'ht...
# Copyright 2018--2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
## # File: NeighborFiguresTests # Author: jdw # Date: 28-Dec-2020 # Version: 0.001 # # Updates: # ## """ Tests cases for selected category neighbor diagram figure generator. """ __docformat__ = "restructuredtext en" __author__ = "<NAME>" __email__ = "<EMAIL>" __license__ = "Apache 2,0" import logging import os...
# Developer: SpatialDev # Company: Spatial Development International # standard library import os import sys from datetime import datetime, timedelta # third-party from arcpy.sa import * import arcpy class TRMMCustomRasterRequest: """ encapsulates a request to the TRMMCustomRasterCreator to create a cust...
#!/usr/bin/env python """ A service like daemon for calculating components of the gradient """ # pylint: disable=invalid-name, unused-import, multiple-imports import platform import numpy as np import uuid import sys, time, os, atexit, json from SparseSC.cli.daemon import Daemon from yaml import load, dump import tempf...
# Importing tensorflow import tensorflow as tf # importing the data from tensorflow.examples.tutorials.mnist import input_data # Importing some more libraries import matplotlib.pyplot as plt from numpy import loadtxt import numpy as np from pylab import rcParams from sklearn import preprocessing import cv2 i...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
# -*- coding: utf-8 -*- """ Created on Thu Dec 30 16:20:13 2021 @author: doudou """ import torch import torch.nn as nn import torch.nn.functional as F import time # record the time record import matplotlib.pyplot as plt #draw the diagram import numpy as np #linear algebra import datetime import random from DSL impo...
from google.cloud import bigquery, storage import json import pandas as pd import time import requests import os import datetime import geojson import numpy as np from matplotlib.path import Path from time import sleep import yaml UPDATE_MINS = 60 gs_client = storage.Client() env = None _area_params = None # Downloa...
#!/usr/bin/python import sys, re import os.path import argparse from dependency_input import Dependency from operator import itemgetter PUNCTS=set(['PU', 'PUNCT', '``', ',', ':', '.', "''", '-LRB-', '-RRB-']) def smart_open(fname, mode = 'r'): if fname.endswith('.gz'): import gzip # Using max comp...
# coding=utf-8 # Copyright (c) HISSL Contributors try: import h5py except ImportError: raise ValueError("You must have h5py installed to run this script: pip install h5py.") from pathlib import Path # Idea of this script is to take the TCGA-CRCk or TCGA-BC features saved per tile in h5 format and output them ...
# -*- coding: utf-8 -*- """<EMAIL>. 功能描述:one hot encoding for manifacture name """ import os from pyspark.sql import SparkSession from dataparepare import * from interfere import * from pdu_feature import * from pyspark.sql.types import * from pyspark.sql.functions import when from pyspark.sql.functions import explo...
""" Code for turning a GAE Search query into a SOLR query. """ import logging from appscale.search.constants import InvalidRequest from appscale.search.models import SolrQueryOptions, SolrSchemaFieldInfo from appscale.search.query_parser import parser logger = logging.getLogger(__name__) def prepare_solr_query(gae_...
######################## SYSTEM TEST ######################## """ This test is meant to test the nested strands, where the parent strand regs are visible to child process, if the regs are followed by a '.' """ ########################################################### import simpy import sys from copy import...
from typing import List, Iterator from string import punctuation from .alphabet import VOWELS, ALPHABET, CONSONANTS, LONG_VOWELS from .classifications.letter_types import LetterType from .classifications.syllable_types import SyllableType def hecele(text: str) -> List[str]: """Syllabifies the specified text. ...
import pandas as pd import numpy as np import itertools from matplotlib import cm import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.model_selection import GridSearchCV from sklearn.metrics import confusion_matrix, make_scorer, roc_auc_score, average_precision_score, classifi...
import numpy as np import termcolor import cnc_structs def string_array_to_char_array(m): c = np.array([x.decode('ascii')[0] if len(x) > 0 else ' ' for x in m.flat]).reshape(m.shape) return '\n'.join(map(''.join, c)) def staticmap_array(map: cnc_structs.CNCMapDataStruct) -> np.ndarray: tile_names = np....
############################################################################### # Copyright 2013 The University of Texas at Austin # # # # Licensed under the Apache License, Version 2.0 (the "License"); #...
# -*- coding: utf-8 -*- # ***************************************************************************** # ufit, a universal scattering fitting suite # # Copyright (c) 2013-2019, <NAME> and contributors. All rights reserved. # Licensed under a 2-clause BSD license, see LICENSE. # **************************************...
''' training for Navier Stokes with Reynolds number 500, 0.5 second time period ''' import csv import random from timeit import default_timer import deepxde as dde from deepxde.optimizers.config import set_LBFGS_options import numpy as np from baselines.data import NSdata import tensorflow as tf Re = 500 def forcin...
"""Incorporate ETH Zurich's BIWI (EWAP) dataset into simple gridworld.""" import os from pathlib import Path from matplotlib.image import imread import matplotlib.pyplot as plt import numpy as np from .simple_gw import SimpleGridworld # Grid constants OBSTACLE = 2 GOAL = 6 PERSON = 9 ROBOT = 15 class EwapDataset: ...
import os import sqlite3 import json import datetime from shutil import copyfile from werkzeug._compat import iteritems, to_bytes, to_unicode from jam.third_party.filelock import FileLock import jam LANG_FIELDS = ['id', 'f_name', 'f_language', 'f_country', 'f_abr', 'f_rtl'] LOCALE_FIELDS = [ 'f_decimal_point', 'f...
# Data uploader for workflow automation using Agave v2 for actors and file upload. import json from agavepy import Agave import pickle import random import sys import time import os from os.path import join, isdir, isfile, relpath, basename, realpath, dirname from multiprocessing import cpu_count from multi...
# -*- coding: utf-8 -*- import sys def printf(*objects, sep=' ', end='\n', file=sys.stdout): enc = file.encoding if enc == 'UTF-8': print(*objects, sep=sep, end=end, file=file) else: f = lambda obj: str(obj).encode(enc, errors='backslashreplace').decode(enc) print(*map(f, objects),...
''' SPIN COATER PROJECT RPM CONTROL SOFTWARE by <NAME> Website: https://yetkinakyuz.com Email: <EMAIL> ''' ##### LIBRARIES ##### import RPi.GPIO as GPIO #RASPBERRY PI GPIO LIBRARY WIKI: https://sourceforge.net/p/raspberry-gpio-python/wiki/Home/ import lcddriver #LCD I2C LIBRARY impor...
from os import path as osp import cv2 import numpy as np import matplotlib.pyplot as plt from scipy.linalg import lstsq from scipy.ndimage import gaussian_filter from scipy import interpolate import argparse import sys sys.path.append("..") import Basics.params as pr import Basics.sensorParams as psp from Basics.Geome...
from numpy import * from scipy.linalg.basic import * from scipy.linalg.decomp import * from util import * import cvxopt.coneprog; from cvxopt.base import matrix, spmatrix from cvxopt import solvers import settings as S def translate_matrix(t): """ Given a d-dim vector t, returns (d+1)x(d+1) matrix M such that ...
# Copyright (C) 2019-2022, <NAME>. # This program is licensed under the Apache License version 2. # See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details. """ Training script for semantic segmentation """ import datetime import os import time import matplotlib.pyplot as plt...
## ## setup1.py ## from functools import reduce class Card: """ Represents a card from a "standard" deck of playing cards that consists of 52 Cards in each of the 4 suits of Spades, Hearts, Diamonds, and Clubs. Each suit contains 13 cards named: Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King....
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # PYTHON VERSION OF MATTHEW LEONAWICZ's DOF/DOT/LOGS R Script # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # Author: <NAME> -- 2019 -- <EMAIL> # LICENSE: MIT # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # def tfg_days( ...
import os.path from pathlib import Path from inspect import signature import torch import numpy as np __all__ = [ "Callback", "ModelSaver", "Logger", "EarlyStopping", "VarianceBasedEarlyStopping", "MetricEvaluator" ] class Callback: """Base class for callbacks.""" def on_train_star...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json, erpnext from frappe import _ from frappe.utils import flt, getdate, nowdate, add_days from erpnext.controllers.acco...
# Copyright (c) 2021 - present / Neuralmagic, 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...
#!/usr/bin/env python import itertools import os import signal import socket import subprocess import sys import uuid from contextlib import contextmanager from functools import partial from threading import Thread import click from dask.distributed import Client, as_completed def timed_wait_proc(proc, timeout): ...
import cv2 import numpy as np import scipy from scipy import fftpack, signal from sklearn.neighbors import ball_tree from scipy.sparse import spdiags import matplotlib.pyplot as plt def sinc_psf(window_size=15, edge=15/4): x = np.expand_dims(np.linspace(-edge, edge, window_size),axis=0) s = np.sinc(x.T @ x) ...
# Copyright 2018 AT&T Intellectual Property. All other 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...
import numpy as np import pandas as pd import os from features import * from util import * # Handle datasets def merge_data(key_list, array_list): all_keys = np.array([kl[i] for kl in key_list for i in range(len(kl))]) all_keys_idxs = np.argsort(all_keys) all_keys_sorted = np.sort(all_k...
import os from glob import glob import subprocess import sys import pathlib import json import yaml import nbformat import nbterm import traceback import asyncio import config import click def get_toc_files(notebooks_only=True): """return a list of files in the _toc.yml""" with open("_toc.yml") as fid: ...
from django.shortcuts import get_object_or_404 from django.http import JsonResponse from first_app.models import Student from django.core.serializers import serialize from django.views.decorators.csrf import csrf_exempt import json from rest_framework.response import Response from rest_framework.decorators import api_v...
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # 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 ...
# Copyright (c) 2017, MD2K Center of Excellence # 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 conditio...
import asyncio import base64 import binascii import json import logging import os import sys from urllib.parse import urlparse sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from runners.agent_container import ( # noqa:E402 arg_parser, create_agent_with_args, AriesAgent, ) f...
from datetime import datetime from sqlobject import SQLObject, SQLObjectNotFound, RelatedJoin, \ DateTimeCol, IntCol, StringCol, UnicodeCol from sqlobject.inheritance import InheritableSQLObject import warnings import logging log = logging.getLogger("turbogears.identity.soprovider") import turbogears from turbog...
# -*- coding: utf-8 -*- #================================================================ # God Bless You. # # author: klaus # email: <EMAIL> # created date: 2019/12/17 # description: # #================================================================ import os import time from easydict import EasyDict impor...
from datetime import datetime import json import os import shutil import sys from django.contrib.auth.models import User from django.core.management import call_command from django.core.management.base import BaseCommand from django.utils.dateparse import parse_datetime from django.utils.timezone import utc from djang...
#! /usr/bin/env python3 import os import git import subprocess import glob default_systemd = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "system.d/")) build = "ntcl-build" util = "ntcl-util" data = "ntcl-data" tensor = "ntcl-tensor" algorithms = "ntcl-algorithms" examples = "ntcl-examples" part_lo...
import math from rlbot.agents.base_agent import BaseAgent, SimpleControllerState from rlbot.utils.structures.game_data_struct import GameTickPacket class Vector3: def __init__(self,a,b,c): self.data = [a,b,c] def __getitem__(self,key): return self.data[key] def __str__(self): retur...
# -*- coding: utf-8 -*- """ Loss function for listwise ranking training. """ import torch import torch.nn.functional as F from itertools import permutations PADDED_Y_VALUE = -1 DEFAULT_EPS = 1e-10 DEFAULT_TOPK = 2 def listNet_top_one(y_pred, y_true, eps=DEFAULT_EPS, padded_value_indicator=PADDED_Y_VALUE): ...
import patch import validata_core import requests import yaml import functools from urllib.parse import urlencode from collections import defaultdict import csv import datetime import sys import json import os import textwrap CSV_PATH = "data/data.csv" COMMENT_SUBJECT = "Conformité au schéma" USER_SLUG = "validation...
import types from dataclasses import dataclass from typing import Callable, List, Union from fastapi import Depends, FastAPI, HTTPException, Query from sqlmodel import Field, Session, SQLModel, select # Model generator + container ------------------------------------------------------------- @dataclass class Multi...
import re import os import io import time import shlex import logging import tempfile import subprocess from PIL import Image from lxml import etree class WaitforTimeout(RuntimeError): pass class CouldNotDumpScreen(RuntimeError): pass class NotReachedToActivityError(RuntimeError): def __init__(self, ...
import os import glob import csv import pandas as pd import numpy as np from collections import deque from itertools import chain from utils import rotate_quat, rotate_cross_product class Sensor(object): def __init__(self, name, fieldnames, data): self.name = name self.fieldnames = fieldnames ...
# Copyright (c) 2021 PaddlePaddle 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 appli...
import math import logging from shazzam.py64gen import * from shazzam.py64gen import RegisterX as x, RegisterY as y, RegisterACC as a from shazzam.macros.aliases import color, vic logger = logging.getLogger("shazzam") # Beam Racer * https://beamracer.net # Video and Display List coprocessor board for the Commodore 64...
import math import matplotlib.pyplot as plt import numpy as np from pf import pf_localization from ekf_1 import ekf_estimation from leastsq import lsq_estimation # Simulation parameter # Q_sim = np.diag([0.2]) ** 2 # R_sim = np.diag([1.0, np.deg2rad(30.0)]) ** 2 Q_sim = np.diag([0.4]) ** 2 R_sim = np.diag([0.8, np...
# -*- coding:utf-8 -*- # Scanner module: Scan binaries to get useful infos for exploits import subprocess import mmap import re from ropgenerator.core.Architecture import * import lief g_binary_lief = None g_binary_name = None g_offset = 0 def init_scanner(filename): global g_binary_lief global g_binary_n...
######################################################################## # # Copyright (c) 2021 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # ######################################################################## import jsonpatch import pecan from pecan import rest import six import wsme from ws...
import numpy as np import pandas as pd from functools import reduce from itertools import combinations_with_replacement from amlearn.featurize.base import create_featurizer_backend from amlearn.utils.packing import load_radii from sklearn.base import BaseEstimator, TransformerMixin try: from amlearn.featurize.src ...
#!/usr/bin/env python ''' Run tests for Pannellum, set up with Continuous Integration. Contributed by <NAME>, JoSS Review 2019. See the project repository for licensing information. ''' from selenium.common.exceptions import TimeoutException from selenium.webdriver.chrome.options import Options from selenium.webdri...
#!/usr/bin/env python """Populate GitHub labels for issue tracker.""" from collections import namedtuple import codecs import yaml import json import sys import os import re import requests import urllib.parse try: from yaml import CLoader as Loader except ImportError: from yaml import Loader __version__ = "1....
#!/usr/bin/env python3.7 # ****************************************** # Dev: marius-joe # ****************************************** # Logging Utilities # v1.0.7 # ****************************************** """Utility functions for logging""" import os, sys import logging from logging.handlers impor...
# ##################################################################################################################### ''' This file is a scratchpad of code used for preparing the folders of the dataset, including: - Inverting a greyscale image, so that all cells are on a black background - Pulling a random subset...
from __future__ import print_function from tqdm import * import sys import argparse import torch from torch.autograd import Variable from torch.utils.data import DataLoader import torch.utils.data.distributed import torchvision.transforms as transforms import torchvision.datasets as datasets from models.resnet_imagen...
# -*- coding: utf-8 -*- """\ Test the natsort command-line tool functions. """ from __future__ import print_function, unicode_literals import pytest import re import sys from pytest import raises from compat.mock import patch, call from compat.hypothesis import ( assume, given, sampled_from, integers, ...
#!/usr/bin/env python3 # ssb/adt/lfs.ps # logical file system for SSB import copy from datetime import datetime import os import sys import uuid import ssb.adt.tangle # --------------------------------------------------------------------------- # this is the UUID for the SSB filesystem namespace # (we picked a ran...
import datetime as dt from functools import partial import logging from math import isfinite import os import re import pathlib from typing import Any, NamedTuple, Optional import numpy as np from pydantic import BaseModel, Field import jinja2 import requests from rich.progress import track from urllib.parse import ur...
from blenderneuron.section import Section import numpy as np import math import numpy as np class BlenderSection(Section): def __init__(self): super(BlenderSection, self).__init__() self.was_split = False self.split_sections = [] def from_full_NEURON_section_dict(sel...