input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
from Danim.Contry import *
from Danim.Distribution import LogscaleNumberLine
hair_svg_dir = "Danim\\video1\\file\\T_hair.svg"
#坐标轴设置settings
population_per_circle_area = 1/1.4*1.2 # default: 1.4 billion people is a 1.2unit area circle
xmin = 0
xmax = 10
ymin = 0
ymax = 100
proportion_to_left = 0.9 #default x axis move... | |
fournisseur déja entré) Pour éviter les doublons
if FinancialProvider.objects.filter(iban_ou_ccp=data['iban_ou_ccp'], deleted=False).exists():
fournisseur = FinancialProvider.objects.filter(iban_ou_ccp=data['iban_ou_ccp'], deleted=False).first()
if 'pk' not in data or fournisseur.pk != data['pk']:
raise forms.Valid... | |
import math
import pytest
from generator import base_objects, materials
from ideal_learning_env import (
InteractableObjectConfig,
VectorFloatConfig,
find_bounds,
)
from ideal_learning_env.defs import ILEException
from ideal_learning_env.interactable_object_config import (
KeywordLocationConfig,
ObjectRepository... | |
Bar {
CREATE PROPERTY foo := (INSERT Foo).id;
};
""")
async def test_edgeql_ddl_bad_10(self):
with self.assertRaisesRegex(
edgedb.SchemaDefinitionError,
r"mutations are invalid in alias definition"):
async with self.con.transaction():
await self.con.execute(r"""
CREATE TYPE Foo;
CREATE TYPE Bar;
CREATE AL... | |
import logging
from dataclasses import dataclass, field
from enum import Enum
import click
from .click_common import command
from .miot_device import MiotDevice
_LOGGER = logging.getLogger(__name__)
class ChargeStatus(Enum):
Charging = 1
Not_charging = 2
Charging2 = 4
Go_charging = 5
class Error(Enum):
NoErr... | |
- 2*
m.b112*m.b164 + 10*m.b113*m.b114 + 12*m.b113*m.b115 + 2*m.b113*m.b117 + 10*m.b113*m.b118 + 10*
m.b113*m.b119 + 10*m.b113*m.b120 + 4*m.b113*m.b121 + 6*m.b113*m.b122 + 10*m.b113*m.b123 + 4*
m.b113*m.b125 + 20*m.b113*m.b126 + 20*m.b113*m.b127 + 2*m.b113*m.b128 + 10*m.b113*m.b129 + 20*
m.b113*m.b131 + 20*m.b113*m.... | |
'topic': 'Web Engineering'},
{'author': 'A',
'before': [923],
'message': 'Redecentralization of the Web',
'observation_id': 924,
'receiver': 'B',
'sender': 'A',
'topic': 'Web Engineering'},
{'author': 'C',
'before': [924],
'message': 'Redecentralization of the Web',
'observation_id': 925,
'receiver': 'B',
... | |
# 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 generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
glance_exceptions.NotFound:
pass
class FindOrUploadImage(BaseSymmetricSingletonTask):
def __init__(self, cfg, migration, obj, location):
self.var_name = location + '_image_id'
super(FindOrUploadImage, self).__init__(
cfg, migration, obj, location, provides=[self.var_name])
def migrate(self, *args, **kwargs):
... | |
# Leo colorizer control file for rebol mode.
# This file is in the public domain.
# Properties for rebol mode.
properties = {
"commentEnd": "}",
"commentStart": "comment {",
"indentCloseBrackets": "}])",
"indentOpenBrackets": "{[(",
"lineComment": ";",
"lineUpClosingBracket": "true",
"noWordSep": "_-... | |
Oracle
(pdb,dbcur,deftDB) = connectJEDI('R','jedi')
t_table_DEFT = "%s.%s"%(deftDB,deft_conf.daemon['t_production_task'])
t_table_JEDI = "%s.%s"%(deftDB,deft_conf.daemon['t_task'])
t_table_projects= "%s.%s"%(deftDB,deft_conf.daemon['t_projects'])
i = 0
jedi_task_params = ''
for p in user_task_list :
jedi_tid ... | |
luigi.Parameter(description="Path to overall_machine_util.raw.csv [output from UtilTask]")
directory = luigi.Parameter(description="Output directory", default=".")
x_type = param_x_type
y_title = luigi.Parameter(description="y-axis title", default=None)
suffix = luigi.Parameter(description="Add suffix to output fil... | |
import abc
import asyncio
import collections
import contextlib
import fcntl
import functools
import inspect
import io
import mmap
import operator
import os
import pathlib
import random
import signal
import socket
import stat
import struct
import subprocess
import tempfile
import termios
import time
import types
import ... | |
<filename>src/a1_process_model.py
import math as _math
import geometry as _g
import sys as _sys
if _sys.version_info.major != 2: reload = lambda x: 0
reload(_g)
# Author: <NAME>
# Date: 2016
# Apr 2018: modified for Python 3
class ModelState(object):
# This class is as fast for member access by name
# as tuples a... | |
#coding:utf-8
import sys
#sys.path.append("../")
sys.path.insert(0,'..')
import numpy as np
import argparse
import os
import cPickle as pickle
import cv2
from train_models.mtcnn_model import P_Net,R_Net
from train_models.MTCNN_config import config
from loader import TestLoader
from Detection.detector import Detector
fr... | |
# -*- coding: utf-8 -*-
# pylint: skip-file
"""
This module provides methods for interacting with Hashicorp Vault via the HVAC
library.
"""
from __future__ import absolute_import
from builtins import super
import logging
import hashlib
import json
from collections import OrderedDict
log = logging.getLogger(__name__)... | |
"""Creates various Sklearn models"""
import math
import pickle
import keras
from keras import backend as K
from keras.callbacks import EarlyStopping
from keras.callbacks import History
from keras.callbacks import ReduceLROnPlateau
from keras.engine.topology import Layer
from keras.layers import AveragePooling2D
from... | |
self.toons.append(avId)
toon = simbase.air.doId2do.get(avId)
if toon:
if hasattr(self, 'doId'):
toon.b_setBattleId(self.doId)
else:
toon.b_setBattleId(-1)
messageToonAdded = 'Battle adding toon %s' % avId
messenger.send(messageToonAdded, [avId])
if self.fsm != None and self.fsm.getCurrentState().getName() == '... | |
status = status and result
return status, output_dict
@mockready
def send_command(self, command, system_name, session_name=None,
start_prompt='.*', end_prompt='.*', int_timeout=60):
"""Sends a command to a system or a subsystem
:Arguments:
1. command(string) = the command to be sent to the system
2. system_na... | |
data directory
FilenamePrefix (str): the file name prefix
PlotDirectory (str): The directory into which the plots are saved
CustomExtent (list): If [-9999] then just use extent of raster. Otherwise a four lement list with extents of the area you want to plot
FigSizeFormat (str): The format of the figure you want. T... | |
import numpy as np
from scipy import interpolate, integrate
class Signal:
# Implements a signal that was sampled.
def __init__(self, time, samples):
if type(time) == list:
time = np.array(time)
if type(samples) == list:
samples = np.array(samples)
self.time = time
self.samples = samples
@property
d... | |
# Copyright 2019, The TensorFlow Federated Authors.
#
# 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 agr... | |
{1,S} {7,D}
5 Cdd u0 {2,D} {9,D}
6 Cdd u0 {3,D} {10,D}
7 Cdd u0 {4,D} {11,D}
8 Cb u0 {1,S}
9 O2d u0 {5,D}
10 O2d u0 {6,D}
11 O2d u0 {7,D}
""",
thermo = u'Cs-(Cds-Cds)(Cds-Cdd-O2d)(Cds-Cdd-O2d)(Cds-Cdd-O2d)',
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = 757,
label = "Cs-(Cds-Cdd-O2d)(Cds-Cdd-O2d)(C... | |
<reponame>nudles/a2c
import numpy as np
import random
import math
import argparse
import logging
import pathlib
import datetime
# create logger
logger = logging.getLogger('Rafiki')
class Timer:
"""
This is a man-hand driven timer. The user should manually tick the timer.
"""
def __init__(self, start_time=0):
... | |
0:
lEventNum = 4
else:
lEventNum = 5
else:
lEventNum = event.num
if lEventNum == 4:
self.set(self.value+self.oneTurn)
else:
self.set(self.value-self.oneTurn)
def get(self):
return self.type(self.value)
def printLabel(self):
if self.canvas is None:
return
self.canvas.itemconfigure(self.labelId2,
text... | |
# This file is a modification of sklearn.metrics.pairwise
# Modifications by <NAME>
"""
New BSD License
Copyright (c) 2007–2018 The scikit-learn developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are m... | |
<gh_stars>0
import requests
from urllib.parse import quote_plus
import time
import re
import logging
from ssl import SSLError
from requests_oauthlib import OAuth1
from birbapi.resource_urls import SEARCH_TWEETS, FAVORITES_CREATE, FAVORITES_DESTROY, \
STATUSES_RETWEET, STATUSES_DESTROY, FRIENDSHIPS_CREATE, FRIENDSHIPS_... | |
# Copyright 2014 Red Hat, 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 required by applicable law or a... | |
<filename>asmd/dataset_utils.py
from copy import deepcopy
import numpy as np
from sklearn.utils import check_random_state
from . import utils
def choice(dataset, p=[0.6, 0.2, 0.2], random_state=None):
"""
Returns N non-overlapping datasets randomply sampled from `dataset`, where
N is `len(p)`; each song belong t... | |
map.get('Fingerprint')
self.common = map.get('Common')
self.issuer = map.get('Issuer')
self.last_time = map.get('LastTime')
return self
class DescribeVodCertificateListResponseCertificateListModelCertList(TeaModel):
def __init__(self, cert=None):
self.cert = []
def validate(self):
self.validate_required(self... | |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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 t... | |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may ch... | |
"""Contains functions that are used in the dynamic location and creation
of tabs and datatypes. Can be used both internally and externally.
"""
import os
import json
import pkg_resources
import importlib
import logging
from PyQt5 import QtWidgets
from meggie.utilities.uid import generate_uid
from meggie.utilities.m... | |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
of addresses that have been reserved for the interconnect
attachment, Used only for interconnect attachment that has the
encryption option as IPSEC.
The addresses must be RFC 1918 IP address ranges. When creating HA
VPN gateway over the interconnect attachment, if the attachment is
configured to use an RFC 1918 IP... | |
description(self) -> str:
"""
Description of the entry direction rule.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter(name="networkAclEntryName")
def network_acl_entry_name(self) -> str:
"""
The name of the entry direction rule entry.
"""
return pulumi.get(self, "network_acl_entry_name"... | |
"""Class to automatically select available and new primers for sequencing runs.
"""
from copy import deepcopy
import re
from collections import defaultdict
import pandas
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
import numpy as np
from Bio import SeqIO
import flametree
from... | |
Column(Int, Check(lambda s: s >= 0)),
"col2": Column(String, Check(lambda x: x <= 0)),
"col3": Column(Object, Check(lambda x: x == 0)),
},
strict=True,
)
assert schema2 == expected_schema_2
# test that remove_columns doesn't modify schema2:
schema3 = schema2.remove_columns(["col2"])
assert schema2 == schema... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Plugin to create a Quantum Espresso ph.x input file.
"""
import os
import numpy
from aiida.common.utils import classproperty
from aiida.common.exceptions import UniquenessError, InputValidationError,ValidationError
from aiida.common.datastructures import CalcInfo, CodeInfo
from a... | |
-1 else None
if road is not None and (road.__isDuplex__() or road.__to__() == self.id_):
self.providerIndex.append(index)
if road is not None and (road.__isDuplex__() or road.__from__() == self.id_):
self.receiverIndex.append(index)
if road is not None:
self.validRoadIndex.append(index)
self.provider = [self.roa... | |
tags = filter_text.split(' ')
for tag in tags:
if tag not in text:
return False
return True
def hex_space(string):
if not app_config['hex_space_separation']:
return string
return ' '.join([string[i:i+2] for i in range(0, len(string), 2)])
def space_bindies(bindie):
if not app_config['hex_space... | |
import os
from datetime import datetime
from tqdm import tqdm
import pickle
import json
import numpy as np
import torch
def conceptgraph2id(
root='../data/conceptgraphEmbedding/TransE_l2_concetgraph_2/',
name1='entities', name2='relations', format=".tsv"):
'''
加载 conceptgraph中实体和关系及其对应的id
'''
print('starting:'... | |
import scipy.signal
import numpy as np
from .cltools import HAVE_PYOPENCL, OpenCL_Helper
if HAVE_PYOPENCL:
import pyopencl
mf = pyopencl.mem_flags
#~ from pyacq.dsp.overlapfiltfilt import SosFiltfilt_Scipy
from .tools import FifoBuffer, median_mad
def offline_signal_preprocessor(sigs, sample_rate, common_ref_rem... | |
import colorsys
import json
import socket
import logging
from enum import Enum
from .decorator import decorator
from .flow import Flow
MUSIC_PORT = 37657
_LOGGER = logging.getLogger(__name__)
@decorator
def _command(f, *args, **kw):
"""
A decorator that wraps a function and enables effects.
"""
self = args[0]
... | |
which region will reside
:type division_name: String
:param data: The update action. QueueUpdateRequest() can be used for this argument also.
:type data: Dict[str, Any]
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""
#
# Roles
... | |
OFF_pt[i * delta_u + j] = pt[i * delta_u + j] + (0.1 * normals[i * delta_u + j])
# #
# OFF_pt_2[i * delta_u + j] = OFF_pt[i * delta_u + j] + (0.1 * normals[i * delta_u + j])
pass
# count = np.sum(edge_bool)
return pt, normals
pass
def compute_surf_offset(off_layers, ctrl_pts, knot_u, knot_v, degree_u, degree_v... | |
<reponame>M-casado/ena-content-dataflow
#!/usr/bin/env python3.7
# Copyright [2020] EMBL-European Bioinformatics Institute
#
# 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.apac... | |
##
# @file This file is part of the ExaHyPE project.
# @author ExaHyPE Group (<EMAIL>)
#
# @section LICENSE
#
# Copyright (c) 2016 http://exahype.eu
# All rights reserved.
#
# The project has received funding from the European Union's Horizon
# 2020 research and innovation programme under grant agreement
# No 671698. ... | |
indexes[idx] += 1
if indexes[idx] < len(self.cgi_options[idx][1]):
break
indexes[idx] = 0
idx += 1
if idx==len(self.cgi_options):
done=True
self.progress(total_tests, total_tests)
def test_availability_start_time(self):
"""Control of MPD@availabilityStartTime using the start parameter"""
self.setup_media()
... | |
3614288.9880884974, 3448028.61050569,
2613897.3925167606, 10.676487893570695, 0.013473647569965668, 2.369752188687355e-06],
[1121.556326096255, 1225.477552275013, 1423.939707863312, 2833336.6064214385, 4056131.6666533365,
4235528.204404335, 11.244808146052, 0.018099038041, 2.432848e-06],
[1006.917429294439, 1253.47... | |
<gh_stars>1-10
#!/usr/bin/env python
import pandas as pd
import numpy as np
import os, sys, enum, re, json, logging, time
import functools as fct
from .utils import timeit
logger = logging.getLogger(__name__)
__all__ = [
'RecomposeReplayResultProcessor',
'MonolithicReplayResultProcessor'
]
class AlignExitCode... | |
[6], [4], [4]],
[[4], [4], [6], [6], [4], [4]],
[[6], [6], [9], [9], [6], [6]],
[[6], [6], [9], [9], [6], [6]],
[[4], [4], [6], [6], [4], [4]],
[[4], [4], [6], [6], [4], [4]]]])
def test_depthwise_conv2d_3x3_dilation2_stride2_error(self):
with self.assertRaises(ValueError):
_ = layers.DepthwiseConv2D(
kernel_... | |
not report_buffer:
return -1
print("\nReading Input Report (length {})...".format(size))
r = usb.control_transfer(handle,
usb.LIBUSB_ENDPOINT_IN |
usb.LIBUSB_REQUEST_TYPE_CLASS |
usb.LIBUSB_RECIPIENT_INTERFACE,
HID_GET_REPORT,
(HID_REPORT_TYPE_INPUT << 8) | 0x00, 0,
report_buffer, ct.c_uint16(size),
5000)
i... | |
<filename>tests/python/relay/test_vm.py<gh_stars>0
# 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 Lice... | |
'INSERTIONS_IN_GENES', 'INSERTIONS_IN_MATURE_MIRNA',
'INSERTIONS_IN_SPLICE_SITE_REGIONS',
'INSERTIONS_IN_UTR_REGIONS',
'INSERTIONS_PERCENT_FOUND_IN_DBSNP',
'INSERTION_HET_HOM_RATIO', 'MEAN_COVERAGE',
'MISMATCH_RATE_READ_1', 'MISMATCH_RATE_READ_2',
'NON_SYNONYMOUS_DELETIONS', 'NON_SYNONYMOUS_INSERTIONS',
'NON_SYN... | |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of thi... | |
import os
import sys
import re
import json
import math
from difflib import SequenceMatcher
import plotly.graph_objects as go
import requests
import networkx as nx
import pandas as pd
import numpy as np
import scipy
import matplotlib
import matplotlib.pyplot as plt
from ipywidgets import interactive, HBox, VBox
import... | |
<gh_stars>0
#!/usr/bin/env python
import csv
import json
import operator
import os
import re
from argparse import ArgumentParser
from collections import defaultdict
import atexit
import pandas as pd
import psycopg2
import psycopg2.extras
import requests
from ebi_eva_common_pyutils.config_utils import get_pg_metadata_... | |
import numpy as np
import torch
from torch.autograd import Variable
from tqdm import tqdm
import utils
from Classifiers.Fashion_Classifier import Fashion_Classifier
from Classifiers.Mnist_Classifier import Mnist_Classifier
from Classifiers.Cifar_Classifier import Cifar_Classifier
from Data.load_dataset import load_dat... | |
<gh_stars>100-1000
import sys
from copy import deepcopy
import pytest
import numpy as np
from numpy.random import random, randint
from numpy import isclose
from flare.kernels.utils import from_mask_to_args, str_to_kernel_set
from flare.kernels.cutoffs import quadratic_cutoff_bound
from flare.parameters import Paramet... | |
R = np.asarray(R, dtype=np.float)
if R.ndim != 2 or R.shape[0] != 3 or R.shape[1] != 3:
raise ValueError("Expected rotation matrix with shape (3, 3), got "
"array-like object with shape %s" % (R.shape,))
RRT = np.dot(R, R.T)
if not np.allclose(RRT, np.eye(3), atol=tolerance):
error_msg = ("Expected rotation matri... | |
"""
Copyright (c) 2015, 2016, 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import copy
import glob
import json
import os
import fnmatch
from pkg_resources import parse_version
import shutil
import six
impo... | |
m.b829**2 + m.b142**2 + m.b683**2 + m.b684**2 + m.b696**2 + m.b707**2 + m.b712**2 + m.b719**2 +
m.b721**2 + m.b735**2 + m.b747**2 + m.b752**2 + m.b782**2 + m.b807**2 + m.b818**2 + m.b143**2 +
m.b690**2 + m.b695**2 + m.b731**2 + m.b834**2 + m.b144**2 + m.b686**2 + m.b687**2 + m.b737**2 +
m.b739**2 + m.b814**2 + ... | |
data_type : str or int
The data_type of the prep template
investigation_type : str, optional
The investigation type, if relevant
Returns
-------
A new instance of `cls` to access to the PrepTemplate stored in the DB
Raises
------
QiitaDBColumnError
If the investigation_type is not valid
If a required colum... | |
in
the System QoS Policy. An example entry is:
[{"Name": "Best Effort",
"AdminState": "Enabled",
"Cos": 255,
"Weight": 5,
"PacketDrop": True,
"Mtu": 1500
},
{"Name": "FC",
"AdminState": "Enabled",
"Cos": 3,
"Weight": 5,
"PacketDrop": False,
"Mtu": 2240
},
{"Name": "Platinum",
"AdminSta... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from mpl_toolkits import mplot3d
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.ticker as mtick
import BS
import bootstrapping
###########################################################... | |
for i in reversed(sorted(to_remove)):
data.pop(i)
return index
def _get_complex_date_index(self, data, col_names=None, parse_dates=True):
def _get_name(icol):
if isinstance(icol, basestring):
return icol
if col_names is None:
raise ValueError(('Must supply column order to use %s as '
'index') % str(icol))
... | |
node, 'tpRegJor')
self.tpRegJor = ival_
elif nodeName_ == 'natAtividade':
sval_ = child_.text
try:
ival_ = int(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires integer: %s' % exp)
ival_ = self.gds_validate_integer(ival_, node, 'natAtividade')
self.natAtividade = ival_
elif nod... | |
import logging
import os
import io
from typing import List, Tuple
import unittest
import traceback
from time import sleep
import toml
from scalablerunner.util import info, warning, error, type_check, UtilLogger
from scalablerunner.ssh import SSH
from scalablerunner.dbrunner import DBRunner
from scalablerunner.taskrun... | |
to the server
persist until the process is completed. The entity returned with
this response SHOULD include an indication of the request's
current status and either a pointer to a status monitor or some
estimate of when the user can expect the request to be fulfilled.
"""
# end class Accepted
class Non_Authorita... | |
<reponame>lemassykoi/XTBApi
#!/usr/bin/env python3
# adaptation du script FXCM pour XTB
##
debug = 1 ## DEBUG ENABLED OR DISABLED
from XTBApi.api import *
import time
import pandas as pd
import datetime as dt
import talib.abstract as ta
## Maths modules
import pyti.bollinger_bands as bb
from pyti.relative_strength_ind... | |
visibility):
""" Creates a tuple of (key, value) from the attribute text.
If visibility is '0' the attribute key is prefixed with '_'
to make it a hidden attribute.
Returns a tuple of key and value.
"""
key, value = text.split('=', 1)
## prefix attributes that are marked as invisible
if visibility == 0:
key = ... | |
information can be extracted from other job object fields.
In the case of ATLAS, information is extracted from the metadata field and
added to other job object fields.
:param job: job object
:return:
"""
## comment from Alexey:
## it would be better to reallocate this logic (as well as parse
## metadata value... | |
"""Util functions for CIFAR10/100."""
from collections import OrderedDict
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
import torch
from flwr.common.parameter import weights_to_parameters
from flwr.common... | |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may ch... | |
<filename>skybright/skybright.py
#!/usr/bin/env python
"""A model for the sky brightness
"""
from functools import partial
from math import pi, cos, acos, sin, sqrt, log10
from datetime import datetime, tzinfo, timedelta
from time import strptime
from calendar import timegm
from copy import deepcopy
from sys import arg... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Global addon constants.
Everything that is to be globally accessible must be defined in this module
and initialized in GlobalVariables.init_globals.
When reusing Kodi languageInvokers, only the code in the main module
(addon.py or service.py) will be run every time the addon is... | |
<filename>src/main/python/extract_results.py
#!/usr/bin/env python
# Extract results from a number of runs. Converted from shell script
# 'tg-extract-results'. The intent was to speed things up but unfortunately
# it doesn't always work. It seems the majority of the time is spent reading
# the file from disk, and that... | |
<reponame>Duseong/my_packages
'''
VisIt_code_generator.py
this code is designed for generating VisIt codes for command line interface option
(1) 2D map plotting (class Map_2D)
(2) Quick plotting using class Map_2D
MODIFICATION HISTORY:
dsj, 30, DEC, 2020: VERSION 1.00
- 2D map plotting code generation
dsj, 04, JAN,... | |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import functools
import math
import numpy as np
from collections import OrderedDict
import veriloggen as vg
import nngen.basic_types as bt
import nngen.util as util
class slice_(bt._Operator):
"""
Create ... | |
<filename>ReactivityProfile.py
###############################################################################
#
# Basic info for reading in profile files from shapemapper and
# performing various operations on them
#
# <NAME>
# Copyright 2018
#
# This file is licensed under the terms of the MIT license
#
# Change-... | |
import pandas as pd
import codecs as cd
import numpy as np
#### NEW ROUTINES JAN2020 ####
def header_keywords(X):
keywords = {}
defaults = {}
keywords['units'] = ('Units of measure ','Units of measure:')
defaults['units'] = 'SI'
keywords['mass'] = ('Mass:','Mass ','Mass =')
defaults['mass'] = 'N/A'
keywo... | |
"""
<NAME>
<EMAIL>
@shackoverflow
surrender_index_bot.py
A Twitter bot that tracks every live game in the NFL,
and tweets out the "Surrender Index" of every punt
as it happens.
Inspired by SB Nation's <NAME> @jon_bois.
"""
import argparse
from base64 import urlsafe_b64encode
import chromedriver_autoinstaller
from da... | |
<filename>sdk/python/pulumi_ucloud/ipsecvpn/vpn_gateway.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, ... | |
# 调用该信号/指标画布(plotDataItem.setData()),更新数据,更新画笔颜色,更新名称
if indicator in self.sub_indicator_plots:
self.sub_indicator_plots[indicator].setData(self.sub_indicator_data[indicator],
pen=self.sub_indicator_colors[indicator][0],
name=indicator)
# ----------------------------------------------------------------------
def... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2020 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 applic... | |
<filename>conans/client/conan_api.py
import hashlib
import os
import sys
import requests
import conans
from conans import __version__ as client_version, tools
from conans.client.client_cache import ClientCache
from conans.client.conf import MIN_SERVER_COMPATIBLE_VERSION, ConanClientConfigParser
from conans.client.con... | |
: ( 25599, 25600 ),
"AL37a3" : ( 25600, 25601 ),
"AL37a4" : ( 25601, 25602 ),
"AL37a5" : ( 25602, 25603 ),
"AL37a6" : ( 25603, 25604 ),
"AL37a7" : ( 25604, 25605 ),
"AL37a8" : ( 25605, 25606 ),
"AL37a9" : ( 25606, 25607 ),
"AL37a10" : ( 25607, 25608 ),
"AL37b" : ( 25608, 25611 ),
"AL37c" : ( 25611, 25612 ),
... | |
<gh_stars>100-1000
#!/usr/bin/python
import sys, getopt, locale
from scipy.stats.stats import pearsonr
import numpy
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates
import os.path
from sys import getsizeof
from scipy.spatial import distance
import platform
def replace... | |
# !/usr/bin/env python3
"""
author: Apeiria
contact: <EMAIL>
file: GeneticAlgorithm.py
function: Genetic algorithm correlation
"""
# ---------------------------------- import --------------------------------- #
import os
import sys
import time
import random
import copy
import numpy as np
import ray
from Method.Ge... | |
# -*- coding: utf-8 -*-
from subprocess import Popen
import os
from datetime import date
import shlex
import shutil
import re
import codecs
import traceback
import sys
import urlparse
import ftplib
import json
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import web... | |
`tf.data` dataset.
- A generator or `keras.utils.Sequence` instance.
y: Target data. Like the input data `x`,
it could be either Numpy array(s) or TensorFlow tensor(s).
It should be consistent with `x` (you cannot have Numpy inputs and
tensor targets, or inversely).
If `x` is a dataset, generator or
`keras.utils... | |
Pressure in bar
eq_fug : numpy array
Equilibrium fugacity of each non-water component that will
be in equilibrium within some other phase
"""
error = 1e6
TOL = 1e-8
if hasattr(self, 'C_small'):
C_small = self.C_small
C_large = self.C_large
else:
C_small = np.zeros(self.num_comps)
C_large = np.zeros(self.nu... | |
# Copyright (c) 2021 <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, modify, merge, publish, distribute, ... | |
name
paste $folder*concoct.stats|tail -n +2 | sed "s/^/$var.bin./g" >> concoct.checkm
paste $folder*metabat.stats|tail -n +2 | sed "s/^/$var./g" >> metabat.checkm
paste $folder*maxbin.stats|tail -n +2 >> maxbin.checkm
paste $folder*metawrap_*_bins.stats|tail -n +2|sed "s/^/$var./g" >> refined.checkm
done
echo "D... | |
import string
from scml.nlp import (
RepeatingCharacter,
RepeatingSubstring,
collapse_whitespace,
count_alpha,
count_digit,
count_punctuation,
count_space,
count_upper,
emoji_shortcode_to_text,
has_1a1d,
ngrams,
sentences,
split,
strip_ip_address,
strip_punctuation,
strip_url,
strip... | |
# coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, definitions of the expected input and output, potential response co... | |
= None
elif latest["time"] is None:
clrs.update(dict(_sym=cfg.dark, _sepl="", _sepr="",
_prc=(cfg.faint_shade if lnum % 2 else
cfg.faint_tint), _vol="", _chg=""))
change, pulse = 0, None
# Must divide by 100 because ``_pulse_over`` is a %
elif (abs(abs(latest["last"]) - abs(last_seen["last"])) >
abs(_pulse_over... | |
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import abc
import os
import pytest
import re
import socket
import tempfile
import time
import unittest
from datetime import da... | |
os
import fcntl
from os.path import join as pjoin
import shutil
import subprocess
from glob import glob
from string import Template
from pprint import pformat
import tempfile
import errno
import select
from StringIO import StringIO
import json
from ..hdist_logging import CRITICAL, ERROR, WARNING, INFO, DEBUG
from .co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.