text stringlengths 6.04k 39.5k |
|---|
# coding: utf8
"""
weasyprint.css
--------------
This module takes care of steps 3 and 4 of “CSS 2.1 processing model”:
Retrieve stylesheets associated with a document and annotate every element
with a value for every CSS property.
http://www.w3.org/TR/CSS21/intro.html#processing-model
Th... |
"""
.. note::
This module is experimental. It's API may change between versions.
This module implements function for DTCWT-based image registration as outlined in
`[1] <http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5936113>`_.
These functions are 2D-only for the moment.
"""
from __future__ import division, a... |
'''
This repository is used to implement all upsamplers(only x4) and tools for Efficient SR
@author
<NAME> from SIAT
<NAME> from SIAT
'''
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import basicsr.archs.Blocks as Blocks
import basicsr.archs.Upsam... |
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier as KNN
from sklearn.metrics import matthews_corrcoef, confusion_matrix
from sklearn.metrics import classification_report as class_re
from sklearn.preprocessing import MinMaxScaler
from openpyxl import load_workb... |
from types import GeneratorType
import idlib
import rdflib
from pysercomb.pyr.units import Expr, _Quant as Quantity, Range
from pyontutils import combinators as cmb
from pyontutils.namespaces import TEMP, TEMPRAW, isAbout, sparc
from pyontutils.namespaces import rdf, rdfs, owl, dc
from sparcur import datasets as dat
fr... |
"""
Base class for storing workflow and job information
"""
##
# Copyright 2010-2011 University Of Southern California
#
# 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.a... |
# Copyright 2015-2016 Mirantis, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : ode_analyzer.py
@Time : 2020/07/21
@Author : <NAME> <<EMAIL>>
@Desc : Analyze the learned OnsagerNet for Lorenz system
see more descriptions and update on [GitHub](https://github.com/yuhj1998/ode-analyzer)
'''
# %% 1. import library and set p... |
from __future__ import unicode_literals
import os
from sqlalchemy import (create_engine, MetaData, Table, Column,
Integer, Numeric, String, Date, DateTime, text)
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.schema import (CreateTable, AddConstraint, CreateIndex,
... |
# Importing packages
from django.shortcuts import render
from django.http import HttpResponse
from django.http import FileResponse
import os
# For parsing URL
from urllib.parse import urlparse, urlencode, parse_qs
# For extracting comments from YouTube
import googleapiclient.discovery
# For translating comments into En... |
#!/usr/bin/env python3
# Copyright 2012-2019 <NAME>
#
# Thanks to all contributors:
# https://github.com/Scarygami/location-history-json-converter/graphs/contributors
#
# 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 ... |
import os
import numpy as np
import matplotlib.pyplot as plt
class LearningProc:
def __init__(self, init_weight, learning_rate, datas, class_w1_idx, class_w2_idx, epochs, bias):
self.learning_rate = learning_rate
self.class_1_data = datas[class_w1_idx]
self.class_2_data = datas[class_w2_idx... |
import sys
import argparse
import copy
import random
import torch
import torch.utils.data as data
from random import shuffle
from collections import OrderedDict
import continual_benchmark.dataloaders.base
import continual_benchmark.agents as agents
import continual_benchmark.dataloaders as dataloaders
from continual_b... |
import glob
import logging
import os
from functools import lru_cache
import regex
from indic_transliteration import sanscript
from curation_utils import file_helper
from doc_curation.md.file import MdFile
from doc_curation.md.library import metadata_helper
def import_md_recursive(source_dir, file_extension, source_... |
# coding: utf-8
# TODO for the moment we assume Product of same space
import numpy as np
from itertools import product
from scipy.linalg import eig as eig_solver
from gelato.expr import GltExpr as sym_GltExpr
from psydac.api.ast.glt import GltKernel
from psydac.api.ast.glt import GltInterface
from p... |
# This file is part of datacube-ows, part of the Open Data Cube project.
# See https://opendatacube.org for more information.
#
# Copyright (c) 2017-2021 OWS Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import, division, print_function
import numpy
import xarray
from affine import... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# All contributions by <NAME>:
# Copyright (c) 2019 <NAME>
#
# MIT License
#
# BigGAN V1:
# This is now deprecated code used for porting the TFHub modules to pytorch,
# included here for reference only.
import numpy as np
import torch
from scip... |
from PIL import Image as pil
from cStringIO import StringIO
import hashlib
from image import settings
from image.settings import IMAGE_DEFAULT_QUALITY, IMAGE_DEFAULT_FORMAT
from image.storage import MEDIA_STORAGE, STATIC_STORAGE
INTERNAL_CACHE_ROOT = "%s/_internal/" % settings.IMAGE_CACHE_ROOT
def power_to_rgb(val... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import psycopg2.extras
import config
import contextlib
import collections
import json
import os
import base64
import pytz
from datetime import datetime, timedelta
# NOTE: We use one single connection per process, but every function in this module
# creates its own dedicated cursor. This means that these functions shou... |
# Setup
import pandas as pd
pd.options.display.max_columns = 30
pd.options.display.width = 120
import pickle
from collections import defaultdict
from termcolor import colored
import statistics
# ML setup
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, OneHotEncode... |
#!/usr/bin/env python2.7
from __future__ import absolute_import
from __future__ import print_function
import sys
from textwrap import dedent
import numpy as np
import argparse
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import tangos as db
from tangos import all_simulations
from tang... |
import logging
import re
import traceback
from tempfile import NamedTemporaryFile
import pandas as pd
from django.http import HttpResponseBadRequest, HttpResponseServerError
from django.shortcuts import render
from django_filters import rest_framework as drf
from django_filters.rest_framework import DjangoFilterBacken... |
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.colors import LightSource
from mpl_toolkits.mplot3d import Axes3D
import keras
import math
import os
plt.rcParams['animation.ffmpeg_path'] = "C:\\ProgramData\\Anaconda3\\pkgs\\ffmpeg-4.1.... |
import glob
import logging
import os
import re
import posixpath
import warnings
try:
from pxr import Usd
except ImportError:
warnings.warn("Warning: module pxr not found", ImportWarning)
from kaolin import io
logger = logging.getLogger(__name__)
__all__ = [
'Timelapse',
'TimelapseParser'
]
class Ti... |
# NCC: Neural Code Comprehension
# https://github.com/spcl/ncc
# Copyright 2018 ETH Zurich
# 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... |
import ast
import configparser
import importlib
import logging
import os
import sys
import xml.etree.ElementTree as ET
from functools import partialmethod
from time import gmtime, strftime
import coloredlogs
import configargparse
from tqdm import tqdm
from pygetpapers.download_tools import DownloadTools
from pygetpap... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2013 <NAME>
# This code is distributed under the two-clause BSD license.
from __future__ import unicode_literals
"""Specific versions of XWorkflows to use with Django."""
from django.apps import apps
from django.db import models
from django.db import transaction
from djan... |
import bz2
import dataclasses
import gzip
import importlib
import json
import logging
import lzma
from abc import abstractmethod
from os import PathLike
from pathlib import Path
from typing import (
IO,
Any,
Callable,
Dict,
Generic,
Iterable,
Iterator,
List,
Optional,
Sequence,
... |
import unittest
import copy
import StringIO
import sys
import mock
from tutumcli.tutum_cli import patch_help_option, dispatch_cmds, initialize_parser
from tutumcli.exceptions import InternalError
import tutumcli
class PatchHelpOptionTestCase(unittest.TestCase):
def setUp(self):
self.add_help_argv_list = ... |
# BSD 2-Clause License
#
# Copyright (c) 2020, dotcomboom <<EMAIL>> and contributors
# 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 copy... |
import time
import tkinter as tk
from tkinter import filedialog
from desktopmagic.screengrab_win32 import getDisplayRects, getRectAsImage, getScreenAsImage, getDisplaysAsImages
import os
import glob
class MainWindow:
def __init__(self):
# ? Start root
self.root = tk.Tk()
self.r... |
"""Abstract finite element classes and functions."""
import sympy
import warnings
import numpy
from .symbolic import x, subs, sym_sum, PiecewiseFunction, to_sympy, to_float, all_symequal
from .calculus import diff
from .vectors import vsub
from .basis_function import ElementBasisFunction
from .legendre import evaluate... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
# @File : connect_api_demo.py
# @Desc : None
'''
import datetime
import hashlib
import json
import random
import ssl
import time
from urllib.parse import unquote, urlencode
import jwt
import requests
import websocket
# Ver 2.2.0
# https://doc.apifiny.com/con... |
# -*- coding: utf-8 -*-
"""
From github.com/villares/villares/arcs.py
2020-09-22 Merges/renames several versions of the arc related functions
2020-09-24 Updates arc_filleted_poly and arc_augmented_poly
2020-09-25 Added bar() and var_bar()
2020-09-26 Moved code from bar() to var_bar() and added several new kwargs
2020-... |
# Import libraries
import numpy as np
import tensorflow as tf
import os
from PIL import Image
import matplotlib.pyplot as plt
import math
# Set global values
ROWS = 224
COLS = 224
lr = 0.001
# pkeep = 0.5
window = 5
tf.set_random_seed(0)
# Functions go here
def read_from_folder(filename):
a = so... |
import enum
import logging
from functools import partial
from typing import Dict, Set, Tuple, Optional
from rlai.actions import Action
from rlai.agents.mdp import MdpAgent
from rlai.environments.mdp import MdpEnvironment, MdpPlanningEnvironment, PrioritizedSweepingMdpPlanningEnvironment
from rlai.gpi import PolicyImpr... |
"""
Test the decoder module
"""
# Author: <NAME>
# <NAME>
# <NAME>
#
# License: simplified BSD
import warnings
import numpy as np
import pytest
from nilearn._utils.param_validation import check_feature_screening
from nilearn.decoding.decoder import (Decoder, DecoderRegressor,
... |
# code from https://raw.githubusercontent.com/simochen/model-tools/master/pytorch_tools.py
import torch
import torchvision
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
def print_model_param_nums(model=None):
if model == None:
model = torchvision.models.alexnet... |
import math, random, time
import tensorflow as tf
import numpy as np
import sys
from game2048.game import Game
from keras.models import load_model
from game2048.expectimax import board_to_move
model_score = 256
def board_to_oht(state):
out_ = np.zeros((1,16,12))
for i in range(4):
for j... |
# -*- encoding: utf-8 -*-
'''
@File : CluORegAddMixupv2.py
@Contact : <EMAIL>
@Modify Time @Author @Version @Desciption
------------ ----------- -------- -----------
2020/12/23 15:24 guzhouweihu 1.0 None
'''
import os
import sys
import csv
import time
import datetim... |
################################################################################
# pyopt_uq_scaneagle2.py
# This file performs a robust design optimizarion on a Boeing ScanEagle aircraft
# with 6 random variables. The random variables are Ma, TSFC, W0, E, G, mrho.
# This file can be run in 3 ways
#
# 1. Reduced optimiz... |
#1 라이브러리 임포트
import pygame
from pygame.locals import *
import math
import random
import sys
import time
#2 게임 설정
boolStart = 0
pygame.init()
width, height = 1280,720
screen = pygame.display.set_mode((width,height))
keys = [False, False, False, False]
Select = [False, False]
SelectClear = False
Select_Weapon = [False, ... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Magnifying Glass
A QGIS plugin
Magnifying Glass Tool for Qgis
-------------------
begin : 2016-05-19
copyright ... |
'''
URL class and transformations for the cocrawler.
We apply "safe" transformations early and often.
We apply "unsafe" transformations right after parsing an url out of
a webpage. (These represent things that browsers do but aren't
in the RFC, like discarding /r/n in the middle of hostnames.)
See cocrawler/data/htm... |
# MIT License
# Copyright © 2020 Hobyst
# 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, publ... |
#!/usr/bin/python
"""
(C) Copyright 2019 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 la... |
#!/usr/bin/env python
from __future__ import print_function, division
import argparse
import os
#import errno
import time
import numpy as np
from astropy.io import ascii, fits
#from astropy.table import Table
from astropy.utils.console import human_time
from lsdlib import colunits, col_stack_all3, create_table, drop_... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains widgets related with directories and files
"""
from __future__ import print_function, division, absolute_import
import os
import logging
from tpDcc import dcc
from Qt.QtCore import Qt, Signal
from Qt.QtWidgets import QSizePolicy, QWidget, QList... |
#librerias importadas necesarias para los calculos
import math
import numpy as np
__version__ = '0.12'
def simplebeam():
#se define un diccionario en el cual se ira agregando los datos en campos separados
beam={}
leng=input("\nIngrese el largo de la viga que sera en metros: ")
#se especifican los val... |
"""
MIT License
Copyright(c) 2021 <NAME>
"""
from datetime import datetime
from flask import (
render_template,
redirect,
url_for,
flash,
abort,
request,
current_app,
)
from flask_babel import _
from flask_login import current_user, login_required
from sqlalchemy import or_
from urllib.parse... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from .utils import register_model, unpack_feature, pack_feature
from collections import OrderedDict
@register_model
def IMDN(**kwargs):
model = IMDN_Model(**kwargs)
return model
@register_model
def IMDN_free(**kwargs):
model = IMDN_free_... |
import torch
import torch.nn as nn
import ops.create5Dimages as create5D
import ops.create4Dimages as create4D
def create5Dimages(images): # [BT,C,H,W]->[B,T,C,H,W]
# images : 4D tensor with shape [BT,C,H,W]
T = 16
B = images.size(0) // T
C = images.size(1)
H = images.size(2)
W = images.size(... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
""" A module for performing tracking in world coordinates. This works better than
tracking in pixel coordinates.
"""
import click
import pandas as pd
import numpy as np
from itertools import count
from math import sqrt
# from lap._lapjv import lapjv
from munkres import Munkres, DISALLOWED, print_matrix, Unsolvabl... |
"""Implements serializers for StatsBomb data."""
import os
import warnings
from typing import Any, Dict, List, Optional
import pandas as pd # type: ignore
from pandera.typing import DataFrame
try:
from statsbombpy import api_client, sb
def my_has_auth(creds: Dict[str, str]) -> bool:
"""Monkeypatch t... |
"""
Import as:
import core.artificial_signal_generators as carsigen
"""
import datetime
import logging
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
import scipy as sp
# import statsmodels as sm
import statsmodels.api as sm
import helpers.hdbg... |
import copy
from itertools import chain
from abc import ABC, abstractmethod
import galsim
import numpy as np
from astropy.table import Column
import descwl
from btk.multiprocess import multiprocess
def get_center_in_pixels(blend_catalog, wcs):
"""Returns center of objects in blend_catalog in pixel coordinates ... |
""" Parse xls up to some point
Read storages, (sub-)streams, records from xls file
"""
#
# === LICENSE ==================================================================
# xls_parser is copyright (c) 2014-2019 <NAME> (http://www.decalage.info)
# All rights reserved.
#
# Redistribution and use in source and binary for... |
"""Shared helper functions for running experiments and generating plots."""
from pathlib import Path
import os
import time
import glob
import json
import logging
import pandas
import numpy as np
import matplotlib.pyplot as plt
import jax.config
import arviz
import sde
import mici
from mici.states import _cache_key_fun... |
"""Copyright 2021 Hangzhou Dianzi University, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... |
# -*- coding: utf-8 -*-
"""
Simulations.
"""
import warnings
from itertools import groupby
import numpy as np
# Try to import the original SamplableSet,
# but if that doesn't work, use the mock version
# that's implemented in this package
try:
from SamplableSet import SamplableSet
except ModuleNotFoundError as e... |
# Copyright 2009-2017 <NAME>.
# This program is distributed under the MIT license.
'''A collection of tools for manipulating iterators.'''
from __future__ import generator_stop
import collections
import operator
import itertools
import builtins
import numbers
from python_toolbox import sequence_tools
from python_to... |
import matplotlib.pyplot as plt
import numpy as np
from keras.models import load_model
import cv2
import importlib
import cnn
from skimage import measure
from heapq import merge
from itertools import count
from matplotlib.patches import Rectangle
import pandas as pd
from scipy.interpolate import interp2d
from scip... |
r"""
Creating an orthogonal polynomial expansion can be numerical unstable
when using raw statistical moments as input
:cite:`gautschi_construction_1968`. This can be a problem if
constructing large expansions since the error blows up. Given that the
distribution is univariate it is instead possible to create orthogona... |
import torch
import torch.nn as nn
import os
import json
from tools import builder
from utils import misc, dist_utils
import time
from utils.logger import *
from utils.AverageMeter import AverageMeter
from utils.metrics import Metrics
from extensions.chamfer_dist import ChamferDistanceL1, ChamferDistanceL2
def run_net... |
import argparse
import os
import pickle
import random
import numpy as np
import networkx as nx
import node2vec
from gensim.models import Word2Vec
from numpy import random
from optimization import update_embeddings
from optimization import update_sphere
from error import measure_penalty_error
from error import measure_r... |
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import pytest
import reframe as rfm
import unittests.utility as test_util
import reframe.core.fixtures as fixtures
import ref... |
import numpy as np
from det3d import torchie
from det3d.datasets.kitti import kitti_common as kitti
from det3d.core.evaluation.bbox_overlaps import bbox_overlaps
from det3d.core.bbox import box_np_ops
from det3d.core.sampler import preprocess as prep
from det3d.builder import (
build_dbsampler,
build_anchor_ge... |
# -*- coding: utf-8 -*-
import re
import string
from pytib.exceptions import InvalidConfig
# Wylie/latin consonants
W_ROOTLETTERS = (
'k', 'kh', 'g', 'ng',
'c', 'ch', 'j', 'ny',
't', 'th', 'd', 'n',
'p', 'ph', 'b', 'm',
'ts', 'tsh', 'dz', 'w',
'zh', 'z', '\'', 'y',
'r', 'l',... |
from django.core.exceptions import SuspiciousOperation
from django.db import models
from django.db.models import Q, Sum
from django.forms.models import model_to_dict
from django.utils.translation import ugettext as _
from enumfields import EnumIntegerField
import reversion
from tally_ho.apps.tally.models.ballot import... |
#!/usr/bin/env python3
from flask import Flask, render_template, request
from flask import redirect, url_for, jsonify, flash
from sqlalchemy import create_engine, asc, inspect
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import StaticPool
from database_setup import Base, AnimalClasses, ClassFamilies, U... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
# Copyright 2022 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 o... |
import math
import multiprocessing
from copy import deepcopy
from dataclasses import dataclass
from functools import partial
from typing import (Any, Callable, List, Optional, Tuple, Union)
import numpy as np
from tqdm import tqdm
from deap.tools import ParetoFront
from fedot.core.composer.constraint import constrain... |
# -*- coding: utf-8 -*-
import yaml
# import re
# import requests
# import functools
import pprint
import os
import base64
import psycopg2
import time
import contextlib
from ast import literal_eval
from datetime import datetime # , timedelta
from disco.types.permissions import Permissions
from disco.api.http import ... |
from app.administracion import blueprint
from flask import render_template, request, redirect, jsonify
from flask_login import login_required
from bcrypt import checkpw
from app import db, login_manager
from app.db_models.models import *
@blueprint.route('/<template>')
@login_required
def route_template(template):
... |
import click
from PIL import Image
from flask import Flask, render_template, url_for, redirect, request, session, abort, make_response, jsonify
from flask_login import LoginManager, login_user, current_user, login_required, logout_user
from sqlalchemy import func as sqlalchemy_func
from wt_forms import *
from data.db_... |
from __future__ import with_statement
from skimage import measure
from OpenGL.GL import *
from OpenGL.GLUT import *
import numpy as np
main_path = os.path.join(os.path.dirname(__file__), "..")
single_view_path = os.path.abspath(os.path.join(main_path, "..", "SingleViewReconstruction"))
import sys
sys.path.append(main_... |
#!/usr/bin/env python3
import argparse
from numpy import NaN
import pandas as pd
from espn_api.football import League, player
import jinja2
from pandas.core.frame import DataFrame
from datetime import datetime
import logging
from tqdm import tqdm
import pickle
import json
def print_team_scoring(league: League):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__copyright__ = """
This code is licensed under the MIT license.
Copyright University Innsbruck, Institute for General, Inorganic, and Theoretical Chemistry, Podewitz Group
See LICENSE for details
"""
from collections import OrderedDict
from matplotlib.ticker import Forma... |
#%%
import json
import matplotlib
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.colors as colors
from matplotlib import ticker
from utils.libfunctions import *
def replace_at_index1(tup, ix, val):
lst = list(tup)
... |
#!/usr/bin/env python
# Public domain.
# #import psyco; psyco.full()
# http://stackoverflow.com/questions/2068372/
# fastest-way-to-list-all-primes-below-n-in-python/2073279
"""Prime number generation."""
from __future__ import absolute_import
import itertools
import math
import numpy as np
__author__ = "<EMAIL> (... |
# Add ability to pass TF_Input_Dialog a data structure
# instead of an XML filename. XML file is only for
# initial creation, but for updates or showing user-
# modified settings, need this other option.
#---------------------------------------------------------
#!/usr/bin/env python
# August 8 & 11, 2008
# Febru... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# region header
'''
This script is indented to use as "post-commit" hook for any git \
repository with a page branch.
'''
# # python3.5
# # pass
from __future__ import absolute_import, division, print_function, \
unicode_literals
# #
'''
For convention... |
from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import argparse
import pickle
import os.path as osp
import numpy as np
import torch
import torch.onnx
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoade... |
#!usr/bin/env python3
# Importing packages
import argparse
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModelForTokenClassification, DataCollatorForTokenClassification, TrainingArguments, Trainer, logging
import datasets
import numpy as np
import pandas as pd
from utils.ut... |
# -*- coding: utf-8 -*-
from youtubesearchpython.__future__ import ChannelsSearch, VideosSearch
import difflib
import pathlib
import re
import sys
import time
import traceback
import disnake
import humanize
import youtube_dl as ydl
from disnake.ext import commands
from disnake.ext.commands import InvokableSlashComma... |
# Generated by nuclio.export.NuclioExporter
import mlrun
from mlrun.platforms.iguazio import mount_v3io, mount_v3iod
from mlrun.datastore import DataItem
from mlrun.execution import MLClientCtx
import os
from subprocess import run
import pandas as pd
import numpy as np
from pyspark.sql.types import LongType
from pys... |
import math
from PIL import Image, ImageDraw, ImageFont
from PyQt5.QtWidgets import *
import sys
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QApplication, QPushButton, QWidget, QLabel
from PyQt5.QtGui import QIcon, QPixmap
import face_recognition
import face_recognition
# Image for... |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Imports config files stored in Gitiles.
If services_config_location is set in admin.GlobalConfig root entity,
each directory in the location i... |
# -*- coding: utf-8 -*-
import os,random,glob,time,shutil
import json,gc
import numpy as np
from PIL import Image
from datetime import datetime as dt
import socket
import subprocess,sys
import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torchvi... |
from .command import fun_undercommand1, fun_undercommand3_ReGiSTeR
from .command import fun_undercommand2
from .command import fun_undercommand3
from .command import fun_undercommand2_ReGiSTeR
from .command import fun_get_id
from .command import fun_without
from .command import log
import json
import os
import sys
impo... |
# Copyright Toyota Research Institute 2021
"""
This module implements agents and helper functions designed
support multi-fidelity discovery campaigns.
See the following reference:
<NAME>, <NAME>, <NAME>, <NAME>, Montoya JH. Multi-fidelity Sequential Learning for
Accelerated Materials Discovery. ChemRxiv. Cambridge: C... |
import copy
import random
from search.rm_search.ea.model_rm_custom import BaseMutator
from search.rm_search.ofa_profile.arch_gen import get_ofa_resnet_arch_id
from search.rm_search.ofa_profile.constants import OFA_RES_STAGE_MAX_N_BLOCKS, OFA_RES_STAGE_MIN_N_BLOCKS
"""
Contains different types of arch mutator for OFA
... |
#!/usr/bin/env python3
__author__ = '<NAME>'
import argparse
import hailtop.batch as hb
import hail as hl
import pandas as pd
import os
from typing import List
def bytes_to_gb(in_file):
""" Convert the size from bytes to GB"""
file_info = hl.utils.hadoop_stat(in_file)
size_bytes = file_info['size_bytes... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
"""Module to generate plots of the flow field with VisIt.
Requirements: Python 2, environment variables VISIT_DIR and VISIT_ARCH.
"""
import os
import sys
import yaml
VISIT_DIR = os.environ.get('VISIT_DIR', '')
VISIT_ARCH = os.environ.get('VISIT_ARCH', '')
pkgs_dir = os.path.join(VISIT_DIR, VISIT_ARCH, 'lib', 'site-... |
#!/usr/bin/python3
import os
import sys
from Wihunter import nethunter
from Wihunter import netmanager
from Wihunter import wifite_attacker
from printer import dialog
################################################################################
### ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.