input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"GOMC_CONTROL_FILE_WRITTEN"
try:
value = gomc_control.write_gomc_control_file(
charmm,
"test_save_NVT_bad_variables_part_8.conf",
"GEMC_NPT",
10,
300,
input_variables_dict={
"MEMC_DataInput": [
[1, "ETH", ["C2", "C1"], "ETO", ["O1", "C1"]]
],
"DisFreq": 0.05,
"RotFreq": 0.05,
"IntraSwapFreq": 0.05,
"Swa... | |
<reponame>rlquinn/landscaper
# Copyright (c) 2017, Intel Research and Development Ireland 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
#... | |
<filename>lib/sqlalchemy/orm/scoping.py
# orm/scoping.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import annotations
from typ... | |
= _openbabel.READONEONLY
READBINARY = _openbabel.READBINARY
ZEROATOMSOK = _openbabel.ZEROATOMSOK
NOTWRITABLE = _openbabel.NOTWRITABLE
WRITEONEONLY = _openbabel.WRITEONEONLY
WRITEBINARY = _openbabel.WRITEBINARY
READXML = _openbabel.READXML
DEPICTION2D = _openbabel.DEPICTION2D
DEFAULTFORMAT = _openbabel.DEFAULTFORMAT
cla... | |
#!/usr/bin/env python
#
# Copyright 2010 Google 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 ag... | |
try:
_self.lock(_self)
r = _cmd.get_viewport(_self._COb)
finally:
_self.unlock(r,_self)
if is_ok(r):
if len(r):
if (_self.get_setting_int("logging") != 0) and (output<3):
if not quiet:
print(" get_viewport: data written to log file.")
_self.log("_ viewport (\\\n","cmd.viewport((\\\n")
_self.log("_ %14.9f, %1... | |
import streamlit as st
import numpy as np
import pandas as pd
import torch
from torchvision import transforms
import models
import yaml
from skimage import io, transform, filters
import cv2 as cv
from scipy import ndimage
from pathlib import Path
from argparse import Namespace
from PIL import Image, ImageFilter
from o... | |
def transitionFunction_idleBehaviour_fun1(self):
self.log("[Behaviour idleBehaviour] -- Calculating Partial Transition Function fun1")
# Partial Transition Function - the first layer #
self.log("PARTIAL TRANSITION FUNCTION - FIRST LAYER - idleBehaviour consists of the following partial transition functions (decompo... | |
runtime)
)
async def edit_order_with_options_async(
self,
request: dingtalkjzcrm__1__0_models.EditOrderRequest,
headers: dingtalkjzcrm__1__0_models.EditOrderHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkjzcrm__1__0_models.EditOrderResponse:
UtilClient.validate_model(request)
body = {}
if not Uti... | |
# @Author: <NAME>
# @Email: <EMAIL>
# @Filename: spherical_brute_force.py
# @Last modified by: <NAME>
# @Last modified time: 31-Jul-2018
"""Obtain clusters and calculate meta-features.
Args:
dataset_filename (string): path to the dataset
Predefined types:
Point (dict): {'coordinate': (float, ...), 'label': int}
Da... | |
each sentence
"""
try:
import mishkal.tashkeel
# Load vocalizer
if not hasattr(self, "vocalizer"):
vocalizer = mishkal.tashkeel.TashkeelClass()
setattr(self, "vocalizer", vocalizer)
# Add diacritics
text = vocalizer.tashkeel(text)
except ImportError:
_LOGGER.warning("mishkal is highly recommended for lang... | |
>= 45:
self.sector_name += ' ' + chr(ord(self.word[0]) - 32) + self.word[1:len(self.word)]
elif name_variance >= 35:
self.sector_name += ' ' + 'Alpha'
elif name_variance >= 25:
self.sector_name += ' ' + 'Beta'
elif name_variance >= 15:
self.sector_name += ' ' + 'Gamma'
elif name_variance >= 10:
self.sector_nam... | |
<filename>awsRESv2.py
import os, sys
import re, time, datetime
import shutil, atexit
import subprocess
import yaml
from awsAPI import aws, print_color
#version 2: backup all termination/creation cli
#version 2.1: add GWLB v1 support
class resource(object):
def __init__(self):
self.creation_dependency = None
self.t... | |
<reponame>ramsuthar305/SwachhHab59
from flask import render_template, request, redirect, url_for, session, escape, Flask, jsonify
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from bson import regex, ObjectId
from random import randint
import json
import pathlib
import hashlib
impo... | |
such as downloading files from a
# remote camera.
# If you register the callback function, the EDSDK calls the callback
# function during execution or on completion of the following APIs.
# This timing can be used in updating on-screen progress bars, for example.
#
# Parameters:
# In: inRef - The reference of the strea... | |
or pidx < 0:
# no parens, current block ends at keyword
return kidx
else:
# parens, there might be a child filter inside.
# find the close parens and that is end of block
pidx = match_symbol(S)
if pidx > 0:
return find_keyword(S, start=pidx, keywords=keywords)
else:
return -1
def split_sqly(S, keywords=FILT... | |
<gh_stars>1-10
"""
Hierarchical GAN with InfoGAN structure and losses
Author(s): <NAME> (<EMAIL>)
"""
import os.path
import pickle
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Flatten, Reshape, Input, Lambda
from keras.layers import Conv2D, Conv2DTranspose... | |
'''
@Author: <NAME>
https://github.com/lindawangg/COVID-Net/blob/master/create_COVIDx_v2.ipynb
@Date: 2020-04-06 15:50:21
@
# Description:
'''
import numpy as np
import pandas as pd
import os
import random
from shutil import copyfile
import pydicom as dicom
import cv2
from torch.utils.data import Dataset,DataLoader
f... | |
authenticated and unauthenticated roles are supported.
- *(string) --*
- *(string) --*
- **RoleMappings** *(dict) --*
How users for a specific identity provider are to mapped to roles. This is a String-to- RoleMapping object map. The string identifies the identity provider, for example, "graph.facebook.com" or "... | |
qualifier=False, statement_type="predicate")
#statements_test = get_all_statements_of_entity('Q176198')
#id_statements_test = get_statements_by_id(statements_test, 'Q176198', 'P725')
#id_statements_test[0]
# In[107]:
# parameters
# cluster_root_ids: ['Qcode']
# predicates_ids: ['Pcode']
def cluster_extend_by_predic... | |
# -*- coding: utf-8 -*-
"""
VirtualBox COM/XPCOM constants.
This file is autogenerated from VirtualBox.xidl, DO NOT EDIT!
"""
__copyright__ = \
"""
Copyright (C) 2009-2016 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free sof... | |
<reponame>danjperron/A2D_PIC_RPI
#!/usr/bin/env python
################################
#
# burnLVP.py
#
#
# Program to burn pic12F1840 using LVP mode with a Rasberry Pi
#
#
# programmer : <NAME>
# Date : June 30, 2013
# Version : 1.0
#
# source code: https://github.com/danjperron/A2D_PIC_RPI
#
#
#/////////////////... | |
<filename>fhir/resources/conditiondefinition.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/ConditionDefinition
Release: R5
Version: 4.5.0
Build ID: 0d95498
Last updated: 2021-04-03T00:34:11.075+00:00
"""
import typing
from pydantic import Field
from pydantic import root_vali... | |
of nodes to use
"""
return pulumi.get(self, "max_node_count")
@property
@pulumi.getter(name="minNodeCount")
def min_node_count(self) -> Optional[int]:
"""
Min number of nodes to use
"""
return pulumi.get(self, "min_node_count")
@property
@pulumi.getter(name="nodeIdleTimeBeforeScaleDown")
def node_idle_tim... | |
this may not always be available or up to date. For \
example, if a user changes their display name, the API may show the new value in a future response, but the items \
associated with the user won't show up as having changed when using delta.
id: Unique identifier for the identity.
- name: --microsoft-graph-ide... | |
) == path ]), 6 )
self.assertEqual( prims[0].vertex( 0 ).point().position(), hou.Vector3( 3, 0, 0 ) )
self.assertEqual( prims[6].vertex( 0 ).point().position(), hou.Vector3( 6, 0, 0 ) )
node.parm( "root" ).set( "/1/2/3" )
prims = node.geometry().prims()
self.assertEqual( len(prims), 6 )
nameAttr = node.g... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from copy import deepcopy
from datetime import datetime, timedelta
from hashlib import md5
from Queue import Empty, Queue
import re
import ssl
import time
import traceback
# 3p
from pyVim import connect
... | |
)
@dataclass
class TeamEditMembersResult(DataClassJsonMixin):
failures: Optional[List[UserRolePair]] = field(
default=None, metadata=config(field_name="failures")
)
@dataclass
class InviteLinkDetails(DataClassJsonMixin):
invite_id: TeamInviteID = field(metadata=config(field_name="inviteID"))
inviter_uid: UID =... | |
#!/usr/bin/env python3
# Copyright 2021 BHG [bw.org]
# BWDB.py as of 2021-04-13 bw
# module version
__version__ = "3.1.11"
# import sqlite3
try:
import sqlite3
have_sqlite3 = True
except ImportError:
sqlite3 = None
have_sqlite3 = False
# import mysql
try:
import mysql.connector as mysql
have_mysql = True
exce... | |
270 degrees in air',
'files': ['tvd', 'c3d', 'amc', 'avi'],
'fps': 120},
59: {'desc': 'hop turn left 270 degrees in air',
'files': ['tvd', 'c3d', 'amc', 'avi'],
'fps': 120},
60: {'desc': 'hop turn left 270 degrees in air',
'files': ['tvd', 'c3d', 'amc', 'avi'],
'fps': 120},
61: {'desc': 'hop turn 360 degrees l... | |
<filename>ALGORITHM/Starcraft/star_foundation.py<gh_stars>0
from UTILS.colorful import print亮紫, print亮绿
import numpy as np
import copy
import math
import random
import torch
from operator import itemgetter as iget
from UTILS.tensor_ops import _2cpu2numpy, _2tensor, process_space, np_one_hot, __hash__
from config import... | |
float, i2: float, result: float) -> bool:
eq = make_strict_eq(input_wrapper(i1))
return eq(result)
elif eq_to == BinaryCondArg.SECOND:
def check_result(i1: float, i2: float, result: float) -> bool:
eq = make_strict_eq(input_wrapper(i2))
return eq(result)
else:
raise ValueError(f"{eq_to=} must be FIRST or SEC... | |
# -*- coding: utf-8 -*-
import json
import random
import urllib
from base64 import b64encode
from twisted.python import log
from twisted.web import http
from twisted.web.error import Error
from twisted.internet import defer, reactor
from twisted.internet.protocol import Protocol
from twisted.web.client import Agent,... | |
# Main driver file for user input and displaying
# Also checks legal moves and keep a move log
class GameState():
def __init__(self):
# Initial board state
# Board is 8x8 2d list with each element having 2 characters
# First character represents the color: w = white & b = black
# Second character represents the t... | |
Ecoli model to account for additional metabolites'''
query = stage02_isotopomer_query()
# get the xml model
cobra_model_sbml = ''
cobra_model_sbml = query.get_row_modelID_dataStage02IsotopomerModels(model_id_I);
# load the model
if cobra_model_sbml:
if cobra_model_sbml['file_type'] == 'sbml':
with open('data/c... | |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init
import torch.backends.cudnn as cudnn
import numpy as np
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.nn.utils.clip_grad import clip_grad_norm
def l1norm(matrix, dim, eps=1e-8):
... | |
<gh_stars>0
# *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0
# which accompanies this distribution, and is available at
# http://www.... | |
<gh_stars>10-100
# Generated from SqlSmall.g4 by ANTLR 4.8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u00ac")
buf.write("\u05f6\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5... | |
width=9*cm, height=0.9*cm, fill=False,stroke=True),
# Label(text='<b>Description</>', top=8.1*cm, left=1.4*cm, style={'fontName': 'Candara-Bold', 'alignment': TA_CENTER}),
# Rect(left=11.5*cm, top=7.9*cm, width=5*cm, height=0.9*cm, fill=False,stroke=True),
# Label(text='<b>Qty</b>', top=8.1*cm, left=11.2*cm, style={... | |
tuple(slc_tuple)
slice_list.append(slc_tuple)
return tuple(slice_list)
def calc_matching_peer_rank_slices(out_slice, inp_arys):
"""
For each input array in :samp:`{inp_arys}, calculates the portion
which broadcasts to the :samp:`{out_slice}`.
Returns :obj:`tuple` of :obj:`slice` (one tuple for each array/scala... | |
def __mul__(self, o):
res = self.__v * o
return concolic_int(sym_mul(ast(self), ast(o)), res)
def __div__(self, o):
res = self.__v / o
return concolic_int(sym_div(ast(self), ast(o)), res)
def _sym_ast(self):
return self.__sym
class concolic_str(str):
def __new__(cls, sym, v):
assert type(v) == str or type(v... | |
<filename>paperII/abundace_evolution.py
from galaxy_analysis.plot.plot_styles import *
import numpy as np
import matplotlib.pyplot as plt
import deepdish as dd
import h5py, glob, sys
from galaxy_analysis.utilities import utilities
from galaxy_analysis.analysis import Galaxy
from mpl_toolkits.axes_grid1 import make_a... | |
# Copyright 2021 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
#
# Unless required by applicable ... | |
w = r*w
#print shortstr(w)
v = dot(B, w) - w
assert eq(v, s)
weights.append(w)
W = array(weights)
print("W:")
print(shortstr(W))
Wt = W.transpose()
St = S.transpose()
# What combination of weights gives the (simple) roots?
U = solve(Wt, St)
print("U:")
print(shortstr(U))
# What combination of roots gi... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for utils.py.
@author: <NAME>
"""
import os
import pathlib
import glob
import time
import unittest
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
import numpy as np
import m... | |
# The chain (Rumors reference intended)
# ----------------------------------------- Higher-level Chain functions -----------------------------------------------
def makeChain(functionDictList, preiterable=None, inMethod=None, in_kwargs=None, writeInfoExists=False,
recordMethod=None, record_kwargs=None, writeInfo_re... | |
import numpy as np
import multiprocessing
import sys
import time
import matplotlib.pyplot as plt
# =============================================================================
# Distributed Computing Parameters
pool_size = multiprocessing.cpu_count()
# Genetic Circuit Hyperparameters
NODES = 3000
# Evolutionary Alg... | |
"""Parameters.py - Parameter handling for ruffus pipelines
==========================================================
Reference
---------
"""
import re
import collections
import os
import configparser
import sys
import CGATCore.Experiment as E
import CGATCore.IOTools as IOTools
from CGATCore.Pipeline.Utils impor... | |
= copy.deepcopy(diag_params)
report_methods = copy.deepcopy(report_methods)
net.load.p_kw.at[4] *= 1000
check_result = pp.overload(net, diag_params['overload_scaling_factor'])
if check_result:
diag_results = {check_function: check_result}
else:
diag_results = {}
assert diag_results[check_function] == \
{'gene... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 20 12:59:15 2020
@author: ssli
script to make the data vector plot
"""
import pandas as pd
import numpy as np
from XiPlot import XiPlotFunc
# # ++++++++++++++++++++++++++++++++++++++++++ data: whole vs. red vs. blue
# # Number of bins
# nzbi... | |
have issues here because H5py dataset
# return data
#
#
# def _set_datas(dat: DatHDF, datas: EA_datas):
# """Saves 2D datasets properly in HDF, more efficient for loading etc"""
# for name, list_datas in asdict(datas).items():
# if list_datas is not None and list_datas != []:
# for i, data in enumerate(list_datas):
# i... | |
from __future__ import print_function
if __name__ == '__main__':
import matplotlib
matplotlib.use('Agg')
from optparse import OptionParser
from math import sqrt, floor, ceil, pi
from glob import glob
import numpy as np
import pylab as plt
from scipy import linalg
from astrom_common import *
from astrom_intra impor... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python... | |
<reponame>ChenSunMac/Kaggle_Project<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 15 17:00:02 2018
@author: Chens
"""
import sys #access to system parameters https://docs.python.org/3/library/sys.html
print("Python version: {}". format(sys.version))
import pandas as pd #collection of functions for data p... | |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import division
import argparse
import pprint
import urllib
import re
import os
import pdb
import sys
import codecs
import json
import typotools
import traceback
import subprocess
import shlex
import datetime
from typ... | |
"""JSON Keys core functions.
JSON Key definition:
An ordered sequence of one or more JSON pointer reference tokens
(Object member key or array index) starting with a root-level
key/index and ending with a reference to some value within the
document.
The last key can optionally be Python slice syntax, where # can... | |
# -*- encoding: utf-8 -*-
# WARNING: This file is managed by Puppet. Changes to this file will be overwritten.
# Script Location: /usr/lib/python2.6/site-packages/cloudbackup-1.0.01-py2.6.egg/cloudbackup/backends.py
# File Mode: 755
import tempfile
import sys
import subprocess
import os
import math
import logging
impor... | |
if _map is not None:
return _map
result = dict()
if self.headers is not None:
result['headers'] = self.headers
return result
def from_map(self, m: dict = None):
m = m or dict()
if m.get('headers') is not None:
self.headers = m.get('headers')
return self
class GetGeneralFormCreatedDeptSummaryHeaders(TeaMod... | |
<gh_stars>0
import os
import glob
import cv2
import scipy.misc as misc
from skimage.transform import resize
import numpy as np
from functools import reduce
from operator import mul
import torch
from torch import nn
import matplotlib.pyplot as plt
import re
try:
import cynetworkx as netx
except ImportError:
import net... | |
== len(workplace_names) # Each name should be unique
workplaces = pd.DataFrame({
'ID': range(0, len(workplace_names)),
'MSOA': workplace_msoas,
'SOC': workplace_socs
})
assert len(workplaces) == len(self.all_msoas) * len(possible_jobs) # One location per job per msoa
PopulationInitialisation._add_location_colum... | |
import alignments
import re
import read
import binaryIO
import math
import os
import preprocess
import time
class Compressor:
aligned = None
# 0 - zlib
# 1 - lzma
# 2 - bz2
compressMethod = 0
covSize = 0
totalSize = 0
def __init__(self, frag_len_cutoff):
if self.compressMethod == 0:
self.zlib = __import__... | |
import h5py
import numpy as np
from scipy.io import loadmat
from operator import itemgetter
import math
import scipy as sp
import cv2
import matplotlib.pyplot as plt
import os, sys
import time
import multiprocessing
import random
# Generate Observation Map
def func(theta, m, I, imax, L, w, N, anglemask):
print('*',... | |
<gh_stars>10-100
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
import sys, os, ma... | |
<reponame>AT-jamesp0013/Theano
from __future__ import absolute_import, division, print_function
import os
import warnings
import pkg_resources
import numpy as np
from numpy.linalg.linalg import LinAlgError
import theano
from theano import Op, config, tensor
from theano.scalar import bool as bool_t
from theano.gof im... | |
Grey": 0xA8C0BB,
"Harbour Light": 0xD7E0E7,
"Harbour Mist": 0xDAE1E3,
"Harbour Mist Grey": 0x778071,
"Harbour Rat": 0x757D75,
"Harbour Sky": 0x7EB6D0,
"Harbourmaster": 0x4E536B,
"Hard Candy": 0xFFBBBB,
"Hard Coal": 0x656464,
"Hardware": 0x8B8372,
"<NAME>": 0x006383,
"H<NAME>": 0xA52A2A,
"Harlequin": 0x3FFF0... | |
"{}_prepro.tiff".format(modality_name)
cache_transform_fp = self.image_cache / "{}_init_tforms.json".format(
cache_im_fp.stem
)
cache_osize_tform_fp = (
self.image_cache
/ "{}_orig_size_tform.json".format(cache_im_fp.stem)
)
if cache_im_fp.is_file() is False:
sitk.WriteImage(reg_image.reg_image, str(cache_im... | |
out of :ref:`range <ref-matrixrange>`.
"""
ncols = _stp._st_getmatrixcol(name)
nrows = _stp._st_getmatrixrow(name)
if rows is None:
mrows = None
else:
mrows = _get_matrix_index(rows, name, nrows, ncols, True)
if cols is None:
mcols = None
else:
mcols = _get_matrix_index(cols, name, nrows, ncols, False)
... | |
= reshape(matmul(gate_mat, reshape(new_state.vector, [2, half_length])), [new_state_len, 1])
# Update the order of active vertices and the background state
self.vertex.active = new_state.system
self.__bg_state = State(new_state.vector, new_state.system)
def __create_graph_state(self, which_qubit):
r"""以待测量的比特为输入参... | |
from __future__ import absolute_import
import sys
import warnings
from typing import Any, List, Tuple, Type
import numpy as np
from pandas import DataFrame
from scipy import interpolate, signal
from scipy.stats import pearsonr
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
from sklearn.... | |
<reponame>Bhumbra/probayes
""" Provides probability distribution funciontlaity based on Distribution """
#-------------------------------------------------------------------------------
import collections
import numpy as np
from probayes.named_dict import NamedDict
from probayes.pd_utils import str_margcond, margcond_... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import discord
import os
from typing import Dict, List, Set, Tuple
from cache import PssCache
import emojis
import pss_assert
import pss_entity as entity
import pss_core as core
import pss_lookups as lookups
import settings
import utility as util
# ---------- Constants ... | |
98:
return '~'
if table2Version == 129 and indicatorOfParameter == 97:
return '~'
if table2Version == 129 and indicatorOfParameter == 96:
return '~'
if table2Version == 129 and indicatorOfParameter == 95:
return '~'
if table2Version == 129 and indicatorOfParameter == 94:
return '~'
if table2Version == 12... | |
_get_lun_status(self, lun_name):
if not lun_name:
err = _('Param [lun_name] is invalid.')
raise exception.InvalidParameterValue(err=err)
try:
lun_info = self._get_lun_info(lun_name,
['status', 'is_action_locked'])
except Exception:
with excutils.save_and_reraise_exception():
LOG.exception('Failed to _get_lun_... | |
headers=self.json_headers, environ=self.extra_environ_admin)
resp = json.loads(response.body)
assert len(resp) == 97
@nottest
def test_search_h_empty(self):
"""Tests POST /forms/search: is NULL."""
json_query = json.dumps(
{'query': {'filter': ['Form', 'narrow_phonetic_transcription', '=', None]}})
response = ... | |
# ------------------------------------------------------------------------------
# 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 requir... | |
# Python wrapper for EDSDK
# Camera operating function
import ctypes
import os
import platform
from .pyEDSDKTypes import *
if platform.uname()[0] == "Windows":
dir_path = os.path.dirname(os.path.realpath(__file__))
dllPath = os.path.join(dir_path, 'EDSDK.dll')
dllImagePath = os.path.join(dir_path, 'EdsImage.dll')... | |
<filename>src/models/portfolio.py
import datetime
import pandas as pd
from src.models.utils import get_current_port, get_advised_port, get_recommendation
from src.models.load_data import Balance, Instruments, AdvisedPortfolios, PriceDB, Singleton
import copy
import math
from typing import Sequence
import numpy as np
... | |
# -*- coding: utf-8 -*-
import collections
import getpass
import os
import pytest
@pytest.fixture()
def mock_getuser(mocker):
"""Mock 'getpass.getuser' function."""
return mocker.patch.object(getpass, "getuser", return_value="john-doe")
@pytest.fixture()
def mocked_expanduser(mocker):
"""Return mocked 'os.path... | |
def __repr__(self): # print attributes
return str([key for key in self.__dict__.keys()])
@property
def open_folder(self):
"""Open the data folder"""
from ..utils.functions import open_folder
open_folder(self.path)
def extract(self, time_range: list):
"""
Extracts data from the specified range
Parameters
... | |
<filename>examples/libs/gif/img_bulb_gif.py
img_bulb_gif_map = [
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x3c, 0x00, 0x50, 0x00, 0xf7, 0x00, 0x00, 0xfa, 0xfb, 0xfb,
0xfd, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0xd9, 0xec, 0xfe, 0x1e, 0x93, 0xfe, 0x23, 0x95, 0xfd, 0x5f,
0xb2, 0xff, 0x52, 0xac, 0xfe, 0xb1, 0xd8, 0xff, 0xce, 0xe7,... | |
<filename>gui.py
import sys, random
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seabo... | |
import inspect
from inspect import Signature, Parameter
from typing import Dict, List, Callable, Any, Optional, Union
from illuminate_core.support.utils import call_user_func
from illuminate_core.contract.container import Container as ContainerInterface, ContextualBindingBuilder as ContextualBindingBuilderInterface
fr... | |
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[DocumentState]',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def get_document_state_by_id(self, id, **kwargs):
"""
Get a documentState by its unique ID
Retrieve a documentState by its ID.
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# make_unicode_property_data.py
# Copyright (c) 2016-2018 K.Kosako
import sys
import re
POSIX_LIST = [
'NEWLINE', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower',
'Print', 'Punct', 'Space', 'Upper', 'XDigit', 'Word', 'Alnum', 'ASCII'
]
MAX_CODE_POINT = 0x10ffff
GRAPH... | |
#!/usr/bin/env python3
# coding: utf-8
#
# A script that collects referentially transparent functions related to drawing.
import curses
import utils
# A function that initializes Curses.
def initialize():
# Make cursor invisible.
curses.curs_set(0)
# Color initialization. The background color is assumed to be t... | |
lambda self: 100
self.assertEqual(int(a), 100)
self.assertEqual(a.foobar, 2)
self.assertNotHasAttr(a, "spam")
def mygetattr(self, name):
jeżeli name == "spam":
zwróć "spam"
podnieś AttributeError
C.__getattr__ = mygetattr
self.assertEqual(a.spam, "spam")
a.new = 12
self.assertEqual(a.new, 12)
def mysetattr(... | |
##########
# Code from: https://github.com/tobiasbaumann1/Adaptive_Mechanism_Design
##########
import copy
import logging
import numpy as np
import tensorflow as tf
logging.basicConfig(filename='Planning_Agent.log', level=logging.DEBUG, filemode='w')
from marltoolbox.algos.adaptive_mechanism_design.agent import Agent... | |
<gh_stars>10-100
import json
import math
import time
from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.csrf import requires_csrf_token
from django.views.decorators.csrf import ensure_csrf_cookie
import authorization... | |
without end_time
stage.start_timestamp = .1
cb._update_progress_time_info(None)
self.assertEqual(ctx.progress, {})
# update with end_time
cb._update_progress_time_info(1.5)
self.assertAlmostEqual(ctx.progress['elapsed'], 1.4)
# update eta
self.assertNotIn('eta', ctx.progress)
stage.get_eta = mock.Mock(retur... | |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
import json
import logging
from datetime import datetime, timezone
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.templatetags.static im... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | |
"""various mesh_utils tests"""
import os
import unittest
from io import StringIO
from docopt import DocoptExit
import numpy as np
from cpylog import SimpleLogger
#import pyNastran
#from pyNastran.bdf.bdf import BDF
#root_path = pyNastran.__path__[0]
#test_path = os.path.join(root_path, 'bdf', 'test', 'unit')
import... | |
(self._metadata_pb.emulator_type ==
emulator_meta_data_pb2.EmulatorMetaDataPb.QEMU2):
possible_kernels = ['kernel-ranchu-64', 'kernel-ranchu']
else:
possible_kernels = ['kernel-qemu']
system_image_dir = self._metadata_pb.system_image_dir
for name in possible_kernels:
if os.path.isfile(os.path.join(system_image_... | |
<filename>jcast/main.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""jcast.main: Main function."""
import os
import datetime
import logging
from functools import partial
import tqdm
from jcast import params, fates, model
from jcast.junctions import Junction, RmatsResults
from jcast.annots import ReadAnnotations, Read... | |
graph.merged_outputs_map[fetch.name]
return fetch
elif isinstance(fetch, ops.Operation):
graph = Graph.get()
op_replicas = graph.get_local_replicas(graph.get_operation_by_name(fetch.name))
replicas.extend([item.primitive_obj for item in op_replicas])
return fetch
elif isinstance(fetch, (six.string_types, SparseT... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Tests for salt.utils.jinja
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import ast
import copy
import datetime
import os
import pprint
import re
import tempfile
# Import Salt libs
import salt.config
import salt.loader
# date... | |
^ ( 1 / 2.4 ) ) - 0.055
# else, data[x, y, c] = data[x, y, c] * 12.92
data[mask] **= 0.4167
data[mask] *= 1.055
data[mask] -= 0.055
data[np.invert(mask)] *= 12.92
# rescale
return np.clip(data * clip_range[1], clip_range[0], clip_range[1])
def degamma_adobe_rgb_1998(self, clip_range=[0, 65535]):
# bring d... | |
Args:
timeout(float): The maximum amount of time to wait in seconds.
"""
_funcs.nx_wait(self._handle, constants.Condition.INTF_COMMUNICATING, 0, timeout)
def wait_for_intf_remote_wakeup(self, timeout=10):
# type: (float) -> None
"""Wait for interface remote wakeup.
Wait for the interface to wakeup due to activ... | |
* uk_61
+ 1085386600 * uk_62
+ 705501290 * uk_63
+ 2442119850 * uk_64
+ 2094796138 * uk_65
+ 1889232031 * uk_66
+ 978876700 * uk_67
+ 636269855 * uk_68
+ 2202472575 * uk_69
+ 225 * uk_7
+ 1889232031 * uk_70
+ 507190000 * uk_71
+ 329673500 * uk_72
+ 1141177500 * uk_73
+ 978876700 * uk_74
+ 214287775 * uk_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.