text stringlengths 3.07k 22.1k |
|---|
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QFileDialog, QInputDialog
from PyQt5.QtCore import QObject, pyqtSignal, QThread, QMutex
from PyQt5.QtGui import QMovie, QImage, QPixmap, QIcon
from PyQt5 import QtGui, QtCore
import cv2 as cv
import source
import os
from MainWindow import Ui_MainWindow as ... |
import numpy as np
import pandas
from scipy.stats import rankdata
from bayesian_benchmarks.database_utils import Database
from bayesian_benchmarks.data import regression_datasets, classification_datasets
from bayesian_benchmarks.data import _ALL_REGRESSION_DATATSETS, _ALL_CLASSIFICATION_DATATSETS
_ALL_DATASETS = {}
_... |
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
"""
This file defines the public API for conda-build. Adding or removing functions,
or Changing argume... |
#!/usr/bin/env python3
#
# 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 "Li... |
from tkinter import *
from pandastable import Table
from pandastable import Table, TableModel
import tkinter
from tkinter import *
import tkinter as tk
import random
import time
import os
import shutil
import pdfminer
from pdfminer.high_level import extract_text
import os
import nltk
import numpy as np
f... |
from flask import Flask
from flask import jsonify
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from flask_bootstrap import Bootstrap
from flask_migrate import Migrate
import os
import json
import re
import requests
from twilio.util import TwilioCapabil... |
import httpx
import re
from io import BytesIO
import base64
from PIL import Image, ImageDraw, ImageFont
from datetime import datetime, timedelta
from nonebot.adapters.cqhttp.message import MessageSegment
from configs.pathConfig import PATH_PLUGIN_WEATHER, PATH_FONT
from .config import WEATHER_INFO, WIND_INFO
async d... |
"""
Python: 3.8.10
"""
import os
import pandas as pd
import datetime as dt
import re
from nltk import tokenize as token
import concurrent.futures as cf
import time
import pickle
# Symbols Extraction settings
"""
bracket_symbols_only: Find the companies only by brackets tickers if True, for both titles and contents
se... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
import numpy as np
import ray
class DataFrame(object):
def __init__(self, df, columns):
"""Distributed DataFrame object backed by Pandas dataframes.
Args:
... |
# Copyright 2016 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... |
import asyncio
import os
import random
import linecache
import inspect
from .. import cursor
from ..game import (StoreGamesWithResultMessageMixin,
StoreGamesWithSnapshotMixin,
Game)
class HangmanBoard:
_guessed_label = f'{cursor.RESET}{cursor.RED}missed:{cursor.RESET}{curso... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 6 14:21:48 2021
@author: Shaun
"""
import pandas as pd
import helper
YDS_DICT={"N/A":"N/A",'3-4':0,'5':1,'5.0':1,'5.1':2,'5.2':3,'5.3':4,'5.4':5,
'5.5':6,'5.6':7,'5.7':8,'5.8':9,'5.9':10,
'5.10a':11,'5.10b':12,'5.10c':13,'5.10d':14,
'5.11a'... |
import arcade
import layouts
import wall
import ball
# Constants
SCREEN_WIDTH = 500
SCREEN_HEIGHT = 400
WALL_THICKNESS = 20
BALL_SPEED = 3
BALL_MAX_X = 6
BRICK_SCORE = 10
PADDLE_SCORE_PENALTY = 1
LIFE_SCORE_PENALTY = 10
MAX_LEVEL = 4
BRICK_IMAGES = ['images/brick.png', 'images/brick2.png', 'images/brick3.png', 'images... |
from . import MTYPE_INVOKE, perform_request
from ..Codec import Codec
# rpc_lwip_accept(int32 s, in binary addr, inout uint32 addrlen) -> int32
def accept(s, addr, addrlen) :
codec = Codec(16, 1, MTYPE_INVOKE, "iI{}I", "Ii")
return perform_request(codec, s, addr, addrlen)
# rpc_lwip_bind(int32 s, in binary na... |
import cv2
import numpy as np
import os
import csv
import base64
import qrcode
from pdf2image import convert_from_path
from PIL import Image, ImageTk
from os import mkdir, path
import re
from qr_stamp.msgs import error_msgs as err
from random import randint
from qr_stamp.msgs import warning_msgs as warn
from qr_stamp.m... |
from __future__ import division
import os
import numpy as np
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
CSVDIR = os.path.join(
os.path.abspath(os.path.dirname(__file__)), 'data'
)
SENSOR_GROUPS = {
'WV2': 'WV',
'WV3': 'WV',
'WV4': 'WV_4band',
'GE... |
import os
import numpy as np
from astropy.coordinates import SkyCoord, Angle
import astropy.units as u
from astropy.io import fits
from astropy.table import Table, vstack
from src.utils import Str
import src.globals as glo
def write_col_cat(c, wts, cdists):
col_cat = c.file_calibrated_combined.clean_cat.to_panda... |
# @Time : 2/4/2022 1:32 PM
# @Author : <NAME>
# System related packages
import os
# File related packages
import csv
def single_label(location, label_index, label_result):
"""
Sweeps the files within a folder and outputs a list for each label
:param label_result:
:param label_index:
:param locati... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
import torch.nn as nn
import torch.nn.functional as F
import torch
from models.attention import CBAM3D, SELayer3D
try:
from .sync_batchnorm import SynchronizedBatchNorm3d
except:
pass
def normalization(planes, norm='bn'):
if norm == 'bn':
m = nn.BatchNorm3d(planes)
elif norm == 'gn':
m... |
import spotipy
import pydantic
from typing import Dict, Union, List, TypedDict, Any
from spotipy.oauth2 import SpotifyOAuth
from spotiPlus.spotify.secrets import (
SPOTIFY_CLIENT_ID,
SPOTIFY_CLIENT_SECRET,
REDIRECT_URI,
SCOPE,
)
from spotipy.exceptions import SpotifyException
# Spotify OAUTH2.0
sp =... |
"""
Generic runtime exception feedback class.
"""
from pedal.core.location import Location
from pedal.core.report import MAIN_REPORT
from pedal.sandbox.data import format_contexts
from pedal.utilities.exceptions import KeyError, get_exception_name
from pedal.core.feedback import FeedbackResponse
from pedal.sandbox impo... |
import collections
import csv
import itertools
import json
import logging
import os
import time
from typing import Iterator
import fastavro
import numpy as np
import tensorflow as tf
from gdmix.models.schemas import BAYESIAN_LINEAR_MODEL_SCHEMA
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
INTE... |
# -*- coding: utf-8 -*-
# Copyright 2008-2016 <NAME> (<EMAIL>)
# This file is part of wikitools.
# wikitools 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 3 of the License, or
# (at your opti... |
# -*- coding: utf-8 -*-
"""
This file is part of Ludolph: Ansible plugin
Copyright (C) 2015 Erigones, s. r. o.
See the LICENSE file for copying permission.
"""
from __future__ import absolute_import
import fnmatch
from six import text_type, iteritems
from ansible import constants
from ansible import utils
from ansib... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Utility functions """
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
from scipy import stats
import matplotlib.pyplot as plt
import plotly.figure_factory as ff
import plotly.graph_objs as go
from plotly import tools
warnings.simplefil... |
from collections import defaultdict
from dataclasses import dataclass, field
import os
import pickle
from typing import Dict, Optional
import numpy as np
def list_duplicates(tokens):
tally = defaultdict(list)
for i,item in enumerate(tokens):
tally[item].append(i)
return [(key,locs) for key,locs in... |
"""
In this example, we will customize the trainer to use custom metrics and perform validation based on one of the custom metric
by subclassing the ClassifierTrainer
"""
from PyTorchTrainer import ClassifierTrainer, get_cosine_lr_scheduler
import os, sys, getopt, pickle
import torch
import torchvision
import torchvi... |
import cProfile
import pprint
from collections import Counter
import numpy as np
from mpi4py import MPI
import common_settings
import continuum_goodness_of_fit
import median_transmittance
import physics_functions.delta_f_snr_bins
from continuum_fit_container import ContinuumFitContainerFiles, ContinuumFitContainer
fr... |
# array._array_reconstructor is a special constructor used when
# unpickling an array. It provides a portable way to rebuild an array
# from its memory representation.
import sys
from pypy.interpreter.gateway import unwrap_spec
from pypy.interpreter.error import OperationError
from pypy.interpreter.argument import Argu... |
#! /bin/python3
from pathlib import Path
import json
import xml
import sys
skipcategories = ["macros"]
apiblacklist = {"RDEvent_Unsubscribe"}
allcallbacks = {}
def check_struct_proxies(catobj):
structproxies = {}
for s in catobj["structs"]:
for f in s["fields"]:
if not f["callback"]:
... |
import os
import unittest
from io import StringIO
from cpylog import get_logger
import pyNastran
from pyNastran.converters.abaqus.abaqus import read_abaqus
from pyNastran.converters.abaqus.abaqus_to_nastran import (
nastran_to_abaqus_filename, abaqus_to_nastran_filename)
PKG_PATH = pyNastran.__path__[0]
MODEL_PAT... |
# -*- coding: utf-8 -*-
"""
Created on 09/05/2020
@author: <NAME>
Radial profile of Lick indices
"""
import os
import numpy as np
from astropy.io import fits
from astropy.table import Table, join, vstack
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.patches import Rectangle... |
import json
import random
from datetime import datetime
from sqlalchemy import select, and_, inspect
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (
Column, TIMESTAMP as DateTime, String, Text, Integer, Float)
from flask import g
from uservice.database.basesqldb import SqlDB
Bas... |
"""
Copyright (c) 2019 <NAME> <<EMAIL>>
This library is responsible for MNIST related operations from reading, plotting, processing, etc.
"""
import os
import struct
import numpy as np
from inf.db_handler import MongoManagement
from inf.disk_ops import save_processed_mnist_to_disk
from inf import runtime_data
from ipu... |
"""
converter.py
Convert those silly plain text readmes to markdown easily!
"""
import sys
import subprocess
import requests
import json
import argparse
import getpass
from shutil import copyfile
from requests.auth import HTTPBasicAuth
# Project information
__author__ = "<NAME>, and <NAME>"
__credits__ = ["<NAME>",... |
import os
import sys
import time
import json
from io import StringIO
from os import PathLike
from typing import Union, BinaryIO
import usb.core
import usb.util
import tqdm
from zlib import adler32
import threading
import logging
from modtpy import api
from modtpy.api.usb import USBDevice, Mode
from modtpy.api.utils ... |
#!/usr/bin/env python3
import argparse
import operator
import threading
from time import sleep
import cv2
import depthai as dai
import socket
from common import target_finder
from common.config import NN_IMG_SIZE
from pipelines import object_detection, object_tracker_detection, object_edge_detection
import logging
... |
"""
test_form.py
Test submission to the FishFry Form.
"""
import os
import json
import decimal
import unittest
import uuid
from random import sample
from datetime import date
from dateutil.parser import parse
from core import application, api, application_db, dynamo_db
from core.config import basedir
from core.mode... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from keras import backend as K
from keras import activations, initializations, regularizers, constraints
from keras.layers import Layer, InputSpec
from keras.utils.np_utils import conv_output_length
import theano
import theano.tensor a... |
# -*- coding: utf8 -*-
""" Views for the base application """
import os.path
import re
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts impo... |
import os
import time
import requests
import datetime
import secrets
import pytest
import paramiko
import logging
import random
class WaitCommandErrorException(Exception):
pass
class WaitResFailedException(Exception):
pass
DEFAULT_FIXTURE_SERVER = {
"datacenter": "IL",
"image": "ubuntu_server_18.0... |
import pickle
import pandas as pd
from typing import Tuple
"""
Columns to include when loading the data from dot_traffic_2015.txt.gz
The columns record_type, restrictions, year_of_data and lane_of_travel were excluded
as they did not contain very useful information
i.e. record_type: 3 for all the ro... |
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import tenso... |
import numpy as np
import pandas as pd
import json
import pickle
from TaxoTree import *
import argparse
# 匹配raw_taxostr
def match_raw_taxostr(sota_result, datafile):
# 获取文章id
article_ids = [text.split(' : ')[0] for item in sota_result for text in item[1]]
# 获得year-identification字典
year_identificat... |
import numpy as np
import csv
import json
import os
import datetime
import matplotlib.pyplot as plt
import seaborn as sb
import shutil
import pprint
pp = pprint.PrettyPrinter(indent=4)
import config
import utils
class TaskTarget:
def __init__(self, video_ID, fnum_from, fnum_to):
self._video_ID = video_ID... |
'''
A collection of simplified functions to compute the LRP harmonic similarity.
'''
from ChordalPy.Transposers import transpose
from ngrams_lib import extract_ngrams
from harmonic_lib import ngram_hsim
from chord_encodings import ChordEncodingError
CHORD_MAP = {
"E:min7(b5)": "E:min7",
"F:min7(b5)": "F:min... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright © 2018 Endless Mobile, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your opt... |
import os
import time
import yaml
from component import mymysql, dingding_webhook
table_define_fc = None
application = None
db_config = None
table_defines = [] # {"s_d": "","s_t": "","t_d": "","t_t": ""}
total_table_count = 0
select_sql_list = []
now_time_second = int(time.time())
if not os.path.exists("temp"):
... |
#!/usr/bin/env python3
import logging
import os
import threading
from logging import Filter
from os.path import expanduser
from pathlib import Path
from typing import Union
from dotenv import load_dotenv
import broker._utils.colored_traceback as colored_traceback
# from web3 import Web3
# from eblocbroker.Contract ... |
# Copyright 2000-2020 JetBrains s.r.o.
# Use of this source code is governed by the Apache 2.0 license that can be found
# in the LICENSE file.
"""User dialog related procedures."""
import sys
from os.path import expanduser
from typing import Optional, Dict, List, Tuple
import click
import netifaces # type: ignore... |
import glob
import os
import random
import cv2
import keras.backend as K
import numpy as np
from keras.callbacks import LearningRateScheduler
from keras.losses import mean_squared_error
from keras.optimizers import SGD
from matplotlib import pyplot
from model import FullyConvolutionalNetwork
def prepare_batch(input... |
# Author: <NAME>
# License: MIT
# Contributors:
# <NAME>
import sys
import struct
from base64 import b64encode
from hashlib import sha1
import logging
from socket import error as SocketError
import errno
if sys.version_info[0] < 3:
from SocketServer import ThreadingMixIn, TCPServer, StreamRequestHandler
else... |
import os
import sys
import string
import csv,re,io
import nltk
os.environ['SPARK_HOME'] = "/home/sam/spark-1.6.1-bin-hadoop2.6/"
sys.path.append("/home/sam/spark-1.6.1-bin-hadoop2.6/python")
os.environ['PYSPARK_PYTHON'] = "/home/sam/anaconda3/bin/python3.5"
try:
from nltk.corpus import stopwords
from nltk.s... |
"""
### 5.4 Direct
The following section contains normative clauses for Linked Data Platform
Direct Container.
#### 5.4.1 General
##### 5.4.1.1 Each LDP Direct Container _MUST_ also be a conforming LDP
Container in section 5.2 Container along the following restrictions. LDP
clients _MAY_ infer the following triple: ... |
"""
-------------
| CTF Ware |
------------
| hlpr |
--------
Version: 1.1
Date: Dec/2021
------------------------------
---------------
Additions Made:
---------------
+ Request for user's IP.
+ API commands
+ Reverse Shell commands.
+ Python Server commands.
------------------------------
"""
... |
'''
Dragon Radar -- create MKVs from R2 video and R1 audio/subs
'''
import os
import sys
import argparse
import configparser
import tempfile
import logging
import atexit
import colorama
import time
import constants
from episode import Episode
from utils import (get_op_offset,
pad_zeroes,
... |
from datetime import datetime
import os
import boto3
import math
from suricataparser import parse_rule, parse_file
s3 = boto3.client('s3')
anf = boto3.client('network-firewall')
ec2 = boto3.client('ec2')
ssm = boto3.client('ssm')
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
today_date = datetime.now().strftim... |
from progonka import *
from math import *
import numpy as np
def get_abs_dif(y_n_s_minus_1, y_n_s):
return fabs((y_n_s - y_n_s_minus_1) / y_n_s)
def get_max_dif_from_result(T_list, T_new_list):
max_dif = 0
for i in range(len(T_list)):
dif = get_abs_dif(T_list[i], T_new_list[i])
if (max_di... |
import numpy
from oasys.util.oasys_util import write_surface_file
from orangecontrib.esrf.wofry.util.thin_object import WOThinObject, WOThinObject1D #TODO from wofryimpl....
from wofry.beamline.decorators import OpticalElementDecorator
class WOThinObjectCorrector(WOThinObject, OpticalElementDecorator):
def __ini... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (c) Ostap developers.
# =============================================================================
# @file test_fitting_resolutions.py
# Test module for ostap/fitting/resolution.... |
#!/usr/bin/python -u
# coding=utf-8
"""
Generic Data Manager implementation with concrete subclasses
Here we include subclasses to handle saving data to csv or to mysql database
"""
import logging
import os
import pandas as pd
from pathlib import Path
from dbinfo import DBInfo
from logmanager import MessageHandler
from... |
"""
Stub implementation of EdxNotes for acceptance tests
"""
import json
import re
from copy import deepcopy
from datetime import datetime
from math import ceil
from uuid import uuid4
from urllib.parse import urlencode
from .http import StubHttpRequestHandler, StubHttpService
class StubEdxNotesServiceHandler(Stub... |
from datetime import datetime, timedelta, time
import pandas as pd
class Battery:
def __init__(self, battery_size=5000):
self.battery_size = battery_size
self.current_charge = 0
def use_battery(self, energy):
if energy > 0:
residual = self.charge(energy)
return... |
import urllib.request
import re
import html
import os
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
wikibase = 'https://share.coursera.org'
baseurl = wikibase+'/wiki/index.php'
categories = [
'Sna',
'Pythonlearn',
'Fantasysf',
'Introfinance',
'Introthermodynamics',
'Modelthinking',
'... |
#!/usr/bin/python3
#-*- coding: utf-8 -*-
from enum import Enum
from DipTraceUnits import *
from DipTracePatternLibrary import *
class DipTracePin:
def __init__(self, number, name=None):
self.number = number
self.name = name or 'P{0}'.format(number)
self.setLocked()
self.setEnabled()
self.setType()
s... |
import tensorflow as tf
from tensorflow import keras
import cv2
from scipy import io
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
from tensorflow.keras.utils import get_file
from tensorflow.keras.models import Model
from tensorflow.keras.callbacks import *
from preprocess import get_d... |
import sys
sys.path.extend(['../'])
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from net.utils.graph import Graph
from net.subnet.st_gcn import *
from net.subnet.discriminator import Discriminator
class ST_AAE(nn.Module):
def __init__(self, in_channels, T, V, num_cl... |
from flask import request, abort, g, Response
from flask_restx import Namespace, Resource, reqparse
from flask_accepts import accepts
from annotationengine.anno_database import get_db
from annotationengine.aligned_volume import get_aligned_volumes
from annotationengine.errors import SchemaServiceError
from annotationen... |
from typing import List
from hwt.hdl.constants import DIRECTION, INTF_DIRECTION
from hwt.interfaces.std import VectSignal
from hwt.serializer.ip_packager import IpPackager
from hwt.synthesizer.interface import Interface
from hwt.synthesizer.interfaceLevel.unitImplHelpers import getSignalName
from hwt.synthesizer.param... |
import torch
from quoridor import encode_loc, parse_loc, Quoridor
from typing import Iterable, Union
# TODO - extend to 4-player games? All functions here currently assume 2-player
# TODO - make batch operations
STATE_SHAPE = (6, 9, 9)
POLICY_SHAPE = (3, 9, 9)
def flip_y_perspective(row:int, current_player:int, is_v... |
import os
import numpy as np
import pandas as pd
import importlib
import time
import sys
# Custom import
from src.data_processing.xbrl_parser import XbrlParser
xbrl_parser = XbrlParser()
class XbrlExtraction:
"""
"""
def __init__(self):
self.__init__
@staticmethod
def get_filepaths(dire... |
from keras import layers as kl
from keras import regularizers as kr
import keras.initializers as ki
from keras.initializers import Initializer, serialize, deserialize
from keras import backend as K
import concise
from concise.utils.pwm import PWM, pwm_list2pwm_array, pwm_array2pssm_array, DEFAULT_BASE_BACKGROUND
from k... |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from itertools import combinations
import numpy as np
class PairsProcessor(object):
"""Returns pairs sampled for LPOCV
"""
def __init__(self, dataset=None, pair_settings=None):
self.selected_pairs = []
if dataset:
self.generate_all_pairs(dataset)
if pair_settings:
... |
import collections
from ..data import RNAINTERACTION
class Designsequence:
def __init__(self, sequence, listofdist=None, cutofffreq=0,
initialize_mers=None):
"""
:param sequence: RNA sequence of a part
:type sequence: str
:param listofdist: list of structures with distri... |
# python3
# para que descargue pasar como argumento el activo_id
# este modulo no actualiza la base de datos, solo descarga
import sqlite3
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.common.exceptions import TimeoutException, WebDriverException
from lxml import h... |
import math
import numpy as np
import obj as obj_lib
import rect as rect_lib
import road_artifact as ra
import utilities as u
class Road(obj_lib.Obj, rect_lib.RectDirection):
LANE_WIDTH = 5.0 # 3.7 meters + buffer for lines
def __init__(self, pygame, screen, id, rect_parms, direction_road, direction_lanes, r... |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 13 17:45:11 2018
@author: <NAME>
@e-mail: <EMAIL>
Program for analysis and creation of fragmentation diagrams in mass spectrometry out of .csv files
"""
import os
import time
from tkinter import filedialog
import pandas as pd
import numpy as np
from numpy import tra... |
from ipykernel.kernelbase import Kernel
import pexpect
from subprocess import check_output
from os import unlink, path
import base64
import imghdr
import re
import signal
import urllib
import sys
from ipykernel.comm import Comm
from ipykernel.comm import CommManager
import JuPyMake
kernel_object_for_ipython = Non... |
import json
import html5validate
import unittest
from django.test import TestCase
from django.urls import reverse
from django.core import mail
from django.contrib.auth.models import User
from allauth.socialaccount.models import SocialAccount
from signatories.orcid import name, institution, jpath, urlize, homepage, f... |
"""
This file generates a plot of L_recon wrt the two input images when interpolating between them for the validation set
, given a model.
"""
import argparse
import os
import torch
from torch.utils.data import DataLoader
from torchvision.transforms import transforms
from data.celeba_cropped_pairs_look_alike im... |
import numpy as np
from bilby.core.prior import PriorDict, Uniform, LogUniform, Normal
from .priors import SpikeAndSlab
class JointFluxModel(object):
def __init__(self, flux_model_A, flux_model_B):
self.models = []
if isinstance(flux_model_A, JointFluxModel):
self.models += flux_mode... |
# coding=utf8
from __future__ import print_function
import re
import os
import json
import copy
import time
import signal
import platform
import argparse
import frida, sys
from pprint import pprint
from record_inputs import record_inputs_on_dialog as dialog
from record_inputs import record_inputs_on_activity as activi... |
import time
from collections import defaultdict, Counter, deque, ChainMap
from itertools import product
from multiprocessing import Pool
def d15(inp):
p1, p2 = None, None
turn_spoken = ChainMap()
num_hidden = 0
maps_hidden = 0
low_len = 1024
max_sz = 1024 * 4
low_nums = [0] * low_len
c... |
import sys
sys.path.insert(0, "./")
from functools import partial
import d4rl
import torch.nn as nn
from rlf import run_policy
from rlf.algos import (GAIL, PPO, BaseAlgo, BehavioralCloning,
BehavioralCloningFromObs, BehavioralCloningPretrain,
GailDiscrim)
from rlf.algos.... |
import uuid
from abc import ABC, abstractmethod
from copy import copy
from inspect import isclass
from contextlib import contextmanager
from pulsar.api import UnprocessableEntity, MethodNotAllowed, context
from .component import Component
from .schema import resource_name, get_schema_class
from ..utils.data import c... |
import os
from cs50 import SQL
from flask import Flask, flash, jsonify, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, ge... |
# Copyright 2018 <NAME>. 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 ... |
import logging
from itertools import permutations as permut
from itertools import product
from collections import defaultdict
import pytest
from renormalizer.utils.constant import ev2au, fs2au
from renormalizer.utils import Op
from renormalizer.model import MolList2, ModelTranslator
from renormalizer.utils import bas... |
from flask import Flask, request, jsonify
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address, get_ipaddr
from sqlalchemy.dialects.mysql import VARCHAR, BIGINT, TIMESTAMP, TINYINT, LONGTEXT, DATE, DATETIME, INTEGER
impor... |
import logging
import os
import platform
from six import (
integer_types,
string_types,
binary_type,
iteritems
)
from ...compat import urlencode
from ...compat import urlparse
from ...compat import urlunparse
from ... import __version__
from ...exceptions import TwilioException
from ..exceptions impor... |
#!/usr/bin/python3
import json
import warnings
import pytest
import brownie
from brownie._config import ARGV, CONFIG
from brownie.exceptions import VirtualMachineError
from brownie.network.state import _get_current_dependencies
from brownie.test import coverage, output
from .base import PytestBrownieBase
from .util... |
import random
import os
import torch
from torch import nn, optim
from data import SOS_token, batch2TrainData, create_batches, prepareData, Lang
from model_batch import EncoderRNNBatch, LuongAttnDecoderRNN
# For pytorch 1.1
# def maskNLLLoss(inp, target, mask, device):
# nTotal = (mask == True).sum()
# crossEnt... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
import argparse
import sys
#try:
# import matplotlib.pyplot as plt
#except:
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from em_pe.models import model_dict
def _parse_command_line_args():
'''
Pars... |
import pandas as pd
from re import findall
from pickle import dump
from timeit import default_timer as timer
from subprocess import call
def grace(patient_data, risk_factors, risk_threshold=145):
risk=0
for i in range(0, len(risk_factors)):
factor = risk_factors[i]
if factor... |
import sys
import os
import logging
import json
import importlib
from dataclasses import dataclass
from panda3d.core import (
Filename,
loadPrcFileData,
TextNode,
ConfigVariableBool,
WindowProperties
)
from direct.showbase.DirectObject import DirectObject
from direct.gui import DirectGuiGlobals a... |
# -*- coding: utf-8 -*-
"""
Preprocessing script
Created: 2020/03/18
Script to concatenate all the saved REM epochs of control and subject groups,
split train and test sets and prepare for CNN classification.
"""
import numpy as np
from numpy import loadtxt
import h5py
import time
from scipy.signal import butter, l... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import (NON_FIELD_ERRORS, ObjectDoesNotExist,
ValidationError)
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.