text
stringlengths
3.07k
12.6k
import pandas as pd import pandas as pd import numpy as np import gensim from gensim.utils import simple_preprocess from gensim.parsing import PorterStemmer from gensim.parsing.preprocessing import STOPWORDS from gensim.corpora import Dictionary from gensim.models import CoherenceModel from gensim.similarities.docsim i...
from capreolus.reranker.reranker import Reranker from capreolus.reranker.common import create_emb_layer from capreolus.extractor.embedtext import EmbedText import torch import torch.nn as nn import torch.nn.functional as F class DRMM_class(nn.Module): def __init__(self, embeddings, config): super(DRMM_cl...
import collections.abc import difflib import enum import gzip import io import lzma import os.path import pathlib from typing import Collection, Sequence, Callable, Union, Any, Tuple, TypeVar, Iterator, Dict, Optional import numpy as np import PIL.Image from torch.utils.data import IterDataPipe __all__ = [ "INFI...
import torch from dataset import HorseZebraDataset import sys from utils import save_checkpoint, load_checkpoint from torch.utils.data import DataLoader import torch.nn as nn import torch.optim as optim import config from tqdm import tqdm from torchvision.utils import save_image from discriminator_model import Discrimi...
#!/usr/bin/env python ''' Classes for reading images from video, folder, or web camera, and for writing images to video file. Main classes and functions: * Read: class ReadFromFolder class ReadFromVideo class ReadFromWebcam * Write: class VideoWriter * Display...
"""Utils for working with the parquet thrift models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from collections import OrderedDict from six import text_type from .thrift_structures import parquet_thrift def...
import json import logging import joblib import pandas as pd import yaml from igel.configs import configs from igel.data import metrics_dict, models_dict logger = logging.getLogger(__name__) def create_yaml(data, f): try: with open(f, "w") as yf: yaml.dump(data, yf, default_flow_style=False)...
import json import os.path import re import pytest from freshdesk.v2.api import API DOMAIN = 'pythonfreshdesk.freshdesk.com' API_KEY = 'MX4CEAw4FogInimEdRW2' class MockedAPI(API): def __init__(self, *args): self.resolver = { 'get': { re.compile(r'tickets\?filter=new_and_my_o...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from aenum import Enum, auto class EnumHelper(object): @staticmethod def enum_to_int(enum_obj): assert isinstance(enum_obj, Enum) return enum_ob...
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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 applic...
# Copyright (c) 2016 Cisco Systems 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 re...
# Copyright 2018 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 applica...
""" Template dispatcher module. A dispatcher is a function that can contains multiple behaviors. Its specific behavior is can be controlled by DispatchContext. DispatchContext is used in two ways, usually via different implementation of the DispatchContext base class. - During search, we can use it to pass the curre...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. """ tf2onnx.tf2onnx - sparse_softmax_cross_entropy_with_logits op conversion """ import numpy as np from onnx.onnx_pb import TensorProto from tf2onnx import utils from tf2onnx.function.range import make_range from tf2onnx.fun...
import pygame as pg white_pawn = pg.image.load("img/white_pawn.png") black_pawn = pg.image.load("img/black_pawn.png") white_pawn_outside = pg.image.load("img/white_pawn_outside.png") black_pawn_outside = pg.image.load("img/black_pawn_outside.png") dest_light_bottom = pg.image.load("img/dest_light_bottom.png") dest_l...
from __future__ import print_function # Analytic solution of EM fields due to a plane wave import numpy as np from scipy.constants import mu_0, epsilon_0 as eps_0 def getEHfields(m1d, sigma, freq, zd, scaleUD=True, scaleValue=1): """Analytic solution for MT 1D layered earth. Returns E and H fields. :param ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ######################################################################### # Copyright (c) 2016, UChicago Argonne, LLC. All rights reserved. # # # # Copyright 2015. UChicago Argonne, LLC. This...
""" test_util_nodes ~~~~~~~~~~~~~~~ Tests uti.nodes functions. :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from textwrap import dedent from typing import Any import pytest from docutils import frontend, nodes from docutils.parsers i...
#!/usr/bin/env python # Copyright 2014 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 optparse import os import sys import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARENT_DIR = os.path.dirn...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import re import subprocess import sys from distutils.version import StrictVersion from typing import Dict, List...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2018, Arm Limited and contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
"""show_platform.py """ import re from genie.metaparser import MetaParser from genie.metaparser.util.schemaengine import Schema, \ Any, \ Optional, \ Or, \ ...
import tensorflow as tf import tensorflow.contrib as tfc def conv_block(func, bottom, filters, kernel_size, strides=1, dilation_rate=1, name=None, reuse=None, reg=1e-4, apply_bn=True, apply_relu=True): with tf.variable_scope(name): conv_params = { 'padding': 'same', ...
import numpy as np import pandas as pd import lib.constants as c from math import isnan def get_nearest_in_dataframe(df, vals_to_search): index = df.index.get_loc(vals_to_search, "nearest") return df.iloc[index] def get_nearest_index_in_array(array, value): array = np.asarray(array) idx = (np.abs(ar...
""" Pipeline for text processing implementation """ import os from os import walk from pathlib import Path import re import string from constants import ASSETS_PATH from core_utils.article import Article from core_utils.article import ArtifactType class EmptyDirectoryError(Exception): """ No data to process ...
# Copyright 2020 DeepMind Technologies Limited. 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 ...
from typing import List, NamedTuple import pandas as pd from pyspark import SparkContext from pyspark.sql import SparkSession, Row from qanta import logging from qanta.datasets.quiz_bowl import Question, QuestionDatabase from qanta.guesser.abstract import AbstractGuesser from qanta.util.io import safe_path from qa...
import streamlit as st # To make things easier later, we're also importing numpy and pandas for # working with sample data. import numpy as np import pandas as pd import plotly.graph_objects as go import random import markov_tensor from fractions import Fraction st.title('拡散確率テーブル') st.sidebar.header("制御") st.sidebar....
""" Model factory. Add more description """ import copy import gym import torch import torch.nn as nn import torch.nn.functional as F from malib.utils.preprocessor import get_preprocessor from malib.utils.typing import Dict, Any def mlp(layers_config): layers = [] for j in range(len(layers_config) - 1): ...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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 us...
import os import re from daisy.tasks.Runner import Runner from daisy.toolkit import as_namedtuple import cgatcore.pipeline as P import cgatcore.experiment as E import cgatcore.iotools as IOTools class MetricRunner(Runner): action = "metric" # a list of tables that this metric will produce. # If not set...
from __future__ import print_function, absolute_import import os import gc import sys import time import math import argparse import os.path as osp import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader import models import transforms.spatial...
from django.conf import settings from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from django.core.exceptions import ObjectDoesNotExist from rest_framework import generics, status, filters from rest_framework.response import Response from rest_framework.reverse import reverse f...
import json import os import re import subprocess import time import platform import redis as redislib from flask import Flask, Response, abort, request, render_template import settings from forms import DeployForm, LoadtestForm app = Flask(__name__) os.environ['PYTHONUNBUFFERED'] = 'go time' servername = platform...
# coding: utf-8 from __future__ import unicode_literals from ...attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP from ..util import get_doc from ...vocab import Vocab from ...tokens import Doc import pytest import numpy def test_doc_token_api_strings(en_tokenizer): text = "Give it back! He...
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
# Copyright 2019 The Sonnet 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 applicable l...
import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets, transforms import torch.utils.data import numpy as np import math from copy import deepcopy import os import sys path = os.path.abspath(os.path.dirname(sys.argv[0])) def to_var(x, requires_grad=False): """ Au...
# Copyright 2017, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import os import requests import shutil import time import tarfile import tempfile from studio.artifacts import artifacts_tracker from studio.util import util def _find_ignore_list(local_path: str): if os.path.isdir(local_path): base_dir = local_path else: base_dir, last_name = os.path.split(l...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import chardet import os import re from ebooklib import epub from . import COVER_SUFFIX PAT_TITLE = r'^(#+)\s*(.*)\s*$' PAT_EMPTY = r'<p>\s*</p>' PAT_COMMENT = '!#' PAT_ALIGN_RIGHT = '#:' PAT_INLINE_IMAGE = r'!\[(.+)\]\((.+)\)' TEMPLATE_PARA = '<p>{0}<...
import pytest from discovery import api def sample_payload(): return { "Name": "my-query", "Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e", "Token": "", "Service": { "Service": "redis", "Failover": {"NearestN": 3, "Datacenters": ["dc1", "dc2"]}, ...
from flask import request, Blueprint from tracklater.utils import _str from datetime import datetime, timedelta, date import json import pytz from typing import Dict, Any from tracklater.database import db from tracklater.main import Parser from tracklater import settings from tracklater.models import Entry, Issue, Pr...
import numpy as np from source.postprocess.skin_model.node_model import Node class LineStructure: def __init__(self, params): """ initializing line structure with dofs """ # initializing beam info with param self.params = params self.beam_length = params["length"] ...
#!/usr/bin/env python import click import re from click import group, pass_context, option, argument, command, echo from click import Context from pprint import pprint from cira_am import util, api, config from cira_am import config def validate_fqdn(ctx, param, value): if value == 'rights': return vali...
import os import sys from mock import patch import setupmeta from setupmeta.model import Definition, DefinitionEntry, is_setup_py_path from . import conftest def test_first_word(): assert setupmeta.relative_path(None) is None assert setupmeta.relative_path("") == "" assert setupmeta.relative_path("foo"...
"""Test class for metadata generator lambda""" from datetime import datetime import boto3 from moto import mock_s3 @mock_s3 def _setup_s3(): s3 = boto3.resource("s3") bucket = s3.Bucket("covid-eo-data") bucket.create() s3_keys = [ ("indicators/test/super.csv", b"test"), ("xco2-mean/...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import io import json import os import pprint as pp import sys installpath = os.path.dirname(os.path.realpath(__file__)) replace_set = [ ('·', '/'), # \xb7 ('․', '/'), # \u2024 ('ㆍ', '/'), # ...
# -*- coding:utf-8 -*- ############################################################################# # Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms # and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan P...
import json, subprocess, time, traceback from hwilib.serializations import PSBT from hwilib.commands import get_client, enumerate as hwi_enumerate from hwilib import bech32 from .specter_hwi import SpecterClient, enumerate as specter_enumerate def _enumerate(): """Standard HWI enumerate() command + Specter.""" ...
#!/usr/bin/env python """ Perform dense downsampling over indicated segmentation intervals. Author: <NAME> Contact: <EMAIL> Date: 2015, 2021 """ from datetime import datetime from os import path from tqdm import tqdm import argparse import numpy as np import pickle import scipy.signal as signal import sys output_di...
# -*- coding: utf-8 -*- """ Created on Thu May 21 13:41:35 2020 @author: Fernando Create a Convolutional neural network to distinguish and classify cats and dogs into 2 classes This CNN is using Keras and Tensorflow # pip install --update keras It is composed by 2 parts + 1 optional The Part 1 is composed by 4 ste...
# -*- coding: utf-8 -*- """ FLAccessControlFactory Module. Manage ACLs between different application objects. """ from PyQt5 import QtWidgets # type: ignore from pineboolib.application.metadata.pntablemetadata import PNTableMetaData from pineboolib.application import project from pineboolib.fllegacy.flaccesscontrol...
#!/usr/bin/env python from __future__ import print_function import sys, os from collections import defaultdict from math import ceil, pi, log import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True ROOT.gROOT.SetBatch(True) from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM, NoPlot, Plot1D, Count1D, shortDump fr...
# -*- coding: utf-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm class SpanMLP(nn.Module): def __init__(self, span_length): super(SpanMLP, self).__init__() self.lin1 = nn.Linear(span_length, 32) self.tanh1 = nn.Tanh() self.lin2 = nn.Linear(...
#!/usr/bin/env python """ Fill the "player_prediction" table with score predictions Usage: python fill_predictedscore_table.py --weeks_ahead <nweeks> Generates a "tag" string which is stored so it can later be used by team-optimizers to get consistent sets of predictions from the database. """ from uuid import uuid4 i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Converts the JSON dump into XLSX files. # # Written in 2020 by <NAME> # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software is distributed w...
#!/usr/bin/env python """ Analyzes resulting output """ import numpy as np import pandas as pd import seaborn as sn import matplotlib.pyplot as plt def read_sites_file(sample: str, settings: "runner.Settings") -> pd.DataFrame: return pd.read_csv(f"{settings.path}{sample}_sites.txt", sep="\t") def read_summary_t...
"""Miscellaneous utilities.""" from functools import reduce import os import os.path as op import subprocess import warnings import numpy as np from mne import pick_types, pick_info, make_sphere_model, DipoleFixed, Epochs from mne.channels import make_standard_montage, make_dig_montage from mne.fixes import _get_args...
""" @brief Compute charge transfer (in)efficiency. @author <NAME> <<EMAIL>> """ import os import astropy.io.fits as fits from lsst.eotest.fitsTools import fitsWriteto import lsst.eotest.image_utils as imutils from .AmplifierGeometry import makeAmplifierGeometry from .EOTestResults import EOTestResults from .eperTask i...
import asyncio, discord, re from discord.ext import commands from cogs import Nullify # bot = None # url_regex = re.compile(r"(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?") def setup(bot): # This module isn't actually a cog - but it is a place # we can call "a trash fire" b...
import random import time import json import requests # Initial Steps to invite in the game: print("\nWelcome to Hangman game by <NAME>!\n") name = input("Enter your name: ") print(f"Hello {name.capitalize()}! The game is about to start! \nBest of Luck!") time.sleep(1.5) print() time.sleep(1.5) print("You can guess 4 ...
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo # Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # https://www.eclipse.org/legal/epl-2....
""" Test TorsionScanSet """ from torsionfit.tests.utils import get_fn import torsionfit.database.qmdatabase as qmdb from cclib.parser import Gaussian from cclib.parser.utils import convertor from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal from parmed.charmm import CharmmParameterSet imp...
import json import os from datetime import datetime, timedelta import config from exchange_rates.util import get_local_exchange_rate, get_first_market_price_date from manage_transactions import get_first_transaction_timestamp, get_transaction_data from util import logging BASE_DIRECTORY = '/market-data/raw/balance_da...
from stable_baselines3.common.env_util import make_atari_env from stable_baselines3.common.vec_env import VecFrameStack from stable_baselines3 import PPO from easy_logx.easy_logx import EasyLog import os import time import gym from typing import Any, List, Tuple from easy_logx.easy_logx import EasyLog import...
# Implementation of # <NAME>, <NAME>, and <NAME>, “A Deep Multitask Learning Framework Coupling Semantic Segmentation and Fully Convolutional LSTM Networks for Urban Change Detection,” IEEE Trans. Geosci. Remote Sensing, vol. 59, no. 9, pp. 7651–7668, 2021, doi: 10.1109/TGRS.2021.3055584. # Transferred from https://gi...
# import packages import os from Read import read_intlen_hys, read_intro from SVM import svm_train, svm_predict import shutil import math from Visual import visual_block # 排序 def intlen_sort(acc_value): arr = [] for i in acc_value: arr.append(i) index = [] for i in range(len(arr...
# Copyright (c) 2020-2022 The PyUnity Team # This file is licensed under the MIT License. # See https://docs.pyunity.x10.bz/en/latest/license.html """ A module used to load the window providers. The window is provided by one of three providers: GLFW, PySDL2 and GLUT. When you first import PyUnity, it checks ...
import datetime as datetime_mod import re import time as time_mod import urlparse # local imports from cleanliness import exception from cleanliness import encoding # Cleaners EMPTY_VALUES = (None, '') def string_length(value, message="Must be between %(max)s and %(min)s characters", ...
# # 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...
# Copyright 2021 Efabless Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# ============================================================================= # Titre : Principal.py # Description : Librairie permettant d'encoder et de décoder des chaines selon # divers types d'encodage. # Auteur : <NAME> # Date : 2015/02/23 # Version : 1.0 # Usage : python3 Principal.py # Notes : # python_versio...
# 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 copy import deepcopy import os import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as util import pandas from typing import List from torch.utils.tensorboard import SummaryWriter from .hyperparameters.Parameters import Params from pytorch_lightning import loggers as pl_loggers fr...
#!/usr/bin/env python3 # author : <NAME> # date : 13.07.16 # license : BSD-3 #============================================================================== __author__ = 'pavel' import os import sys import gzip import pickle from rdkit import Chem from rdkit.Chem.PropertyMol import Propert...
import pickle import sys from dataclasses import dataclass import tensorflow as tf import tensorflow_hub as hub from absl import logging from smart_arg import arg_suite from detext.layers import embedding_layer from detext.utils.layer_utils import get_sorted_dict from detext.utils.parsing_utils import InternalFtrType...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. <NAME> (<EMAIL>), # Prof. <NAME> (<EMAIL>) and the RMG Team (<EMAIL>) # # Permission is hereby granted, free of ch...
"""The Flux LED/MagicLight integration discovery.""" from __future__ import annotations import asyncio from collections.abc import Mapping import logging from typing import Any, Final from flux_led.aioscanner import AIOBulbScanner from flux_led.const import ( ATTR_ID, ATTR_IPADDR, ATTR_MODEL, ATTR_MOD...
""" Provide a command-line argument parsing function using argparse (resulting in the following help message): -------------------------------------------------------------------------------- usage: battleground [-h] [-V] [-H HOST] [-P PORT] [-D] [-v [{0,1,2,3}]] [-l [LOGFILE]] ...
# 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 agreed to in writing, ...
import tuio import threading from tuio.objects import Tuio2DCursor from tuio.objects import Tuio2DObject class _TuioCallbackListener(tuio.observer.AbstractListener): """ Private Helper Class to react on Tuio Events we get from pytuio Sorry, this is very hackish to get things done... notify is c...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2019 luozw, Inc. All Rights Reserved Authors: luozhiwang(<EMAIL>) Date: 2020/9/7 """ import os import argparse import numpy as np import torch import torch.nn as nn import torch_pruning as tp import copy import matplotlib.pyplot as plt from models.yolo im...
# -*- coding: utf-8 -*- # Copyright 2015 basebuilder 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 os import shutil from utils import replace class Frontend(object): def __init__(self, configuration, application): ...
# -*- coding: utf-8 -*- # Copyright 2019 <NAME> # MIT License (https://opensource.org/licenses/MIT) """Utility functions.""" import fnmatch import logging import os import sys import librosa import h5py import numpy as np def find_files(root_dir, query="*.wav", include_root_dir=True): """Find files recursive...
## # The MIT License (MIT) # # Copyright (c) 2015 Frankly Inc. # # 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, m...
from django.conf.urls import include, url from django.core.urlresolvers import reverse from django.conf.urls.static import static from django.conf import settings from django.http import HttpResponseRedirect from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib.flatpages.views import f...
import numpy as np import copy try: from tqdm import tqdm except ImportError: pass eps = 1e-6 def jacobian(f, p, **kwargs): ''' Finds the Jacobian matrix of the function f at the point p. Arguments --------- f : callable A function F^n -> F^m (F = R or C); takes in an n-length num...
# coding=utf-8 # # * RECODE? OKE GAK MASSALAH # * TAPI YA JANGAN DI JUAL KONTOL # ############################################################ # Name : Moonton Account Checker # # File : proxy.py # # Author : DulLah ...
from mss import mss # Takes a screenshot of monitor from features.lib.helpers.rp_driver import (start_launcher, start_feature_test, timestamp, start_scenario_test, log_step_result, finish_launcher, terminate_service, finish_scen...
import torch import argparse from train import * import time import os import matplotlib.pyplot as plt def set_interact_args(): """ Sets up the training arguments. """ parser = argparse.ArgumentParser() parser.add_argument( "--data_type", default="Reuters2000", type=str, required=False,...
import tkinter import sqlite3 conn=sqlite3.connect("MDBA.db") rootAA=None def set(): global e3,e1,e2,e4,e5,e6,conn p1=e1.get() p2=e2.get() p3=e3.get(tkinter.ACTIVE) p4=e4.get() p5=e5.get() p6=e6.get(1.0,tkinter.END) conn = sqlite3.connect("MDBA.db") conn.execute("Insert into appoint...
# -*- coding: utf-8 -*- """ Some functions to convert between Dekatrian and Gregorian calendar. @author: Pena 11\10\2017 dekatrian.com """ def Dek2week(dekDay, dekMonth, dekYear): """ Returns the Gregorian week day from a Dekatrian date. 1 = Sunday; 2 = Monday; 3 = Tuesday ... 7 = Saturday. """ we...
# -*- coding: utf-8 -*- # # 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 #...
import asyncio import ccxt.async_support as ccxt import time import os import sys from pprint import pprint import statistics as st import logging root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') MAIN_EXCHANGES = [ 'binance', 'bitfinex', 'bittre...
################################################## ## Author: {<NAME>} ## Maintainer: {<NAME>} ## Email: {<EMAIL>} ################################################## #!/usr/bin/python3.8 import json, tempfile import os from functools import wraps import ast import pandas as pd from flask import Flask, jsonify, render...
# Log into Reddit and download the highest rated wallpaper import argparse import hashlib import os import praw import requests from urllib.parse import urlparse import shutil import sys import tempfile def get_system_info(): """ Return os and desktop information Param: None Return: os_name - name of ...
"""Calculate graph edge speeds and travel times.""" import re import networkx as nx import numpy as np import pandas as pd from . import utils_graph def add_edge_speeds(G, hwy_speeds=None, fallback=None, precision=1): """ Add edge speeds (km per hour) to graph as new `speed_kph` edge attributes. Imput...
#!/usr/bin/python3 import sys import time import ctypes fullscreen = True sys.path.append("./shared") from sbmloader import SBMObject # location of sbm file format loader from ktxloader import KTXObject # location of ktx file format loader from textoverlay import OVERLAY_ from shader import shader_...