text
stringlengths
3.07k
22.1k
import asyncio import inspect import time from datetime import datetime from time import sleep from typing import Union, Coroutine, Type, Callable from privex import helpers from privex.helpers import r_cache_async, get_async_type from privex.helpers.exceptions import PrivexException from tests import PrivexBaseCase i...
#!/usr/bin/env python3 # clang-tidy review # Copyright (c) 2020 <NAME> # SPDX-License-Identifier: MIT # See LICENSE for more information import argparse import itertools import fnmatch import json import os from operator import itemgetter import pprint import re import requests import subprocess import textwrap impor...
from enum import Enum from django.conf import settings from django.utils.translation import npgettext_lazy, pgettext_lazy from django_prices.templatetags import prices_i18n from prices import Money class OrderStatus: DRAFT = 'draft' UNFULFILLED = 'unfulfilled' PARTIALLY_FULFILLED = 'partially fulfilled' ...
""" Extracted from sphinx.writers.text """ import math import re import textwrap from itertools import chain, groupby from typing import cast from docutils import writers from docutils.utils import column_width from rst2text import MAXWIDTH class Cell: """Represents a cell in a table. It can span on multipl...
import scipy.io import scipy.optimize import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np from matplotlib import colors from .familiarisation import load_mat_img from .familiarisation import prep_cmap_array_plt from .familiarisation import plot_image from .encoder import Encoder def ...
import emoji_data_python import imaplib import json import logging import smtplib import time import urllib.parse from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from slack import WebClient from slack.errors import SlackApiError from twilio.rest import Client from twilio.twiml.messag...
import ixcom import time import sys import struct import argparse import socket class TextFileParser(ixcom.parser.MessageParser): def __init__(self, outputfile, skip_parameter=None, print_request = True): super().__init__() self.outputfile = outputfile self.print_request = print_request ...
# Copyright (C) 2021 Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # import mmap import logging from math import floor, ceil from .exception import * class Object: def get(self): raise NotImplementedError(self.__class__.__name__) def set(self, obj): raise ...
#!/usr/bin/python -u # -*- coding: latin-1 -*- # # Nonogram (Painting by numbers) in Z3 # # http://en.wikipedia.org/wiki/Nonogram # ''' # Nonograms or Paint by Numbers are picture logic puzzles in which cells in a # grid have to be colored or left blank according to numbers given at the # side of the grid to reveal a...
import collections from pbge.plots import PlotError import pbge import gears from .. import exploration from . import ghterrain from . import ghwaypoints from . import ghcutscene import uuid from . import backstory from . import ghrooms # The list of plots will be stored as a dictionary based on label. PLOT_LIST =...
""" Silicone's custom statistical operations. """ import os import numpy as np import pandas as pd import scipy.interpolate def rolling_window_find_quantiles( xs, ys, quantiles, nwindows=11, decay_length_factor=1 ): """ Perform quantile analysis in the y-direction for x-weighted data. Divides the x-...
import copy import math import os from faiss import knn from parso import parse from pytorch_metric_learning.utils import accuracy_calculator import torch from torch import optim from torch.utils.data import DataLoader, dataloader import numpy as np import matplotlib.pyplot as plt import librosa import librosa.displ...
""" Codes for gas, oil, and water PVT correlations @author: <NAME> @email: <EMAIL> """ """ GAS """ def gas_pseudoprops(temp, pressure, sg, x_h2s, x_co2): """ Temperature in Fahrenheit """ import numpy as np temp = temp + 459.67 # convert to Rankine # calculate pseudocritical properties (Sutton, valid for...
import math import torch import matplotlib.pyplot as plt import numpy as np import torch.utils.data from torch import optim from torch import nn from torch import distributions as dist from enum import Enum # boolean variable that indicates whether or not we have gpu... use_cuda = torch.cuda.is_available() print("Use ...
#global: dictionary, docs #type of model: z, nd, nw #pull: subset of z, nd, nw #push: diff of subset of z, nd, nw import numpy as np import random import time from joblib import Parallel, delayed """ Configuration """ K = 10 class LDADictionary: def __init__(self): self.word2id = dict() self.id...
""" Try to run a tf kernel Check does/doesnt work """ import os from os.path import join import numpy as np import pyopencl as cl import subprocess from test import test_common from test.test_common import offset_type import pytest # CLANG_HOME = os.environ['CLANG_HOME'] def myrun(cmd_list): print('running [%s]...
# MIT License # # Copyright (c) 2021 <NAME> for Amano Team # # 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...
# # Authors: <NAME> # Licensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/) """ MTI-Net implementation based on HRNet backbone https://arxiv.org/pdf/2001.06902.pdf """ import torch import torch.nn as nn import torch.nn.functional as F from models.resnet import BasicBlock f...
from fontbakery.callable import check, condition from fontbakery.status import FAIL, PASS, WARN from fontbakery.message import Message # used to inform get_module_profile whether and how to create a profile from fontbakery.fonts_profile import profile_factory # NOQA pylint: disable=unused-import profile_imports = [ ...
import json import re from django.apps import apps from django.core.exceptions import ObjectDoesNotExist from .serializers import * import googlemaps from django.contrib.gis.geos import GEOSGeometry, MultiPolygon ENUM_FIELDS = { 'BuildingCode', 'ElectricCode', 'FireCode', 'ResidentialCode', 'Win...
import argparse import sys import pickle import matplotlib.pyplot as plt import numpy as np from schrodinger.application.desmond.packages import analysis, topo, traj, traj_util from schrodinger.application.desmond.packages.energygroup import ( EnergyGroupBase, # EnergyFacade, # SliceParams analyze, ) #...
from termcolor import colored import collections import datetime import dateutil.tz import json import logging import os import os.path as osp import sys import tempfile import subprocess import shutil from tensorboardX import SummaryWriter __all__ = ['setup', 'scoped_setup'] class KVWriter(object): def writekv...
#!python3.6 # pylint: disable=line-too-long from __future__ import generator_stop # just to be safe with python 3.7 import os import argparse import random import sys import spot from deepltl.data import aalta_wrapper from deepltl.data import ltl_parser from deepltl.utils import utils def spot_get_trace(formula_s...
#!/usr/bin/env python2 # # Copyright 2010 Google Inc. All Rights Reserved. """Module for transferring files between various types of repositories.""" from __future__ import print_function __author__ = '<EMAIL> (<NAME>)' import argparse import datetime import json import os import re import socket import sys import t...
import rospy import message_filters import cv2 import numpy as np from fcn.config import cfg from fcn.test import vis_segmentations_vertmaps_detection, _extract_vertmap from utils.blob import im_list_to_blob, pad_im, unpad_im, add_noise from normals import gpu_normals from std_msgs.msg import String from sensor_msgs.ms...
import logging from pathlib import Path from typing import Dict, List, Tuple, Union import numpy as np import pandas as pd import torch from scipy.sparse import coo_matrix from torch_geometric.data import Data from torch_geometric.utils import from_scipy_sparse_matrix from transformers.tokenization_utils_base import P...
import itertools import math import os import loompy import h5py import copy import umap import numpy as np import pandas as pd from collections import Counter import seaborn as sns; sns.set(style="white", color_codes=True) import matplotlib import matplotlib.colors as mcol from scipy.stats import spearmanr from scip...
# -*- coding: utf-8 -*- """ configs.py =========== This module defines classes and functions to correctly process persistent configurations. Please see the :doc:`guide to miscellaneous operations <misc>` for a complete description of working with configs. """ from __future__ import print_function from collections impo...
# -*- coding: utf-8 -*- import locale import time import urllib import json import urlparse import bleach import jinja2 from django.utils.text import Truncator from django.db.utils import IntegrityError from django.contrib.sites.requests import RequestSite from django.utils.safestring import mark_safe from django.ut...
"""Xbox Media Source Implementation.""" from dataclasses import dataclass from typing import List, Tuple from pydantic.error_wrappers import ValidationError # pylint: disable=no-name-in-module from xbox.webapi.api.client import XboxLiveClient from xbox.webapi.api.provider.catalog.models import FieldsTemplate, Image f...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2019 NOKIA Inc. # MIT License - See License file at: # https://github.com/ktbyers/netmiko/blob/develop/LICENSE import re import os import time from netmiko import log from netmiko.base_connection import BaseConnection from netmiko.scp_handler import BaseFile...
#!/usr/bin/env python3 # Copyright 2019 Johns Hopkins University (author: <NAME>) # Copyright <NAME> # Copyright 2019 Idiap Research Institute (Author: <NAME>). # Apache 2.0. """ This script outputs information about a neural net training schedule, to be used by ../train.sh, in the form of lines t...
""" map_sense.py Copyright 2016 University of Melbourne. 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 ...
# -*- coding: utf-8 -*- ## # TRACK 8 # BODY LANGUAGE # <NAME> (<EMAIL>) # This file builds the sequence file for use with ChucK from the data supplied ## # Library dependancies import csv import json import math import os from pprint import pprint import sys import time # Config BPM = 100 # Beats per minute, e.g. 60,...
""" to match xuefeng's data and train-valid split """ from pathlib import Path import hashlib from torch.utils.data import DataLoader, Subset from NeuralGraph.dataset import MolData, SmileData from NeuralGraph.model import QSAR, MLP import torch.nn as nn import pandas as pd import numpy as np import argparse FP_...
# -*- coding: utf-8 -*- __all__ = ['points', 'costfunction', 'station'] # todo add grid definitions of reanalysis # for plotting era5_grid = {'lon': None, 'lat': None} erai_grid = None jra55_grid = None cera_grid = None def station(lon, lat, label=None, marker='o', markersize=20, bounds=1, ax=None, data=None, **kwa...
import sys import csv import re from itertools import chain, combinations import itertools # List of values and their respective MIS values mis_dict = {} # List of given transactions list_of_transactions = [] # List of cannot_be_together sets list_of_cbt = [] # List of items list_of_items = [] # Support difference con...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import io import numpy as np import re as _re from random import shuffle import PIL.Image as Image import PIL.ImageColor as ImageColor import PIL.ImageDraw as ImageDraw import PIL.ImageFont as ImageFont from ...
# Copyright 2018 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, ...
# Copyright 2019 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from __future__ import absolute_import, unicode_literals import urlparse from mopidy.internal import deprecation from mopidy.mpd import exceptions, protocol, translator @protocol.commands.add('add') def add(context, uri): """ *musicpd.org, current playlist section:* ``add {URI}`` Adds the ...
#encoding=utf8 # Copyright (c) 2021 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 requi...
# # MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pu...
#! /usr/bin/env python # -*- coding: utf-8 -*- """system.py Unit Tests ..moduleauthor:: <NAME> <<EMAIL>> """ import logging import os import os.path as osp import shutil import subprocess import pytest import numpy as np from strumenti.tests.fixtures import \ ChromalogLogCapture from strumenti import system ...
#!/usr/bin/env python3 """ takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h, using the following template rules /**begin repeat -- on a line by itself marks the start of a repeated code segment /**end repeat**/ -- on a line by itself marks it's end After...
import os import uuid from django.core.exceptions import ValidationError from django.urls import reverse from django.db import models from django.db.models import Q from django.utils.translation import gettext_lazy from django.utils import timezone from .abstract_is_admin import AbstractIsAdmin from .abstract_is_cand...
import logging import os from math import factorial from typing import Optional, Tuple import matplotlib.pyplot as plt import networkx as nx import pandas as pd import src.mechanrich.startup from src.mechanrich.preprocessing import PreProcessing from src.mechanrich.reader import DataReader logger = logging.getLogger...
""" The Magnificent Splitbrain .. versionadded:: 3.3 """ import sys import atexit import threading from contextlib import contextmanager import functools import gc try: import __builtin__ as builtins except ImportError: import builtins # python 3+ from types import ModuleType router = threading.local() route...
import atexit import logging import json import numpy as np import os import six import sys import threading import weakref from gym import error, version from gym.monitoring import stats_recorder, video_recorder from gym.utils import atomic_write, closer, seeding logger = logging.getLogger(__name__) FILE_PREFIX = '...
# Copyright 2016-2020 The <NAME> at the California Institute of # Technology (Caltech), with support from the Paul Allen Family Foundation, # Google, & National Institutes of Health (NIH) under Grant U24CA224309-01. # All rights reserved. # # Licensed under a modified Apache License, Version 2.0 (the "License"); # you ...
""" Module for building a complete dataset from local directory with csv files. """ import os import sys from os.path import isfile, join import pandas as pd import json import numpy as np from logbook import Logger, StreamHandler from pandas import read_csv, Timedelta from zipline.utils.calendars import deregister_c...
#! /usr/bin/env python3 import frida import sys import os import time from termcolor import cprint import argparse from mobsf import MobSF from generate_report import gen_report DELAY_TIME = 0.5 WAIT_TIME = 0.8 FINAL_WAIT_TIME = 3 DEBUG = True def open_activity(activity_name, activity_fullname, package_name): ...
from time import time import numpy as np from kdtree import KDTree import collections import heapq import pickle import itertools import math import random class SimpleGraph: def __init__(self, dim, capacity=100000): self._edges = collections.defaultdict(list) self._kd = KDTree(dim, capacity) ...
""" Test for the MultiInterface and GeomDictInterface """ from unittest import SkipTest import numpy as np from holoviews.core.data import Dataset, MultiInterface from holoviews.core.data.interface import DataError from holoviews.core.util import pd from holoviews.element import Polygons, Path from holoviews.element....
# interactive stratigraphic filter toy model # IMPORT LIBLARIES import numpy as np import matplotlib.pyplot as plt import matplotlib.widgets as widget from mpl_toolkits.axes_grid1 import make_axes_locatable if __name__ == '__main__': import utils import functions as funcs else: from . import utils fr...
# coding=utf-8 from datetime import datetime, timedelta from ml import feature_functions import numpy as np import pandas as pd import settings import time from db.encoding import EncodingHelper, __decode_binary_array encoder = EncodingHelper() def encode_feature(ftr): import bson if isinstan...
#---------------------------------------------------------------- # # # # ************************** # THIS IS WHAT USED TO BE controller_server.py # ************************** # # # # #---------------------------------------------------------------- def controller_worker(contr...
##Chinese Stock API Data Grabber# ##@ycooi <EMAIL># ##@version 1.0# #coding=utf-8 import urllib, re import MySQLdb import time import threading import ConfigParser class myDatabase(): def __init__(self,tbname): self.user = 'root' self.passwd = '<PASSWORD>' self.dbname = 's...
# coding=utf-8 # Copyright 2022 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...
from datetime import datetime import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras import regularizers import numpy as np import matplotlib.pyplot as plt import tracks racer = tracks.Racer() ################################################# # DDPG implementat...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import py...
#!/usr/bin/python # -*- coding: utf-8 -*- from sklearn.base import BaseEstimator, TransformerMixin from sklearn.preprocessing import LabelEncoder from collections import defaultdict import numpy as np import sys PY3 = sys.version_info[0] == 3 def lambda_underscore(): # Module level named lambda-function to make de...
# -*- coding: utf-8 -*- """The ``RPC`` result backend for AMQP brokers. RPC-style result backend, using reply-to and one queue per client. """ from __future__ import absolute_import, unicode_literals import time import kombu from kombu.common import maybe_declare from kombu.utils.compat import register_after_fork fr...
#!/usr/bin/env python # encoding: utf-8 # <NAME> 2008-2010 """ MacOSX related tools """ import os, shutil, platform from waflib import Task, Utils, Errors from waflib.TaskGen import taskgen_method, feature, after_method, before_method app_info = ''' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "file...
import argparse import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import scikit_posthocs as sp import seaborn as sns from pingouin import kruskal from statannot import add_stat_annotation def parse_args(args): parser = argparse.ArgumentParser(description="GC_content_plots") par...
# BSD 2-Clause License # # Copyright (c) 2021-2022, Hewlett Packard Enterprise # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright...
#!/bin/env python3 import datetime import inspect import time import yaml import kubernetes class NotFound(Exception): pass class RetryWrapper: """Generic class for retrying method calls on an object""" def __init__(self, object, exception=Exception, timeout=60): self.object = object ...
from inspect import getdoc, signature from pprint import pprint from typing import Any, Callable, Coroutine, Dict, List, Optional, Type, Union from interactions.client.decor import command from interactions import ( MISSING, Client, CommandContext, Extension, Guild, InteractionException, O...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from multiprocessing import Process from time import sleep, time from typing import Any, Dict, List, ...
import os, copy, glob import yaml import itertools import pandas import numpy as np import matplotlib.pyplot as plt from gcg.data import mypickle from . import utils from gcg.data.file_manager import FileManager from gcg.misc.utils import import_params ############################ ### Multiple Experiments ### ######...
from __future__ import absolute_import import torch import torch.nn as nn import numpy as np import scipy.misc import os import math from .misc import * # ============================================================================= # Helpful functions generating groundtruth labelmap # =============================...
# -*- coding: utf-8 -*- # # Copyright (c) 2016 - 2020 -- <NAME> # All rights reserved. # # License: BSD License # """\ Segno writer plugin to convert a (Micro) QR code into a Pillow Image and and to add (animated) background images to QR codes. """ from __future__ import absolute_import, unicode_literals, division impo...
""" legacyhalos.io ============== Code to read and write the various legacyhalos files. """ from __future__ import absolute_import, division, print_function import os import pickle, pdb import numpy as np import numpy.ma as ma from glob import glob def get_objid(cat, analysisdir=None): """Build a unique object ...
import json import sys import urllib3 from ansible.module_utils.basic import AnsibleModule DOCUMENTATION = """ --- module: thola_check_server_facts author: "<NAME>" version_added: "1.0.0" short_description: "Checks a server" description: - "Checks a server given its IP" requirements: - thola-client-module-pyt...
# coding: utf-8 # Import Python Libs from __future__ import absolute_import import os # Import Salt Testing Libs from tests.support.unit import skipIf # Import 3rd-party libs # pylint: disable=import-error try: import tornado.testing import tornado.concurrent from tornado.testing import AsyncTestCase ...
import hashlib from dagster import check from dagster.core.definitions.mode import ModeDefinition from dagster.core.system_config.objects import EnvironmentConfig def _resolve_step_input_versions(step, step_versions): """Computes and returns the versions for each input defined for a given step. If an input ...
import discord import traceback import requests import json, urllib.request from discord.ext import commands from discord.ext.commands import Bot from logging import getLogger from tinydb import where log = getLogger("extensions.Lolinfo") class LolInfoCog(commands.Cog, name="LeagueInfo"): def __init__(self, b...
# 2021-05-01 # This code was made for use in the Fu lab # by <NAME> import numpy as np import scipy.io as spio import warnings from sif_reader import np_open as readsif from .constants import conversion_factor_nm_to_ev # eV*nm from .constants import n_air from .DataDictXXX import DataDictFilenameInfo from .DataDictX...
import re import time from urllib.parse import urlparse import textblob.en.inflect import textblob.translate from nltk.stem import WordNetLemmatizer from core.stop_words import stop_words DEFAULT_MEASUREMENT = "serving" DEFAULT_MEASUREMENT_VARIATIONS = { "piece", "fruit", "bit", "section", "slice...
############################################################################ # Generic routines for doing things on graphs # # # ############################################################################ import numpy...
import numpy as np from sklearn.metrics import pairwise_distances from scipy.spatial.distance import cdist from ._hdbscan_linkage import mst_linkage_core from .hdbscan_ import isclose def all_points_core_distance(distance_matrix, d=2.0): """ Compute the all-points-core-distance for all the points of a cluster....
# encoding=utf-8 # python3.6 # bear_import.py # Developed with Visual Studio Code with MS Python Extension. ''' # Markdown import to Bear from folder Version 1.0.0 - 2018-02-10 at 17:37 EST github/rovest, <EMAIL> ## NEW import function: * Imports markdown or textbundles from nested folders under a `BearImport/inpu...
# -*- coding: utf-8 -*- """This script evaluates imported PyTorch models on the ImageNet validation set e.g. python run_imagenet_benchmarks.py --model_subset pt_tpu --gpus 2 """ import os import argparse from torchvision.models import densenet from imagenet.evaluation import imagenet_benchmark from pathlib import Pat...
# -------------------------------- # Name: PPA2_masterTest.py # Purpose: get values for the "trip shed" for freeway projects. # # # Author: <NAME> # Last Updated: <date> # Updated by: <name> # Copyright: (c) SACOG # Python Version: 3.x # -------------------------------- import datetime as dt import os import arcpy i...
# Copyright 2018 <NAME> # Licensed under the MIT license """ Core implementation of aiosqlite proxies """ import asyncio import logging import sqlite3 from functools import partial from pathlib import Path from queue import Queue, Empty from threading import Thread from typing import Any, Callable, Iterable, Optiona...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2012 California Institute of Technology. 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 th...
# -------------------------------------------------------- # DaSiamRPN # Licensed under The MIT License # Written by <NAME> (wangqiang2015 at ia.ac.cn) # -------------------------------------------------------- import numpy as np from torch.autograd import Variable import torch.nn.functional as F import math from .uti...
from rest_framework.views import APIView from rest_framework.response import Response from analysis.corpus import get_dual_corpora_by_metadata, find_doc_in_hierarchy, trace_doc_in_hierarchy from analysis.utils import profile from django.conf import settings from django.http import Http404 from django.core.cache import ...
### # This file was generated by VCL Generator # Copyright 1998 - <NAME> # 29/06/1999 12:59:49 # it declares the symbols of the Delphi unit Graphics.pas ### from System import * from Classes import * import _Graphics # TFontStyle = ( fsBold, fsItalic, fsUnderline, fsStrikeOut ); fsBold = 0 fsItalic =...
#!/usr/bin/env python """Cleans up one or many given directories until a given amount of free space is available on the device of those directories. See the usage method below for further details. Copyright (c) 2014 <NAME> <<EMAIL>> License: The MIT License (http://opensource.org/licenses/MIT) """ def usage()...
import time import traceback from typing import Dict, List, Optional, Tuple from chia.types.blockchain_format.program import SerializedProgram from chia.types.blockchain_format.sized_bytes import bytes32 from chia.types.coin_record import CoinRecord from chia.types.condition_with_args import ConditionWithArgs from chi...
#!/usr/bin/env python3 import random from collections import Counter from .typos import add_typos def random_select_weighted_list(ls): return random.choices([k[1] for k in ls], weights = [k[0] for k in ls], k = 1)[0] suspect_words = [ (1.0, 'suspect'), (0.3, 'have reason to suspect'), (1.0, 'believe'), (0...
import numpy as np from abc import ABC, abstractmethod from rl.tools.online_learners.utils import cg class Prox(ABC): """An interface of strictly convex functions R.""" def proxstep(self, g): # argmin <g,x> + R(x) return self.primalmap(-g) def dualfun(self, u): # sup_x <u,x> - R(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # credit: https://raw.githubusercontent.com/BlocklyDuino/BlocklyDuino/gh-pages/arduino_web_server.py # credits-credit: http://sheep.art.pl/Wiki%20Engine%20in%20Python%20from%20Scratch __script_name__ = 'serve.py' __version__ = '1.0.0' import logging L = logging.getLogg...
import asyncio import multiprocessing import os from distributed.comm.utils import from_frames, to_frames from distributed.protocol import to_serialize from distributed.utils import nbytes import cloudpickle import numpy as np import pytest import rmm import ucp from utils import more_than_two_gpus cmd = "nvidia-smi...
from django.contrib import admin from gbe.models import * from import_export.admin import ImportExportActionModelAdmin from django.urls import reverse from django.utils.html import format_html class ConferenceAdmin(admin.ModelAdmin): list_display = ('conference_name', 'conference_slug', ...
# Copyright 2016 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. All Rights Reserved. # # Portion of this code is Copyright Geoscience Australia, Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this file # except in c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Microsoft Crypto API structures """ import enum from Crypto.PublicKey import RSA from Crypto.Math.Numbers import Integer from refinery.lib.structures import Struct, StructReader class _ENUM(enum.IntEnum): def __str__(self): return self.name def __repr__(sel...
# import pandas as pd import random import matplotlib.pyplot as plt import plotly.graph_objects as go import numpy as np import plotly.express as px from pandas import DataFrame from matplotlib.backends.backend_pdf import PdfPages res_8 = [45, 27, 15, 28, 20, 8, 19, 21, 9, 24, 3, 16, 7, 12, 6, 9, 1, 3, 17, 27, 19, 26...