text
stringlengths
957
885k
""" Module providing unit-testing for `~halotools.utils.value_added_halo_table_functions`. """ from __future__ import (absolute_import, division, print_function) from copy import deepcopy from collections import Counter import numpy as np import pytest from astropy.extern.six.moves import xrange as range from ..v...
import logging from typing import Callable, Union from tags_model import (TagCategory, TagCategoryBase, TagCategoryBaseItem, TagItem) tag_configuration: list[TagCategoryBase] = list() def load_tag_configuration(config_file_name: str) -> None: with open(config_file_name, mode='r', encoding='utf-8-sig') as f: ...
<filename>pkgs/ops-pkg/src/genie/libs/ops/lldp/iosxr/tests/lldp_output.py '''LLDP Genie Ops Object Outputs for IOSXR.''' class LldpOutput(object): ShowLldp = { "hello_timer": 30, "enabled": True, "hold_timer": 120, "status": "active", "reinit_delay": 2 } ShowL...
<gh_stars>1-10 """secp256k1 elliptic curve cryptography interface.""" # The process for using SECP256k1 is complex and more involved than ED25519. # # See https://xrpl.org/cryptographic-keys.html#secp256k1-key-derivation # for an overview of the algorithm. from __future__ import annotations from hashlib import sha256 ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from matplotlib import pyplot as plt from matplotlib.patches import Polygon import seaborn as sns from utils import * from analysis import * from SpikeVidUtils import * def tidy_axis(ax, top=False, right=False, left=False, bottom=False): ax.spines['top'].set_visible(top) ax.spines['right'].set_visible(right) ...
#! /usr/bin/env python3 import sys import pickle import argparse import numpy as np import pandas as pd import scipy.stats as stats def like_calc(X, y_test, unc): """ Given a simulated entry with uncertainty and a test entry, calculates the likelihood that they are the same. Parameters -----...
#!/usr/bin/env python """ cmddocs Class """ import os import cmd import sys import signal import configparser import git import pkg_resources from cmddocs.articles import * from cmddocs.completions import * from cmddocs.version import __version__ class Cmddocs(cmd.Cmd): """ Basic commandline interface class """ ...
<filename>sdk/loadtestservice/azure-mgmt-loadtestservice/azure/mgmt/loadtestservice/models/_models_py3.py<gh_stars>1000+ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.t...
# Copyright 2011 OpenStack Foundation # # 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 ...
#!/usr/bin/python ''' Example of inverse kinematics using the simple gradient descent method ''' from riglib.bmi import robot_arms import imp imp.reload(robot_arms) import numpy as np import matplotlib.pyplot as plt import time from riglib.stereo_opengl import ik import cProfile pi = np.pi q = np.array([0, 90, 0, 0,...
<filename>mailchimp_marketing_asyncio/models/rss_options1.py # coding: utf-8 """ Mailchimp Marketing API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 3.0.74 Contact: <EMAIL> Generated by: https://github.c...
# Copyright (c) 2009-2010 Six Apart Ltd. # 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 notice, # this list of conditions an...
import tensorflow as tf from utils import FLAT_COLOR_DIMS, COLOR_DIMS IMAGE_SIZE = 416 # TODO(indutny): there is no reason to not calculate grid_size automatically GRID_SIZE = 13 GRID_CHANNELS = 7 PRIOR_SIZES = [ [ 0.14377480392797287, 0.059023397839700086 ], [ 0.20904473801128326, 0.08287369797830041 ], [ 0.2...
<reponame>brianhie/trajectorama<filename>bin/dataset_zeisel_adolescent_brain.py from anndata import AnnData import loompy import numpy as np import os from scanorama import * import scanpy as sc from scipy.sparse import vstack from sklearn.preprocessing import normalize from process import process, load_names, merge_d...
#!/usr/bin/env python from __future__ import print_function import matplotlib as mpl #mpl.use("Agg") import numpy as np import matplotlib.pyplot as plt from costar_models import * from costar_models.planner import GetOrderedList, PrintTopQ from costar_models.sampler2 import PredictionSampler2 from costar_models.dat...
<gh_stars>10-100 # Downloads and uses the XML version of the US Code to extract a table of contents. # # Outputs JSON to STDOUT. Run and save with: # ./run structure_xml > structure.json # # options: # title: Do only a specific title (e.g. "5", "5a", "25") # sections: Return a flat hierarchy of only titles and s...
import os from datetime import datetime, timedelta, timezone from json import loads # 各重要目录名。 CONFIG_DIR = "config" RSC_DIR = "resource" LOG_DIR = "log" # 获取当前目录和上级目录。 cwd = os.getcwd() cwd_parent = os.path.dirname(cwd) # 如果 config 目录在上级目录下,那么根目录是上级目录。 if os.path.exists(os.path.join(cwd_parent, CONFIG_DIR)): roo...
<filename>t/test_maybe.py # 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 a...
<gh_stars>1-10 import worker from pyspark.mllib.feature import Word2VecModel from pyspark.rdd import PipelinedRDD from mock import patch from test_helpers import get_job, get_fake_mongo_client from multiprocessing import Queue, Process from bson.binary import Binary import pymongo import json def test_cleanstr(): ...
#!/usr/bin/env python2.7 # encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Vers...
<filename>peregrinearb/utils/general.py import math import networkx as nx import logging __all__ = [ 'ExchangeNotInCollectionsError', 'format_for_log', 'FormatForLogAdapter', 'print_profit_opportunity_for_path', 'print_profit_opportunity_for_path_multi', ] class ExchangeNotInCollectionsError(Exc...
import tkinter as tk import tkinter.ttk as ttk from Components.db import Database from Components.patter_menu import PatternMenu from Components.factory import OperationFactory class ToolBar(): def __init__(self, root, tab): self.root = root self.tab = tab self.op_fac = OperationFactory(...
import json import numpy as np import pandas as pd from .utils import get_blocked_videos from .utils import interpolated_prec_rec from .utils import segment_iou from joblib import Parallel, delayed class ActionDetectorDiagnosis(object): GROUND_TRUTH_FIELDS = ['database', 'taxonomy', 'version'] PREDICTION_FI...
import boto3 from botocore.client import ClientError import freezegun import pytest from moto import mock_greengrass from moto.core import get_account_id from moto.settings import TEST_SERVER_MODE ACCOUNT_ID = get_account_id() @freezegun.freeze_time("2022-06-01 12:00:00") @mock_greengrass def test_create_core_defin...
###################################################################### # # Software Name : Cloudnet TOSCA toolbox # Version: 1.0 # SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange # SPDX-License-Identifier: Apache-2.0 # # This software is distributed under the Apache License 2.0 # the text of which is available at ...
<filename>docs/source/conf.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Configuration file for the Sphinx documentation builder. # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- import os import sys from ambiance.__init__ import __modu...
<gh_stars>0 """ class ObjectMapping @author: <NAME> """ import warnings warnings.simplefilter('ignore', FutureWarning) import numpy as np from keras.preprocessing.image import img_to_array from PIL import Image, ImageDraw, ImageFont, ImageOps from itertools import combinations, product from string import ascii_upperca...
<filename>mod/setup_geometry.py<gh_stars>1-10 import bpy, math, bmesh, random from typing import Set, Tuple # Divisor coefficient for int colors coef = { "8 bit": 255, "16 bit": 65535, "32 bit": 4294967295, } # Return this angle if it's not possible to calculate angle between faces ang_limit = math....
""" wf_netcdfio ----------- netcdf reading and writing for wflow $Author: schelle $ $Id: wf_DynamicFramework.py 915 2014-02-10 07:33:56Z schelle $ $Rev: 915 $ """ import osgeo import osgeo.ogr import netCDF4 import pyproj import os # the two below are needed fpr bbfreeze try: import n...
import sys import json import os.path import importlib.util import conducto as co from conducto.shared import constants from conducto import api from conducto.contrib.discover.cli import discover_cli from conducto.debug import debug, livedebug from conducto.glue import method import asyncio def show(id, app=method._g...
<reponame>steinst/ABLTagger<filename>preprocess/vectorize_dim.py import numpy import argparse import sys tag_matrix = {"no":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "lo":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import os import time import threading as mt import radical.utils as ru from . import utils as rpu from . import states as rps from . import constants as rpc from . import compute_unit_description as rpcud # bulk call...
<gh_stars>0 import astropy.units as u import gwcs.coordinate_frames as cf import numpy as np import pytest from astropy.coordinates import SkyCoord from astropy.time import Time from ndcube.extra_coords.lookup_table_coord import (MultipleTableCoordinate, QuantityTableCoordinate, ...
"""Utilities for mapping between actual and formal arguments (and their types).""" from typing import TYPE_CHECKING, List, Optional, Sequence, Callable, Set from mypy.maptype import map_instance_to_supertype from mypy.types import ( Type, Instance, TupleType, AnyType, TypeOfAny, TypedDictType, ParamSpecType, get_...
from pathlib import Path import json import shutil import os.path import pyclbr import copy renames = {"cc_defect_detection":"cc_defect_detect", "cc_clone_detection_big_clone_bench":"cc_clone_detect_big", "cc_code_refinement":"cc_refine", "cc_code_completion_token":"cc_complete_token", "cc_code_to_code_trans":"cc_code...
<reponame>jiahuanluo/label-inference-attacks<gh_stars>1-10 """ thanks: https://github.com/swapniel99/criteo/blob/master/criteo.py """ import torch.utils.data as data from csv import DictReader import numpy as np import pandas as pd import torch from imblearn.over_sampling import SMOTE from sklearn import prepr...
<reponame>jonathanengelbert/ETLs # This script copies the basic layers from Transbase needed by TIM, with the exception of injury data. #Last modified: 11/21/2017 by <NAME> # ### No Known Issues ### WARNING: #CAUTION: The field "overlap" in dataset "TB_overall_hgh_injry_network" no longer exists ### in newer versions ...
from sam import SAM import copy import os import numpy as np from sklearn.preprocessing import LabelEncoder import matplotlib.pyplot as plt import cv2 import os import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from sklearn.model_selection import tra...
# Copyright 2018 AT&T Intellectual Property. All other 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...
# GUIDs from https://github.com/snare/ida-efiutils/blob/master/efiguids.py # pylint: disable=duplicate-key edk_guids = { "ACPI_TABLE_GUID": [ 0xEB9D2D30, 0x2D88, 0x11D3, 0x9A, 0x16, 0x0, 0x90, 0x27, 0x3F, 0xC1, 0x4D, ], ...
<filename>docusign_esign/models/usage_history.py # coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2.1 Contact: <EMAIL> Generated by: https://github.com/swagger-ap...
<reponame>resistics/resistics """Testing of sampling code""" import pytest from typing import Tuple, Union from datetime import datetime, timedelta import pandas as pd from resistics.sampling import RSDateTime, RSTimeDelta, to_datetime, to_timedelta @pytest.mark.parametrize( "time, expected", [ ("202...
<reponame>edouardparis/aquarium<gh_stars>0 #!/usr/bin/env python3 import argparse import logging import os import shutil import socket import subprocess import sys import test_framework import time import traceback from concurrent import futures from test_framework.bitcoind import BitcoinD from test_framework.revault_...
import unittest import requests import json import os.path from urllib.parse import urljoin import itertools import subprocess import os URL = 'http://localhost:8000/' USERNAME_LOWER_LIMIT = 3 USERNAME_UPPER_LIMIT = 20 PASSWORD_LOWER_LIMIT = 6 PASSWORD_UPPER_LIMIT = 20 TITLE_LOWER_LIMIT = 5 TITLE_UPPER_LIMIT = 100 BOD...
from __future__ import with_statement import sys import struct import json import ssl import pytest import gevent from itertools import product from gnsq import Nsqd, Message, states, errors from gnsq import protocol as nsq from gnsq.stream.stream import SSLSocket, DefalteSocket, SnappySocket from mock_server import...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 7 08:38:28 2020 pyqt realtime plot tutorial source: https://www.learnpyqt.com/courses/graphics-plotting/plotting-pyqtgraph/ @author: nlourie """ from PyQt5 import QtWidgets, QtCore,uic from pyqtgraph import PlotWidget, plot,QtGui import pyqtgra...
# MIT License # # Copyright (c) 2021 Emc2356 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
from rest_framework.test import APITestCase from django.core.management import call_command from django.core.management.base import CommandError class BaseTestCase(APITestCase): def init_data(self): self.url = '/api/post/' self.good_url = '/api/post/1' self.good_data = {"title": "Test", ...
from ctypes import * from comtypes.hresult import S_OK, S_FALSE from . import core as DbgEng from . import exception class DebugSymbols(object): def __init__(self, symbols): self._sym = symbols exception.wrap_comclass(self._sym) # IDebugSymbols def GetSymbolOptions(self): ...
#!/usr/bin/env python # coding: utf-8 # In[1]: # Import Splinter, BeautifulSoup, and Pandas from splinter import Browser from bs4 import BeautifulSoup as soup import pandas as pd from webdriver_manager.chrome import ChromeDriverManager # In[2]: # Set the executable path and initialize Splinter executable_path = ...
#!/usr/bin/env python3 # ---------------------------------------------------------------------------- # Description: Script to create a new github repo # ---------------------------------------------------------------------------- # This file is part of the 'SLAC Firmware Standard Library'. It is subject to # the licen...
<reponame>lucasxlu/MMNet """ inference code """ import sys import time from pprint import pprint import numpy as np import torch import torch.nn as nn from PIL import Image from skimage import io from torchvision.transforms import transforms sys.path.append('../') from models.vgg import MMNet class MMNetRecognizer:...
""" fonts ===== .. module:: fonts :platform: Unix, Windows :synopsis: font utils .. moduleauthor:: <NAME> """ import os from autobasedoc import base_fonts from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.pdfmetrics import getFont from reportlab.pdfbase.ttfonts import TTFont from reportlab.lib....
<reponame>mfkenson/swift #!/usr/bin/env python """ @author <NAME> """ import swift as sw import websockets import asyncio from threading import Thread import webbrowser as wb import json import http.server import socketserver from pathlib import Path import os from queue import Empty def start_servers(outq, inq, op...
<filename>src/wrapper/atari_wrapper.py<gh_stars>0 import numpy as np from collections import deque import gym from gym import spaces import cv2 import tensorflow as tf import json from detect.backbone.tiny_darknet_fcn import yolo_net, load_from_binary from detect.util.postprocessing import getboxes cv2.ocl.setUseOpenC...
<reponame>nishadg246/stripstream-ivan-nishad<filename>robotics/openrave/tamp_fixed_base.py<gh_stars>0 from time import sleep import numpy as np from robotics.openrave.utils import solve_inverse_kinematics, \ set_manipulator_conf, Conf, Traj, manip_from_pose_grasp from robotics.openrave.motion import has_mp, mp_birr...
import dill import numpy as np import pandas as pd from matplotlib import pyplot as plt from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import linear_kernel from sklearn.preprocessing import MinMaxScaler, LabelEncoder from surprise import SVD, Reader, Dataset from surprise.mode...
#! /usr/bin/env python import sys, os from socket import * from select import select import struct, zlib import time from common.msgstruct import * from common.pixmap import decodepixmap from common import hostchooser import modes from modes import KeyPressed, KeyReleased import caching # switch to udp_over_tcp if th...
from collections import namedtuple from datetime import timedelta from unittest import mock from pydrag import Artist from pydrag import constants from pydrag import Tag from pydrag import Track from pydrag import User from pydrag.models.common import ListModel from pytuber.core.models import ConfigManager from pytub...
<reponame>shanghua520/fuck-hexue-class-time<filename>main.py import threading import time import requests import json mutex = threading.Lock() logidall = [] def login(username, pwd, appId): reps = requests.post(r'http://api.hnscen.cn/mobile/api/login', {'username': username, "pwd": pwd}).text logininfo = js...
<gh_stars>0 """Tools to extract and analyze data from GOES-R.""" import datetime as dt import itertools from multiprocessing import get_context import netCDF4 as nc import numpy as np from pathlib import Path import s3fs def download_goes_hotspot_characterization(folder, start, end, satellite="G17", full_disk=False)...
<reponame>rsmith-nl/deploy #!/usr/bin/env python # file: deploy.py # vim:fileencoding=utf-8:fdm=marker:ft=python # # Copyright © 2018 <NAME> <<EMAIL>>. # SPDX-License-Identifier: MIT # Created: 2014-03-09T17:08:09+01:00 # Last modified: 2020-10-27T18:16:10+0100 """ Script for deploying files. It can check for differen...
# coding: utf-8 # 词典来自: https://github.com/mahavivo/english-wordlists/edit/master/CET4+6_edited.txt import numpy as np class AutoCheck(object): def __init__(self, word_file='words.txt'): self.word_file = word_file self.word_list = self.read_words(word_file=word_file) print(len(self.word_li...
from PyQt4 import QtCore from gui import Ui_MainWindow from gui_components import BaseGuiComponent from gui_components import SelectFile from gui_components import FileInfo from gui_components import Convert from gui_components import Player from gui_components import Cut from gui_components import FftAnalysis class ...
<filename>heart_failure_app.py import streamlit as st import pandas as pd import numpy as np import pickle from sklearn.ensemble import RandomForestClassifier st.write(""" # HEART FAILURE PREDICTION APP This app predicts the likelihood of a person having an **Heart Attack** . """) st.sidebar.header('User Medica...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 29 20:53:21 2020 @author: asherhensley """ import dash import dash_core_components as dcc import dash_html_components as html import plotly.express as px import pandas as pd import yulesimon as ys from plotly.subplots import make_subplots import plo...
<reponame>legitbee/pulumi-ovh # 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, ...
''' explicit control evaluator build a machine that can evaluate any scheme program we skip the parsing part, instead we reuse parser in sicp414_evaluator to generate expressions we feed our machine with expressions and resolved distances we allocate a special register "dist" to hold resolved distances this register w...
from polymuse import dataset, dataset2 as d2, constant, enc_deco from keras.utils import Sequence import numpy, random, traceback, sys from sklearn.model_selection import train_test_split """ It generates the note data batch wise Returns: NoteDataGenerator -- generator class for note while trainin """ class No...
<gh_stars>1-10 # Copyright (c) 2018 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.0 # # Unless ...
<filename>ETCetera/util/parsing/parser_nonlinear_systems.py """ Created on Sat May 16 14:53:58 2020 @author: gmaddodi """ import re import sys import ETCetera.util.parsing.syntax_checker as sc import sympy as sp from ETCetera.exceptions.parser_exceptions.general_parser_exception import EmptyValueException, \ Mu...
<gh_stars>0 """Calendar parsing.""" import os import datetime import re from . import spec TODAY = datetime.date.today().strftime("%Y%m%d") def machine(file, shift=TODAY, event='first', report=False): """Creates a new calendar file with shifted dates. Args: file: str. Calendar file. Supported extens...
<reponame>ecoromka/mbed-os """ mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applic...
<gh_stars>0 """ The state is central in torchbearer, storing all of the relevant intermediate values that may be changed or replaced during model fitting. This module defines classes for interacting with state and all of the built in state keys used throughout torchbearer. The :func:`state_key` function can be used to ...
<reponame>landrito/api-client-staging<filename>generated/python/gapic-google-cloud-speech-v1beta1/google/cloud/gapic/speech/v1beta1/enums.py # Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lic...
from collections.abc import Iterable, MutableSequence, Mapping from enum import Enum from pathlib import Path from numbers import Real, Integral from xml.etree import ElementTree as ET import openmc.checkvalue as cv from . import VolumeCalculation, Source, RegularMesh from ._xml import clean_indentation, get_text, reo...
from io import StringIO import pathlib import rich import pytest from django.core.management import call_command from apps.greencheck.bulk_importers import ( ImporterCSV, MissingHoster, MissingPath, EmberCO2Import, ) from apps.greencheck.models import GreencheckIp from apps.greencheck.models.checks im...
import logging import json import re from typing import Any, Dict, List, Optional, TypeVar import pydash from fidesops.common_exceptions import FidesopsException from fidesops.graph.config import ScalarField from fidesops.core.config import config from fidesops.schemas.saas.shared_schemas import SaaSRequestParams from...
<filename>hxl/scripts.py """ Console scripts <NAME> April 2015 This is a big, ugly module to support the libhxl console scripts, including (mainly) argument parsing. License: Public Domain Documentation: https://github.com/HXLStandard/libhxl-python/wiki """ from __future__ import print_function import argparse, jso...
from typing import Dict, Optional from overrides import overrides import torch from allennlp.data import Vocabulary from allennlp.models.model import Model from allennlp.modules import Seq2SeqEncoder, Seq2VecEncoder, TextFieldEmbedder from allennlp.nn import InitializerApplicator, RegularizerApplicator from allennlp....
"""Schedule games in competitions. These schedulers are used to keep track of the ids of games which have been started, and which have reported their results. They provide a mechanism to reissue ids of games which were in progress when an unclean shutdown occurred. All scheduler classes are suitable for pickling. "...
<reponame>pankdm/highloadcup-2019<filename>src/py/tank.py #!/usr/bin/env python import sys import json import requests from collections import defaultdict import time COMPARE_RESULTS = True MAX_RESPONSE_SIZE = 0 # example usage: # cat input-data/elim_accounts_261218/answers/phase_1_get.answ |grep "/group" | head -...
# Model from torch.nn import functional as F from global_config import Config import math from torch.nn.parameter import Parameter from torch.nn.modules.module import Module import torch.nn as nn import torch # Graph Neural Networks class GraphConvolution(Module): """ Simple GCN layer, similar to https://arxi...
<reponame>milancermak/alexa-math-skill<filename>tests/functions/skill/test_main.py import jmespath import pytest from src.functions.skill import main from .fixtures import ( # pylint: disable=unused-import dynamodb_client, launch_request, session_ended_request, did_select_operation_intent, did_select_difficult...
<reponame>JiaMingLin/tsn-pytorch """ Utility functions for model """ import os import hashlib import requests from tqdm import tqdm import torch def deploy_model(model, cfg): """ Deploy model to multiple GPUs for DDP training. """ if cfg.DDP_CONFIG.DISTRIBUTED: if cfg.DDP_CONFIG.GPU is not No...
<gh_stars>0 import os import numpy as np import pandas as pd from mtist.graphing_utils import despine, easy_subplots, savefig # from mtist.mtist_utils import mu.GLOBALS, mu.load_ground_truths, mu.simulate from mtist import mtist_utils as mu class MASTER_DATASET_DEFAULTS: dt = 0.1 tend = 30 sample_freq...
import tkinter as tk ventana = tk.Tk() ventana.title("RESTAURANTE(Todo lo que puedas comer)") ventana.geometry("700x500") ventana.configure(bg = "white") #variables cliente = tk.StringVar() ruc = tk.StringVar() producto1 = tk.StringVar() producto2 = tk.StringVar() producto3 = tk.StringVar() producto4 = tk.StringVar...
<reponame>splunk-soar-connectors/attivo<gh_stars>0 # ----------------------------------------- # Phantom sample App Connector python file # ----------------------------------------- # Phantom App imports import phantom.app as phantom from phantom.base_connector import BaseConnector from phantom.action_result import Ac...
import time class Log(object): """ :param start_time: Time (seconds) at which the logging process was started :param end_time: Time (seconds) at which the last variable was logged :param end_itr: Iteration at which the last variable was logged :param objval_ave: function value at manifold ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UI.ui' # # Created by: PyQt5 UI code generator 5.14.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QObject, pyqtSlot from files_handler import FolderHandler fr...
# ================================================================ # Created by <NAME> on 9/17/18. # Copyright (c) 2018 <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://...
<filename>azurelinuxagent/ga/monitor.py<gh_stars>0 # Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
# Boilerplate commons for django based web api application. # Copyright (C) 2017 Logicify # The MIT License (MIT) # # 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 witho...
from dataclasses import replace from hanzi_font_deconstructor.common.TransformedStroke import TransformedStroke from .generate_svg import generate_svg, get_stroke_attrs from .transform_stroke import transform_stroke from .transform_stroke import transform_stroke from .svg_to_pil import svg_to_pil from os import path fr...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-24 20:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
import pygame import sys import time class Grid_WorldSim: def __init__(self,height,width,start_loc,finish_loc,actions,reward=-1,shift=None): self.shift = [0]*width if shift==None else shift self.height = height self.width = width self.start_loc = start_loc self.fin...
# -*- coding: UTF-8 -*- import re from time import time __all__ = ["DeauthMixin", "ScanMixin", "ConnectMixin", "STATION_REGEX"] CONNECT_REGEX = re.compile(r"(?m)Device '(?P<iface>[a-z][a-z0-9]*)' success" r"fully activated with '(?P<uid>[0-9a-f\-]+)'\.") STATION_REGEX = re.compile(r"^\s*(...
<reponame>HazeDT/DL-based-Intelligent-Diagnosis-Benchmark #!/usr/bin/python # -*- coding:utf-8 -*- import argparse import os from datetime import datetime from utils.logger import setlogger import logging from utils.train_utils_ae import train_utils args = None def parse_args(): parser = argparse.ArgumentParser...
<reponame>Deril-Pana/wikiBlackcoinNL # -*- coding: utf-8 -*- # # (c) Copyright 2015 HP Development Company, L.P. # # 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...