text stringlengths 3.07k 22.1k |
|---|
# author: <NAME>, <NAME>, <NAME>
# date: 2020-01-23
'''
Train an average ensemble model based on a Random Forest regressor model,
a XGBoost regressor model and a LightGBM model with a set train and test data.
Then, output the results in charts and tables in terms of test dataset performance.
Usage: model.py --source_... |
"""Add Office for National Statistics Postcode Directory data
This script joins a .csv file with a postcode column with the ONS Postcode
Directory.
This script has no command line options.
"""
from __future__ import annotations
import time
from typing import TYPE_CHECKING
import pandas as pd
from incognita.data im... |
"""Read a GO Association File (GAF) and store the data in a Python object.
Annotations available from the Gene Ontology Consortium:
http://geneontology.org/page/download-annotations
GAF format:
http://geneontology.org/page/go-annotation-file-formats
"""
import sys
import os
import re
import c... |
#!/usr/bin/python3
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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 requir... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by <NAME> and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
"""
import os
import time
import random
import argparse
import numpy as np
from pathlib import PurePath
import torch
import torch.utils.data
import torch.nn as n... |
#!/usr/bin/env python3
"""
Implements a node
"""
import threading
import time
from ast import literal_eval as make_tuple
import logging
import pika
from fifo import Fifo
MSG_ADVISE = "advise"
MSG_INITIALIZE = "initialize"
MSG_PRIVILEGE = "privilege"
MSG_REQUEST = "request"
MSG_RESTART = "restart"
WORK_TIME = 2
... |
import time
import threading
from StreamDeck.DeviceManager import DeviceManager
from streamdeck.models import (
Streamdeck, StreamdeckModel, StreamdeckKey, Folder)
from functools import partial
from .image_handling import (
update_key_image, start_animated_images, clear_image_threads,
create_full_deck_sized... |
import project
import sys
import os
import numpy as np
import tensorflow as tf
import time
import numpy as np
import pickle
from io import BytesIO
from PIL import Image
from datetime import datetime
def benchmark_function(fn, input_gen_fn, batch_size, avg_after):
iter_num = 0
avg_latency = 0
avg_throug... |
# -*- coding: utf-8 -*-
"""
gc_crawler.utils
-----------------
Various gc_crawler util functions/classes used in other modules
"""
from pathlib import Path
from typing import Union, List, Any, Dict, Generator, Iterable
import zipfile
import copy
import tempfile
import shutil
from hashlib import sha256
from functools im... |
# coding=utf-8
from psi.app.utils import user_has_role, format_util
from flask import url_for, render_template
from flask_babelex import lazy_gettext
from markupsafe import Markup
from psi.app.views.views_mapping import get_endpoint_by_type_attr
has_invoice_field = {'label': lazy_gettext('Has Invoice'), 'field': 'has... |
import cv2
import numpy as np
import copy
import random
import math
class Node(object):
def __init__(self, pos=[0, 0]):
self.pos = pos
self.parent = None
class RRT(object):
def __init__(self, map_path, qstart, qgoal, grid_size, step_size,
max_steps=1000, goal_prob=0.0):
... |
# Version 1.0. <NAME>
# Copyright (c) 2019 Potsdam university
# Fisher forecast Matrix approach
# execute fisher.c code(by <NAME>:https://github.com/CullanHowlett/PV_fisher) on a set of survey parameters
# to determine the expected value of fsi... |
#!/usr/bin/python
import psycopg2
from config import config
from datetime import datetime, timedelta, date
import csv
import requests
from bs4 import BeautifulSoup
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
name2ID = {'Hawks': '1610612737','Celtics': '1610612738','Nets': '1610612751','Hornets'... |
#!/usr/bin/env python
# /********************************************************************
# Filename: train.py
# Author: AHN
# Creation Date: Feb 16, 2018
# **********************************************************************/
#
# Build and train threeclasses model for Go board intersections (BEW)
#
from __futu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ███╗ ███╗ █████╗ ███╗ ██╗██╗ ██████╗ ██████╗ ███╗ ███╗██╗ ██████╗
# ████╗ ████║██╔══██╗████╗ ██║██║██╔════╝██╔═══██╗████╗ ████║██║██╔═══██╗
# ██╔████╔██║███████║██╔██╗ ██║██║██║ ██║ ██║██╔████╔██║██║██║ ██║
# ██║╚██╔╝██║██╔══██║██║╚██╗██║██║██║ ██║ ██... |
import time
import os
import errno
import uuid
import shutil
from zipfile import ZipFile, ZIP_DEFLATED
from DataFileUtil.DataFileUtilClient import DataFileUtil
from KBaseReport.KBaseReportClient import KBaseReport
from ReadsUtils.ReadsUtilsClient import ReadsUtils
from AssemblyUtil.AssemblyUtilClient import AssemblyUt... |
import json
import sys
import os
from bs4 import BeautifulSoup
import ast
import csv
import re
import urllib3
import certifi
import time
import subprocess
import configuration as c
filtered_heuristic = './repos_mining_data/otherData/repos_filtered_launch_file.json'
metrics_exported_gdrive = './repos_mining_data/other... |
import pyrealsense2 as rs
import numpy as np
def file_exists(filename):
try:
f = open(filename)
f.close()
return True
except IOError:
return False
class Camera:
def __init__(self, conf):
self.vid_h = conf.vid_h
self.vid_w = conf.vid_w
self.calib_f... |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / <EMAIL>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
#!/usr/bin/env python
"""
IceAllPartials procedures:
(1) For each input fasta file (i.e., each splitted nfl read file), map its
reads to unpolished consensus isoforms in ref_fasta
(i.e., final.consensus.fasta), then create a pickle file
(e.g. *.partial_uc.pickle).
(2) Wait for all pickle files to be creat... |
"""Pytest utility classes, functions and fixtures."""
import inspect
import itertools
import os
import random
import types
import numpy as np
import pytest
import geomstats.backend as gs
def autograd_backend():
"""Check if autograd is set as backend."""
return os.environ["GEOMSTATS_BACKEND"] == "autograd"
... |
from typing import List, Optional, Tuple
from collections import defaultdict
import pickle
import json
import argparse
from os import path
from math import log
from typing import Union, Dict
from sklearn.feature_extraction.text import TfidfVectorizer
from qanta_util.qbdata import QantaDatabase
from tfidf_guesser_tes... |
import logging
import requests
from io import BytesIO
from PIL import Image, ExifTags
from PIL import ImageOps, ImageDraw
log = logging.getLogger(__name__)
class CloudStorageImageResizerException(Exception):
pass
class InvalidParameterException(CloudStorageImageResizerException):
pass
class CantFetchImage... |
# Advent of Code, Day 16
#
# Parse hierarchy of binary codes into numeric literals and operations.
# For part 2, recursively evaluate the resulting expression using a
# LISP-like approach.
#
# AK, 16/12/2021
# For converting hex digit to binary
h2b = {'0': '0000', '1': '0001', '2': '0010', '3': '0011',
'4': '0100'... |
#
# Copyright (C) 2020 <NAME> <<EMAIL>>.
# SPDX-License-Identifier: MIT
#
r"""Collect network info from fortios' configuration.
"""
from __future__ import absolute_import
import collections.abc
import ipaddress
import itertools
import logging
import os.path
import anyconfig
from . import netutils, parser, utils
NE... |
import torch
import torch.nn as nn
from utils import AttrDict,get_stft_outch,get_stft_outlen,init_weights,get_padding_down
from torch.nn.utils import weight_norm,remove_weight_norm
from torchsummaryX import summary
from layers import ResBlock
import math
from torch.utils.tensorboard import SummaryWriter
class BaseModel... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains extended functionality for QMenus
"""
from __future__ import print_function, division, absolute_import
from Qt.QtCore import Qt, Signal
from Qt.QtWidgets import QLineEdit, QMenu, QActionGroup, QAction, QWidgetAction
from tpDcc.libs.python impor... |
import json
from dataclasses import dataclass, field
from typing import Optional, Tuple
import torch
from transformers.training_args import TrainingArguments, cached_property, torch_required
@dataclass
class ModelArguments:
"""Arguments pertaining to which model/config/tokenizer we are going to
fine-tune fro... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
import re
import shlex
import subprocess
from ..common.info import UNKNOWN
from . import source
IDENTIFIER = r'(?:[a-zA-z]|_+[a-zA-Z0-9]\w*)'
TYPE_QUAL = r'(?:const|volatile)'
VAR_TYPE_SPEC = r'''(?:
void |
(?:
(?:(?:un)?signed\s+)?
(?:
char |
short |
... |
#! /usr/bin/env python
#
# GUI module generated by PAGE version 4.11f
# In conjunction with Tcl version 8.6
# Feb 28, 2018 04:08:02 PM
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = 0
except ImportError:
import tkinter.ttk as ttk
py3 = ... |
################################################################################
#
# This file is implements a CLI which can be used to generate a speaker
# verification trial list based on a voxceleb-structured directory tree and meta file.
#
# Author(s): <NAME>
########################################################... |
#!/usr/bin/env python3
# encoding: UTF-8
"""
Filename: tic_tac_toe.py
Date: 2019-09-22 04:12:17 PM
Author: <NAME>
E-mail: <EMAIL>
License:
The code is licensed under MIT License. Please read the LICENSE file in
this distribution for details regarding the licensing of this code.
Description:
Implementatio... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import targetprofilerulematcher
class TrialMatchResult(object):
""" Indicates the matching result between a patient and a trial.
"""
PASS = True
UNSURE = None
FAIL = False
def __init__(self, trial, tests):
self.trial = trial # Tr... |
from lxml import etree
import sys
"""
This program reads in an xml tree and applies xsl tranformations to various levels of the tree.
The first 4 functions apply xsl tranformations to a single level of the tree and create an HTML file with the result.
The rest of the functions are helper functions for indexing descen... |
"""Module for aiopg transaction utils"""
import asyncio
import sys
from typing import Dict, Optional, Union
import aiocontextvars as contextvars
from aiopg.sa.connection import SAConnection
import aiopg.sa.engine
transaction_connections_var = contextvars.ContextVar("transaction_connections")
def get_current_task() ... |
from abc import abstractmethod, ABCMeta
from collections import deque
from collections.abc import KeysView, MutableMapping
from types import MappingProxyType
from typing import Any, Iterator
from itemadapter.utils import (
is_attrs_instance,
is_dataclass_instance,
is_item,
is_scrapy_item,
)
__all__ =... |
# Copyright 2019 <NAME>. All rights reserved.
# Copyright 2019 DATA Lab at Texas A&M University. All rights reserved.
# Copyright 2019 DeepMind Technologies 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.
# ... |
# coding: utf-8
import itertools
import random
import math
from handright._exceptions import *
from handright._template import *
from handright._util import *
# While changing following constants, it is necessary to consider to rewrite the
# relevant codes.
_INTERNAL_MODE = "1" # The mode for internal computation
_... |
import os
import logging
import requests
from requests.utils import quote
import xml.dom.minidom
from pywb.warc.recordloader import ArcWarcRecordLoader
from pywb.utils.bufferedreaders import DecompressingBufferedReader
logger = logging.getLogger(__name__)
HDFS_ROOT = os.environ.get('HDFS_ROOT','')
CDX_SERVER = os.en... |
import os
import sys
import textwrap
import unittest
from collections import OrderedDict
import six
from mock import Mock
from mock.mock import call
from parameterized import parameterized
import pytest
from conans.client.graph.python_requires import ConanPythonRequire
from conans.client.loader import ConanFileLoader... |
"""
lecturenotes2pdf.notebook
Interface to LectureNotes notebooks
"""
from collections import namedtuple
import logging
import os
import os.path
import xml.etree.ElementTree as ET
_log = logging.getLogger(__name__)
class NotebooksBoard(object):
def __init__(self, path):
if path.endswith('settings.xml') ... |
"""This plugin will read binary data from the Münster TPC. The data is stored in .eve files that are created
with the daq software "FPPGUI" written by <NAME>.
In short the file is built up like this:
1 file header
2 event header
3 configuration header
4 event header
5 signal header
6 data
7 32bit word "0xaffe"
<repeat... |
# 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... |
#!/usr/bin/python
# Copyright 2014-2017 <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 applicable law or agre... |
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cm
import matplotlib.image as mpimg
from PIL import Image, ImageDraw
from matplotlib.animation import FuncAnimation, PillowWriter
import math
def interp(x0, y0, x1, y1):
"""Uses Xiaolin Wu's line algorithm to interpola... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Modify a Ubuntu live CD with a series of scripts.
TODO: Describe parameters and script naming conventions.
Based on the Ubuntu article LiveCDCustomization
https://help.ubuntu.com/community/LiveCDCustomization
"""
import argparse
from contextlib import ExitSta... |
"""
This module contains the definition of all the data structures used by our model, :py:class:`hepqpr.qallse.qallse.Qallse`
as well as some useful type alias used throughout the project.
"""
import math
from typing import Set, Iterable
import numpy as np
from .type_alias import *
from .utils import curvature, angl... |
import os
import cv2
import sys
import json
import numpy as np
import matplotlib.pyplot as plt
from scenedetect import VideoManager
from scenedetect import SceneManager
from scenedetect.detectors import ContentDetector
def find_scenes(video_path, threshold=30.0):
video_manager = VideoManager([video_path])
sce... |
import numpy as np
from PIL import Image
from PIL import ImageDraw
import itertools
import tensorflow as tf
import cv2
FLAGS = tf.flags.FLAGS
# Model parameters
tf.flags.DEFINE_integer("hidden_size", 128, "Size of LSTM hidden layer.")
tf.flags.DEFINE_integer("memory_size", 16, "The number of memory... |
import os
import click
import time
from common import ClickPythonLiteralOption
from common.soccer_domain import SoccerScaledParameterisedActionWrapper
import gym
import gym_soccer
from gym.wrappers import Monitor
import numpy as np
# 根据动作类型选择参数
def pad_action(act, act_param):
action = np.zeros((7,))
action[0] ... |
# !jupyter nbconvert --to script scrape_mars.ipynb
# Dependencies
import re
import requests
import pandas as pd
from time import sleep
from splinter import Browser
from bs4 import BeautifulSoup as bs
mars_dict = {}
# Mars Facts
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
def pandas_scrape_... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from matplotlib import animation
import matplotlib.pyplot as plt
import time
import numpy as np
import gc
import datetime
from . import AC_tools as AC
"""
Animate a NetCDF array to give a video of 2D (surface)
"""
# --- Settings for calling main as via scripting
specs = ['O3',... |
import pathlib
from argparse import ArgumentParser, Namespace
import skimage.io
import torch
import torch.nn.functional as F
import torchvision
import yaml
from pytorch_lightning import LightningModule, Trainer, seed_everything
from torch.backends import cudnn
from torch.utils.data import DataLoader
from torch.utils.d... |
import math
from itertools import cycle
from .EmbConstant import *
from .WriteHelper import write_string_utf8
STRIP_SPEEDS = True
SEQUIN_CONTINGENCY = CONTINGENCY_SEQUIN_STITCH
MAX_JUMP_DISTANCE = float('inf')
MAX_STITCH_DISTANCE = float('inf')
def write(pattern, f, settings=None):
if settings is None:
... |
import datetime
import os
import warnings
from typing import List, Union
import numpy as np
import pandas as pd
from IPython.core.display import HTML, display
from pandas.api.types import is_numeric_dtype, is_string_dtype
import mlrun
from mlrun.utils import flatten
warnings.simplefilter(action="ignore", category=Fu... |
from typing import List
from tabulate import tabulate
from singly_linked_list import ListNode, print_nodes, connect_nodes
from tree import TreeNode
class Solution:
# 91 Decode Ways, Medium
# A -> 1 ... Z -> 26
# "226" -> "BBF", "BZ", "VF" -> 3
def numDecodings(self, s: str) -> int:
size = len(... |
import utils
# These page info classes are exactly the same as the CIX scheme, since it's unique
class PageType:
FrontCover = "FrontCover"
InnerCover = "InnerCover"
Roundup = "Roundup"
Story = "Story"
Advertisement = "Advertisement"
Editorial = "Editorial"
Letters = "Letters"
Preview ... |
import os
import re
import pytest
import collections
from operator import sub
from zipfile import ZipFile, BadZipfile, LargeZipFile
import numpy as np
import quantipy as qp
from quantipy.sandbox.sandbox import ChainManager
from quantipy.sandbox.excel import Excel
from quantipy.sandbox.excel_formats_constants import _D... |
"""Main entry point, training and validation script for the experiments on Fashion MNIST."""
import sys
print('path', sys.path)
import sys
import tempfile
from logging import Logger
import sacred
import torch
import torch.nn.functional as F
import torchvision
from sacred.arg_parser import get_config_updates
from sacre... |
import xml.etree.ElementTree as ET
from xml.dom.minidom import Document
import os
import cv2
import time
set_color = set()
set_car = set()
def ConvertVOCXml(file_path="", file_name=""):
tree = ET.parse(file_name)
root = tree.getroot()
# print(root.tag)
num = 0 # 计数
# 读xml操作
f... |
from typing import Tuple, Optional, List, Union, Dict
from typing import Any # pylint: disable=unused-import
from collections import OrderedDict # pylint: disable=unused-import
from datetime import datetime
import logging
import xmltodict
import pandas as pd
import numpy as np
from toolz import get_in
from .utils ... |
import numpy.linalg as la
from os import path
import numpy as np
import cv2 as cv
# Our local modules
from ds_tools.shared import transform as tf
from ds_tools.shared import util, cv_util
def merge_textures(capture_data_json_path, texture_dir, max_texture_count=99999):
# Prepare paths
base_capture_path = pat... |
import logging
from itertools import chain
from braces.views import UserFormKwargsMixin
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.safestring import mark_safe
fro... |
import pytest
from brainlit.algorithms.generate_fragments.adaptive_thresh import (
get_seed,
get_img_T1,
thres_from_gmm,
fast_marching_seg,
level_set_seg,
connected_threshold,
confidence_connected_threshold,
neighborhood_connected_threshold,
otsu,
gmm_seg,
)
import SimpleITK as s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Analize the SRAG data and export the statistics to generate the figure 1
Needs the filter_SRAG.py csv output to run
"""
import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
from scipy.stats import norm, binom
def median_estimate(X, C... |
import copy
import torch
import os
import pickle
import tempfile
import time
import urllib.request
import cv2
import requests
import numpy as np
from tqdm import tqdm
from functools import lru_cache
import supervisely_lib as sly
import sly_globals as g
import sly_progress
def init_fields(state, data):
state['... |
from PIL import Image
import os
import errno
import sys
import pickle
import numpy as np
class CIFAR10(object):
"""`CIFAR10 <https://www.cs.toronto.edu/~kriz/cifar.html>`_ Dataset.
Args:
root (string): Root directory of dataset where directory
``cifar-10-batches-py`` exists.
train... |
from collections import OrderedDict
import math
import matplotlib as mpl
# configure to use a backend that doesn't require a display since this
# will be run from docker. It must be configured before importing pyplot
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplot... |
"""
Script to store anchor related functions
that uses tf tensors
"""
from __future__ import division
import numpy as np
import tensorflow as tf
def compute_overlap(bboxes1, bboxes2):
"""
Parameters
----------
bboxes1: (N, 4) Tensor
bboxes2: (K, 4) Tensor
Returns
-------
overlaps: (N... |
from functools import partial
import time
import networkx as nx
import numpy as np
import renderapi
import requests
from rtree import index as rindex
from six import viewkeys
from scipy.spatial import cKDTree
from asap.residuals import compute_residuals as cr
from asap.em_montage_qc.schemas import (
DetectMontage... |
"""
Process the Backup or Restore commands.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import copy
import os
import re
import six
import shlex
from shutil import copyfileobj
from subprocess import Popen
from django.core.management.base import Command... |
import dataclasses
import enum
import json
import logging
from datetime import timedelta
from uuid import uuid4
from django.conf import settings
from django.utils.module_loading import import_string
from django.utils.translation import gettext as _
from django_redis import get_redis_connection
from edd.utilities impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018-2019 Nekoka.tt
#
# 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 li... |
"""
Experiment summary
------------------
Treat each province/state in a country cases over time
as a vector, do linear regression on each province.
Classify each country by the slope of the regression.
"""
import sys
sys.path.insert(0, '..')
from utils import data
import os
import sklearn
import numpy as np
from skl... |
import re
class Classification(object):
UNKNOWN = 'unknown'
UNDECIDED = 'undecided'
KNOWN = 'known'
GOODWARE = 'goodware'
SUSPICIOUS = 'suspicious'
MALICIOUS = 'malicious'
_DEFINED_CLASSIFICATIONS = {constant for constant in vars().values()
if ... |
#!/usr/bin/env python3
"""
Visualize Wedge masks in AV1 codec
Copyright (c) 2018 yohhoy
"""
import itertools
import numpy as np
import matplotlib.pyplot as plt
BLOCK_8X8 = 3
BLOCK_16X16 = 6
BLOCK_SIZES = 22
MASK_MASTER_SIZE = 64
WEDGE_TYPES = 16
WEDGE_HORIZONTAL = 0
WEDGE_VERTICAL = 1
WEDGE_OBLIQUE27 = 2
WEDGE_OBLIQ... |
import numpy as np
import matplotlib.pyplot as plt
import os, sys
import sacc
from pspy import so_dict, pspy_utils, so_mcm
def get_ell_covar(e1a, f1a, p1a, e1b, f1b, p1b, e2a, f2a, p2a, e2b, f2b, p2b, covar_in, n_ells, id_cov_order):
nx_1 = e1a + "_" + f1a + "x" + e1b + "_" + f1b
nx_2 = e2a + "_" + f2a + "x" ... |
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from web_app.app import app
import pandas as pd
from web_app.apps.helpers.helper_functions import get_tweets, get_polarity
df = pd.read_csv(r"C:\Users\LENOVO\Desktop\CustomDash-master\web_ap... |
#! /usr/bin/env python3
import time
import re
def parse_speclist(iterable,size_limit=512000,recieve_timeout=120,encoding=None):
data = []
species_id = 0
species_other_names_id = 0
entry = dict()
headerbarsre = re.compile(r'^=+$')
headerspecre = re.compile(r'^\s*\(([0-9])\)\s+Real\s+organism\s+codes')
hea... |
#!/bin/python3
# -*- coding: UTF-8 -*-
# Author: <NAME>, <NAME>
####################################################################################################
import logging
import json
import os
import time
import csv
import requests
from cfg.auth import firebase_admin_auth
from cfg.auth import mysqlDB
from ut... |
""" libWrapper.py
dent earl, dearl (a) soe ucsc edu
November 2011
Common functions used by python wrappers for alignathon
"""
##################################################
# Copyright (C) 2009-2011 by
# <NAME> (<EMAIL>, <EMAIL>)
# ... and other members of the Reconstruction Team of <NAME>'s
# lab (BME Dept. UCS... |
import collections
import random
import itertools
import functools
from functools import singledispatch
COLOR_BLACK = { 'red': 0, 'green': 0, 'blue': 0 }
Field = collections.namedtuple('Field', ['name', 'index', 'type', 'pretty', 'format'])
FieldGroup = collections.namedtuple('FieldGroup', ['pretty', 'children'])
Fie... |
"""
the module for Topcoder (https://topcoder.com/)
.. versionadded:: 10.1.0
"""
import urllib.parse
from logging import getLogger
from typing import *
import bs4
import requests
import onlinejudge._implementation.utils as utils
import onlinejudge.type
from onlinejudge.type import SampleParseError, TestCase
logger... |
from django.db.models.aggregates import Count
from corehq.apps.accounting.filters import DateCreatedFilter
from corehq.apps.reports.datatables import (
DataTablesColumn,
DataTablesHeader,
)
from corehq.apps.reports.generic import GenericTabularReport
from corehq.apps.sms.models import (
INCOMING,
OUTGOI... |
from flask import render_template, flash, redirect, url_for, jsonify
from app import app, db
from app.forms import RegisterClass, LogIn, InsertStudent
from datetime import datetime, timedelta
from flask_login import current_user, login_user, logout_user, login_required
from app.models import Class, Student, Timeta... |
"""
compare texrel and shapeworld datasets
this also runs shapeworld using lsl code
expects to find lsl repo in same folder that this repo is inside, i.e this repo
and lsl repo should be peers, inside the same folder.
"""
import argparse
import csv
import time
import sys
import subprocess
from typing import List, Dict... |
import os
import time
import io
import requests
from random import shuffle
import uuid
from jumpscale import j
from zerorobot.service_collection import ServiceNotFoundError
from zerorobot.template.base import TemplateBase
from zerorobot.template.decorator import retry
from zerorobot.template.state import StateCheckErr... |
# Copyright (c) 2012-2016 Seafile Ltd.
# encoding: utf-8
# Utility functions for api2
import os
import time
import json
import re
import logging
from collections import defaultdict
from functools import wraps
from django.http import HttpResponse
from rest_framework.authentication import SessionAuthentication
from re... |
# Original work Copyright (c) 2004-2020 <NAME> and others (MIT)
# From https://github.com/pytest-dev/pytest
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the... |
# coding: utf-8
# # Intel-Optimized Histology Demo
#
# This demo uses the [colorectal histology images dataset](https://www.tensorflow.org/datasets/catalog/colorectal_histology) to train a simple convolutional neural network in TensorFlow.
#
# All images are RGB, 0.495 µm per pixel, digitized with an Aperio ScanSc... |
# Import Python packages
import os
import glob
import csv
import black
def process_files():
# Join a set of event data stored in indiual csv file into one output file
# for parsing
# checking your current working directory
print(os.getcwd())
# Get your current folder and subfolder event data
... |
# https://www.theschool.ai/courses/move-37-course/lessons/augmented-random-search-tutorial-teach-a-robot-to-walk/
# importing libraries
import os
import numpy as np
import gym
# import pybullet_envs
from gym import wrappers
ENV_NAME = 'BipedalWalkerHardcore-v3'
# ENV_NAME = 'HalfCheetahBulletEnv-v0'
# s... |
##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
from logger import setup_logger
from model import BiSeNet
import torch
import os
import os.path as osp
import numpy as np
from PIL import Image
import torchvision.transforms as transforms
import cv2
from EPE_detectors import DECA_FAN
from EPE_detectors import AFR
def vis... |
# The MIT License (MIT)
# Copyright (c) 2019 by the xcube development team and contributors
#
# 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... |
#!/usr/bin/env python2
# reference: CTP/OSCE
# author: greyshell
# description: identify good and bad chars in HPNNM-B.07.53
# dependency: python version: 2.7.x, pyenv-win==1.2.2, pywin32==218, WMI==1.4.9, pydbg
# 1) download the `dependency.zip` file.
# 2) extract the `pydbg.zip` inside your python `lib\site-package... |
# -*- coding: utf-8 -*-
# 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... |
# -*- coding: utf-8 -*-
""" Pipes: Pipenv Shell Switcher """
import sys
import click
from . import __version__
from .environment import EnvVars
from .picker import Picker
from .utils import get_query_matches, collapse_path
from .pipenv import (
call_pipenv_venv,
call_pipenv_shell,
)
from .core import (
f... |
import time
from options.test_options import TestOptions
from data.test_video_dataset import Test_dataset
from models.models import ModelsFactory
from collections import OrderedDict
import os
import numpy as np
from sklearn.metrics import f1_score
from PATH import PATH
import pandas as pd
from tqdm import tqdm
from cop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.