input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>0
# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This file is automatically generated by mkgrokdump and should not
# be modified manually.
# List of known V8 instance types.
INSTANCE_TYPES ... | |
<reponame>ZaydH/stratego
# -*- coding: utf-8 -*-
r"""
tests.test_state
~~~~~~~~~~~~~~~~
Tests for the \p State class including movement mechanics and enumeration of the \p MoveSet
class.
:copyright: (c) 2019 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
from typing import Tuple
import pytest
fro... | |
"""
Structure & PKCS11-specific definitions.
"""
from ctypes import CFUNCTYPE, Structure
from pycryptoki.cryptoki.c_defs import *
from pycryptoki.cryptoki.helpers import struct_def
# values for unnamed enumeration
CK_MECHANISM_TYPE = CK_ULONG
CK_MECHANISM_TYPE_PTR = POINTER(CK_MECHANISM_TYPE)
CK_USER_TYPE = CK_ULON... | |
'''
Parse the Versa Literate (Markdown) serialization of Versa
Proper entry point of use is versa.serial.literate
see: doc/literate_format.md
'''
import re
import itertools
import markdown
from amara3 import iri # for absolutize & matches_uri_syntax
from amara3.uxml import html5
from amara3.uxml.tree import treeb... | |
InputDataNotConvertibleExc),
(ipaddress.ip_address("127.0.0.1"), InputDataNotConvertibleExc),
(ipaddress.ip_address("::1"), InputDataNotConvertibleExc),
(ipaddress.ip_network("127.0.0.0/30"), ["127.0.0.0", "127.0.0.1", "127.0.0.2", "127.0.0.3"]),
(ipaddress.ip_network("2001:db8::/126"), ["2001:db8::", "2001:db8::1"... | |
<reponame>pjh/vm-analyze<gh_stars>1-10
# Virtual memory analysis scripts.
# Developed 2012-2014 by <NAME>, <EMAIL>
# Copyright (c) 2012-2014 <NAME> and University of Washington
from util.pjh_utils import *
import conf.system_conf as sysconf
import datetime
import os
import shlex
import shutil
import signal
import subp... | |
for required, given in zip(pdb_required, pdb_list):
assert required == given, f"{required} was not created"
logger.info(f"All required PDBs created: {pdb_required}")
def get_osd_utilization():
"""
Get osd utilization value
Returns:
osd_filled (dict): Dict of osd name and its used value
i.e {'osd.1': 15.27628... | |
self.score_type == 'rmse':
score_val = rmse_folds
else:
score_val = norm_rmse_folds
except Exception as e:
print("Exception occurred while building Prophet model...")
print(e)
print(' FB Prophet may not be installed or Model is not running...')
self.ml_dict[name]['model'] = model
self.ml_dict[name][... | |
Name: 媒体文件名称。
:type Name: str
:param Description: 媒体文件描述。
:type Description: str
:param CreateTime: 媒体文件的创建时间,使用 [ISO 日期格式](https://cloud.tencent.com/document/product/266/11732#I)。
:type CreateTime: str
:param UpdateTime: 媒体文件的最近更新时间(如修改视频属性、发起视频处理等会触发更新媒体文件信息的操作),使用 [ISO 日期格式](https://cloud.tencent.com/document/... | |
np.min(rres)
else:
self.se_dur = tt[(rres<1.)][-1] - tt[(rres<1.)][0] if np.sum(rres<1.)>1 else 0
self.se_depth = np.min(rres)
return np.mean(tt, axis=1), np.mean(rres, axis=1)
def rvprep(self, t, rv1, rv2, drv1, drv2):
"""Stores observed radial velocity data points
Parameters
----------
t : float array or ... | |
WASM_OP_Code.section_code_dict['type'])
tmp_obj.insert(0, "01")
# tmp_obj.insert(0, '01')
self.Obj_Header = tmp_obj
def PrintTypeHeaderObj(self):
# print(self.Obj_Header)
for byte in self.Obj_Header:
print(byte)
def Dump_Obj_STDOUT(self):
for bytecode in self.Obj_file:
print(bytecode)
# reads a wasm-obj ... | |
data monitor (true | false)",
display_name="Data Monitor",
type=ParameterDictType.BOOL))
self._param_dict.add_parameter(
RegexParameter(InstrumentParameters.LOG_DISPLAY_TIME,
r'Monitor\s+(?:\w+\s+){1}(\w+)',
lambda match: True if match.group(1) == ON else False,
lambda x: YES if x else NO,
visibility=Parameter... | |
users_graph['valueAxes'][0]['title'] = 'Points'
users_graph['graphs'] = users_graphs
users_graph['dataProvider'] = sorted(users_data_provider, key=lambda x: x['date'])
# compute the cart of challenge solvers over time for each challenge
challenges_graphs = []
challenges_data_provider = []
for i, chal in enumera... | |
ID,
MTS_CREATE,
MTS_UPDATE
],
...
]
Examples
--------
::
positions = bfx_client.positions_history(limit=10)
for position in positions:
print(position)
"""
body = kwargs
raw_body = json.dumps(body)
path = "v2/auth/r/positions/hist"
response = self._post(path, raw_body, verify=True)
return response
... | |
line_num=6350, add=1)
ClassGetCallerInfo1S.get_caller_info_s1bt(exp_stack=exp_stack,
capsys=capsys)
# call base class class method target
update_stack(exp_stack=exp_stack, line_num=6355, add=0)
cls.get_caller_info_c1bt(exp_stack=exp_stack, capsys=capsys)
update_stack(exp_stack=exp_stack, line_num=6357, add=0)
s... | |
<filename>packages/pdf/src/RPA/PDF/keywords/finder.py
import functools
import math
import re
from dataclasses import dataclass
try:
# Python >=3.7
from re import Pattern
except ImportError:
# Python =3.6
from re import _pattern_type as Pattern
from typing import (
Callable,
Dict,
List,
Optional,
Union,
)
fro... | |
from __future__ import print_function
import os
import signal
import socket
import struct
import subprocess
import sys
import unittest
import random
import time
import tempfile
import plasma
USE_VALGRIND = False
def random_object_id():
return "".join([chr(random.randint(0, 255)) for _ in range(plasma.PLASMA_ID_SIZ... | |
None:
self.adv_temperature = nn.Parameter(torch.Tensor([adv_temperature]))
self.adv_temperature.requires_grad = False
self.adv_flag = True
else:
self.adv_flag = False
def get_weights(self, n_score):
return F.softmax(n_score * self.adv_temperature, dim = -1).detach()
def forward(self, p_score, n_score):
if se... | |
not self.__flag:
self.__cond.wait(timeout)
return self.__flag
finally:
self.__cond.release()
# Helper to generate new thread names
_counter = _count().next
_counter() # Consume 0 so first non-main thread has id 1.
def _newname(template="Thread-%d"):
return template % _counter()
# Active thread administration
_ac... | |
import struct
import unittest
import unittest.mock as mock
from io import StringIO
from numpy import float32
import settings
from interpreter import exceptions as ex
from interpreter import memory, syscalls
from interpreter.classes import Label
from interpreter.interpreter import Interpreter
'''
https://github.com/s... | |
import os
from helper_evaluate import compute_accuracy, compute_mae_and_mse
from helper_losses import niu_loss, coral_loss, conditional_loss, conditional_loss_ablation
from helper_data import levels_from_labelbatch
import time
import torch
import torch.nn.functional as F
from collections import OrderedDict
import jso... | |
level (>=14) first.')
sys.exit(3)
# Check ant install
ant_path = Which('ant')
if ant_path is None:
print('failed\nAnt could not be found. Please make sure it is installed.')
sys.exit(4)
print('ok')
def MakeApk(options, app_info, manifest):
CheckSystemRequirements()
Customize(options, app_info, manifest)
n... | |
resave_all(self, without_mtime=False):
self.save(without_mtime=without_mtime, no_propagate=True)
for mc in self.meaningcontext_set.all():
mc.resave_all(without_mtime=without_mtime)
for ex in self.examples:
ex.resave_all(without_mtime=without_mtime)
for m in self.child_meanings:
m.resave_all(without_mtime=without... | |
<reponame>leonardt/veriloggen
from __future__ import absolute_import
from __future__ import print_function
import sys
import os
import collections
import tempfile
import veriloggen.core.vtypes as vtypes
import veriloggen.core.module as module
import veriloggen.core.function as function
import veriloggen.core.task as t... | |
<gh_stars>0
"""
Defines the ComposedPOVM class
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government re... | |
entries to the next workq file
steps_to_scramble = " ".join(reverse_steps(steps_to_solve.split()))
if self.use_edges_pattern:
workq_line = f"{pattern}:{state}:{steps_to_scramble}"
else:
workq_line = f"{state}:{steps_to_scramble}"
to_write.append(workq_line + " " * (workq_line_length - len(workq_line)) + "\n")
... | |
<reponame>TheFarGG/qord
# MIT License
# Copyright (c) 2022 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | |
import numpy as np
from sklearn.metrics import roc_auc_score
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from os.path import join
import dask.dataframe as dd
import pandas as pd
import seaborn as sns
from collections import Counter
import xarray as xr
import cartopy.crs as ccrs
import cartop... | |
# -*- coding: utf-8 -*-
"""
Test the RescaleToBound class.
"""
import numpy as np
import pytest
from unittest.mock import MagicMock, call, create_autospec, patch
from nessai.reparameterisations import RescaleToBounds
from nessai.livepoint import get_dtype, numpy_array_to_live_points
@pytest.fixture
def reparam():
r... | |
<filename>exp1_bot_detection/SATAR_FT/SATAR_FT.py<gh_stars>1-10
import torch
import numpy
import math
import pandas as pd
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
import random
import torch.nn.utils.rnn as rnn
from torch.uti... | |
0.00435488,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.139305,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic':... | |
<reponame>MosHumanoid/bitbots_thmos_meta<gh_stars>0
#!/usr/bin/python3
import os
import rospy
import rosnode
import roslaunch
import rospkg
import rostopic
from bitbots_msgs.msg import FootPressure
from diagnostic_msgs.msg import DiagnosticStatus
from geometry_msgs.msg import Twist
from std_srvs.srv import Empty
impor... | |
<filename>pygsm/growing_string_methods/se_gsm.py
from __future__ import print_function
# local application imports
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from coordinate_systems import Distance, Angle, Dihedral, OutOfPlane
from .main_gsm import MainGSM
from wrappers import Molecule
from uti... | |
<filename>manila/tests/api/v2/test_share_servers.py
# Copyright 2019 NetApp, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
be used.")
if args.variable_weights_inference:
options.constantWeights = False
if args.group_host_syncs:
options.groupHostSync = True
if args.internal_exchange_optimisation_target is not None:
engine_options["opt.internalExchangeOptimisationTarget"] = str(args.internal_exchange_optimisation_target)
options.e... | |
<filename>modules/general.py
from discord.ext import commands
import discord
import aiohttp
from bs4 import BeautifulSoup
import base64
import config
import random
from PIL import Image
from io import BytesIO
import datetime
import qrcode
from urllib.parse import quote_plus
import rethinkdb as r
from math import sqrt
... | |
"4354 4461 4536",
45562: "4354 4461 4537",
45563: "4354 4461 4538",
45564: "4354 4461 4539",
45565: "4354 4461 4540",
45566: "4354 4461 4541",
45567: "4354 4461 4542",
45568: "4354 4461 4543",
45569: "4354 4461 4544",
45570: "4354 4461 4545",
45571: "4354 4461 4546",
45572: "4354 4462",
45573: "4354 4462 45... | |
settings are kept null
newFormType.form_type_group = None
newFormType.is_hierarchical = False
#We need to delete all of the child Forms parent references
remove_all_form_hierarchy_parent_references(newFormType)
else:
newFormType.type = 0;
#Update the form type's group
#If it's a new group
if post_data.get('ft_... | |
if len(data_settings.i_coords) == 0:
if warning_strings != None:
warning_strings.append(
'WARNING(dump2data): atom_style unknown. (Use -atomstyle style. Assuming \"full\")')
warn_atom_style_unspecified = True
# The default atom_style is "full"
data_settings.column_names = AtomStyle2ColNames('full')
ii_coords = C... | |
# File: greynoise_connector.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
# Python 3 Compatibility imports
from __future__ import print_function, unicode_literals
# Phantom App imports
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.acti... | |
default=YANGBool("false"), is_leaf=True, yang_name="enable-interface-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/relay-agent', defining_module='openconfig-relay-agent', yang_type='boolean', is_config=True)
def _get_enable_re... | |
) << 24
oOO += int ( o0oOOoOOoO00O0oO [ 1 ] ) << 16
oOO += int ( o0oOOoOOoO00O0oO [ 2 ] ) << 8
oOO += int ( o0oOOoOOoO00O0oO [ 3 ] )
self . address = oOO
elif ( self . is_ipv6 ( ) ) :
if 81 - 81: Ii1I
if 8 - 8: I1ii11iIi11i * I1IiiI * OOooOOo - I1Ii111 - iII111i
if 67 - 67: oO0o
if 76 - 76: I1IiiI % I1IiiI - I... | |
<gh_stars>1-10
#!/usr/bin/python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | |
#! /usr/bin/env python3
# Copyright(c) 2019, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | |
"{", "]": "}", ";": ":", "'": "@", ",": "<", ".": ">", "/": "?",
"\\": "|"}
# Just gets the keys from the shifts dictionary
# tuple of numbers 0 - 9
shift_keys = shifts.keys()
# Static variable that holds the total number of text boxes in the program
# Used in checking which text box is in focus
# A text box mus... | |
been created")
self._iterations = variable
self._weights.append(self._iterations)
def _decayed_lr(self, var_dtype):
"""Get decayed learning rate as a Tensor with dtype=var_dtype."""
lr_t = self._get_hyper("learning_rate", var_dtype)
if isinstance(lr_t, learning_rate_schedule.LearningRateSchedule):
local_step = ... | |
servicebus topic create --resource-group myresourcegroup --namespace-name mynamespace --name mytopic
"""
helps['servicebus topic update'] = """
type: command
short-summary: Updates the Service Bus Topic
examples:
- name: Updates existing Service Bus Topic.
text: az servicebus topic update --resource-group myresou... | |
# -*- coding: utf-8 -*-
"""
This package implements several community detection.
Originally based on community aka python-louvain library from <NAME>
(https://github.com/taynaud/python-louvain)
"""
from __future__ import print_function
import array
import random
from math import exp, log, sqrt
from collections import... | |
<reponame>theGreenJedi/BciPy
import glob
import itertools
import logging
import random
from os import path, sep
from typing import Iterator
import numpy as np
import sounddevice as sd
import soundfile as sf
from PIL import Image
from psychopy import core
# Prevents pillow from filling the console with debug info
log... | |
!= 1: # pragma: no cover
raise ValueError(
"expected 1 value in each column of MAPS matrix "
f"but for SE {se}, found {n} values in column {col}"
)
matrix[r, 0] = col
matrix[r, 1] = struct.unpack(frmu, self._fileh.read(bytes_per))[0]
self._fileh.read(4) # endrec
key = self._getkey()
col += 1
self._getkey()
... | |
value:
value = '%s%s%s' % (perc, value, perc)
conditions.append({'name': key[:-1],
'op': 'like', 'value': value})
else:
if value != null:
conditions.append({'name': key,
'op': eq, 'value': value})
else:
conditions.append({'name': key,
'op': 'is null', 'value': ''})
elif key == 'conditions':
conditions.ext... | |
import os
from collections import defaultdict
from io import IOBase
from itertools import groupby
from typing import Dict, List, Tuple, Union, Optional, AnyStr
from uuid import uuid4
from zipfile import ZipFile
import msgpack
import networkx as nx
from typing.io import IO
from charge.babel import convert_from, IOType... | |
<reponame>dgarrett622/EXOSIMS
# -*- coding: utf-8 -*-
import time
import numpy as np
from scipy import interpolate
import astropy.units as u
import astropy.constants as const
import os, inspect
try:
import cPickle as pickle
except:
import pickle
import hashlib
from EXOSIMS.Prototypes.Completeness import C... | |
fdopen.argtypes = [c_int, c_char_p]
fdopen.restype = c_void_p
fdopen.errcheck = self.errcheck
with open(savFileName, mode) as f:
self.fd = fdopen(f.fileno(), mode)
if mode == "rb":
spssOpen = self.spssio.spssOpenRead
elif mode == "wb":
spssOpen = self.spssio.spssOpenWrite
elif mode == "cp":
spssOpen = self.sp... | |
as
'LO_yYYYYmMMdDD.nc'
:arg str bc_dir: the directory in which to save the results.
:arg str LO_dir: the directory in which Live Ocean results are stored.
:arg str NEMO_BC: path to an example NEMO boundary condition file for
loading boundary info.
"""
# Create metadeta for temperature and salinity
var_meta =... | |
import numpy as np
from scipy.io.idl import readsav
from scipy.interpolate import interp1d
import h5py
from astropy.io import fits
import shutil
import glob
import os
def dimensions(instrument):
if instrument == 'HARPS':
M = 4096 # pixels per order
R = 72 # orders
elif instrument == 'HARPS-N':
M = 4096 # pixels p... | |
<gh_stars>10-100
# KVM-based Discoverable Cloudlet (KD-Cloudlet)
# Copyright (c) 2015 Carnegie Mellon University.
# All Rights Reserved.
#
# THIS SOFTWARE IS PROVIDED "AS IS," WITH NO WARRANTIES WHATSOEVER. CARNEGIE MELLON UNIVERSITY EXPRESSLY DISCLAIMS TO THE FULLEST EXTENT PERMITTEDBY LAW ALL EXPRESS, IMPLIED, AND ... | |
lib.einsum('ijab,iabj', t2_new, eris_ovvo,optimize=True)
del t2_new
return e_mp
def contract_ladder(myadc,t_amp,vvvv):
log = logger.Logger(myadc.stdout, myadc.verbose)
nocc = myadc._nocc
nvir = myadc._nvir
t_amp = np.ascontiguousarray(t_amp.reshape(nocc*nocc,nvir*nvir).T)
t = np.zeros((nvir,nvir, nocc*nocc)... | |
from __future__ import print_function
import argparse
import torch
import torch.utils.data
from torch import nn, optim
from torch.autograd import Variable
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
from torch.utils import model_zoo
from to... | |
X, y=None, params={}, n_splits=0):
# checkpoint_predictions = []
# weights = []
if mode == "train":
self.run_model_train(model, X, y, params, n_splits > 1, n_splits)
elif mode == "predict":
pred = model.predict(X, verbose=2, batch_size=BATCH_SIZE)
return pred
# if predict_ones_with_identity:
# return model.... | |
the image with.")
# Powershell Specific Args
c.argument('valid_exit_codes', options_list=['--exit-codes', '-e'], arg_type=ib_powershell_type, nargs='+', help="Space-separated list of valid exit codes, as integers")
# Windows Restart Specific Args
c.argument('restart_command', arg_type=ib_win_restart_type, help="C... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 22 15:58:31 2019
@author: DaniJ
"""
import numpy as np
import scipy as sp
from bvp import solve_bvp
from scipy import linalg
#from four_layer_model_2try_withFixSpeciesOption_Scaling import four_layer_model_2try_withFixSpeciesOption_Scaling as flm
from matplotlib import p... | |
<reponame>samaloney/STIXCore
import os
import sys
import sqlite3
from types import SimpleNamespace
import numpy as np
from scipy import interpolate
from stixcore.util.logging import get_logger
__all__ = ['IDB', 'IDBPacketTypeInfo', 'IDBParameter', 'IDBStaticParameter',
'IDBVariableParameter', 'IDBPacketTree', 'IDBP... | |
in any attribute values
for _, attr in self._auto_attribs:
attr.set_value(etree, self)
def toxml(self, etree=None, **options):
"""
If `etree` is specified, then this theory object will be
serialized into that element tree Element; otherwise, a new
Element will be created.
"""
#print 'serializing %s' % self.__... | |
# Setup
registration_data = {
"stage": "prebirth",
"mother_id": "mother00-9d89-4aa6-99ff-13c225365b5d",
"data": REG_DATA["missing_field"].copy(),
"source": self.make_source_adminuser()
}
registration = Registration.objects.create(**registration_data)
# Execute
result = validate_registration.apply_async(args=[r... | |
port_profile = ET.SubElement(config, "port-profile", xmlns="urn:brocade.com:mgmt:brocade-port-profile")
name_key = ET.SubElement(port_profile, "name")
name_key.text = kwargs.pop('name')
qos_profile = ET.SubElement(port_profile, "qos-profile")
qos = ET.SubElement(qos_profile, "qos")
cos = ET.SubElement(qos, "cos")
... | |
<gh_stars>1000+
"""
Documents:
* libwx source code: see fib.c source code
* "Microsoft Word 97 Binary File Format"
http://bio.gsi.de/DOCS/AIX/wword8.html
Microsoft Word 97 (aka Version 8) for Windows and Macintosh. From the Office
book, found in the Microsoft Office Development section in the MSDN Online
Library.... | |
# -*- coding: utf-8; py-indent-offset: 2 -*-
"""
This module provides tools for examining a set of vectors and find the geometry
that best fits from a set of built in shapes.
"""
from __future__ import absolute_import, division, print_function
from scitbx.matrix import col
from collections import OrderedDict
try:
fro... | |
<reponame>caldarolamartin/hyperion
"""
==========================
ANC350 Attocube Instrument
==========================
This is the instrument level of the position ANC350 from Attocube (in the Montana)
"""
from hyperion import logging
import yaml #for the configuration file
import os #for playing with files in opera... | |
<filename>Text.py
from Base import Buttons
from Slider import Slider
import os
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = ""
import pygame
class Text(Buttons):
"""
A simple (multi-line) text object, with scrolling support.
pos: (left, top) - The topleft position before scaling.
size: (width, height) - The size ... | |
import asyncio
import contextlib
import time
from unittest import TestCase
from aioquic import tls
from aioquic.buffer import Buffer
from aioquic.quic import events
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.connection import (
IFType,
IPVersion,
QuicConnection,
QuicConnectionError,... | |
rule = req.url_rule
# if we provide automatic options for this URL and the
# request came with the OPTIONS method, reply automatically
if ( # pragma: no cover
getattr(rule, "provide_automatic_options", False)
and req.method == "OPTIONS"
):
return self.make_default_options_response() # pragma: no cover
# otherwi... | |
of Simics internal events.""", filename="/mp/simics-3.0/src/core/common/commands.py", linenumber="977")
#
# -------------------- break, tbreak --------------------
#
def do_break(object, t, address, length, r, w, x, temp):
if length < 1:
print "The breakpoint length must be >= 1 bytes."
return
access = 0
mode =... | |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_... | |
<reponame>gruunday/useradm
# --------------------------------------------------------------------------- #
# MODULE DESCRIPTION #
# --------------------------------------------------------------------------- #
"""RedBrick User Database Module; contains RBUserDB class."""
import crypt
import fcntl
import math
import os
... | |
self.boton[3].setStyleSheet("background-color: rgb(239, 172, 122);")
def txMargen(self):
self.boton[4].setStyleSheet("background-color: rgb(239, 172, 122);")
def Graficar(self):
self.figura.chart().removeAllSeries()
if self.motor.redOk:
GSuperficie(self)
GPatrones(self)
if self.motor.redOk:
GRed(s... | |
str
"""
if self.use_phase_model:
return r"Time [MJD]"
else:
return r"Time since burst [days]"
@property
def ylabel(self) -> str:
"""
:return: ylabel used in plotting functions
:rtype: str
"""
try:
return self.ylabel_dict[self.data_mode]
except KeyError:
raise ValueError("No data mode specified")
def s... | |
<filename>src/build/android/gyp/extract_unwind_tables.py
#!/usr/bin/env python
# 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.
"""Extracts the unwind tables in from breakpad symbol files
Runs dump_syms on... | |
availability also modified work.last_update_time.
assert (datetime.datetime.utcnow() - work.last_update_time) < datetime.timedelta(seconds=2)
# make a staff (admin interface) edition. its fields should supercede all others below it
# except when it has no contributors, and they do.
pool2.suppressed = False
staff... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import logging
import urllib
from ast import literal_eval as make_tuple
from calendar import month_name
from celery import shared_task
import requests
from django.c... | |
of graph in which to situate the agent to
'''
self.bookkeep(agent)
node.agent_content = agent
self.node_from_agent_id_[agent.agent_id_system] = node
def sample(self, phrase, generation=0):
'''Sample the agent management system according to a named sampler
Parameters
----------
phrase : str
Name of the samp... | |
2.0), (33, 80, 3.0, 5.5), (34, 80, 5.5, 6.5)])
testing_lib.add_chords_to_sequence(
expected_sequence, [('N.C.', 0), ('F', 1), ('C', 4)])
self.assertProtoEquals(expected_sequence, sequences[0])
class OneHotDrumsConverterTest(BaseOneHotDataTest, tf.test.TestCase):
def setUp(self):
sequence = music_pb2.NoteSequenc... | |
<gh_stars>1-10
# Developed by <NAME> and <NAME> on 1/21/19 6:29 PM.
# Last modified 1/21/19 6:29 PM
# Copyright (c) 2019. All rights reserved.
import itertools
import time
from enum import Enum
from math import floor
from typing import List
from PyQt5.QtCore import pyqtSignal, Qt, QEvent, QObject, QTimer, QSize, pyqt... | |
# Copyright (C) 2002, <NAME> (<EMAIL>)
# Copyright (C) 2017, <NAME> (<EMAIL>)
#
# 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.
"""... | |
for logging.
# This object is created in this module, (in init_logging()), it gets
# initialized separately within each thread, and then it is updated
# dynamically, if needed, as the thread progresses.
#
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
global theLoggingContext # A si... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
SHORT_VOWELS = ['a', 'E', 'I', 'i', 'O', 'Y', 'u', '9', 'ai', 'ei', 'Ou', '9Y']
LONG_VOWELS = ['a:', 'E:', 'I:', 'i:', 'O:', 'Y:', 'u:', '9:', 'ai:', 'ei:', 'Ou:', '9Y:']
# These mappings are mostly not generally valid, but only in certain contexts. They are ... | |
for each cluster. This type of plots is useful to fast assess library quality and batch effects.
Parameters
----------
data : ``AnnData`` or ``UnimodalData`` or ``MultimodalData`` object
Single cell expression data.
groupby : ``str``
A categorical variable in data.obs that is used to categorize the cells, e.g. ... | |
<filename>multi-threading.py
#!/usr/bin/env python
# coding: utf-8
# # Dense 3D Face Correspondence
# In[1]:
import os
os.environ["MKL_NUM_THREADS"] = "12"
os.environ["NUMEXPR_NUM_THREADS"] = "12"
os.environ["OMP_NUM_THREADS"] = "12"
# In[2]:
import pdb
import numpy as np
from collections import defaultdict
imp... | |
# coding: utf-8
"""Tests for lightgbm.dask module"""
import socket
from itertools import groupby
from os import getenv
from sys import platform
import lightgbm as lgb
import pytest
if not platform.startswith('linux'):
pytest.skip('lightgbm.dask is currently supported in Linux environments', allow_module_level=True)
... | |
<reponame>KurmasanaWT/community<filename>codes/correl.py
from dash import dcc, html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
import numpy as np
import pandas as pd
import plotly.io as pio
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import... | |
<reponame>jasonb5/cdms<gh_stars>1-10
#!/usr/bin/env python
"""
A variable-like object extending over multiple tiles and time slices
<NAME> and <NAME>, Tech-X Corp. (2011)
This code is provided with the hope that it will be useful.
No guarantee is provided whatsoever. Use at your own risk.
"""
import cdms2
from cdms2.... | |
score for target prioritisation of genes with associations with your disease of interest. Features that contribute to the overall score include detection of association and association odds-ratio from a variety of studies (**OpenTargets** and the **PheWAS catalog**), network degree in protein-protein interaction networ... | |
I', 'type': 'line', 'wavelengths': [[0.7699,0.7665],[1.169,1.177],[1.244,1.252]]}, \
'ki': {'label': r'K I', 'type': 'line', 'wavelengths': [[0.7699,0.7665],[1.169,1.177],[1.244,1.252]]}, \
'k1': {'label': r'K I', 'type': 'line', 'wavelengths': [[0.7699,0.7665],[1.169,1.177],[1.244,1.252]]}}
features = kwargs.get('... | |
<reponame>xingchenwan/nasbowl
import collections
import copy
import logging
import random
from copy import deepcopy
import ConfigSpace
import networkx as nx
import networkx.algorithms.isomorphism as iso
import numpy as np
from kernels import GraphKernels, WeisfilerLehman
from .gp import GraphGP
# === For NASBench-10... | |
import tia.trad.tools.ipc.naming_conventions as names
import tia.trad.tools.arithm.floatArithm as fl
import tia.trad.market.orders as orders; reload(orders)
from tia.trad.tools.dicDiff import DictDiff
import tia.trad.market.events as event; reload(event)
import logging
import tia.trad.tools.ipc.processLogger as pl
LOGG... | |
r'h_\mathrm{in,1}\right)+ kA \cdot \frac{T_\mathrm{out,1} - '
r'T_\mathrm{in,2} - T_\mathrm{in,1} + T_\mathrm{out,2}}'
r'{\ln{\frac{T_\mathrm{out,1} - T_\mathrm{in,2}}'
r'{T_\mathrm{in,1} - T_\mathrm{out,2}}}}'
)
return generate_latex_eq(self, latex, label)
def kA_deriv(self, increment_filter, k):
r"""
Partial... | |
# 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
# distributed under the Li... | |
#!/bin/bash python
"""
Main entry point for the ANDES CLI and scripting interfaces.
"""
# [ANDES] (C)2015-2022 <NAME>
#
# 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 3 of the ... | |
on simulated session. GitHub issue #1273")
def test_fetch_history_ram_cycle_information_samples_to_read_all(multi_instrument_session):
configure_for_history_ram_test(multi_instrument_session)
history_ram_cycle_info = multi_instrument_session.sites[1].fetch_history_ram_cycle_information(
position=0,
samples_to_read... | |
<gh_stars>0
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2014, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.