text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
# Copyright 2009-2013, <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 applica... |
"""
This module contains the execution context objects that are internal to the system.
Not every property on these should be exposed to random Jane or Joe dagster user
so we have a different layer of objects that encode the explicit public API
in the user_context module
"""
from collections import namedtuple
from da... |
### Types to hold CTR's data
class catboost_model_ctr(object):
def __init__(self, base_hash, base_ctr_type, target_border_idx, prior_num, prior_denom, shift, scale):
self.base_hash = base_hash
self.base_ctr_type = base_ctr_type
self.target_border_idx = target_border_idx
self.prior_n... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
'''
Non-relativistic NMR shielding tensor
'''
import sys
import time
from functools import reduce
import numpy
import pyscf.lib
import pyscf.gto
from pyscf.lib import logger
import pyscf.lib.parameters as param
from pyscf.scf import _vhf
from pyscf.scf import cphf... |
"""
Grid of thumbnails.
TODO: GridCanvasItem should handle dragging multiple items
TODO: GridCanvasItem should handle keyboard navigation
TODO: GridCanvasItem should allow drag selection to select multiple
"""
from __future__ import annotations
# standard libraries
import enum
# third party libraries... |
# 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 agreed to in... |
"""Define a plugin architecture to create bots."""
from __future__ import annotations # see https://www.python.org/dev/peps/pep-0563/
import abc
import os
import importlib
import logging
import logging.config
import datetime
import smokesignal
from box import Box
from logging.config import DictConfigurator
from bbot.co... |
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test automappings"""
import itertools
from contextlib import contextmanager
from sqlalchemy.orm import load_only
import ggrc
from ggrc import automapper
from ggrc import models
from ggrc.models import a... |
"""
Utilities for plotting, function definitions, and GPs.
This file defines utilities needed for the experiments, such as creating
parameter grids, computing LQR controllers, Lyapunov functions, sample
functions of Gaussian processes, and plotting ellipses.
Author: <NAME>, Learning & Adaptive Systems Group, ETH Zuri... |
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
class AntsEnv(gym.Env):
"""The main OpenAI Gym class. It encapsulates an environment with
arbitrary behind-the-scenes dynamics. An environment can be
partially or fully observed.
The main API methods... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Time Domain Electromagnetics (TDEM) functions and class"""
import sys
from math import pi
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
from . vmd import VMDTimeDomainModelling
def rhoafromU(U, t, Tx, current=1.0, Rx=None):
r"""Apparent re... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\baby\baby.py
# Compiled at: 2020-06-17 21:35:30
# Size of source mod 2**32: 24563 bytes
from pr... |
from __future__ import print_function
import argparse
import pcap
import struct
import math
import os.path
import stream
import messages
import stream_decoders.ssl
from bitfields import bitfields
class empty: pass
class PacketDecoder:
def __init__(self):
self.ip= {
# http://www.iana.org/assignments/pr... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import tempfile
import unittest
import json
from telemetry import project_config
from telemetry import decorators
from telemetry.core import util... |
# Copyright 2012 the V8 project authors. 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 conditi... |
"""PipelineGO - Tasks for a GO analysis
============================================
Reference
---------
"""
import re
import glob
import os
import collections
import sqlite3
import CGAT.Experiment as E
import CGATPipelines.Pipeline as P
import CGAT.Stats as Stats
import CGAT.IOTools as IOTools
import CGAT.CSV as C... |
"""
A reference implementation of max-product loopy belief propagation inference
for a two-level RCN model.
This code is an unoptimized version of what was used to produce the results in the paper.
Note that we use a faster implementation of 2D dilation, instead of the slower
scipy.ndimage.morphology.grey_dilation.
""... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
"""
-----------------------------------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a model from coco weights.
python3 voc.py train --da... |
import io
import os
import pprint
import re
import traceback
from collections import defaultdict
import yaml
from invoke import task
from invoke.exceptions import Exit
from tasks.utils import DEFAULT_BRANCH, get_all_allowed_repo_branches, is_allowed_repo_branch
from .libs.common.color import color_message
from .libs... |
"""PyTorch BERT model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import copy
import json
import math
import logging
import tarfile
import tempfile
import shutil
import numpy as np
import torch
from torch import nn
from torch.nn import C... |
"""
Tuner with genetic algorithm, using reinforcement learning for crossover and mutation.
Additional debugging is included which can be used to track the progress of the
tuner.
DISCLAIMER: Some of the code below is from the GATuner included in the standard TVM package.
Comments have been added in order t... |
import logging
from datetime import datetime, timedelta
from urllib.parse import unquote, urljoin
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import MaxValueValidator, RegexValidator
from django.db impor... |
import tkinter as tk
from tkinter import *
from tkinter import ttk
from PIL import ImageTk, Image
import model
okno = Tk()
okno.title('Vmesnik')
LASTNOSTI_VOZNIKI = ['Ime', 'Začetek', 'Konec', 'Prostor']
LASTNOSTI_POTNIKI = ['Ime', 'Začetek', 'Konec']
LASTNOSTI_ODGOVOR = ['Zaporedna številka', 'Stavek']
graf = {'LJUB... |
#==============================================================================
# Copyright 2019-2020 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... |
# Progetto Ricerca Operativa - n.46 "Sensor Network" - A.A. 2020-21
# <NAME>, <NAME>, <NAME>
import sys
import random as rn
from math import ceil
from display_functions import display_sensors, display_solution, display_mst, display_full_solution, \
display_difference_between_solutions
from graph_functions import mi... |
'''resoboard.py
A Reso circuit can be thought of as a 'board' that needs to be iterated upon.
This code does the heavy lifting! Some important concepts:
1. The 'palette' defines our base colors. We import a lot from 'palette'.
2. A 'Board' holds all the information for a Reso circuit.
An 'image' is a grid of RGB p... |
from dataclasses import dataclass, field
from .base import SerialisableObject, EnumContainer
@dataclass
class MCColor(SerialisableObject):
_name: str = field(default="MCColor", init=False)
_java_name: str = field(default="Color", init=False)
red: int = 0
green: int = 0
blue: int = 0
def from_... |
__package__ = 'archivebox.index'
import re
import os
import shutil
import json as pyjson
from itertools import chain
from typing import List, Tuple, Dict, Optional, Iterable
from collections import OrderedDict
from contextlib import contextmanager
from ..system import atomic_write
from ..util import (
scheme,
... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2010-present MagicStack Inc. and the EdgeDB 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... |
import base64, sys, re
from lxml import etree
from datetime import datetime
from portality.core import app
from portality import datasets
from copy import deepcopy
#####################################################################
# Crosswalks for OAI-PMH
###########################################################... |
# Copyright 2022 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... |
# Author: <NAME>
# Date: 06/04/2020
# Description: A GUI implementation of the game of Gess using Kivy
from GessGame import GessGame
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.graphics import Color
from kivy.graphics impo... |
import copy
import itertools
import json
import logging
import urllib.parse
from typing import List, Dict, Union, Any, Callable, Optional
from django.conf import settings
from django.contrib.admin import ListFilter
from django.contrib.admin.helpers import AdminForm, Fieldset, InlineAdminFormSet
from django.contrib.adm... |
#! /usr/bin/env python
"""
DistributionMaker class definition and a simple script to generate, save, and
plot a distribution from pipeline config file(s).
"""
from __future__ import absolute_import
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from collections import OrderedDict
from collections... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import re
from pathlib import PurePath, PurePosixPath
from typing import TYPE_CHECKING, Any, List, Type
from retry import retry
from semver import VersionInfo
from lisa.base_tools import Cat, Sed, Wget
from lisa.executable import Tool
from lisa... |
import math
import numpy as np
from mathutils import Vector, Quaternion
_FLOAT_EPS = np.finfo(np.float).eps
# computes rotation matrix through Rodrigues formula as in cv2.Rodrigues
def Rodrigues(rotvec):
theta = np.linalg.norm(rotvec)
r = (rotvec / theta).reshape(3, 1) if theta > 0.0 else rotvec
cost = ... |
'''
line_patterns is a principal version of 1st-level 1D algorithm
Operations:
- Cross-compare consecutive pixels within each row of image, forming dert_: queue of derts, each a tuple of derivatives per pixel.
dert_ is then segmented into patterns Pms and Pds: contiguous sequences of pixels forming same-sign matc... |
# flu prediction
import os
import pandas as pd
import feather
from utils.fastai.structured import *
from utils.fastai.column_data import *
from sklearn import preprocessing
from sklearn.metrics import classification_report, confusion_matrix
import keras
from keras.layers import Input, Embedding, Dense, Dropout
from ke... |
# This will be a conglomerate processing file, containing the contents of EMG_Process
# New_Process and read_data
import pandas
import numpy as np
from numpy import linalg as LA
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.io
import imageio
from scipy.fftpack import fft
from scipy import signal... |
# -*- coding: utf-8 -*-
#
"""
Module to datatype restrictions, i.e., data ranges.
The module implements the following aspects of datatype restrictions:
- a new datatype is created run-time and added to the allowed and accepted datatypes; literals are checked whether they abide to the restrictions
- the new d... |
#import numpy as np
import autograd
import autograd.numpy as np
import scipy.stats
from quad import Control, State
class OrigFeats:
def __init__(self, model):
self.model = model
self.n_features = 8
def get_features_from_state_input(self, state_input):
""" state_input is x, z, x vel, z vel, u, theta "... |
import math
import unicodedata as uda
from binascii import unhexlify, hexlify
from torba.rpc.jsonrpc import RPCError
from torba.server.hash import hash_to_hex_str
from torba.server.session import ElectrumX
from torba.server import util
from lbry.schema.result import Outputs
from lbry.schema.url import URL
from lbry.w... |
from utils import (choose, split_trn_val, update_task, get_max_of_db_column,
get_a_task, get_task, ExploitationNeeded,
LossIsNaN, get_task_ids_and_scores, PopulationFinished,
get_col_from_populations, RemainingTasksTaken,
print_with_time, Explo... |
import datetime
import os
import pickle
import random
import sys
import time
import numpy as np
import tensorflow as tf
from config import flags
from dataloader_parallel import DataLoader
import metadata
import metrics
from model import Model
import vsrl_eval
vcoco_root = '/home/tengyu/dataset/v-coco'
def get_vcoco... |
from threading import RLock, Thread, Condition, Event
import time
class RingBuffer(object):
"""
Fast, list backed, preallocated Ring Buffer with static size. Not thread safe and has no safety checking.
"""
def __init__(self, size):
"""
Construct a RingBuffer
:param size: size... |
#!/opt/stack/bin/python3 -E
#
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
"""Output the /tmp/partition.xml for autoyast to create the partitions as requested.
When we do a fresh install, t... |
import abc
import logging
import multiprocessing as mp
import platform
import queue
import signal
import sys
import traceback
from collections import namedtuple
from time import sleep, time
import numpy as np
from acconeer.exptool import libft4222
from acconeer.exptool.clients import links
from acconeer.exptool.clien... |
import logging
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING)
import unittest
import pygsti
import numpy as np
from pygsti.modelpacks.legacy import std1Q_XY
from pygsti.baseobjs import Label as L
from pygsti.circuits import Circuit
import pygsti.models.modelconstruction as mc
from py... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>
#
# This script 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 versi... |
import installSynApps
import shutil
import os
from sys import platform
from installSynApps.io import logger as LOG
import datetime
import re
# External areaDetector plugins
ad_plugins = ['ADCompVision', 'ADPluginBar', 'ADPluginEdge', 'ADPluginDmtx']
# Bash shebang length limit is 127 characters, so we need to make s... |
# This file is part of REANA.
# Copyright (C) 2018, 2019 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Workflow run manager interface."""
import base64
import json
import logging
import os
from flask import curren... |
#!/usr/bin/python
import os
import sys
import signal
import json
import yfinance as yf
import pandas as pd
import math
import argparse
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
g_StocksDB = None
def Load(filename):
if os.path.isfile(filename) is True:
file = open(filename, "r... |
import csv
import functools
import itertools
import json
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, Optional
import requests
from darwin.dataset.utils import exhaust_generator
from darwin.exceptions import UnsupportedFileType
from darwin.utils import is_image_extension_allowed, is_vid... |
import streamlit as st
from pathlib import Path
import requests
import pandas as pd
from pandas.io.json import json_normalize
import base64
from crim_intervals import *
import ast
from itertools import tee, combinations
from typing import List
# import matplotlib
#sets up function to call Markdown File for "about"... |
import cv2
import numbers
import math
import random
import numpy as np
from skimage.util import random_noise
def show_pic(img, bboxes=None, name='pic'):
'''
输入:
img:图像array
bboxes:图像的所有boudning box list, 格式为[[x_min, y_min, x_max, y_max]....]
names:每个box对应的名称
'''
show_img = img.... |
"""
Copyright (c) 2018-present, Facebook, Inc.
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. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import aiodns
import asynci... |
# Generally useful functions. Uses cgs units unless specified otherwise.
import math
import sys
import numpy as np
from scipy.interpolate import interp1d
### physical constants
Lsun = 3.839e33 # solar luminosity in erg/s
G = 6.674e-8 # gravitational constant in cm**3 g**-1 s**-2
Msun = 1.989e33 # mass of the sun in gr... |
from collections import OrderedDict
from numbers import Number
import numpy as np
import tensorflow as tf
from tensorflow.python.training import training_util
from .rl_algorithm import RLAlgorithm
def td_target(reward, discount, next_value):
return reward + discount * next_value
class DRSAC(RLAlgorithm):
... |
import os
import csv
import pickle
import itertools as itt
from Bio import SeqIO
import networkx as nx
from matplotlib import pyplot as plt
plt.rcParams['svg.fonttype'] = 'none'
aa_weights = {
'X': 110, 'A': 89, 'R': 174, 'N': 132, 'D': 133, 'C': 121, 'E': 147, 'Q': 146,
'G': 75, 'H': 155, 'I': 131, 'L':131,'... |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
##############################################################################
# Copyright 2020 AlexPDev
#
# 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 Lice... |
from datetime import datetime, timedelta
from types import SimpleNamespace
from copy import deepcopy
import pystac
import pytest
from datacube import Datacube
from datacube.model import Dataset, DatasetType, metadata_from_doc
from datacube.index.eo3 import prep_eo3
from datacube.index.index import default_metadata_typ... |
# coding: utf-8
# * Build baseline model
# * Example of leaky variables:
# * Missing Data
# * Example of New categorical variables
# * Features not available in production, only in training
# * Outliers
# * Blacklist variables
#
#
# * Example of overfitting
# * Multi-collinearity of variables in linear & NN models
# ... |
import os
import numbers
import csv
import pymrmr
import numpy as np
import pandas as pd
from copy import deepcopy
from sklearn.svm import SVC
from abc import ABCMeta,abstractmethod
from sklearn.feature_selection import SelectKBest, f_classif, RFE
from FAE.FeatureAnalysis.ReliefF import ReliefF
from FAE.DataContainer... |
#
# Copyright (c) 2017-2019 NVIDIA CORPORATION. All rights reserved.
# This file is part of webloader (see TBD).
# See the LICENSE file for licensing terms (BSD-style).
#
from __future__ import absolute_import, division, print_function
import itertools
import logging
import math
import os
import pickle
import random a... |
import six
import os
import warnings
import numpy as np
from flair.data import Sentence
from flair.datasets import UD_ENGLISH
from flair import embeddings
from datasets import load_dataset, get_dataset_config_names, list_datasets
from sklearn.feature_extraction import text
from sklearn import decomposition
from .array... |
"NLP data loading pipeline. Supports csv, folders, and preprocessed data."
from ..torch_core import *
from .transform import *
from ..data import *
__all__ = ['LanguageModelLoader', 'SortSampler', 'SortishSampler', 'TextDataset', 'TextMtd', 'classifier_data', 'lm_data',
'pad_collate', 'read_classes', 'stand... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module is to provide Findit service APIs through Cloud Endpoints:
Current APIs include:
1. Analysis of compile/test failures in Chromium waterfalls.... |
# -*- coding: utf-8 -*-
"""
:Purpose: Central library for general utility-based methods.
This ``utils`` module was the starting place of the original
``utils`` library. Therefore, it's historically been a
'dumping-ground' for general S3DEV utilities and function wrappers
... |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from time import time
import numpy as np
from .. utils import pointnet2_utils as pointutils
def timeit(tag, t):
print("{}: {}s".format(tag, time() - t))
return time()
def pc_normalize(pc):
l = pc.shape[0]
centroid = np.mean(pc, axis=0)... |
# Copyright 2018 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 applicab... |
import concurrent.futures
from multiprocessing import cpu_count
import os
import re
import subprocess
import remoto.process
import spark_deploy.internal.defaults.install as install_defaults
import spark_deploy.internal.defaults.submit as defaults
from spark_deploy.internal.remoto.modulegenerator import ModuleGenerato... |
"""Module containing operators to work on RGB-Depth images."""
from typing import Union
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.filters.sobel import spatial_gradient
from kornia.utils import create_meshgrid
from .camera import PinholeCamera, cam2pixel, pixel2cam, project_points... |
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import sys
import enum
import subprocess
import board_cfg_lib
import common
class RDT(enum.Enum):
L2 = 0
L3 = 1
MBA = 2
INCLUDE_HEADER = """
#include <asm/board.h>
#include <asm/vtd.h>
#include <asm/m... |
#!/usr/bin/env python
# coding: utf-8
import os.path
import struct
import re
from binaryninja import *
function_name_regex = re.compile(r'[\W_]+')
Settings().register_group("degobfuscate", "DeGObfuscate")
Settings().register_setting("degobfuscate.prefix", """
{
"title" : "Default function prefix",
... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#author:doganaydin
#project:themoviedb
#repository:http://github.com/doganaydin/themoviedb
#license: LGPLv3 http://www.gnu.org/licenses/lgpl.html
"""An interface to the themoviedb.org API"""
__author__ = "doganaydin"
__version__ = "1.0b"
import fuzzywuzzy.fuzz
import reques... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import gzip
import pickle
from tqdm import tqdm
from transformers import BertTokenizer
class Example(object):
def __init__(self,
qas_id,
qa... |
from __future__ import division
import argparse
import torch
import torch.nn as nn
from torch import cuda
import lib
import os
import sys
import pdb
import datetime
import numpy as np
import os.path
from torch.autograd import Variable
import random
import gensim
import time
import pickle
import code_retrieval
# # to ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 <NAME>. All rights reserved.
#
# check_redfish.py
#
# This work is licensed under the terms of the MIT license.
# For a copy, see file LICENSE.txt included in this
# repository or visit: <https://opensource.org/licenses/MIT>.
from cr_module.common import grab
from cr_m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
" ArchModel."
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam, RMSprop
from alphastarmini.core.arch.scalar_encoder import ScalarEncoder
from alphastarmini.core.arch.entity_encoder import EntityEncoder, Entity
from alphastar... |
# Copyright 2018 <NAME>
# This software is provided under the BSD 2 clause license; see LICENSE.txt file for more information
from typing import Optional, List, Any, Tuple, Union
from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget, QAbstractItemView, QHeaderView, QMessageBox, QWidget
from PyQt5.QtCore import Q... |
import math
from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel, \
QSizePolicy, QTableView, QPushButton, QDialog, QHBoxLayout, \
QButtonGroup, QMenu, QAction, QApplication, QMessageBox
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
from app.utilities import utils
from app.data.database import ... |
from collections import OrderedDict
from enum import Enum
import cv2
import logging as log
from pathlib import Path
import numpy as np
import copy
import random
import pdb
from PyQt5.QtCore import QPointF as Point2D
import gripit.core.config as config
import gripit.edgelib.util as util
import gripit.edgelib.Line_feat... |
import multiprocessing as mp
if mp.get_start_method(allow_none=True) != 'spawn':
mp.set_start_method('spawn', force=True)
import argparse
import os
import time
import logging
from datetime import datetime
import numpy as np
import yaml
import pdb
import torch
import torch.nn as nn
import torch.backends.cudnn as c... |
import math
import os
import sys
import warnings
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
warnings.warn("QT3-based backends are deprecated and will be removed after"
" the v1.2.x release. Use the equivalent QT4 backend instead.",
mplDeprecation)
import matplo... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#... |
# pip.main(['install', 'nibabel'])
# pip.main(['install', 'pynrrd'])
# pip.main(['install', 'h5py'])
# pip.main(['install', 'scikit-image'])
# pip.main(['install', 'future'])
import os
import sys
import shutil
import difflib
import itertools
import numpy as np
import pandas as pd
import matplotlib.pyplot as pp
import ... |
from os import truncate
from transformers import AutoTokenizer
from typing import Dict, List
import pickle
try:
import marisa_trie
except ModuleNotFoundError:
pass
class Trie(object):
def __init__(self, sequences: List[List[int]] = []):
self.trie_dict = {}
self.len = 0
if sequenc... |
#
# ImageViewMock.py -- classes for the display of FITS files in mock widgets
#
# <NAME> (<EMAIL>)
#
# Copyright (c) <NAME>. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys, os
import numpy
from io import BytesIO
from ging... |
#!python3
"""
Python 3 wrapper for identifying objects in images using Darknet (https://github.com/AlexeyAB/darknet).
It run only on Linux systems and libdarknets.so file is required.
Windows version requires dll and code to manage it (see original https://github.com/AlexeyAB/darknet/blob/master/darknet.py)
To use, is... |
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import glob
import logging
import os
import re
import uuid
from django.conf import settings
from django.urls import reverse
from django.utils import timezone
from django.db import models
from django.db.models.signals import pre_s... |
import webapp2
import os
import jinja2
import urllib
import re
from google.appengine.ext import db
import hmac
import hashlib
import random
import string
import time
import datetime
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(templa... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import json
import time
import random
from PIL import Image
from itertools import count
import sys
import torchvision.models as models
from torchvision import transforms
import t... |
#!/bin/env python
'''
PURPOSE:
THIS SCRIPT IMPORTS ALL THE OPERATING SYSTEMS INFORMATION FROM DUO CONSOLE USING THE DUO ADMIN API,
PRINTS THE OUTPUT TO A CSV AND THEN IMPORTS THE CSV INTO FIREPOWER MANAGEMENT CENTER USING THE HOST INPUT API OF FMC.
DEPENDENCIES / REQUIREMENTS:
1- PYTHON 3.6
2- PERL 5
3- ACCOUNT O... |
from collections import namedtuple
import re
from copy import copy
from typing import List, Set, Iterable, Iterator, Optional, Mapping
from toposort import toposort_flatten, CircularDependencyError
from nightwatch.annotation_set import default_annotations, Conditional
from nightwatch.c_dsl import ExprOrStr
from .inde... |
# -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
settings = current.deployment_settings
T = current.T
"""
Template settings ... |
from __future__ import absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Import packages
import numpy as np
"""
This utility contains the statistics class
References:
<NAME>, <NAME>, <NAME>, <NAME>; Stable, Scalable Formulas for Parallel and Online Computation of Highe... |
# -*- coding: utf-8 -*-
"""
magic is a wrapper around the libmagic file identification library.
See README for more information.
Usage:
>>> import magic
>>> magic.from_file("testdata/test.pdf")
'PDF document, version 1.2'
>>> magic.from_file("testdata/test.pdf", mime=True)
'application/pdf'
>>> magic.from_buffer(op... |
#___________________________________________________
## Names: Vic, Mignote, Kemi, Tiffany
## Date: August 9 2019
## Description: An arcade with severalgames to play
## Thank you Jordan, Denelis, Khan and Sam for help!
#___________________________________________________
# import pygame
##import... |
# Defines the modules
import logging
import os
import pandas as pd
from onsset import (SET_ELEC_ORDER, SET_LCOE_GRID, SET_MIN_GRID_DIST, SET_GRID_PENALTY,
SET_MV_CONNECT_DIST, SET_WINDCF, SettlementProcessor, Technology)
try:
from onsset.specs import (SPE_COUNTRY, SPE_ELEC, SPE_ELEC_MODELLED,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.