text stringlengths 3.07k 12.6k |
|---|
from typing import (Sequence, Optional)
import pysweep.databackends.base as base
import qcodes.utils.metadata
STUPIDAXES = ['None1', 'None2', 'None3']
class DataBackend(base.DataBackend, base.DataSaver):
def __init__(self, meas):
self.meas = meas # The qcodes measurement object
self.runner = None... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
"""
Code to do fractal geometry analysis:
surface area of simple curves
volume of simple curves
find all line segment intersections
"""
import numpy as np
from scipy.spatial import ConvexHull
#from shapely.geometry import LineString
#from shapely.geometry.polygon import LinearRing
def poly_point_pairs(c... |
# Copyright 2011, 2013 OpenStack Foundation
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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/LICEN... |
"""
.. module:: TextGenerator
TextGenerator
*************
:Description: TextGenerator
:Authors: bejar
:Version:
:Created on: 06/09/2017 9:26
"""
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.layers import LSTM
from keras.optimizers import RMSprop, SGD
impo... |
#!/bin/env python
#===============================================================================
# NAME: CheetahUtil.py
#
# DESCRIPTION: This class contains the methods that format data into the ways
# which Cheetah templates desire it.
#
# AUTHOR: <NAME>
# EMAIL: <EMAIL>
# DATE CREATED: June 6, 2018
#
# Copyright 2... |
#python makeAllGraphs.py [cutoff value] [-w for weighted matrix, -uw for unweighted]
# [-nb for no biases, -b for biases] [optional filename prefix for saving]
import sys
import makeGraph
import makeGraphNoBias
import numpy as np
path = ""
'''
MAIN HAS BEEN MODIFIED TO RETURN THE MATRIX INSTEAD OF SAVING IT.
'''
def ... |
import tensorflow as tf
from tensorflow import keras
def smooth_l1_loss(y_true, y_pred):
'''Implements Smooth-L1 loss.
Args
---
y_true and y_pred are typically: [N, 4], but could be any shape.
'''
diff = tf.abs(y_true - y_pred)
less_than_one = tf.cast(tf.less(diff, 1.0), tf.flo... |
"""
Citation:
TensorFlow code and pre-trained models for BERT.
Contribute to google-research/bert development by creating an account on GitHub.
Google AI Research, 2019.
This code is adapted from code with the following license:
# Copyright 2019 Google Inc.
# Licensed under the Apache License, Version 2... |
# -*- coding: utf-8 -*-
DESCRIPTION = """Given a paper ID, get all of the outgoing references, then collect seed, target, and candidate sets for different random seeds based on those references."""
import sys, os, time, shutil
from pathlib import Path
from datetime import datetime
from timeit import default_timer as ... |
"""Fragment processors."""
import glob
import logging
import os
from typing import Any, Callable, Iterable, Iterator, Mapping, Sequence, Tuple, Type
from climatecontrol.constants import REMOVED
from climatecontrol.file_loaders import (
FileLoader,
NoCompatibleLoaderFoundError,
iter_load,
load_from_file... |
import math
import numpy as np
import transforms3d
import utm
def axangle4_to_3(ax):
normal = ax[0]
angle = ax[1]
return normal*angle
def axangle3_to_4(ax):
angle = np.linalg.norm(ax)
if(angle != 0):
return (ax/angle, angle)
else:
return ([0.0, 0.0, 1.0], 0)
def x_to_mat(x)... |
#!/usr/bin/python3
import tensorflow as tf #import general python packages
import numpy as np
import pandas as pd
import time, os, sys
import argparse
from network import Network #import components from other user defined python files
from utils import Utils
from data import Data
from model import Model
from ... |
from .ConstantsAndParameters import *
# useful functions
def w2f(wlen):
return c0/wlen # returns the frequency [Hz] \\tfrom the wavelength [m]
def f2w(freq):
return c0/freq # returns the wavelength [m] \\tfrom the frequency [Hz]
def print_const(normalized = False):
if not normalized:
print("CONST... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
__all__ = []
import kplr
import numpy as np
import matplotlib.pyplot as pl
client = kplr.API()
def build_matrix(x, nwindow):
nx, nt = x.shape
X = np.empty((nt - nwindow, nx * nwindow))
for i... |
import threading
import shared
import time
import sys
import os
import pickle
import tr#anslate
from helper_sql import *
from helper_threading import *
from debug import logger
"""
The singleCleaner class is a timer-driven thread that cleans data structures
to free memory, resends messages when a remote node doesn't... |
# Copyright (c) 2015 <NAME> <<EMAIL>>
# Author: <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
# use, copy... |
from . import yes_no_parser,run_command,variables
import logging
import random
import json
import sys
import re
import os
def process_node(node_tag,nodes,session_vars,responses,user_input=None):
node = nodes[node_tag]
conversation = 'default'
logging.debug("Processing {} node: {}".format(node['node_type']... |
import math
from PIL import Image
from logging import debug, info, warning, basicConfig, INFO, DEBUG, WARNING
#Don't forget the max number of items in each array is 32767 items (max signed 16 bit int size).
#This means the max value for length below is 10922!
#Length is the number is pixels stored in each array, so sh... |
# -*- coding: utf-8 -*-
""" CLI to process imagery products to tiles and index in database
"""
from collections import defaultdict
import concurrent.futures
import logging
import os
import click
import six
# TODO: hide many of these imports to improve CLI startup speed
from . import cliutils, options
from .. import m... |
"""Query client CLI."""
from argparse import ArgumentParser, Namespace
from json import dumps
from logging import DEBUG, INFO, basicConfig, getLogger
from socket import timeout
from sys import exit, stdout # pylint: disable=W0622
from mcipc.query.exceptions import InvalidConfig
from mcipc.query.client import Clien... |
# -*- coding: utf-8 -*-
"""Wrapper around Royal Render API."""
import sys
import os
from openpype.settings import get_project_settings
from openpype.lib.local_settings import OpenPypeSettingsRegistry
from openpype.lib import PypeLogger, run_subprocess
from .rr_job import RRJob, SubmitFile, SubmitterParameter
log = P... |
# Copyright (c) 2020, <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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
"""empty message
Revision ID: bc79206537e7
Revises: 10bd52b06872
Create Date: 2021-10-16 23:55:25.599527
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bc79206537e7'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### com... |
import numpy as np
import torch
from scipy.stats import wasserstein_distance
from generate.metrics import ca_metrics, amino_acid_metrics, secondary_sequence_metrics
class MMD:
"""
Compute the Maximum Mean Discrepancy (MMD) between the predicted graph and a set of target ones.
Graph statistics include a... |
#!/usr/bin/env python
"""433SS - 433 MHz Sensor Service using rtl_433."""
import json
import os
import subprocess
import sys
import ConfigParser
import paho.mqtt.client as paho
def execute(command):
"""Execute given command in a subprocess."""
process = subprocess.Popen(
command, shell=True, stdout=s... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2022- <NAME>
#
# Distributed under the terms of the MIT License
# (see wavespin/__init__.py for details)
# -----------------------------------------------------------------------------
import math
fro... |
import requests
from datetime import datetime, date
import pandas as pd
# headers and params used to bypass NASDAQ's anti-scraping mechanism in function __exchange2df
headers = {
'authority': 'api.nasdaq.com',
'accept': 'application/json, text/plain, */*',
'user-agent': 'Mozilla/5.0 (X11; Linux x86... |
import json
from typing import Sequence, Set, Tuple
import numpy as np
import pytest
from brown_clustering import BigramCorpus, BrownClustering
files: Sequence[Tuple[str, int]] = [
("very_small_fraud_corpus", 50),
("small_fraud_corpus", 1000)
]
@pytest.mark.parametrize("f", files)
def test_full_clustering(... |
#### Tic Tac Toe Game ####
"""
*[C] Represent the board as a 9-dimensional array [1, 9].
* Don't care about the sequence of a game, simply score moves against static boards
* Illegal moves (no move, place over existing gamepiece) are scored as a "loss" (-1)
* Normal moves that don't end the game are scored ne... |
from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import reduce_mean
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
... |
# --------------------------------------------------------
# TensorFlow @ Dragon
# Copyright(c) 2017 SeetaTech
# Written by <NAME>
# --------------------------------------------------------
import re
from dragon.core.tensor import Tensor
from dragon.core.scope import TensorScope, DeviceScope
from dragon.vm.tensorflo... |
import argparse
from functools import partial
import json
import os
import pathlib
import subprocess
from typing import Dict
from newpy import logger
from newpy.storage import Storage
from newpy.templates import templates
from newpy.utilities import retrieve
parser = argparse.ArgumentParser()
arguments = [
{
... |
#
"""
Functions that define and manipulate GridData.
The griddata has axes [chan, pol, z, y, x] where z, y, x are spatial axes in either sky or Fourier plane. The
order in the WCS is reversed so the grid_WCS describes UU, VV, WW, STOKES, FREQ axes.
GridData can be used to hold the Fourier transform of an Image or gri... |
"""
General UI utilities for simplifying UI creation code.
"""
import logging
import os
import traceback
from functools import partial
import maya.cmds as cmds
from ..vendor.Qt import QtCore, QtWidgets, QtGui
LOG = logging.getLogger(__name__)
ICON_DIR = os.path.join(os.path.dirname(__file__), 'icons')
# mel comma... |
#!/usr/bin/python
'''
(C) Copyright 2019 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
Unless required by applicable ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 04 15:59:14 2016
@author: hehu
"""
import numpy as np
import random
import matplotlib.pyplot as plt
import matplotlib
import pickle
def generate_data(N):
X1 = np.random.randn(2, N)
X2 = np.random.randn(2, N)
M1 = np.array([[1.5151, -0.112... |
#coding:utf8
# sys
import sys
import torch
from torch.utils.data.dataset import Dataset
from torch.utils.data import TensorDataset, DataLoader
import random
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
import torch.nn.functional as F
fr... |
# -*- coding utf-8 -*-#
# ------------------------------------------------------------------
# Name: item
# Author: liangbaikai
# Date: 2020/12/31
# Desc: there is a python file description
# ------------------------------------------------------------------
import json
import re
from typing import Un... |
"""Various computers of job posting properties. Each class is generally a generic algorithm (such as skill extraction or occupation classification) paired with enough configuration to run on its own"""
from . import JobPostingComputedProperty, ComputedPropertyColumn
from skills_ml.algorithms.string_cleaners.nlp import... |
from nntoolbox.vision import *
from .layers import *
__all__ = ['MultipleStyleTransferNetwork', 'GenericDecoder', 'PixelShuffleDecoder', 'PixelShuffleDecoderV2', 'SimpleDecoder']
class MultipleStyleTransferNetwork(nn.Module):
def __init__(self, encoder: FeatureExtractor, decoder:nn.Module, extracted_feature: in... |
import argparse
import os
import subprocess
import sys
import tempfile
from Crypto.PublicKey import RSA
from jinja2 import Template
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--github-user', help='The GitHub user whose keys will'
' be preloaded for the pi user. If absent authentica... |
import os
import argparse
import zipfile
import numpy as np
from tqdm import tqdm
from h3ds.dataset import H3DS
from h3ds.mesh import Mesh
from h3ds.log import logger
from h3ds.utils import error_to_color, download_file_from_google_drive, create_parent_directory, create_directory, remove
def method_file_id(method):... |
import datetime
from random import randint
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.validators import MaxLengthValidator, MinLengthValidator, MinValueValidator
from django.db import models
from django.db.mod... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
import os
import sys
import time
import json
import requests
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
from spider.jobdetail_spider import crawl_job_detail
import pandas as pd
from util import log
from config.config import TIME... |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2017 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... |
import numpy as np
from sigpipes.sigcontainer import SigContainer
from sigpipes.sigoperator import SigOperator
from warnings import warn
from typing import Sequence, List
from scipy.signal import correlate, convolve
from deprecated import deprecated
class Joiner(SigOperator):
def __init__(self, *branches):
... |
import socket
import os
import threading
import shutil
import pygame
import random
class game:
x = pygame.init()
def __init__(self):
self.gameWindow = pygame.display.set_mode((400, 500))
pygame.display.set_caption("RollDice - By <NAME>")
self.one = pygame.image.load("dice_images/dice... |
"""
Author:
<NAME>, <EMAIL>
"""
from deepctr.feature_column import build_model_input
from deepctr.layers import DNN
from deepctr.layers.utils import NoMask, combined_dnn_input
from tensorflow.python.keras.models import Model
from deepmatch.layers import PoolingLayer
from deepmatch.utils import get_item_embedding
f... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
=================================================
@Project :aste
@IDE :PyCharm
@Author :Mr. Wireless
@Date :2021/12/22 14:41
@Desc :
==================================================
"""
import unicodedata
def _is_whitespace(char):
"""Checks whether `c... |
import random
import numpy as np
VERBOSE = __name__ == '__main__'
class Matrix:
def __init__(self, nb_row, nb_col, name="Matrix"):
self.name = name
self.nb_row = nb_row
self.nb_col = nb_col
self.randomize()
def __str__(self):
title = self.get_name()
mat = ''
for r in range(self... |
# ===============================================
# Foreword
# ===============================================
""" This script works as a demonstration how a given audio file can be transformed into speaker embeddings. When working with multiple audio files,
consider first creating the MFCC files as desc... |
import numpy as np
import os
import sys
import matplotlib.pyplot as plt
#os.system('cat ')
def plotCurse(logfile):
command_train_loss = 'cat ' + logfile + ' | grep \'Train net output #0\' | awk \'{print $11}\''
command_train_loss_1 = 'cat ' + logfile + ' | grep \'Train net output #1\' | awk \'{print $11}\''... |
# -*- coding: utf-8 -*-
# Copyright (c) 2022 by <NAME>
import os
import time
import torch
import pickle
import random
import configs
import threading
import torch as t
import numpy as np
from time import time
from tqdm import tqdm
from torch.utils import data
class QADataset(data.Dataset):
def __init__(self):
... |
# ======================================================================
# imports
# ======================================================================
from discord.ext import commands as cmds
from cogs.utils.quizList import QuizList, solution_index
from cogs.utils import checks
import datetime
from tzlocal impor... |
#!/usr/bin/env python
import os
import sys
import numpy
import argparse
import copy
from util import StoppableThread, safe_div, tailq
import threading
import signal
from pprint import pprint
import itertools
# header
# Time,Time_usec,ProducerName,component_id,job_id,aries_rtr_id
## global variables
aries_metric_delt... |
from typing import List
from topics_and_summary.datasets.twenty_news_groups import TwentyNewsGroupsDataset
from topics_and_summary.models.topics import LdaModelsList, LsaModelsList, LdaMalletModelsList, TopicsModel
from topics_and_summary.preprocessing.dataset.structured import preprocess_dataset
from topics_and_summa... |
"""
Base classes for answer testing
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------... |
"""Utility, helps with gen3."""
import os
import urllib3
import requests
import sys
import json
from gen3.auth import Gen3Auth
from gen3.submission import Gen3Submission
from gen3_etl.utils.collections import grouper
import logging
import hashlib
import multiprocessing as mp
from requests.packages.urllib3.exceptions ... |
import json
from api.request import RequestBase
from api.ipcheck import ServerTest, IPRegion, DnsLookup, is_ip_address
from api.template import Template
class AppCreate(RequestBase):
def __init__(self, data={}, region=None, test_result={}, template=None, handler=None):
# def __init__(self, method='GET',... |
from typing import Union as U, Optional as Opt, Callable, Any, Dict
from collections import defaultdict
from functools import partial
from itertools import chain
from argparse import Namespace
import inspect
import logging
from toposort import toposort
logger = logging.getLogger(__name__)
def generate_type_hints(s... |
from .DataStructures import OptCase
from ...Utils.RouteFunctions import *
##from DataStructures import OptCase
def possible_segments(N):
""" Generate the combination of segments """
segments = ((i, j, k) for i in range(N) for j in range(i + 1, N) for k in range(j + 1, N if N - (j+1) < 3 else j + 4 ))
return... |
# Copyright (c) 2019-present, <NAME>
import torch.nn as nn
from fairseq import utils
from fairseq.models import (
FairseqDecoder,
FairseqEncoderDecoderModel,
register_model,
register_model_architecture,
)
from fairseq.models.lstm import LSTM
from sightseq.models.text_recognition_encoder import TextRe... |
# Copyright 2021 MosaicML. All Rights Reserved.
"""Hyperparameters for callbacks."""
from __future__ import annotations
import abc
import dataclasses
import textwrap
from dataclasses import dataclass
from typing import TYPE_CHECKING, Optional
import yahp as hp
from composer.core.callback import Callback
from compos... |
import numpy as np
import util
def rotation(message, n):
message = list(message)
for i in range(n):
tmp = message.pop(0)
message.append(tmp)
message = "".join(message)
return message
def pc1(key):
new_key = np.zeros(56)
permutation_positions = [57, 49, 41, 33, 25, 17, 9,
... |
# File: poem.py
# Creation: Saturday September 12th 2020
# Author: <NAME>
# Contact: <EMAIL>
# <EMAIL>
# --------
# Copyright (c) 2020 <NAME>
r"""
This module defines the poem datasets used for textual embedding.
It mainly uses Pytorch but tensorFlow was used for padding sequences.
.. code-block:: python
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
import sys
import math
import numpy as np
import OpenGL.GL as gl
import OpenGL.GLUT as glut
import polyhedra
from shader import Shader
from vertex_buffer import VertexBuffer
from transforms imp... |
class HTTPStatus:
def __init__(self, code, description):
self.code = int(code)
self.description = str(description)
def __lt__(self, other):
try:
other_code = other.code
except AttributeError:
other_code = other
return self.code < other_code
... |
# Copyright 2017 Databricks, 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 writin... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
import numpy as np
import torch
import cv2
def project_pose(x, camera=None, **kwargs):
"""
Args
x: 3xN points in world coordinates
R: 3x3 Camera rotation matrix
T: 3x1 Camera trans... |
#!/usr/bin/env python3
# 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... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... |
import logging
from datetime import datetime
from typing import (
Generic,
Optional,
List,
Dict,
Any,
ClassVar,
Type,
TypeVar,
cast,
TYPE_CHECKING,
)
import attr
from marshmallow import fields
from simple_smartsheet import utils
from simple_smartsheet.models import sheet as she... |
import os
import copy
import unittest
import jsonschema
from yggdrasil.tests import assert_equal
from yggdrasil.communication import new_comm
from yggdrasil.communication.tests import test_CommBase as parent
def test_wait_for_creation():
r"""Test FileComm waiting for creation."""
msg_send = b'Test message\n'
... |
import os
import json
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision.transforms import ToTensor, Compose, Normalize
from model_training import ModelTrainer, TrainingTimeEstimation, BatchStatistics
from model_training.training_strategy import RNNCellTrainer, RNNCellCurriculu... |
import enum
import sys
from pathlib import Path
import pyzed.sl as sl
import numpy as np
import cv2
import utilities
class AppType(enum.Enum):
LEFT_AND_RIGHT = 1
LEFT_AND_DEPTH = 2
LEFT_AND_DEPTH_16 = 3
def main():
if not sys.argv or len(sys.argv) != 4:
sys.stdout.write("Usage: \n\n")
sys.stdout.write(" ... |
import math
import pandas as pd
from tools.interactions_helper import _only_uniprots_in_df
from tools.tools_helper import normalize_interactions
def parse_interactions_imex(interactions_base_df, protein_df, gene_df):
"""
Parses interactions list from IMEx data file.
Steps:
1. Get Uniprot values f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# player.py
import time
import logging
import pathlib
from pynput import mouse
from pynput import keyboard
from pynput.mouse import Button
from pynput.keyboard import Key, KeyCode
STOP_LISTEN = False # changed by _stop_player
STOP_KEY = Key.esc
def _stop_player(key: ... |
"""Image Weather Package.""" # coding=utf-8
#
# /************************************************************************************
# ***
# *** Copyright Dell 2021, All Rights Reserved.
# ***
# *** File Author: Dell, 2021年 12月 14日 星期二 00:22:28 CST
# ***
# *******************************************************... |
from django import forms
from django import template
from django.conf import settings
from django.template import Context, Template
from django.template.defaultfilters import stringfilter
from django.core.context_processors import csrf
from biostar.apps.posts.models import Post, Tag
from biostar.apps.usermessages.model... |
#!/usr/bin/env python3
#
# Advent of Code 2019 - Day 16
#
from typing import Sequence, Union
from pathlib import Path
from dataclasses import dataclass
import math
INPUTFILE = "input.txt"
SAMPLE_CASES = [
("8A004A801A8002F478", 16),
("620080001611562C8802118E34", 12),
("C0015000016115A2E0802F182340", 23)... |
#
# Copyright 2017 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... |
#how to run this file:
#first make sure you are pointing to the expected config file in CONFIG_FILE_TO_TEST_WITH
# if from command line, uncomment the line ./run_tests.sh inside mithun_scripts/run_all.sh and
# from command line do ` bash run_all.sh --epochs_to_run 1 --machine_to_run_on laptop `
#if from IDE like pychar... |
import datetime
import decimal
import logging
import six
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm.properties import ColumnProperty, RelationProperty
import sqlalchemy.types
import wsme.types
log = logging.getLogger(__name__)
class SQLAlchemyRegistry(object):
@classmethod
def get(cls, r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''Flask Blueprint for file uploads.'''
import base64
import datetime
imp... |
from netaddr import *
from scapy.all import *
WPS_QUERY = {
b"\x00\x10\x18": "Broadcom", # Broadcom */
b"\x00\x03\x7f": "AtherosC", # Atheros Communications */
b"\x00\x0c\x43": "RalinkTe", # Ralink Technology, Corp. */
b"\x00\x17\xa5": "RalinkTe", # Ralink Technology Corp */
b"\x00\xe0\x4c": "RealtekS", # R... |
import sys, os
sys.path.append(os.pardir)
import numpy as np
import operator
import math
import matplotlib as mpl
import matplotlib.pyplot as plt
from common import *
start, end, step = 100, 1100, 100
dirname = '/lustre/jh180021l/k26002/sph_yamauchi/snap_unbound/snap_unbound_10.0Msun_4.0Rsun_pori1.5_rp1.0R_vinf1.00e+0... |
#!/usr/bin/env python3.7.3
'''
Pihole is great, but the admin interface only displays device details
by IP address which can be confusing. This script changes the display
from IP address to a more recognizable hostname. And as a bonus, attaches
the profile (from fingerbank.org) of the device to the hostname as well -... |
import sys
import pandas as pd
from pubsub import pub
from sklearn.preprocessing import LabelEncoder
import matplotlib
if "linux" not in sys.platform:
matplotlib.use("WXAgg")
try:
import seaborn as sns
sns.set()
except ImportError:
pass
import wx
def prepare_data(df):
"""
A helper function... |
import re
import logging
import datetime
from os import makedirs
from os.path import join, exists, getsize
import requests
from wordpad import pad
from homura import download
from .errors import IncorrectLandsat8SceneId, RemoteFileDoesntExist, IncorrectSentine2SceneId
logger = logging.getLogger('sdownloader')
S3_LAN... |
import uuid
import os
import cloudpickle
import pickle
import base64
import logging
import types
logger = logging.getLogger()
import findspark
findspark.init()
import pyspark
import pyspark.sql.functions
from flask import Flask, request, jsonify
from flask.logging import default_handler
from pyspark_proxy.server.c... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import os
import json
import numpy as np
import torch
from torchvision import datasets, transforms
from torchvision.datasets.folder import ImageFolder, default_loader
from PIL import Image
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGE... |
# import pyedflib
import numpy as np
from scipy import signal as sg
import argparse
import sys
import json
# import matplotlib.pyplotmatplot as plt
from pprint import pprint
import pandas as pd
class Notch():
Q = 0
f0 = 0
def __init__(self,f0=60,Q=50):
self.f0=f0
self.Q=Q
def argp... |
import json
import re
import typing
from typing import Tuple, Union, Dict
from vkwave.bots.core.dispatching.events.base import BaseEvent
from vkwave.bots.core.types.bot_type import BotType
from vkwave.bots.core.types.json_types import JSONDecoder
from vkwave.types.objects import MessagesMessageActionStatus
from .base ... |
from pyrogram import Client, filters
import pyrogram
import re
api_id = 3507193
api_hash = 'f939bf5eedbe7fa3d9b21fce69101848'
app = Client('antispam', api_id, api_hash)
antispam = True
exempt_users = []
@app.on_message((filters.me & filters.text))
def bot_command(client, message):
splited = message.text.split()
i... |
# The MIT License (MIT)
#
# Copyright (c) 2017-2018 <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, modif... |
import os
import subprocess
import shlex
from requests import Session
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from nose_launchable.log import logger
from nose_launchable.version import __version__
class LaunchableClientFactory:
BASE_URL_KEY = "LAUNCHABLE_... |
from __future__ import print_function
from datetime import date
import shutil
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from clockifytool import helpers
def list_entries(args, config, app_data):
today_raw = date.today()
today = today_raw.strft... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from six import PY3
from ..lib.python_utilities import to_unicode
if PY3:
from urllib.parse import ParseResult, SplitResult, urlparse
else:
from urlparse import ParseResult, SplitResult
from urlparse import urlparse
def uc2utf8(input):
# argh! this fee... |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import divis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.