text stringlengths 6.04k 39.5k |
|---|
####
#
# The MIT License (MIT)
#
# Copyright 2019, 2020 <NAME> <<EMAIL>>
#
# 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 us... |
import logging
from collections import deque
from oseq import OrderedSequence
from tri.delaunay.tds import Edge
from grassfire.regression import are_residuals_near_zero
from grassfire.calc import near_zero
from grassfire.collapse import compute_collapse_time, find_gt
from grassfire.events.flip import handle_flip_e... |
import sys
import math
import struct
import threading
import logging
import multiprocessing
from contextlib import contextmanager
import lmdb
import cv2
import numpy as np
import time
import tensorflow as tf
from tensorpack import imgaug
from tensorpack.dataflow.image import MapDataComponent, AugmentImageComponent
... |
from manim import *
class cir(Scene):
def construct(self):
circle = Circle(radius = 1, color = BLUE, fill_opacity = 0.5)
tex= Text("now we have to discuss circle")
tex.to_corner(UP+LEFT)
self.play(Write(tex))
self.wait(2)
self.add(circle)
self.wait(2)
... |
#! /usr/bin/env python3
#
# names.py - a library for naming using the ASIM conventions for
#
'''This file provides support for the ohm naming conventions library
which are based on ASIM which in turn are b ased on Powercorp
Hungarian. The principles are fairly simple, in particular a name
defines:
1. The units for the... |
#!/usr/bin/env python3
#Author: <NAME>
#Contact: <EMAIL>
from __future__ import print_function
import os
import sys
import time
import re
import argparse
start_time = time.time()
def save_tsb (chromosome_string_path, transcript_path, output_path):
'''
Creates binary files that contain the transcriptional inform... |
#!/usr/bin/python3
import os
import sys
import logging
import argparse
import time
import torch
import torch.nn as nn
from datetime import datetime
from torchvision import datasets, transforms
from log import setup_logging, ResultsLog, save_checkpoint
from meters import AverageMeter, accuracy
from preprocess import get... |
from typing import Optional, Tuple
import torch
import torch.nn.functional as F
from torch.overrides import has_torch_function
from torch import Tensor, softmax
def _NN_attention(
q: Tensor,
k: Tensor,
v: Tensor,
NN,
attn_mask: Optional[Tensor] = None,
dropout_p: float = 0.0,
) -> ... |
import numpy as np
from utils.octree_partition import partition_octree
import time
from glob import glob
import tensorflow as tf
import multiprocessing
from tqdm import tqdm
from pyntcloud import PyntCloud
import pandas as pd
#VOXEL-OCTREE
def timing(f):
def wrap(*args, **kwargs):
time1 = time.time()
... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import os
import cv2
import numpy as np
import torch
from torchvision import transforms
from torchvision.ops import box_convert
from yolox.utils import adjust_box_anns
import random
from ..data_augment import box_candidat... |
# -*- python -*-
"""
Obtain packages, unpack them in a location, and add associated uselib variables
(CFLAGS_pkgname, LIBPATH_pkgname, etc).
The default is use a Dependencies.txt file in the source directory.
This is a work in progress.
Usage:
def options(opt):
opt.load('package')
def configure(conf):
con... |
import sys
import os.path as osp
# Config project if not exist
project_path = osp.abspath ( osp.join ( osp.dirname ( __file__ ), '..', '..' ) )
if project_path not in sys.path:
sys.path.insert ( 0, project_path )
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
from backend.CamStyle.... |
#!/usr/bin/env python3
import readchar
import os
import subprocess
import stat
import sys
from sys import argv
import curses
import platform
import mimetypes
VERSION = "scroll 1.0"
dir_contents = []
cd = os.getenv("PWD")
EDITOR = os.getenv("EDITOR") if os.getenv("EDITOR") else "editor"
MEDIA_OPEN = "open" if plat... |
# Framework for setting Input and Output expectations in a unit test.
#
# This file defines the class ExpectedInputOutput which can be used to override
# sys.stdout to validate that expected outputs are printed and sys.stdin to
# inject mock responses in the standard input. This is useful in unit test, to
# validate th... |
#!/usr/bin/env python
""" Create an installer environment """
# Standard lib
import os
import math
import shutil
import random
import pathlib
import zipfile
import platform
import textwrap
import argparse
import subprocess
from collections import namedtuple
# 3rd party
import numpy as np
from PIL import Image
from... |
# ROBOT PANCAKESWAP
# Import all the libraries to use
import threading
import requests
from web3 import Web3
from os import system
import os
from time import sleep
import winsound
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import Chr... |
# -*- coding: utf-8 -*-
"""
ui/wz_base.py
Last updated: 2021-05-20
Administration interface.
=+LICENCE=============================
Copyright 2021 <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 ... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab... |
'''
Copyright (c) <NAME>, <NAME>
All rights reserved
'''
import numpy as np
import math
from scipy import signal
from ext import utils
from ext import features #import spectrum2scaletime, scaletime2scalerate, scalerate2cortical, waveform2auditoryspectrogram
import matplotlib.pylab as plt
def load_static_params():
... |
import inspect
import pytest
from context import codechain
from rlp import decode
from rlp import encode
from rlp.sedes import big_endian_int
from codechain.primitives import U128
from codechain.primitives import U256
from codechain.primitives import U64
TOO_LARGE = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF... |
import numpy as np
import os
import pickle
from typing import Dict, Optional, Tuple, Union, Mapping, Callable, Set
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.transforms import RandomCrop
from fastmri import complex_abs, ifft2c
from fastmri.data import SliceDataset
from fastmri.data... |
from steam.steamid import SteamID
from tkinter import *
from tkinter import filedialog
from tkinter import ttk
from tkinter import messagebox
import pyperclip
from functools import partial
import sqlite3
import ast
from tkcalendar import Calendar
# pyperclip.copy('The text to be copied to the clipboard.')
# spam = pyp... |
import logging
import numpy as np
import argparse
import json
from pytorch_pretrained_bert.tokenization import BertTokenizer
import torch
from tap2.bottom_machine.hypers import DataOptions, SentMarkerStyle
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(filename)s:%(lineno)d - %(message)s',
... |
#
# Copyright (C) 2018 ETH Zurich and University of Bologna
#
# 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 applicabl... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Library containing functions to transfer files onto a remote device.
Transfer Base class includes:
----Tranfer----
* @ret... |
# SPDX-License-Identifier: MIT
'''
File containing mathematical tools
'''
import math
import numpy as np
import scipy.integrate as integrate
# *** COEFFICIENTS FOR FINITE DIFFERENCE ***
dic_coeff_FD = {}
# *** Finite differences for first and second derivative at 2th order ***
denom = 2.
dic_coeff_FD['[1,2],centered... |
"""
Bot that stays on 1base, goes 4 rax mass reaper
This bot is one of the first examples that are micro intensive
Bot has a chance to win against elite (=Difficulty.VeryHard) zerg AI
Bot made by Burny
"""
import random
import sc2
from sc2 import Race, Difficulty
from sc2.constants import *
from sc2.position import... |
from flask import Flask, render_template, request, redirect, url_for, session, g
from flask_babel import Babel, lazy_gettext as _l
from flask_assets import Environment, Bundle
from flask_oidc import OpenIDConnect
from flask_wtf import FlaskForm
from wtforms import SelectField, TextField, validators
from datetime import... |
from hparams import hougen_hparams as hp
# from utils import *
import os
import re
import random
import matplotlib.pylab as plt
from scipy.io.wavfile import write
import numpy as np
import torch
import torch.utils.data
from torch.utils.data import DataLoader
from audio_processing import griffin_lim
import layers
fro... |
import base64
import hashlib
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lookup.pe as s_l_pe
class FileBase(s_types.Str):
def postTypeInit(self):
s_types.Str.postTypeInit(self)
self.setNormF... |
import logging
import numpy as np
import cv2
import colour
import random
from art.attacks.evasion import RobustDPatch
logger = logging.getLogger(__name__)
def calculate_ccm(im_np, gt_np, gamma=2.2, Vandermonde=True, degree=1):
"""
Calculates the color transform matrix.
attributes::
im_np
... |
import ast
from collections import Iterable
from contextlib import contextmanager
from typing import List, Dict, Any, Optional, Callable, Generator
from op_code import OpCode, MAXARG_sBx, _ENV
from vm.lua_value import LuaValue, UpValue
class LocalVarInfo:
def __init__(self,
name: str,
... |
# import Asclepius dependencies
from asclepius.instelling import GGZ, ZKH, HardCodedParameters
# import other dependencies
from pandas import read_excel, merge, isnull, DataFrame
from typing import Union
class TestFuncties:
def __init__(self):
pass
# DAILY AUDIT FUNCTIES
def wrangle_da(self... |
from datetime import datetime, timedelta
from os import PathLike
from pathlib import Path
from typing import Collection
import fiona
import fiona.crs
import numpy
import rasterio
from rasterio.enums import Resampling
import scipy.interpolate
import xarray
import PyOFS
from PyOFS import CRS_EPSG, LEAFLET_NODATA_VALUE,... |
#!/usr/bin/env python
# Copyright (c) 2015 <NAME>. All rights reserved.
# Restrictions are listed in the LICENSE file distributed with this package.
import numpy as np, math, sys, getopt, os, socket, operator, pyopencl as cl
from numpy.linalg import norm
from subprocess import check_call
from mpi4py import MPI
from ... |
# Copyright 2014 Midokura SARL
#
# 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... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2016-2018 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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/LICE... |
import logging
import re
from datetime import datetime
from datetime import timedelta
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from django.db import transaction
from django.db.models import Sum
from django.utils import timezone
from telegram import Update
fro... |
# -*- coding: utf-8 -*-
# pylint: disable=C0411,broad-except,too-many-statements,too-many-branches,logging-fstring-interpolation,import-error
import argparse
from collections import defaultdict
import logging
import os
import pickle
import cv2
import numpy as np
import torch
from libyana.exputils import argutils
fro... |
# -*- coding: utf-8 -*-
# Apache Software License 2.0
#
# Copyright (c) 2018, <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 ... |
import discord
from discord.ext import commands, tasks
import datetime
from enum import Enum
from Resources.Utility import TimeLength
class LogType(Enum):
mute = "mute"
unmute = "unmute"
member_ban = "member ban"
member_unban = "member unban"
member_join = "member join"
member_leave = "member ... |
from basic_functions import *
def idxes_init(phase, cp, co, ep, eo, direction):
if phase == 0:
res1 = co2idx(co)
res2 = eo2idx(eo)
res3 = ep2idx_phase0(ep)
return (res1, res2, res3, direction)
else:
res1 = cp2idx(cp)
res2 = ep2idx_phase1_1(ep)
res3 = ep2i... |
import enum
import typing
from hat.drivers.iec60870.app.common import * # NOQA
from hat.drivers.iec60870.app.common import (Time,
Bytes)
OriginatorAddress = int
"""Originator address in range [0, 255] - 0 if not available"""
AsduAddress = int
"""ASDU address in range [0... |
# -*- coding: utf-8 -*-
import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
from transformers import BertModel, RobertaModel
import os
def MixoutWrapper(module: nn.Module, p: float = 0.5):
"""
Implementation of Mixout (https://arxiv.org/abs/1909.11299).
Use with:
>>> mi... |
#!/usr/bin/env python
"""A widget to display changing values in real time as a strip chart
Known issues:
Matplotlib's defaults present a number of challenges for making a nice strip chart display.
Here are manual workarounds for some common problems:
- Memory Leak:
Matplotlib 1.0.0 has a memory leak in canvas.dr... |
import operator
from decimal import Decimal
from sqlalchemy import literal
from waitlist.utility.constants import location_flags, effects, check_types
from typing import List, Dict, Optional, Tuple, AbstractSet, Union
from waitlist.storage.database import InvType, Shipfit, FitModule,\
MarketGroup, ShipCheckCollecti... |
"""
MIT License
Copyright (c) 2021 martinpflaum
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, publish, ... |
""" Module for generating a finder chart """
import os
import numpy as np
from IPython import embed
from matplotlib import pyplot as plt
from matplotlib import font_manager
import matplotlib.cm as cm
from PIL import Image
from astropy import units
from astropy.visualization.wcsaxes import SphericalCircle
from astro... |
"Assembling quasispecies from superreads."
import json
import numpy as np
import pandas as pd
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
from .reads import characters
from .io import read_json
from .io import write_json
character_to_index_map = {char: i for i, char in enumerat... |
### This script calculates the flux of mass and tracer through the 4 boundaries of the domain as an advective flux.
### o-KRM-o
# o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o
from math import *
import matplotlib.pyplot as plt
impor... |
"""Provides access to application-level structures.
This module is the starting point for getting access to windows and other application-global data.
"""
import iterm2.broadcast
import iterm2.connection
import iterm2.notifications
import iterm2.rpc
import iterm2.session
import iterm2.tab
import iterm2.window
impor... |
# =============================================================================
# Fog Word Tokenizer
# =============================================================================
#
# A general purpose word tokenizer able to consider a lot of edge case and
# typical entities all while remaining mostly language agnosti... |
import sys
import io
import os
import gi
import pyds
import cv2
import numpy as np
sys.path.append(os.path.join('..', os.curdir))
gi.require_version("Gst", "1.0")
gi.require_version('GstRtspServer', '1.0')
from gi.repository import GObject, Gst, GstRtspServer
from utils.trtis.ssd_parser import (nvds_infer_parse_cu... |
##################################################
# Import Own Assets
##################################################
from hyperparameter_hunter.metrics import ScoringMixIn, Metric, format_metrics, wrap_xgboost_metric
from hyperparameter_hunter.metrics import get_formatted_target_metric, get_clean_prediction
#####... |
import sys
sys.path.append('/home/tbartsch/source/repos')
import numpy as np
import datetime
from datetime import datetime as ddatetime
from datetime import timedelta
from sqlalchemy import desc
import mtatracking_v2.nyct_subway_pb2 as nyct_subway_pb2
from datetime import date
from mtatracking_v2.mean_transit_times imp... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 18 11:35:57 2016
@author: bmanubay
"""
import thermopyl as th
from thermopyl import thermoml_lib
import cirpy
import numpy as np
import pandas as pd
from sklearn.externals.joblib import Memory
mem = Memory(cachedir="/home/bmanubay/.thermoml/")
@mem.cache
def resolve_c... |
from __future__ import absolute_import, division, print_function
import operator
import numbers
import numpy as np
from .visual import VisualAttributes, RED
from .decorators import memoize
from .message import SubsetDeleteMessage, SubsetUpdateMessage
from .exceptions import IncompatibleAttribute
from .registry impor... |
## import csv
import json
import itertools
import pprint
import random
from collections import Counter
import itertools
import numpy as np
import pandas as pd
import pandas as pd
import matplotlib.pyplot as plt
import scipy as sp
from neo4j import GraphDatabase
from neo4j import unit_of_work
from tqdm import tqdm
impo... |
# -----------------------------------------------------------------------------
# Copyright 2016-2018 by I3py Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ----------------------------------------... |
import os
import copy
import math
import errno
import torch
#import trimesh
import skimage
import numpy as np
import urllib.request
import skimage.filters
import matplotlib.colors as colors
from tqdm import tqdm
from PIL import Image
#from inside_mesh import inside_mesh
from torch.utils.data import Dataset
from data_... |
import random
from functools import reduce
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.db.models import Q, Prefetch
from django.http import Http404, QueryDict
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.contenttypes.models import... |
import re
import copy
from collections import namedtuple
import warnings
import astropy.time
import astropy.coordinates
from astropy._erfa import ErfaWarning
import galsim
import numpy as np
import lsst.geom as LsstGeom
from lsst.obs.lsstSim import LsstSimMapper
from lsst.sims.utils import arcsecFromRadians
from . impo... |
"""
Created on Tue Jan 26 16:41:35 2021
@author: mark
"""
import numpy as np
import torch
import torch.nn as nn
from aircraft_detector.utils.utils import print_verbose
import aircraft_detector.utils.pytorch_earlystopping as es
"""
conv1d: in shape = (N, C_in, L_in) -> out shape = (N, C_out, L_out)
conv2d: in shape =... |
# -*- coding: UTF-8 -*-
from weakref import WeakSet
from django.conf.urls import patterns, url, include
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.shortcuts import redirect
from djan... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... |
import base64
from typing import Optional, Sequence, Union, Dict
from kubernetes import client
from kubernetes.client import V1Pod, V1PodList, NetworkingV1beta1Ingress, ApiException, ApiTypeError, ApiValueError, \
CoreV1Api
from xcube_hub.typedefs import JsonObject
from xcube_hub import api
def get_secret(name: ... |
import itertools
import os
import sys
import pandas
from geopandas import GeoDataFrame, sjoin
from pandas import DataFrame
from shapely.geometry import Polygon
import numpy as np
import math
from gtfspy.util import wgs84_width, wgs84_height, df_to_utm_gdf, ut_to_utc_datetime, makedirs, wgs84_distance
import random
imp... |
from __future__ import absolute_import
import argparse
import os
import sys
# sys.path.append(".")
import time
import torch
from tensorboardX import SummaryWriter
from metrics.evaluation import evaluate
from metrics.vae_metrics import VaeEvaluator
from struct_self.dataset import Dataset
from struct_self.dataset impo... |
import copy,subprocess,os,tempfile,re
import uuid,time,glob,lixtools
import numpy as np
from io import StringIO
import pylab as plt
from dask.distributed import as_completed
def run(cmd, path="", ignoreErrors=True, returnError=False, debug=False):
""" cmd should be a list, e.g. ["ls", "-lh"]
path is for th... |
import re
import os
import platform
import requests
from bs4 import BeautifulSoup
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from urllib.parse import urlencode
import json
from requirementNode import Node, nodify
import courseScraper
PATH_TO_SELENIUM_DRIVER ... |
""" Running this file will allow for experimentation with my GUI """
from __future__ import print_function
import datetime
import math
import os
from tkinter import *
import PIL.Image
import PIL.ImageTk
import cv2
import keras
import matplotlib.pyplot as plt
import numpy as np
import pytube
from src.ML_Application ... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
import torch
def draw_skeleton(input_image, joints, draw_edges=True, vis=None, radius=None):
"""
joints is 3 x 19. but if not will transpose it.
0: Right ankle
1: Right knee
2: Right hip
3: Left hip
4: Left knee
5: Left ankl... |
from cognitive.apps.atlas.utils import color_by_relation, generate_uid, do_query, get_relation_nodetype
from py2neo import Path, Node as NeoNode, Relationship
from cognitive.settings import graph
import pandas
class Node:
def __init__(self,name,fields=["id","name"]):
'''Node is a general class to represe... |
import copy
import logging
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import warnings
from csv import *
from seaborn import *
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.metrics import confusion_matrix, classification_report, \
precision... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
from ......utils import jp_compose, deref
from ......errs import SchemaError
from .constants import BASE_SCHEMA_FIELDS, SCHEMA_FIELDS
from .parameter_context import ParameterContext
def _generate_fields(obj, names):
ret = {}
for name ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
BoardGameGeek.com interface for pyprototypr
Based off of the BGGGame object, for example::
{'_comments': [],
'_data': {'accessory': False,
'alternative_names': ['德国大选', '디 마허'],
'artists': ['<NAME>', '<NAME>'],
'ca... |
#coding=utf-8
import rospy
from std_msgs.msg import Header
from sensor_msgs.msg import Image, NavSatFix
from map_generator.msg import tjy
from nav_msgs.msg import Path
import numpy as np
import time
from googleplaces import GooglePlaces
import googlemaps
import time
import sys
import math
from math import cos,sin,tan,s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Utils for input-output hidden Markov models (IO-HMMs).
We have an HMM that also takes into account actions, ie
transition and observation matrices have an extra dim for
which action was taken.
@author: josephfutoma
"""
import sys
import autograd
import autograd.... |
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2020-04-07 13:09:23
# @Last Modified by: <NAME>
# @Last Modified time: 2020-04-10 20:56:45
"""
Plottings
"""
import matplotlib.pyplot as plt
from matplotlib.ticker import (FormatStrFormatter, MultipleLocator,
AutoMinorLocator, FixedL... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 <NAME>
# Distributed under the terms of the Modified BSD License.
# The full license is in the file LICENSE, distributed with this software.
#
# I Would have never figured out how to make this work without
# the espn3 xbmc addon by Ksosez/BlueCo... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright (c) 2013 <NAME>, <EMAIL>.lucchese at gmail.com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# in... |
import torch
import numpy as np
import random
import sys
from Model_Dataset import mtne_metapath_dataset
from torch.nn.functional import softmax
from Evaluation import Evaluation, read_embedding
from Heterogeneous_Rec import H_Evaluation, H_read_embedding
from Node_Classification import do_node_classification
... |
import time
import numpy as np
import types
import torch.nn as nn
import torch.utils.data
import ummon.utils as uu
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.data.dataset import ConcatDataset
from torch.utils.data.dataset import Subset
from .logger import Logger
from .s... |
import collections
import io
import pytest
import util.dicts
import tornado.concurrent
import tornado.ioloop
import tornado.gen
from schema import validate, check
# TODO queues
# python specific tests
def test_bytes_matches_str_schemas():
schema = 'asdf'
validate(schema, b'asdf')
def test_bytes_not_synonymo... |
import requests
import bs4
import pandas as pd
import numpy as np
import re
from ..season.season_extract import season_url
from ..helpers.extract_helpers import search_for_new_seasons
from ..helpers.db_funcs import create_full_name_season_srs, get_season_id, create_full_name_srs, get_tribe_id, get_alliance_id, get_at... |
import urllib.request
import shutil
import os
import os.path
import zipfile
import time
import sys
import traceback
from subprocess import call
import base64
from bs4 import BeautifulSoup
import uuid
import html
import traceback
def find_between(file):
f = open(file, "r", encoding = "utf8")
soup = BeautifulSoup(f, '... |
from typing import Any
from jsonschema.exceptions import ValidationError
import urllib.request
import json
import pytest
from mojap_metadata import Metadata
from mojap_metadata.metadata.metadata import (
_parse_and_split,
_get_first_level,
_unpack_complex_data_type,
_table_schema,
_get_type_categ... |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pickle
import sys
import numpy as np
import pandas as pd
import root_numpy
from builtins import object
from builtins import range
try:
from imblearn import over_sampling
except ImportErro... |
"""
The :mod:`hotspots.hs_io` module was created to facilitate easy reading and
writing of Fragment Hotspot Map results.
There are multiple components to a :class:`hotspots.result.Result` including, the
protein, interaction grids and buriedness grid. It is therefore tedious to manually
read/write using the various cla... |
import math
from abc import ABCMeta, abstractmethod
import numpy.random as rand
import scipy.stats as stats
import inspect
KG_PER_LB = 0.453592
MJ_PER_MCAL = 4.184
class Cow:
__metaclass__ = ABCMeta
def __init__(self, day_of_lactation=None, day_of_gestation=None,
parity=None, weight=None):
... |
import itertools
import warnings
import copy
import time
from math import inf
import numpy as np
from sklearn.feature_selection import f_classif, f_regression
from ..computation.util import to_dataframe
from ..data import Collection
from ..computation import Input, Graph
from ..transformers import *
__all__ = [
... |
"""Module containing the GlobalStore class."""
import gc
import os
import atexit
import json
import time
from typing import Union, Optional
import jsonpickle
from flask import Response
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.interval import IntervalTrigger
# Ignore ... |
import json
import random
import re
from nltk.tokenize import TweetTokenizer
import csv
def preprocess_data(data_dir, ifile, ofile):
'''This method
1) takes the json file and processes dialogs with at least one turn including two utterances)
2) creates an output file in the following format: dialogId\tnum_utter... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import random as rn
from sklearn.metrics import roc_auc_score
import sys
import os
from lib_util import get_target,get_opt
import lightgbm as lgb
from keras.layers import Input, Embedding, Dense, Flatten, Dropout, concatenate, BatchNormalization, SpatialDr... |
# python pascalvoc.py -gt ../gt_pred/ -det ../maskrcnn_pred/ -gtformat 'xyrb' -detformat 'xyrb'
import torch
import torch.nn as nn
import hyperparams as hyp
import numpy as np
import time
import detectron2
import ipdb
st = ipdb.set_trace
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
f... |
import numpy as np
from ..preprocessing.stack import StackedObservation
from ..dataset import TransitionMiniBatch
def _make_batches(episode, window_size, n_frames):
n_batches = len(episode) // window_size
if len(episode) % window_size != 0:
n_batches += 1
for i in range(n_batches):
head_i... |
import os
import random
import speedtest
from flask import Flask, request
from pymessenger.bot import Bot
import modules.hackermode as ghack
import json
import weather
from time import sleep
from cachetools import TTLCache
app = Flask(__name__)
ACCESS_TOKEN = 'YOUR_FACEBOOK_PAGE_ACCESS_TOKEN'
VERIFY_TOKEN = '<PASSWORD... |
#!/usr/bin/env python3
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QAction, QApplication, QDialog, QLineEdit,
QMessageBox, QMenu, QSystemTrayIcon, QInputDialog)
from PyQt5.QtCore import (QTimer, QSettings)
import imaplib
import email
import subprocess
from views.ui_settings... |
#!/usr/bin/python
_author_ = "Zihan"
_copyright_ = "Copyright 2018, Computer Science"
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkinter import *
from tkinter import simpledialog
import time
# declare variables
# Font Style
FONT_ONE = ("times bold italic", 48)
FONT_TWO = ("times... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.