text
stringlengths
6.04k
39.5k
import logging import operator from collections import defaultdict import torch as th import torch.nn as nn from torch.distributions import Categorical class DecayThenFlatSchedule: def __init__(self, start, finish, time_length, decay="exp"): self.start = start self.finish = finish self.t...
import re import os import sublime import sublime_plugin DEBUG = False def debug_message(message): if not DEBUG: pass print('DEBUG phpunitkit: %s' % str(message)) class PluginSettings(): def __init__(self, name): self.name = name self.loaded = False self.transient_data =...
"""Support for RFXtrx devices.""" import asyncio import binascii from collections import OrderedDict import copy import logging import RFXtrx as rfxtrxmod import async_timeout import voluptuous as vol from homeassistant import config_entries from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA fro...
""" GBDX Vector Services Interface. Contact: <EMAIL> """ #from __future__ import absolute_import from string import Template from builtins import object import six import requests from shapely.wkt import loads as load_wkt from collections import OrderedDict import json, time, os from shapely.ops import cascaded_unio...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2021, <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
#!/usr/bin/env python # coding: utf-8 __author__ = 'saqibmobin' __version__ = '1.0' import os import sys import json import random import math import re import time import numpy as np import cv2 import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from importlib import import_module ...
""" Markov chains for the striplog package. """ from collections import namedtuple import numpy as np import scipy.stats import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.colors as cols from .utils import hollow_matrix from .utils import observations from .utils import rgb_is_dark class ...
#!/usr/bin/env python3 """ Clearine Yet Another GTK3-based logout-window overlay for independent windowmanager usage: -h --help show help docs configuration file location: Clearine reads its configuration from "~/.config/clearine.conf" . if that file is unavailable, It will read from "/etc/clearine.c...
# Author: <NAME> <<EMAIL>> # # This module was developed with funding provided by # the Google Summer of Code (2013). from __future__ import absolute_import from time import strptime, mktime from datetime import datetime import fnmatch import os from astropy.units import Unit, nm, equivalencies from sqlalchemy impor...
# coding: utf-8 #this script is about the latest news of MENA region #we scrape different influential media websites, or so-called fake news, lol #and send only updates to the mailbox for daily newsletter #in order to do that, we need a db to store all the historical content of websites #and all the scraping tec...
import base64 import re from collections import Counter from functools import reduce import pandas as pd from neanno.utils.dict import merge_dict_sum_numbers from neanno.utils.list import ensure_items_within_set, get_set_of_list_and_keep_sequence ANNOTATION_TYPES = [ "standalone_key_term", "parented_key_term...
# Copyright 2015 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 by applicable law or ag...
""" tl;dr: all code code is licensed under simplified BSD, unless stated otherwise. Unless stated otherwise in the source files, all code is copyright 2010 <NAME> <<EMAIL>>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import csv import io import logging import re from collections import defaultdict from pathlib import Path from typing import Dict, List, Opti...
#!/usr/bin/env python from __future__ import print_function import sys import os from xml.etree import ElementTree from glob import glob from collections import OrderedDict import re import argparse validName = re.compile('^[a-zA-Z0-9_]+$') class Device: # dummy pass def getText(element): if element i...
import datetime import pickle import time import numpy as np import tensorflow as tf def stack_data(data, num_shifts, len_time): """Stack data from a 2D array into a 3D array. Arguments: data -- 2D data array to be reshaped num_shifts -- number of shifts (time steps) that losses...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 <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 limitati...
""" Class To Create Dataset Inventory """ import random import json import logging import copy from camera_trap_classifier.data.utils import ( randomly_split_dataset, map_label_list_to_numeric_dict, export_dict_to_json, _balanced_sampling) from camera_trap_classifier.data.importer import DatasetImporter log...
import os import re import time import threading import thread_stop from gobang import Chess from gobang import aiChess from gobang import dicttoChees import tkinter as tk import tkinter.messagebox import tkinter.filedialog from PIL import ImageTk, Image times = int(time.time()) # 加载资源文件夹 base_f...
"""Components for use in `CycleGroup`. For details, see `CycleGroup`.""" from __future__ import division, print_function from six.moves import range import numpy as np import scipy.sparse as sparse import unittest from openmdao.core.explicitcomponent import ExplicitComponent PSI = 1. _vec_terms = {} def _compu...
from enum import IntFlag from typing import cast, List, Tuple, Iterable, TextIO from itertools import takewhile from qcodes import VisaInstrument, InstrumentChannel, ChannelList from qcodes.utils.validators import Enum, Numbers from qcodes.instrument.group_parameter import GroupParameter, Group def read_curve_file(c...
import cv2 import sys import pickle from collections import deque import numpy as np import matplotlib.pyplot as plt from moviepy.editor import VideoFileClip # Define a class to receive the characteristics of each line detection class Line(): def __init__(self): #queue size self.iterations = 5 ...
# # FAPS PLMAgents import logging import os import random from collections import deque import keras.backend as k import numpy as np from keras import Input from keras.initializers import RandomUniform from keras.layers import Dense, add from keras.models import Sequential, Model from keras.optimizers import Adam, Op...
from flask import ( Blueprint, abort, current_app, jsonify, redirect, render_template, request, session, url_for, ) from flask_user import roles_required from ..database import db from ..date_tools import localize_datetime from ..extensions import oauth, recaptcha from ..models.app_...
from collections import OrderedDict from collections import defaultdict from collections.abc import Collection from copy import deepcopy from typing import Iterator, Type, Callable, Sequence, Tuple, Union, TypeVar, Set, Dict, List import kge from kge.core import events from kge.core.camera import Camera from ...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
"""Run DAWG tests against alternate SPARQL implementation.""" import rdflib from rdflib import plugin, URIRef from rdflib import Namespace from rdflib.graph import ConjunctiveGraph from rdflib.graph import Graph from rdflib.store import Store from rdflib.store import NO_STORE from rdfextras.sparql.parser import parse ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import functools import torch def implements(torch_function): """Register a torch function override for CUDALon...
""" Logging module for printing status during an exploit, and internally within ``pwntools``. Exploit Developers ------------------ By using the standard ``from pwn import *``, an object named ``log`` will be inserted into the global namespace. You can use this to print out status messages during exploitation. For e...
import os import logging import json from collections import defaultdict import hmac from flask import (abort, Flask, session, render_template, session, redirect, url_for, request, flash, jsonify) from flask_session import Session from sqlalchemy import desc from mlapp import GitHu...
from .base import Folder from .collections import FolderCollection from ..items import CalendarItem, Contact, Message, Task, DistributionList, MeetingRequest, MeetingResponse, \ MeetingCancellation, ITEM_CLASSES, ASSOCIATED from ..version import EXCHANGE_2010_SP1, EXCHANGE_2013, EXCHANGE_2013_SP1 class Calendar(F...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import nu...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME>, <NAME>, and <NAME> # @Date: 2017-03-20 # @Filename: conftest.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: <NAME> # @Last modified time: 2018-07-21 21:51:06 import copy import itertools import os...
# Copyright (c) 2019 PaddlePaddle Authors. 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 by app...
# -*- coding: utf-8 -*- # Copyright 2018, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=missing-docstring,broad-except # pylint: disable=redefined-builtin """IBMQJob Test.""" import os import ...
import taichi as ti from mpl_toolkits.mplot3d import Axes3D import os import math import numpy as np import random import matplotlib.pyplot as plt import time import taichi as tc real = ti.f32 ti.set_default_fp(real) dim = 3 # this will be overwritten n_particles = 0 n_solid_particles = 0 n_actuators = 0 n_grid = 64 ...
# -*- coding: utf-8 -*- import ast import builtins import re import token import tokenize import os.path from thonny.assistance import ErrorHelper, Suggestion, name_similarity, add_error_helper from thonny import assistance from thonny.misc_utils import running_on_linux, running_on_windows class SyntaxErrorHelper(Er...
import logging from functools import wraps from inspect import getfullargspec from json import loads from traceback import format_exc import paste.httpexceptions from pydantic import BaseModel from pydantic.error_wrappers import ValidationError from galaxy.exceptions import ( error_codes, MessageException, ...
from flatland.core.grid.grid4_utils import get_new_position from flatland.envs.rail_env import RailEnv from flatland.envs.rail_generators import sparse_rail_generator from flatland.envs.line_generators import sparse_line_generator from flatland.utils.rendertools import RenderTool from collections import defaultdict im...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2021 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ This file is to classify the samples from 66 classes where the number of samples is larger than 2000. There are 77 classes in total. Input: ...
import numpy as np import math from collections import defaultdict import numba from numba import typeinfer, ir, ir_utils, config, types from numba.ir_utils import (visit_vars_inner, replace_vars_inner, compile_to_numba_ir, replace_arg_nodes, mk_unique_var) from n...
from __future__ import annotations from typing import Union, Optional import importlib import os import pathlib from enum import Enum from route import quick_invalid, write, Cause from route import error as e class Method(Enum): GET = "GET" HEAD = "HEAD" TRACE = "TRACE" OPTIONS = "OPTIONS" CONNEC...
# 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 # distributed under the...
import re from datetime import timedelta from enum import Enum from typing import Union, Tuple, List from django.apps import apps from django.core import exceptions from django.conf import settings from django.db.models import F, Count, Min, Max, Sum, Value, Avg, ExpressionWrapper, DurationField, FloatField, Model, JS...
from decimal import Decimal import logging from urllib.parse import urljoin from django.core import checks from django.core.exceptions import ImproperlyConfigured from django.db import models, transaction from django.db.models.aggregates import Sum # from django.urls import NoReverseMatch, reverse from django.utils.fu...
# -*- coding: utf-8 -*- from enum import Enum from typing import List, Tuple, Union from numpy import * import numpy as np import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' os.environ["CUDA_VISIBLE_DEVICES"] = "-1" from k_means import k_means, get_group_center from ransac import * from blend import * from L2_Net impor...
# -*- coding: UTF-8 -*- # !/usr/bin/python # @time :2019/5/18 23:51 # @author :Mo # @function :classify text of bert and (text-cnn、r-cnn or avt-cnn) from __future__ import division, absolute_import from keras.objectives import sparse_categorical_crossentropy, categorical_crossentropy from conf.path_con...
# Code Taken from https://github.com/LYH-YF/MWPToolkit # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/29 11:10:20 # @File: multi_head_attention.py import numpy as np import torch from torch import nn from torch.nn import functional as F from utils.enum_type import EPT class MultiHeadAttention(nn.Module)...
# -*- coding: utf-8 -*- import numpy as np import random import time import cv2 import os import lzma from collections import deque from sortedcontainers import SortedList from accum_trainer import AccumTrainer from game_state import GameState from game_ac_network import GameACFFNetwork, GameACLSTMNetwork import opti...
r"""Order utilities for 0x applications. Setup ----- Install the package with pip:: pip install 0x-order-utils Some methods require the caller to pass in a `Web3.BaseProvider`:code: object. For local testing one may construct such a provider pointing at an instance of `ganache-cli <https://www.npmjs.com/package...
#張哲銘 60947061s import tkinter as tk from tkinter import filedialog from tkinter.simpledialog import askinteger from PIL import Image, ImageTk import numpy as np import matplotlib.pyplot as plt import random import math from scipy import misc import os root = tk.Tk() root.title('AIP 60947061s') screen_width = root.winf...
# 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 # distributed under the...
from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from __future__ import division import math import torch import torch.nn as nn class _DynamicInputDenseBlock(nn.Module): def __init__(self, conv_modules, debug): super(_DynamicInputDenseB...
#!/usr/bin/env python3 import os import argparse import shelve import datetime import shutil import numpy as np import isce import isceobj from isceobj.Constants import SPEED_OF_LIGHT from isceobj.Util.Poly2D import Poly2D from mroipac.looks.Looks import Looks def createParser(): ''' Command line parser. ...
from typing import Optional import sortedcontainers import logging import asyncio import random import collections from gear import Database from hailtop import aiotools from hailtop.utils import ( secret_alnum_string, retry_long_running, run_if_changed, time_msecs, WaitableSharedPool, AsyncWor...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/8/20 0020 16:50 # @Author : Hadrianl # @File : widget from vnpy.chart import ChartWidget, CandleItem, VolumeItem from vnpy.trader.constant import Direction from tzlocal import get_localzone from vnpy.trader.ui import QtCore, QtWidgets, QtGui from vn...
# 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...
#!/usr/bin/env python3 # # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Create an Android application bundle from one or more bundle modules.""" import argparse import json import os import shutil imp...
# Dedicated to the public domain under CC0: https://creativecommons.org/publicdomain/zero/1.0/. import re from argparse import ArgumentParser from itertools import groupby from os import environ from sys import stderr, stdout from typing import Any, Dict, List, Match, Optional, Set, Tuple from pithy.ansi import BG, B...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD 3 clause from __future__ import division import numpy as np import scipy as sp from scipy import ndimage from scipy.sparse.csgraph import connected_components from sklearn.feature_extraction.image import ( img_to_graph, grid_to_graph, extract_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ PyInvoke tasks examples for usage of workflows from neuro_pypes. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os import os import logging impor...
#!/usr/bin/env python3 # Copyright 2018 Johns Hopkins University (author: <NAME>) # Apache 2.0. # see get_args() below for usage message. import argparse import os import sys import math import re # The use of latin-1 encoding does not preclude reading utf-8. latin-1 # encoding means "treat words as sequences of...
""" pygments.lexers.mys ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Mys and related languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments import unistring as uni from pygments.lexer import Lexer from pygments.lexer...
import math import random import string import time from itertools import chain from art import * from huepy import * import numpy # This creates a dictionary of letters mapped to their corresponding # number in the alphabet LETTERS = { letter: index for index, letter in enumerate( string.ascii_uppercase, ...
import sys, os root_dir = os.path.join(os.path.dirname(__file__),'..') if root_dir not in sys.path: sys.path.insert(0, root_dir) from dataset.image_base import * from config import args set_names = {'all':['train','val','test'],'test':['test'],'val':['train','val','test']} class PW3D(Image_base): def __init__...
#!/usr/bin/env python # coding=utf-8 import os import tqdm import numpy as np import tensorflow as tf gpu_id='2' class Config: train_path='/data/dataset/pinyin2hanzi/py2hz_train.tsv' hz2id_dict='/data/dataset/dict/hz2id_dict.txt' test_path='/data/dataset/pinyin2hanzi/py2hz_test.tsv' dev_path='/data/data...
import sys import os import numpy as np import pickle import h5py if __name__ == "__main__": __package__ = "modules.alt_splice" ### local imports from .verify import * from .write import * from ..rproc import rproc, rproc_wait from ..helpers import compute_psi, codeUTF8 def _prepare_count_hdf5(options, OUT, even...
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli...
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) <NAME> <<EMAIL>> # Copyright (C) <NAME> <<EMAIL>> # This program is published under a GPLv2 license # flake8: noqa E266 # (We keep comment boxes, it's then one-line comments) """ C API calls to Windows DLLs ""...
# -*- coding: utf-8 -*- """ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Classes for building models of 3D/4D polytopes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See the doc: "https://neozhaoliang.github.io/polytopes/" """ from itertools import combinations import numpy as np import helpers from todd_coxeter i...
"""Test script for ftplib module.""" # Modified by <NAME>' to test FTP class and IPv6 environment import ftplib import threading import asyncore import asynchat import socket import StringIO from unittest import TestCase from test import test_support from test.test_support import HOST # the dummy data returned by ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 16 17:34:28 2020 @author: pmbpanther """ import numpy as np import matplotlib.pyplot as plt from scipy.integrate import quad, nquad from numpy.testing import assert_almost_equal from inspect import signature π = np.pi oo = np.inf class Wavefunctio...
import copy import csv import os import json from functools import reduce import collections from lxml import etree import nltk import numpy import networkx nltk.download('punkt') """ ## examples # parse OAB exam, return generator of OABQuestion instances oab = parse_xml('/home/bruno/git/oab-exams/OAB/raw/2010-01.xm...
""" Module for setting up a :obj:`schnetpack.md.simulator.Simulator` from a config dictionary, which can then be used for simulation. """ import logging import os import torch from shutil import rmtree from ase import io try: import oyaml as yaml except ImportError: import yaml from schnetpack.md import Simul...
# -*- coding: utf-8 -*- # The dos-azul-lambda request handling stack is generally structured like so: # # /\ * Endpoint handlers, named for the DOS operation converted to # /__\ snake case (e.g. list_data_bundles). # / \ * ElasticSearch helper functions that implement common query types # /______\ ...
import fme import fmeobjects import json, collections, itertools # -------------------------------------------------------------------------- def lerp(vec1, vec2, fraction): ''' Returns a point between vec1 and vec2 based on a weighted average given as a decimal fraction between 0 and 1 ''' clamped = max(min(...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from pandas import read_csv import os, os.path import csv import matplotlib.pyplot as plt import re import dateutil.parser os.chdir('/home/will/HIVReportGen/') # <codecell> def extract_YOB(inp): try: return float(inp.split('-')[0]) exc...
# -*- coding: utf-8 -*- """ Created on Thu May 23 13:51:15 2019 @author: Lieke """ import os import numpy as np import pandas as pd import time as tm import rpy2.robjects as robjects import tensorflow as tf import math import scipy.io as sio import optunity as opt from tensorflow.contrib.tensor_forest.python import ...
#!/usr/bin/env python3 # # Copyright 2016 Canonical Ltd # # 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 asyncio import logging import time import typing import ydb from ydb import issues, settings, table from ydb.table import ( BaseSession, BaseTableClient, _scan_query_request_factory, _wrap_scan_query_response, BaseTxContext, ) from . import _utilities from ydb import _apis, _session_impl ...
"""People Counter.""" """ Copyright (c) 2018 Intel Corporation. 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...
# ElectrumSV - lightweight Bitcoin client # Copyright (C) 2019-2020 The ElectrumSV Developers # # 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 limita...
from __future__ import annotations import logging from datetime import datetime, timedelta from time import gmtime, strftime from typing import Any, Dict, Optional, Sequence, Tuple, Union from wyze_sdk.errors import WyzeRequestError from wyze_sdk.models import datetime_to_epoch from wyze_sdk.models.devices import Dev...
import collections.abc from contextlib import suppress from datetime import timedelta from typing import ( TYPE_CHECKING, Any, Dict, Hashable, Iterable, Mapping, Optional, Sequence, Tuple, Union, ) import numpy as np import pandas as pd from . import formatting, utils from .ind...
# # # 0=================================0 # | Kernel Point Convolutions | # 0=================================0 # # # ---------------------------------------------------------------------------------------------------------------------- # # Callable script to start a training on Myhal...
# Copyright WillianFuks # # 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, softw...
import numpy as np def make_cell_division_times(n_divisions, n_replicates=8, std=.1, seed=None, drop_p=.05, maxtime=10): """ Simulate Cell division times for n_divisions. The division times are drawn between 0 and maxtime. Dropout events are simulated for cells to be dropped due to technical variance. ...
#!/usr/bin/env python __author__ = "<NAME>" __copyright__ = "Copyright (C) 2021 by <NAME>" __license__ = "Apache License Version 2.0" __version__ = "1.1.4" __date__ = "11/06/2021" """Configurable python service to run on Raspberry Pi and evaluate one GPIO-in to control one GPIO-out as light switch. """ # Copyr...
#!/usr/env/bin python3.9 import io import re import pickle import random from pathlib import Path from itertools import repeat from operator import itemgetter, mul from functools import partial, reduce from multiprocessing import cpu_count from typing import Callable, BinaryIO, Match, Pattern, Tuple, Union, Optional ...
import psutil import torch import os import argparse import numpy as np import itertools from tqdm import tqdm from problems import load_problem from utils.data_utils import save_dataset, load_heatmaps from utils.functions import move_to, get_durations, compute_batch_costs, accurate_cdist from torch.utils.data import D...
# Copyright (c) 2020, NVIDIA CORPORATION. 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 by appli...
# coding:UTF-8 # Copyright 2017 The <NAME>. 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 by appl...
import itertools import math import datetime import collections from django.conf import settings from django.utils.datastructures import SortedDict from django.utils.timezone import now from ..conference import models as conference_models from . import models from django.core.cache import cache def proposal_is_sch...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Public utilities for testing code that uses the REST API. """ __all__ = ["buildIntegrationTests", "dumps", "loads", "dummyRequest", "CloseEnoughJSONResponse", "CloseEnoughResponse", "extractSuccessfulJSONResult", "render...
import os.path as osp import os, sys from shutil import copy, rmtree import pdb import argparse import random import numpy as np from tqdm import tqdm import torch import torch.nn.functional as F import torch_geometric.transforms as T from qm9 import QM9 from dataloader import DataLoader # use a custom dataloader to ...
def ignoreAllFiltersOnPath(path): """Given a 'Path', find all EDFilters and wrap them in 'cms.ignore' """ import FWCore.ParameterSet.Config as cms from FWCore.ParameterSet.SequenceTypes import _MutatingSequenceVisitor, _UnarySequenceOperator class IgnoreFilters(object): def __init__(self): self.__...
"""Do I need a docstring here ?""" from .bruteforce_lib import * from .invert import * from dolo.numeric.decision_rule import DecisionRule from dolo.misc.itprinter import IterationsPrinter from numba import jit import numpy import time import scipy.sparse.linalg from operator import mul from functools import reduce...
#!/usr/bin/python # flake8: noqa # tmp_divergence_test.py import geonomics as gnx import os import numpy as np import shutil import matplotlib.pyplot as plt from matplotlib.lines import Line2D import statsmodels.api as sm # set some plotting params #img_dir = ('/home/drew/Desktop/stuff/berk/research/projects/sim/m...
from PIL import Image, ImageTk from tkinter import messagebox import tkinter as tk import numpy as np import matplotlib.pyplot as plt import cv2 as cv #from tkinter import ttk window = tk.Tk() # create window window.title( 'B063040061 hw2' ) # name title flagOpen = False # file open flag flagOB = False #...
#!/usr/bin/python3 import sys, os import simpy import csv import random import requests import json import subprocess import signal import socketio PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(PPRZ_HOME + "/var/lib/python") sys.path.append(PPRZ...