text stringlengths 3.07k 22.1k |
|---|
from typing import ClassVar, List, NamedTuple, Optional, Set, Tuple
import cv2 as _cv
import numpy as _np
from _util import (
Config as _Config,
Rect,
get_frames as _get_frames,
)
class LedDetectionResults(NamedTuple):
rectangles: List[Rect]
contours: List[_np.ndarray]
hulls: List[_np.ndarra... |
# 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... |
"""
Defines parsing of the item API and converting into a local object.
"""
import re
from typing import Any, Callable, Dict, List, Tuple
from consts import COLORS, HEADER_TEMPLATE, SPAN_TEMPLATE
from gamedata import COMBO_ITEMS, FRAGMENTS, RARITIES
from property import Property
from requirement import Requirement
P... |
import folium as folium
from django.shortcuts import render
from django.views.generic import View, TemplateView
from django.db import connection
from django.utils import timezone
from django.contrib.auth.decorators import login_required
from datetime import datetime
from folium import plugins
from .filters import Acc... |
#!/usr/bin/env python3
import datetime as dt
import glob
import os
import pickle
import sys
import traceback
from time import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib import style
# from wordcloud import WordCloud
import matplotlib.lines as mlines
import data_loader
i... |
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
from typing import Union, List, Text
import random
import numpy as np
import albumentations as A
import tensorflow.keras.backend as K
import tensorflow as tf
import tensorflow_transform as tft
import tensorflow_advanced_segmentation_models as tasm
from segmentation_... |
########################### DEFUNCT CODE ##############################
# Was going to use pandas to try to deal with the header issues, but the pandas lib on my AWS instances is broken.
# After I get parquet working, if there's time I'll attempt this again. I'd like to do profiling on both.
# Maybe use conda? Rememb... |
"""
This script is meant to mock an inference request from Arterys to your model.
Before executing this script, you must update mock_server.py#request_handler
or implement your own server to direct the request to your model
function (model_fn) and adjust the request literal below as necessary, then
run the container.
... |
import os
import sys
import asyncio
from time import time
import trimesh
import numpy as np
import pandas as pd
from tkinter import Tk
from tkinter import filedialog as fd
from PySimultan import DataModel
from src.PYSimultanRadiation.client.client import Client
from src.PYSimultanRadiation.radiation.location import... |
from __future__ import unicode_literals
from mopidy.core import PlaybackState
from mopidy.mpd.protocol import handle_request
from mopidy.mpd.exceptions import (
MpdArgError, MpdNoExistError, MpdNotImplemented)
@handle_request(r'consume\ ("?)(?P<state>[01])\1$')
def consume(context, state):
"""
*musicpd.o... |
import os
import tensorflow as tf
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
import glob
def data_heading_check(df): #异常数据处理 数据平滑
length = df.shape[0]
for i in range(1,length-1):
if (abs(df['heading_180'].iloc[i] - df['heading_180'].iloc[i... |
import cv2
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import time
import h5py
import sys
IM_SHAPE = (64, 64, 3)
class TrainingDatasetLoader(object):
def __init__(self, data_path):
print("Opening: ", format(data_path))
sys.stdout.flush()
self.cac... |
######################################################
#
# Author: <NAME>
#
# This script runs a basic GATT server and
# performs BLE advertisements for a
# "smart trash picker service"
#
# Clients that connect to the server will
# be notified when trash is picked up
#
# Important UIUDS:
# Smart Trash Picker S... |
#!/usr/bin/python3
from .rtypes import *
import pypat, relations
from pypat import Or, Guard, As
from adt import ADT
import traceback
class Threesome(pypat.PureMatchable):
def __init__(self, s, m, l, t):
self.src = s
self.mid = m
self.trg = t
self.labels = l
@classmethod
de... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from aiohttp import ClientSession, ClientTimeout, ClientResponse
from botbuilder.schema import Activity
from botbuilder.core import BotTelemetryClient, NullTelemetryClient, TurnContext
from copy import copy
import json, plat... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence as pack
from torch.nn.utils.rnn import pad_packed_sequence as unpack
import dict
import models
import time
import numpy as np
import torch.nn.init as init
import ma... |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... |
#!/usr/bin/env python3
# Author: <NAME>
import os
import sys
import argparse
import math
import re
try:
from babeltrace import CTFWriter, CTFStringEncoding
except ImportError:
# quick fix for debian-based distros
sys.path.append("/usr/local/lib/python%d.%d/site-packages" %
(sys.version_... |
from typing import Dict, Set, Any, Optional, Callable
from functools import partial
from argparse import ArgumentParser, Namespace, Action
from .core import Parameter, DefaultFactory, Runtime
from ._lib import add_parameters as _add_parameters
from ._lib import preprocess_parameter as _preprocess_parameter
from ._lib i... |
import sys
sys.path.append("..")
from common import *
# Very bad awfully redundant ~SLOW~ code!
def parse(data):
lines = data.split("\n")
tiles = {}
tile = None
buff = []
for i in range(len(lines)):
curr = lines[i]
if len(curr) < 1:
tiles[tile] = tuple(buff)
... |
# %%
'''----------------------------------------------------------------
This script takes the cell info identified by fastER and Mask-RCNN
Then identify the difference between two methods in terms of # of objects
We have 7 parameters for now:
circumference | intensity | smooth | volume | centre | contour | instan... |
import os.path
import threading
import sublime
import SublimeHaskell.internals.atomics as Atomics
SETTING_SUBHASK_PROJECT = 'subhask_project_name'
'''View-private setting that identifies the project to which a view belongs. This is the cabal file's name, without the
'.cabal'extension.'''
SETTING_SUBHASK_PROJDIR = ... |
import logging
from abc import ABC, abstractmethod, ABCMeta
import decimal
from typing import List
import math
ctx = decimal.Context()
ctx.prec = 17
logger = logging.getLogger('iir')
def float_to_str(f):
"""
Convert the given float to a string without scientific notation or in the correct hex format.
... |
import signal
import os
import click
import sys
import flutile.functions as fun
INT_SENTINEL = 1e9
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
mafft_exe_opt = click.option(
"--mafft-exe",
default="mafft",
type=str,
help="Path to MAFFT alignment tool executable",
)
ha_subtypes = [
... |
import pytorch_lightning
from pytorch_lightning import Trainer, seed_everything
seed_everything(1234567)
import time
import torch
import numpy as np
import re, os, csv, math, operator
import pandas as pd
from collections import Counter
from torch import nn
from pytorch_lightning.callbacks import EarlyStopping
from tor... |
# The dataset code has been adapted from:
# https://github.com/yaoyao-liu/mini-imagenet-tools
# which has been distributed under the following license:
################################################################################
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# Permission is hereby granted, free of c... |
import numpy as np
import os
import sys
import tensorflow as tf
import gym
from collections import defaultdict
import atari_constants
import box_constants
from cpg import ContextualParameterGenerator
def wrap_env(env_name, context_size=None):
env_data = defaultdict(lambda: None)
env_data['env'] = gym.make(env... |
import astropy.units as u
import astropy.constants as c
import matplotlib.pyplot as plt
import numpy as np
from astropy.cosmology import WMAP9 as cosmo
from . import general
from .data import atnf as atnf
from scipy import signal
import scipy.interpolate as interp
class Source():
"""
The base class for a gravi... |
"""
Utilty code for constructing optimizers and scheduling learning rates.
"""
# System
import math
from functools import partial
# Externals
from tensorflow import keras
#import horovod.tensorflow.keras as hvd
from mlperf_logging import mllog
import tensorflow.compat.v1 as tf
import mesh_tensorflow as mtf
from .mom... |
"""
textgame.parser
=====================
This module's main class is :class:`textgame.parser.Parser`. The parser can take
user input, call a function that's associated to the input and return to the user a
message describing what happened.
Use ``actionmap`` and ``legal_verbs`` to define how verbs should be mapped to... |
import unittest
import sys
from PIL import Image
import log
def get_default(dic, k, fallback, cast=None):
retval = fallback
if (k in dic): retval = dic[k]
#else: log.log.write("Warning: Unspecified setting %s, defaulting to %s\n" % (k, fallback))
if (cast is not None): retval = cast(retval)
return retval
... |
import frappe
import datetime
from frappe.model.base_document import BaseDocument, set_new_name, set_encrypted_password, default_fields
from frappe.utils import cint, cstr, now, flt, compare
from frappe import _
from latte.model.document import core_doctypes_list
from six import string_types
from frappe.utils.file_mana... |
# -*- coding: utf-8 -*-
""" Code for training and evaluating Self-Explaining Neural Networks.
Copyright (C) 2018 <NAME> <<EMAIL>>
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 3 of t... |
"""Get servicenow data via REST."""
# ToDo:
# configure SN api calls to use oauth
# replace sys_id_check function with glom
import ast
import json
import logging
import pathlib
import urllib.parse
import urllib.request
import urllib.response
from glom import glom
FORMAT = ("[%(asctime)s][%(levelname)s]" +
... |
# coding: utf-8
import sqlite3
from html import escape
from os import path
from typing import Callable, List, Dict
from siebenapp.domain import EdgeType, Graph
from siebenapp.goaltree import Goals
from siebenapp.enumeration import Enumeration
from siebenapp.switchable_view import SwitchableView
from siebenapp.open_vie... |
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
def cyclegan_generator_resnet(image, num=9, is_train=True, reuse=False, batch_size=None, name='generator'):
b_init = tf.constant_initializer(value=0.0)
w_init = tf.truncated_normal_initializer(stddev=0.01)
g_init = tf.random... |
# Copyright 2015 Observable Networks
#
# 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 ... |
import csv
import util
from util import csv_head_key
def export_from_spreadsheet(input_fname, input_ext, output_fname="temp/references.bib", exclude_keys=[]):
bibtex = []
reader = util.read_spreadsheet(input_fname, input_ext)
cnt = 0
for row in reader:
if cnt == 0:
cnt... |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
import json
import re
from datetime import datetime
from datetime import timedelta
from urllib.parse import urlparse
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.dash import dashparse
from svtplay_dl.fetcher.h... |
# -*- coding: utf-8 -*-
"""Functionality to check for the availability and version of dependencies."""
from __future__ import print_function
import re
import urllib2
# The dictionary values are:
# module_name: minimum_version
LIBYAL_DEPENDENCIES = {
u'pybde': 20140531,
u'pyewf': 20131210,
u'pyqcow': 2013... |
# 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, software
# dist... |
# Copyright 2020 DataStax, 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,... |
"""OpenNEM WEM Client
Four sources:
* balancing summary live data (from the infographic feeds)
* balancing summary (usually delayed 3-4 days)
* live facility generation data
* nemweb generation data (usually delayed 3-4 days)
See the URL constants for sources and unit tests
"""
import csv
import logging
from da... |
from collections import namedtuple
import numpy.testing as nptest
import pytest
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from matplotlib.offsetbox import (
AnchoredOffsetbox, DrawingArea, _g... |
import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
from adafruit_datetime import datetime, timedelta
import time
import board
import displayio
import terminalio
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font
from adafruit_magtag.magtag import MagTag
... |
import folium
import geopandas
import numpy as np
import pandas as pd
import plotly.express as px
import streamlit as st
from datetime import datetime
from folium.plugins import MarkerCluster
from streamlit_folium import folium_static
# definição de layout para ele ficar um pouco mais comprido/amplo
... |
import sys
sys.path.append("../")
import argparse
from tools.dictionary import Dictionary
from tools.utils import normalize_embeddings
import torch
import os
from tools.lazy_reader import *
import math
import io
def select_subset(word_list, max_vocab, freqs):
"""
Select a subset of words to consider, to deal ... |
# Copyright 2022 DeChainers
#
# 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, so... |
import json
import time
import io
import random
import sys
import os.path
import base64
import datetime
import math
import fileinput
import traceback
from PIL import Image, ImageOps, ImageDraw, ImageChops, ImageFilter
from math import ceil, radians, cos, sin, asin, sqrt
import re
import win32gui
import subprocess
impor... |
from Bot import ChatBot
from discord import Embed, Color
from mtgsdk import Card
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=UserWarning)
from fuzzywuzzy import fuzz
from collections import OrderedDict
class CARDBOT:
def __init__(self, bot):
self.bot... |
"""Different config formats. Currently supported are:
- JSON
- INI
- YAML
- TOML
Round-trip preservation for preserving comments in config files (depending on
third-party libraries). Internally all config formats get mapped on a
:class:`being.utils.NestedDict` data structure which can be accessed throu... |
import threading
import time
import psutil
import rostopic
import rospy
from glog import logging
from node_evaluator.msg import Bandwidth as BandwidthMsg
class EvaluatorFactory:
registry = {}
@classmethod
def register(cls, name):
def inner_wrapper(wrapped_class):
if name in cls.regis... |
import os
from typing import List
import numpy as np
import pandas as pd
import pytest
from pandas import DataFrame
from data_domain import CategoricalDataDomain, RealDataDomain
from privacy_budget import PrivacyBudget
from private_table import PrivateTable
from utils import check_absolute_error
@pytest.fixture
def... |
#!/usr/bin/env python3
# -*- coding: iso-8859-1 -*-
################################################################################
#
# Parameter/return value type checking for Python 3 using function annotations.
#
# (c) 2008-2016, <NAME> <<EMAIL>>
# Distributed under BSD license.
#
# Samples:
#
# from typecheck impo... |
# -*- coding: utf-8 -*-
"""
The :class:`SwaggerClient` provides an interface for making API calls based on
a swagger spec, and returns responses of python objects which build from the
API response.
Structure Diagram::
+---------------------+
| |
| SwaggerClient |
... |
from DataHandler import DataHandler, DataManager
import logging
import json
import requests
import random
from config import config
import time
import threading
from cachetools import cached, TTLCache
logger = logging.getLogger(__name__)
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(seque... |
# Copyright 2021 QHAna plugin runner contributors.
#
# 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 ... |
############################################
# Dataset object, for efficiently streaming the
# SVO triple data into a TensorFlow
# feed
############################################
import os
import itertools
from collections import namedtuple
common_verbs = ['be', 'were', 'been', 'is', "'s", 'have', 'had', 'do', ... |
"""
Harness for conducting black box optimisation experiments.
-- <EMAIL>
"""
# pylint: disable=invalid-name
# pylint: disable=no-member
# pylint: disable=abstract-class-not-used
# pylint: disable=star-args
# pylint: disable=maybe-no-member
from argparse import Namespace
from datetime import datetime
import numpy... |
from PySide.QtGui import QVBoxLayout, QMenu, QApplication
from PySide.QtCore import Qt, QSize
from ...utils import locate_function
from ...data.function_graph import FunctionGraph
from ..widgets import QDisasmGraph, QDisasmStatusBar
from ..dialogs.jumpto import JumpTo
from ..dialogs.rename_label import RenameLabel
fr... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # Logistic Regression with a Neural Netw... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: lintao
# TODO
# This may have some bugs.
# So, I need to develop it.
import MySQLdb
from gensql import gensql
import copy
class LoginInfo(object):
def __init__(self):
self.user = "lint"
self.passwd = "<PASSWORD>"
self.host = "localho... |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 <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 res... |
#!/usr/bin/python3
#
# miniirc_discord: Allows miniirc bots/clients to connect to Discord.
#
# Licensed under the MIT License:
# https://gitlab.com/luk3yx/miniirc_discord/LICENSE.md
#
import asyncio, discord, miniirc, re, threading, time, traceback
ver = (0,5,18)
version = '0.5.18'
__all__ = ['Discord', 'minii... |
#!/usr/bin/python
import os
import sys
import time
import argparse
import math
import numpy as np
import os.path as osp
import torch
from torch.utils.data import DataLoader
# custom functions defined by user
from datasets import EPIDataSetTrain, EPIDataSetTest
from utils import Dict
import torch.nn as nn
import torc... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 14:22:30 2019
@author: yanbo
"""
import pygame
#from pygame.sprite import Sprite
import pygame.font
import game_functions as gf
from random import randint
class TetrisShape():
def __init__(self, game_settings, screen):
self.scre... |
# -*- coding:utf-8 -*-
import argparse
from os.path import join, isdir, basename
from os import listdir
import numpy as np
from .eer_stats import calculate_roc, calculate_roc_hist, calculate_roc_auc,\
get_fmr_op, get_fnmr_op, get_eer_values, Stats, get_decidability_value,\
get_youden_index, get_matthews_cco... |
import datetime
import os
from sqlalchemy import Column, String, DateTime, Integer, ForeignKey, Boolean, Text
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class ServerSettings(Base):
__tablename__ = 'server_settings'
server_id = Colum... |
"""
Copyright (c) 2018 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 law or agreed to in wri... |
from billparser.db.handler import Session
from billparser.translater import translate_paragraph
from billparser.db.models import USCContentDiff, USCSection, USCContent
from billparser.actions import ActionObject
from billparser.actions.strike import strike_text
import re
from billparser.logger import log
... |
import base64
import logging
import os
import time
import uuid
from typing import Any, Callable, Dict, List, Optional, Text, Tuple
import gamla
from kubernetes import client
from kubernetes.client import rest
from cloud_utils.k8s import configure
def _set_dry_run(options: Dict, dry_run: bool):
if dry_run:
... |
# ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain r... |
import xml.dom.minidom as xmldom
import openpyxl
import requests
from bs4 import BeautifulSoup
from fontTools.ttLib import TTFont
import time
# python的字典用于将英文转换为数字
number_dict = {
"period": ".",
"zero": "0",
"one": "1",
"two": "2",
"three": "3",
"four": "4",
"five": "5",
... |
#globalPath에 현제 실행시킬 환경에 데이터가 저장되어 있는 위치를 입력
from PIL import Image
import os
from glob import glob
import numpy as np
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import pickle
from tensorflow.python.keras... |
# -*- coding: utf-8 -*-
"""
Locomotion features
Contains Processing code for:
-----------------------------
locomotion.velocity
locomotion.motion_events
"""
import numpy as np
from .. import utils
from . import events
from . import feature_comparisons as fc
# To avoid conflicting with variables named 'velocity', w... |
from generate_charac import convert_fps
import os
from generate_charac import split_video
from generate_charac import extract_audio
from generate_charac import generate_mfec_features
from speechpy.feature import extract_derivative_feature
import numpy as np
import subprocess
from generate_charac import resize_frames
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Random Graph Generator
Generate various random graphs using networkx and output as edge list
Can be used as input of graph algorithm exercises
Output Format:
5 5 # The first line contains total number of nodes and edges
0 1 # Each of remaining lines con... |
import six
from copy import deepcopy
from .fields import PrimaryKeyField, FieldDescriptor, Field, ForeignRelatedObject
from .query import UpdateQuery, InsertQuery, SelectQuery
from .signals import pre_save, post_save
from .utils import force_text, force_str
from . import get_default_handler
class DoesNotExist(Excep... |
from ..ThreeDinstance import ThreeDinstance
from ..ThreeDcontainerkind import ThreeDcontainerkind
from ..ThreeDitemkind import ThreeDitemkind
from ..ThreeDloadingspace import ThreeDloadingspace
import xml.etree.ElementTree as ET
def attempt(fun, default = None):
return (lambda x: (fun(x) if x is ... |
"""Tests of tasks/github.py:rescan_repository and rescan_organization"""
import json
from datetime import datetime
import pytest
from openedx_webhooks.info import get_bot_username
from openedx_webhooks.lib.github.models import PrId
from openedx_webhooks.tasks.github import (
pull_request_changed,
rescan_orga... |
import pygame
import random
from pygame.locals import * # eg K_UP, K_DOWN,K_LEFT,K_RIGHT,K_ESCAPE,KEYDOWN,QUIT
#from P6_classes import *
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_ESCAPE,
KEYDOWN,
QUIT,
)
# Define constants for the screen width and height
DISPLAY_WID... |
#!/usr/bin/python
# (c) 2020, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
---
module: na_santricity_drive_firmware
short_description: NetApp E-Series ... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
import time
from extra.safe2bin.safe2bin import safecharencode
from lib.core.agent import agent
from lib.core.bigarray import BigArray
from lib.core.common import a... |
from utils.validation import is_money
from models.DAO import DAO
from utils.exception import ValidationError
from models.shared import (
user_pay,
find_user,
find_coupon_and_check_validity,
create_purchased_item,
get_cart_items_by_user_id,
delete_cart_item
)
def place_order(user_id, payment,... |
#!/usr/bin/env python3
import sys
import os
import warnings
import argparse
import configparser
import shutil
import pandas as pd
import subprocess as sp
import yaml
import glob
from threading import Event
import signal
import requests
gotHUP = Event()
def breakSleep(signo, _frame):
gotHUP.set()
def sleep(conf... |
import copy
from typing import Dict, Any, List, Optional, Type, Union
from collections import namedtuple
from dataclasses import dataclass, field
from ml_gym.error_handling.exception import ComponentConstructionError, InjectMappingNotFoundError, DependentComponentNotFoundError
from ml_gym.blueprints.constructables impo... |
from collections import defaultdict, deque
from typing import List
class Vertex:
def __init__(self, identifier):
self.id = identifier
self.neighbors = dict() # id --> Vertex
def neighbor_ids(self):
return list(self.neighbors.keys())
class GraphList:
def __init__(self, graph):
... |
from collections import OrderedDict
import logging
import scipy
import numpy as np
from theano import tensor
from theano.tensor.signal.pool import pool_2d, Pool
from blocks.extensions import SimpleExtension
from blocks.extensions.monitoring import (DataStreamMonitoring,
Monit... |
# coding=utf-8
"""Objects related to cooking"""
from typing import List, Optional, Dict, Any
import logging
from psycopg2 import sql
import rses_errors
from rses_connections import db
from objects.stock import Ingredient
log = logging.getLogger(__name__)
class RecipeCategory:
"""
For recipe categorization
... |
from __future__ import print_function, unicode_literals
import os
import sys
import six
import urlparse
import traceback
from sqlalchemy.orm import scoped_session, sessionmaker
import flask
from flask import Flask, request, redirect, escape, url_for
from flask_admin import Admin
from flask_admin.menu import MenuLink
... |
import math
from forEgitim import *
import numpy as np
def sigmoid(x):
ans = 1 / (1 + math.exp(-x))
# print(ans)
return ans
def hiperbol(x):
ans = (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
return ans
def araKatmaniGuncelle(hata,w,op,iterasyonBilgisi,guncellemeBilgisi):
hata... |
import numpy as np
import cv2 as cv
import sys
from imutils.video import VideoStream
import time
import picamera
import imutils
import argparse
'''
THIS is v0 (scroll down for others, along with current)
class CHclass:
def __init__(self, img):
self.img = img
self.height = len(self.img[0])
... |
# Original coco annotations. COCO category IDs to COCO category names
COCO_CATS_ID_TO_NAME = {
1: 'person',
2: 'bicycle',
3: 'car',
4: 'motorcycle',
5: 'airplane',
6: 'bus',
7: 'train',
8: 'truck',
9: 'boat',
10: 'traffic light',
11: 'fire hydrant',
13: 'stop sign',
1... |
# -*- coding: utf-8 -*-
# @Time : 2022/2/18 18:21
# @Author : u4f55u6770
# @contact: <EMAIL>
import xlrd
import requests
import xlsxwriter
import json
from bs4 import BeautifulSoup
from exports import merge_and_writer_stream, export_excel
import datetime
import re
import os
base_dir = os.path.dirname(os... |
import sys
import argparse
import torch
import torch.nn.init
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import time
import os
import sys
sys.path.insert(0, '/home/ubuntu/dev/opencv-3.1/build/lib')
import cv2
import math
import numpy as ... |
import abc
import collections
import functools
import itertools
import types
from .error import *
from .operation import (
as_basic_type,
ContractInfo,
convert,
default_conversion,
get_contract_info,
Operation,
SimpleConversion,
)
from .hook import (
HooksFactory,
Target,
)
def _s... |
import torch
from torch.nn import Module
import numpy as np
global num
def rvs(dim=3):
random_state = np.random
H = np.eye(dim)
D = np.ones((dim,))
for n in range(1, dim):
x = random_state.normal(size=(dim - n + 1,))
D[n - 1] = np.sign(x[0])
x[0] -= D[n - 1] * np.sqrt((x * x).... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# -*- coding: utf-8 -*-
__title__ = 'fews_adapter'
__description__ = 'fews adapter for Respighi downscaling module'
__version__ = '0.9.0'
__author__ = '<NAME>'
__author_email__ = '<EMAIL>'
__license__ = 'MIT License'
# import os-modules
import os
from pathlib import Path
import sys
# set python environment (similar... |
"""Module that contains the Image abstract class and implementations.
This module contains the Image abstract class, which is a class created
to better aid OpenCV image object managements, speficially tailored for
the scrambling and unscrambling of its concrete classes' instances. It
also contains its implementations.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.