text
stringlengths
3.07k
22.1k
""" Is Unique Implement an algorithm o determine if a string has all unique characters. What if you cannot use additional data structures? """ def is_unique(word): # if no data structures then sort and count return len(word) == len(set(word.lower())) def test_is_uniqure(): assert is_unique('...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This is the example module. This module reference from https://github.com/mikeckennedy/write-pythonic-code-demos/tree/master/code/ch_02_foundations """ __author__ = ["[<NAME>](https://github.com/davislf2)"] __copyright__ = "Copyright 2018, The Boundary of Knowledge Pro...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import numpy as np from collections import namedtuple import tensorflow as tf from tensorflow.python.ops import variable_scope from tensorflow.python.ops import math_ops from tensorflow.python.ops ...
"""Base classes and function for REST, WMS, and WMF services.""" from dataclasses import dataclass from itertools import zip_longest from typing import Dict, List, Optional, Tuple, Union import pyproj from orjson import JSONDecodeError from owslib.wfs import WebFeatureService from owslib.wms import WebMapService from...
# + ''' Given an object, save it in disk or database. Input: Object (DataFrame, model, etc.). Output: None. Object is saved. ''' from utils import utils import dill import subprocess import pickle import pyarrow.parquet as pq import pyarrow as pa import datetime import hashlib import pandas as p...
"""Brings the VPHAS catalogue headers in line with ESO's PHASE 3 requirements. """ import os import re import json import glob from datetime import datetime import numpy as np from astropy import log from astropy.io import fits from astropy.coordinates import SkyCoord from astropy.time import Time from surveytools i...
""" Hangout API =========== Main module of Hangout that provide base HG management and call settings management. """ # pylint can't handle EasyDict properly # pylint: disable=E1101 import os.path from pyvirtualdisplay.smartdisplay import SmartDisplay import seleniumwrapper as selwrap from chromedriver import CHROMEDR...
import os, pickle, csv, copy from pathlib import Path import numpy as np from sklearn.utils import resample from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import Normalizer from sklearn.model_selection import train_test_split from sklearn.utils import shuffle def listFiles(data_folder): ...
import typing from datetime import datetime, timedelta from .abc import BaseObject, BaseUser if typing.TYPE_CHECKING: from .state import ConnectionState __all__ = ( "ClashOfCode", "Player", ) class ClashOfCode(BaseObject): """Represents a Clash of Code. Attributes ----------- publi...
import pandas as pd import StringIO import collections import re import django.db BASE_SQL = 'SELECT crs.*, recipient.recipientname, donor.donorname, channel.channelname, ' \ 'sector.sectorname, purpose.purposename, agency.agencyname, ' \ 'region.regionname, incomegroup.incomegroupname, flow.flo...
#-*- coding:utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import print_function import os import torch import argparse import torch.nn as nn import torch.utils.data as data import torch.backends.cudnn as cudnn import torchvision.transforms as transforms ...
# Copyright 2019 Uber Technologies, 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 applica...
import os import shutil import subprocess import sys import tempfile import typing import zipfile from abc import ABC import json HOME = os.path.dirname(__file__) class ProjectView: """ Helper class for in-memory file manipulation todo: export to common place / library """ def __init__(self): ...
#! "/usr/bin/python3" #imports needed by some functions to work import random #just reference for the names and position of the 9 slots of the tic-tac-toe matrix ''' a b c d e f g h i ''' # the slot class is not very different from the string class but it allows only some specific values to be inserted class slot():...
""" Module to read / write wav files using NumPy arrays Functions --------- `read`: Return the sample rate (in samples/sec) and data from a WAV file. `write`: Write a NumPy array as a WAV file. """ from __future__ import division, print_function, absolute_import import sys import numpy import struct import warnings...
from __future__ import division, absolute_import, print_function import sys import re import inspect import textwrap import pydoc import collections import os from jinja2 import FileSystemLoader from jinja2.sandbox import SandboxedEnvironment import sphinx from sphinx.jinja2glue import BuiltinTemplateLoader from .do...
#!/usr/bin/python import random from optparse import OptionParser from torch.utils.data import TensorDataset from torch.utils.data import DataLoader from torch.utils.data import random_split from utils import * from models import * ###################################################################### #--...
#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().system("pip3 install bayesian-optimization==0.6 --user") # I use `bayesian-optimization==0.6`, my backend pretty much stick with this version, so migrating will break the code. # In[2]: import random import time import types import matplotlib.pyplot ...
# Copyright 2011 Citrix System. # 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 b...
from ooiui.core.app import app from flask import request, render_template, Response, jsonify, session from werkzeug.exceptions import Unauthorized import requests import json import urllib from uuid import uuid4 def get_login(): token = request.cookies.get('ooiusertoken') if not token: return None ...
from abc import ABCMeta, abstractmethod from argparse import ArgumentParser from typing import List, Any import numpy as np import pytorch_lightning as pl import torch import wandb import museval from pytorch_lightning.loggers import WandbLogger from torch.optim.lr_scheduler import ReduceLROnPlateau from lasaft.sourc...
import math from math import nan import numpy as np import pandas as pd from sklearn.ensemble import AdaBoostClassifier from sklearn.linear_model import * import sklearn.feature_selection from sklearn.model_selection import train_test_split, GridSearchCV def dummy_df(df, todummy_list): for x in todummy_list: ...
# Copyright 2016 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. from __future__ import absolute_import import atexit import json import os import sys import time import threading import multiprocessing from py_trace_event...
# -*- coding: utf-8 -*- ''' Return data to an influxdb server. .. versionadded:: 2015.8.0 To enable this returner the minion will need the python client for influxdb installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml influxdb.db: 'salt' ...
#!/usr/bin/env python3.4 """ Entry point to provide REPL and file processing. """ import judged from judged import context from judged import actions from judged import tokenizer from judged import parser from judged import logic from judged import formatting from judged import worlds from judged import extensions im...
# -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020-2021, <NAME> <<EMAIL>> # # This module is under the UIUC open-source license. See # github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt # for license details. """ """ from ..units_...
# -*- coding: utf-8 -*- # Copyright 2018 The Blueoil 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 # # Unles...
""" Client for uploading packaged artifacts to s3 """ # Copyright 2012-2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aw...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible 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 the License, or #...
import math import mmcv import numpy as np import os import random import sys import time import torch from mmcv.runner import get_time_str, master_only from os import path as osp from shutil import get_terminal_size from torchvision.utils import make_grid from basicsr.utils import get_root_logger de...
import os import time from typing import Sequence import numpy as np from argparse import ArgumentParser from src.data.study import Study from src.data.landmarks import get_lmks_data from src.utils.definitions import MAX_GA_DIFF, MIN_CASES_PER_GA, N_ITER, ATLAS_SAVE_FOLDER, USE_RIGHT_LEFT_FLIP, GA_STD, LMKS_NAMES from ...
# -*- coding: utf-8 -*- # # Copyright 2019-2021 BigML # # 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 ...
#!/usr/bin/env python # coding: utf-8 # 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. import collections import os import unittest import sys import build_utils # pylint: disable=relative-import # Requi...
import torch from torch._six import container_abcs from torch_geometric.nn.inits import reset import torch_geometric.nn as pyg_nn import torch_geometric.utils as pyg_utils import torch.nn as nn # TODO: add another new "HeteroSAGEConv" add edge_features class HeteroSAGEConv(pyg_nn.MessagePassing): r"""The heterogen...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2004-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
from framework import utils def serialize_initiator(initiator): return { 'fullname': initiator.fullname, 'id': initiator._id } def serialize_meta_schema(meta_schema): if not meta_schema: return None return { 'id': meta_schema._id, 'schema_name': meta_schema.name...
import json from django.http import HttpResponse from django.core import serializers from django.core.urlresolvers import reverse_lazy from django.shortcuts import redirect from django.views.generic import View, CreateView, ListView, DetailView, UpdateView, DeleteView from django.contrib.auth.mixins import PermissionR...
# -*- coding: utf-8 -*- import os import json import tkinter from tkinter import filedialog from datetime import datetime import yaml from mongoengine import connect, disconnect from mongoengine import ( Document, StringField, ListField, FloatField, IntField, EmbeddedDocument, EmbeddedDocumentField, Da...
# Copyright (c) # Copyright (c) 2018-2020 CVC. # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module implements an navigation that roams around a track following random waypoints and avoiding other vehicles. The navigation also responds t...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt from utils import MatReader, rel_error, UnitGaussianNormalizer from tqdm import tqdm import sys import argparse import os import shutil torch.manual_seed(0) np.random.seed(0) device = torch.device('c...
"""Utils to convert OpenHTF TestRecord to test_runs_pb2 proto. MULTIDIM_JSON schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Multi-dimensional test parameter", "type": "object", "properties": { "outcome": {"enum": ["PASS", "FAIL", "ERROR"]}, "name": {"type": "string"}, "di...
import argparse import asyncio import logging import re import time import sys import csv import yarl import aiohttp __all__ = ["DataLogger", "STDOUTDataLogger"] class DataLogger: all_data_loggers = {} def __init_subclass__(cls, name): cls.all_data_loggers[name] = cls help = "applet help missi...
# # Copyright 2011 Twitter, 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, so...
"""Monkey-patch data frame formatter to 1. add dtypes next to column names when printing 2. collapse data frames when they are elements of a parent data frame. """ from pandas import DataFrame from pandas.io.formats.html import ( HTMLFormatter, NotebookFormatter, Mapping, MultiIndex, get_level_lengt...
""" A package to generate a csv file type report for cleaning rules. """ # Python imports import csv import logging import os from copy import copy # Third party imports from googleapiclient.errors import HttpError from google.api_core.exceptions import BadRequest from google.auth.exceptions import DefaultCredentialsE...
# # MIT License # # Copyright (c) 2020 Airbyte # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pu...
import pandas as pd import json import numpy as np import pyswarms as ps from scipy.optimize import minimize import matplotlib.pyplot as plt from scipy.optimize import fsolve from scipy.stats import nbinom, poisson, norm from pseudotimeAPI import * from pseudotimeEstInfer import * import csv import warnings warnings.f...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm # from utils import init_weights, get_padding LRELU_SLOPE = 0.1 def get_padding(kernel_size, dilation=1): ret...
import socket import time import paho.mqtt.client as mqtt import logging import json import configparser import io from datetime import timedelta,datetime from MQTTHandler import MQTTHandler from connection import connection import connection # Define constants HPUMP_MODES = { 0: "auto", 1: "he...
"""Test the nifti_region module Functions in this file only test features added by the NiftiLabelsMasker class, not the underlying functions (clean(), img_to_signals_labels(), etc.). See test_masking.py and test_signal.py for details. """ from nose.tools import assert_raises, assert_equal, assert_true import numpy as...
import requests import bs4 user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' headers = {'User-Agent': user_agent} dict_decoder = {0: "English", 1: "American", 2: "Business"} link_prefix = "https://dictionary.cambridge.org" def get_tags(block) -> [list, list, list, l...
''' Homebrew for Mac OS X ''' # Import python libs import copy import logging # Import salt libs import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Confine this module to Mac OS with Homebrew. ''' if salt.utils.which('brew') and __grains__['os'] == 'MacOS': return '...
"""Functions for reading and writing networks in different file formats. """ from .net import MultilayerNetwork,MultiplexNetwork import math,json,os def write_ucinet(net,outputfile,outputType="edges"): assert isinstance(net,MultiplexNetwork), "Multilayer networks not supported by the UCINET file format." if is...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
from __future__ import print_function import atexit import numbers import os import sys import time from git import Repo, InvalidGitRepositoryError from six.moves import urllib from mlflow.entities.experiment import Experiment from mlflow.entities.param import Param from mlflow.entities.metric import Metric from mlf...
# Copyright 2020 gRPC 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 applicable law or agreed to in writing...
""" Augmenter that apply operation (sentence level) to textual input based on contextual word embeddings. """ import os from nlpaug.augmenter.sentence import SentenceAugmenter import nlpaug.model.lang_models as nml from nlpaug.util import Action, Doc import nlpaug.util.text.tokenizer as text_tokenizer CONTEXT_WO...
from typing import Dict, Tuple import numpy as np from sklearn.manifold import MDS def cityblock_batch(X: np.ndarray, y: np.ndarray) -> np.ndarray: """ Calculate the L1 distances between a batch of arrays X and an array of the same shape y. Parameters ---------- X Bat...
''' admin_boundaries.py ------------------- Generates polygons from OpenStreetMap relations ''' import array import logging import six from bisect import bisect_left from collections import defaultdict, OrderedDict from itertools import izip, combinations from geodata.coordinates.conversion import latlon_to_decimal...
import sys import pandas as pd import argparse import json import numpy as np from progressbar import ProgressBar import copy import os DEFAULT_PROJECT_REPO = os.path.sep.join(__file__.split(os.path.sep)[:-2]) PROJECT_REPO_DIR = os.path.abspath( os.environ.get('PROJECT_REPO_DIR', DEFAULT_PROJECT_REPO)) sys.path.a...
from collections import defaultdict import logging import random import threading import time from typing import Any, Callable, Dict, List, Mapping, Optional, Set, Union from django.conf import settings import pika from pika.adapters.blocking_connection import BlockingChannel from pika.spec import Basic from tornado ...
import IPython import math import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf import tensorflow.keras as keras from kerastuner import HyperModel, RandomSearch def create_interval_dataset(dataset, look_back=12): """ :param dataset: input array ...
# -*- coding: UTF-8 -*- import os import subprocess import time import simplejson as json from django.conf import settings from django.contrib.auth.decorators import permission_required from django.http import HttpResponse from common.config import SysConfig from common.utils.aes_decryptor import Prpcrypt from common...
# Copyright 2018 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribute, ...
from __future__ import print_function from future import standard_library standard_library.install_aliases() from future.utils import iteritems from gevent import monkey monkey.patch_all() from flask import Flask, request, render_template import time import os import sys import re from bson import ObjectId import jso...
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE import awkward as ak np = ak.nplike.NumpyMetadata.instance() # @ak._v2._connect.numpy.implements("sum") def sum(array, axis=None, keepdims=False, mask_identity=False, flatten_records=False): """ Args: array: Arra...
""" Classes for scaling refinement engines. Classes are inherited from the dials.refinement engine with a few methods overwritten to use them with scaling code.""" from __future__ import annotations import logging from libtbx.phil import parse from dials.algorithms.refinement.engine import ( GaussNewtonIterat...
import os import time import scipy.io import json import warnings warnings.filterwarnings("ignore") from utils import * from MeshPly import MeshPly # Create new directory def makedirs(path): if not os.path.exists( path ): os.makedirs( path ) def find_betapose_entry(betas, image_id): f...
# Database for Vaccine Donations # Created as part of EEE 121 Probset Part IV Requirement # Submitted by: <NAME>. ############################################################################################################ # HOW TO USE # The user will be given guides as soon as he/she runs the program # Follow input...
# Copyright 2022 The etils 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 applicable law or agreed to in wr...
"""Implements the :stac-ext:`Projection Extension <projection>`.""" import json from typing import Any, Dict, Generic, Iterable, List, Optional, TypeVar, Union, cast import pystac from pystac.extensions.hooks import ExtensionHooks from pystac.extensions.base import ( ExtensionManagementMixin, PropertiesExtens...
# encoding: utf-8 from __future__ import division, print_function, unicode_literals #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # --> let me know if you have ideas for improving # --> <NAME> aka Deutsc...
# vim: set et nosi ai ts=2 sts=2 sw=2: # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import ast import json import pprint import msgpack from schwa.dr.constants import FieldType import six from six.moves import zip from drapps.api import App from drapps.util import r...
# Copyright (c) 2021, elParaguayo. All rights reserved. # # 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, ...
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # 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...
# Copyright 2021 Huawei Technologies Co., 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 or agreed to...
from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf tf.__version__ # To generate GIFs import glob import imageio import matplotlib.pyplot as plt import numpy as np import os import PIL from tensorflow.keras import layers import time from IPython imp...
# encoding: UTF-8 ''' vn.stub的gateway接入 ''' from vnpy.trader.gatewayMarket.vtMarket import VtMarket from vnpy.trader.main.vtObject import VtLogData, VtTickData from vnpy.trader.gatewayTrade.vtGateway import * from vnpy.trader.language.vtConstant import * from vnpy.trader.event.eventEngine import EventEn...
""" This module contains all the needed functions to control the Freenove 4WD Car FEAGI IPU/OPU directly interact with this module to operate the 4WD CAR """ import RPi.GPIO as GPIO from PCA9685 import PCA9685 from Led import * from ADC import * class LED: def __init__(self): self.led = Led() def ...
# -*- coding: utf-8 -*- """Transport functions for `BioDati <https://biodati.com/>`_. BioDati is a paid, closed-source platform for hosting BEL content. However, they do have a demo instance running at https://studio.demo.biodati.com with which the examples in this module will be described. As noted in the transport...
import os, sys, getopt, math, re, random import numpy as np import time from datetime import datetime #import config print("Importing qiskit...") import qiskit print("Importing fastsc...") import fastsc #from fastsc.coloring import success_rate_rand_coloring, success_rate_full_coloring, success_rate_layer_coloring,...
from nibabel import four_to_three from nibabel.processing import resample_to_output, resample_from_to from skimage.measure import regionprops, label from skimage.transform import resize from tensorflow.python.keras.models import load_model from scipy.ndimage import zoom import os import nibabel as nib from os.path impo...
import numpy as np import h5py import matplotlib.pyplot as plt from testCases_v2 import * from dnn_utils_v2 import sigmoid, sigmoid_backward, relu, relu_backward plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots plt.rcParams['image.interpolation'] = 'nearest' plt.rcParams['image.cmap'] = 'gray' np...
import pyspark import pyspark.sql.functions as F import pyspark.sql.types as T import re from datetime import datetime import pytz import pandas as pd import dateutil.parser as dp def repartition(df, repartition=None): assert isinstance(df, pyspark.sql.dataframe.DataFrame) return df.repartition(repartition)...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf from zhusuan.utils import log_mean_exp from zhusuan.variational.base import VariationalObjective __all__ = [ 'importance_weighted_ob...
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
"""Cuda op Python library.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import time import numpy as np import tensorflow as tf from tensorflow.python.framework import ops data_files_path = tf.resource_loader.get_data_files_path() _op_m...
#! /usr/bin/env python """ PFPT.py: Utility to do perturbative expansions for parafermion chain systems. """ __author__ = "<NAME>" __copyright__ = "Copyright 2016" __license__ = "GPL" __version__ = "0.1" __email__ = "<EMAIL>" import parafermions as pf import numpy as np import argparse import sys import time...
# Copyright 2019 The Android Open Source Project # # 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...
from itertools import chain import graphene from django.core.exceptions import ImproperlyConfigured, ValidationError from graphene.types.mutation import MutationOptions from graphene_django.registry import get_global_registry from graphql.error import GraphQLError from graphql_jwt import ObtainJSONWebToken, Verify fro...
#!/usr/bin/env python3 # Imported from https://github.com/jupyterhub/jupyterhub/blob/6b1046697/examples/cull-idle/cull_idle_servers.py """script to monitor and cull idle single-user servers Caveats: last_activity is not updated with high frequency, so cull timeout should be greater than the sum of: - single-user web...
""" Copyright 2018 EPAM Systems, 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...
import inspect from base64 import b32encode from hashlib import sha3_224 from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, cast import pydantic from tortoise import fields from tortoise.contrib.pydantic.base import PydanticListModel, PydanticModel from tortoise.contrib.pydantic.utils import ge...
#!/usr/bin/env python from __future__ import print_function import json import os from pybullet_tools.parse_json import parse_body, parse_pose, parse_region, parse_robot from pybullet_tools.pr2_problems import Problem from pybullet_tools.utils import ( connect, disconnect, point_from_pose, reset_simu...
import pickle from unittest.mock import Mock, call from pathlib import Path, PurePosixPath import pytest from ploomber.clients import GCloudStorageClient from ploomber.clients.storage.gcloud import storage from ploomber.exceptions import RemoteFileNotFound, DAGSpecInvalidError @pytest.fixture def mock_client(monkey...
# coding: utf-8 # # Refs: # - https://opencv-python-tutroals.readthedocs.io/en/latest/ import base64 import logging import os import re import time from typing import Union import cv2 import findit import numpy as np import requests from logzero import setup_logger from PIL import Image, ImageDraw from skimage.metric...
"""Unit tests for the Performancetest-runner source.""" from datetime import datetime from tests.source_collectors.source_collector_test_case import SourceCollectorTestCase from collector_utilities.functions import days_ago class PerformanceTestRunnerTestCase(SourceCollectorTestCase): """Base class for testing...
# -*- coding: utf-8 -*- from datetime import datetime from dispatches import dispatch from vilya.config import DOMAIN from vilya.libs.store import bdb from vilya.libs.model import BaseModel, ModelField from vilya.libs.signals import codereview_signal from vilya.models.project import CodeDoubanProject from vilya.models...
import sys import urllib.request import json import re import os from os.path import join from bugswarm.common.rest_api.database_api import DatabaseAPI def get_commits(artifact_tag): """ Using the Bugswarm API, Returns a list containing a project's passed and failed job trigger_sha """ bugswar...
"""Functional interface to Grail user preferences. See the Grail htdocs/info/extending/preferences.html for documentation.""" # To test, "(cd <scriptdir>; python GrailPrefs.py)". __version__ = "$Revision: 2.33 $" import os import sys if __name__ == "__main__": sys.path.insert(0, '../utils') import utils from ...