text stringlengths 3.07k 22.1k |
|---|
##
# File: RepoScanExec.py
#
# Execution wrapper -- repository scanning utilities --
#
# Updates:
#
# 28-Jun-2018 jdw update ScanRepoUtil prototype with workPath
# 3-Jul-2018 jdw update to latest ScanRepoUtil() prototype
# 20-Aug-2018 jdw engage incremental repository scan mode.
# 1-Aug-2021 jdw add scan_obsolete... |
import sys
import pandas as pd
import numpy as np
from qtpy import QtGui, QtWidgets
from qtpy.QtCore import QObject, Slot, Signal, QLocale, QDateTime, QRectF, QDate, QThread, Qt
from pyqtgraph.dockarea import Dock
from pymodaq.daq_utils.gui_utils import DockArea
from pymodaq.daq_utils.plotting.viewer1D.viewer1D_main i... |
# coding:utf-8
# Copyright 2016 Google Inc. All Rights Reserved.
# ==============================================================================
"""Converts image data to TFRecords file format with Example protos.
"""
from datetime import datetime
import os
import random
import sys
import threading
import ... |
import copy
import logging
import os
import tempfile
import uuid
from queue import Queue
from threading import Thread
from time import sleep
from typing import Optional, List, Dict
from werkzeug.datastructures import FileStorage
from dedoc.common.exceptions.bad_file_exception import BadFileFormatException
from dedoc.... |
import random
from pyeasyga import pyeasyga
import logging
from sklearn.model_selection import train_test_split
from torch import nn
from tqdm import tqdm
import os
import numpy as np
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
log = logging.getLogger(__name__)
from easynas.model_generation import ge... |
import enum
import itertools
import platform
import random
import datetime as dt
import statistics
import sys
from dataclasses import dataclass, asdict, field
from pathlib import Path
from typing import List, Optional
import pdfkit
from jinja2 import Template
if platform.system() == "Windows":
# ugh. Sorry. I ne... |
# Created by <NAME> at 23.02.2021
# contact: <EMAIL>
# import argparse
# import os
# import numpy as np
# import yaml
# import matplotlib.pyplot as plt
# from torchvision import transforms
# from efficientdet.dataset import CocoDataset, Resizer, Normalizer
# from utils.sync_batchnorm import patch_replication_callback
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from audio_separation.rl.ppo.ddppo_utils import distributed_mean_and_var
EPS_PPO = 1e-5
class PPO(nn.Module):
def __init__(
self,
actor_critic,
clip_param,
ppo_epoch,
num_mini_b... |
from __future__ import division
import glob
import json
import sys
import os
import os.path
sys.path.append('/Users/rodrigobresan/Documents/dev/github/anti_spoofing/spoopy')
import numpy as np
from keras.applications import VGG16, VGG19
from sklearn.ensemble import BaggingClassifier
from sklearn.metrics import accur... |
import os
import argparse
import cv2
import numpy as np
import glob
import math
from objloader_simple import *
dir_markers = os.path.join(os.pardir,'markers')
dir_chess = os.path.join(os.pardir,'chessboards')
dir_objects = os.path.join(os.pardir,'objects')
MIN_MATCHES = 30
def capture_boards():
vd = cv2.VideoCap... |
from tkinter import *
import models
import math
# Window class
class Window(Tk):
def __init__(self, *args, **kwargs):
# Initialize the window
super().__init__(*args, **kwargs)
# Set window settings
self.title("Charges and Fields")
self.resizable(0, 0)
# Set window... |
#!/usr/bin/python
import calendar
import xml.etree.ElementTree as ET
import sys
from datetime import date, timedelta
import datetime
import json
import time
import yaml
import math
from urllib.request import urlopen
from urllib.error import HTTPError
from dateutil.relativedelta import *
# pip install pyyaml
# pip in... |
import glob
import os
import re
import numpy as np
import soundfile
class AudioSliceInterface(object):
"""Abstract base class for data access"""
def time_slice(self, t_start, t_stop):
if t_start < 0.0:
raise ValueError("t_start ({:.2f}) cannot be < 0".format(t_start))
if t_stop >... |
import matplotlib.pyplot as plt
import face_alignment
import kornia
import torch
from torch import nn
import torchvision.transforms as transforms
import torch.nn.functional as F
from torch_utils import misc
import dnnlib
import legacy
from external.identity.iresnet import iresnet50, iresnet100
from external.landmark.... |
# -*- coding:UTF-8 -*-
'''
Created on 2013-7-12
@author: caifenghua
'''
import unittest
import pprint
import creditutils.file_util as myfile
import creditutils.base_util as base
import os
def func_flag():
pass # do stuff
global __modpath__
__modpath__ = base.module_path(func_flag)
class Test(unittest.Tes... |
from app import app
from es_connection import es
import csv
from config.newman_config import default_min_timeline_bound, default_max_timeline_bound, default_timeline_span, default_timeline_interval
from es_queries import _build_filter, _addrs_filter, _date_filter, _build_email_query
from dateutil.parser import parse
... |
class CONFIG:
XUA_JSON = 'xua.json'
class KEY:
PROJECTS = 'projects'
PROJECT_SERVER_PHP = 'server/php'
PROJECT_MARSHAL_DART = 'marshal/dart'
PROJECT_DOC_HTML = 'doc/html'
PROJECT_DOC_LATEX = 'doc/latex'
PROJECT_ = [
PROJECT_SERVER_PHP,
PR... |
import copy
from typing import Iterable
import numpy as np
from IPython.core.display import clear_output
from rdkit import DataStructs
from tqdm import tqdm
from synergetic_molecule_generator import molecules
def _relativize_vector(vector: np.ndarray):
std = vector.std()
if std == 0:
return np.ones(... |
import numpy as np
import tensorflow as tf
class EncoderCV(tf.keras.layers.Layer ):
def __init__(self, intermediate_dims, w = 64):
super(EncoderCV, self).__init__()
self.original_w = w
# self.reshape_1 = tf.keras.layers.Reshape([original_w, original_w, 1])
self.... |
# Copyright 2015 MongoDB, Inc.
#
# 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, s... |
"""Functions defining expected losses from the instruments."""
from __future__ import annotations
from pathlib import Path
import numpy as np
from edges_cal import reflection_coefficient as rc
from ..config import config
from scipy import integrate
def balun_and_connector_loss(
band: str,
freq,
gamma_ant... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import defaultdict, Counter
from itertools import chain
from multiprocessing.pool import Pool
from pathlib import Path
from typing import Dict, Tuple, List
import numpy
from data_structure import GraphNode
from semantic_labeling.column import Column
from sema... |
import numpy as np
import pandas as pd
import cvxpy as cp
pd.set_option('expand_frame_repr', False) # Keeps results on 1 line
# Convert Aggregator to combine OCHRE Battery models into a virtual battery model
# Required parameters for virtual battery model, and their min/max values
BATTERY_PARAMETERS = {
'State ... |
import os as _os
import shutil as _shutil
import numpy as _np
class OctopusStates:
def __init__(self, basedir):
rf = open(basedir + '/restart/gs/states')
self.basedir = basedir
self.nst = int(rf.readline().split()[1])
self.dim = int(rf.readline().split()[1])
self.nik = int... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import random
import argparse
import util
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self, input_size, hidden_size):... |
import ast
import glob
import os
import albumentations as A
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from matplotlib import pyplot as plt
from sklearn.metrics import recall_score
from torch.utils.data import DataLoader
from tqdm import tqdm
from dataset import Bengal... |
"""Recipe parsing for MasterCook 5+ format (.mx2) files.
Use parse_file to parse a file.
"""
import xml.etree.ElementTree as ET
__all__ = ['Info', 'Recipe', 'Rating', 'Ingredient', 'parse_file']
class Info:
"""Represents file-level information for a MasterCook 5+ .mx2 file.
Attributes:
source: Fil... |
import argparse
import csv
import linecache
import os
import pickle
import traceback
import sys
import subprocess
import ray
import itertools
import pygments
import json
from collections import namedtuple
from pathlib import Path
from pdb import set_trace
from git_crawler import get_postcommit_file, get_precommit_fil... |
"""
downloads anime themes
"""
from pySmartDL import SmartDL
import time;start = time.time()
import os
import eyed3
import threading
import requests
import string
from animethemes import get_proper
from printer import fprint
from globals import Opts
FILENAME_BAD = set('#%&{}\\<>*?/$!\'":@+`|')
FILENAME_BANNED = set('<... |
import matplotlib.pyplot as plt
import numpy as np
from numpy.linalg import norm
import re
import os
import torch
import torchvision.transforms as transforms
import os.path as osp
from torch.utils.data import Dataset
from os import listdir
from os.path import isfile, join
#from Bio.PDB import PDBParser
from src.dataloa... |
import asyncio
import concurrent
import discovery
import environment as env
import instruction
import random
import time
from threading import Thread
import tlc5947
resolution_ms = 15
max_brightness = 4095
def start_background_loop(loop: asyncio.AbstractEventLoop):
asyncio.set_event_loop(loop)
loop.run_foreve... |
from datetime import date
from itertools import chain
from lunchinator.commands import Commands
from lunchinator.models import Selection, Meal, User, Restaurant
from lunchinator import SlackUser
from recommender.recommender import Recommender
from slack_api.sender import SlackSender
import re
from django.http import H... |
import csv
import requests
import io
import json
import uuid
from collections import OrderedDict, defaultdict, Counter
import urllib.parse
from functools import lru_cache
# for LRU cache
CACHE_MAX_SIZE = 65536
__all__ = ['RProperty', 'RQuery', 'PeriodoReconciler',
'CsvReconciler', 'non_none_values', 'group... |
import random
import re
import string
PADDING = 1
VPADDING = 1
DOUBLE_SPACE = False
PATTERN_LEN = 15
PATTERN_CHARS = string.ascii_uppercase + string.digits
class stereo_panel(object):
"""This is a class for building text-based autostereograms.
Any text passed in 'lines' surrounded by /forward slashes/ wil... |
#
# Copyright 2021, NTT Communications Corp.
#
# 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 applic... |
import numpy as np
import librosa
from joblib import dump, load
from sklearn.preprocessing import StandardScaler
from sklearn.utils import shuffle
from sklearn.utils.fixes import loguniform
from scipy.stats import uniform
from sklearn.pipeline import Pipeline
from sklearn.model_selection import ParameterGrid, GridSea... |
import requests
import lxml.html
import datetime
from natsort import natsorted, ns
import MySQLdb
import re
def main():
'''
メイン処理
'''
session = requests.Session()
res = session.get('http://gfkari.gamedbs.jp/')
urls = get_girl_urls(res)
nat_urls = natsorted(urls)
for url in nat_urls:
... |
from ...core.enum.ea_mode import EAMode
from ...core.models.assembly_parameter import AssemblyParameter
from ...core.enum import ea_mode_bin
from ...core.enum.ea_mode_bin import parse_ea_from_binary
from ...simulator.m68k import M68K
from ...core.util.split_bits import split_bits
from ...core.opcodes.opcode import Opco... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import os, sys, re
import logging
import argparse
import collections
import datetime
import time
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logger = logg... |
#
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, pu... |
import httpretty
import pytz
from datetime import datetime
from requests_forecast import Forecast
API_KEY = "1234"
LATITUDE = 38.9717
LONGITUDE = -95.235
API_URL = "https://api.darksky.net/forecast/{}/{},{}".format(
API_KEY, LATITUDE, LONGITUDE
)
@httpretty.activate
def test_alerts():
body_fixture = open(... |
from __future__ import absolute_import
from collections import OrderedDict
import warnings
import six
import math
import decimal
from plotly import utils
from plotly import exceptions
from plotly import graph_reference
from plotly import session
from plotly.files import (CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT,
... |
# File: F (Python 2.4)
import Weapon
import WeaponGlobals
from pirates.audio import SoundGlobals
from pirates.audio.SoundGlobals import loadSfx
from direct.interval.IntervalGlobal import *
from pandac.PandaModules import *
from pirates.uberdog.UberDogGlobals import InventoryType
from pirates.piratesbase import PLocali... |
#!/usr/bin/env python3
import os
import argparse
import logging
import sys
import export
import util
import logging
from rich.logging import RichHandler
from PyPDF2 import PdfFileMerger, PdfFileReader
from reportlab.graphics import renderPDF
from reportlab.pdfgen import canvas
import qrcode
import qrcode.image.svg
fr... |
#!/usr/bin/env python
# Copyright 2020 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
# Tracking program with pan-tilt mechanism
# USAGE: python 3_fullsystem.py -m 1
# Credits: <NAME> from PyImageSearch.com
# https://www.pyimagesearch.com/2019/04/01/pan-tilt-face-tracking-with-a-raspberry-pi-and-opencv/
# import the necessary packages
import time
import numpy as np
import cv2
import pantilthat as pth
i... |
"""All base classes are defined in this file."""
import logging
import os
from contextlib import contextmanager
from unittest.mock import Mock
from requests import Session
class RESTBaseException(Exception):
def __init__(self, msg=None, data=None, code=None, response=None, exc=None):
super().__init__(msg... |
from typing import Callable, Tuple
from ribosome.machine import may_handle, handle, Message
from ribosome.machine.base import io, UnitTask
from ribosome.machine.transition import Fatal
from ribosome.request.base import parse_int
from amino import __, L, _, Task, Either, Maybe, Right, List, Map, Eval, Left
from amino.... |
#!/usr/bin/env python -u
'''
pDMET: Density Matrix Embedding theory for Periodic Systems
Copyright (C) 2018 <NAME>. All Rights Reserved.
A few functions in pDMET are modifed from QC-DMET Copyright (C) 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compl... |
import logging
from datetime import date
from functools import partial
from os.path import basename
from typing import Callable, Iterator
import requests
import us
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.feature import Feature
from django.contrib.gis.gdal.layer import Layer
from dja... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) IBM Corporation 2019, 2020
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
module: ims_command
short_description... |
# Copyright (c) 2016-2021, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions ... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow_addons as tfa
#分类数,我们要使用cifar100这个数据集,这里有100种分类,所以这里我们设置100
num_classes = 100
input_shape = (32, 32, 3) #输入图片的大小(h, w, c)
(x_train, y_train),(x_test,y_test) = keras.datasets.cifar100.load_dat... |
import math
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import src.utils.init as my_init
from .tensor_utils import tile_batch, FLOAT32_INF
class ScaledDotProductAttention(nn.Module):
''' Scaled Dot-Product Attention '''
def __init__(self, d_model, att... |
from pypitchfx.load.queries import *
from pypitchfx.gameday_model.Action import Action
from pypitchfx.gameday_model.AtBat import AtBat
from pypitchfx.gameday_model.Game import Game
from pypitchfx.gameday_model.GamePlayer import GamePlayer
from pypitchfx.gameday_model.Inning import Inning
from pypitchfx.gameday... |
#!/usr/bin/env python
# coding: utf-8
# In[6]:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import urllib.request
import os
import pandas as pd
from urllib.parse import quote_plus
from bs4 import BeautifulSoup as bs
from selenium import webdriver
import time
f... |
import argparse
import numpy as np
from iblviewer.qt_application import ViewerApp
from iblviewer.application import Viewer
got_ibllib = True
try:
from iblviewer.mouse_brain import MouseBrainViewer
except ModuleNotFoundError:
got_ibllib = False
"""
Project: IBL Viewer
Description: this is a fast and interacti... |
# 대신증권 API
# 시세 연속 조회 제한 확인용 예제
# 예제 설명:
# 본 예제는 거래소 종목(약 1350 여 종목) 전체에 대한 현재가 통신을 반복 호출 합니다.
# 플러스 API 를 이용한 시세 요청 건수는 과다 호출을 막기 위해 기본 15초당 60건으로 제한하고 있습니다
# 만약 15초에 60건을 초과할 경우 이후 요청은 자동으로 지연 요청 하게 되어 있습니다
# 이번 예제는 시세 요청 시 현재 남아 있는 통신 요청 건수를 확인하고, 만약 요청이 지연되는 경우 지연 요청이 해제되기까지 남은 시간을 구하는 방법을 설명하... |
# Copyright (c) 2016. Mount Sinai School of Medicine
#
# 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 o... |
import os
import inspect
from pkg_resources import parse_version
import geosoft.gxpy as gxpy
import geosoft.gxapi as gxa
import re
from docstring_info import parse_docstring
min_version = parse_version("8.5")
ver_add_re = re.compile(".*versionadded\:\:\s+([0-9\.]+)", re.MULTILINE)
def _is_some_method(obj):
retu... |
"""Utilities module for gui services."""
import datetime
import logging
from typing import Any
from aiohttp import web
from aiohttp_session import get_session
from result_service_gui.services import (
EventsAdapter,
RaceplansAdapter,
StartAdapter,
TimeEventsAdapter,
TimeEventsService,
UserAdap... |
import numpy as np
import os
import copy
from PIL import Image
from enums import suffix_dict, model_dict, Suffix
from parameter_parser import default_model_params
from execute import generate_files
from datasets.dataset_iad import DatasetIAD
from scipy.signal import savgol_filter
def save_png(iad, output_filename,... |
"""Kongsberg_MBES_preporocessing.
Module which preprocesses raw Kongsberg EM series bathymetry and backscatter
from ALL files.
The module is based on the pyall reader. For the bathymetry preprocessing, the
XYZ and position datgrams are used. Based on the processed bathymetry, the
backscatter time series in the... |
"""scipy implementation of beta-Gaussians (compatible to scipy.stats)"""
from scipy.special import gamma
import numpy as np
from scipy.stats._multivariate import multi_rv_generic, multi_rv_frozen
from scipy.stats._multivariate import multivariate_normal
from .utils import _PSD, _process_parameters
_LOG_2PI = np.lo... |
#
# Copyright (c) 2020 Expert System Iberia
#
"""Normalizes `ClaimReview` so other reviewers can use a standard
value range. Produces a `NormalisedClaimReview`.
"""
from esiutils import isodate, bot_describer, dictu, hashu
from acred import content
from acred.rating import agg
from acred.reviewer.credibility import lab... |
import os
import tensorflow as tf
from keras import Sequential, layers, regularizers
import keras
import numpy as np
import pandas as pd
import plotly.offline as ply
import plotly.graph_objs as graphs
import math
import random
import matplotlib.pyplot as plt
def get_dims(data_dir):
"""Get dimensions from a npy fi... |
from time import time
from typing import List, Tuple, Dict, Callable, Union
from abc import ABC
from abc import abstractmethod
from pprint import pformat
import gc
from scipy.sparse import csr_matrix
import numpy as np
from sklearn.base import clone
from sklearn.metrics import balanced_accuracy_score, f1_score, preci... |
"""Module containing object handler classes used by :py:class:`.Delver`"""
import six
from delver.exceptions import DelverInputError, ObjectHandlerInputValidationError
class BaseObjectHandler(object):
"""Base Object Handler class from which other handlers should inherit"""
#: The object type associated wit... |
# Copyright 2021, <NAME>.
#
# Developed as a thesis project at the TORSEC research group of the Polytechnic of Turin (Italy) under the supervision
# of professor <NAME> and engineer <NAME> and with the support of engineer <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f... |
#!/usr/bin/env python3
#
# This is intended as a bare-bones landscape evolution model using landlab
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d as plt3d # allows projection='3d'
import matplotlib.animation as mpl_animation
import landlab as lab
import landlab.components as lab_com... |
"""
Set of functions for processing files and filenames which may be system specific and might need to be
changed in moving from one system to another.
"""
import os
import subprocess
def process_bad_id_file(bad_id_file):
"""
Read in each entry in the bad id file and if it is shorter than 9 characters
pa... |
import unittest
import torch.nn as nn
import torch.nn.functional as F
import torch
from super_gradients.training.utils.optimizer_utils import separate_zero_wd_params_groups_for_optimizer
from super_gradients.training.utils import HpmStruct
from super_gradients.training.models.sg_module import SgModule
class ToyLinea... |
'''
MIT License
Copyright (c) 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, distri... |
from __future__ import division, unicode_literals
__all__ = ['utlilits']
import hashlib
import numpy as np
import logging
import collections
import sys
if sys.version_info[0] >= 3:
basestring = str
unicode = str
long = int
else:
range = xrange
try:
from utlilits import get_value, simhash_build_b... |
import requests, sys, argparse, validators, os, tldextract
from colorama import init, Fore, Style
from pyfiglet import Figlet
requests.packages.urllib3.disable_warnings()
#methods = ["GET","POST","PUT","TRACE","SEARCH","PATCH","PROPFIND","VERSION-CONTROL","MKCOL","LOCK","REPORT","UNLOCK","MOVE","LABEL","COPY","CH... |
# -*- coding: utf-8 -*-
"""
@date: 2020/12/4 下午4:11
@file: act_helper.py
@author: zj
@description:
"""
import numpy as np
import torch
import torch.nn as nn
from .layers.asymmetric_convolution_block import AsymmetricConvolutionBlock
from .layers.acb_util import _fuse_kernel, _add_to_square_kernel
from .layers.repvgg... |
# 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 u... |
#===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... |
import sys
import os
import argparse
from collections import defaultdict
from subprocess import Popen
from threading import Thread
from datetime import datetime
from time import sleep
FILE_LIST_DISPLAY_MAX_SIZE = 50
class DeleteThread(Thread):
"""background deletion thread"""
def __init__(self, f... |
from MessageHeader import MessageHeader
from AVP import AVP
import binascii
import xdrlib
class Message:
"""A Diameter message (header and AVPs)
The Message is a container for the MessageHeader and the AVP s.
It supports converting to/from the on-the-wire format, and
manipulating the AVPs. The class is... |
# -*- coding: utf-8 -*-
import numpy as np
from sklearn.metrics import mean_squared_error
from scipy.signal import find_peaks
from scipy.spatial.distance import euclidean
from scipy.ndimage import gaussian_filter
import time
#import fastdtw
#from dtaidistance import dtw
# %% some normalization functions
def normali... |
import pytest
import cv2
import fotogrametria
from webcam import calcular_angulo_e_distancia_na_image_da_webcam
segmentado_ciano = None
segmentado_magenta = None
ccontorno_ciano = None
contorno_magenta = None
centro_ciano = None
centro_magenta = None
## PARTE 1 - FOCO
def test_foco():
try:
resp ... |
import numpy as np
import os
import sys
if '/opt/ros/kinetic/lib/python2.7/dist-packages' in sys.path:
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
from utils import get_file_name, filter_events_by_key
import argparse
def pack_with_manual_refocus(opt, event_path, aps_path, sa... |
##############################################################################
#
# Copyright (c) 2020 TomskSoft LLC
#
# 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, incl... |
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# ... |
"""
Sample usage (from project root dir): python src/github_analysis/motif_finder.py 0
Functions for implementing the following algo, suggested by <NAME>:
To identify the K-node motifs in a graph, you could always use NetworkX and do something simple like:
Iterate:
sample a random node
pick a neighbor, add to... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Application-agnostic utility functions
"""
import io
import logging
import mimetypes
import os
import os.path
import smtplib
import sys
__all__ = [
"exception_hook", "print_tb_with_local", "supports_color", "get_logger",
"readxml", "readkeyval", "readyaml", "... |
# -*- coding: UTF-8 -*-
from tkinter import *
from tkinter import font
from tkinter.ttk import Combobox
from tokenizer import Tokenizer
from tagger import Tagger
from tkinter import filedialog
import tkinter.scrolledtext as tkscrolled
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt... |
# 微博数据抓取 基于关键词
# 作者: David
# Github: https://github.com/HEUDavid/WeiboSpider
import datetime
import random
import re
import time
import pandas as pd
from bs4 import BeautifulSoup
from CookieTest import CookieTest
from SpiderThread import SpiderThread
class WeiboSpider:
def __init__(self, html):
self.... |
#!/usr/bin/env python
# -*-encoding:utf-8-*-
# -------------------------------------------------------------------------------
# Name: utils.py
# Description:
# Author: Aaron
# Date: 2019/5/27
# -------------------------------------------------------------------------------
"""
需求说明:
v2版数据结构: {"... |
import random
import time
from abc import ABCMeta, abstractmethod
from enum import Enum
if __name__ == '__main__':
print("面向对象")
class Student:
def study(self, course_name):
print(f'学生正在学习{course_name}.')
def play(self):
print(f'学生正在玩游戏.')
stu1 = Student()
stu2 = Student()
print(stu1)... |
import numpy as np
import random
import matplotlib.pyplot as plt
import networkx as nx
import os
class Construct_Binary_Clustering:
def __init__(self,dims,latent_dims):
self.dims = dims
self.latent_dims = latent_dims
def constr_latent_mat(self): ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 15 23:37:29 2018
@author: kindy
python 调用有道翻译api实现简单翻译软件
(1)前往http://ai.youdao.com/注册账号, 登录后台创建应用和实例并完成绑定, 可获得应用ID和密钥等信息,其中应用ID就是appKey( 注意不是应用密钥)
"""
import http.client as httplib
from hashlib import md5
import urllib
import random
import json... |
#!/usr/bin/env python3
# Forked from import_h5_4.py at 05/25/2021 by SJ
# To be publicly released
#
# Difference (wrt. import_h5_4.py):
# - code cleanup
# - hard codes removed
#
# Initial code in 09/25/2019 by <NAME>
#
import h5py
import glob
import numpy as np
import datetime
from numpy.lib.nanfunctions import _nanq... |
from __future__ import annotations
import copy
import inspect
import string
import typing
from .lazy import Lazy, resolve_lazy
EXCEPTION_HANDLER_NAME = "_htmlgenerator_exception_handler"
"Must be a function without arguments, will be called when an exception happens during rendering an element"
# for integration wi... |
#!/usr/bin/env python
from dataclasses import dataclass
from math import floor, sqrt, inf
from typing import List, Tuple
import os
from matplotlib import pyplot as plt
from nav_msgs.srv import GetMap, GetMapResponse
import numpy as np
import rospy
import seaborn as sns
from racecar_behaviors.srv import BlobList, BlobL... |
#!/usr/bin/env python3
import random
import timeit
import numpy as np
import os.path as osp
from itertools import count
from datetime import timedelta
import matplotlib
import matplotlib.pyplot as plt
import collections
from collections import namedtuple
from tensorboardX import SummaryWriter
import tor... |
from os.path import dirname
from shutil import copy
from lark import Lark, Transformer
from constants import GRAMMAR
def rreplace(s, old, new):
li = s.rsplit(old, 1) #Split only once
return new.join(li)
includes = []
class PeriwinkleTree(Transformer):
def __init__(self, path):
super().__init__(... |
"""
:synopsis: Main crawler module, to oversee all site-specific crawlers.
Contains all website/framework-specific Class crawlers.
"""
import logging
import math
import time
import threading
import requests
from . import indexer
class GitHubCrawler(threading.Thread):
"""
Crawler that retrieves links to all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.