text stringlengths 3.07k 22.1k |
|---|
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# <NAME> (<EMAIL>) and <NAME> (<EMAIL>).
# For more info, see http://inst.eecs.berkeley.... |
from __future__ import print_function
import argparse
import brain
import h5py
import math
import numpy
import sys
def compute_frames_per_block(cells_to_frames_ratio, report, block_values,
gids=None):
# The number of frames per block is fixed using the median number of
# compartm... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 2 10:34:31 2016
@author: ganong
"""
import os
os.environ["R_HOME"] = "/Library/Frameworks/R.framework/Resources"
os.chdir("/Users/ganong/repo/HARK-comments-and-cleanup/gn")
import settings
import sys
#xxx want to change this default path
#sys.path.remove('/Users/ganon... |
# Accessing the files and preparing the dataset
from os.path import join
import os
from arguments import opt
# Treating the images
from PIL import Image
import numpy as np
from matplotlib.pyplot import imshow # used??
import matplotlib.pyplot as plt
# Dealing with GPUs
import torch.backends.cudnn as cudnn... |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Implementation of the Nearest Neighbor clustering (also known as kNN) that
use a string similarity func... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
# Author: <NAME> <<EMAIL>>
import time
from urllib.parse import urlparse
from http_client import HttpClient
from rsteg_socket import RstegSocket
import matplotlib.pyplot as plt
import numpy as np
import os
import subprocess
import PySimpleGUIQt as sg
import logging
import re
f... |
from dataclasses import dataclass
from typing import (
Any,
ClassVar,
Dict,
List,
Optional,
Sequence,
Tuple,
Type,
Union,
no_type_check,
)
import anyio
from sqlalchemy import Column, func, inspect, select
from sqlalchemy.engine.base import Engine
from sqlalchemy.exc import NoIns... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python includeswhich
import numpy as np
import random
import glob
from rviz_tools_py.public_para import Public_para as _para
# gps_test_path = '/home/apple/catkin_ws/src/rviz_tools_py/data/GPStrafficLine.txt'
# test_bug_txt = '/home/apple/catkin_ws/test_bug.txt'
# np_da... |
import unittest
import numpy as np
from pyapprox.low_rank_multifidelity import *
from functools import partial
from scipy.stats import uniform
import pyapprox as pya
from scipy.special import jv as bessel_function
class OscillatoryPolyLowFidelityModel(object):
def __init__( self, mesh_dof=100, num_terms=35 ):
... |
import logging
import os
import random
import sys
import hydra
import numpy as np
import torch
from omegaconf import OmegaConf
from scipy.spatial.distance import cdist
from torch.backends import cudnn
from tqdm import tqdm
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
os.c... |
import constants
import pygame
import time
import random
import os
import img2pdf
from threading import Thread
from PIL import Image
from collections import defaultdict
options = """
+--------------------------+
| opções: |
+---+----------------------+
| 1 | exportar |
| 2 | jogar ... |
# -*- encoding: utf8 -*-
'''
Mantra - test selection page
'''
import os
import json
import shutil
import threading
import time
import csv
from operator import attrgetter
import logging
import dash_html_components as html
import dash.dependencies as dd
import dash_core_components as dcc
from app import app
from config ... |
#!coding:utf8
#author:yqq
#date:2020/2/7 0007 14:03
#description: XLM接口
import logging
from base_handler import BaseHandler
from utils import decimal_default, get_linenumber
import json
import sql
from utils import is_hex_str
import decimal
from decimal import Decimal
from decimal import getconte... |
import math
import pygame
import random
import json
from itertools import count
from collections import namedtuple
Point = namedtuple('Point', 'x y')
# Global config
WIN_SIZE = [600, 800]
# ------------------------------------------------------------------------------
class Rocket:
_id = count(0)
def __in... |
"""
Functions for testing brainlocate.
"""
import pytest
import numpy as np
import os
from numpy.testing import assert_array_equal, assert_allclose
import brainload as bl
import brainload.brainlocate as loc
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(THIS_DIR, os.pardir, 'test_... |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by <NAME> <<EMAIL>>
#
# Handle various things related to ELF images
#
from collections import namedtuple, OrderedDict
import io
import os
import re
import shutil
import struct
import tempfile
from patman import command
from patman import t... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
D&D Dice Roller with roll modifiers
"""
# Built-in/Generic Imports
import random
# Libs
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
random.seed() # initialize pseudo-random numbers
def DX(rolls_num, dice_sides, modifier):
"""roll di... |
import sys
import re
import numpy as np
import os
import json
import datetime
import errno
import json
import six
class NumpyEncoder(json.JSONEncoder):
""" json encoder for numpy types
source: https://stackoverflow.com/a/49677241/99379
"""
def default(self, obj):
if isinstance(obj,
... |
from gevent.monkey import patch_all; patch_all() # noqa
from gevent.pywsgi import WSGIServer
import os
import re
import time
import pickle
import hashlib
import logging
from threading import Thread, Event, Lock
from urllib.parse import urljoin
from datetime import datetime, timedelta
from dataclasses import dataclass... |
#!/usr/bin/env python3
"""
#------------------------------------------------------------------------------
#
# SCRIPT: convert_s2s_anom_cf.py
#
# PURPOSE: Updates attributes of S2S monthly anomaly/standardized anomaly
# netCDF files to conform with CF-1.8 convention.
#
# REQUIREMENTS as of 26 Sep 2021:
# * Python 3.8 o... |
"""
DotKnot: software for RNA pseudoknot prediction
Copyright (C) 2010-2011 <NAME>
This program 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 2 of the License, or ... |
# Keystone authentication server working on port 9000
# 1) accepts GET /login and responds with a login form
# curl -i -H "X-Target: /abc" http://localhost:9000/login
# 2) accepts POST /login, sets a cookie, and responds with redirect
# curl -i -X POST -d "username=test&password=<PASSWORD>&target=/abc" http://lo... |
from enum import Enum
from typing import Generator
import matplotlib
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from scikitplot import metrics as skplt
from Classification.MetricType import MetricType
from Utils import Log
matplotlib.use('TkAgg')
class PlotTy... |
from collections.abc import MutableMapping
from collections import deque
from functools import partialmethod
import math
import re
from functools import wraps
from regularize.exceptions import SampleNotMatchedError, \
InvalidRangeError
from regularize.flag import FlagSet
class Metacharacter:
def __copy__(sel... |
import re
import sys
from functools import reduce, partial
from itertools import dropwhile, groupby, chain
class Token:
def __init__(self, name, value=None, start=None, end=None, pos=None):
self.name = name
self.value = value
self.start = start
self.end = end
self.pos = pos ... |
def mensaje_negativo(numero):
"""
(float) -> str
Escribe un mensaje para evaluar un numero negativo
>>> mensaje_negativo(-10.0)
'El numero es negativo'
>>> mensaje_negativo(898)
'El numero es positivo'
:param numero: num el numero a evaluar
:return: str con el mensaje de la evalu... |
# Copyright (c) 2021 <NAME>. All Rights Reserved.
import math
import pymel.core as pm
import piper_config as pcfg
COLORS_INDEX = {0: 'default',
1: 'black',
2: 'dark grey',
3: 'light grey',
4: 'dark red',
5: 'dark blue',
... |
# This file was generated by the Tkinter Designer by <NAME>
# https://github.com/ParthJadhav/Tkinter-Designer
import analysis as an
import os
from tensorflow import keras
from pathlib import Path
import methods
# from tkinter import *
# Explicit imports to satisfy Flake8
from tkinter import *
import tkinter as tk
impo... |
from typing import NoReturn
import numpy
import matplotlib.pyplot as plt
from cryspy.B_parent_classes.cl_1_item import ItemN
from cryspy.B_parent_classes.cl_2_loop import LoopN
class PdMeas(ItemN):
"""Measured data point.
Attributes
----------
- ttheta (mandatory)
- intensity_up, intensi... |
import logging
from collections import namedtuple
import re
from django.contrib.auth import get_user_model
from django.db.utils import IntegrityError
from django.http import Http404
from rest_framework import status
from rest_framework import viewsets
from rest_framework.exceptions import ValidationError, ParseError,... |
import json
import os
import shutil
import subprocess
from types import SimpleNamespace
import humanize
from bootstrap_modal_forms.generic import BSModalFormView
from dateutil.parser import parse
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMi... |
# This file is Copyright (c) 2019 <NAME> <<EMAIL>>
# License: BSD
import math
from migen import *
from migen.genlib.cdc import MultiReg
from litex.soc.interconnect.csr import *
# SPI Master ---------------------------------------------------------------------------------------
SPI_CONTROL_START = 0
SPI_CONTROL_LE... |
import pandas as pd
import numpy as np
def read_airports_data():
return pd.read_csv("./dataset/flights/airports.csv")
# Reading the intersection of cities from txt file
def read_intersection():
file = open('./dataset/intersection.txt', 'r')
inter = file.read().split('\n')
file.close()
return inter... |
import asyncio
import aiohttp_jinja2
import jinja2
import pathlib
import time
import os
import aiohttp.web
import threading
from aiohttp import WSCloseCode
import janus
from timetable_logic import next_buses,create_ptv_api
import json
import logging
import datetime
import sys
# debug level, can be debug, error, info, ... |
#!/usr/bin/env python
## ----------------------------------------------------------------------------
## Copyright 2016-2017 ARM Ltd.
##
## SPDX-License-Identifier: Apache-2.0
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## Yo... |
import re
class BooleanExpression:
# A simple evaluator of boolean expressions.
#
# Grammar:
# expr :: or_expr
# or_expr :: and_expr ('||' and_expr)*
# and_expr :: not_expr ('&&' not_expr)*
# not_expr :: '!' not_expr
# '(' or_expr ')'
#... |
"""A common simple Neural Network for the experiments
"""
import pathlib
import torch
import torch.nn as nn
import torch.nn.functional as F
import tqdm
import numpy as np
from .utils import Accuracy, AccuracyTop1, AccuracyTop3
class FlowerNet(nn.Module):
"""
The model to optimize
"""
def __init__(s... |
import logging
import re
# from discord.commands import Option
import discord
from alttprbot import models
from alttprbot.alttprgen.smz3multi import generate_multiworld
from discord.ext import commands
from slugify import slugify
PRESET_OPTIONS = {
'sm': [
discord.SelectOption(label="casual_full"),
... |
import os
from datetime import date, datetime
from aiogram import Bot, types
from aiogram import Dispatcher
from aiogram.types.message import ContentType
from aiogram.utils import executor
import dotenv
from utils_db import (check_have_member, check_active, create_roll, create_user, activated_user,
... |
#!/usr/bin/env python
"""Functions useful for query codes to be called by framework.
"""
import re
import json
from intgutils.wcl import WCL
import intgutils.intgdefs as intgdefs
import despymisc.miscutils as miscutils
def make_where_clause(dbh, key, value):
"""Return properly formatted string for a where clau... |
import gc
import os
import re
import ast
import time
import pickle
import pytest
import inspect
import subprocess as sp
from radon import metrics
from importlib import util
from psutil import Process
from coverage import Coverage
from distutils import sysconfig
from multiprocessing import Event, Pipe
COMMIT_WINDOW =... |
# -*- coding: utf-8; -*-
''' CoordsConf: Configure QGIS coordinate display
Store this script as .qgis2/python/startup.py
Redoute, 19.10.2013 '''
from __future__ import unicode_literals, division
import qgis
QgsPoint = qgis.core.QgsPoint
CoordinateReferenceSystem = qgis.core.QgsCoordinateReferenceSystem
CoordinateTr... |
import math
import random
import matplotlib.pyplot as plt
import numpy as np
import PIL
import PIL.ImageDraw
import PIL.ImageFilter
import func_profiles
def blend(c1, c2, a=0.5): # TODO: THIS SHOULD BE MOVED TO A FILE WITH OTHER COLOR UTILITIES
c1 = np.array(c1)
c2 = np.array(c2)
cr = a * c1 + (1-a) *... |
# Copyright © 2020 Province of British Columbia
#
# 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 agr... |
"""
Created by howie.hu at 2022-05-12.
Description: 基于Ruia爬虫框架的微信公众号爬虫
原始数据来源于:https://mp.data258.com/mp/search?type=category&key=老胡的储物柜&sort=
! 注意,该目标网站有比较严厉的反爬措施,单IP只能访问15次,此功能需要代理池
- 运行: 根目录执行,其中环境文件pro.env根据实际情况选择即可
- 命令: PIPENV_DOTENV_LOCATION=./dev.env pipenv run python src... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
A `textless` wrapper around datasets (Quantize dataset) and a set of pre-wrapped standard torchaudio datasets
(https://pytorch.org/audio/st... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
from torch.autograd import Variable
'''based on code from: https://github.com/vincentherrmann/pytorch-wavenet
also see:
https://github.com/musyoku/wavenet
https://github.com/ibab/ten... |
import io, os, csv, sys, re
from Bio import SeqIO
from selftarget.data import getHighDataDir, getAllDataDirs, isNullDir, getShortDir, getSubdirs, getSampleSelectors, sortSampleNames, parseSampleName
from selftarget.oligo import partitionGuides
import pandas as pd
RUN_LOCAL = False
PYTHON_CMD = '~/run_python.sh'
LOG_DI... |
import argparse
class Literal:
"""A literal that can be assigned a Boolean value."""
def __init__(self, name):
self.name = name.replace("--", "")
self.neighbours = [] # if b is a neighbour of a, then a->b.
self.d = None # first discovered
self.f = None # finished examining
... |
from ...system.component import Identifiable, Component
from ...system import event_ids
from ...system import target_ids
from ...shell.native.gui_window import GuiWindow
import threading
import time
# noinspection PyUnusedLocal
def portal_chrome_factory(bus, config, id_manager, component_settings):
if config.use... |
import json
import logging
import os
import pickle
import random
import numpy as np
import pandas as pd
from eurito_indicators import config, PROJECT_DIR
from eurito_indicators.getters.arxiv_getters import (
get_article_categories,
get_arxiv_articles,
get_arxiv_tokenised,
get_arxiv_w2v,
)
AI_VOC_PAT... |
from math import exp
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
# from kornia.color import rgb_to_yuv
from torch.nn.modules.loss import _Loss
import numpy as np
def gaussian(window_size, sigma):
gauss = torch.Tensor([exp(-(x - window_size//2)*... |
import sys
import numpy as np
import h5py
from pydata.h5pydata import Group_autoiter, h5file
from pydata.increment import increment_file, __increment__
if 'pyslave' in sys.modules :
from pyslave import __slave_disp__ as disp
else:
disp = print
# Error class
class DataException(Exception):
pass
class... |
import contextlib
from datetime import datetime
from dataclasses import dataclass, field
import logging
import sqlite3
import threading
from typing import Callable, List, Tuple, Optional, Set
@dataclass
class Message:
timestamp: int
update_id: int
chat_id: int
text: str
insert_timestamp: int = fie... |
"""
module for describing data process.
All data structure is describing as nested combination of `dict` or `list` for `ndarray`.
Data process is a translation from data structure to another data structure or typical `ndarray`.
Data cache can be implemented based on the dynamic features of `list` and `dict`.
The full... |
#!/usr/bin/python
import datetime
import lxml.etree
import os
import re
import shutil
import subprocess
import sys
# Settings file that uses the our artifactory server as proxy for all
# repositories:
SETTINGS = """
<settings>
<mirrors>
<mirror>
<id>ovirt-artifactory</id>
<url>http://artifactory.o... |
# -*- coding: utf-8 -*-
"""Some matrix specialization."""
import time
from pygimli.core import _pygimli_ as pg
from pygimli.utils.geostatistics import covarianceMatrix
import numpy as np
from . import _pygimli_ as pgcore
from . import (CMatrix, CSparseMapMatrix, CSparseMatrix, ElementMatrix,
IVector, M... |
import argparse
import sys
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, classification_report
import json
import random
import pickle
import datetime
import numpy as np
from tqdm import tqdm
from utils.LogPrint import... |
'''
Reduce eye strain on screens
'''
# import packages
import toga
from toga.style.pack import Pack, COLUMN, ROW
import threading
import time
import os
import sys
import random
import eyehelp.face_detect as fd
import eyehelp.calibrate as calibrate
import eyehelp.grapher as grapher
# Label for multiple lines
def Multi... |
#-*- coding: utf-8 -*-
from __future__ import print_function
from .states import NounState, DerivationalState, NominalVerbState
from _collections import deque
from io import open
import functools
import sys, os
__all__ = ["TurkishStemmer"]
# The turkish characters. They are used for skipping not turkish words.
ALPHAB... |
#Bartu Utku SARP 150401028
import socket
import time
import os
import sys
serverIP = str(socket.gethostbyname(socket.gethostname()+".local")) #sunucunun mevcut interface'ine ait IP adresi otomatik alınıyor
port = 42
try: #UDP bağlantısının başarılı bir şekilde oluşuturulup oluşturulamadığı kontrol ediliyor
UDP =... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc., its affiliates and <NAME>.
import math, copy, os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from parlai.core.torch_generator_agent import TorchGeneratorModel
from parlai.core.dict import DictionaryAgent
from transform... |
import osmnx as ox
import networkx as nx
import numpy as np
import copy
from shapely.geometry import LineString, MultiLineString
from shapely import ops
import osmnx.utils_graph
def generate_square_multidi_graph(width, height, mean_distance=300, std=100, min_distance=100) ->nx.MultiDiGraph:
'''
Generate graph... |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib as matplotlib
def load_image(path):
"""
Load an image using matplotlib and return as numpy array.
:param path: The file path of the image to load
:return: A numpy array with image[y,x,band]
"""
return mpimg.imrea... |
import matplotlib.pyplot as plt
import seaborn as sns
from copy import deepcopy
from itertools import product
import numpy as np
from mvmm.multi_view.MVMM import MVMM
from mvmm.multi_view.BlockDiagMVMM import BlockDiagMVMM
from mvmm.multi_view.LogPenMVMM import LogPenMVMM
from mvmm.multi_view.TwoStage import TwoStage
... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
import asyncio
import logging
import socket
import json
import PySimpleGUI as sg
from collections.abc import Sequence
import threading
import time
import lelof1py as f1client
from sample_gui import GUISample
LISTEN_ADDR = '0.0.0.0'
LISTEN_PORT = 5005
SOCKET_ENCODING = 'utf8'
class SampleClient:
'''
Holds inform... |
"""Schema definitions for `marketprice.messages.targeting_recommendation_engine` namespace. Generated by avro2py v.0.0.6."""
import datetime
import decimal
import enum
from typing import List, NamedTuple, Union
class TargetingRecommendationToEnricher(NamedTuple):
"""
Provides required information to the TRE s... |
import yaml
import sys
import os
import argparse
from shutil import which
from kijiji_scraper.kijiji_scraper import KijijiScraper
from kijiji_scraper.email_client import EmailClient
from . import VERSION
def parse_args():
parser = argparse.ArgumentParser(description="""Kijiji scraper: Track ad informations and se... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import os.path
class Profile(object):
def __init__(self, input_fn, opt):
self.input_fn = input_fn
self.opt = opt
self.src_coord_file = ""
self.src_img = ""
self.id = ""
self.pixelwidth = 0
self.metric_un... |
#!/usr/bin/python3
import argparse
import tempfile
import yaml
import json
import subprocess
import base64
import os
import sys
import signal
import shlex
import time
import random
def parse_args(args_list):
parser = argparse.ArgumentParser(description='Run a simple command')
parser.add_argument('--copy-forwa... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from xio.core.lib.request import Request,Response
from xio.core.lib.utils import is_string, urlparse
import os
import sys
import traceback
import collections
import hashlib
import base64
i... |
import os
from shutil import rmtree
from tempfile import TemporaryDirectory
import pytest
from cognite.model_hosting.data_fetcher import DataFetcher
from cognite.model_hosting.data_fetcher.exceptions import InvalidFetchRequest
from cognite.model_hosting.data_spec import DataSpec, FileSpec, TimeSeriesSpec
class Test... |
import numpy as np
import pandas as pd
# non-migrating population = base population - out migration
# in migrating population = in migrating rates applied to base population
# dead population = death rates applied to non-migrating population
# non-migrating survived population = non-migrating population - deaths
# n... |
# Standard Modules
# Third Party Modules
from telebot import TeleBot
from telebot.types import (CallbackQuery, InlineKeyboardButton,
InlineKeyboardMarkup, Message)
# Local Modules
import anime_handler
import bot_token
import welcome_handler as w_handler
# Bot Initialization
bot = Tele... |
import io
import json
import logging
import re
import subprocess
import tempfile
import time
from dataclasses import dataclass, field
from typing import Any, Dict, List
import yaml
from . import config
from . import entity
from . import exceptions
from . import model
from . import schema
from . import utils
log = l... |
##
# Train SVM Model with given Command samples and baseline data and compare it with testdata
#
##
import codecs
import json
import pickle
import numpy as np
from p300Functions import filterDownsampleData
from sklearn import svm, preprocessing, metrics
from sklearn.model_selection import GridSearchCV
from sklearn.mo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 24 11:01:32 2019
@author: xiayezi
"""
import sys
sys.path.append("..")
import numpy as np
from utils.conf import *
from utils.data_gen import *
from utils.result_record import *
import matplotlib.pyplot as plt
vocab_table_full = [chr(97+int(v)) f... |
import argparse as ap
import os
import configparser
from astropy.io import fits
from .utilities import argparse as aputil
from .info import __version__,__code__,__ref__
# global comment symbol in output files
COMMENT='#'
def list_type(lst):
''' method to determine the datatype of a list
Parameters
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 16:59:49 2021
@author: bdobkowski
"""
import pandas as pd
import numpy as np
import seaborn as sns
import math
def clean_oly_data(data, wdi, world, indicators, field_names):
data = data[data.Season == 'Summer']
data = data.drop(columns=[... |
# Copyright 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, subl... |
from ..utils import chrom_order, PheWebError
from ..file_utils import get_cacheable_file_location, get_tmp_path, read_maybe_gzip
from .load_utils import run_script, ProgressBar
from collections import OrderedDict
import wget
import os
import sys
# TODO:
# class Build?
# .lookup_base(chrom, pos, length=1)
# ._ref... |
"""
Wisconsin Autonomous - https://www.wisconsinautonomous.org
Copyright (c) 2021 wisconsinautonomous.org
All rights reserved.
Use of this source code is governed by a BSD-style license that can be found
in the LICENSE file at the top level of the repo
"""
# WA Simulator
from wa_simulator.path import WAPath, create... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from mmskeleton.ops.st_gcn import ConvTemporalGraphical, Graph
class sSE(nn.Module):
def __init__(self, out_channels):
super(sSE, self).__init__()
self.conv = nn.Sequential(nn.Conv2d(out_channels... |
# -*- coding: utf-8 -*-
# Reference VOC scrips
# Author : <NAME>
# last modify : 2020-09-27
# This tool is used to convert VOC xml format to YOLO V3 format
# And pick 80% for train, left for val
# Files Tree: NOTE: One xml file corresponds to one image folder
# .
# ├── img
# │ ├── 1
# │ │ ├── img_1.jpg
# │ │ ... |
import numpy as np
import subprocess
import collections
import sys
import os
import time
def three_taxa_seq_generator(taxa_list):
l=len(taxa_list)
no_of_triplets=(l*(l-1)*(l-2))/6
used = 0
list3=[]
for i in range(0,l-2):
pointer1=i
elem = taxa_list[pointer1]
elem += ','
for j in range(1,l-used-1):
poi... |
"""
Author: <NAME>
Date Created: 16/12/2020
Function:
This script:
1: Gets preprocessed tweets from a text file(tweet_tokens.txt)
2: Gets the TF-IDF scores for the tokens in the data
3: Trains a SVC Classifier using the data
Each function has a docsting about its function
"""
import json
from sklearn.feature_extra... |
"""postgres
Revision ID: f9e56ed7c0bc
Revises:
Create Date: 2018-12-13 21:12:39.402429
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Ale... |
import pandas as pd
from abc import abstractmethod
import benchutils, os, time
class Preprocessor:
"""Super class of all preprocessor implementations.
Inherit from this class and implement :meth:`preprocessing.Preprocessor.preprocess()` if you want to add a new preprocessor class.
:param input: abso... |
import sublime, sublime_plugin, os, collections, json, hashlib
# Add our BetterBookmarks cache folder if it doesn't exist
def plugin_loaded():
directory = '{:s}/User/BetterBookmarks'.format(sublime.packages_path())
if not os.path.exists(directory):
os.makedirs(directory)
def Log(message):
if Settings()... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
#!/usr/bin/env python
import os
import sys
import logging
import logging.handlers
import inspect
from cloghandler import ConcurrentRotatingFileHandler
try:
import curses
except ImportError:
curses = None
try:
import util
except ImportError:
util = None
_LOGGER_NAME = 'frame_log'
log = logging.getLog... |
# -*- coding: utf-8 -*-
## 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... |
#
# Copyright (c) 2020, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list o... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
import subprocess
import os
import sys
import signal
import random
from contextlib import contextmanager
from app import logger, emitter, values, definitions
import base64
import hashlib
import time
from app.synthesis import program_to_formula, collect_symbols, ComponentSymbol, RuntimeSymbol
def generate_formula_from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/fitting/pdf_ops.py
# PDF multiplication via operators: easy wrappers for class RooProdPdf
# @see RooProdPdf
# @see ostap.fitting.basic.PDF
# @see ostap.fitting.fit2d.PDF2
#... |
import socket
import time
import threading
EXIT_FLAG = False
NAME = ""
END_CHAT = False
# in class baraye non-blocking input estefade mishe. yani ham zaman ke payam mokhatab ro toye console neshon midim betonim payam befrestim
class KeyboardThread(threading.Thread):
def __init__(self, input_cbk=None, name='keybo... |
# rtc_time.py Pyboard-only RTC based timing for low power uasyncio
# Author: <NAME>
# Copyright <NAME> 2018-2019 Released under the MIT license
# Code based on extmod/utime_mphal.c
# millisecs roll over on 7 days rather than 12.42757 days
# If not running on a Pyboard the normal utime timebase is used. This is also
#... |
import os
import sys
import datetime
import socket
import shutil
import subprocess as sp
import time
import signal
import pynput
import pyautogui
from pynput.keyboard import Key, Listener
import logging
import numpy as np
import cv2
import pyaudio
import wave
import pyAesCrypt
from tenacity import retry
import platfo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.