text
stringlengths
957
885k
import os import sys import logging import boto3 import inflect import pendulum from ask_sdk_core.skill_builder import CustomSkillBuilder from ask_sdk_core.api_client import DefaultApiClient from ask_sdk_core.utils import ( is_request_type, is_intent_name, get_api_access_token, get_device_id) from ask_sdk_core...
import torch.nn as nn import config class NetG(nn.Module): def __init__(self): super(NetG, self).__init__() self.layer_1 = nn.Sequential( nn.ConvTranspose2d(config.latent_dim, 512, kernel_size=4, stride = 1, bias=False), nn.BatchNorm2d(512), # nn.ReLU(inplace=Tr...
<filename>bin/ofs.py """ Copyright 2015 <NAME>, Massachusetts Institute of Technology 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...
# -*- coding: utf-8 -*- """QGIS Unit test utils for provider tests. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. "...
# Implements the following 2 layer NN: # Input=0.8, Bias=[-0.14, -0.11], Weight=[1.58, 2.45], Activation=Sigmoid # y = sigmoid( -0.11 + 2.45 * sigmoid( -0.14 + 1.58 * 0.8 ) ) # L1 L2 # [0.8] - O - z - O - y # Bl1=-0.14 Bl2=-0.11 # Wl1=1.58 Wl2=2.45 import torch from torch impo...
<gh_stars>0 # # Conexión a base de datos PostgreSQL # Esta libreta establece un ejemplo de conexión a una base de datos PostgreSQL utilizando variables de ambiente # La correcta ejecución de esta libreta incluye los siguientes elementos: # * existe un archivo `.env` con las variables de ambiente de la conexión en la ...
<reponame>oleksiyVeretiuk/openprocurement.auctions.geb # -*- coding: utf-8 -*- import unittest from openprocurement.auctions.core.tests.base import snitch from openprocurement.auctions.geb.tests.base import ( BaseWebTest ) from openprocurement.auctions.geb.tests.states import ( ProcedureMachine ) from openpr...
<filename>app/bin/dltk/core/deployment/rest_handlers.py from urllib.parse import parse_qs, unquote import os from dltk.core.rest import BaseRestHandler from dltk.core import algorithm from dltk.core import deployment from dltk.core import environment from dltk.core import runtime from dltk.core import is_truthy from...
""" Python class for handling object catalogs associated with a data release. The catalogs are obtained from FITS files. This class does some caching for speed. """ import numpy from ..utils import fits from ..utils import filehandler from ..utils.columnstore import ColumnStore from ..utils.npyquery import Column as...
from oeda.databases import setup_experiment_database, setup_user_database, db from oeda.analysis.factorial_tests import FactorialAnova from oeda.analysis.analysis_execution import delete_combination_notation, iterate_anova_tables, get_tuples from collections import OrderedDict from oeda.utilities.Structures import Defa...
import json import os import time from typing import List, Callable from slackclient import SlackClient from slack_bot.models import Message, Response from slack_bot.routes import Routers, Route RTM_READ_DELAY = int(os.getenv('RTM_READ_DELAY', 1)) class Application: def __init__(self, token: str): se...
# -*- coding: utf-8 -*- """ Created on Mon Nov 11 15:01:25 2019 The ModelClass parent class. All the actual models are child classes with (if needed) overloaded methods @author: Dr. Dr. <NAME> @web : https://dannyvanpoucke.be """ import pandas as pd import numpy as np import sys sys.path.append("../ParallelResults...
import pandas as panda import matplotlib.pyplot as plt import numpy as np import random import sys import matplotlib.cm as cm import time import matplotlib from collections import OrderedDict import math from csv import writer from csv import reader import textwrap from PIL import ImageTk, Image import os current_path...
# -*- coding: utf-8 -*- """ @author: LiuXin @contact: <EMAIL> @Created on: 2020/8/4 下午1:56 """ from pycocotools.coco import COCO import numpy as np from PIL import Image import matplotlib.pyplot as plt import os,shutil,cv2 from dataloader.skmt import SkmtDataSet def resave_img(img_name,output_path,prefix): ''' ...
<reponame>hihi-dev/linphone<filename>coreapi/help/doc/sphinx/gendoc.py #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2017 Belledonne Communications SARL # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Fre...
import ipywidgets as ipw from IPython.display import display, clear_output, HTML import nglview import time import ase.io import ase.units as aseu from ase.data.colors import jmol_colors import urllib.parse import numpy as np import copy import re from collections import OrderedDict import matplotlib.pyplot as plt fr...
<filename>beeline/__init__.py<gh_stars>0 ''' module beeline ''' import functools import logging import os import socket from contextlib import contextmanager from libhoney import Client from beeline.trace import SynchronousTracer from beeline.version import VERSION from beeline import internal import beeline.propagati...
# Copyright 2016, FBPIC contributors # Authors: <NAME>, <NAME> # License: 3-Clause-BSD-LBNL """ This file is part of the Fourier-Bessel Particle-In-Cell code (FB-PIC) It defines a set of common transverse laser profiles. """ import numpy as np from scipy.special import factorial, genlaguerre, binom # Generic classes #...
<filename>examples/pretrained_cnn/tutorial_vgg19.py #! /usr/bin/python # -*- coding: utf-8 -*- """ VGG-19 for ImageNet. Pre-trained model in this example - VGG19 NPZ and trainable examples of VGG16/19 in TensorFlow can be found here: https://github.com/machrisaa/tensorflow-vgg For simplified CNN layer see "Convolutio...
import numpy as np import math #------------------------------------------------------------------------- ''' Problem 1: softmax regression In this problem, you will implement the softmax regression for multi-class classification problems. The main goal of this problem is to extend the logistic regression...
import datetime import logging import os from functools import lru_cache from pathlib import Path import mlflow import requests from cd4ml.model_utils import load_deployed_model_from_local_file from cd4ml.problems import list_available_scenarios class ModelCache: def __init__(self, cache_location=Path("mlflow_ca...
<gh_stars>1-10 from matplotlib import pyplot as plt import pandas as pd import re import numpy as np def scplot(fig, dat, dep, coef): """ Plots scatter plot with regression line Inputs: dat (Pandas Series): data structure containing data about the best policy dep (Pandas Series): data structure co...
<reponame>jasperschroeder/BigDataClass ############################################################################### # title: 02-lda.py # created on: May 15, 2021 # summary: lda, outputs topic weights in a df ############################################################################### import pandas a...
"""Kazoo testing harnesses""" import logging import os import uuid import unittest from kazoo import python2atexit as atexit from kazoo.client import KazooClient from kazoo.exceptions import KazooException from kazoo.protocol.connection import _CONNECTION_DROP, _SESSION_EXPIRED from kazoo.protocol.states import ( ...
<reponame>NicoleEic/projects import numpy as np import sys from my import mymodule import matplotlib.pyplot as plt import pdb import logging as log luminance_factors = {'R': 0.2126, 'G': 0.7152, 'B': 0.0722} def get_luminance(colour, luminance_factors={'R': 0.2126, 'G': 0.7152, 'B': 0.0722}): '''determine the p...
import ast import sys import copy from collections import namedtuple from rightarrow.annotations import * class Constraint(object): "A type constraint of the form `S <: T`" def __init__(self, subtype, supertype): self.subtype = subtype self.supertype = supertype def __str__(self): ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt...
<filename>T3Window.py # Created by <NAME>' # https://github.com/alxxlc/Boolean-Algebra-Toolbox # Test Equation: (AVB') (AVCVD') (A+B+D') import sys from PyQt5 import QtCore, QtWidgets, uic from ttConverter import * from ttGenerator import * import pyperclip form_class = uic.loadUiType("T3Window.ui")[0] eqConverter ...
import logging from abc import ABC from abc import abstractmethod from iptv_proxy.providers import ProvidersController logger = logging.getLogger(__name__) class ProviderHTMLTemplateEngine(ABC): __slots__ = [] _provider_name = None @classmethod @abstractmethod def render_configuration_template...
import functools import inspect from .users import UserMethods, _NOT_A_REQUEST from .. import utils from ..tl import functions, TLRequest class _TakeoutClient: """ Proxy object over the client. `c` is the client, `k` it's class, `r` is the takeout request, and `t` is the takeout ID. """ def __ini...
<reponame>csadsl/poc_exp #! /usr/bin/env python # -*- coding: UTF-8 -*- # Author : <EMAIL> <github.com/tintinweb> # http://www.secdev.org/projects/scapy/doc/build_dissect.html from scapy.packet import Packet, bind_layers from scapy.fields import * from scapy.layers.inet import TCP, UDP import os, time class BLenField(...
<reponame>tylersiemers/securecrt-tools<gh_stars>0 # $language = "python" # $interface = "1.0" import os import sys import logging # Add script directory to the PYTHONPATH so we can import our modules (only if run from SecureCRT) if 'crt' in globals(): script_dir, script_name = os.path.split(crt.ScriptFullName) ...
<gh_stars>0 ########################### # Latent ODEs for Irregularly-Sampled Time Series # Author: <NAME> ########################### # Create a synthetic dataset from __future__ import absolute_import, division from __future__ import print_function import os import matplotlib if os.path.exists("/Users/yulia"): ...
from unittest.mock import patch from django.contrib.auth import get_user_model from django.test import TestCase from ohq.models import Course, Membership, Question, Queue, Semester from ohq.tasks import sendUpNextNotificationTask User = get_user_model() @patch("ohq.tasks.sendUpNextNotification") class sendUpNextN...
""" Tests for the C implementation of the sequence transducer. From outside the package directory, run `python -m transducer.test.` """ from __future__ import division from __future__ import print_function import argparse import numpy as np import time import torch import torch.autograd as autograd import torch.nn as...
<reponame>gcasabona/cuda<gh_stars>10-100 #----------------------------------------------------------------------- # Skeleton 3D Darwin PIC code # written by <NAME>, <NAME>, and <NAME>, UCLA import math import numpy from fdpush3 import * from dtimer import * int_type = numpy.int32 double_type = numpy.float64 float_type...
import os import requests import time from os import path from flask import Flask, render_template, redirect, request, url_for from flask_pymongo import PyMongo from flask_googlemaps import GoogleMaps from bson.objectid import ObjectId from datetime import date # instatiate Flask application app = Flask(__name__) # I...
""" Django settings for django_tpq project. Generated by 'django-admin startproject' using Django 1.11.1. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import...
# # Copyright 2019 The FATE 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 appli...
# -*- coding: UTF-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals __author__ = "d01" __email__ = "<EMAIL>" __copyright__ = "Copyright (C) 2015-16, <NAME>" __license__ = "MIT" __version__ = "0.1.0" __date__ = "201...
# -*- coding: utf-8 -*- # # # <NAME> # # Kotel'nikov Institute of Radio-engineering and Electronics of RAS # # 2019 # import csv import regex as re import os import sys from collections import defaultdict from settings import Settings from termcolor import colored # Функция ищет все файлы с именем f во всех подкатал...
""" Contains the "RenameVariableTransformer" that renames a variable and all its uses. """ import random from abc import ABC import logging as log import libcst as cst from libcst import CSTNode from lampion.transformers.basetransformer import BaseTransformer from lampion.utils.naming import get_random_string, get_p...
from ..DB.Repositorio_Turistas_Entrantes_INE import RepositoryTuristasEntrantesINE as DBRepository from ..Utilidades.Conversores import Conversores as Conversor def obtener_porcentaje_turistas_entrantes_en_ciudad_destino_desde_ciudad_origen_en_rango_anio_mensualmente(CiudadDestino, CiudadOrigen, AnioInicio, AnioFin):...
<filename>py65/disassemblerM65C02A.py from utils.addressing import AddressParser class Disassembler: def __init__(self, mpu, address_parser=None): if address_parser is None: address_parser = AddressParser() self._mpu = mpu self._address_parser = address_parser self.ad...
# Copyright 2018 Argo AI, 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, sof...
<gh_stars>1-10 import numpy as np import random import torch from collections import namedtuple, deque import math #code from openai #https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py import operator class SegmentTree(object): def __init__(self, capacity, operation, neutral_elemen...
# 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, ...
<reponame>Carlson-J/energy-transfer-analysis import argparse from mpi4py import MPI import FFTHelperFuncs from IOhelperFuncs import read_fields from EnergyTransfer import EnergyTransfer from FlowAnalysis import FlowAnalysis import os import sys import pickle import numpy as np analysis_description = ( "MPI parall...
<reponame>satish1901/Methane-detection-from-hyperspectral-imagery ######################################################################### # # detectors.py - This file is part of the Spectral Python (SPy) package. # # Copyright (C) 2013 <NAME> # # Spectral Python is free software; you can redistribute it and/ # ...
#! /usr/bin/env python ################################################################################ # # KheBaseShell.py # """ Khepera II Base Command-Line Shell Module Khepera II base serial command-line shell provides a command-line interface to most of the commands available on the Khepera II base robot. This ...
<reponame>liuzhengqi1996/math452_Spring2022<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # # Week 5 Programming Assignment # # Remark: # # Please upload your solutions of this assignment to Canvas with a file named "Programming_Assignment_5 _yourname.ipynb" before deadline. # =================================...
<gh_stars>10-100 import sys import cv2 import os import imutils sys.path.append('/home/pi/GitHub/T-BOTS/Python') from collections import deque import numpy as np import matplotlib.pyplot as plt from TBotTools import tbt, pid, geometry from time import time plt.ion() import bluetooth as bt from datetime import datetime ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
<reponame>owlet42/FedVision # Copyright (c) 2019 PaddlePaddle 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....
""" sentry.models.projectkey ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import petname import six from bitfield import BitField from uuid import uuid4 fro...
#~ imports from world import time import numpy as np import argparse from pprint import pprint import tensorflow as tf #~ imports from this repo from generate_tracks import gen_tracks np.random.seed(42) tf.config.threading.set_intra_op_parallelism_threads(1) tf.config.threading.set_inter_op_parallelism_threads(1) ...
<gh_stars>0 # Copyright (c) 2016-2021, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of...
# Copyright (c) 2021 Qualcomm Technologies, Inc. # All rights reserved. """ Adapted from: hsn/nn/harmonic_resnet_block.py by <NAME> at github.com/rubenwiersma/hsn MIT License Copyright (c) 2020 rubenwiersma Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated d...
# Copyright 2017 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 unittest from libs import structured_object class _ObjectA(structured_object.StructuredObject): # pragma: no cover. v = int _unused = 2 def...
<reponame>karakays/otp-py<filename>otp/token.py<gh_stars>1-10 # MIT License # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including with...
""" Defines Vive Tracker server. This script should run as is. Example usage: python vive_tracker_client.py --debug True For Vive Tracker Server implementation, please see https://github.com/wuxiaohua1011/ROAR_Desktop/blob/main/ROAR_Server/vive_tracker_server.py """ import socket import sys import logging from typin...
# coding: utf-8 """ <NAME> Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.1.2-pre.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: fro...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from bokeh.models import ColumnDataSource, FixedTicker, Hover...
<gh_stars>100-1000 from __future__ import unicode_literals from uuid import uuid4 import os from django import forms from reviewboard.attachments.mimetypes import get_uploaded_file_mimetype from reviewboard.attachments.models import (FileAttachment, FileAttachmentHistory) ...
<filename>Library_Generation/Validation_of_library.py from IsoAligner_core.Protein_isoform import * from IsoAligner_core.Alignment import * class Validate_library(): pass @staticmethod def check_if_there_are_AA_seq_duplicates(list_of_gene_objects): ''' check out if there were IDs and Seq t...
<reponame>mvdoc/himalaya<gh_stars>10-100 import numpy as np try: import scipy.linalg as linalg use_scipy = True except ImportError: import numpy.linalg as linalg use_scipy = False ############################################################################### def apply_argmax(array, argmax, axis): ...
import logging from robotframework_ls.client_base import LanguageServerClientBase log = logging.getLogger(__name__) class _LanguageServerClient(LanguageServerClientBase): def __init__(self, *args, **kwargs): LanguageServerClientBase.__init__(self, *args, **kwargs) from robotframework_ls_tests imp...
<reponame>hh-wu/ezdxf # Copyright (c) 2019 <NAME> # License: MIT License import pytest from copy import deepcopy from ezdxf.math import Vector from ezdxf.entities.dxfentity import base_class, DXFAttributes, DXFNamespace, SubclassProcessor from ezdxf.entities.dxfgfx import acdb_entity from ezdxf.entities.line import acd...
<reponame>MichalOren/anyway from enum import Enum from typing import List, Iterable try: from flask_babel import _ except ImportError: pass # noinspection PyProtectedMember class BackEndConstants(object): MARKER_TYPE_ACCIDENT = 1 MARKER_TYPE_DISCUSSION = 2 CBS_ACCIDENT_TYPE_1_CODE = 1 UNITE...
from collections import Sequence from delphin.derivation import Derivation from delphin.tokens import YyTokenLattice from delphin.mrs import ( Mrs, Dmrs, simplemrs, eds, ) from delphin.util import SExpr, stringtypes class ParseResult(dict): """ A wrapper around a result dictionary to automate...
<reponame>ZW7436/PycQED_py3 """ April 2018 Simulates the trajectory implementing a CZ gate. June 2018 Included noise in the simulation. July 2018 Added distortions to simulation. """ import time import numpy as np import qutip as qtp from pycqed.measurement import detector_functions as det from scipy.interpolate impo...
import numpy as np def get_augmentations_from_list(str_list, upright_axis=2): ''' :param str_list: List of string indicating the augmentation type :param upright_axis: Set to 1 for modelnet (i.e. y-axis is vertical axis), but 2 otherwise (i.e. z-axis) :return: ''' if str_list is None: ...
<reponame>mwetzel7r/webrunner<gh_stars>0 # python standard lib import json, os, uuid # external resources from flask import Flask, redirect, url_for, request, render_template, make_response, jsonify,send_from_directory, flash from flask_login import current_user, login_user, logout_user, login_required, login_manager...
import os import re import socket import sys import time from tox import hookimpl from tox.config import SectionReader import py from docker.errors import ImageNotFound from docker.types import Mount import docker as docker_module # nanoseconds in a second; named "SECOND" so that "1.5 * SECOND" makes sense SECOND = ...
<filename>qtree/voronoi.py import numpy as np from matplotlib import pyplot as plt from matplotlib.collections import LineCollection from scipy.spatial import Voronoi from qtree.utils import _points_in_poly class ParticleVoronoiMesh(object): def __init__(self, positions, deposit_field, bounds): """A vor...
<filename>tcvx21/grillix_post/components/namelist_reader_m.py """ Implementation of a reader for Fortran namelist readers, which can be used to interface with parameter files """ from collections import defaultdict from os import name from pathlib import Path import f90nml from tempfile import NamedTemporaryFile impor...
import cv2 import numpy as np import imutils c = 1 folder = "input4/" alueet = cv2.imread(folder + 'Yleiskaava.png', 0) alueet = cv2.threshold(alueet, 127, 255, cv2.THRESH_BINARY_INV)[1] # ensure binary connectivity = 8 output = cv2.connectedComponentsWithStats(alueet, connectivity, cv2.CV_32S) kernel = np.ones((...
from typing import Callable, Optional, List, Set import logging import subprocess from pathlib import Path from readchar import key import appdirs import yaml from . import Remote, MuteContext, vanity from .backend import Client from .library import Album from .speech import Speech, Beep, conjoin class DenonRC1223(...
import csv import decimal import logging import typing from io import StringIO from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import FlushError from flask import flash from project.server import db from project.server.models import Manufacturer, DeviceSeries, Device, Color, Repair log...
#!/usr/bin/env python3 import argparse import logging import os import re import sys import time from pathlib import Path import torch from vits_train.checkpoint import load_checkpoint from vits_train.config import TrainingConfig from vits_train.utils import audio_float_to_int16 from vits_train.wavfile import write a...
<reponame>DmitryTakmakov/Takmachat<filename>server/server/server/core.py<gh_stars>0 """ All the main functions for the server app """ from binascii import hexlify, a2b_base64 from hmac import new, compare_digest from json import JSONDecodeError from logging import getLogger from os import urandom from select import sel...
from copy import Error import pymisp as pm from pymisp import api import malpedia_client as mp_Client import mitre_functions as mf import sanitizitation_functions as sf import globals as gv import misp_event_functions as mef import database_actions as db import os import sys import json import time import math import g...
<filename>components/py_engine/framework/sh1106.py from micropython import const import utime import framebuf from driver import SPI from driver import GPIO # a few register definitions _SET_CONTRAST = const(0x81) _SET_NORM_INV = const(0xa6) _SET_DISP = const(0xae) _SET_SCAN_DIR = const(0xc0) _SET_SEG_REMAP = const(0...
#Import the OpenCV and dlib libraries import cv2 import dlib #Initialize a face cascade using the frontal face haar cascade provided with #the OpenCV library faceCascade = cv2.CascadeClassifier('xmls/haarcascade_frontalface_alt.xml') #The deisred output width and height OUTPUT_SIZE_WIDTH = 775 OUTPUT_SIZE_HEIGHT = 6...
#!/usr/bin/python -Wall # ================================================================ # <NAME> # <EMAIL> # 2005-06-08 # # Some simple I/O routines for real and complex scalars, vectors, # and matrices. # ================================================================ from __future__ import division # 1/2 = 0.5,...
<reponame>AllClearID/pants # coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_state...
import tkinter as tk import multiprocessing as mp import os import sys import json import threading import time import random import math class CanvasController: def __init__(self, canvas, game = None, layers = None, get_pil = False): self.canvas = canvas self.game = game self.winf...
import tensorflow as tf import os import sys from nets.CPM import CPM from nets.Hourglass import Hourglass from data.DomeReader import DomeReader from data.HumanReader import HumanReader from data.MultiDataset import combineMultiDataset from data.COCOReader import COCOReader import pickle import utils.general import ...
# Copyright 2021 The Cirq Developers # # 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 ...
<filename>tools/log2csv.py import os import re import glob import argparse import pandas as pd list_test = ["alexnet", "inception3", "inception4", "resnet152", "resnet50", "vgg16"] # Naming convention # Key: log name # Value: ([num_gpus], [names]) # num_gpus: Since each log folder has all the record for different ...
<reponame>ihumphrey/Xi-cam.SAXS from typing import Callable, Union from qtpy.QtWidgets import * from qtpy.QtCore import * from qtpy.QtGui import * from xicam.plugins.widgetplugin import QWidgetPlugin from xicam.gui.static import path from xicam.core.execution.workflow import Workflow from xicam.plugins import Operation...
<filename>01 weibo/weibo.py<gh_stars>0 # -*- coding: utf-8 -*- # @Author : Leo import os import rsa import time import base64 import requests import binascii from urllib.parse import quote class LoginSinaWeibo: """ 新浪微博登陆 - 用户名和密码均加密后提交,其中密码采用rsa加密 """ # 创建session会话 session = requests.session...
# coding=utf-8 import json from enum import Enum from typing import Callable, Any from flask import Flask, request as flask_request MiddlewareType = Enum('MiddlewareType', ('Request', 'Response')) class Middleware: func = Callable tag = str weight = int type = MiddlewareType def __init__( ...
<reponame>mikgroup/subtle_data_crimes import numpy as np from PIL import Image import os def calc_pad_half(N_original, pad_ratio): N_tot = N_original * pad_ratio # this will be the total k-space size diff = np.ceil(N_tot - N_original) # this is the total padding length pad_size_vec = diff.astype(int) #...
#!/usr/bin/env python3 import socket import argparse import threading import signal import json import requests import sys import time import traceback from queue import Queue from contextlib import contextmanager CLIENT2SERVER = 1 SERVER2CLIENT = 2 running = True """ "fast" TLS brute-force @author: <NAME> """ MESS...
<gh_stars>1-10 # -*- coding: utf-8 -*- """Admin models.""" import datetime as dt from flask_login import UserMixin from league.database import (Column, Model, SurrogatePK, db, reference_col, relationship) from league.extensions import bcrypt class SiteSettings(SurrogatePK, Model): "...
<reponame>rajanramprasadh/profiles-rest-api<filename>src/profiles_project/profiles_api/views.py from django.shortcuts import render from rest_framework import viewsets, status, filters from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.authentication import TokenA...
# Copyright 2014 Google. # # 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, softw...
""" Copyright 2021 <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 Unless required by applicable law or agreed to in writing, software distributed...
#!/usr/bin/env python # test_copy.py - unit test for COPY support # # Copyright (C) 2010-2011 <NAME> <<EMAIL>> # # psycopg2 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 3 of ...