text
stringlengths
3.07k
12.6k
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from time import * from tabulate import tabulate import pandas as pd pd.options.mode.chained_assignment = None def df_pk(path=''): """ dataframe_package Loading the data in CVS. Return the whole DataFrame. """ gcf_data_path = os.path.dirna...
import inspect from torch import nn import boardom as bd from contextlib import contextmanager class Module(nn.Module): _registry = None def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls._module_key = cls.__name__.lower() Module._registry[cls._module_key] =...
from collections.abc import Mapping from typing import Optional, Union, List class cached_property: def __init__(self, func, name=None): self.func = func self.__doc__ = getattr(func, '__doc__') self.name = name or func.__name__ def __get__(self, instance, cls=None): if instanc...
import time import numpy as np from scipy.spatial.distance import pdist, squareform from sklearn.utils import shuffle class DotDict(dict): """Wrapper around in-built dict class to access members through the dot operation. """ def __init__(self, **kwds): self.update(kwds) self.__dict__ = s...
import numpy as np import numpy.ctypeslib as npct import ctypes import os.path from sys import platform from lisa.lisa_configuration import config SST_TAG_LEN = int(config['ODAS']['SST_tag_len']) MAX_ODAS_SOURCES = int(config['INCOME_STREAM']['n_sources']) ODAS_RCV_LIB = config['ODAS']['library'] pTag ...
"""Get modules from model.""" from ghpythonlib.componentbase import dotnetcompiledcomponent as component import Grasshopper, GhPython import System import rhinoscriptsyntax as rs import copy from Grasshopper import DataTree from Grasshopper.Kernel.Data import GH_Path __author__ = "<NAME>" __laboratory__ = ...
# -*- coding: utf-8 -*- #-------------------------------- # Name:calc_mix_index_sacog.py # Purpose: calculate the mix index for PPA, with emphasis on measuring how # conducive the land use mix is to replacing drive trips with walk # trips due to daily needs like retail, schools, etc. being within wal...
"""Tuya devices.""" import logging from typing import Optional, Tuple, Union from zigpy.quirks import CustomCluster, CustomDevice from zigpy.zcl.clusters.general import OnOff from zigpy.zcl import foundation import zigpy.types as t from .. import Bus TUYA_CLUSTER_ID = 0xEF00 TUYA_SET_DATA = 0x0000 TUYA_GET_DATA = ...
from asciimatics.widgets import Frame, TextBox, Layout, Label, Divider, Text, \ CheckBox, RadioButtons, Button, PopUpDialog, TimePicker, DatePicker, Background, DropdownList, \ PopupMenu from asciimatics.event import MouseEvent from asciimatics.scene import Scene from asciimatics.screen import Screen from ascii...
# 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 __...
""" Assetto Corsa shared memory for Python applications _ctypes.pyd must be somewhere in sys.path, because AC doesn't include all Python binaries. Usage. Let's say you have following folder structure:: some_app DLLs _ctypes.pyd some_app.py some_app.py:: import os import sys ...
''' Classes used to represent a Management Protocol ''' from .relationships import (ATTACHMENT, CONNECTION, DEPENDENCY, ENDPOINT, FEATURE, HOST, STORAGE) class Protocol(): ''' The Protocol class representation. Attributes: initial_state -- the initial state (type:State) ...
""" Settings for REST framework are all namespaced in the REST_FRAMEWORK setting. For example your project's `settings.py` file might look like this: REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( 'rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.TemplateHTMLRenderer', ) ...
# ---------------------------------------------------------------------------- # Copyright (c) 2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------...
import matplotlib.pyplot as plt import time class Map: """Class that conducts transformations to vectors automatically, using the commads "go straight", "turn left", "turn right". As a result it produces a set of points corresponding to a road """ def __init__(self, map_size): self.map_s...
#!/usr/bin/env python """ Copyright (c) 2020 <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, publi...
# Copyright 2020 The AutoKeras 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 i...
from panda3d.core import * from direct.interval.IntervalGlobal import * from ElevatorConstants import * def getLeftClosePoint(type): width = ElevatorData[type]['width'] return Point3(width, 0, 0) def getRightClosePoint(type): width = ElevatorData[type]['width'] return Point3(-width, 0, 0) def getLe...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from analysis_data import generate_base_map, generate_max_delta_map, find_max_value, get_sqrt_square_average from find_pattern import find_pattern from plot_figure import plot_figure from read_txt import read_txt import numpy as np import math import sys def get_max_nois...
# -*- coding: utf-8 -*- from googleapiclient.discovery import build class GSheetSlotRequest: def __init__(self, sheet_id: str = '1Atr4sHOFmiIMxOY6rz2HjH4F6JD#&#ziXsN9G8s'): """Init API connection object""" # If modifying these scopes, delete the file token.pickle. self.SCOPES = ['https:...
############################################################################ # Original work Copyright 2017 Palantir Technologies, Inc. # # Original work licensed under the MIT License. # # See ThirdPartyNotices.txt in the project root for license information. # # All modifi...
#!/usr/bin/env python3 import sys import os import argparse import pandas as pd import glob def main(): parser = argparse.ArgumentParser(description="Preprocess reference collection: randomly select samples and write into individual files in lineage-specific directories.") parser.add_argument('-m, --metadata...
from dataclasses import dataclass import discord import pymongo from bson.objectid import ObjectId from discord.ext import commands from discord.ext.menus.views import ViewMenuPages from helpers.pagination import AsyncEmbedListPageSource from helpers.utils import FakeUser @dataclass class Tag: name: str owne...
# Copyright [2017] [Red Hat, 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 writ...
from django.utils.translation import gettext as _ from django.db.models import TextField from django.forms.widgets import Textarea from django.contrib.admin import register, ModelAdmin, TabularInline, StackedInline from tabbed_admin import TabbedModelAdmin from markdownx.models import MarkdownxField from markdownx.widg...
from collections import defaultdict import tensorflow as tf from .layers import GraphConvolutionMulti, GraphConvolutionSparseMulti, \ DistMultDecoder, InnerProductDecoder, DEDICOMDecoder, BilinearDecoder flags = tf.app.flags FLAGS = flags.FLAGS class Model(object): def __init__(self, **kwargs): all...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # File: cifar10-resnet.py # Author: <NAME> <<EMAIL>> import numpy as np import tensorflow as tf import argparse import os from tensorpack import * from tensorpack.tfutils.symbolic_functions import * from tensorpack.tfutils.summary import * """ CIFAR10 ResNet example. See...
import torch from onmt.translate.decode_strategy import DecodeStrategy def sample_with_temperature(logits, sampling_temp, keep_topk): """Select next tokens randomly from the top k possible next tokens. Samples from a categorical distribution over the ``keep_topk`` words using the category proba...
# coding: utf-8 """ Generated by: https://openapi-generator.tech """ from dataclasses import dataclass import re # noqa: F401 import sys # noqa: F401 import typing import urllib3 from urllib3._collections import HTTPHeaderDict from petstore_api import api_client, exceptions import decimal # noqa: F401 from ...
# Copyright © 2021 <NAME>, Red Hat, 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 ...
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
#!/usr/bin/env python3 """ Extract files from downloaded repositories to prepare Guesslang learning: * testing files and learning files are retrieved from different repositories * they are stored into two different subdirectories * a limited number of files for each language are retrieved per repository """ impo...
from u import * from modules import AdaptiveEmbedding, ProjectedAdaptiveLogSoftmax mask_type = torch.uint8 if torch.__version__.startswith('1.1') else torch.bool class Decoder(nn.Module): def __init__(self, c): super(Decoder, self).__init__() n_embed = c.n_embed self.ln1 = nn.LayerNorm(n_...
from __future__ import annotations from typing import Generic, Iterator, TypeVar _T = TypeVar("_T") class Header(Generic[_T]): __slots__ = "next" # improve memory usage def __init__(self) -> None: self.next: Node[_T] | Trailer[_T] class Trailer(Generic[_T]): __slots__ = "prev" # improve mem...
MQL_RESULTS = { 1: { "file": "2017_q4439_text_Bas_Meeuse", "results": 8, "verses": 8, "words": 42, }, 2: { "file": "2017_q4440_text_Bas_Meeuse", "results": 156, "verses": 136, "words": 294, }, "2a": { "file": "2017_q4467_text_Di...
""" Developer views (c) 2015 - <NAME> - @ekivemark """ __author__ = '<NAME>:@ekivemark' # DONE Activate Account # DONE: accounts/profile Landing Page. import ast import json from collections import OrderedDict from django.core import serializers from django.core.urlresolvers import reverse_lazy from django.contrib....
# Importing Packages # Update Requirements with 'pipreqs' import sys import subprocess import os import qrcode from tkinter import * import tkinter.filedialog from PIL import ImageTk, Image loc = "/" # Base Directory Variable class logoLoc(object): # Locations of all logos put into a class - Easier to Call Globally...
import functools import json import os import sys from timeit import default_timer import prompt_toolkit from prompt_toolkit.application import run_in_terminal from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop from prompt_toolkit.patch_stdout import patch_stdout from prompt_toolkit.shortcuts import ...
#!/usr/bin/env python3 # Copyright (c) 2021 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT """This module has ASN1 related functions""" from subprocess import Popen, PIPE, STDOUT from typing import List def len2int(first_n_bytes: bytes) -> int: """ Gets th...
"""JSON Web Algorithms. https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40 """ import abc import logging import cryptography.exceptions from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes # type: ignore from cryptography.hazmat.primitives import...
# -*- coding: utf-8 -*- # Copyright 2020 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...
import unittest from lambda_tools import mapper FAMOUS_FIVE = ['Dick', 'Julian', 'George', 'Anne', 'Timmy'] class StringFieldEntity: hello = mapper.StringField() class TestStringField(unittest.TestCase): def test_simple_mapping(self): result = mapper.parse(StringFieldEntity, { 'hello': 'world' }) ...
import io import logging import os import zipfile from datetime import datetime from .fs import FS, FileStat logger = logging.getLogger(__name__) logger.addHandler(logging.StreamHandler()) class ZipFileStat(FileStat): """Detailed information of a file in a Zip Attributes: filename (str): Derived fr...
from gevent import monkey monkey.patch_all() import time from threading import Thread import logging import threading from flask import Flask, render_template, session, request from flask.ext.socketio import SocketIO, emit, join_room, leave_room, \ close_room, disconnect logging.basicConfig(level=loggin...
#!/sr/bin/env python3 import numpy as np import pandas as pd from PIL import Image import torch import torch.nn as nn from torch.utils.data import DataLoader import os from shutil import copyfile from tqdm import tqdm import argparse from QataCovDataset import QataCovDataset from model.unet import UNet import gc de...
"""Platform for sensor integration.""" from __future__ import annotations from devolo_home_control_api.devices.zwave import Zwave from devolo_home_control_api.homecontrol import HomeControl from homeassistant.components.sensor import ( DEVICE_CLASS_BATTERY, DEVICE_CLASS_ENERGY, DEVICE_CLASS_HUMIDITY, ...
# -*- coding: utf-8 -*- # Copyright 2018 <NAME> <<EMAIL>> # # 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 # notice, this list of conditions and th...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Copyright (c) 2017-2019 The Raven Core developers # Copyright (c) 2020-2021 The Hive Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test...
# import kivy module import os import kivy import cv2 import numpy as np from tkinter import Tk from tkinter.filedialog import askopenfilename # base Class of your App inherits from the App class. # app:always refers to the instance of your application from gtts import gTTS from kivy.app import App from ki...
from snovault import ( AuditFailure, audit_checker, ) from snovault import ( UPGRADER, ) from snovault.schema_utils import validate from snovault.util import simple_path_ids from .formatter import ( audit_link, path_to_text, space_in_words, ) @audit_checker('Item', frame='object') def audit_it...
# Copyright 2015 Cisco 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 to in writin...
import numpy import operator import warnings import numpy as np import pandas from scipy import stats from ..exceptions import AsymmetricCorrelationError from ..workbench.em_framework.samplers import (AbstractSampler, DefaultDesigns, LHSSampler, MonteCarloSampler) def induce_correlation(std_uniform_sample, correlat...
# 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...
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 r...
# Lint as: python2, python3 # Copyright 2019 Google LLC. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
import json import plotfi import os, fnmatch from os import listdir from os.path import isfile, join try: import matplotlib.pyplot as plt import matplotlib.widgets as widgets import numpy as np from scipy.signal import butter,filtfilt except: print("Sono in raspberry") def TestParameterWr(filename,N...
from tryme import tryme from tryme.tryme import Success, Failure, Some, Nothing import os import pytest def test_try_bool(): assert Success('it worked!') assert not(Failure('it failed!')) def test_try_comparisons(): s0 = Success(0) s1 = Success(1) f0 = Failure(0) f1 = Failure(1) assert ...
#!/usr/bin/env python # # Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://abo...
#!/usr/bin/python import os, sys import stat from shutil import copyfile from distutils.dir_util import copy_tree def search_file(search_path, filename): """Given a search path, find file """ file_found = 0 paths = ["data/test/input", "data/ref/input", "data/all/input"] for path in paths: full...
import numpy as np import pylab import re # cities in our weather data CITIES = [ 'BOSTON', 'SEATTLE', 'SAN DIEGO', 'PHILADELPHIA', 'PHOENIX', 'LAS VEGAS', 'CHARLOTTE', 'DALLAS', 'BALTIMORE', 'SAN JUAN', 'LO<NAME>LES', 'MIAMI', 'NEW ORLEANS', 'ALBUQUERQUE', '...
""" Copyright (C) 2019 <NAME>, ETH Zurich 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, distri...
# BSD 2-Clause License # # Copyright (c) 2021, 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 noti...
"""Base material for download middlewares. Download middlewares capture :py:class:`django_downloadview.DownloadResponse` responses and may replace them with optimized download responses. """ import collections import copy import os from django.conf import settings from django.core.exceptions import ImproperlyConfigu...
#!/usr/bin/env python # coding: utf-8 -*- # # GNU General Public License v3.0+ # # Copyright 2019 Arista Networks AS-EMEA # # 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.ap...
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. import torch from torchvision import transforms normalization_parameters = {"mean": [0.485, 0.456, 0.406], "std": [0.229, 0.224, 0.225]} use_bbox_info_config = {False: {"max_trial": 1, "minimum_bbox_interlap": 0.0}, ...
#!/usr/bin/env python # RTC_DS1307.py Python Driver Code # only works in 24 hour mode from datetime import datetime import smbus def _bcd_to_int(bcd): """Decode a 2x4bit BCD to a integer. """ out = 0 for d in (bcd >> 4, bcd): for p in (1, 2, 4 ,8): if d & 1: out ...
from __future__ import print_function import time import datetime import sys import json from hpc_acm.rest import ApiException from hpc_acm_cli.command import Command from hpc_acm_cli.utils import print_table, match_names, arrange class Diagnostics(Command): @classmethod def profile(cls): return { ...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import nu...
import os import torch from torch import optim from torch.optim.lr_scheduler import StepLR from torch import nn from torch.nn import functional as F from tvae.data.mnist import DualTransformPreprocessor from tvae.containers.tvae import TVAE from tvae.models.mlp import MLP_Encoder, MLP_Decoder from tvae.containers.enco...
# Copyright The PyTorch Lightning team. # # 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 i...
"""Period differences""" from pandas.io.sql import read_sql from pyiem.plot.use_agg import plt from pyiem.plot import MapPlot, centered_bins from pyiem.util import get_autoplot_context, get_dbconn PDICT = {'state': 'State Level Maps (select state)', 'midwest': 'Midwest Map'} PDICT2 = {'both': 'Show both cont...
# Copyright 2018 D-Wave 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...
from collections import defaultdict from itertools import product import pandas as pd import numpy as np import scipy.sparse as sps from sklearn.base import TransformerMixin,BaseEstimator from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn.ensemble import RandomForestCl...
import json import os import re from collections import namedtuple import numpy as np ALGORITHMS = [method + '-' + device_type for device_type in ['CPU', 'GPU'] for method in ['catboost', 'xgboost', 'lightgbm']] TIME_REGEX = r'Time: \[\s*(\d+\.?\d*)\s*\]\t' ELAPSED_REGEX = re.compile(r'El...
"""Cart-related ORM models.""" from collections import namedtuple from decimal import Decimal from uuid import uuid4 from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.utils.encoding import smart_str from django.utils.timezo...
import numpy as np import scipy.optimize from .template_tools import get_template_channel_sparsity, get_template_amplitudes dtype_localize_by_method = { 'center_of_mass': [('x', 'float64'), ('y', 'float64')], 'monopolar_triangulation': [('x', 'float64'), ('y', 'float64'), ('z', 'float64'), ('alpha', 'floa...
""" Declare and configure the models for the courses application """ from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.utils.text import slugify from django.utils.translation import gettext_lazy as _ from cms.api import Page, PagePermission fro...
import matplotlib.pyplot as plt from src.lib import * from itertools import compress from scripts.dwt_no_edge_effects import * # by <NAME>, 2018 def find_ideal(p, just_once): if not just_once: diff = np.array(p[1:]) - np.array(p[:-1]) return sum(np.maximum(np.zeros(diff.shape), diff)) else: best = 0. i0_...
""" A Printer for generating executable code. The most important function here is srepr that returns a string so that the relation eval(srepr(expr))=expr holds in an appropriate environment. """ from __future__ import print_function, division from sympy.core.function import AppliedUndef from .printer import Printer ...
# coding: utf-8 """ HTCondor workflow implementation. See https://research.cs.wisc.edu/htcondor. """ __all__ = ["HTCondorWorkflow"] import os import logging from abc import abstractmethod from collections import OrderedDict import luigi from law.workflow.remote import BaseRemoteWorkflow, BaseRemoteWorkflowProxy f...
import tkinter import tkinter.messagebox from tkinter import * import string as st bg_colour ='blue' if bg_colour =='blue': calc_colour = 'royal blue' input_colour = 'royalblue1' calc_lock = True # Let's create the Tkinter window window = tkinter.Tk() window.configure(bg=bg_colour) window.iconbi...
# 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 from ... import _utilities, _tables from...
# # Copyright 2021 <NAME> # 2021 <NAME> # # ### MIT license # # 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, ...
# Copyright 2021 The TensorFlow 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 ...
import matplotlib matplotlib.use('Agg') import seaborn as sns import matplotlib.pyplot as plt import numpy as np import json import os import os.path as osp import platform import sys eval_set = 'val' methods = ['iclr_pos_ft_big_baseline_bn', 'iclr_gcn_dwr_pos_ft_spatial', 'iclr_internet_dwr_pos_ft_spatial', 'iclr_po...
import commonware from django.contrib.auth.models import User from nose.tools import eq_ from nose import SkipTest from pyes import StringQuery, FieldQuery, FieldParameter from elasticutils.tests import ESTestCase from elasticutils import F from jetpack.models import Package from search.helpers import package_search...
import argparse import os import preprocessing.util as util from subprocess import call def process_aida(in_filepath, out_filepath): # _, wiki_id_name_map = util.load_wiki_name_id_map(lowercase=False) #_, wiki_id_name_map = util.entity_name_id_map_from_dump() entityNameIdMap = util.EntityNameIdMap() e...
''' life.py Simulates John Conway's Game of Life with random initial states This is the original version using a dictionary to store the board. Original code here: http://www.daniweb.com/software-development/python/code/217028 Modified by <NAME> and <NAME>, January 2012 Second edit February 2013 Updated again January ...
import unittest import numpy from six import moves from chainer.backends import cuda from chainer import testing from chainer.testing import attr from chainer.utils import conv class TestConv(unittest.TestCase): def check_conv_outsize(self, size, k, s, p, d): # When cover_all == False, `outsize` is the...
""" adapted from https://github.com/keithito/tacotron """ import re import numpy as np from . import cleaners from .symbols import get_symbols from .cmudict import CMUDict from .numerical import _currency_re, _expand_currency ######### # REGEX # ######### # Regular expression matching text enclosed in curly braces f...
import os from pytgcalls import GroupCall import ffmpeg from config import Config from datetime import datetime from pyrogram import filters, Client, idle import requests import wget import aiohttp from random import randint import aiofiles VOICE_CHATS = {} DEFAULT_DOWNLOAD_DIR = 'downloads/vcbot/' # deezer download ...
#!/usr/bin/python # pip install lxml import sys import os import json import xml.etree.ElementTree as ET import glob START_BOUNDING_BOX_ID = 1 PRE_DEFINE_CATEGORIES = None # If necessary, pre-define category and its id # PRE_DEFINE_CATEGORIES = {"aeroplane": 1, "bicycle": 2, "bird": 3, "boat": 4, ...
# -*- coding: utf-8 -*- """ Script to calculate the Modulation transfer function of a edge target. Kickstarted from from https://gist.github.com/stefanv/2051954 and additional info from http://www.normankoren.com/Tutorials/MTF.html which tells us that "MTF can be defined as the magnitude of the Fourier transform of t...
import enum import os import pathlib import shutil from appdirs import user_data_dir from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, Table, Float from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref from sqlalchemy_utils import ColorType, ChoiceT...
from sqlalchemy import Column, ForeignKey, Integer, UniqueConstraint from sqlalchemy.orm import backref, relationship from sqlalchemy.types import PickleType from fonduer.candidates.models.temporarycontext import TemporaryContext from fonduer.parser.models.context import Context, construct_stable_id class TemporaryS...
import pygame import os import sys __author__ = "<NAME>" __copyright__ = "MIT License Copyright (c) 2019" __license__ = "MIT" __url__ = "https://github.com/Koltonix/comp120-tinkering-graphics" """ This program is designed to take an image, and display it as if the user was colour blind. After the image ...
import json import os import os.path as osp import re import shutil import sys import tempfile import textwrap import time import requests import six from core.gdown.parse_url import parse_url CHUNK_SIZE = 512 * 1024 # 512KB home = osp.expanduser("~") if hasattr(textwrap, "indent"): indent_func = textwrap.in...
# Python Version: 3.x import posixpath import re import string import urllib.parse from typing import * import bs4 import requests import onlinejudge.dispatch import onlinejudge.implementation.logging as log import onlinejudge.implementation.utils as utils import onlinejudge.type from onlinejudge.type import Submissi...
# Copyright 2016 Infinite Connection # # 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 w...
import os import pytest import salt.client.ssh.client import salt.utils.msgpack from salt.client import ssh from tests.support.mock import MagicMock, patch from tests.support.runtests import RUNTIME_VARS pytestmark = [ pytest.mark.skip_if_binaries_missing("ssh", "ssh-keygen", check_all=True), ] @pytest.fixture ...