text
stringlengths
957
885k
import argparse import os import sys ############################################## parser = argparse.ArgumentParser() parser.add_argument('--epochs', type=int, default=10) parser.add_argument('--batch_size', type=int, default=64) parser.add_argument('--lr', type=float, default=1e-2) parser.add_argument('--eps', ty...
<gh_stars>0 # Generated by Django 2.2.5 on 2020-10-13 02:44 import ckeditor_uploader.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
<reponame>sarah-keren/MAC<filename>src/control/evaluate.py import sys import itertools import numpy as np import matplotlib.pyplot as plt sys.path.append('../src') from control.controller_decentralized import Decentralized from control.controller_decentralized_RL import DecentralizedRL from control.controller_centraliz...
<reponame>janwillembuist/SeismicPro """Implements Muter class to define a boundary above which gather values will be zeroed out""" import numpy as np from scipy.interpolate import interp1d from sklearn.linear_model import LinearRegression from .utils import read_single_vfunc class Muter: """A class to define an...
from tensorflow.keras.optimizers import Adam, SGD from tensorflow.keras.callbacks import EarlyStopping import pandas as pd import numpy as np import os from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from library.feature_engineering import encode_source_labels, create_tok...
<reponame>ganeshdg95/Privacy-and-Performance-in-Power-Consumption-Curve-Generation-with-GANs #!/usr/bin/env python # coding: utf-8 # In[ ]: import numpy as np from scipy.stats import wasserstein_distance as EMD # This function computes the empirical distributions of the indicators for natural (real) and artificial (...
<reponame>epicfaace/GCMW from .util import calculate_price # def coupon_code_verify_max(form, code, responseId=None): # # True: coupon code can be used (either length of coupon codes used is not at max, or your ID has already used the coupon code before.) # # If maximum is negative, that means there is no maxi...
<reponame>DreamsofPeace/Cisco-Firmware-Sort from iosutils import product,imagelookup,iostrain,utilssinglemove,utilssingleprodname,utils_dev_v2_vf_imagecode,utils_dev_imagecode_v2_vf from iosutils import filemove,filepath2,filepath3,filepath4,filepath5 from iosutils import util2digit,util3digit,util4digit,util5digit,str...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python CopyRight = ''' /************************************************************************** * * Copyright 2010 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "...
<reponame>yangchengtest/onnx-tf-atlas from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import copy import inspect import tensorflow as tf from onnx_tf.common import IS_PYTHON3 from onnx_tf.common import get_data_forma...
# Copyright 2014 SolidBuilds.com. All rights reserved # # Authors: <NAME> <<EMAIL>> from flask import Blueprint, redirect, render_template from flask import request, url_for from flask_user import current_user, login_required, roles_required from app import db from app.models.employee_models import EmployeeProfileFo...
<gh_stars>10-100 import os import sys import json import unittest import numpy as np from skimage.morphology import label from elf.evaluation import rand_index import luigi import z5py import nifty.tools as nt try: from ..base import BaseTest except ValueError: sys.path.append('..') from base import Base...
# -*- coding: utf-8 -*- # (C) Copyright IBM Corp. 2020. # # 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...
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, division from eight import * from bw2analyzer.sc_graph import GTManipulator from bw2data import ( Database, databases, geomapping, mapping, methods, projects, ) from bw2data.tests import BW2DataTest import unittest...
# (C) Copyright IBM Corp. 2019, 2020. # # 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...
import numpy as np def generate_cosmic_rays( shape, mean_cosmic_rays=10, min_length=10, max_length=30, rng=None): """Generate a binary mask w/ cosmic rays. This routine generates cosmic rays by choosing a random position in the image, a random angle, and a random length of the cosmic ...
import random from eth_utils import ( encode_hex, ) import hypothesis.strategies as st from eth_abi.utils.numeric import ( scale_places, ) total_bits = st.integers(min_value=1, max_value=32).map(lambda n: n * 8) frac_places = st.integers(min_value=1, max_value=80) bytes_sizes = st.integers(min_value=1, max_v...
from typing import List, Union, Optional import os import requests import re import time import pandas as pd from selenium import webdriver from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup class PatentDownloader: url = "https://patents.google.com" def __init__(self, chro...
#!/usr/bin/env python # -*- coding: utf-8 -*- from bowtie.visual import Plotly, SmartGrid from bowtie.control import Slider, Number, Button from bowtie import cache, command, Pager import numpy as np import plotlywrapper as pw import plotly.graph_objs as go pager = Pager() # # Initialize our values # # This prevents ...
import random import os import json import pandas as pd import numpy as np import svgwrite from IPython.display import display, HTML here = os.path.abspath(os.path.dirname(__file__)) class RelationExtractionVisualizer: def __init__(self): self.color_dict = { "overlap" : "light...
# Copyright 2012 by <NAME>. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Bio.SearchIO parser for BLAST+ XML output formats.""" # for more info: http://www.ncbi.nlm.nih.gov...
<filename>mining/temp-processing/data-deal-and-draw-graph.py<gh_stars>1-10 from pyecharts import options as opts from pyecharts.globals import GeoType from pyecharts.charts import Line3D, Scatter3D, Geo import csv import time def read_csv(filename): """读取csv文件""" with open(filename, newline='') as csvfile: ...
from django.shortcuts import render,redirect,HttpResponseRedirect,reverse from django.urls import reverse from django.contrib.auth.decorators import login_required from apps.student.models import Student,StudentList from django.conf import settings from django.views.generic.list import ListView from ..classes.models im...
<reponame>ystk/debian-python3.1 # asciixmas # December 1989 <NAME> Indianapolis, IN # # $Id: xmas.py 46754 2006-06-08 15:35:45Z thomas.wouters $ # # I'm dreaming of an ascii character-based monochrome Christmas, # Just like the ones I used to know! # Via a full duplex communications channel, # At ...
<gh_stars>1-10 #!/usr/bin/env python3 import optparse import os import sys from distutils.spawn import find_executable import chpl_platform, chpl_locale_model, overrides from utils import error, memoize, warning # # If we can't find a file $CHPL_HOME/make/Makefile.<compiler_val>, # that suggests that this is a comp...
import numpy as np import numpy.ma as ma import logging #Own imports from . import inout class MicroscopeData: """Retrieves and stores the tile set and corner coordinates of each tile from raw coordinate input. Parameters: ----------- y_flip: bool It is assumed that the microscope ...
<gh_stars>10-100 # Distributed under MIT License # Copyright (c) 2021 <NAME> # historically based on : # https://github.com/robert-hh/FTP-Server-for-ESP8266-ESP32-and-PYBD/blob/master/ftp.py # but I have modified a lot, there must still be some original functions. """ Ftp server implementation core class """ import soc...
# 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...
from lib.datasets import MNIST as Data from lib.model import Model as BaseModel, generate_placeholders, train from lib.segmentation import extract_features_fixed # from lib.segmentation import slic_fixed from lib.segmentation import quickshift_fixed from lib.pipeline import preprocess_pipeline_fixed from lib.layer impo...
from yacs.config import CfgNode as CN #--------------------------ECG OPTIONS ------------------------ #-------------------------------------------------------------- _C = CN(new_allowed=True) cfg = _C #------------SAMPLING RATE--------- _C.FS = 500 _C.FS_RESAMPLE = 360 _C.ROUND = 3 #--------------------------------...
import functools import hashlib import json import random from urlparse import urlparse import uuid from operator import attrgetter from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import get_list_or_404, get_object_or_404, redirect from django.utils.transla...
<reponame>MarcelRaschke/dactyl #!/usr/bin/env python3 from dactyl.common import * import argparse class DactylCLIParser: UTIL_BUILD = "Generate static site from markdown and templates." UTIL_LINKS = "Check files in this repository for broken links." UTIL_STYLE = "Check content files for style issues." ...
# Copyright (c) 2020 Spanish National Research Council # # 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 ...
<gh_stars>1-10 import math from enum import Enum from functools import total_ordering # TODO different fees to lp holders and swap operation class Fee(Enum): """ ``Fee`` Enum class defines available fees for UniV3 pools. Currently 3 values are available: 0.05%, 0.3%, 1%. The actual enum values are fe...
<gh_stars>0 """ Django settings for backend project. Generated by 'django-admin startproject' using Django 2.1. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ im...
#!/usr/bin/env python # Copyright (c) 2012, Adobe Systems Incorporated # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright not...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_tool_wappalyzer # Purpose: SpiderFoot plug-in for using the 'Wappalyzer' tool. # Tool: https://github.com/EnableSecurity/wappalyzer # # Author: <NAME> <<EMAIL>> # # Creat...
import aria2p import os import time import telebot from telebot import types import subprocess import sys import platform import ctypes import re Telegram_bot_api=os.environ.get('Telegram_bot_api') Aria2_host=os.environ.get('Aria2_host') Aria2_port="8080" Aria2_secret=os.environ.get('Aria2_secret') bot = telebot.TeleB...
<filename>multienum.py """MultiEnum class for enumerations for multiple equivalent names. Full documentation is in the README. At present, this has only been tested in CPython 3.4, although it should work for any recent version which allows subclassing of the core int type. """ # pylint: disable=W0212,E1101 class ...
import re # enquanto search retorna um objeto match do primeiro texto correspondente na string pesquisada, # o metodo findall() retorna as strings todas as correspondencias na string pesquisada. phoneNumRegex = re.compile(r'\d\d\d-\d\d\d-\d\d\d\d') mo = phoneNumRegex.search('Cell: 415-555-9999 Work: 212-555-0000') pr...
<gh_stars>1-10 #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import time from typing import ClassVar, Dict, List import torch from habitat import Config, ...
<filename>dreamwidget/boshclient_foo.py<gh_stars>0 # Original source https://friendpaste.com/1R4PCcqaSWiBsveoiq3HSy # Copied at 2012-11-12 # Modified to suit our needs import httplib, sys, random from urlparse import urlparse from xml.dom import minidom class BOSHClient: def __init__(self, jid, password, bosh_...
<gh_stars>1-10 from enum import Enum import re, os MAX_FCN = 65 FUNCTION_REGEX_SOURCE = "\s*(inline|)\s*\w*(::\w*(<\w*>|)|)(&|)(\*|) \w*(::\w*(<\w*>|)|)([\[\]<>+=\-\*\/]*|)\([a-zA-Z0-9_\*<>&:, ]*\) (const|) {" ACCEPT_COMMENT_REGEX = "\s*\/\/[\s[A-Za-z0-9,\.-]*]*$" CLASS_FIND_REGEX = "class \w* {" ALLOW_NO_HEADER = ...
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # 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...
<reponame>khchine5/xl<filename>lino_xl/lib/cal/ui.py # -*- coding: UTF-8 -*- # Copyright 2011-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) from __future__ import unicode_literals from builtins import str from collections import OrderedDict from django.conf import settings from django.db import m...
<filename>scripts/supervised/.~c9_invoke_vRCWi.py """ Author: <NAME> Note that this script only applies to Box3dReachPixel environments """ from sandbox.rocky.tf.envs.base import TfEnv from rllab.envs.gym_env import GymEnv from rllab.envs.normalized_env import normalize from rllab.misc import logger from railrl.predi...
import numpy as np import torch from PIL import Image from random import random from scipy.ndimage import geometric_transform from numpy import * from torchvision import transforms from mobius_transformation import Mobius from mobius_mask import Mobius_mask from util.cutout import Cutout #np.random.seed(0) class sup...
<reponame>matthewmichihara/shiritori from collections import namedtuple from flask import Flask from flask import request from flask_cors import CORS from google.cloud import datastore from word import entity_to_word from word import pick_your_word from word import fetch_opponent_word from word import Word from romaji_...
<filename>UIWindows/UIDataloaderWindow.py ''' Copyright [2020] Hahn-Schickard-Gesellschaft für angewandte Forschung e.V., <NAME> + <NAME> Copyright [2021] Karlsruhe Institute of Technology, <NAME> SPDX-License-Identifier: Apache-2.0 ===============================================================================...
<reponame>heynemann/ea import random import math from deap import base, tools SMART_ALGO = False def drawBoard(board): # This function prints out the board that it was passed. board = [item or ' ' for item in board] message = "" # "board" is a list of 10 strings representing the board (ignore ind...
import configparser # CONFIG config = configparser.ConfigParser() config.read('dwh.cfg') dwh_role_arn = config.get("IAM_ROLE", "ARN") log_data = config['S3']['LOG_DATA'] log_jsonpath = config['S3']['LOG_JSONPATH'] song_data = config['S3']['SONG_DATA'] # DROP TABLES staging_events_table_drop = "DROP TABLE IF EXISTS ...
<filename>tests/test_checkParamTableModel.py from unittest import TestCase import logging import os import systemcheck.models as models from systemcheck.checks.models.checks import Check from systemcheck.gui.models import GenericTreeModel from systemcheck.models.meta.base import engine_from_config, scoped_session, sess...
from django.views.generic import View from games.models import GameTime from django.contrib.auth import get_user_model from base_user.tools.common import game_session_generate from games.models import LeaderBoard import facebook User = get_user_model() class UserGameSessionIdCheck(View): """ Check user se...
import pytest import responses from django.forms import model_to_dict from django.test import Client from model_bakery import baker from pollaris.app.models import SearchLog from pollaris.app.tests.test_utils import ( GOOGLE_GEOCODE_URL_GENERIC, SMARTY_URL_GENERIC, check_search_log, get_string_search, ...
""" FIXME module add docstrings """ from unittest import TestCase, main from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClassifier from sklearn.ensemble import RandomForestClassif...
<filename>trRosetta/features.py<gh_stars>10-100 import numpy as np import tensorflow as tf # reweight MSA based on cutoff def reweight(msa1hot, cutoff): with tf.name_scope('reweight'): id_min = tf.cast(tf.shape(msa1hot)[1], tf.float32) * cutoff id_mtx = tf.tensordot(msa1hot, msa1hot, [[1,2], [1,2]...
import os, ntpath from treelib import Tree from gensim.models import KeyedVectors import matplotlib.pyplot as plt import numpy as np plt.style.use('seaborn-paper') class ParentChildEvaluate: """ Class to perform intrinsic evaluation of embeddings using the hierarchical relation of parent/child domains 1) parse ...
import itertools import datetime import pandas as pd import numpy as np import requests import math import os import warnings import torch import multiprocessing import GPUtil from torch import nn from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader from sklearn.model_selection import tr...
<gh_stars>0 # Ignoring some linting rules in tests # pylint: disable=redefined-outer-name # pylint: disable=missing-docstring import numpy as np import pytest from bingo.symbolic_regression.agraph.operator_definitions import * from bingo.symbolic_regression.agraph.evaluation_backend \ import evaluation_backend as ...
<filename>djforms/communications/printrequest/models.py # -*- coding: utf-8 -*- from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.utils.safestring import mark_safe from djtools.fields.helpers import upload_to_path FORMATS = ( ('Booklet / Event ...
#!/usr/bin/env python import os import sys sys.path.insert(1, os.path.abspath('..')) #--------------------------------------------------------------------------------------------------- # SYNTHESIS OF POLYNOMIALS IN NIA #----------------------------------------------------------------...
<reponame>iwaseyusuke/python-ovs-vsctl<gh_stars>1-10 # Copyright (C) 2016 <NAME> <iw<EMAIL>> # # 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 ...
# # Copyright (c) 2015, <NAME> <<EMAIL>> # Pypsi - https://github.com/ameily/pypsi # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS...
<reponame>HenriqueBraz/app_flask import logging import json from datetime import datetime import pymysql class GraficoModel(object): def __init__(self): with open('config.json') as f: conf = json.load(f) self.host = conf['mysql']['host'] self.port = conf['mysql']['port'] ...
<reponame>sreesxlnc/kaggle-right-whale """ ipython -i --pdb scripts/train_model.py -- --model cropped_dec19 --data 128_20151029 --use_cropped --as_grey --overwrite --no_test """ import numpy as np from lasagne.layers import dnn import lasagne as nn import theano.tensor as T import theano from nolearn.lasagne import ...
<filename>RS/libera5.py import os import netCDF4 import cdsapi import numpy as np import matplotlib import matplotlib.pyplot as plt def download_ERA5_bbox(i_year, out_dir, prefix, north, west, south, east): c = cdsapi.Client() c.retrieve( 'reanalysis-era5-single-levels', { 'product_type': 'rean...
<reponame>hotsyk/vulyk-declaration<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import codecs import json import sys import re sys.stdout = codecs.getwriter('utf8')(sys.stdout) lists = {} fields = [] current_answer = {} REGIONS_MAP = { "ukraine": "Загальнод...
"""View of Graphs as SubGraph, Reverse, Directed, Undirected. In some algorithms it is convenient to temporarily morph a graph to exclude some nodes or edges. It should be better to do that via a view than to remove and then re-add. In other algorithms it is convenient to temporarily morph a graph to reverse directed e...
# -*- coding: utf-8 -*- # vim:set ts=4 sw=4 et: # # Copyright 2014 <NAME>. # # This file is part of the mavros package and subject to the license terms # in the top-level LICENSE file of the mavros repository. # https://github.com/mavlink/mavros/tree/master/LICENSE.md import csv import time import rospy import mavros ...
<reponame>rdo-infra/releng #! /usr/bin/python3 # # Mostly copied code from find_unblocked_orphans.py in fedora # # Credits to original authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Copyright (c) 2009-2013 Red Hat # SPDX-License-Identifier: GPL-2.0 # # From: # https://pagure.io/releng/blob/main/f/scripts/fi...
from pprint import pprint import pickle from tqdm import tqdm import json from collections import defaultdict import native_api_utils import classes import config import utils incident_types=config.incident_types languages_list=config.languages_list def get_additional_reference_texts(ref_texts, found_names, found_la...
<filename>scripts/usufy.py ################################################################################ # # Copyright 2015-2021 <NAME> and <NAME> # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # ...
<filename>paas-ce/paas/paas/common/tests.py<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT L...
# # 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, software # distributed under ...
<filename>test_QA/browser/test_API_Browser_in_AWS.py from osbot_aws.apis.Lambda import Lambda from osbot_aws.apis.shell.Lambda_Shell import Lambda_Shell from osbot_aws.helpers.Lambda_Package import Lambda_Package from osbot_aws.helpers.Test_Helper import Test_Helper from osbot_utils.decorators.lists.group_by import gro...
<reponame>Briancbn/fleet_adapter_mir<filename>fleet_adapter_mir/fleet_adapter_mir.py<gh_stars>1-10 from rmf_fleet_msgs.msg import Location, RobotMode, RobotState import rmf_adapter as adpt from mir100_client.rest import ApiException from mir100_client.models import PostMissionQueues, PostMissions, \ PostMissionAc...
<filename>gribmagic/smith/bbox.py """ grib_bbox.py Copyright (C) 2020-2021 <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any late...
<reponame>PseudoSky/rpcs-sensors<filename>testbit_keys2.py #teOfSleep': u'2016-04-'dateOfSleep': u'2016-04-V1 - Minute by minute data #V2 - Summary data added #!/usr/bin/env python import fitbit import pprint import serial import requests from datetime import datetime, timedelta import json import cherrypy import os i...
<gh_stars>100-1000 from .constants import GROUPBY_SEASONALITIES OPTIONS = { "seasonality": "month", "warn_for_failed_PredictionEnsemble_xr_call": True, "warn_for_rename_to_climpred_dims": True, "warn_for_init_coords_int_to_annual": True, "climpred_warnings": True, } # defaults _SEASONALITY_OPTION...
<reponame>drmidnightytb/InstaBot ## Tabela de cores ANSI (Python) ## # fonte # Mblack = '\033[1;30m' # Preto Ired = '\033[1;31m' # Vermelho Dgreen = '\033[1;32m' # Verde Nyellow = '\033[1;33m' # Amarelo Iblue = '\033[1;34m' # Azul Gpurple = '\033[1;35m' # Roxo Hcyan = '\033[1;36m' # Ciano Twhite = '\03...
# coding:utf-8 #!/usr/bin/python # # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # # -- This line is 75 characters ------------------------------------------...
from asmdot import * # pylint: disable=W0614 @handle_command_line() class NimEmitter(Emitter): @property def language(self): return 'nim' @property def filename(self): return f'asmdot/private/{self.arch}.nim' @property def test_filename(self): return f'test/test{self...
<filename>escpos/showcase.py # -*- coding: utf-8 -*- # # escpos/showcase.py # # Copyright 2020 Base4 Sistemas Ltda ME # # 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...
<gh_stars>10-100 import pickle from pathlib import Path import numpy as np import pandas as pd import dill from os import listdir import json from tqdm import tqdm import re import subprocess import random import time from multiprocessing import Pool from shutil import rmtree from os import path import sys sys.path....
<filename>plugins/modules/oci_opsi_summarize_exadata_insight_resource_forecast_trend_facts.py #!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPY...
<reponame>ChuckCottrill/hack-rank abs(num) any(iterable) all(iterable) ascii(object) bin(num) bool(value) bytearray() # bytearray(source, encoding, errors), mutable bytes() # bytes(source, encoding, errors), immutable callable(object) chr(num) # num in [0,1_114_111], returns unicode codepoint compile() # compile(sour...
import html import os import sys import threading import flask from flask import Flask, request from flask_socketio import SocketIO, emit, join_room from lyrics_launcher import run_launcher app = Flask('lyrics') socketio = SocketIO(app) if hasattr(sys, '_MEIPASS'): root_dir = sys._MEIPASS else: root_dir = ...
<reponame>MrSometimeswinmid/DoAn from team_config import * from PyQt5.QtWidgets import QWidget, QComboBox, QPushButton, QListWidget, QApplication, QDialog from PyQt5 import uic from class_convertType import ConvertThisQObject import sys import json class FillMajorData: def __init__(self, file): self.file...
<filename>freeze_model.py<gh_stars>10-100 import argparse import numpy as np import tensorflow as tf from tensorflow.python.framework import dtypes from tensorflow.python.framework import graph_util from tensorflow.python.tools.optimize_for_inference_lib import optimize_for_inference as opt_inference from tensorflow.py...
<filename>utils.py import os import numpy as np import cv2 import matplotlib.pyplot as plt from preprocessing import warp_image # output image folder output_folder = 'output_images/' def display_images(images, labels, fname='', path=output_folder, figsize=None, cmap=None): assert len(images) > 0 assert len(im...
<filename>RiboCode/RiboCode_onestep.py #!/usr/bin/env python from __future__ import division from __future__ import absolute_import from __future__ import print_function # -*- coding:UTF-8 -*- __author__ = '<NAME>' """ One-step script for running RiboCode program. Usage: RiboCode_onestep.py -g <gtf.txt> -f <genome.fa...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- #---------------------------------------------------------------------------------------------------------------------------------- # includes # 2+3 compat from __future__ import absolute_import, division, print_function, unicode_literals # standards import j...
<gh_stars>0 import json import re import requests import argparse import en_core_web_sm from flask import jsonify, request from nltk.tokenize import sent_tokenize import numpy as np import pandas as pd from scipy import spatial TOPK = 3 """ This is a simple script for invoking summarization server. It needs a runnin...
<reponame>Sajjad2117/FastAPI-OAuth2-JWT-based<filename>main.py from datetime import timedelta, datetime from fastapi import FastAPI, Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from passlib.hash import bcrypt from tortoise import fields from tortoise.contr...
<filename>common/python_common/sql_manipulate.py # -*- coding: utf-8 -*- # # python_common/sql_manipulate.py # # Sep/04/2017 # # -------------------------------------------------------- import sys import string import datetime from time import localtime,strftime # from to_utf8 import to_utf8_proc # # ---------------...
<reponame>U8NWXD/vivarium<filename>vivarium/library/dict_utils.py from __future__ import absolute_import, division, print_function import collections import copy from functools import reduce import operator tuple_separator = '___' def merge_dicts(dicts): merge = {} for d in dicts: merge.update(d) ...
<reponame>microsoft/ATAC import os import time from collections import namedtuple from dowel import logger, tabular import numpy as np from garage.trainer import Trainer as garageTrainer from garage.trainer import TrainArgs, NotSetupError from garage.experiment.experiment import dump_json from .utils import read_attr_...
# -*- coding: utf-8 -*- import logging import datetime from flask import request, render_template from flask_jwt_extended import ( create_access_token, decode_token ) from jwt.exceptions import DecodeError from flasgger import swag_from from http import HTTPStatus from pathlib import Path from sqlalchemy.orm.e...
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Mathematics/FibonacciNumbers/fibonacci-...