input
stringlengths
2.65k
237k
output
stringclasses
1 value
# -*- coding: utf-8 -*- """:py:mod:`unittest`-based classes and accompanying functions to create some types of ferenda-specific tests easier.""" from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from difflib import unified_diff from io import BytesIO import bu...
#!/usr/bin/python3.6 from __future__ import print_function from googleapiclient.discovery import build from googleapiclient import errors from httplib2 import Http from oauth2client import file, client, tools from pytz import timezone from datetime import datetime from re import match from netmiko import ConnectHandler...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Wed Feb 24 19:49:28 2021 by generateDS.py version 2.37.16. # Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39) [Clang 6.0 (clang-600.0.57)] # # Command line options: # ('--no-namespace-defs', '') # ('-o', './tnt_lib/label_common_definitions.py') # # Com...
<reponame>jaib1/yass<gh_stars>10-100 """ Functions for dimensionality reduction """ try: from pathlib2 import Path except Exception: from pathlib import Path from functools import reduce import logging import numpy as np from yass.batch import BatchProcessor from yass.util import check_for_files, LoadFile, save_nu...
#!/usr/bin/env python #make thumbnails centered at list of ra/dec's #imname='../data/new/111-18/g/15/Skymapper_805310385_00000_2011-04-12T19:16:27_15.fits' #ras=[168.98898] #decs=[-18.014603] #outdir='.' import pyfits import numpy as np from math import pi import subprocess import matplotlib matplotlib.use('Agg') ...
doc_type_stats = [] for ( tag, max_depth, max_repets, min_repets, avg_Repets, ) in self.pm.get_single_xml_type_stats(xml_type): doc_type_stats.append( [tag, max_depth, max_repets, min_repets, avg_Repets] ) doc_types[xml_type] = { "no_of_docs": no_of_docs, "doc_type_stats": doc_type_stats, } ...
<filename>mycdo/__init__.py # -*- coding: utf-8 -*- """ Created on Wed Feb 04, 2015 @author: <NAME> This module is the python interface to the command line tool of Climate Data Operators (CDO). Each CDO operator is wrapped into a string in a list, and the chain of CDO operators is realized by first adding these indi...
<reponame>Michal-Gagala/sympy from sympy.core.add import Add from sympy.core.exprtools import factor_terms from sympy.core.function import expand_log, _mexpand from sympy.core.power import Pow from sympy.core.singleton import S from sympy.core.sorting import ordered from sympy.core.symbol import Dummy from sympy...
<gh_stars>0 """ Used for pytest fixtures and anything else test setup/teardown related. """ import copy import datetime import os import sys import aiofiles import aiomock import mock import pytest try: import uvloop LOOP = uvloop.new_event_loop L_SHOW = LOOP() L_SHOW.set_debug(True) print("Test loop policy:", st...
<filename>compression.py """ toy compression algorithm with an interface matching stdlib modules. class StatesError class StatesCompressor class StatesDecompressor class StatesFile def compress def decompress def open """ import io import itertools import os import pathlib import struct import typing from pprint i...
- EncryptedPrivateKeyInfo (RSA/DSA/EC - PKCS#8) - Encrypted RSAPrivateKey (PEM only, OpenSSL) - Encrypted DSAPrivateKey (PEM only, OpenSSL) - Encrypted ECPrivateKey (PEM only, OpenSSL) :param data: A byte string to load the private key from :param password: The password to unencrypt the private key :raises: ...
""" Asset compilation and collection. """ import argparse import glob import json import os import traceback from datetime import datetime from functools import wraps from threading import Timer from paver import tasks from paver.easy import call_task, cmdopts, consume_args, needs, no_help, path, sh, task from watch...
<gh_stars>10-100 #!/usr/bin/python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
<reponame>marcellogoccia/deep-value-investing import traceback import time import datetime import sys from decimal import Decimal from utilities import log from urllib.request import URLError default_float = None NA = ['-', '--', 'N/A', 'NA', ' '] def parse(string, dictionary): if string in dictionary: return dic...
'property_name': 'exploration_id', 'node_id': 'node_1', 'old_value': self.EXP_ID, 'new_value': None })], 'Removed exploration.') # Suggestion should be rejected after exploration is removed from the # story. suggestions = suggestion_services.query_suggestions( [('author_id', self.author_id), ('target_id', self...
#!/usr/bin/python ''' Variable Expression = Variable + Variable Assignment(Expresssion) ''' env = None _float = None _int = None _string = None #============================ class NameGen: def __init__(self,pre): #self.val = val self.pre = pre def __get__(self, instance, owner): return self.pre + instance.id...
== date.today() assert occurrences.outdated is True assert occurrences.tags == ['b', 'c'] assert occurrences.locations == ['B', 'C'] occurrences = occurrences.for_filter(start=date(2010, 5, 1)) assert occurrences.range is None assert occurrences.start == date(2010, 5, 1) assert occurrences.end == date.today() ...
<gh_stars>0 """ ==================================================================================================== Parse a PhysiCell configuration file (XML) and generate two Jupyter (Python) modules: user_params.py - containing widgets for user parameters. microenv_params.py - containing widgets for microenviron...
# -*- coding: utf-8 -*- """The xonsh built-ins. Note that this module is named 'built_ins' so as not to be confused with the special Python builtins module. """ import os import re import sys import types import signal import atexit import pathlib import inspect import warnings import builtins import itertools import ...
<filename>fos/lib/pyglet/media/avbin.py # ---------------------------------------------------------------------------- # fos.lib.pyglet # Copyright (c) 2006-2008 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followin...
x in remote_states]) comm_queues = ray.get([x.get_comm_queue.remote() for x in remote_states]) aggregators = get_aggregators(comm_queues) [x.set_comm_queues.remote(comm_queues, control_queues) for x in remote_states] if not USE_RAY_CALLS: retval_queue = ramba_queue.Queue() [x.rpc_serve.remote(retval_queue) for x ...
key-value pair that forms a tag associated with a given resource. For instance, if you want to show which resources are used by which departments, you might use “Department” as the key portion of the pair, with multiple possible values such as “sales,” “legal,” and “administration.” - **Value** *(string) --* The seco...
"4363 4468 4537", 51051: "4363 4468 4538", 51052: "4363 4468 4539", 51053: "4363 4468 4540", 51054: "4363 4468 4541", 51055: "4363 4468 4542", 51056: "4363 4468 4543", 51057: "4363 4468 4544", 51058: "4363 4468 4545", 51059: "4363 4468 4546", 51060: "4363 4469", 51061: "4363 4469 4520", 51062: "4363 4469 45...
<reponame>amcclead7336/Enterprise_Data_Science_Final # 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 gen...
αρτόδεντρο αρφάνια αρχάγγελος αρχάνθρωπος αρχές αρχέτυπο αρχέτυπον αρχή αρχίγραμμα αρχίδι αρχίνημα αρχίνισμα αρχαΐζουσα αρχαΐστρια αρχαία αρχαίος αρχαγγελικός αρχαιγόνιο αρχαιοβακτήριο αρχαιοβοτανική αρχαιογνωσία αρχαιογνωστικός αρχαιογνώστης αρχαιοδίφης αρχαιοδιφικός αρχαιοκάπηλος αρχαιοκαπηλία αρχαιοκύτταρο αρχαι...
# Digital Object Identifier (DOI) #if headerCol == "D2": paperIn[""] = col # Book Digital Object Identifier (DOI) if headerCol == "PG": paperIn["pageCount"] = col # Page Count #if headerCol == "WC": paperIn["subject"] = col # Web of Science Categories if headerCol == "SC": paperIn["subject"] = col # Research Areas ...
# Copyright The PyTorch Lightning team. # # 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 wr...
``Upgrade`` class provides methods to configure the upgrade of this appliance from an existing vCenter appliance. This class was added in vSphere API 6.7. """ _VAPI_SERVICE_ID = 'com.vmware.vcenter.deployment.upgrade' """ Identifier of the service in canonical form. """ def __init__(self, config): """ :type ...
<filename>venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_eni.py #!/usr/bin/python # # This is a 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 3 of the License, or # (at your op...
k, v in config.items(): if type(v) == bytes: # noinspection PyArgumentList config[k] = str(v, encoding="utf8") config_json = json.dumps(config, sort_keys=True, indent=4) with gzip.GzipFile(join(SETTINGS_DIR, "settings.json.gz"), "w+") as gz_file: try: gz_file.write(config_json) except TypeError: # Python3 gz_f...
#!/usr/bin/env python3 # # relayenforce.py # # Copyright (c) 2020 Infoblox, Inc. # # 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 th...
united': '436f05df', 'whyteleafe': '0cb86048', 'wick & barnham united': '637a268c', 'wick barnham united': '637a268c', 'widnes': '1d19434e', 'wigan athletic': 'e59ddc76', 'willand rovers': '3bf9b5e5', 'wimbledon': '3679c494', 'wimborne town': 'f3a2ba41', 'winchester city': '82cfb72a', 'windsor': '2b534fac', ...
("glGet", F, 4, "GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX"), # 0x840A ("glGet", I, 1, "GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX"), # 0x840B ("glGet", I, 1, "GL_FRAGMENT_LIGHT0_SGIX"), # 0x840C ("", X, 1, "GL_FRAGMENT_LIGHT1_SGIX"), # 0x840D ("", X, 1, "GL_FRAGMENT_LIGHT2_SGIX"), # 0x840E ("", X, 1, "GL_FRAGME...
= cms.bool(True), chi2n_no1Dmod_par = cms.double(9999), chi2n_par = cms.double(1.0), copyExtras = cms.untracked.bool(True), copyTrajectories = cms.untracked.bool(False), d0_par1 = cms.vdouble(0.9, 3.0), d0_par2 = cms.vdouble(1.0, 3.0), dz_par1 = cms.vdouble(0.9, 3.0), dz_par2 = cms.vdouble(1.0, 3.0), keepAllTr...
<filename>train_frcnn_val.py from __future__ import division import random import pprint import sys import time import numpy as np from optparse import OptionParser import pickle import re import pandas as pd from keras import backend as K import tensorflow as tf from keras_preprocessing.image import ImageDataGenera...
= prob['o'] assert_near_equal(obj, 20.0, 1e-6) def test_driver_supports(self): prob = om.Problem() model = prob.model model.add_subsystem('p1', om.IndepVarComp('x', 50.0), promotes=['*']) prob.driver = pyOptSparseDriver(optimizer=OPTIMIZER, print_results=False) with self.assertRaises(KeyError) as raises_msg...
-1 return _f(values, pos, size) class AbstractSecsCommunicator: __DEFAULT_TIMEOUT_T1 = 1.0 __DEFAULT_TIMEOUT_T2 = 15.0 __DEFAULT_TIMEOUT_T3 = 45.0 __DEFAULT_TIMEOUT_T4 = 45.0 __DEFAULT_TIMEOUT_T5 = 10.0 __DEFAULT_TIMEOUT_T6 = 5.0 __DEFAULT_TIMEOUT_T7 = 10.0 __DEFAULT_TIMEOUT_T8 = 5.0 def __init__(self, d...
import numpy as np import scipy as sp def sim_state_eq( A, B, xi, U): """This function caclulates the trajectory for the network given our model if there are no constraints, and the target state is unknown, using the control equation precess x(t+1) = Ax(t) + BU(t). x(t) is the state vector, A is the adjacency mat...
# ----------------------------------------------------------- # A discord bot that has every features you want in a discord server ! # # (C) 2022 TheophileDiot # Released under MIT License (MIT) # email <EMAIL> # linting: black # ----------------------------------------------------------- from asyncio import new_event_...
tables defining the metric groups in section 'Metric groups' in the :term:`HMC API` book. type (:term:`callable`): Python type for the metric value. The type must be a constructor (callable) that takes the metrics value from the `MetricsResponse` string as its only argument, using the following Python types for ...
<gh_stars>1-10 import unittest import unittest.mock import datetime import io import uuid from g1.bases import datetimes from g1.containers import bases from g1.containers import builders from g1.containers import images from g1.containers import models from g1.containers import pods from g1.files import locks from g...
organization = database.team.organization if organization and organization.external: endpoint = organization.grafana_endpoint datasource = organization.grafana_datasource else: endpoint = credential.endpoint datasource = credential.get_parameter_by_name('environment') engine_type = ( database.engine_type if no...
# # Copyright (c) SAS Institute 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 writi...
<reponame>piovere/beschi from ..protocol import Protocol, BASE_TYPE_SIZES from ..writer import Writer from .. import LIB_NAME, LIB_VERSION LANGUAGE_NAME = "C" class CWriter(Writer): language_name = LANGUAGE_NAME default_extension = ".h" def __init__(self, p: Protocol): super().__init__(protocol=p, tab=" ") se...
#!/usr/bin/env python3 # # Copyright 2018 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. """Create an Android application bundle from one or more bundle modules.""" import argparse import json import os import shutil imp...
This URL can be used in conjunction with the video content authorization token to download the video MP4 file. The resulting MP4 file can be played on any standard media player. It is available when the video type is 'file' and video file is available for consumption. :type download_url: str :param archive_base_ur...
import collections import warnings try: import ssl except ImportError: # pragma: no cover ssl = None from . import compat from . import protocols from . import transports from .log import logger def _create_transport_context(server_side, server_hostname): if server_side: raise ValueError('Server side SSL needs a...
# If it is not the *very last* index, find the the critical level # of mNrm where the artificial borrowing contraint begins to bind. d0 = cNrmNow[idx] - cNrmCnst[idx] d1 = cNrmCnst[idx + 1] - cNrmNow[idx + 1] m0 = mNrmNow[idx] m1 = mNrmNow[idx + 1] alpha = d0 / (d0 + d1) mCrit = m0 + alpha * (m1 - m0) # Adjust...
true, run the while loop. We set win to false at the start therefore this will always run guess = int(input("Have a guess: ")) tries = tries + 1 if guess == number: win = True # set win to true when the user guesses correctly. elif guess < number: print("Guess Higher") elif guess > number: print("Guess ...
' + topic.member.username template_values['page_description'] = template_values['page_description'].replace("\r\n", " ") if member: if member.level == 0: can_edit = True can_move = True if topic.member_num == member.num: now = datetime.datetime.now() if (now - topic.created).seconds < 300: can_edit = True can...
import asyncio import base64 import json import os from datetime import datetime, timedelta from typing import Dict, List, Optional, Union from urllib import parse as urlparse import aiohttp from spotify.classes import * BASE_URL = "https://api.spotify.com/v1/" class SpotifyClient: """A simple client for performi...
# -*- coding: utf-8 -*- import numpy as np from scipy.optimize import fsolve import random import time import os import matplotlib.pyplot as plt import logging from Life import Life from Fitness import Fitness random.seed(10) logging.basicConfig(level=logging.INFO, # 控制台打印的日志级别 filename='./logs/out_%s.log' % time.s...
over time on the basis of a set of differential equations defining the rates of change of state variables. Args: pop_hist_len (int): Maximum lenght of the population history. Keep memory utilization in mind when using positive numbers for this argument. traj_id (Any): ID of the trajectory which wraps the simulati...
<reponame>openedx/openedx-census #!/usr/bin/env python """Automate the process of counting courses on Open edX sites.""" import asyncio import collections import csv import itertools import json import logging import os import pickle import pprint import re import time import traceback import urllib.parse import attr...
"vGPU profile {0} is already configured for VM {1}. " "Skip.".format(vm_cfg["profile"], vm_cfg["vm"]) ) else: tasks.append(vm_update.add_vgpu(vm_cfg["profile"])) else: self.logger.error( "vGPU profile {0} is not available for VM {1}. Skip.".format( vm_cfg["profile"], vm_cfg["vm"] ) ) if tasks: if not vm_sta...
0.285 # - Epoch 60 Batch 0/21 train_loss = 0.274 # - Epoch 60 Batch 10/21 train_loss = 0.240 # - Epoch 60 Batch 20/21 train_loss = 0.264 # - Epoch 61 Batch 9/21 train_loss = 0.276 # - Epoch 61 Batch 19/21 train_loss = 0.272 # - Epoch 62 Batch 8/21 train_loss = 0.277 # - Epoch 62 Batch 18/21 train_loss = 0.266 # - Epoch...
""" Copyright 2019 Cartesi Pte. 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 applicable law or agreed to in writing, software d...
# -*- coding:utf-8 -*- import logging logger = logging.getLogger(__name__) import ast import re import os.path import tempfile import shutil import hashlib import stat from prestring.python import PythonModule from functools import partial from collections import namedtuple from io import StringIO from kamo.expr import...
actual_type = type + "_tileset2" elif ram_address == 0x02002F00: # BG1 8x8 tile mapping actual_type = type + "_mapping1" elif ram_address == 0x02019EE0: # BG2 8x8 tile mapping actual_type = type + "_mapping2" elif ram_address == 0x0600F000: # BG3 8x8 tile mapping actual_type = type + "_mapping3" elif ram_address...
'61746933':{'en': 'Pittsworth'}, '61746428':{'en': 'Elbow Valley'}, '61746429':{'en': 'Freestone'}, '61746426':{'en': 'Allora'}, '61746427':{'en': 'Cunningham'}, '61746424':{'en': 'Ravensbourne'}, '61746425':{'en': 'Toowoomba'}, '61746422':{'en': 'Toowoomba'}, '61746423':{'en': 'Pittsworth'}, '61746420':{'en':...
<reponame>oliviazz/noteable from flask import request, jsonify, Blueprint from flask_login import login_required, login_user, current_user, logout_user from models import User from database import Database import requests from bs4 import BeautifulSoup import json import unicodedata import datetime from urllib import ur...
<reponame>kevin-ci/advent-of-code-2020<gh_stars>0 import re input = """iyr:2010 ecl:gry hgt:181cm pid:591597745 byr:1920 hcl:#6b5442 eyr:2029 cid:123 cid:223 byr:1927 hgt:177cm hcl:#602927 iyr:2016 pid:404183620 ecl:amb eyr:2020 byr:1998 ecl:hzl cid:178 hcl:#a97842 iyr:2014 hgt:166cm pid:594143498 eyr:2030 ecl:hzl ...
<reponame>ntiufalara/openerp7<filename>openerp/addons/event/event.py # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redi...
<reponame>TobyChen0106/DeepQ_Final_B05901170<gh_stars>0 import torch.nn as nn import torch import math import time import torch.utils.model_zoo as model_zoo from utils import BasicBlock, Bottleneck, BBoxTransform, ClipBoxes from anchors import Anchors import losses from lib.nms.pth_nms import pth_nms def nms(dets, thr...
<gh_stars>1-10 #! /usr/bin/env python # -*- coding: utf-8 -*- """ This module computes the neutral and ionized populations of H in the upper atmosphere. """ from __future__ import (division, print_function, absolute_import, unicode_literals) import numpy as np import astropy.units as u import astropy.constants as c f...
= Constraint(expr=m.x949*m.x949 - m.x3979*m.b3010 <= 0) m.c4051 = Constraint(expr=m.x950*m.x950 - m.x3980*m.b3010 <= 0) m.c4052 = Constraint(expr=m.x951*m.x951 - m.x3981*m.b3010 <= 0) m.c4053 = Constraint(expr=m.x952*m.x952 - m.x3982*m.b3010 <= 0) m.c4054 = Constraint(expr=m.x953*m.x953 - m.x3983*m.b3010 <= 0) m.c...
# # Copyright (c) 2017-2019 AutoDeploy AI # # 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 ...
self._client.get_data_feed_ingestion_progress(data_feed_id=data_feed_id, **kwargs) @distributed_trace_async async def refresh_data_feed_ingestion( self, data_feed_id: str, start_time: Union[str, datetime.datetime], end_time: Union[str, datetime.datetime], **kwargs: Any ) -> None: """Refreshes data ingestion b...
get_cells_serialized_result: """ Attributes: - success - e """ thrift_spec = ( (0, TType.STRING, 'success', None, None, ), # 0 (1, TType.STRUCT, 'e', (ClientException, ClientException.thrift_spec), None, ), # 1 ) def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self,...
number of local MEPs disabled due to operational errors **type**\: int **range:** 0..4294967295 .. attribute:: peer_meps The number of peer MEPs **type**\: int **range:** 0..4294967295 .. attribute:: operational_peer_meps The number of operational peer MEPs recorded in the CFM database **typ...
args=(self.superuser.pk,)) self.assertContains( response, '<div class="readonly"><a href="%s">super</a></div>' % user_url, html=True, ) # Related ForeignKey with the string primary key registered in admin. language_url = reverse( 'admin:admin_views_language_change', args=(quote(language.pk),), ) self.assertC...
or # noqa: E501 local_var_params['entity_set_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `entity_set_id` when calling `execute_entity_neighbor_search`") # noqa: E501 # verify the required parameter 'entity_key_id' is set if self.api_client.client_side_validation and ('entity_key_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------ # Penji OpDev Fall 2019 # GS Run Wrapper # Author: <NAME> # Updated: # ------------------------ # General import os import argparse import pandas as pd # For Google Sheets import pygsheets # Local import core.utils as utils from core import logge...
<filename>sporco/admm/bpdn.py<gh_stars>1-10 # -*- coding: utf-8 -*- # Copyright (C) 2015-2019 by <NAME> <<EMAIL>> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. ""...
get wcs, no header yet if self.meta is None: self.logger.warning("Cannot get WCS, no header yet") return None try: self._wcs = WCS(self.meta) return self._wcs except: self.logger.warning("Problem with WCS") return None @property def exptime(self): # We have it already, just return it if self._exptime is ...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Fri Jul 23 08:59:01 2021 @author: alexa """ import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp import time import math from numpy import pi as pi from scipy import optimize #par = [MASSA, MASSB, d_1, d_2, SADDLE_E] def upo_ana...
#!/usr/bin/env python # coding: utf-8 # # Notebook script for generation of training dataset (supports n phase material) # # ## For case of one or two phase, GUI works # # ## Different steps of data generation is outlined in this notebook (LaueToolsNN GUI does the same thing) # # ### Define material of interest # #...
<reponame>joezuntz/MockMPI<filename>mockmpi/comm.py # Copyright (c) <NAME> and other collaborators # See https://github.com/rmjarvis/MockMPI/LICENSE for license information. import numpy as np # This constant seems to have the same value in MPICH and OpenMPI # so we reproduce it here since it can be quite important. ...
<gh_stars>0 #!/usr/bin/env python # -*-mode: python; coding: utf-8 -*- # # Inspired from svn-import.py by <EMAIL> (ref : # http://svn.haxx.se/users/archive-2006-10/0857.shtml) # # svn-merge-vendor.py (v1.0.1) - Import a new release, such as a vendor drop. # # The "Vendor branches" chapter of "Version Control with Subve...
import os import sys import time import pprint import signal import random import inspect import pkgutil import traceback import importlib.util import threading as mt from .ids import generate_id from .threads import get_thread_name # ------------------------------------------------------------------------------ ...
<gh_stars>100-1000 # Import required libraries import os import pickle import copy import datetime as dt import math import requests import pandas as pd from flask import Flask import dash import dash_daq as daq import dash_table from dash.dependencies import Input, Output, State import dash_core_components as dcc im...
-d '/' -f 2 slices the line by '/' and selects the second field resulting in: QtWebKit.framework otool_command = "otool -L '%s' | cut -d ' ' -f 1 | grep @rpath.*Qt | cut -d '/' -f 2" % (os.path.join(src, darwin_adjusted_name)) output = subprocess.check_output(otool_command, shell=True) qt_dependent_libs = re.split(...
the top down if keyLoc[0] == 't': markers.reverse() # Construct ctioga2 command for each key for i, key in enumerate(markers): if key[0] == 'Bullet' or key[0] == 'BulletOpen': key[2] /= 1.5 if key[2] > 1.0: key[2] = 1.0 # Write the extra marker overlay for the reference point if len(key) == 7: keyString += '...
from _PhylogenyExt import * class Split(SplitBase): #---+----|----+----|----+----|----+----|----+----|----+----|----+----| """ Encapulates a split, or taxon bipartition. """ def __init__(self): #---+----|----+----|----+----|----+----|----+----|----+----|----+----| """ Initializes data members and sets up the ...
const [] Ap, npy_int32 const [] Ai, unsigned short const [] Ax, npy_int32 const [] Bp, npy_int32 const [] Bi, unsigned short const [] Bx, npy_int32 [] Cp, npy_int32 [] Ci, unsigned short [] Cx) csc_plus_csc(npy_int32 const n_row, npy_int32 const n_col, npy_int32 const [] Ap, npy_int32 const [] Ai, int const [] A...
<reponame>rbrutherford3/ASCII-Chess<gh_stars>0 ################################################################# # # # ASCII-Chess, written by <NAME> in 2021 # # # ################################################################# from piece import * # Yield the opposite player def opponent(player): if player == 1:...
__repr__(self): return '<IrcCommands(%s)>' % ', '.join(map(repr, self.commands)) # ----------------------------------------------------------------------------- # User/Mask classes _rfc1459trans = string.maketrans(string.ascii_uppercase + r'\[]', string.ascii_lowercase + r'|{}') def IRClower(s): return s.translate...
""" Configuration of pytest for agent tests """ from pathlib import Path from textwrap import dedent from unittest.mock import patch import httpx import respx from pytest import fixture from lm_agent.backend_utils import BackendConfigurationRow from lm_agent.config import settings MOCK_BIN_PATH = Path(__file__).pare...
# Copyright 2019-21 by <NAME>. All rights reserved. # This file is part of the Biopython distribution and governed by your # choice of the "Biopython License Agreement" or the "BSD 3-Clause License". # Please see the LICENSE file that should have been included as part of this # package. """SCADIO: write OpenSCAD progr...
ids (list[str], optional): A list of resource IDs. If after filtering, there is not at least one resource that matches each of the elements of `ids`, then an error is returned. This cannot be provided together with the `name` or `names` query parameters. names (list[str], optional): Performs the operation on the u...
"""Reader for the GMSH file format.""" from __future__ import division, absolute_import __copyright__ = "Copyright (C) 2009 <NAME>, <NAME>" __license__ = """ 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 t...
Caesar(_Cipher): """ The Caesar Cipher """ class Tools: @staticmethod def _encDec(text, key, alphabet, isEncrypt): ans = "" for char in text: try: alphIndex = alphabet.index(char) except ValueError: raise Exception("Can't find char '" + char + "' of text in alphabet!") alphIndex = (alphIndex + isEncrypt *...
WATCHLIST_RESPONSE_MOCK = { "cursor": "", "hits": 1, "results": [ { "status": "ACTIVE", "infected_user_record_count": 115, "last_discovered": "2020-04-30T00:09:27Z", "verification_secret": "", "verified": "YES", "infected_employee_record_count": 60, "identifier_type": "domain", "infected_consumer_record_cou...
for i in xrange(1, len(k_i)): sk_i = k_i[i:] sk_j = k_j[:-i] if sk_i == sk_j: return i return len(k_i) # init self.alignment_table_sequence = '' p_kmer = '' self.alignment_table_sequence = self.twoD_alignment_table[0][2] p_kmer = self.twoD_alignment_table[0][2] for t, c, kmer in self.twoD_alignment_table: ...
<reponame>dlens/dlxapi # coding: utf-8 """ Decision Lens API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import...
will match receipts on amount only. "notification_order" will match receipts in order of payment notifications received by signal. "confirmation_order" will match payments in order of confirmation on the Mobilecoin blockchain Returns: bool: boolean representing if expected receipts match actual receipts """ pa...
id, unique_database, unique_table): uri = '/tmp' try: # Grant server privileges and verify admin_client.execute("grant all on server to {0} {1}".format(kw, id), user=ADMIN) result = self.client.execute("show grant {0} {1} on server".format(kw, id)) TestRanger._check_privileges(result, [ [kw, id, "", "", "", "*",...
optional Prefix for HOLE output files. write_input_files: bool, optional Whether to write out the input HOLE text as files. Files are called `hole.inp`. Returns ------- dict A dictionary of :class:`numpy.recarray`\ s, indexed by frame. .. versionadded:: 1.0 """ input_file = '{prefix}hole{i:03d}.inp' ...
= request.form['title'] unsigned_credential["credentialSubject"]["description"] = request.form['description'] unsigned_credential["credentialSubject"]["startDate"] = request.form['start_date'] unsigned_credential["credentialSubject"]["endDate"] = request.form['end_date'] unsigned_credential["credentialSubject"]["sk...
n(T-1) x d0 x d1 x ...)```, this splits values into a TensorArray with T tensors. TensorArray index t will be the subtensor of values with starting position ```(n0 + n1 + ... + n(t-1), 0, 0, ...)``` and having size ```nt x d0 x d1 x ...``` Args: handle: A `Tensor` of type `resource`. The handle to a Tensor...