text
stringlengths
957
885k
from .dataset import * import torch class WicExample(ParaphraseExample): """single example from WiC dataset""" def __init__(self, lemma, pos, idxs, sent1, sent2, **kwargs): """ Args: lemma: the lemma of the word in the two contexts pos: the part of speech of the word ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
<reponame>mikespub-org/bjodah-pyemf from .constants import * from .field import * from .record import _EMR_UNKNOWN _type_map = {} def register(klass): """Register META with id.""" _type_map[klass.emr_id] = klass return klass class META_UNKNOWN(_EMR_UNKNOWN): emr_id = 0x7FFF def...
# Copyright 2017 Mycroft AI Inc. # # 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 writin...
<reponame>dcrmg/Efficient-Segmentation-Networks import math import torch import torch.nn as nn import torch.nn.functional as F def fixed_padding(inputs, kernel_size, dilation): kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1) pad_total = kernel_size_effective - 1 pad_beg = pad_tota...
""" Module for storing interaction profiles of Systems and SystemTypes. """ import collections as col import itertools as it class ProfileError(Exception): pass def get_inx_class_features(inx_class, system): features = [] for i, feature_type in enumerate(inx_class.feature_types): # find the inde...
"""Data used by this integration.""" from __future__ import annotations import asyncio from collections import defaultdict from typing import NamedTuple, cast from async_upnp_client import UpnpEventHandler, UpnpFactory, UpnpRequester from async_upnp_client.aiohttp import AiohttpNotifyServer, AiohttpSessionRequester ...
<gh_stars>0 from torch.nn import CrossEntropyLoss import torch.optim as optim import torch import argparse import sys sys.path.append("..") from model_pytorch import LeNet5 from dataloader import get_mnist # check if GPU is available device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") def load_...
<reponame>elifesciences-publications/genomic-features-survival #!/usr/bin/env python # encoding: utf-8 ''' variant_allele_freq.py Created by <NAME> on 2017-09-02. Given the set of mutation files and the variant allele frequency key, calculate variante allel frequency distributions. Copyright (c) 2018. All rights res...
import numpy as np def scatter_matrix(data): pass def _gca(): import matplotlib.pyplot as plt return plt.gca() def _gcf(): import matplotlib.pyplot as plt return plt.gcf() def hist(data, column, by=None, ax=None, fontsize=None): keys, values = zip(*data.groupby(by)[column]) if ax is None...
#!/usr/bin/env python # coding: utf-8 # In[1]: import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import math # In[45]: class Attention(nn.Module): """ 返回值: 返回的不是attention权重,而是每个timestep乘以权重后相加得到的向量。 输入: (batch_size, ...
<reponame>codejamninja/nb2plots # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Test scripts Test running scripts """ from __future__ import division, print_function, absolute_import from os.path import (join as pjoin, exists) from glob import glob...
<reponame>chachabooboo/king-phisher<gh_stars>1000+ """Schema v3 Revision ID: 24a4a626ff7c Revises: None Create Date: 2015-07-17 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = None import os import sys sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), *['..']...
<reponame>leilakhalili87/gbmc_v0<gh_stars>0 import util_funcs as uf import pad_dump_file as pdf import vv_props as vvp import lammps_dump_writer as ldw import lammps_script_writer as lsw import ovito.data as ovd from ovito.pipeline import StaticSource, Pipeline import ovito.modifiers as ovm from shutil import copyfile ...
<gh_stars>0 import pyautogui from time import sleep import pyperclip from datetime import datetime pyautogui.PAUSE = 1 def tres_esq(): pyautogui.press('left') sleep(0.6) pyautogui.press('left') sleep(0.6) pyautogui.press('left') sleep(0.6) def tres_dir(): pyautogui.press('right') sle...
<filename>LightFields/xmlFiles/generateXMLFiles.py import xml.etree.ElementTree as etree import xml.dom.minidom import subprocess import os import imageio import h5py import numpy as np def createXMLstring(filename,scaleVal,cameraPosX,cameraPosY): scene = etree.Element("scene",version="0.5.0") sensor = etree.SubEl...
<gh_stars>0 import pickle import numpy as np from pprint import pprint import cv2 import matplotlib.pyplot as plt from itertools import combinations from slam.utils import visualize2d, to_gridmap from collections import defaultdict from scipy.spatial import ConvexHull, convex_hull_plot_2d from sklearn.decomposition imp...
from functionality.shared_functions import create_event_tree, create_type_tree, add_event_to_file, turn_types_to_string from types import TracebackType from Event import Event from parse.match import parse_period from functionality.create_event_type import create_event_type from functionality.distance import get_distan...
<reponame>mheidir/BlueCatSG-SplunkApp-UnOfficial<gh_stars>1-10 import os import subprocess import warnings from api_exception import api_exception """ Various functions for peforming dynamic DNS operations via nsupdate. There are Python modules to do this directly but it's not clear how well debugged these are hence ...
<gh_stars>0 #!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np from tensorflow.python.summary.summary_iterator import summary_iterator from tensorflow.python.framework import tensor_util def getEventFileData(path): data = {} for event in summary_iterator(path): for value in even...
from werkzeug.exceptions import NotFound, MethodNotAllowed from werkzeug.routing import Map, Rule from werkzeug.wrappers import Response from lymph.testing import WebServiceTestCase from lymph.web.interfaces import WebServiceInterface from lymph.web.handlers import RequestHandler from lymph.web.routing import HandledR...
<filename>ros_ws/src/bluetooth_bridge/src/bluetooth_bridge_server_node.py #!/usr/bin/env python # -*- coding: utf-8 -*- ## @package docstring # This package provides the bridge between Bluetooth and ROS, both ways. # Initially it receives "String" messages and sends "String" messages # import rospy import math impo...
<filename>apps/organizations/models.py<gh_stars>0 """ This module provides the different ``models`` pertaining to the ``organizations`` app. """ from django.db import models from django.contrib.auth import get_user_model from django.utils.translation import gettext_lazy as _ from django.core.validators import MaxVal...
<reponame>rubenvillegas/icml2017hierchvid<gh_stars>10-100 import os import cv2 import sys import time import socket os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf import scipy.misc as sm import numpy as np import scipy.io as sio from os import listdir, makedirs, system from argparse import ArgumentPa...
<gh_stars>0 __author__ = 'Hao' import openpyxl import json from string import Template wb = openpyxl.load_workbook("../data/Inkjet Printing Process File Repository/Droplet Ejection/Trigger Waveform Graph Master Sheet.xlsx", data_only=True) waves = {key: {"id": key, "label": key} for key in wb.sheetnames} for wave i...
import uuid import datetime as dt import decimal import sqlalchemy as sa import pytest from sqlalchemy.dialects import postgresql, mysql from sqlalchemy.orm import column_property from marshmallow import Schema, fields, validate from marshmallow_sqlalchemy import ( fields_for_model, ModelConverter, proper...
<gh_stars>0 from app import app from flask import render_template, redirect, url_for from .forms import SearchForm, AddForm # %*%*%*%*%*%*%*%*%*%*%*%*%*%*%*% HOME %*%*%*%*%*%*%*%*%*%*%*%*%*%*%*% @app.route('/') def home(): return render_template('home.html') # %*%*%*%*%*%*%*%*%*%*%*%*%*%*%*% ...
import discord from discord.ext import commands import datetime from random import choice class Decisions(commands.Cog): "Polls and decision making commands" def __init__(self, bot): self.bot = bot @property def reactions(self): return { 1: "1️⃣", 2: "2️⃣", ...
<reponame>codehag/jsparagus<gh_stars>0 """Parse a grammar written in ECMArkup.""" import os from jsparagus import parse_pgen, gen, grammar, types from jsparagus.lexer import LexicalGrammar from jsparagus.ordered import OrderedFrozenSet ESGrammarLexer = LexicalGrammar( # the operators and keywords: "[ ] { } ,...
<gh_stars>0 """ Some utilities for working with spiders """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from itertools import izip_longest from scrapy.crawler import Crawler from scrapy.utils.project import get_project_settings import magic import subprocess #import pydocx f...
""" Admin configurations for django-invite project """ from django.conf import settings from django.contrib import admin, messages from django.forms import BooleanField, ModelForm from django.urls import reverse from django.utils.html import format_html from django.utils.translation import gettext as _ from invite.joi...
<filename>celseq2/diagnose.py #!/usr/bin/env python3 import argparse from .helper import print_logger from .helper import filehandle_fastq_gz from collections import Counter def get_dict_bc_has_reads(r1, bc_index, bc_seq_col): print(r1) with open(bc_index, 'rt') as fin: # next(fin) rows = map(...
import os from math import ceil, floor from .errors import InvalidCaptionsError from .webvtt import WebVTT from .structures import Caption MPEGTS = 900000 SECONDS = 10 # default number of seconds per segment __all__ = ['WebVTTSegmenter'] class WebVTTSegmenter(object): """ Provides segmentat...
"""The tests for the Modbus cover component.""" from pymodbus.exceptions import ModbusException import pytest from homeassistant.components.cover import DOMAIN as COVER_DOMAIN from homeassistant.components.modbus.const import ( CALL_TYPE_COIL, CALL_TYPE_REGISTER_HOLDING, CONF_INPUT_TYPE, CONF_LAZY_ERR...
# Copyright 2019 <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, softw...
<reponame>marssaxman/robocrate<filename>library.py import os import os.path import sys import shutil import json DIR = os.path.expanduser("~/.robocrate") LIBRARY = os.path.join(DIR, "library.json") _library = None _tracklist = None class Track(object): def __init__(self, fields): self._fields = fields ...
<filename>Lib/pyclbr.py """Parse a Python file and retrieve classes and methods. Parse enough of a Python file to recognize class and method definitions and to find out the superclasses of a class. The interface consists of a single function: readmodule(module, path) module is the name of a Python module, pat...
<filename>tests/test_transducer.py import myouji_kenchi # Given that the output depends on what goes into the attested myouji file I'm # hesitant to write too many tests in the blast radius of changes to that file class TestTransducer(): nbt = myouji_kenchi.MyoujiBackTransliteration() def assert_transliter...
import string, random from django.db import models from django.contrib.auth.models import User class base_element(models.Model): """ Base element, abstract class """ name = models.CharField(max_length=128) short_description = models.CharField(max_length=256) description = models.TextFie...
<filename>backend/flaskr/db.py # -*-codeing:utf-8 -*- import pymysql from flask import g def get_db(): """Connect to the application's configured database. The connection is unique for each request and will be reused if this is called again """ if 'db' not in g: g.db = pymysql.connect( host='localhost', ...
<reponame>DuncanSmith147/KVMS ##Copyright (c) 2014 <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 without limitation ##the rights to use, copy, modi...
""" Gridded data is already aggregated by month therefore we don't have daily gridded data, but this is importing to the same basic table type as if it were daily. So: Don't make a daily table Record what monthly aggregations are available We only use monthly aggregations on the map and ...
<gh_stars>0 #!/usr/bin/env python3 # # Author: <NAME> # License: BSD 2-clause # Last Change: Thu Jul 29, 2021 at 03:53 PM +0200 from yaml import safe_load from argparse import ArgumentParser from uncertainties import ufloat, UFloat from statsmodels.stats.proportion import proportion_confint ####################### #...
import json from collections import defaultdict from datasets.arrow_dataset import Dataset import torch from torch.utils.data.sampler import SequentialSampler from torch.utils.data import DataLoader, dataloader from transformers import default_data_collator from transformers import AutoTokenizer, EvalPrediction from u...
# 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 ...
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from os import path import copy from bes.common.check import check from bes.common.string_util import string_util from bes.compat.ConfigParser import ConfigParser from bes.compat.ConfigParser import NoOptionError from bes.compa...
<filename>calculate_linkage_disequilibria_Helen.py import sample_utils import config import parse_midas_data import os.path import os import pylab import sys import numpy import gzip import diversity_utils_Helen as diversity_utils import gene_diversity_utils import calculate_substitution_rates import clade_utils impor...
#!/usr/bin/env python # -*- coding:utf-8 -*- # # Copyright (c) 2013-present SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). import datetime import pathlib import shutil from . import darwincore_utils from . import darw...
import csv import json from collections import defaultdict from heapq import nlargest, nsmallest from typing import List, Tuple, Dict from pathlib import Path import shutil import random import colorsys import numpy as np from io import StringIO from math import isclose CONFIDENCE_LOCATION = -1 TAG_CONFIDENCE_LOCATIO...
<filename>pyaedt/modules/LayerStackup.py """ This module contains these classes: `Layer` and `Layers`. This module provides all layer stackup functionalities for the Circuit and HFSS 3D Layout tools. """ from __future__ import absolute_import # noreorder from pyaedt.generic.general_methods import pyaedt_function_han...
#!/usr/bin/env python """Ninja build configurator for mdns library""" import sys import os sys.path.insert( 0, os.path.join( 'build', 'ninja' ) ) import generator dependlibs = [ 'network', 'foundation' ] generator = generator.Generator( project = 'mdns', dependlibs = dependlibs, variables = [ ( 'bundleidentifier'...
<filename>tests/test_ledfx.py #!/usr/bin/env python # -*- coding: utf-8 -*- import time import pytest import numpy as np from ledfxcontroller.devices import DeviceManager from ledfxcontroller.effects.rainbow import RainbowEffect from ledfxcontroller.effects.spectrum import SpectrumAudioEffect from ledfxcontroller.effe...
<gh_stars>0 #!/usr/bin/env python3 ''' To run this script with aegea do: aegea batch submit --command="cd /mnt; git clone https://github.com/chanzuckerberg/idseq-copy-tool.git; cd idseq-copy-tool; pip3 install schedule; python3 main.py " --storage /mnt=500 --volume-type gp2 --ecr-image idseq_dag --memory 120000 --q...
<gh_stars>0 import datetime from api.qymatix import uploader # from . import file_uploader class EtlBase(): def __init__(self, dbname, file_name=None, since=None): import datetime from api.qymatix import uploader self.dbname = dbname self.file_name = file_name self.sinc...
#!/usr/bin/env python import os import argparse import sys import nibabel as nib from builtins import str import matplotlib.pyplot as plt import numpy as np import nipype.algorithms.confounds as npalg import nilearn.plotting as nlp import nilearn.image as nimg import nilearn.signal as sgn import configparser co...
<reponame>omerk2511/dropbox from Tkinter import * from common import Codes from ..controllers import FileController # EditorController (?) from ..handlers.data import Data class Editors(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.elements = {...
#!/usr/bin/env python """ navigation using only machine learning model @author: <NAME> """ from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from sensor_msgs.msg import Imu from sensor_msgs.msg import Image from cv_bridge import CvBridge from PIL import Image ...
<gh_stars>0 #!/usr/bin/python3 import os import sys import shutil import click import importlib.util import atexit from typing import Any import yaml import builtins from requre.import_system import upgrade_import_system, UpgradeImportSystem from requre.postprocessing import DictProcessing from requre.storage import ...
<filename>leo.py<gh_stars>1-10 #!/usr/bin/python import logging, sys import RPi.GPIO as GPIO import time from LMSTools import LMSDiscovery, LMSServer, LMSPlayer logging.basicConfig(stream=sys.stdout, level=logging.WARNING) # player control pin_play_pause = 25 pin_track_previous = 5 pin_track_next = 6 pin_volu...
import numpy as np import os import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as mtick #import helper functions import helpers as hp dataset = "web-Google-diades" pagerankFilePath = "./results/pageranks/" + dataset + ".data" serialPagerankFilePath = "./results/serial/pageranks/" + dataset ...
<reponame>rsdoherty/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
<filename>source/classify/evaluation.py import numpy as np from sklearn import svm from sklearn.metrics import confusion_matrix, roc_auc_score # randomly permutes in equal amount and segments # Samples,labels by a factor of "fact" # Similarity Touple: # (S1,S2,...,Sk) where k the number of categories # and S1.size = n...
<gh_stars>0 import io from torchtext.utils import download_from_url, extract_archive, unicode_csv_reader from torchtext.experimental.datasets.raw.common import RawTextIterableDataset URLS = { 'AG_NEWS': {'train': 'https://raw.githubusercontent.com/mhjabreel/CharCnn_Keras/master/data/ag_news_csv/train.csv',...
""" Copyright (c) 2020 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the material herein must be in accordance with the t...
<reponame>basicskywards/cyclegan-yolo # Prepare COCO annotation for training YOLOv3 # To convert VOC annotation format to COCO from __future__ import print_function, division import os #import pandas as pd import numpy as np def read_txt(txt_path): f = open(txt_path, "r") for line in f: yield line def parse_l...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import random as rn from sklearn.metrics import roc_auc_score import sys import os from lib_util import get_target,get_opt import lightgbm as lgb from keras.layers import Input, Embedding, Dense, Flatten, Dropout, concatenate, BatchNormalization, SpatialDr...
<gh_stars>1-10 #!/usr/bin/env python # Author: <NAME> (t-sigai at microsoft dot com)) import os import cv2 from datetime import date import numpy as np import matplotlib.ticker as ticker np.set_printoptions(threshold=np.inf) import argparse from zernike import RZern import pdb # external modules from ...
<filename>source/FnAssetAPI/ManagerFactory.py import os from . import logging from .core import PluginManager from .Manager import Manager __all__ = ['ManagerFactory',] class ManagerFactory(object): """ A Factory to manage @ref python.implementation.ManagerPlugin derived plugins and instantiation of Manager...
import os import re import sys import time import ctypes import signal import socket import pyping import ftplib import poplib import shutil import hashlib import smtplib import logging import binascii import platform import requests import netifaces import subprocess import irc.client import ConfigParser from collecti...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
<gh_stars>0 import urllib3 import urllib.parse import re import json class places(object): def __init__(self, auth, place): instance = urllib3.PoolManager() quotedParams = urllib.parse.quote(place) placeRequest = instance.request("GET", f"https://maps.googleapis.com/maps/api/place/...
<filename>Preparing_input_rasters.py ################################### ######## Code to prepare the input rasters ################################### # Input files CHborder_path = "D:\\Geodata\\Raw_data\\SwissBOUNDARIES3D\\swissBOUNDARIES3D\\BOUNDARIES_2020\\DATEN\\swissBOUNDARIES3D\\SHAPEFILE_LV95_LN02\\sw...
<reponame>TX-Yeager/LiTS---Liver-Tumor-Segmentation-Challenge from __future__ import print_function, division import SimpleITK as sitk import numpy as np import cv2 import os trainImage = "D:\Data\LIST\\3dPatchdata_25625616\Image" trainLiverMask = "D:\Data\LIST\\3dPatchdata_25625616\MaskLiver" trainTumorMask = "D:\Dat...
<reponame>cajohare/CompAxion #================================PlotFuncs.py==================================# # Created by <NAME> 2021 #==============================================================================# from numpy import * from numpy.random import * import matplotlib as mpl import matplotlib.pyplot as pl...
<reponame>Wipersee/profielp # Generated by Django 3.2.8 on 2021-11-18 17:46 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0001_initial'), ...
#!/usr/local/sbin/charm-env python3 # # Copyright 2020 Canonical Ltd # # 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 app...
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from PIL import Image import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torchvision.transforms as T...
<reponame>Suitceyes-Project-Code/Tactile-Brush-Python from Stroke import ActuatorPoint, Stroke, EPSILON import math class ActuatorStep: __slots__ = "line", "column", "intensity", "duration", "max_intensity" def __init__(self, column : int, line : int, intensity : float, duration : float, max_intensity : float...
<reponame>phuerta-tc/tcex """Case / Cases Object""" # standard library from typing import TYPE_CHECKING, Union # first-party from tcex.api.tc.v3.api_endpoints import ApiEndpoints from tcex.api.tc.v3.artifacts.artifact_model import ArtifactModel from tcex.api.tc.v3.case_attributes.case_attribute_model import CaseAttrib...
<filename>cocutils/dumpsc.py<gh_stars>0 # -*- coding:utf-8 -*- # Credits: https://github.com/123456abcdef/cr-sc-dump/blob/master/dumpsc.py import argparse import hashlib import io import lzma import os from PIL import Image class Reader(io.BytesIO): def __init__(self, stream): super().__init__(stream) ...
from functools import reduce from scipy.sparse import csr_matrix from scipy.sparse import kron import numpy as np import cirq from openfermion.linalg import qubit_operator_sparse from openfermion.ops import QubitOperator from quchem.Qcircuit.Ansatz_quantum_circuit_functions import full_exponentiated_PauliWord_circuit...
<reponame>alisaifee/youtrack-cli import six from pyutrack.util import Type # Admin types @six.add_metaclass(Type) class Permission(object): __list__ = {'url': 'admin/permission', 'hydrate': False} __render__ = ('name', 'description') __label__ = '%(name)s' @six.add_metaclass(Type) class Role(object): ...
# -*- coding: utf8 -*- import sys from locust import HttpLocust, TaskSet, task from requests_toolbelt import MultipartEncoder from random import randrange import json import requests import variables import time import datetime import evotilities def mpiAcuerdos(Mpi,response_idCaso,r_User): #########################...
<gh_stars>10-100 import numpy as np import ctypes from scipy.optimize import minimize from scipy.sparse import coo_matrix, csr_matrix, csc_matrix import test_math m0 = int(11e0) m1 = int(11e0) m2 = int(13e0) n0 = int(12e0) n1 = int(14e0) n2 = int(16e0) p = int(3e0) q = int(3e0) k = int(4e0) lam = 2.5 w_main = 3.2 w_u...
from collections import OrderedDict from .compat import is_py2, str, bytes, integer_types, string_types from .util import pack_bytes_into from collections import namedtuple from struct import Struct, error as struct_error import inspect getargspec = getattr(inspect, "getfullargspec", inspect.getargspec) (SCRIPT_DATA...
import base64 import keyword import re from abc import ABCMeta, abstractmethod from collections.abc import Mapping import attr from six import exec_, iteritems, add_metaclass, text_type, string_types from marshmallow import missing, Schema, fields from marshmallow.base import SchemaABC from .compat import is_overridd...
# https://github.com/taki0112/ResNet-Tensorflow import ops_resnet import tensorflow as tf class ResNet(object): def __init__(self, feature_space_dimension, n_classes, n_res_blocks=18, margin_in_loss=0.25, is_train=True): self.img_size = 28 self.c_dim = 1 self.res_n = n_res_blocks ...
import sys import os from os.path import stat from argparse import ArgumentParser import pickle layer_files = ["/home/nannan/dockerimages/layers/hulk1/hulk1_layers_less_1g.lst"]#, "/home/nannan/dockerimages/layers/hulk4/hulk4_layers_less_1g.lst"] out_dir = "/home/nannan/dockerimages/layers/hulk1/" stored_dat_file = os...
<filename>apps/users/models.py # -*- coding: utf-8 -*- import base64 import hashlib from django.conf import settings from django.contrib.auth.models import User from django.db import models from innovate.models import BaseModel from innovate.utils import get_partition_id, safe_filename, ImageStorage from tower impo...
<filename>Scraper/hunter_api.py import json from pyhunter import PyHunter from django.conf import settings from .models import EmailModel, OdinList, Company # This is the hunter.io api code class HunterIO: def __init__(self, api_key): # Initializing the pyhunter object with our api key self.hun...
<reponame>ETH-NEXUS/scout """Tests for the cases controllers""" from flask import Flask, url_for from scout.server.extensions import store from scout.server.blueprints.cases.controllers import case, case_report_content def test_case_report_content(adapter, institute_obj, case_obj, variant_obj): adapter.case_coll...
import base64 import re import uuid from collections import defaultdict from decimal import Decimal from textwrap import dedent import requests import gevent import netaddr from nacl.public import Box from contextlib import ContextDecorator from jumpscale.clients.explorer.models import DiskType, NextAction, WorkloadTy...
import os import time import datetime import socket import platform import sys from colorama import Fore, Back, Style while True: iplist=sys.argv[1] passlist=sys.argv[2] if os.path.exists('./logs'): out=open('logs','a') out.close() else: out=open('logs','w') out.close() choice = input ("Which exploit do ...
<filename>src/pymyinstall/win_installer/win_setup_main.py # -*- coding: utf-8 -*- """ @file @brief Functions to prepare a setup on Windows """ from __future__ import print_function import os import shutil import sys import warnings import datetime from ..installhelper.install_cmd_helper import update_pip, run_cmd, py...
<reponame>nixballs/ungoogled-chromium # ungoogled-chromium: A Google Chromium variant for removing Google integration and # enhancing privacy, control, and transparency # Copyright (C) 2016 Eloston # # This file is part of ungoogled-chromium. # # ungoogled-chromium is free software: you can redistribute it and/or modi...
import requests from flask import request, jsonify from .base import Base from .json_validate import SCHEMA class UserCoupons(Base): def get(self): """ { "userCoupons": [ { "userId": xxx, "storeId": yyy, "coup...
<reponame>mohsenari/aws-lex-v2-cfn-cr #!/usr/bin/env python3.8 ################################################################################ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed un...
<reponame>annehulsey/high-resolution_post-earthquake_recovery_simulation_of_safety_cordons from .base import * def assign_impeding_factors(community_damage, rc_triggers, if_idx, if_pool, max_rc, weeks): # initialize the output [n_rups, n_bldgs, _, n_sims] = community_damage.shape time = np.zeros([n_rups, ...
<filename>tests/common/test_run/ascend/fused_cast_conv_run.py<gh_stars>100-1000 # Copyright 2019-2021 Huawei Technologies Co., Ltd # # 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://w...