input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#
# Copyright (c) 2017 Ensoft Ltd, 2008-2010 <NAME>, <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, modi... | |
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 <NAME> <<EMAIL>>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the So... | |
OpenGL libraries. The parameters are taken from the current analysis parameters in the current scenario. The preview image used is the one chosen in the Camera menu.\n'
try:
extent = analysis[geoparams[0]]
extent_proj = analysis[geoparams[1]]
res = float(analysis[geoparams[2]])
dem = analysis[geopa... | |
<reponame>BoyanZhou/LongStrain<gh_stars>0
# construct microbiome haplotype
import numpy as np
import sys
class Haplotype:
"""
each haplotype represents a strain, default 3 Haplotypes in one sample
"""
def __init__(self, index, sample_size, reads_count_by_sample=np.array([])):
self.sample_size = sampl... | |
#!/usr/bin/env python3
import socket
import threading
import logging
logging.basicConfig(filename='meca.log', level=logging.DEBUG)
PROGRAM_FILE = 'program_output.txt'
# Dictionary of status indexes in robot status message
statusDict = {'activated': 0,
'homed': 1,
'simulating': 2,
'error': 3,
'paused': 4,
'EOB': ... | |
"""
x, b, y_idx = input_storage
if b.shape[0] != x.shape[1]:
raise ValueError('b must have same number of columns as x')
if y_idx.shape[0] != x.shape[0]:
raise ValueError('y_idx must have same number of rows as x')
sm = numpy.zeros_like(x) # softmax
nll = numpy.zeros(x.shape[0], dtype=node.outputs[0].type.
dty... | |
<reponame>anooptp/maml
"""
Selectors
"""
import inspect
from collections import defaultdict
from itertools import combinations
from typing import List, Optional, Union, Dict, Callable
import numpy as np
from scipy.linalg import lstsq
from scipy.optimize import minimize, NonlinearConstraint
from sklearn.linear_model im... | |
# encoding: utf-8
import math
import time
import numpy as np
import random
import torch
from torch import nn
from torch.utils.data import DataLoader
from utils.loss import euclidean_dist, hard_example_mining
from utils.meters import AverageMeter
# from tensorboardX import SummaryWriter
import torchvision.utils as vutil... | |
""" IBM based speech recognition service """
import time
import json
import collections
import os
import os.path
import asyncio
import base64
import websockets
import pyaudio
import webrtcvad
from dotenv import load_dotenv
from MqttService import MqttService
from io_buffer import BytesLoop
# ibm
CHUNK = 1024
FORMAT = ... | |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | |
# -*- coding: UTF8 -*-
from database.utils.connector import BasicDatabaseConnector
class VMServerDBConnector(BasicDatabaseConnector):
'''
Esta clase permite gestionar las diferentes características de las imágenes
accesibles en el servidor de máquinas virtuales actual.
'''
def __init__(self, sqlUser, sqlPass, d... | |
<gh_stars>0
import json
import sys
import os
import datetime
import time
import argparse
from git import Repo, GitCommandError
import docker
import requests
import re
from subprocess import call
def retrieve_pr(repository_name, pr):
github_api_token = os.environ["GITHUB_API_TOKEN"]
r = requests.get("https://api.git... | |
<filename>sandbox/riskModelsResultsEval.py
# -*- coding: utf-8 -*-
"""
Created on Wed May 15 10:22:47 2019
@author: lawdfo
Purpose:
Read in the csv results file generated by (e.g.) riskModelsParamSweep.py
and report back some useful statistics.
"""
# Some fairly standard modules
import os, csv, lzma
import num... | |
# Copyright (c) Microsoft. All rights reserved.
from random import shuffle
import json
import csv
import pandas as pd
from nltk.tokenize import word_tokenize
def load_scitail(file):
"""Loading data of scitail
"""
rows = []
cnt = 0
with open(file, encoding="utf8") as f:
for line in f:
blocks = line.strip().split... | |
e:
print(e);
def get_concAndConcUnits_experimentIDAndSampleNameShortAndTimePointAndComponentGroupName_dataStage01ReplicatesMI(self, experiment_id_I, sample_name_short_I, time_point_I, component_group_name_I):
"""Query calculated concentrations"""
try:
data = self.session.query(data_stage01_quantification_replicate... | |
config_rest(dut, rest_url = url, http_method=cli_type, json_data=config_data):
st.error('Failed to {} PFC Watch-Dog counter poll'.format(mode))
return False
else:
st.error("Unsupported CLI TYPE {}".format(cli_type))
return False
if command:
response = st.config(dut, command, type=cli_type, skip_error_check=skip_... | |
<gh_stars>0
import random
import requests
from lxml import html
from googlesearch import search
from bs4 import BeautifulSoup
import wikipedia as wk
import regex
import pandas as pd
import json
import os
cdeeplearn = __import__("cdeeplearn")
thirukkural = __import__("thirukkural")
tamil_utils = __import__("tamil_utils"... | |
in each `TRIAL` when the Composition executes; it is assigned as the default value for the
`learning_enabled <LearningMechanism.learning_enabled>` attribute of the `LearningMechanisms
<LearningMechanism>` in the pathway, and their `LearningProjections <LearningProjection>`
(see `learning_enabled <LearningMechanism.l... | |
vlan_vn_count + 1):
info = {
'name': vpg1_vmi_names[vmi_id - 1],
'vmi_id': vmi_id,
'parent_obj': proj_obj,
'vn': vn_objs[vn_names[vmi_id - 1]],
'vpg': vpg_objs[vpg_names[0]].uuid,
'fabric': fabric_name,
'pis': [],
'vlan': vlan_ids[vmi_id - 1],
'is_untagged': False}
vmi_infos.append(info)
with ExpectedExcept... | |
"""
This file is part of pynadc
https://github.com/rmvanhees/pynadc
Calibrate Sciamachy Solar Mean Radiance measurements
Copyright (c) 2016-2021 SRON - Netherlands Institute for Space Research
All Rights Reserved
License: BSD-3-Clause
"""
#
# Code layout:
# SECTION VERSION
# - define various versions of the S/W
# ... | |
#!/usr/bin/env python3
# coding: utf-8
"""The game logic.
This should be independent of media used to interact with player."""
from typing import Tuple, List, Set, Dict
from const import PLAYER_SHIFT, LAST_ON_PATH, END_PROGRESS
from piece import Piece
from player import Player
from util import progress_to_positio... | |
= win_project.filter() # very important not win_project.Filtering
'''
obj_tree = cloud_win.make_kdtree()
eu_cluster = cloud_win.make_EuclideanClusterExtraction()
eu_cluster.set_ClusterTolerance(width_grid)
eu_cluster.set_MinClusterSize(1)
eu_cluster.set_MaxClusterSize(6000)
eu_cluster.set_SearchMethod(obj_tree)... | |
in content:
self.log.info("X509 cert is enforced in CE")
def check_roles_base_access(self):
""" from Watson, roles base access for admin should not in in CE """
if self.user_add is None:
self.fail("We need to pass user name (user_add) to run this test. ")
if self.user_role is None:
self.fail("We need to pass us... | |
cc * (2-cc) # to be removed in future
c1a = c1 * (1 - (1 - hsig**2) * cc * (2 - cc)) # adjust for variance loss
if 11 < 3: # diagnostic data
# self.out['hsigcount'] += 1 - hsig
if not hsig:
self.hsiglist.append(self.countiter)
if 11 < 3: # diagnostic message
if not hsig:
print(str(self.countiter) + ': hsig-sta... | |
<reponame>jaratma/astro-nex
# -*- coding: utf-8 -*-
import pango
from datetime import datetime
from .. utils import format_latitud, format_longitud
from .. drawing.roundedcharts import RadixChart,HouseChart,NodalChart
from .. drawing.aspects import SimpleAspectManager
from .. countries import cata_reg
from .. boss impo... | |
"""file_tools: All tools to load and save data
##################################
2018 01 31 Included Nion Swift files to be opened
major revision 2020 09 to include sidpy and pyNSID data formats
2022 change to ase format for structures: this changed the default unit of length to Angstrom!!!
#####################... | |
return self.get('Time mark')
@property
def by_user(self) -> str:
return self.get('by user')
# @property
# def (self) -> str:
# return self.dict[''].strip()
def __init__(self, source) -> None:
self.source = tools.read(source)
if isinstance(self.source, str):
self.source = self.source.splitlines()
parts ... | |
<gh_stars>0
# buildifier: disable=module-docstring
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//rust/private:common.bzl", "rust_common")
load(
"//rust/private:repository_utils.bzl",
"BUILD_for_toolchain",
"DEFAULT_STATIC_R... | |
TODO: move this to a game mode called "fixed" once we implement a way to randomize roles (and have that game mode be called "random")
DEFAULT_ROLE = "villager"
ROLE_INDEX = ( 4 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 15 , 16 , 18 , 20 , 21 , 23 , 24 )
ROLE_GUIDE = OrderedDict([ # This is order-sensitive - many parts of t... | |
# The MIT License (MIT)
# Copyright © 2021 Opentensor.ai
# 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, ... | |
<gh_stars>1-10
import os
import sys
import string
from config import *
from util import err
from util import out
from util import warn
from util import process_info
from util import get_result_info
from util import get_suffixes_from_info
from util import get_variant_bases
from util import overwrite_expected
from util ... | |
any(isinstance(cell, str) and cell.startswith('!') for cell in data[0]):
column_heading = data.pop(0)
for i_cell, cell in enumerate(column_heading):
if isinstance(cell, str):
cell = cell.strip()
column_heading[i_cell] = cell
column_headings.append(column_heading)
elif column_headings:
column_headings.insert(0, ... | |
<filename>nautobot_chatops/dispatchers/slack.py
"""Dispatcher implementation for sending content to Slack."""
import json
import logging
import os
import time
from django.conf import settings
from slack_sdk import WebClient
from slack_sdk.webhook.client import WebhookClient
from slack_sdk.errors import SlackApiError,... | |
'cond_scale_factor': 4,
'cond_encode_depth': 1,
'cond_encode' : {
1 : {'conv' : {'filter_size' : 3, 'stride' : 1, 'num_filters' : 64}
},
},
# Encoding the inputs
'main_encode_depth': 4,
'main_encode' : {
1 : {'conv' : {'filter_size' : 3, 'stride' : 1, 'num_filters' : 64}
},
2 : {'conv' : {'filter_size' : 3,... | |
<reponame>hugovk/dbnd
import logging
from datetime import timedelta
from time import sleep
from airflow_monitor.airflow_data_saving import (
save_airflow_monitor_data,
save_airflow_server_info,
)
from airflow_monitor.airflow_instance_details import create_instance_details_list
from airflow_monitor.airflow_monitor_u... | |
<gh_stars>100-1000
from .cspace import CSpace
from .. import robotsim
from ..model import collide
from .cspaceutils import EmbeddedCSpace
import math
import random
class RobotCSpace(CSpace):
"""A basic robot cspace that allows collision free motion.
Args:
robot (RobotModel): the robot that's moving.
collider (:cl... | |
front = back.front # NOQA
# import IPython
# IPython.embed()
ut.embed()
@blocking_slot()
def dev_cls(back):
"""Help -> Developer Mode"""
logger.info('[back] dev_cls')
logger.info('\n'.join([''] * 100))
if back.ibs is not None:
back.ibs.reset_table_cache()
back.refresh_state()
from wbia.plottool import draw... | |
<reponame>muteria/muteria
from __future__ import print_function
import os
import sys
import re
import shutil
import imp
import logging
import filecmp
from distutils.spawn import find_executable
import muteria.common.mix as common_mix
from muteria.drivers import DriversUtils
ERROR_HANDLER = common_mix.ErrorHandler
... | |
0, 0, 0, 0
])
sno_m = np.array(
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
])
snh_m = np.array(
[
36.8501, 34.24807, 32.16088, 30.77985, 29.79539, 29.23881, 28.52221, 27.95867, 28.12564, 27.55166,
27.4... | |
= data_dgraph_result['standard_count'][0]['count']
return (
rt_recent_result_list,
rd_recent_result_list,
tdw_recent_result_list,
standard_recent_result_list,
standard_count,
)
def parse_recent_type_result(data_dgraph_result, key_name_list):
recent_result_list = []
if key_name_list:
for key_name in key_name... | |
(TinyDB) objects
data_storage_type : str
The name of the storage (TinyDB) table name that's supposed to be used for caching ppr matrices
dataset : str
The name of the dataset for which this model will be applied. This is necessary to make sure the
correct ppr matrix is loaded from the disk for conscutive calls
ma... | |
request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: tuple(list[BusinessObjectPermission], status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread.
"""
local_var_params = l... | |
"Yang/Wu's OEP implementation, in PyQuante."
from math import sqrt
import settings
from PyQuante.NumWrap import zeros,matrixmultiply,transpose,dot,identity,\
array,solve
from PyQuante.Ints import getbasis, getints, getJ,get2JmK,getK
from PyQuante.LA2 import geigh,mkdens,trace2,simx
from PyQuante.hartree_fock import g... | |
= LocalStorageCipher(key, cipherLevel)
except:
return u"Not sure: could not validate your encryption!"
theFormat = key.getFormat()
theAlg = key.getAlgorithm()
except:
return u"Not sure: Error in decryption routine - oh well!!"
return u"%s / %s" % (theFormat, theAlg)
def check_dropbox_and_suppress_warnings()... | |
<filename>rbi2/inte13.py
from collections import OrderedDict, namedtuple
from string import whitespace
import pdb
import sys
ADD = 'ADD'
SUB = 'SUB'
MUL = 'MUL'
INT_DIV = 'INT_DIV'
REAL_DIV = 'REAL_DIV'
INT_TYPE = 'INT_TYPE'
REAL_TYPE = 'REAL_TYPE'
INT_CONST = 'INT_CONST'
REAL_CONST = 'REAL_CONST'
DOT = 'DOT'
COMMA =... | |
newEID
xsect.elemDict = elemDict
del xsect.nodeDict[-1]
del xsect.elemDict[-1]
def solidBox(self,xsect, elemX, elemY, L1, L2, MID, matlib, elemOrder):
"""Meshes a box beam cross-section.
This method meshes a similar cross-section as the boxBeam method. The
geometry of this cross-section can be seen below. The ... | |
<gh_stars>0
# encoding: utf-8
#
# Copyright 2017-2019 <NAME>.
#
# 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... | |
'C3', 2, ['r:<0,0,1,a>', 't:<0,0,b>'], 4, '<0,0,0>', 'C4', 3, ['r:<0,0,1,c>', 't:<0,0,d>'], 1, '<e,0,0>', 'O', 'F432', 3, '(2*e, 2*e, 2*e), (90, 90, 90)', 5, 6],
58: [58, 'C3', 2, ['r:<0,0,1,a>', 't:<0,0,b>'], 7, '<0,0,0>', 'C5', 4, ['r:<0,0,1,c>', 't:<0,0,d>'], 9, '<0,0,0>', 'I', 'I', 0, 'N/A', 4, 2],
59: [59, 'C3',... | |
##################################################
def decorator(F):
print('Called decorator, get function:', F)
F.data = 1000
return F
@decorator
def func(x, y):
return x + y
##################################################
def decorator(F):
print('Called decorator, get function:', F)
def wrapper(*args):
p... | |
import pandas as pd
import math
import parser
# Worksheets with indemnification funds and temporary remuneration
# For active members there are spreadsheets as of July 2019
# Adjust existing spreadsheet variations
def format_value(element):
if element == None:
return 0.0
if type(element) == str and "-" in element... | |
<reponame>jtschindler/sculptor
#!/usr/bin/env python
"""
This module introduces the SpecModel class and its functionality. The SpecModel
class is designed to fit models to an astronomical spectrum using LMFIT.
The SpecModel is always associated with a SpecFit object, which provides the
foundational functionality for... | |
# 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 ... | |
il.sub(1, il.reg(1, 'A'), il.const(1, 1)), 'NZ')],
None,
[('INCA', 1, M6805_AddressMode.INH), [], lambda self, il: il.set_reg(1, 'A', il.add(1, il.reg(1, 'A'), il.const(1, 1)), 'NZ')],
[('TSTA', 1, M6805_AddressMode.INH), [], lambda self, il: il.sub(1, il.reg(1, 'A'), il.const(1, 0), 'NZ')],
None,
[('CLRA', 1, M68... | |
# 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, Mapping, Optional, Sequence, Union, overload
from .. import... | |
self._backend_agent.save(directory=policy_directory, callbacks=callbacks)
return directory
def train(self, train_context: core.TrainContext,
callbacks: Union[List[core.AgentCallback], core.AgentCallback, None],
default_plots: Optional[bool]):
"""Trains a new model using the gym environment passed during instantia... | |
<gh_stars>10-100
##############################################
# The MIT License (MIT)
# Copyright (c) 2016 <NAME>
# see LICENSE for full details
##############################################
import attr
from math import sqrt
from ins_nav.utils import normalize3
# from math import radians as deg2rad
# from math impor... | |
"Charm",
"Ecstasy",
"Enthrall",
"Permanent Madness",
"False Memory",
"Avoid",
"Nightmare",
"Hallucination",
"Lesser Geas",
"Suggestion",
"Mass Suggestion",
"Glib Tongue",
"Enslave",
"Great Hallucination",
"Great Geas",
"Haste",
"Apportation",
"Glue",
"Grease",
"Deflect Missile",
"Hold Fast",
"Incre... | |
""" Implement the Vanilla Interval domain based on PyTorch.
Vanilla Interval: Simply propagates using interval arithmetic without any optimization.
"""
from __future__ import annotations
from pathlib import Path
from typing import Tuple, Union, Iterator, Callable, Iterable
import torch
from torch import Tensor, nn
... | |
__init__(
self,
common_headers: Dict[str, str] = None,
x_acs_dingtalk_access_token: str = None,
):
self.common_headers = common_headers
self.x_acs_dingtalk_access_token = x_acs_dingtalk_access_token
def validate(self):
pass
def to_map(self):
_map = super().to_map()
if _map is not None:
return _map
resul... | |
<gh_stars>10-100
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript functions w... | |
<gh_stars>0
# -*- coding: utf-8 -*-
import collections
from datetime import datetime, timedelta
import re
import nose
import numpy as np
import pandas as pd
from pandas.tslib import iNaT, NaT
from pandas import (Series, DataFrame, date_range, DatetimeIndex,
TimedeltaIndex, Timestamp, Float64Index)
from pandas import ... | |
# -*- coding: utf-8 -*-
"""
Created on Jul 29, 2012
@author: marko
"""
from PIL import Image, ImageTk
from Tkconstants import RIGHT, LEFT, BOTH, E, W, HORIZONTAL
from Tkinter import Frame, Label, Button, Toplevel, OptionMenu, Scale, Entry, \
Message, Spinbox, IntVar, StringVar, DoubleVar
from matplotlib.backends.back... | |
"""Internal module for accessing EuXFEL HDF5 files
This includes convenience features for getting the metadata & indexes from a
file, as well as machinery to close less recently accessed files, so we don't
run into the limit on the number of open files.
"""
from collections import defaultdict, OrderedDict
import h5py
... | |
from __future__ import print_function
import json
import zlib
import sys
import inspect
import os
import atexit
import queue
import logging
import pickle
import cloudpickle
from datetime import datetime
from modelchimp import settings
from .sklearn_tracker import sklearn_loader
from .tracker_thread import TrackerThr... | |
import asyncio
import json
import logging
import time
import warnings
from collections import defaultdict
from decimal import Decimal
from typing import Any, AsyncIterable, Dict, List, Optional
from dateutil.parser import parse as dateparse
from dydx3.errors import DydxApiError
from hummingbot.connector.derivative.dy... | |
from hms import app
from datetime import datetime, date
from flask import render_template, session, url_for, request, redirect, flash, session, g
from .Forms import Login_form, Patient_create, Patient_delete, delete_result, Patient_update, issue_medicine_form, add_diagnosis
from .Models import UserStore, Patient_test, ... | |
copy from https://zhuanlan.zhihu.com/p/31421408
# Define a resnet block
class ResnetBlock(nn.Module):
def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias):
super(ResnetBlock, self).__init__()
self.conv_block = self.build_conv_block(dim, padding_type, norm_layer, use_dropout, use_bias)
def buil... | |
1]
# sf = (y0 - y1) / (y_lhs[-1] - y_lhs[0])
# y_rhs = y_lhs * sf + y1 - y_lhs[0]
x0 = x1
y0 = y1
pass
@property
def soils(self):
return self._soils
def set_to_decimal_places(self):
"""Adjusts the node coordinates to a certain number of decimal places"""
self.y_nodes = np.round(self.y_nodes, self.dp)
sel... | |
<filename>zunis_lib/zunis/models/flows/coupling_cells/piecewise_coupling/piecewise_linear.py
"""Implementation of the piecewise linear coupling cell
This means that the *variable transform* is piecewise-linear.
"""
import torch
from ..transforms import InvertibleTransform
from ..general_coupling import InvertibleCoupl... | |
import os
from shutil import copyfile
import numpy as np
from datetime import datetime
import pytest
from mikeio import Dfsu, Mesh, Dfs0
from mikeio.eum import ItemInfo
from mikeio.dutil import Dataset
def test_read_all_items_returns_all_items_and_names():
filename = os.path.join("tests", "testdata", "HD2D.dfsu")
... | |
the number of
distinct labels is approximately the same in each fold.
.. versionadded:: 0.17
Parameters
----------
labels : array-like with shape (n_samples, )
Contains a label for each sample.
The folds are built so that the same label does not appear in two
different folds.
n_folds : int, default=3
Numbe... | |
checked_request.unique_id == rq.unique_id:
# This is a case when rq != self.tmp_rq.
# Request was already checked
status = (e_errors.OK, None)
else:
# This is a case when rq == self.tmp_rq
# Need to check this request
rq, status = self.check_read_request(rq.ticket['volume'], rq, requestor)
if rq and status[0] =... | |
# -*- coding: utf-8 -*-
import simplejson as json
import pendulum
import inflection
import inspect
import uuid
import datetime
from warnings import warn
from six import add_metaclass
from collections import OrderedDict
from ..utils import basestring, deprecated
from ..exceptions.orm import MassAssignmentError, Related... | |
and returns a list of outputs, binary or categorical
Inputs:
corpus: 'DictaSign' or 'NCSLGR'
types: a list of lists of types to regroup
DictaSign: subset of ['fls' (with different categories), 'PT', 'PT_PRO1', 'PT_PRO2', 'PT_PRO3', 'PT_LOC', 'PT_DET', 'PT_LBUOY', 'PT_BUOY', 'DS', 'DSA', 'DSG', 'DSL', 'DSM', 'DSS',... | |
input = """
c num blocks = 1
c num vars = 180
c minblockids[0] = 1
c maxblockids[0] = 180
p cnf 180 815
-50 -91 -166 0
-55 -32 101 0
30 -91 -161 0
42 75 -12 0
55 -107 -69 0
-18 -31 -140 0
152 -137 -113 0
-103 113 -93 0
-58 -15 -131 0
129 -74 73 0
111 -86 6 0
134 -104 -92 0
-32 116 75 0
53 108 -40 0
85 -87 -8 0
-86 103 ... | |
"""
Definition of all artifactory objects.
"""
import warnings
import json
import logging
import os
from os.path import isdir, join
from typing import List, Optional, Dict, Tuple, Union, Iterator
from pathlib import Path
import requests
from requests import Response
from pydantic import parse_obj_as
from pyartifactor... | |
or (phjSortProportions in ['ascending','ascend','asc']):
phjPropDF = phjPropDF.sort_values(by = phjSuffixDict['joinstr'].join([phjGroupsToPlotList[0],phjSuffixDict['proportion']]),
axis = 0,
ascending = True)
elif phjSortProportions in ['descending','descend','desc']:
phjPropDF = phjPropDF.sort_values(by = phjSu... | |
import json
import random
from typing import NamedTuple, Any
import numpy
from numpy.testing import assert_array_almost_equal, assert_almost_equal
import torch
import pytest
from flaky import flaky
from allennlp.common.checks import ConfigurationError
from allennlp.common.testing import AllenNlpTestCase
from allennlp... | |
set local=1. The
Daylight Savings flag is always -1, which means unknown, and may
or may not have ramifications.
"""
if local:
return (self._localYear,
self._localMonth,
self._localDay,
self._localHour,
self._localMinute,
self._second,
self._localWeekday,
self._localDayOfYear,
-1)
else:
return (self._utc... | |
<gh_stars>0
__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2013, The SAGA Project"
__license__ = "MIT"
import time
import saga
import radical.utils.testing as testing
import saga.utils.test_config as sutc
from copy import deepcopy
# ------------------------------------------------------------------------... | |
<gh_stars>0
#!/usr/bin/env python
#coding: utf8
# by wgwang <EMAIL>
#
import os
import sys
import psycopg2
import pymongo
import jinja2
from datetime import datetime
from setting import pg, mdb
try:
from setting import interval
except:
interval = 600
import traceback
import logging
import time
import zipfile
import ... | |
-----
if call.data == '1-1':
t = 'Супер! А что именно из категории (Фото и видео) ты готов сдать в аренду? ' \
'Укажи название, нескольких слов будет достаточно :)'
z = 'Фото и видео'
msg = bot.send_message(message.chat.id, t, parse_mode='html')
bot.register_next_step_handler(msg, init_name_obj, z)
if call.data... | |
NotFound()
@raise_null_argument
def get_functions_by_ids(self, function_ids):
# Implemented from azosid template for -
# osid.resource.ResourceLookupSession.get_resources_by_ids_template
if self._can('lookup'):
return self._provider_session.get_functions_by_ids(function_ids)
self._check_lookup_conditions() # ra... | |
'sym_pd':
list_of_matrices.append(random_symmetric_pd_matrix(matsize, dtype=dtype, device=device))
elif mat_chars[mat_type] == 'sing':
list_of_matrices.append(torch.ones(matsize, matsize, dtype=dtype, device=device))
elif mat_chars[mat_type] == 'non_sing':
list_of_matrices.append(random_square_matrix_of_rank(matsi... | |
<filename>mama/build_dependency.py
import os, subprocess, shutil, stat
from mama.parse_mamafile import parse_mamafile, update_mamafile_tag, update_cmakelists_tag
from mama.system import System, console, execute, execute_piped
from mama.util import is_dir_empty, has_tag_changed, write_text_to, read_lines_from, forward_s... | |
# 如果发生了成交
if buyCross or sellCross:
# 推送成交数据
self.tradeCount += 1 # 成交编号自增1
tradeID = str(self.tradeCount)
trade = VtTradeData()
trade.vtSymbol = so.vtSymbol
trade.tradeID = tradeID
trade.vtTradeID = tradeID
if buyCross:
self.strategy.pos += so.volume
trade.price = max(bestCrossPrice, so.price)
else:
s... | |
<reponame>widnyana/pyTenable<gh_stars>1-10
from tenable.errors import *
from ..checker import check, single
from .conftest import SCAN_ID_WITH_RESULTS
import uuid, time, pytest
@pytest.mark.vcr()
def test_scan_create_scan_document_template_typeerror(api):
with pytest.raises(TypeError):
api.scans._create_scan_documen... | |
lets the LRU be based on the
# popularity of an object, not its particular transaction. It also lets
# us use a LLBTree to store the data, which can be more memory efficient.
self._cache = None
# The {oid: tid} that we read from the cache.
# These are entries that we know are there, and if we see them
# change, ... | |
from __future__ import print_function
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import os.path as op
import warnings
from nose.tools import assert_true, assert_raises, assert_equal
from copy import deepcopy
import numpy as np
from numpy.testing import (assert_array_almost_eq... | |
import os
import pytest
from mock import MagicMock, Mock, call, patch
import AndroidRunner.Adb as Adb
from AndroidRunner.Device import Device
from AndroidRunner.Devices import Devices
from AndroidRunner.util import ConfigError
class TestDevice(object):
@pytest.fixture()
@patch('AndroidRunner.Adb.connect')
def d... | |
1.0})
r = model.reactions.ETOHtex.copy()
r.id = 'IPtex'
r.name = 'Isopentenol transport via diffusion (extracellular to periplasm)'
r.gene_reaction_rule = ''
model.add_reactions([r])
r.add_metabolites({'etoh_e': 1.0, 'etoh_p': -1.0, 'isoprenol_e': -1.0, 'isoprenol_p': 1.0})
# Add a boundary reaction
r = model.r... | |
'TokenEndpoint': 'string',
'UserInfoEndpoint': 'string',
'ClientId': 'string',
'ClientSecret': 'string',
'SessionCookieName': 'string',
'Scope': 'string',
'SessionTimeout': 123,
'AuthenticationRequestExtraParams': {
'string': 'string'
},
'OnUnauthenticatedRequest': 'deny'|'allow'|'authenticate',
'UseExisting... | |
<reponame>ajroach42/bbj
from src.exceptions import BBJException, BBJParameterError, BBJUserError
from src import db, schema, formatting
from functools import wraps
from uuid import uuid1
from sys import argv
import traceback
import cherrypy
import sqlite3
import json
dbname = "data.sqlite"
# any values here may be ov... | |
<filename>src/x7zipfile.py
# -*- coding: utf-8 -*-
# Copyright 2021 UuuNyaa <<EMAIL>>
# This file is part of x7zipfile.
#
# BSD 3-Clause License
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of ... | |
<filename>tools/simmc_dataset.py
import json
import pdb
import re
import string
import torch
from nltk.tokenize import WordPunctTokenizer
from torch.utils.data import Dataset
"""
The dialog intents have the shapes:
DA:<DIALOG_ACT>:<ACTIVITY>:<OBJECT> or DA:<DIALOG_ACT>:<ACTIVITY>:<OBJECT>.<attribute>
Examples:
DA:I... | |
import os
import time
from unittest.mock import MagicMock, Mock, call
import numpy as np
import pytest
import torch
import ignite.distributed as idist
from ignite.engine import Engine, Events, State
from ignite.engine.deterministic import keep_random_state
from ignite.metrics import Average
from tests.ignite.engine i... | |
a greater '
'value than current_release')
self.ValidateUniqueIds()
# Add the encoding check if it's not present (should ensure that it's always
# present in all .grd files generated by GRIT). If it's present, assert if
# it's not correct.
if 'enc_check' not in self.attrs or self.attrs['enc_check'] == '':
self.... | |
from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from pointnet.dataset import PoseDataset
from pointnet.model import PointNetCls, feature_transform_regularizer
from pointnet.fusion_model import PoseNet... | |
from robin_stocks.gemini.authentication import generate_signature
from robin_stocks.gemini.helper import (format_inputs, login_required,
request_get, request_post)
from robin_stocks.gemini.urls import URLS
@format_inputs
def get_pubticker(ticker, jsonify=None):
""" Gets the pubticker information for a crypto.
:pa... | |
<reponame>emtom2019/em_topicmodeling_project<filename>model_analysis.py
from time import time
from datetime import datetime
import os, sys
import numpy as np
import pandas as pd
import gensim, spacy, scispacy
import pickle
import glob
import random
import model_figure_pipeline as mfp
import data_nl_processing, data_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.