text stringlengths 6.04k 39.5k |
|---|
""" Slicelet for SBN Project """
import logging #pylint: disable=unused-import
import time
import datetime
import json
import re
import os
import ctk
import qt
import slicer
from slicer.ScriptedLoadableModule import *
from sbn.config import Config
from sbn import functions, workflow
#pylint: disable=useless-object-... |
import ast
import importlib
import re
from inspect import isclass
from mimetypes import add_type, guess_type
import numpy as np
import pandas as pd
import woodwork as ww
from woodwork.pandas_backport import guess_datetime_format
# Dictionary mapping formats/content types to the appropriate pandas read function
type_... |
'''
This module is in charge of pulling the event
information from the Antelope Datascope database.
We create an object with multiple methods to
interact with the databases and attributes to
keep the event information easily accessible to
the parent process.
<NAME>
<EMAIL>
'''
# pylint: disable=logging-not-lazy
from _... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import plotly.graph_objs as go
from src.visualization.utils import get_palette
external_stylesheets = ['https://codepe... |
#k-mean clustering
import random
import math
import time
def getRandomValue(MaxValue): #Returns two random data points
value = random.randint(0,MaxValue)
return value
def hasClusterChanged(prev, curr):
if len(prev) != len(curr):
return False
for i in range(len(prev)):
for j in range... |
''' A module for representing and manipulating maps between Triangulations. '''
from fractions import Fraction
import operator
import numpy as np
import curver
from curver.kernel.decorators import memoize, ensure
NT_TYPE_PERIODIC = 'Periodic'
NT_TYPE_REDUCIBLE = 'Reducible' # Strictly this means 'reducible and no... |
# Bereken het percentuele verschil tov een x-aantal dagen ervoor
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sn
import platform
import datetime
import datetime as dt
import streamlit as st
from streamlit import caching
from helpers import * # cell_background, select_period... |
"""
MixMatch Pytorch
"""
from __future__ import print_function
import argparse
import ast
import os
import shutil
import sys
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data a... |
# Copyright (c) 2019, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... |
r"""
Module containing the `~halotools.mock_observables.tpcf` function used to
calculate the 1-halo, 2-halo decomposition of the
two-point correlation function in 3d.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from math import gamma
from warnings import w... |
from datetime import datetime
from .message import Emoji, Sticker
from .misc import DictSerializerMixin, Snowflake
from .presence import PresenceActivity
from .team import Application
from .user import User
class WelcomeChannels(DictSerializerMixin):
"""
A class object representing a welcome channel on the w... |
import glob
ocr_dir = '../OCR_TEXT/'
from utils.clean_article import BLUE,RED,GREEN,END, ref
from utils import view_ocr
import numpy as np
class Pdf:
def __init__(self,filename):
self.filename = filename.split('/')[-1].strip('.pdf')
self.make_pages()
self.get_blocks()
def make_pages(self):
fn= glob.glob(o... |
"""
Defense submission for team Stanford & Suns for NIPS 2017 Adversarial Examples Competition
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import csv
import pickle
import numpy as np
from scipy.misc import imread
from scipy.stats import m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position, invalid-name
"""
Utilities for extracting and processing reconstruction information saved to disk
"""
from __future__ import absolute_import, division, print_function
__all__ = [
'extract_from_leaf_dir',
'augment_info',
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""This file is part of Splitter which is released under MIT License.
full_video_put.py uses opencv (cv2) to read and write files to disk. It contains
primitives to encode and decode archived and regular video formats for a tiered
storage system.
"""
import os
from feedback.utils.utils import *
from feedback.streams i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import logging
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Set, Union
import pandas as pd
from dataclasses_json import dataclass_json
from selenium import webdriver
from selenium.common.exceptions imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#****************************************************************************************************************************************************
# Copyright 2017 NXP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifi... |
import tensorflow as tf
import modeling
import optimization
import tokenization
from random import shuffle
import collections
import json
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
def get_dict(path):
char2num = dict()
num2char = dict()
with open(path,'r',encoding = 'utf-8') as f:
lines ... |
"""
A module that provides functions for manipulating bit masks and data quality
(DQ) arrays.
"""
import sys
import warnings
import numbers
import numpy as np
__all__ = ['bitfield_to_boolean_mask', 'interpret_bit_flags']
_MAX_UINT_TYPE = np.maximum_sctype(np.uint)
_SUPPORTED_FLAGS = int(np.bitwise_not(
0, dty... |
from color_trans_gradients_2 import delegator, create_undistorted_hls_image, create_sobel_image
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import pickle
# Loading camera calibration
cameraCalibration = pickle.load(open('serialized_camera_data/camera_calibration.p', 'rb'))
mtx, dist = ma... |
from requests import Session
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
from datetime import datetime
HEADERS = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) '\
'AppleWebKit/537.36 (KHTML, like Gecko) '\
'Chrome/75.0.3770.80 Safari/537.36'}... |
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.views.generic.edit import CreateView
from django.views.generic.list import ListView
from django.views.generic.detail import Detail... |
#!/usr/bin/python3
import json
import sys
import re
import os
import getpass
import configparser
import requests
from datetime import date
# Module handling
try:
from androguard.core.bytecodes.apk import APK
except:
print("Error: >androguard< module not found.")
sys.exit(1)
try:
from rich import prin... |
import pytest
import numpy as np
import cmath
import math
from numpy.testing import assert_almost_equal
def test_phasor():
from electricpy.phasor import phasor
magnitude = 10
# basic angles test case 0
z1 = phasor(magnitude, 0)
z2 = phasor(magnitude, 30)
z3 = phasor(magnitude, 45)
z4 = phas... |
#
# Copyright (c) 2020-2021 The Board of Trustees of the Leland Stanford Junior University
# 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 abov... |
from random import random
import subprocess
from time import time
from random import randint, random
from tqdm import trange
import matplotlib.pyplot as plt
from math import sqrt, exp
pattern_num = 5
index_num = 38
'''
translate_raw = [
[0, 1, 2, 3, 4, 5, 6, 7], [8, 9, 10, 11, 12, 13, 14, 15], [16, 17, 18, 19, 20... |
# The MIT License (MIT)
# Copyright © 2021 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, ... |
from collections import (
defaultdict,
)
from concurrent.futures.thread import (
ThreadPoolExecutor,
)
from itertools import (
groupby,
)
import json
import logging
from operator import (
itemgetter,
)
import time
from typing import (
Any,
ClassVar,
Dict,
List,
Optional,
Sequence... |
import torch
from torch.functional import einsum
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torchsummary import summary
# from thop import profile, clever_format
def parameter_check(expand_sizes, out_channels, num_token, d_model, in_channel, project_demension, fc_demension):
chec... |
#!/usr/bin/env python
import os
import invdet
from invdet import bamExtractor
from invdet import peGenerator
from invdet.invdet_core import InvDector
from invdet.maxcut import MaxCut
import errno
import logging
import itertools
import argparse
import subprocess
import pysam
import multiprocessing
import signal
def ma... |
'''
This is the main data processing script. For all datasets, this script tokenizes every input/output and saves as pickle files.
'''
from helper import *
from proofwriter_classes import *
import random
random.seed(10)
def get_pw_fname(args, subdir, split, is_staged=True, equivalence=False):
if is_staged:
fname =... |
'''
(c) Copyright 2021
All rights reserved
Programs written by <NAME>
Department of Computer Science
New Jersey Institute of Technology
University Heights, Newark, NJ 07102, USA
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby grante... |
# python3
import base64
import json
import random
import time
import traceback
import urllib.request
import urllib.parse
# TODO some inflection tests fail. Change to warnings?
# the url to be tested
host = 'http://localhost:5000'
simple_urls = ['index', 'lexicon', 'partofspeech', 'defaulttable']
def lexicon():
... |
from PIL import Image
import os
import numpy as np
import pandas as pd
from preparation.concept_detection import loop_concepts, ugu_motif, pairs_stem, palindrome, \
AU_pairs_begin_maturemiRNA, large_asymmetric_bulge
import tensorflow as tf
from sklearn.model_selection import StratifiedKFold
import seaborn as sns
im... |
nrows = 3
import zipfile
with zipfile.ZipFile('Z:\\L2_data\\MDL\\20210621\\20210621_mdl_6_33_0.csv.zip') as zpobjct:
with zpobjct.open('mdl_6_33_0.csv','r') as f:
header = next(f).decode().strip().split(',')
rows = []
for i in range(nrows):
row = next(f).decode().strip().split(',... |
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# 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/lice... |
'''
this file contains old functions that are no longer used
!!! this file is not meant to be run !!!
1. Create and search for mock sources
2. Source detection in old line maps
'''
if __name__ == '__main__':
raise RuntimeError('this file cannot be executed (import functions you want instead)')
# --------------... |
# -*- encoding: utf-8 -*-
'''
@File : bitmex_gateway.py
@License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2021/4/3 10:08 <NAME> 1.0 None
'''
# encoding: UTF-8
from copy import copy
... |
import os
import sys
import tensorflow as tf
import numpy as np
import random
import time
import scipy as sp
import json
from setup_imagenet import ImageNet, ImageNetModel
from PIL import Image
def dump(img, path):
#save as npy
np.save(path + ".npy", img)
#save as png file
fig = (img + 0.5)*255
... |
import sys
import random
from tqdm import tqdm
import numpy as np
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.LSTMLM import LSTMLM
from models.RNNLM import RNNLM
from models.GRULM import GRULM
#Load data in memory from an input text (when cv is True, perform cv split)
def... |
import pylab as plt
import numpy as np
from skimage.io import imread
from skimage.transform import warp_coords
import skimage.measure
import skimage.transform
import torch.nn as nn
import torch.nn.functional as F
import torch
from torch.autograd import Variable
# from .pose_utils import LABELS, LABELS_PAF, MISSING_VALU... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
from ntpath import join
import c4d
from c4d import documents
import sys
from .CustomCmd import Cinema4DCommands as dzc4d
from .CustomIterators import TagIterator
from . import Database
from . import Utilities
class JointFixes:
joint_orient_dict = dict()
@staticmethod
def update_rotation_order(ctrl_name,... |
from idaapi import CF_USE1, CF_USE2, CF_USE3, CF_USE4, CF_USE5, CF_USE6
from idaapi import CF_CHG1, CF_CHG2, CF_CHG3, CF_CHG4, CF_CHG5, CF_CHG6
from idaapi import o_reg, o_imm, o_near, o_far, o_mem, o_displ, o_phrase, o_idpspec0, o_idpspec1
from idc import op_hex, GetOpnd
import __builtin__
import re
import ctypes
f... |
"""Class Namespaces (internal module).
All of the guts of the class namespace implementation.
"""
# See https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/
import collections.abc
import functools
import itertools
import weakref
from . import ops
from .descriptor_inspector import DescriptorInspect... |
# Copyright 2013-2018 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.txt' file ... |
#
# Modified by <NAME>
# Contact: <EMAIL>
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import logging
import numpy as np
import torch
import torchvision.transforms.functional as F
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as T
... |
import os
import getpass
import logging # For warning
from datetime import datetime
import time
import re
import pandas as pd
import numpy as np
import shutil # Notably for copyfile
from pathlib import Path
import seaborn as sns
import matplotlib.pyplot as plt
import jenkspy # Jenks clustering
import smtplib
from ... |
import json
import zlib
from datetime import datetime, timedelta
from django.db import transaction
from django.db.models.aggregates import Min
from django.db.utils import IntegrityError
from django.http.response import HttpResponse
from django.shortcuts import render
from django.utils import timezone
from api.decorat... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
__author__ = 'Altertech, https://www.altertech.com/'
__copyright__ = 'Copyright (C) 2012-2020 Altertech'
__license__ = 'Apache License 2.0'
__version__ = '0.0.3'
import eva.pluginapi as pa
import sqlalchemy as sa
import threading
import time
from neotasker import g, background_worker
from eva.client import apiclient... |
#!/usr/local/bin/python
'''
Parse a variant report returned by duplexCaller and filter the results to produce a readable report
BEGIN COPYRIGHT NOTICE
cfDNApipeline code -- (c) 2019 <NAME> -- GIS -- A*STAR
Copyright 2019 Genome Institute of Singapore (GIS) and Agency for Scienc... |
from rest_framework import permissions
from .models import *
from .serializers import *
class Helpers:
def day_has_child(self, team, day):
has_child = False
for child_type in ['task', 'note', 'file']:
child_set = getattr(day, child_type + 's')
if len(child_set.all()) > ... |
#!/usr/bin/env python
import os
import re
import sys
import teizone
import StringIO
import tempfile
import string
from collections import OrderedDict
from copy import copy
from six.moves.urllib.parse import urljoin
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
from xml.etree import Elem... |
import secrets
import time
from irctest import cases
from irctest.irc_utils.junkdrawer import to_history_message
from irctest.irc_utils.random import random_name
CHATHISTORY_CAP = 'draft/chathistory'
EVENT_PLAYBACK_CAP = 'draft/event-playback'
MYSQL_PASSWORD = ""
def validate_chathistory_batch(msgs):
batch_tag... |
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
import logging
import inspect
import pykka
import copy
import time
import traceback
from bll.common import util
from bll.common.exception import InvalidBllRequestException, BllException
from bll.api.auth_token import Tok... |
import stanza
import os
import json
from tqdm import tqdm
import sys,os
import pickle
import numpy as np
import sys,os
sys.path.append('/data/data/hujingpeng/sumwithGraph')
nlp = stanza.Pipeline('en', package='mimic', processors={'ner': 'radiology'})
nlp2 = stanza.Pipeline('en', package='mimic', processors='tokenize')... |
#
# The MIT License (MIT)
#
# This file is part of RLScore
#
# Copyright (c) 2012 - 2016 <NAME>, <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 witho... |
###########################################################
# Mini Web of Bits Virtual Agent using Q-Leaning Policy #
# #
# Developed by <NAME> #
# #
###################... |
import json
import os, ctypes
import re
from tkinter import ttk
from tkinter import messagebox as msg
from tkinter import *
import psutil
import subprocess
from urllib.request import urlopen
class Application:
def __init__(self, master, DNS: dict, connections: list):
self.dns = DNS
self.master = ma... |
# Copyright 2020 University of Illinois Board of Trustees. All Rights Reserved.
# Author: <NAME>, DPRG (https://dprg.cs.uiuc.edu)
# This file is part of Baechi, which is released under specific terms. See file License.txt file for full license details.
# =================================================================... |
import pygame, sys, random
from pygame.locals import * # import pygame modules
import engine as e
pygame.mixer.pre_init(44100, -16, 2,512)
clock = pygame.time.Clock()
pygame.init()
icon = pygame.image.load('data/images/entities/player/run/run_1.png')
pygame.display.set_icon(icon)
pygame.mixer.set_num_channels(64)
... |
import os
import pytest
import types
from werkzeug.datastructures import FileStorage
from app import create_app
from parser.base_parser import BaseParser
from parser.clear_parser import ClearParser
from parser.easynvesting_parser import EasynvestingParser
@pytest.fixture
def client():
app = create_app()
with app.... |
import argparse
import logging
import os
import random
import sys
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
from torch.nn.modules.loss import CrossEntropyLoss
from torch.utils.data import DataLoader
from tqdm import tqdm
from uti... |
import numpy as np
import tensorflow as tf
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.python.framework import function as tff
def energy_distance(f_sample, f_data):
nr_chunks = len(f_sample)
f_sample = np.concatenate(f_sample)
f_data = np.concatenate(f_data)
grads... |
"""Easily convert RGB video data (e.g. .avi) to the TensorFlow tfrecords file format with the provided 3 color channels.
Allows to subsequently train a neural network in TensorFlow with the generated tfrecords.
Due to common hardware/GPU RAM limitations, this implementation allows to limit the number of frames per
v... |
import itertools
import subprocess
import os
import re
import pytest
import sys
import contextlib
from conftest import PROCESS_SHUTDOWN_TIME, HcIdle
from Xlib import X, Xatom
HC_PATH = os.path.join(os.path.abspath(os.environ['PWD']), 'herbstclient')
@pytest.mark.parametrize('argument', ['version', '--idle'])
def tes... |
#!/usr/bin/env python3
from typing import Tuple, Optional, Dict, Iterator, Sequence
from pathlib import Path
import subprocess
import sys
import os
import argparse
import re
import urllib.request
from urllib.parse import urlparse
import http.client
import platform
import tempfile
import shutil
import shlex
from enum ... |
connect4_version = "0.51"
last_update = "10 Oct/2009"
import random
import curses
from sys import exit
def InitCurses():
'''Curses related stuff'''
global screen
screen = curses.initscr()
curses.noecho()
curses.start_color()
screen.keypad(1)
curses.init_pair(1, curses.COLOR_BLUE, curses.COLOR_BLACK) # Create ... |
from torchvision import transforms
from torch.utils.data import Dataset
import torch
import operator
import torch.nn.functional as F
from skimage.io import imread
from skimage import exposure, img_as_float
from utils.augmentation import Augmentation, cropCenter, toGrayscale
from utils.visualisation_helpers import plo... |
import tensorflow as tf
import numpy as np
import train
import sys
import pickle
sys.path.insert(0, 'Utils/')
import hparam
import amino_acid
import metric
import os
#predict GO terms based on fasta results.
def data_load_fasta(data_path):
seq_test=[]
new_seq={}
seq_ind={}
with open(data_path, "r") as f:
for l... |
import sys, csv, logging, argparse, subprocess, os, pickle, json, colorsys
from typing import Tuple, Dict
from operator import itemgetter
from functools import partial
from graphviz import Digraph
import matplotlib.pyplot as plt
import editdistance
from foldit.graph.Node import Node
from foldit.graph.graph_analysis ... |
import os
from functools import partial
from itertools import repeat
import json
import multiprocessing
from multiprocessing.pool import ThreadPool, Pool
import keras
import numpy as np
import librosa
from sklearn.preprocessing import StandardScaler
from kapre.time_frequency import Melspectrogram, Spectrogram
from at_... |
import os
import time
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial
from typing import *
import imageio
import mltk
import numpy as np
import tensorflow as tf
import tfsnippet as spt
from tensorflow.contrib.framework import add_arg_scope
from tensorflow.python.... |
"""
Copyright (c) 2021 TU Darmstadt
Author: <NAME> <<EMAIL>>
License: Apache License 2.0
"""
from __future__ import print_function
import os
import copy
import sys
import numpy as np
import time
import math
import random
import builtins
import setproctitle
from functools import partial
import torch
import torch.mul... |
# -*- encoding: utf-8 -*-
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.utils import formats
from django.conf import settings
from django.db.models import Max
from django import forms
from cal.models import SlotType
from cal.models import Slot
from cal.mode... |
# coding: utf-8
# In[1]:
# dependencies
import tensorflow as tf
import numpy as np
from sklearn.model_selection import train_test_split
import time
import pickle
import data_utils
import matplotlib.pyplot as plt
import re
import pandas as pd
from nltk.translate.bleu_score import sentence_bleu
# In[4]:
from coll... |
import os
from datetime import datetime
from django.db import models
from django.db.models import F, Max, Min
from config.settings.base import MEDIA_ROOT, PLAY_VIDEO_ROOT, PLAY_VIDEO_URL
from game.statcast import get_field_with_percentage, get_player_stats
LOGO_BASE_URL = f'https://www.mlbstatic.com/team-logos/' # ... |
import datetime
import json
from config import (
CannotLoadConfiguration,
Configuration,
temp_config,
)
from adobe_vendor_id import (
AdobeSignInRequestParser,
AdobeAccountInfoRequestParser,
AdobeVendorIDRequestHandler,
AdobeVendorIDModel,
MockAdobeVendorIDClient,
VendorIDAuthentica... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
import json
import random
import os
import time
import cv2
import numpy as np
from torch.utils.data import Dataset, DataLoader
import torch
from scipy import ndimage
from Configs import Config, features_clustering
from sklearn.metrics.cluster import normalized_mutual_info_score
import glob
from tqdm import tqdm
# Tra... |
# super basic tests / exploration
import numpy as np
import pandas as pd
import plotnine as p9
import svgutils.transform as sg
import io
import os
import re
import cairosvg
from PIL import Image
import progressbar
# for text in svg
import matplotlib.pyplot as plt
plt.rcParams['svg.fonttype'] = 'none'
# Predefined ... |
# script to make graph of connected components in a volume
import argparse
import logging
import pickle
from collections import defaultdict
from typing import Dict, Set, Tuple, Union
import cupy as cp
import cupyx.scipy.ndimage as cpnd
import h5py
import numpy as np
VolumeFile = Tuple[str, str]
ArrayTypes = Union[np.... |
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from bayes_filter import float_type, TEC_CONV
from bayes_filter.misc import safe_cholesky, flatten_batch_dims, make_coord_array
def hmc_matrix_stepsizes_1D():
num_chains = 2
# config = tf.ConfigProto()
# config.graph_options... |
import os
import string, random
import uuid
import re
from datetime import datetime, timedelta
import stripe
from flask import json, session, redirect, url_for, render_template, request, flash, jsonify
from garage_sale import app, user_image_dir, product_image_dir
from garage_sale.data_structures import get_product_f... |
import os
import warnings
import matplotlib as mpl
import seaborn as sb
import numpy as np
import matplotlib.pyplot as plt
import statistics
import pandas as pd
import logging
from df_creation import postprocess_vertex_df, get_users_map, get_file_tag
from dataset_paths import get_postprocess_folder_general, get_common... |
from logics.classes.exceptions import NotWellFormed
def separate_arguments(string, comma_separator):
"""
Given a string in forrmat '(x,y,z...)' returns a list with format ['x', 'y', 'z', ...]
Takes into account nested parentheses. For instance, '(1,(2,3),4)' will return ['1', '(2,3)', '4']
WILL NOT EL... |
import argparse
import collections
import gzip
import json
import logging
import math
import os
import statistics
import time
from typing import Dict, List, TypedDict
from roaringbitmap import RoaringBitmap
from sparklines import sparklines
from tdigest import RawTDigest
from engineering_notation import EngNumber
log... |
# -*- coding: utf-8 -*-
"""
other_algorithms.py: Baseline algorithms to compare against.
"""
import pdb
import numpy as np
from scipy.optimize import least_squares
from pylocus.lateration import SRLS
from coordinate_fitting import fit_trajectory
from solvers import trajectory_recovery
EPS = 1e-10
def error_meas... |
#!/usr/bin/env python
#
# Copyright 2016 Tangentix Ltd
"""
App Engine Settings Module
==========================
Provides cached settings for use by App Engine instances in the form of key value pairs
usage:
from settings import Settings
sett... |
#!/usr/bin/env python3
import anytree
import numpy as np
import pandas as pd
NODE1_COL = 'Node1'
NODE2_COL = 'Node2'
REL_COL = 'Relation'
#EDGE_TYPES
PARENT = "parent"
IS_INCLUDED_IN = "<"
INCLUDES = ">"
EQUALS = "="
DISJOINT = "!"
OVERLAPS = "o"
equals = np.array([0,1,0], dtype="bool")
overlaps = np.array([1,1,1], ... |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... |
#!/usr/bin/env python
# coding: utf-8
# # Scenario
#
# As an analyst for OilyGiant mining company our task is to find the best place for a new well.
#
# We will use several techniques, including machine learning and bootstrapping, to select the region with the highest profit margin.
#
# Machine learning prediction... |
"""
Package to facilitate API calls to the Yahoo Fantasy Sports API.
Required packages:
- xmltodict
TODO:
- matching algo: make better assignment of injuries
- comment new separation of team and api
- Make it more robust
- Parameter checking
- Make yahoo_auth part of the package and call it locally
"""
from __future__... |
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchbearer
from torchbearer import cite
IMAGE = torchbearer.state_key('image')
""" State key under which to hold the image being ascended on """
_stanley2007compositional = """
@article{stanley2007compositio... |
#!/usr/bin/env python3
#### PYTHON IMPORTS ############################################################
import argparse
import csv
import json
import numpy as NP
import os
import sys
import warnings
from collections import Counter
#### SCIKITLEARN IMPORTS #######################################################
from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, ... |
#!/usr/bin/env python3
import os
import numpy as np
from shutil import copytree, rmtree, copy2
import subprocess
import shlex
import sqlite3
from tqdm import tqdm
import shutil
import torch
from .torch_matchers import mutual_nn_matcher
from .colmap_read_model import CAMERA_MODELS, CAMERA_MODEL_IDS
from .colmap_read_m... |
# Importações de funções
from tkinter import Tk, Label, Button, Entry, font, StringVar, OptionMenu
from shutil import move
from getpass import getuser
from random import shuffle
from functools import partial
# Função para criação do documento de texto e importação para área de trabalho
def bt_click():
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.