text
stringlengths
957
885k
import datetime import random from collections import defaultdict from typing import List, Optional import django import pytz from annoying.fields import AutoOneToOneField from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.db.models.c...
import math import numpy as np from utlis import visualizeOutput from keras.models import Sequential from keras.layers.core import Dense from keras.datasets import cifar10 from keras.layers.convolutional import * # from keras.layers.normalization import BatchNormalization from keras.layers import Flatten, Dropout fr...
import functools import hashlib import pathlib from dataclasses import dataclass from typing import Any, Callable, Dict, List, Optional, Sequence from typing_extensions import Literal from .api import track from .utils import TrackType TileId = str Tile = Dict[str, Any] TilesetInfo = Dict[str, Any] DataType = Liter...
''' Created on 13/02/2012 @author: piranna ''' from unittest import main, TestCase from sqlparse.filters import IncludeStatement, Tokens2Unicode from sqlparse.lexer import tokenize import sys sys.path.insert(0, '..') from sqlparse.filters import compact from sqlparse.functions import getcolumns, getlimit, IsType ...
<filename>iceprod/server/rest/tasks.py import logging import json import uuid import math from collections import defaultdict import tornado.web import pymongo import motor from iceprod.core import dataclasses from iceprod.core.resources import Resources from iceprod.server.rest import RESTHandler, RESTHandlerSetup, ...
# Copyright 2014 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
<reponame>ilrd/Viral_Headlines import sys import os sys.path.append(os.getcwd()) import tensorflow as tf import numpy as np import pandas as pd from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences from sklearn.model_selection import train_test_spl...
<reponame>jessequinn/coursera_applied_data_science_with_python_specialization ''' https://github.com/henriquepgomide/caRtola All data was taken from caRtola's repository. ''' import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # concat several years of match data m2014 = ...
<reponame>tdilauro/pycallnumber from __future__ import unicode_literals from context import options # Fixtures, factories, and test data class TObjectWithOptions(options.ObjectWithOptions): options_defaults = { 'opt1': 'A', 'opt2': 'A', } opt2 = 'B' # Tests def test_OWO_init_normal_...
<reponame>liyemei/caffe2 from __future__ import absolute_import from __future__ import division from __future__ import print_function from caffe2.python.optimizer import ( build_sgd, build_multi_precision_sgd, build_ftrl, build_adagrad, build_adam, add_weight_decay, SgdOptimizer) from caffe2.python.optimizer_co...
<gh_stars>1000+ """ Module for the creation of composite quantum objects via the tensor product. """ __all__ = [ 'tensor', 'super_tensor', 'composite', 'tensor_swap', 'tensor_contract' ] import numpy as np import scipy.sparse as sp from qutip.cy.spmath import zcsr_kron from qutip.qobj import Qobj from qutip.permu...
<filename>agent.py import math import random from collections import deque import airsim import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from PIL import Image from setuptools import glob from env import DroneEnv from torch.utils.tensorboard imp...
import numpy as np from tqdm import tqdm import torch import pandas as pd class GradMinimizerBase(): def __init__(self, energy_fn, protein, num_steps=1000, log_interval=10): self.energy_fn = energy_fn self.protein = protein self.optimizer = None self.x_best = self.protein.coords ...
<filename>scripts/mcextract.py import json import numpy as np import itertools '''This module is used to extract Monte Carlo results from the *.results.json files provided in the data directory.''' class Observable: def __init__(self, num_tasks): self.rebinning_bin_length = np.zeros(num_tasks) sel...
import sys import numpy as np import torch from torch import nn from torch.autograd import Variable from util.holder import * from util.util import * # loss on frame id prediction class FrameLoss(torch.nn.Module): def __init__(self, opt, shared): super(FrameLoss, self).__init__() self.opt = opt self.shared = sh...
<gh_stars>1-10 import collections.abc from pathlib import Path from typing import Dict, List, Union import yaml from pytz import timezone class LatimesOutputFormatting: def __init__( self, time_format_string: str, different_time_joiner: str, aggregate_joiner: str, aggregat...
<reponame>cheshire3/cheshire3 from __future__ import absolute_import import os import re from subprocess import Popen, PIPE from cheshire3.baseObjects import DocumentFactory from cheshire3.document import StringDocument from cheshire3.utils import getFirstData, elementType, getShellResult from cheshire3.exceptions i...
# This file was *autogenerated* from the file mphase_mms_p2p1_stress_form.sage from sage.all_cmdline import * # import sage library _sage_const_2 = Integer(2); _sage_const_0 = Integer(0); _sage_const_2p5 = RealNumber('2.5'); _sage_const_0p25 = RealNumber('0.25'); _sage_const_1p0 = RealNumber('1.0'); _sage_const_0p0...
#!/usr/bin/env python # coding: utf-8 import pandas as pd import logging from amulog import config from logdag import log2event from . import evgen_common from . import filter_log _logger = logging.getLogger(__package__) FEATURE_MEASUREMENT = "log_feature" class LogEventDefinition(log2event.EventDefinition): ...
import numpy as np from n2v.utils import n2v_utils from n2v.utils.n2v_utils import tta_forward, tta_backward def test_get_subpatch(): patch = np.arange(100) patch.shape = (10, 10) subpatch_target = np.array([[11, 12, 13, 14, 15], [21, 22, 23, 24, 25], ...
import numpy as np import pandas as pd import copy from matplotlib import pylab as plt from sklearn.preprocessing import StandardScaler from xgboost.sklearn import XGBRegressor from sklearn.model_selection import cross_val_score, train_test_split, GridSearchCV def drop_duplicates(data): """ function: drop dup...
<reponame>sail-repos/PRIMA import numpy as np from keras.applications.vgg19 import VGG19 from keras.applications.vgg19 import preprocess_input import os import keras import sys from datautils import get_data,get_model,data_proprecessing def cos_distribution(cos_array): cos_distribute = [0 for i in range(10)...
<reponame>mozhumz/machine_learning_py<filename>demoDay22_decisionTree/data_processHyj.py import pandas as pd # import modin.pandas as pd import numpy as np # import ray.dataframe as pd2 import time #显示所有列 pd.set_option('display.max_columns', None) start_time=time.time() print('start_time:',start_time) input_dir = 'G:...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copy...
<reponame>londonkim/scout_apm_python # coding=utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import errno import hashlib import json import logging import os import subprocess import tarfile import time from urllib3.exceptions import HTTPError from scout_apm.compat import Co...
import numpy import torch import torch.nn as nn from NVLL.distribution.gauss import Gauss from NVLL.distribution.vmf_batch import vMF from NVLL.distribution.vmf_unif import unif_vMF from NVLL.distribution.vmf_hypvae import VmfDiff from NVLL.util.util import GVar from NVLL.util.util import check_dispersion numpy.rando...
""" Input and output specification dictionaries for FreeSurfer's recon_all_ script. .. _recon_all: https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all """ from django.conf import settings from traits.trait_types import String from django_analyses.models.input.definitions import (BooleanInputDefinition, ...
import math as m from typing_extensions import final import numpy as np import random from collections import deque from datetime import datetime from gradient_free_optimizers import HillClimbingOptimizer, StochasticHillClimbingOptimizer from snake_game import SnakeGame from helper import Helper from neural_network im...
<reponame>emmair/BirdsEye<filename>birdseye/rl_common/models.py """ These functions are adapted from github.com/Officium/RL-Experiments """ import torch import torch.nn as nn from torch.nn.functional import log_softmax from torch.optim import Adam from birdseye.rl_common.util import Flatten class SmallRFPFQnet(nn.Mo...
<reponame>mindgarage/Ovation import os from nose.tools import * import datasets from datasets.gersen import Gersen class TestGersenBatches(object): @classmethod def setup_class(self): self.g = Gersen(use_defaults=True) @classmethod def teardown_class(self): pass def test_load_da...
# @author: Ven # @data: 2020/10/3 # @brief: main program of DBM,run this script to keep away from BOTHER from UserSetting import * from DBM import JLU_Helper import time import random import argparse key_words = { 'Chinese':['此项必须填写','如有其它相关说明,请点击','确定','好','办理成功','确定'], 'English':['This field is required'...
# Autogenerated file. Do not edit. from jacdac.bus import Bus, BufferClient from jacdac.util import color_to_rgb from .constants import * from typing import List, Optional, Tuple, Union, cast class LedClient(BufferClient): """ A controller for small displays of individually controlled RGB LEDs. * *...
# import torch # import torch.nn as nn # import torch.nn.functional as F # class _ASPPModule(nn.Module): # def __init__(self, inplanes, planes, kernel_size, padding, dilation): # super(_ASPPModule, self).__init__() # self.atrous_conv = nn.Conv2d(inplanes, planes, kernel_size=kernel_size, # ...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name: 'Python 3.6.7 64-bit (''base'': conda)' # name: python367jvsc74a57bd050da0f6fa72fb86d...
# -*- coding:utf-8 -*- import tensorflow as tf import numpy as np from tensorflow.contrib.rnn import MultiRNNCell from tensorflow.contrib.rnn import RNNCell from zoneout import ZoneoutWrapper default_attn_size = 150 def bidirectional_GRU(inputs, inputs_len, cell=None, cell_fn=tf.contrib.rnn.GRUCell, units=default_at...
"""Active Directory authentication backend.""" from __future__ import absolute_import, unicode_literals import itertools import logging import dns from django.conf import settings from django.contrib.auth.models import User from django.utils.encoding import force_text from django.utils.translation import ugettext_la...
from __future__ import annotations import os import sys from datetime import datetime from typing import Any, Iterable import numpy as np import pandas as pd import torch from scipy.special import softmax from sklearn.metrics import ( accuracy_score, precision_recall_fscore_support, r2_score, roc_auc_...
<filename>src/pdc2/scripts/process_seq.py<gh_stars>1-10 """ Modify these following paths according to the location that each file are located: SRC_HOME APPS_HOME BLASTP_DB_PATH """ import os,sys import seq import gzip import shutil APPS_HOME = "/home/yangya/dmorales/apps/" # where trinity and trnasdecoder dirs are lo...
<filename>Numpy.py<gh_stars>0 import numpy as np import time import sys import os import matplotlib.pyplot as plt import cv2 import math # s = range(1000) # print(sys.getsizeof(5)*len(s)) # d = np.arange(1000) # print(d.size*d.itemsize) # ----------------------------------------------------------------- # size = 10000...
import tensorflow as tf from transformers_keras.modeling_albert import AlbertModel, AlbertPretrainedModel from transformers_keras.modeling_bert import BertModel, BertPretrainedModel class BertForSequenceClassification(BertPretrainedModel): """Bert for sequence classification""" def __init__( self, ...
<reponame>akanimax/rules-and-options # Run with: `python -m unittest discover` import unittest from ruleset import RuleSet, Options class Test(unittest.TestCase): def test_depends_aa(self): rs = RuleSet() rs.addDep("a", "a") self.assertTrue(rs.isCoherent(), "rs.isCoherent failed") ...
import numpy as np import contextlib from collections import deque from spirl.utils.general_utils import listdict2dictlist, AttrDict, ParamDict, obj2np from spirl.modules.variational_inference import MultivariateGaussian from spirl.rl.utils.reward_fcns import sparse_threshold class Sampler: """Collects rollouts ...
<gh_stars>0 import sys import numpy as np import scipy.signal from nptyping import NDArray from typing import Any from py2shpss import metric class HPSS(object): def __init__(self, mode : str = 'hm21', iter : int = 30, h_size : int = 1, p_size :...
<filename>Blog/views.py # -*- coding: UTF-8 -*- from django.shortcuts import render from django.views.generic.list import ListView from django.views.generic.detail import DetailView from Blog.models import Article, Category, Tag, BlogComment from Blog.forms import BlogCommentForm from markdown import markdown from djan...
import re, os, shutil import lookml.config as conf import lkml import github import base64 import requests import time, copy from string import Template import subprocess, os, platform ######### V3 ######### # TODO: implement length of field to be the number of it's properties (will help with formatting. Dense lookml...
<reponame>Blitzy29/vocabulary_learning import numpy as np import pandas as pd from Levenshtein import distance def create_vocab_features(vocab): vocab['levenshtein_distance_german_english'] = add_levenshtein_distance_german_english(vocab) vocab["nb_characters_german"] = vocab["german"].map(len) vocab["n...
<gh_stars>10-100 from config import * from header import * from flask import Flask, request, jsonify, make_response, session from deploy import * def create_app(): app = Flask(__name__) rerank_args = load_deploy_config('rerank') recall_args = load_deploy_config('recall') pipeline_args = load_deploy_co...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 <NAME> # # This file is part of a final year undergraduate project for # generating discrete text sequences using generative adversarial # networks (GANs) # # GNU GPL-3.0-or-later import os import re import sys import time import argparse import numpy ...
import MySQLdb import simplejson as json import sys, os import uuid from datetime import datetime from sync_orm import * sql_to_executes = [] is_new_create = False def _fromType(sqlType): if 'tiny' in sqlType: if 'unsigned' in sqlType: return 'utiny' else: return 'tiny' elif 'small' in s...
<filename>tests/test_20_messages.py import os.path import numpy as np # type: ignore import pytest from cfgrib import messages SAMPLE_DATA_FOLDER = os.path.join(os.path.dirname(__file__), "sample-data") TEST_DATA = os.path.join(SAMPLE_DATA_FOLDER, "era5-levels-members.grib") def test_Message_read(): with open...
#Auhtor: YP #Created: 2018-07-08 #Last updated: 2019-03-06 #A set of helper functions used by GPS that act as an interface between the redis database and the master and work processes of GPS. #The "cat format" is an update introcued on 2019-03-06. The format refers to taking in arrays of pts (the parameter point values...
<filename>tests/utils/test_solve_bruteforce.py # Copyright 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
<filename>src/bow_mnb/mnb.py<gh_stars>0 import glob import math import re from nltk.corpus import stopwords from nltk.stem import SnowballStemmer from sklearn import metrics # Utils from src.util.utils import * ''' Multinomial Naive Bayes - One method for training and testing, optional parameters - one line of code ...
<filename>tasks.py import os import sys import fcntl import datetime import json import re import time import zipfile import threading import hashlib import shutil import subprocess import pprint import random from invoke import task import boto3 import botocore.exceptions import multiprocessing import io import ai2tho...
<reponame>mcarans/hdx-scraper-covid-viz<gh_stars>0 import logging from copy import deepcopy import numpy import pandas as pd from hdx.location.country import Country from hdx.scraper.base_scraper import BaseScraper from hdx.utilities.text import number_format logger = logging.getLogger(__name__) class WHOCovid(Base...
# -*- coding: utf-8 -*- from openprocurement.auctions.core.utils import get_related_contract_of_award # AuctionAwardSwitchResourceTest def not_switch_verification_to_unsuccessful(self): auction = self.db.get(self.auction_id) auction['awards'][0]['verificationPeriod']['endDate'] = auction['awards'][0]['verific...
from scipy.ndimage import rotate from scipy.ndimage import zoom import numpy as np import cv2 import imutils from PIL import Image import Constants class Animations: def img_animation_zoom_in(self, orig_img, blur, fr=30): big_img_size = blur.shape ret_img = [] img_list = self.zoom_in_unt...
"""Schevo database, format 2.""" # Copyright (c) 2001-2009 ElevenCraft Inc. # See LICENSE for details. import sys from schevo.lib import optimize import operator import os import random try: import louie except ImportError: # Dummy module. class louie(object): @staticmethod def send(*arg...
<reponame>nejch/mkdocs-table-reader-plugin<gh_stars>0 """ Note that pytest offers a `tmp_path`. You can reproduce locally with ```python %load_ext autoreload %autoreload 2 import os import tempfile import shutil from pathlib import Path tmp_path = Path(tempfile.gettempdir()) / 'pytest-table-builder' if os.path.exists...
""" Kriging geographical data ------------------------- In this example we are going to interpolate actual temperature data from the German weather service `DWD <https://www.dwd.de/EN>`_. """ import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import gstools as gs border = np.loadtxt...
<filename>scripts/get-data.py<gh_stars>0 import json from urllib.request import urlopen from urllib.parse import urlencode from bs4 import BeautifulSoup import requests import sys, traceback from itertools import islice import codecs def check_url(url, entry): try: soup = BeautifulSoup( url...
import os from io import StringIO from core.factories import UnitFactory, UserFactory from exams.factories import ExamAttemptFactory, ExamFactory from otisweb.tests import OTISTestCase from roster.factories import StudentFactory from roster.models import Student from dashboard.factories import AchievementFactory, Ach...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs) # # 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/lice...
<filename>visualizer.py<gh_stars>1-10 #!/usr/bin/python import util import chordKMeans import sys import numpy as np import matplotlib import matplotlib.pyplot as plt import pylab import random import argparse BEATS_PER_BAR = 4 PLOT_BEATS_PER_BAR = 4 def readCentroids(fileName): with open(fileName, 'r') as f: ...
<reponame>security-geeks/userline # # Author: <NAME> (aka sch3m4) # @sch3m4 # https://github.com/thiber-org/userline # import sys import time import hashlib import collections from dateutil import parser as dateparser from elasticsearch_dsl import Search,Q,A from elasticsearch_dsl.connections import c...
#!/usr/bin/env python3 """ Update page with Wikimedia Commons picture of the day. The following parameters are supported: -always Don't prompt to save changes. &params; """ # Author : JJMC89 # License: MIT from datetime import datetime from typing import Any, Iterable, Set import mwparserfromhell import p...
#!/usr/bin/env python #this class is based on tutorial code from the following link: #https://www.pyimagesearch.com/2018/07/30/opencv-object-tracking/ import sys try: sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages') except Exceptio...
"""Schema definitions for `marketprice.messages.targeting_recommendation_engine` namespace. Generated by avro2py v.0.0.6.""" import datetime import decimal import enum from typing import List, NamedTuple, Union class TargetingRecommendationToEnricher(NamedTuple): """ Provides required information to the TRE s...
# -*- coding: utf-8 -*- """Provides GUIs to import data depending on the data source used, process and/or fit the data, and save everything to Excel. @author: <NAME> Created on May 5, 2020 Notes ----- The imports for the fitting and plotting guis are within their respective functions to reduce the time it takes for t...
<reponame>kyeongsoo/dnn-based_indoor_localization #!/usr/bin/env python3 # -*- coding: utf-8 -*- ## # @file ea-based_data_mapping.py # @author <NAME> (Joseph) Kim <<EMAIL>> # @date 2018-07-20 # # @brief Prototype evolutionary algorithm (EA)-based mapping of unstructured # data to 2-D images. # # ...
""" Utility functions used to download, open and display the contents of Wikimedia SQL dump files. """ import gzip import sys from contextlib import contextmanager from pathlib import Path from typing import Iterator, Optional, TextIO, Union from urllib.error import HTTPError import wget # type: ignore # Custom typ...
<reponame>kcleong/homeassistant-config import logging from typing import Optional from cryptography.fernet import InvalidToken from homeassistant.config_entries import ConfigEntry from ..clients.web_api import EdgeOSWebAPI from ..helpers import get_ha from ..helpers.const import * from ..managers.configuration_manag...
<reponame>bastings/interpretable_neural_predictions import os import time import torch import torch.optim from torch.optim import Adam from torch.optim.lr_scheduler import ReduceLROnPlateau, ExponentialLR import numpy as np import shutil from torch.utils.tensorboard import SummaryWriter from torchtext import data fro...
# coding=utf-8 # Copyright (c) 2017, 2018, Oracle and/or its affiliates. # Copyright (c) 2017, The PyPy Project # # The 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...
import faulthandler import io import logging.handlers import multiprocessing as mp import signal import sys import threading from collections import namedtuple from os import getenv from pathlib import Path from random import randint from zipfile import ZipFile import numpy as np import pytest from bioimageio.core.res...
<reponame>geraldhansen/certbot_dns_myonlineportal """DNS Authenticator for MyOnlinePortal.""" import json import logging import time import requests import zope.interface from certbot import errors from certbot import interfaces from certbot.plugins import dns_common logger = logging.getLogger(__name__) @zope.inte...
<filename>tests/game/test_reroll.py from tests.util import * def test_dodge_reroll_success(): game = get_game_turn() current_team = game.get_agent_team(game.actor) players = game.get_players_on_pitch(team=current_team) player = players[1] assert not player.has_skill(Skill.DODGE) # allow a tea...
<reponame>MatheusProla/Codestand<gh_stars>1-10 import datetime import glob import os import time from django.conf import settings from django.template.loader import render_to_string from ietf.message.models import Message, SendQueue from ietf.message.utils import send_scheduled_message_from_send_queue from ietf.doc.m...
""" Processing full slides with Fold 0 of pipeline v6: * data generation * training images (*0076*) * non-overlap training images (*0077*) * augmented training images (*0078*) * k-folds (*0079*) * segmentation * dmap (*0086*) * contour from dmap (0091) * classifier (*0088*) * segmentation correct...
# cython: profile=False print("Importing `.materials.database`") __doc__ = """ DATABASE DOCUMENTATION: https://www-nds.iaea.org/epics/DOCUMENTS/ENDL2002.pdf https://www-nds.iaea.org/epics/ """ __author__ = "<NAME>" #External Imports from numpy import * #array, geomspace, flip, load, searchsorted #Internal Imp...
""" A minimal mock for Resilient REST API To run with this mock class, in [resilient] section of app.config, set: resilient_mock=rc_cts.lib.resilient_mock.MyResilientMock """ import logging import requests import requests_mock from resilient.resilient_rest_mock import ResilientMock, resilient_endpoint LOG = lo...
#! /usr/bin/env python3 import os import shutil import jinja2 plugin_path = os.path.dirname(os.path.abspath(__file__)) templateLoader = jinja2.FileSystemLoader(searchpath=plugin_path) templateEnv = jinja2.Environment(loader=templateLoader) tm = templateEnv.get_template("plugin.jinja") mode = os.getenv("confgen_mode"...
<reponame>VoigtLab/MIT-BroadFoundry #!/usr/bin/env python """ Dialout barcodes from pool ========================== Allows for the extraction of barcodes from a pool where design structure is fixed. Will only search for perfect matches with references given. Refs are given in the form of regular expre...
#from dll_stack import Stack #from dll_queue import Queue import sys sys.path.append('../queue_and_stack') # lru_cache(maxsize=500) # least recently used (will purge if not lrc) # wraps another function HOC - behind the scenes # takes form of key value pairs # keep track of priority order can use other DS to help with...
<reponame>oryxsolutions/frappe<gh_stars>0 # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import frappe from frappe import _, msgprint from frappe.query_builder import DocType, Interval from frappe.query_builder.functions import Now from frappe.utils import cint, get_ur...
from config import parameters import requests from bs4 import BeautifulSoup import time import pickle import re import os import numpy as np from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfpage import PDFPage from pdfminer.pdfinterp import PDFResourceManager, PDFPa...
<filename>GP/python/restapi/admin/__init__.py # WARNING: much of this module is untested, this module makes permanent server configurations. # Use with caution! from __future__ import print_function import sys import os import fnmatch import datetime import json import urlparse from dateutil.relativedelta import relati...
<filename>pyshadow/main.py<gh_stars>0 from selenium.common.exceptions import ElementNotVisibleException from selenium.common.exceptions import WebDriverException from selenium.webdriver.chrome.webdriver import WebDriver as ChromeDriver from selenium.webdriver.firefox.webdriver import WebDriver as FirefoxDriver from sel...
# -*- coding: utf-8 -*- from dag_configuration import default_dag_args from trigger_k8s_cronjob import trigger_k8s_cronjob from walg_backups import create_backup_task from airflow.operators.dagrun_operator import TriggerDagRunOperator from airflow.operators.python_operator import PythonOperator from datetime import dat...
<reponame>sdadas/yast<gh_stars>1-10 from typing import Dict, List, Any import numpy as np from keras import Input from keras.engine import Layer from keras.initializers import RandomUniform from keras.layers import TimeDistributed, Embedding, Dropout, Conv1D, MaxPooling1D, Flatten, Bidirectional, CuDNNLSTM, \ Spat...
import functools import logging logger = logging.getLogger(__name__) class ExprCtx: def get_metrics(self, name: str, year: int, quarter: int): '''get metrics value Args: name: metrics name year: report year quarter: report quarter.from stockpy.1 to 4 R...
import os,sys import json import tensorflow as tf from utils import * from arguments import * args = get_args() msa_file = args.ALN npz_file = args.NPZ MDIR = args.MDIR n2d_layers = 61 n2d_filters = 64 window2d = 3 wmin = 0.8 ns = 21 a3m = parse_a3m(msa_file) contacts = {'...
<filename>tf_agents/agents/categorical_dqn/categorical_dqn_agent_test.py<gh_stars>0 # coding=utf-8 # Copyright 2018 The TF-Agents 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 # # ...
#!/usr/bin/env python3 ################################################################################ # parse arguments first import argparse import os build_dir = '../build/RelWithDebInfo' if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--min_3d_power', type=int, defaul...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Sep 07 17:20:19 2018 @author: <EMAIL> """ import argparse import os import socket import keras import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F import torch.optim ...
# -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # # This module was developed with funding provided by # the ESA Summer of Code (2011). # # pylint: disable=W0401,C0103,R0904,W0141 from __future__ import absolute_import, division, print_function """ This module provides a wrapper around the VSO API. """ import re i...
import importlib import json import structlog import pika import config from multiprocessing import Process from ServiceManager import ServiceInfo logger = structlog.get_logger() def attackCallback(ch, method, properties, body): """Pull service off of attack queue and run selected attack against it""" conne...
import functools import random import click from . import write_graph @click.group() def main(): """Graph generation commands""" pass def _common_options(func): """Common options used in all subcommands""" @main.command(context_settings=dict(show_default=True)) @click.option( "--outdi...
import sys import os import glob import time import skimage.color as sc from data import common import pickle import numpy as np import imageio import random import torch import torch.utils.data as data import cv2 class VSRData(data.Dataset): def __init__(self, args, name='', train=True): self.args = args...
""" License ------- Copyright (C) 2021 - <NAME> You can use this software, redistribute it, and/or modify it under the terms of the Creative Commons Attribution 4.0 International Public License. Explanation --------- This module contains the statistical model of the COVID-19 vaccination campaign described in a...