input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>jenka13all/Master-Thesis-Multilingual-Longformer #!/usr/bin/env python import argparse import copy import datetime from dataclasses import dataclass, field import functools import logging import math import os import pickle import re import sys import time import threading from typing import Optional import...
self.app.get(path, headers=self.json_headers) assert resp.status_code == 200 assert resp.content_type == CONTENT_TYPE_APP_JSON assert len(resp.json["jobs"]) == 2 for job in resp.json["jobs"]: base_uri = sd.jobs_service.path + "/{}".format(job) path = get_path_kvp(base_uri) resp = self.app.get(path, headers=self....
else: h = spec.peak_heights[peak_idx] / htot size = [h, 1. - h] tit = '% sum of heights' colors = ['k', 'w'] plt.pie(size, colors=colors, startangle=90, radius=0.25, center=(0, 0), frame=False) ax_pie.axis('equal') ax_pie.set_title(tit) if axes3 is None: return fig, ax def make_composite_peak(self, ...
chemokine secretion', disabled=True, layout=desc_button_layout) description_btn.style.button_color = 'lightgreen' row = [name_btn, self.float891, units_btn, description_btn] box955 = Box(children=row, layout=box_layout) name_btn = Button(description='nuclear_NFkB', disabled=True, layout=name_button_layout) name_...
#!/usr/bin/python3 import os import time import sys os.system("clear") print('''\033[91m CREATED BY Hironotori ''') def slowprint(s): for c in s + '\n' : sys.stdout.write(c) sys.stdout.flush() slowprint(''' \033[93m [1] apt-pkg pip-pip3 [2] apt-pkg python [3] apt-pkg python2 [4] apt-pkg bash [5] apt-pkg git [6] a...
""" The pipeline module contains the transformations and actions API of PyFunctional """ from __future__ import division, absolute_import from operator import mul, add import collections from functools import reduce, wraps, partial import json import csv import sqlite3 import re import six from tabulate import tabu...
<reponame>vgoliber/airline-hubs # Copyright 2021 D-Wave Systems 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 appl...
maybe infer different dtype level_values = _maybe_casted_values(lev, lab) new_obj.insert(0, name, level_values) new_obj.index = new_index if not inplace: return new_obj # ---------------------------------------------------------------------- # Reindex-based selection methods @Appender(_shared_docs['isna'] % ...
<reponame>bopopescu/mysql-dbcompare # # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. #...
<filename>germany_compliance/germany_compliance/report/datev/datev.py # Copyright (c) 2022, Frappe Technologies Private Limited and contributors # For license information, please see license.txt """ Provide a report and downloadable CSV according to the German DATEV format. - Query report showing only the columns...
is clicked and last_click set to 20 def on_click(self, mouse_x, mouse_y): if self.rect.collidepoint(mouse_x, mouse_y)and self.last_click == 0 and not self.grey: self.clicked = True self.last_click = 20 # Called every frame, checks if mouse is inside button but doesn't need to be clicked def on_hover(self, mouse_...
), grants as ( select coalesce( string_agg(format( E'GRANT %s ON FUNCTION {0} TO %s%s;\n', privilege_type, case grantee when 'PUBLIC' then 'PUBLIC' else quote_ident(grantee) end, case is_grantable when 'YES' then ' WITH GRANT OPTION' else '' end), ''), '') as text from privileges ) select (select tex...
{} command = {} command_list = [] self.queue_dict = {} for i in args: tmp[i] = self.command_dict[i] for k, v in tmp.items(): command_list = command_list + v for i in command_list: command = dict(command, **i) for i in command: self.queue_dict[i] = Queue.Queue() # command = [dict(command, **command_list[...
# Copyright (c) 2021 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 required by applicabl...
<filename>test/test_punt.py #!/usr/bin/env python3 import binascii import random import socket import os import threading import struct import copy import fcntl import time from struct import unpack, unpack_from try: import unittest2 as unittest except ImportError: import unittest from util import ppp, ppc from re...
address ApiTypes.AccessLevel accessLevel - Level of access (permission) to our API. DateTime? expires - string newTokenName - New name of the AccessToken. (default None) IEnumerable<string> restrictAccessToIPRange - Comma separated list of CIDR notated IP ranges that this token can connect from. (default No...
#!/usr/local/env python3 import os import pathlib import subprocess from concurrent import futures class Qiime2Methods(object): @staticmethod def make_folder(folder): """ Create output folder. :param folder: string. Output folder path. :return: """ # Will create parent directories if don't exist and will no...
""" Mostly copy-paste from DINO and timm library: https://github.com/facebookresearch/dino https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py """ import warnings import math import torch import torch.nn as nn import torch.utils.checkpoint as checkpoint from timm.models.laye...
- 1 dic["id"] = num if len(items) > 0: zone_bucket.append(dic) #LOG.info('zone_bucket----%s'%zone_bucket) return zone_bucket, num def _get_storage_group_bucket(self, storage_groups, zones, num): storage_group_bucket = [] for storage_group in storage_groups: dic = {} dic["name"] = storage_group items = [] w...
<filename>policies.py # Copyright 2021 DeepMind Technologies 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 appl...
<reponame>zbraniecki/pontoon<gh_stars>1-10 """ Models for working with remote translation data stored in a VCS. """ import logging import os import shutil from itertools import chain from datetime import datetime from django.utils import timezone from django.utils.functional import cached_property from pontoon.base ...
+ 0.0219849*m.x301 - 0.00939134*m.x302 + 0.203443*m.x303 == 0) m.c207 = Constraint(expr= - m.x102 + 0.101389*m.x204 + 0.00922513*m.x205 + 0.0026992*m.x206 + 0.00246784*m.x207 + 0.00231482*m.x208 - 0.00125222*m.x209 - 0.00392467*m.x210 - 0.0046966*m.x211 - 0.0142117*m.x212 - 0.00150584*m.x213 - 0.00472481*m.x214 - 0...
<filename>kickstart-menu/menu.py #!/usr/bin/env python # pylint: disable=too-many-ancestors """Menu system.""" import sys import npyscreen import classes import datetime import re from kickstart import * def str_ljust(_string): """Add padding to string.""" pad = 20 return str(_string.ljust(pad, ".") + ":") def up...
<reponame>etiennesky/ece2cmor3 import datetime import json import logging import os import re import resource import threading import numpy from ece2cmor3 import cmor_target, cmor_source, cmor_task, cmor_utils, grib_file, cdoapi # Log object. log = logging.getLogger(__name__) gridpoint_files = {} spectral_files = {...
"NT": 2552, "▁vẹn": 2553, "▁Lịch": 2554, "chè": 2555, "▁bụi": 2556, "I": 2557, "▁2013": 2558, "6%": 2559, "▁hẹp": 2560, "▁khoáng": 2561, "▁Champions": 2562, "▁hung": 2563, "▁6.": 2564, "▁Olympic": 2565, "ly": 2566, "-3": 2567, "se": 2568, "ley": 2569, "▁Barca": 2570, "▁trọn": 2571, "):": 2572, "▁mu...
import numpy as np import matplotlib.pyplot as plt from scipy.special import erfc import lmfit import logging from pycqed.analysis import analysis_toolbox as a_tools from pycqed.analysis.tools import data_manipulation as dm_tools ################################# # Fitting Functions Library # ########################...
print("entro al From2") # Subquerie print(Qffrom.clist) print(Qffrom.id) # WHERE if isinstance(Qwhere, SWhere): print("entro al Where") for col in Qwhere.clist: if isinstance(col, SWhereCond1): print("Es where1") print(col.conds) # print(col.conds.param.opIzq.valor) # print(col.conds.param.operador) # pri...
<filename>Code/frontend.py import streamlit as st import pandas as pd import hashlib import mysql.connector as mysql from streamlit import caching import os def make_hashes(password): return hashlib.sha256(str.encode(password)).hexdigest() def check_hashes(password,hashed_text): if make_hashes(password) == hashed_t...
<filename>thermo/flash.py # -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2019, 2020 <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), ...
0x/0X, as with integer literals in code. Base 0 means to interpret exactly as a code literal, so that the actual base is 2, 8, 10, or 16, and so that int('010', 0) is not legal, while int('010') is, as well as int('010', 8). isinstance(object, classinfo) # Return True if the object argument is an instance of the class...
0, "Inca: Map 29 (SW)", [], False, [], [], [], [], [], [], [], []], 75: [False, [72,99], 2, [1,5,0,b"\x00"], 0, "Inca: Map 29 (SE)", [], False, [], [], [], [], [], [], [], []], 76: [False, [], 2, [1,5,0,b"\x00"], 0, "Inca: Map 29 (statue head)", [], False, [], [], [], [], [], [], [], []], 77: [False, [], 2, [1,5,0,b...
clr = rgb(3) lw1, lw2 = 6, 1 grey = 0.9 * array([1,1,1]) # plot( y.t, y.amp, color=grey, linewidth=lw1, label='NR' ) plot( y.t,-y.amp, color=grey, linewidth=lw1 ) plot( y.t, y.plus, color=grey, linewidth=lw1 ) plot( y.t, y.cross, color=grey, linewidth=lw1 ) # plot( g.t, g.amp, color=0.8*clr[1], linewidth=lw2...
<reponame>ryanpetrello/sdb from __future__ import print_function import cmd import contextlib import errno import logging import os import pprint import re import rlcompleter import select import signal import socket import sys import termios import threading import traceback import tty from multiprocessing import pro...
import os import errno import wget import zipfile import glob import librosa import scipy import math from tqdm import tqdm import torch import torch.utils.data import torchvision.datasets as datasets import torchvision.transforms as transforms import numpy as np import scipy.io.wavfile as wavf class MNIST: """ MNI...
= event.index, added = event.added, removed = event.removed ) #--------------------------------------------------------------------------- # Performs an undoable 'append' operation: #--------------------------------------------------------------------------- def _undoable_append ( self, node, object, data, make...
from django.shortcuts import reverse from django.core.files.storage import default_storage from rest_framework.test import APIRequestFactory from trackstats.models import Metric, Period import pytest from pytest import approx from pathlib import Path import datetime import os.path import zipfile from io import BytesI...
int16/10, int16) broadcast; setLanded() airecv clsend; requestLeave() airecv clsend; }; dclass DistributedLawbotChair : DistributedObject { setBossCogId(uint32) required broadcast ram; setIndex(uint8) required broadcast ram; setState(char) broadcast ram; showCogJurorFlying() broadcast; setToonJurorIndex(int8) b...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 o...
<gh_stars>1-10 import torch import torch.nn as nn import torch.nn.functional as F from typing import List from torch.nn import init from torchvision import models from torch.nn.utils import spectral_norm # Initialization of model def weights_init_normal(m: nn.Module): classname = m.__class__.__name__ if classname....
<gh_stars>1-10 import hashlib from typing import List from ecc import ( S256Point, Signature, ) from helper import ( hash160, hash256, ) from timelock import Locktime, Sequence def is_number_op_code(op_code: bytes) -> bool: return op_code in OP_CODE_TO_NUMBER def number_to_op_code(n: int) -> bytes: '''Return...
lays esteem", "And gives thy pen both skill and argument.", "Rise, resty Muse, my love's sweet face survey,", "If Time have any wrinkle graven there;", "If any, be a satire to decay,", "And make Time's spoils despised every where.", "Give my love fame faster than Time wastes life,", "So thou prevent'st hi...
from dataclasses import dataclass from datetime import datetime from pathlib import Path from typing import Any, Dict, Tuple, List import pytz from ..api import MdApi, TdApi from vnpy.event import EventEngine from vnpy.trader.utility import get_folder_path from vnpy.trader.constant import ( Exchange, Product, Direc...
import seaborn as sns import matplotlib import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib.ticker import ScalarFormatter from matplotlib import lines import pandas as pd import numpy as np from pathlib import Path import os import sys import csv im...
*args, **kwargs): self.current_authenticated_user = get_current_authenticated_user() super(Adressen, self).save(*args, **kwargs) def delete(self, *args, **kwargs): self.current_authenticated_user = get_current_authenticated_user() super(Adressen, self).delete(*args, **kwargs) signals.post_save.connect(assign_pe...
["string", "null"], }, "section": { "description": "Section that the parameter belongs to", "type": ["string", "null"], }, }, "type": "object", } }, "properties": { "force": { "description": "If set to True then both new and running task hyper params can be deleted. Otherwise only the new task ones. Default...
322 X86_INS_LLDT = 323 X86_INS_LMSW = 324 X86_INS_OR = 325 X86_INS_LOCK = 326 X86_INS_SUB = 327 X86_INS_XOR = 328 X86_INS_LODSB = 329 X86_INS_LODSD = 330 X86_INS_LODSQ = 331 X86_INS_LODSW = 332 X86_INS_LOOP = 333 X86_INS_LOOPE = 334 X86_INS_LOOPNE = 335 X86_INS_RETF = 336 X86_INS_RETFQ = 337 X86_INS_LSL = 338 X86_INS_L...
how accesses are split before the device is accessed. A device mapping may swap the bytes of an access based on the <param>swap</param> argument, that should be one of <tt>none</tt>, <tt>bus</tt>, <tt>bus-trans</tt> and <tt>trans</tt>. For a description of these, see the documentation of the <attr>map</attr> attribute ...
def dataCleaning(marriageNum='Full', classNum=2, dropColumns=True): ''' This is the data cleaning function for the CE264 final project: Marriage Analysis Return a pandas data frame and a numpy array: data (X) and observation (y) The name of each column refers to the JGSS data codebook For some combined categorie...
suggestion_models.TARGET_TYPE_EXPLORATION, self.target_id_1, 1, self.author_id_1, self.add_translation_change_dict, 'test description') # Assert that there is one translation suggestion with the given # exploration id found. self.assertEqual( len( suggestion_services .get_translation_suggestion_ids_with_exp_id...
+ "=" + str(value) + ' ' + state, "vm-alter")[2] def appdrsalter(self, cloud_name, identifier, attribute, value): return self.passive.alter_object({}, cloud_name + ' ' + identifier + ' ' + attribute + "=" + str(value), "aidrs-alter")[2] def vmcalter(self, cloud_name, identifier, attribute, value) : return self....
<reponame>seanandrews/DSHARP_CPDs<filename>CSD_modeling/geom_tests/reduction_utils.py """ Functions useful for data reduction """ import os import matplotlib.pyplot as plt def LSRKvel_to_chan(msfile, field, spw, restfreq, LSRKvelocity): """ Identifies the channel(s) corresponding to input LSRK velocities. Useful f...
from datetime import timedelta from sys import maxint import unittest from webob import Request from sqlalchemy import null import pecan from draughtcraft import model from draughtcraft.lib.units import InvalidUnitException from draughtcraft.tests import TestModel class TestRecipeAddition(unittest.TestCase): def ...
<reponame>neeker/chromium_extract<gh_stars>10-100 #!/usr/bin/python # # Copyright (c) 2011 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. """Unittest for generate_gyp_py. It's tough to test the lower-level GetSourceFiles...
set name]') if arg[1] != '=' or arg[2] != '{' or arg[-1] != '}': raise ValueError('[Set specification must be in format "set_name = {element1, element2, ...}"]') set_elements_string = arg[3:-1] list_dict[arg[0]] = parse_list_elements(set_elements_string) set_dict[arg[0]] = parse_set_elements(set_elements_string)...
0.5*m.b90*m.b95 + 0.5*m.b90*m.b97 + 0.5*m.b90*m.b98 + 0.5*m.b90*m.b99 + 0.5*m.b90* m.b103 + 0.5*m.b90*m.b104 + 0.5*m.b90*m.b107 + 0.5*m.b90*m.b109 + m.b90*m.b111 + m.b90*m.b114 + m.b90*m.b115 + m.b90*m.b118 + 0.5*m.b90*m.b119 + 0.5*m.b90*m.b282 + 0.5*m.b90*m.b290 + 0.5*m.b90* m.b292 + 0.5*m.b90*m.b294 + 0.5*m.b90*m...
True)].copy() if eod_nogeo.empty == False: #eod_nogeo.fillna({"coordinatePrecision": 0.00001}, inplace=True) eod_nogeo["gps_accuracy_m"] = np.where(eod_nogeo["eventDate"].apply(lambda x: datetime.strptime(x, "%Y-%m-%dT%H:%M:%S").year) < 2000, 100, 30) eod_nogeo["effort_distance_m"] = 8047 # eBird best practices all...
i in sm.xrange(len(images))]) assert len(caught_warnings) >= 1 assert "deprecated" in str(caught_warnings[-1].message) def test_reduce_to_nonempty(): kpsois = [ ia.KeypointsOnImage([ia.Keypoint(x=0, y=1)], shape=(4, 4, 3)), ia.KeypointsOnImage([ia.Keypoint(x=0, y=1), ia.Keypoint(x=1, y=0)], shape=(4, 4, 3)), ...
<gh_stars>0 #!/usr/bin/python -tt """This implements the OpenShift-specific logic for validating Yum repositories """ import sys from yumvalidator import repo_db from yumvalidator.check_sources import CheckSources from itertools import chain from yum import Errors import logging OSE_PRIORITY = 10 RHEL_PRIORITY = 20...
<reponame>s0nskar/sunpy # Author: <NAME> <<EMAIL>> # # This module was developed with funding provided by # the Google Summer of Code (2013). from __future__ import absolute_import from abc import ABCMeta, abstractmethod import os from sqlalchemy.orm import make_transient from sqlalchemy.exc import InvalidRequestErr...
import time from collections import namedtuple from enum import IntEnum from os.path import join from ovos_utils import resolve_ovos_resource_file, resolve_resource_file from ovos_utils.log import LOG from ovos_utils.messagebus import wait_for_reply, get_mycroft_bus, Message from ovos_utils.system import is_installed,...
<filename>pytorch_blade/torch_blade/onnx_backends/backend_testbed.py # Copyright 2022 The BladeDISC 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.ap...
import queue import subprocess from time import sleep from enum import Enum from classes.MediaLibrary import MediaLibrary from classes.MediaPlayerInfo import MediaPlayerInfo, CurrentTrackInfo, TrackInfo import json import musicbrainzngs as m import libdiscid class MediaPlayer: """ Contains logic for controlling mpv...
<reponame>maparent/leo-editor #@+leo-ver=5-thin #@+node:ekr.20031218072017.3320: * @file leoNodes.py '''Leo's fundamental data classes.''' use_zodb = False #@+<< imports >> #@+node:ekr.20060904165452.1: ** << imports >> (leoNodes) import leo.core.leoGlobals as g import leo.core.signal_manager as sig # if g.app and g.ap...
host. For other cases, this argument has no effect. """) add_docstr_all('cos', r""" cos() -> Tensor See :func:`torch.cos` """) add_docstr_all('cos_', r""" cos_() -> Tensor In-place version of :meth:`~Tensor.cos` """) add_docstr_all('cosh', r""" cosh() -> Tensor See :func:`torch.cosh` """) add_docstr_all('cos...
<filename>sdk/python/pulumi_google_native/jobs/v3/_inputs.py # 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, Optio...
return self._build(sparse, aligned) def _build_pattern(self, residues): """ Build and return a sparse regular rexpression for C{residues}. """ fragments = [] for rn, r in enumerate(residues): res_name = self._encode(r) if rn == 0: # First residue, start a new fragment: fragments.append([res_name]) eli...
find an empty space, quitting.") # Choose the farthest empty space for maximum drag chosen_space = spaces[np.argmax(spaces.sum(axis=1))] # An arbitrary position in the top left region drag_location = (200, 200) # Drag self.input_handler.click( *chosen_space, *chosen_space, button=None, raw=True, speed_factor=...
(im2.shape[1]-im1.shape[1])/2 bgdmodel = np.zeros((1, 65), np.float64) fgdmodel = np.zeros((1, 65), np.float64) mask = np.zeros(im1.shape[:2], dtype=np.uint8) #TODO - maybe find something better than median as the threshold # x0, x1, y0, y1 = [] # mask[y0:y1, x0:x1] = 0 # print('BG'+str(rectangle)) # cv2.GC_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2019-07-29. # 2019, SMART Health IT. import sys from dataclasses import dataclass from typing import ClassVar, Optional, List from .fhirabstractbase import empty_list from ....
<gh_stars>10-100 import tensorflow as tf from tf_utils import ops as _ops def norm(value, name_or_scope=None): with tf.variable_scope(name_or_scope, default_name='norm', values=[value]): # import ipdb # ipdb.set_trace() # value.get_shape().assert_has_rank(1) return tf.sqrt(tf.reduce_sum(tf.square(value))) de...
<filename>envi/archs/arm/disasm.py import sys import struct import traceback import envi import envi.bits as e_bits from envi.archs.arm.const import * from envi.archs.arm.regs import * # FIXME: codeflow needs to identify the following pattern as a call with fallthrough # (currently identifying the xref and making th...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This module provides scrapers for a variety of feeds and web pages. """ import os import re import time import json import requests from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.firefox.options import Options from helpers import...
if 42 - 42: iII111i % i1IIi + Ii1I if 74 - 74: O0 * I11i * OoOoOO00 / Ii1I / iIii1I11I1II1 * I1IiiI if 59 - 59: I1IiiI - OoOoOO00 * ooOoO0o / O0 if 54 - 54: Oo0Ooo % iIii1I11I1II1 * Oo0Ooo i1I1i1Iiiiiii = { } for Ooooo00 in lisp_db_list : for iIII in Ooooo00 . rloc_set : lisp_update_local_rloc ( iIII ) if ( iII...
<gh_stars>10-100 # 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, overlo...
}, params_map={ 'all': [ 'forgot_password_request', ], 'required': [ 'forgot_password_request', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'forgot_password_request': (ForgotPasswordRequest,), }, 'attribute_map': ...
import unittest import pathlib import cpptypeinfo from cpptypeinfo.usertype import (Field, Struct, Pointer, Param, Function) HERE = pathlib.Path(__file__).absolute().parent IMGUI_H = HERE.parent / 'libs/imgui/imgui.h' parser = cpptypeinfo.TypeParser() EXPECTS = { 'ImDrawChannel': parser.parse('struct ImD...
<reponame>sychen6192/Computer-Vision<filename>SFM/SFM.py #!/usr/bin/env python # coding: utf-8 # In[282]: import cv2 import matplotlib.pyplot as plt import numpy as np import random from tqdm.notebook import tqdm from math import sqrt import mpl_toolkits.mplot3d.axes3d as p3 plt.rcParams['figure.figsize'] = [15, 15]...
# -*- coding: utf-8 -*- """ Created on Wed Oct 7 17:35:28 2015 @author: oligschlager """ import pandas as pd import seaborn as sns import numpy as np sns.set_style('white') ############################################################################## #################### Creative Achievement Questionnaire #####...
#!/usr/local/sci/bin/python2.7 #***************************** # # merge _day and _night netCDF files # # #************************************************************************ ''' Author: <NAME> Created: March 2016 Last update: 12 April 2016 Location: /project/hadobs2/hadisdh/marine/PROGS/Build -------------------...
<filename>ptpip/ptpip.py import uuid import time import socket import struct class PtpIpConnection(object): """docstring for PtpIP""" def __init__(self): super(PtpIpConnection, self).__init__() self.session = None self.session_events = None self.session_id = None self.cmd_queue = [] self.event_queue = [] se...
import os import sys import pytest import tempfile import time import random from collections import defaultdict import queue import ray from ray._private.test_utils import SignalActor from ray.util.multiprocessing import Pool, TimeoutError def teardown_function(function): # Delete environment variable if set. if ...
"-" + vm3_macvlan_mac_addr + \ "-" + "0.0.0.0/32", "Mac route is absent in EVPN table. " # checking bridge table peer = self.agent_inspect[vm2_node_ip].get_vna_layer2_route( vm2_vrf_id, mac=vm3_macvlan_mac_addr)['routes'][0]['path_list'][0]['peer'] assert peer == "EVPN", "Peer is not EVPN." # checking if route ...
"Paper Hearts": 0xCC4466, "Paper Lamb": 0xF2EBE1, "Paper Lantern": 0xF2E0C4, "Paper Plane": 0xF1ECE0, "Paper Sack": 0xB4A07A, "Paper Tiger": 0xFDF1AF, "Paper White": 0xEEF0F3, "Paperboy's Lawn": 0x249148, "Paperwhite": 0xF6EFDF, "Papier Blanc": 0xEFEADC, "<NAME>": 0x8590AE, "Pappardelle Noodle": 0xF9EBCC, "...
<reponame>dbanys/glide-text2im<filename>glide_text2im/clip/encoders.py import math from collections import OrderedDict from typing import List, Optional, Tuple, cast import attr import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from .attention import ( AttentionInfo, DenseAttenti...
inverse_transformer.run() """ /opt/fsl/fsl-5.0.10/fsl/bin/convertwarp --ref=standard --premat=example_func2highres.mat --warp1=highres2standard_warp --out=example_func2standard_warp """ warputils = fsl.ConvertWarp() warputils.inputs.reference = os.path.abspath(standard_brain) warputils.inputs.premat = o...
<gh_stars>1000+ # # Copyright (c) 2020 BlackBerry Limited. 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 requi...
<filename>docs/decode_sphinx_inventory.py<gh_stars>0 #! /usr/bin/python #! coding: utf-8 # decode_sphinx_inventory, mb, 2013, 2014-07-26, 2015-12-17 # ÄÖÜäöüß # ================================================== # The following __doc__ string is displayed on --info # -------------------------------------------------- ...
################################################################################ # 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 ...
= sum(A) totalsum = [a for a in A] for i in xrange(1, N): totalsum[i] += totalsum[i - 1] best = total b = 0 for a in xrange(N): if b < a: b += 1 while b < N - 1 and getsum(a, b, total, totalsum) >= getsum(a, b + 1, total, totalsum): b += 1 best = min(best, getsum(a, b, total, totalsum)) best = total - bes...
<reponame>DebeshJha/tensorflow-1 # Copyright 2019 The TensorFlow 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 #...
LifeApp(Frame): #initiates the class's initial properties def __init__(self,master,test_name): super(LifeApp, self).__init__(master) self.master.protocol("WM_DELETE_WINDOW", self.confirmclosure) self.master.iconbitmap('aclogo.ico') self.test_name = test_name self.attempts = [] self.resultlab = [] self...
# -*- coding: utf-8 -*- """ Sahana Eden Request Model @copyright: 2009-2012 (c) Sahana Software Foundation @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 without restriction...
# Copyright (C) 2007-2010 by <NAME> # # This program 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 2 # of the License, or (at your option) any later version. # # This program is distrib...
<filename>mitmproxy-mock/moxy.py<gh_stars>1-10 # # moxy.py: A mitmproxy script for mocking/modifying server responses. # # The mock configuration is loaded from a JSON file, e.g.: # # mitmdump -s moxy.py --set mock=example.json -m reverse:https://foo.com/ # # See config/example.json and README.md for examples and docum...
""" Gibbs sampler for non-negative matrix tri-factorisation. Optimised to draw all columns in parallel. We expect the following arguments: - R, the matrix - M, the mask matrix indicating observed values (1) and unobserved ones (0) - K, the number of row clusters - L, the number of column clusters - priors = { 'alpha' ...
coupon_oid: The coupon oid to retrieve. (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: CouponResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): ...
<filename>c10.py from tkinter import * conduitType = ["Heavy duty rigid UPVC conduit", "Corflo conduit", "Medium duty corrugated", "Medium duty rigid UPVC conduit"] CableType = ["-", "1", "1.5", "2.5", "4" , "6" ,"10" ,"16", "25", "35", "50", "70" , "95" ,"120" ,"150","185","240","300", "400","500","630"] class App...
playthrough, fill_locations, itempool): # We should make sure that we don't count event items, shop items, # token items, or dungeon items as a major item. itempool at this # point should only be able to have tokens of those restrictions # since the rest are already placed. major_items = [item for item in itempool...
and self._content is None: length = self.environ.get('CONTENT_LENGTH', '') if length.isdigit(): length = int(length) else: length = 0 if length <= self.MAX_CONTENT: input = self.environ['wsgi.input'] f = io.BytesIO() while length: part = input.read(length) if not part: break f.write(part) length -= len(pa...
the temporal extent of the element, hopefully from the cache element_interval = interval_cache.get(element) if element_interval is None: element_interval = ISD._make_absolute( element.get_begin(), element.get_end(), parent_computed_begin, parent_computed_end ) interval_cache[element] = element_interval beg...