input
stringlengths
2.65k
237k
output
stringclasses
1 value
== 0: channel = 0 else: channel = int(channelIndicator[0].strip('[]')) outputFilename = outputFilename.split('[')[0] outputFilename = os.path.basename(outputFilename) dimensions = fields[3].split('+')[0].split('x') w = int(dimensions[0]) h = int(dimensions[1]) outputText += 'Thumbnail width: {} height: {}'.f...
<filename>solution.py #!env/bin/python3.7 from copy import deepcopy as copy_deepcopy import os.path from time import time import search class state: """A class used to represent the state of each node in this search problem ... Attributes ---------- tod : list of strings A list of string, where each string ...
<gh_stars>0 import numpy as np import cv2 import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from datetime import datetime import time def sub2d(img, value): N, M = img.shape result = np.zeros((N,M)) for row in range(N): for col in range(M): result[row][col] = img[...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) Copyright 2003-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 Licen...
""" pyarchive.submission A Python library which provides an interface for uploading files to the Internet Archive. copyright 2004-2006, Creative Commons, <NAME> """ __id__ = "$Id: submission.py 640 2006-06-23 02:34:35Z nyergler $" __version__ = "$Revision: 640 $" __copyright__ = '(c) 2004, Creative Common...
double > const * """ return _simbody.Transform_p(self) def setP(self, p): """ setP(Transform self, Vec3 p) -> Transform Parameters ---------- p: SimTK::Vec< 3,double > const & """ return _simbody.Transform_setP(self, p) def pInv(self): """ pInv(Transform self) -> Vec3 Parameters ---------- self:...
# Python Code implementation for Class_Reg ALGORITHM import pandas as pd import numpy as np import itertools from sklearn.model_selection import train_test_split from models import * from sklearn.metrics import accuracy_score,mean_squared_error from tqdm import tqdm import random from sklearn.metrics import median_abs...
import boto3 from time import time import torch from torch.nn.functional import conv2d import json import tenacity import operator import numpy as np from copy import deepcopy from os.path import join from functools import partial from mipless_cloudvolume import deserialize_miplessCV as DCV from cloudvolume import Stor...
<reponame>FowlerLab/hgvs-patterns import unittest import re from mavehgvs.patterns.dna import ( dna_equal_c, dna_equal_n, dna_equal_gmo, dna_sub_c, dna_sub_n, dna_sub_gmo, dna_del_c, dna_del_n, dna_del_gmo, dna_dup_c, dna_dup_n, dna_dup_gmo, dna_ins_c, dna_ins_n, dna_ins_gmo, dna_delins_c, dna_delins_n...
<reponame>reiterl/openslides-backend<gh_stars>0 import time from copy import deepcopy from typing import Any, Dict from openslides_backend.action.motion.delete import MotionDelete from openslides_backend.action.motion.sort import MotionSort from openslides_backend.action.motion.update import MotionUpdate, MotionUpdate...
"""Definition of volume phase scattering functions""" import numpy as np import sympy as sp from functools import partial, update_wrapper from .scatter import Scatter from .rtplots import polarplot class Volume(Scatter): """basic volume class""" def __init__(self, **kwargs): self.omega = kwargs.pop('omega', None...
<reponame>bednie/mango-explorer # # ⚠ Warning # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR...
""" Contains base level parents that aren't to be used directly. """ from twisted.internet.defer import inlineCallbacks, returnValue from fuzzywuzzy.process import QRatio from fuzzywuzzy import utils as fuzz_utils from src.daemons.server.ansi import ANSI_HILITE, ANSI_NORMAL from src.daemons.server.objects.exceptions ...
c.append(c[-1] + x) a = b = 0 best = 0 while b <= N: if a == b or c[b] - c[a] <= total / 3: b += 1 if b > N: break else: a += 1 best = max(best, total - max((c[a], c[b] - c[a], total - c[b])))( 'Case #%d: %.10f' % (testCase, float(best) / float(total))) return a def func_5e3caad5f10949b4a7bf6adc141d6507(t...
from enum import Enum import random import collections import numpy as np # ####################################################################### # Data Types ####################################################################### # class DivideRatio(Enum): DR_8 = ('0', 8.0, '8') DR_643 = ('1', 64.0/3, '64/3') ...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, empress development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
""" Utility functions to support entity data testing """ from __future__ import unicode_literals from __future__ import absolute_import, division, print_function __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2014, <NAME>" __license__ = "MIT (http://opensource.org/licenses/MIT)" import logging log = logg...
atom.residue chain_id = residue.OBResidue.GetChain() fea_dict['chain_id'] = chain_id residue_name = residue.name fea_dict['residue_name'] = residue_name residue_num = residue.OBResidue.GetNum() fea_dict['residue_num'] = residue_num fea_dict['weight'] = 1.0 mba_coor += [fea_dict] return mba_coor def draw_lig...
CAN_DECREASE_CPU_WHEN_RUNNING = 'CAN_DECREASE_CPU_WHEN_RUNNING' CAN_SNAPSHOT_WHEN_RUNNING = 'CAN_SNAPSHOT_WHEN_RUNNING' CAN_DETACH_ISO_WHEN_RUNNING = 'CAN_DETACH_ISO_WHEN_RUNNING' CAN_ATTACH_NIC_WHEN_RUNNING = 'CAN_ATTACH_NIC_WHEN_RUNNING' CAN_ATTACH_DISK_WHEN_RUNNING = 'CAN_ATTACH_DISK_WHEN_RUNNING' CAN_RESIZE_DI...
: [u's'] , u'楊' : [u'y'] , u'㹐' : [u'c', u'z'] , u'擗' : [u'p'] , u'蝖' : [u'x'] , u'偤' : [u'y'] , u'糧' : [u'l'] , u'齦' : [u'y', u'q', u'k'] , u'俱' : [u'j'] , u'諳' : [u'a', u't'] , u'桴' : [u'f'] , u'蚀' : [u's'] , u'愅' : [u'g'] , u'㘋' : [u'x'] , u'厎' : [u'z'] , u'麐' : [u'l'] , u'礕' : [u'p'] , u'䠟' : [u's', u'd'] , u'殞' : ...
<filename>testlib/test_data.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import io import os import six import json import shutil import unittest import gramex.data import gramex.cache import pandas as pd import sqlalchemy as sa from orderedattrdict import AttrDict from nose.plugins.skip import S...
καλαβρέζικα καλαθάκι καλαθάρα καλαθάς καλαθιά καλαθοπλεκτική καλαθοπλεχτική καλαθοποιία καλαθοσφαίριση καλαθοσφαιρίστρια καλαθοσφαιριστής καλαθούνα καλαθόσφαιρα καλαμάκι καλαμάρι καλαμάτης καλαμήθρα καλαμίδι καλαμίθρα καλαμίνη καλαμαράκι καλαμαριά καλαματιανός καλαματιανός καλαμιά καλαμιώνας καλαμοκάνα καλαμοκάνης ...
:return: features set, target set as arrays """ return self._generate_data_by_pointers() def get_cv_data(self) -> (list, list): """ Generate cross-validation set from defined features and target :return: features set, target set as arrays """ return self._generate_data_by_pointers(mode="cv") def get_testing_...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details """Tests for the reportlab.platypus.paragraphs module. """ __version__=''' $Id: test_platypus_paragraphs.py 3959 2012-09-27 14:39:39Z robin $ ''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocat...
the value of the `ssh_public_keys` property. """ self._ssh_public_keys = value @property def groups(self): """ Returns the value of the `groups` property. """ return self._groups @groups.setter def groups(self, value): """ Sets the value of the `groups` property. """ self._groups = value @property de...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2015-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
# -*- coding: utf-8 -*- """ Created on Wed Nov 15 10:08:59 2017 @author: Lennart This class exists to handle all the writing of the charactor to the pdf. """ from Wolke import Wolke import PdfSerializer import Definitionen import Objekte import Talentbox from subprocess import check_output import os import math impor...
import ast import functools import inspect from abc import ABCMeta, abstractmethod from typing import Type from friendly_states.exceptions import IncorrectSummary, InheritedFromState, CannotInferOutputState, \ DuplicateStateNames, DuplicateOutputStates, UnknownOutputState, ReturnedInvalidState, GetStateDidNotReturnSt...
# -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use """ Function utilities_excel_query receives attachment information and two additional fields - list of excel style ranges and comma separated list of names for defined ranges. It th...
<reponame>Honestpuck/python-jamf #!/usr/bin/env python3 # -*- coding: utf-8 -*- #pylint: disable=no-member, missing-class-docstring, signature-differs, missing-function-docstring """ records A class for each type of record/object in Jamf """ __author__ = '<NAME>' __email__ = '<EMAIL>' __copyright__ = 'Copyright (c) ...
(tuple[float, int, array, Variable]): operation parameters Keyword Args: wires (Sequence[int]): Subsystems it acts on. If not given, args[-1] is interpreted as wires. do_queue (bool): Indicates whether the operation should be immediately pushed into a :class:`BaseQNode` circuit queue. This flag is useful if ther...
self.assertEqual(x.__self__, B) # invalid super cases try: x = super(B, 'abc') self.assertUnreachable() except TypeError: pass try: super(B,A) self.assertUnreachable() except TypeError: pass class A(object): def __init__(self, name): self.__name__ = name def meth(self): return self.__name__ classmet...
'id': attribId_4002951160133423716, 'dir': attribDir_4297072167429554704, } _name = u'kbd' # something user would type class Var(pycopia.XML.POM.ElementNode): ATTRIBUTES = { u'lang': attribLang_267608473188383376, u'style': attribStyle_733285237156411536, u'onmousedown': attribOnmousedown_31230459220631...
= [] shape = self._get_attr(tfnode, 'shape') if shape is None: size = [1, 224, 224, 3] else: for dimen in shape.dim: size.append(dimen.size) if size[0] < 0: shape = [1] else: shape = [size[0]] for i in range(1, len(size)): shape.append(size[i]) if self.start_length == 0: self.start_length = len(shape) ...
"""\ Run the benchmark multiple times with a range of settings, and produce tables / graphs with these results """ import argparse import sys import logging import subprocess import datetime import os import matplotlib.pyplot as plt import matplotlib.ticker as mtick import numpy as np import math import time import pa...
<reponame>johncollinsai/post-high-frequency-data<filename>venv/lib/python3.8/site-packages/fontTools/pens/freetypePen.py # -*- coding: utf-8 -*- """Pen to rasterize paths with FreeType.""" __all__ = ['FreeTypePen'] import os import ctypes import platform import subprocess import collections import math import freet...
"""[summary] Database models module [description] The dbmodels defines models for the databases for i.e. table User and AccessLog. Later, corresponding databases will be created from these models in the init module. """ from datetime import datetime from app import db from app import app from flask_restful import requ...
<filename>auto/src/filter.py<gh_stars>10-100 #!/usr/bin/env python import rospy import roslib import tf import sys import math import numpy as np import struct import copy from visualization_msgs.msg import Marker from custom_msgs.msg import WorldObject from custom_msgs.msg import ObjectList from rtabmap_ros.msg impor...
<gh_stars>0 import discord from discord.ext import commands, tasks import aiosqlite import random import time from datetime import datetime from cogs.mute import Mute from utils.ids import TGChannelIDs, AdminVars import utils.check class Warn(commands.Cog): """ Contains our custom warning system. """...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Hewlett Packard Enterprise Development LP # # 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 # # Unl...
if fonts field only has unique "full_name" values. """ fonts = {} for f in family_metadata.fonts: fonts[f.full_name] = f if len(set(fonts.keys())) != len(family_metadata.fonts): yield FAIL,\ Message("duplicated", 'Found duplicated "full_name" values' ' in METADATA.pb fonts field.') else: yield PASS, ('META...
<filename>k1lib/selector.py # AUTOGENERATED FILE! PLEASE DON'T EDIT """ This module is for selecting a subnetwork using CSS so that you can do special things to them. Checkout the tutorial section for a walkthrough. This is exposed automatically with:: from k1lib.imports import * selector.select # exposed """ from t...
B : B's namespace=##local, foo, bar, ##targetNamespace, R's namespace=##targetNamespace, ##local """ assert_bindings( schema="msData/particles/particlesOb056.xsd", instance="msData/particles/particlesOb056.xml", class_name="Doc", version="1.1", mode=mode, save_output=save_output, output_format=output_format, ...
path. For example, domainName queries for Dossier will use a path <hostname>/host. While ipv4 queries for Dossier will use a path of <hostname>/ip. :param stix_object: STIX object :type stix_object: str :param stix_field: STIX field :type stix_field: str :param final_expression: native query expression :type fi...
sol, order=2, solve_for_func=False) == (True, 0) assert dsolve(eqn, f(x)) in (sol, sols) assert dsolve(eqn, f(x), hint="nth_order_reducible") in (sol, sols) eqn = f(x).diff(x, 4) - 2 * f(x).diff(x, 2) sol = Eq(f(x), C1 + C2 * x + C3 * exp(x * sqrt(2)) + C4 * exp(-x * sqrt(2))) sols = constant_renumber(sol) asser...
groups contained inside other groups to the larger group passed_groups = [] for idx, group in enumerate(search_groups): try: other = next(x for x in reversed(search_groups[:idx]) if x[0].start <= group[0].start and x[-1].end >= group[-1].end) for event in group: event.link_event(other[0]) except StopIteration:...
[('only', [[Commodity]])] self.Makes_Measurement._rules = [('only', [[Measurement]])] self.Measures_Property._rules = [('only', [[Property]])] self.Offers._rules = [('only', [[Service]])] self.Accomplishes._instance_identifier = self.get_identifier() self.Consists_Of._instance_identifier = self.get_iden...
<filename>geospacelab/visualization/mpl/axis_ticks.py # Licensed under the BSD 3-Clause License # Copyright (C) 2021 GeospaceLab (geospacelab) # Author: <NAME>, Space Physics and Astronomy, University of Oulu __author__ = "<NAME>" __copyright__ = "Copyright 2021, GeospaceLab" __license__ = "BSD-3-Clause License" __ema...
""" Interface for handling the context of emulation: registers, memory, variables, actions, etc. """ from __future__ import annotations from copy import deepcopy import collections import logging from typing import List, Tuple, Optional, TYPE_CHECKING import dragodis from .instruction import Instruction from .memory ...
a " f"Domme can decide whether you deserve to be disowned, how pathetic!!", color=0xFF2030) elif member_is == 2: # Domme self disowning embed = discord.Embed(title='Nah', description=f'{ctx.author.mention}, I am so confused WHAT ARE YOU DOING.', color=0xF2A2C0) elif member_is == 202: # Domme disowning Domme e...
<reponame>tenkeyaikoukaint/cggpyg<filename>syslcdk.py import pygame class CGGPYG: def __init__(self): pygame.init() self.datainit() self.cvs=pygame.display.set_mode((1024,160)) self.myclock=pygame.time.Clock() self.curx=0 self.cury=0 def putc(self,str,chrctx,cx,cy): chr=self.chrname(str) for i in range(0,...
"gqNzaWfEQJ7q2rOT8Sb/wB0F87ld+1zMprxVlYqbUbe+oz0WM63FctIi+K9eYFSqT" "26XBZ4Rr3+VTJpBE+JLKs8nctl9hgijdHhuiKRhcmN2xCAJ+9J2LAj4bFrmv23Xp6" "kB3mZ111Dgfoxcdphkfbbh/aNmZWXNCOiiZnbOAATsD6JnaMQgSGO1GKSzyE7IEPI" "tTxCByw9x8FmnrCDexi9/cOUJOiKibHbOAATv96NzbmTEIAn70nYsCPhsWua/bden" "qQHeZnXXUOB+jFx2mGR9tuH9pHR5cGWlYXhmZXKkeGF...
#!/usr/bin/env python3 def normalize(value): return value & 0xFFFFFFFF def signed(value): return value - 0x100000000 if value & 0x80000000 else value # from http://code.activestate.com/recipes/577977-get-single-keypress/, MIT licensed try: import tty, termios except ImportError: # Probably Windows. try: import m...
%s" % (filename, lineno)) print('------------------------') print(line, "\n") print('------------------------') print("%s: %s" % (str(traceback.error.__class__.__name__), traceback.error)) outstring = '<!-- ERROR in name -->' return outstring def generatesvg(self,output=None): # Generate standard tag sheet ...
*args, caller=caller, **kwargs) print("^"*70,file=sys.stderr) #- WARNING: The above code may do weird things (specifically, # print the delimiters in one place and the traceback in # another) if the console is shutting down and logging is being # temporarily redirected to somewhere other than sys.stderr. # End fun...
<gh_stars>0 # -*- coding: utf-8 -*- """ *************************************************************************** Grid.py --------------------- Date : May 2010 Copyright : (C) 2010 by <NAME> Email : pyqgis at michaelminn dot com *************************************************************************** * * * T...
in att_dict.keys() ): if (att_dict['coordinate_defines'] == 'center'): CENTERS = True #------------------------------------ # Get user-select minlat and maxlat #------------------------------------ user_minlon = self.map_minlon.value user_maxlon = self.map_maxlon.value #---------------------------------- # ...
# -------------------------------------------------------------------------- # 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) AutoRest Code Generator. # Changes may cause incor...
<filename>Packs/AzureFirewall/Integrations/AzureFirewall/AzureFirewall_test.py import copy import pytest from unittest.mock import Mock from CommonServerPython import * SUBSCRIPTION_ID = "sub_id" RESOURCE_GROUP_NAME = "group_name" BASE_URL = f'https://management.azure.com/subscriptions/{SUBSCRIPTION_ID}' \ f'/resour...
<gh_stars>1-10 # ---------------------------------------------------------------------------- # Gimel Studio Copyright 2019-2021 by <NAME> and contributors # # 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 th...
temptype.lower().startswith(x): if is_lat: return -1 else: return -1 for x in ('infobox pittsburgh neighborhood', 'info/assentamento/madeira', 'info/localidade da madeira', 'info/assentamento/marrocos', 'info/localidade dos eua', 'info/pousadapc', 'info/antigas freguesias de portugal'): if temptype.lower().start...
+ " :: " + \ mapped + ", " + sequence + ")" def visit_SetComp(self, exp: ast.SetComp) -> str: # FIXME maybe we can visit generators # to merge common part in SetComp and ListComp assert exp.generators assert len(exp.generators) == 1 # TODO support multiple generators for gen in exp.generators: assert isinstanc...
with close to symmetric on either side. If False, padding is done on the right side. Default = True Output: window [Numpy array] window containing the required shape and padding if pad_width > 0 ----------------------------------------------------------------------------- """ try: N_window except NameE...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass from typing import Any, Callable, Dict, List, Optional, Tuple, Type, cast import n...
# parse each line positives = {} #[list () for _ in range (0, len (steps))] bar = util.ProgressBar ('Syntatic Distance and Strategy Analysis (' + strategy + ')', metadata ['misses']) try: fin = open (os.path.join (args.input, 'predict'), 'r') except: fin = gzip.open (os.path.join (args.input, 'predict.gz'), 'r') f...
<gh_stars>0 # coding=UTF-8 """All the REST enums used by the FCO REST API.""" from enum import Enum class PrintableEnum(Enum): """Allows for easier formatting when substituting for parameters.""" def __str__(self): """String representation of PrintableEnum object.""" return self.value def untype(self): """...
<gh_stars>1-10 from random import randrange from enum import Enum class Colors: """Just a color class for showing results in colors""" HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4...
@staticmethod # known case of __new__ def __new__(*args, **kwargs): # real signature unknown """ Create and return a new object. See help(type) for accurate signature. """ pass def __next__(self, *args, **kwargs): # real signature unknown """ Implement next(self). """ pass def __reduce__(self, *args, **kwargs)...
## # Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. # This file is part of OSM # 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/l...
DataSourceInterface() self.data_source_interface_info = temp_model.from_map(m['data_source_interface_info']) return self class AuthPersonEnterpriseInfo(TeaModel): def __init__( self, enterprise_name: str = None, enterprise_credit_num: str = None, enterprise_legal_person_name: str = None, enterprise_legal_pers...
<reponame>IFCA/keystoneauth-oidc # coding=utf-8 # Copyright 2016 Spanish National Research Council # Copyright 2016 INDIGO-DataCloud # # 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:...
"""A set of WT related Girder tasks.""" from datetime import datetime, timedelta import os import shutil import socket import json import time import tempfile import docker import requests import subprocess from docker.errors import DockerException import girder_client from dateutil.parser import parse import logging ...
<gh_stars>0 import functools import itertools from dataclasses import dataclass from operator import mul from typing import Callable, Tuple, List, Optional, Union, Sequence import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import LinearSegmentedColormap from scipy.linalg import logm, pinv, eigh...
use_slave=False): return _instance_get_by_uuid(context, uuid, columns_to_join=columns_to_join, use_slave=use_slave) def _instance_get_by_uuid(context, uuid, session=None, columns_to_join=None, use_slave=False): result = _build_instance_get(context, session=session, columns_to_join=columns_to_join, use_slave=use...
<filename>nnef_tools/io/tensorflow/tf_py/tf_py_definitions.py # Copyright (c) 2017 The Khronos Group 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/LI...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
<reponame>luizschmall/tce_siconfi_inconsistencies import pandas import string import math import csv import os from unicodedata import normalize def remover_acentos(txt): return normalize('NFKD', txt).encode('ASCII', 'ignore').decode('ASCII') def containsNumber(line): res = False numero = 0 if an...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import division '''MFEprimer: Multiple factor evaluation of the specificity of PCR primers''' Program = 'MFEprimer' Author = '<NAME>, <NAME> & <NAME>, BIRM, China' AuthorEmail = '<NAME> <<EMAIL>>' Date = 'Nov-8-2011' License = 'Please cont...
#!/usr/bin/env python import os import glob import json import traceback from collections import defaultdict from datetime import datetime from github import Github REPO_NAME = "openforcefield/qca-dataset-submission" DATASET_GLOB = "dataset*.json*" COMPUTE_GLOB = "compute*.json*" PRIORITIES = {'priority-low': 0, '...
_set_lacp_mode) system_id_mac = __builtin__.property(_get_system_id_mac, _set_system_id_mac) system_priority = __builtin__.property(_get_system_priority, _set_system_priority) _pyangbind_elements = OrderedDict([('name', name), ('interval', interval), ('lacp_mode', lacp_mode), ('system_id_mac', system_id_mac), ('sy...
# FUNCTIONS # These completions are here instead of functions.py to avoid a circular import. a = ("a()", "a(${1})") alpha = ("alpha()", "alpha(${1})") annotation = ("annotation()", "annotation(${1})") attr = ("attr()", "attr(${1:name})") auto = ("auto()", "auto(\"${1}\")") b = ("b()", "b(${1}${2:0}%)") blackness = ("bl...
<gh_stars>100-1000 # -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright (c) 2017, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are me...
<filename>VisualVictim.py # -*- coding:utf-8 -*- # ==========Import Modules==========# # OpenCV import cv2 # print("OpenCV ver : ") + (cv2.__version__) # Subprocess import subprocess # Time import time #numpy import numpy as np # Serial Communication import serial # Struct import struct print("----------Import...
elif len(args) == 6: minx, maxx, miny, maxy, minz, maxz = tuple([[arg] for arg in args]) else: raise ValueError("_Getlimits expects 0 or 6 arguments.") # Get limits of children for ob in self.children: tmp = ob._GetLimits() if tmp is not None: limx, limy, limz = tmp minx.append(limx.min); maxx.append(limx.ma...
self.key = "Yes" # self.plotFunc() # else:#only one parameter has been loaded in viewgraph # #only one parameter is in history key and there are more than one point in the historyList for this parameters # if (len(self.historyKeys)==1) and (len(self.historyList[self.historyKeys[-1][0]])>1): # self.historyList[self.hi...
<reponame>sblack-usu/ulmo<filename>test/usgs_nwis_hdf5_test.py from builtins import range import os import shutil import datetime import freezegun import pandas import pytest from ulmo.usgs import nwis import test_util TEST_FILE_DIR = os.path.abspath('tmp') @pytest.fixture def test_file_path(request): return os....
if len(rec) == 7 else 1 self.demag.append( {k: floatnan(r) for r, k in zip(rec, keys[i])}) if demag and 'segment' in demag: self.demag[-1].update(demag) else: for v in [["Limit Hc value", "lim_hc"], ["Max. Magnetization", "br_max"], ["Demagnetisation", "segment"], ["Min. Magnetization", "br_min"], ["Area dem...
# can only "look back" in terms of UnitOn variable state (t-1) or this_lag time periods - whichever is smallest. # the rest of the time period is captured in the unit T0 state, and is handled in the logic above. return m.StartupCost[g, t] >= this_cost * m.UnitOn[g, t] - sum( (this_cost)*m.UnitOn[g, t - k] for k in ...
<filename>data/model/oci/test/test_oci_manifest.py import json from playhouse.test_utils import assert_query_count from app import docker_v2_signing_key, storage from digest.digest_tools import sha256_digest from data.database import (Tag, ManifestBlob, ImageStorageLocation, ManifestChild, ImageStorage, Image, Repo...
containing the facet images added over vis_graph. We can now # gather those images into one image return delayed(gather_invert_results, nout=2, pure=True)(results, template_model_graph, facets=facets, **kwargs) def create_invert_facet_wstack_graph(vis_graph_list, template_model_graph: delayed, dopsf=False, normali...
None: result['commonHeaders'] = self.common_headers if self.x_acs_dingtalk_access_token is not None: result['x-acs-dingtalk-access-token'] = self.x_acs_dingtalk_access_token return result def from_map(self, m: dict = None): m = m or dict() if m.get('commonHeaders') is not None: self.common_headers = m.get('com...
<reponame>jhkennedy/itslive import argparse from datetime import datetime import geojson import h5py import json import numpy as np import os import psutil import pyproj import s3fs import sys import time from tqdm import tqdm # Date format as it appears in granules filenames of optical format: # LC08_L1TP_011002_2015...
<reponame>spacycn/tutorial-knowledge-base import logging from typing import List, Dict, Any, Optional, Text from grakn.client import GraknClient logger = logging.getLogger(__name__) class KnowledgeBase(object): def get_entities( self, entity_type: Text, attributes: Optional[List[Dict[Text, Text]]] = None, lim...
and overwritten from the # bogus value 'J'. Caching stops this from happening. node = qml.QNode(circuit, operable_mock_device_2_wires, cache=True) node.evaluate([0.0]) keys = node.grad_method_for_par.keys() if keys: k0 = [k for k in keys][0] node.grad_method_for_par[k0] = "J" with pytest.raises(ValueError, m...
Asian ideograph 0x215F31: (0x968D, 0), # East Asian ideograph 0x223B28: (0x67A4, 0), # East Asian ideograph 0x213B29: (0x5BD0, 0), # East Asian ideograph 0x213B2A: (0x5BD3, 0), # East Asian ideograph 0x213B2B: (0x5BE1, 0), # East Asian ideograph 0x213B2C: (0x5BE5, 0), # East Asian ideograph 0x215F32: (0x9698, 0)...
<reponame>Unipisa/biaffine-parser<gh_stars>1-10 # -*- coding: utf-8 -*- import torch import torch.nn as nn from parser.modules import MLP, BertEmbedding, Biaffine, BiLSTM, CharLSTM from parser.modules.dropout import IndependentDropout, SharedDropout from parser.utils.alg import eisner from parser.utils.fn import istre...
match type {}... >>> check_type([], {}) # doctest: +ELLIPSIS Traceback (most recent call last): ... TypeMismatchException: [] cannot match type {}... >>> from collections import defaultdict >>> check_type({}, dict_({}, defaultdict, lambda: defaultdict(int)))\ # doctest: +ELLIPSIS Traceback (most recent call last...
{'key': 'id', 'type': 'str'}, } def __init__( self, *, id: str, **kwargs ): super(ContainerGroupNetworkProfile, self).__init__(**kwargs) self.id = id class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): """The instance view of the container group. Only valid in response. Variables are ...
<reponame>s4sarath/tf-transformers<filename>src/tf_transformers/layers/attention/block_attention.py<gh_stars>1-10 # from __future__ import google_type_annotations from __future__ import absolute_import, division, print_function import math import numpy as np import tensorflow as tf from tf_transformers.core import L...
no ``Book`` found by the given ``Id`` raise: NullArgument - ``book_id`` is ``null`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_comment_admin()`` or ``supports_visible_federation()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_comme...