input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import dash
import dash_cytoscape as cyto
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import numpy as np
import plotly.plotly as py
from plotly import graph_objs as go
from plotly.graph_objs import *
# external scripts
e... | |
= meta_episode_len
self.num_trajs = num_trajs
self.num_trajs_eval = num_trajs_eval
self.sampler = InPlacePathSampler(
env=env,
policy=agent,
max_path_length=self.max_path_length,
)
self.expsampler = ExpInPlacePathSamplerSimple(
env=env,
policy=self.exploration_agent,
encoder=self.context_encoder,
max_path... | |
# Refine Steps #
##############################################
def __rafine_steps(self):
'''
This function increases the number of timesteps if the star formation
will eventually consume all the gas, which occurs when dt > (t_star/sfe).
'''
# Declaration of the new timestep array
if not self.print_off:
pri... | |
#cvector =
args += ",%s" % clevels
else:
args += ",%s" % list(cvector)
location = item.getp('clocation')
if location == 'surface':
# place the contours at the corresponding z level (contour3)
func = "contour3"
elif location == 'base':
# standard contour plot
if filled:
func = "contourf"
else:
func = "cont... | |
#!/usr/bin/env pnpython3
#
# Interface PH5 to PH5Viewer
#
# <NAME>, <NAME> August 2015
#
# Updated April 2018
import os
import numpy as np
from ph5.core import ph5api, timedoy
VER = 2018116
class PH5ReaderError(Exception):
''' Exception gets raised in PH5Reader '''
def __init__(self, message):
super(PH5ReaderErro... | |
<filename>cloakifyFactory.py
#!/usr/bin/python
#
# Filename: cloakifyFactory.py
#
# Version: 1.0.1
#
# Author: <NAME> (TryCatchHCF)
#
# Summary: Cloakify Factory is part of the Cloakify Exfiltration toolset that transforms
# any fileype into lists of words / phrases / Unicode to ease exfiltration of data across
# m... | |
== 1)
rel18_inds = self.spatial_neighbours(objects, que18_cond, ind_rubber_object)
que19_cond = (ind_cube_object.size(0) == 1)
rel19_inds = self.spatial_neighbours(objects, que19_cond, ind_cube_object)
que20_cond = (ind_small_sphere_object.size(0) == 1)
rel20_inds = self.spatial_neighbours(objects, que20_cond, ind... | |
14:15:00 | 43.7143 | 11.6095 | 1019.89 | 614.716605714286 | 0 |
# | 1615209600 | 2021-03-08 14:20:00 | 41.85 | 11.98 | 1019.88 | 551.6908515 | 0 |
# | 1615209900 | 2021-03-08 14:25:00 | 40.8571 | 11.981 | 1019.76 | 400.116792380952 | 0 |
# ...
# | 1617792000 | 2021-04-07 12:40:00 | NULL | NULL | 1014.02 | 295.11714... | |
all_is_allowed.append( is_allowed )
else:
#print >> sys.stderr, "primer 5p position combination not allowed" # DEBUG
all_is_allowed.append( False )
break
#is_allowed = all(all_is_allowed)
#assert (is_allowed or not any(all_is_allowed)), "The multiple fwd and rev primer genomic start positions should all yield t... | |
').replace('\r', ' ')
r23c14 = request.POST.get('r23c14').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r23c15 = request.POST.get('r23c15').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r23c16 = request.POST.get('r23c16').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r23c17 = reques... | |
<reponame>rigdenlab/SWAMP
import os
import gemmi
import conkit.io
import itertools
import pandas as pd
import swamp.utils as utils
from swamp.wrappers import Gesamt
from swamp.parsers import PdbtmXmlParser
from swamp.logger import SwampLogger
class SwampLibrary(object):
"""Class that implements certain methods to cr... | |
"""
module for describing data process.
All data structure is describing as nested combination of `dict` or `list` for `ndarray`.
Data process is a translation from data structure to another data structure or typical `ndarray`.
Data cache can be implemented based on the dynamic features of `list` and `dict`.
The full... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use t... | |
<filename>nsopy/methods/universal.py
from __future__ import division
import numpy as np
import copy
from nsopy.methods.base import SolutionMethod
from nsopy.observer_pattern import Observable
from nsopy.utils import invert_oracle_sense
UGM_DEFAULT_EPSILON = 1.0
UGM_DEFAULT_L_0 = 1.1
def _bregman_map(M, lambda_k, di... | |
from cached_property import cached_property
from sqlalchemy import text
import requests
import json
import urllib.parse
import datetime
from app import db
from app import USER_AGENT
from app import MAX_MAG_ID
from app import get_apiurl_from_openalex_url
from util import jsonify_fast_no_sort_raw
# truncate mid.concep... | |
'type': {'readonly': True},
'location': {'readonly': True},
'kind': {'readonly': True},
'application_principals': {'readonly': True},
'masking_level': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'... | |
<filename>docs/quiz/Contents/scrapebylanguage.py
# Program that scrapes Wikipedia for language information
# 0 arguments scrape the 700+ webpages
# 1 argument opens previous dictionaries and modifies them
# 2 arguments uses a debug list to quickly check if the code works
import requests
from bs4 import BeautifulSoup
i... | |
cmd == '!-t':
if item.transcoded_to and os.path.isfile(item.transcoded_to):
filter = True
elif cmd == '!r':
if TAG_RANK not in item.tags:
filter = True
elif cmd == '!-r':
if TAG_RANK in item.tags:
filter = True
elif cmd == '!d':
if item.has_duplicates:
filter = True
elif cmd == '!s':
if not item.source or ... | |
213, 29),
woosh.Token(woosh.NEWLINE, '\r\n', 213, 29, 214, 0),
woosh.Token(woosh.INDENT, ' ', 214, 0, 214, 8),
woosh.Token(woosh.NAME, 'return', 214, 8, 214, 14),
woosh.Token(woosh.NAME, 'default', 214, 15, 214, 22),
woosh.Token(woosh.NEWLINE, '\r\n', 214, 22, 215, 0),
woosh.Token(woosh.DEDENT, ' ', 215, 0, 215, 4),
wo... | |
"""Tests for op_handler_util."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mock
from morph_net.framework import op_handler_util
from morph_net.framework import op_regularizer_manager as orm
import tensorflow as tf
arg_scope = tf.contrib.framew... | |
"""keymaster Integration."""
from datetime import timedelta
import logging
from typing import Any, Dict
from openzwavemqtt.const import CommandClass
from openzwavemqtt.exceptions import NotFoundError, NotSupportedError
from openzwavemqtt.util.node import get_node_from_manager
import voluptuous as vol
from homeassista... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use... | |
#!/usr/bin/env python
"""
Attempt to create a "manor" akin to::
###############################################
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
#########... | |
import pandas as pd
import tushare as ts
from StockAnalysisSystem.core.config import TS_TOKEN
from StockAnalysisSystem.core.Utility.common import *
from StockAnalysisSystem.core.Utility.time_utility import *
from StockAnalysisSystem.core.Utility.CollectorUtility import *
# -------------------------------------------... | |
End scores = (19, 64)
>>> print(turns[1])
Start scores = (19, 64).
Player 1 rolls 10 dice and gets outcomes [3, 2, 3, 4, 3, 1, 2, 1, 3, 1].
End scores = (65, 19)
>>> print(turns[2])
Start scores = (65, 19).
Player 0 rolls 9 dice and gets outcomes [6, 6, 4, 4, 2, 3, 4, 2, 5].
End scores = (19, 101)
>>> print(tu... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import with_statement
import pkg_resources
from pkg_resources import resource_filename
import os
import sys
import re
from pathlib import Path, PurePosixPath
import argparse
import er... | |
cnxn, item_ids):
return {
item_id: self.LookupItemStarrers(cnxn, item_id) for item_id in item_ids}
def LookupStarredItemIDs(self, _cnxn, starrer_user_id):
return self.stars_by_starrer_id.get(starrer_user_id, [])
def IsItemStarredBy(self, cnxn, item_id, starrer_user_id):
return item_id in self.LookupStarredItemI... | |
<filename>dockercloudcli/commands.py
from __future__ import print_function
import errno
import getpass
import json
import logging
import sys
import urllib
import dockercloud
import websocket
import yaml
from dockercloudcli import utils
AUTH_ERROR_EXIT_CODE = 2
EXCEPTION_EXIT_CODE = 3
cli_log = logging.getLogger("... | |
self.delta_ipre_to_isym[infector] +
self.delta_isym_to_dead[infector] if self.bernoulli_is_fatal[infector] else self.delta_isym_to_resi[infector])
# sample exposure at later point
if t < tmax:
self.__push_contact_exposure_infector_to_j(
t=t, infector=infector, j=i, base_rate=base_rate_infector, tmax=tmax)
elif... | |
<filename>Table.py<gh_stars>0
import numpy as np
import pandas as pd
from hdfs import InsecureClient
import threading
class Table:
def __init__(self, schema, n_rows, name, storage="row", filename=None):
self.name = name
self.n_cols = len(schema)
self.storage = storage
self.schema = schema
self.col_names = [p[0... | |
If their is bad contact score = 1000.
if flag: # if any distance < cutoff : no scoring
#self.score = min(9999999.9, 9999.9/mini)
self.score = 1000.
estat = hbond = vdw = ds = 1000.
else:
self.score = min(self.scorer.get_score(),100.)
estat = min(round(self.estat.get_score() * self.ESTAT_WEIGHT_AUTODOCK,2),1000... | |
format((LINE - charlen(splitbox[n-1],mode = 1))*16 + halflen(splitbox[n-1],1),"02x")
if w != "00" and not "-" in w:
shift = r"+T\x{}".format(w)
elif w == "00" or "-" in w:
shift = ""
if "T+" in splitbox[n-1]:
splitbox[n-1] = shift + splitbox[n-1][3:] + "^^<<"
elif "T+" not in splitbox[n-1]:
splitbox[n-1] = shif... | |
rangehint(self):
return(self.xs-3,self.xs+3)
class TwoSlopeATanModel(FunctionModel1DAuto):
"""
This model transitions between two asymptotic slopes with an additional
parameter that allows for a variable transition region size. The functional
form is
.. math::
y = (x-x_0) \\frac{a+b}{2} +
\\frac{ s - (x-x_0... | |
<gh_stars>0
## Python packages
from datetime import datetime
import json
import re
from binascii import a2b_base64
import os
## Django Packages
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.shortcuts import redirect
from django.utils import timezone
from django.http... | |
None
""" The service plugin """
service_connection_handler = None
""" The service connection handler """
connection_socket = None
""" The connection socket """
connection_address = None
""" The connection address """
connection_port = None
""" The connection port """
connection_request_tim... | |
<gh_stars>0
from geoalchemy2 import functions as geo_func
from sqlalchemy import and_
from sqlalchemy import cast
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy.orm import Query
from tests import factories
from threedi_modelchecker.checks.base import _sqlalchemy_to_sqlite_types
from threedi_... | |
<filename>Tests.py
# test.py
""" This file houses the suite of tests for main.py classes and functions
THIS FILE IS A MESS AND TOTALLY BROKEN AT THIS POINT
IT WILL NOT RUN
IT IS HERE THAT IT MAY BE CANABALISED FOR FUTURE ITERATIONS OF THE PROJECT
"""
def test_variables():
""" variables needed for various tests ... | |
fields=(
self._gen_expr(name),
"strip")))]))
elif atype.startswith('store'):
elements.append(gen_store(
name=name.strip(),
value=self._gen_expr(locator_attr)))
return elements
def _gen_keys_mngr(self, atype, param, selectors):
elements = []
args = []
action = None
elements.append(self._gen_get_locator_cal... | |
60 * peak.FittedIntensity * GAUSSIAN_FWHM * peak.FittedWidth / GAUSSIAN_AREA
elif peak.FittedFunction == MODEL_GAMMA:
peak.Area = 60 * 100 * peak.FittedIntensity
# init profile
raster = make_raster(peak.LeftRT, peak.RightRT, peak.FWHM)
ai = [peak.GetFullIntensityAtRT(rt) for rt in raster]
peak.Profile = tuple(z... | |
# Copyright (c) 2008-2011, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the ... | |
<reponame>dgehringer/pyiron_atomistics<filename>pyiron_atomistics/dft/waves/electronic.py<gh_stars>0
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ imp... | |
False,
provider = None,
test = False,
_processed = None
):
''' Get installed components using "provider" to find (and possibly
install) components.
This function is called with different provider functions in order
to retrieve a list of all of the dependencies, or install all
dependencies.
Returns
=======
... | |
QVariant.Int):
#xval, test = attributes[zindex].toInt()
#yval, test = features[y].attributes()[zindex].toInt()
#attributes[zindex] = QVariant(xval + yval)
try:
xval = int(attributes[zindex])
yval = int(zvalue)
attributes[zindex] = xval + yval
except:
... | |
<reponame>mmngreco/PyIneq
"""Low level desciptive statistics.
References
----------
1. http://people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf
2. https://en.wikipedia.org/wiki/Weighted_arithmetic_mean
#Weighted_sample_variance
3. https://en.wikipedia.org/wiki/Algorithms%5Ffor%5Fcalculating%5Fvariance
#Weig... | |
<filename>chef/tests/test_parser.py
from __future__ import with_statement
import re
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import pytest
from chef.datastructures import Ingredient, IngredientProperties, Ingredients,\
unknown, undefined
from chef.errors.syntax import ... | |
NW', 'TR Chain Chomps SW'),
'TR Chain Chomps Down Stairs',
('TR Pokey 2 ES', 'TR Lava Island WS'),
'TR Crystaroller Down Stairs',
('TR Dash Bridge WS', 'TR Crystal Maze ES')
],
'Ganons Tower': [
('GT Torch EN', 'GT Hope Room WN'),
('GT Tile Room EN', 'GT Speed Torch WN'),
('GT Hookshot ES', 'GT Map Room WS'),
... | |
var.KILLER = "" # nickname of who chose the victim
var.STARTED_DAY_PLAYERS = len(get_players())
var.LAST_GOAT.clear()
msg = messages["villagers_lynch"].format(botconfig.CMD_CHAR, len(list_players()) // 2 + 1)
channels.Main.send(msg)
var.DAY_ID = time.time()
if var.DAY_TIME_WARN > 0:
if var.STARTED_DAY_PLAYERS <... | |
<filename>clevr-dataset-gen/question_generation/question_engine.py<gh_stars>0
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be ... | |
# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import json
import logging
from unittest.mock import Mock, patch
from argparse import Namespace
import pytest
fr... | |
positive
"""
N = ZZ(N)
if N <= 0:
raise ValueError("N must be positive")
c = []
for d in divisors(N):
n = num_cusps_of_width(N, d)
if n == 1:
c.append(CuspFamily(N, d))
elif n > 1:
for i in range(n):
c.append(CuspFamily(N, d, label=str(i + 1)))
return c
@richcmp_method
class CuspFamily(SageObject):
r""... | |
images
# need to make two passes/invocations of this method: one
# with push_late=False and one with push_late=True.
is_late_push = False
if self.config.push.late is not Missing:
is_late_push = self.config.push.late
if push_late != is_late_push:
return (self.metadata.distgit_key, True)
push_names = []
if p... | |
import csv
import dataclasses
import math
import pathlib
import threading
import time
from typing import Optional, Tuple, Dict, List, Callable, Union, Iterable, TypeVar, Sequence
import numpy as np
import stim
from .decoding import sample_decode_count_correct
from .probability_util import log_binomial, binary_search
... | |
Hash || _sjcl.hash.sha256;
var exKey = [[],[]], i,
bs = Hash.prototype.blockSize / 32;
this._baseHash = [new Hash(), new Hash()];
if (key.length > bs) {
key = Hash.hash(key);
}
for (i=0; i<bs; i++) {
exKey[0][i] = key[i]^0x36363636;
exKey[1][i] = key[i]^0x5C5C5C5C;
}
this._baseHash[0].update(exKey[0]);
... | |
angular velocity transformation matrix
:rtype: ndarray(6,6) or ndarray(3,3)
Computes the transformation from spatial velocity :math:`\nu`, where
rotation rate is expressed as angular velocity, to analytical rates
:math:`\dvec{x}` where the rotational part is expressed as rate of change in
some other representatio... | |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import hashlib
import logging
import os
import time
import boto3
import click
import yaml
from jinja2 import Environment, FileSystemLoader, Template
from pykwalify.core import Core
import collections
from c... | |
<reponame>konradotto/TS<gh_stars>0
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
"""
Created on May 21, 2013
@author: ionadmin
"""
import logging
from django.conf import settings
from django.template.defaultfilters import truncatechars
from django.utils.translation import ugettext_lazy
from iondb... | |
<gh_stars>0
"""Basic specification for a frontend.
See docs on Frontend class for further information.
"""
import doctest
import msgpack
import oxtie
class Frontend(object):
"""Class specifying the main interface for a frontend and some utils.
All other frontend implementations shall inherit from this.
The fo... | |
else:
if f7 <= 11:
return 7
else:
if f6 <= 23:
return 6
else:
return 3
else:
if f3 <= 19:
if f3 <= 18:
if f2 <= 15:
if f2 <= 14:
if f2 <= 10:
if f1 <= 19:
if f1 <= 18:
return 0
else:
if f2 <= 3:
if f7 <= 1:
return 1
else:
if f4 <= 17:
if f4 <= 14:
return 1
else:
return 0
else:
return 1
else... | |
= copy.copy(curr_client_info.output_to_client)
return
ok = True
first_pass = True
can_call__inline_processor__on__output_buffers_are_empty = True
while ok:
try:
if curr_client_info.current_memoryview_output:
nsent = writable_socket.send(curr_client_info.current_memoryview_output)
curr_client_info.current_memo... | |
<gh_stars>0
from __future__ import division
from googleapiclient.discovery import build
from oauth2client import client, file, tools
from oauth2client.service_account import ServiceAccountCredentials
from sys import stdout
from copy import deepcopy
import pandas as pd
import numpy as np
import httplib2, os
from ._qu... | |
BA This is where we "strip" the invisible stuff from the end
row_text_offset_end = 0
for token in reversed(all_tokens_list[lc:end + 1]):
if token.visible:
break
row_text_offset_end += 1
# if token.token == '<':
# break
end = end - row_text_offset_end
# TODO: BA And we add some stuff to the end of the last one ... | |
default code address to value"""
self._default_code_address = value
def set_default_data_address(self, value):
"""Set the default code address to value"""
self._default_data_address = value
def register_variable_definition(self, definition):
"""Register a new variable definition."""
self._variables.append(defi... | |
window coordinates where the user clicked.\n# - wherey : Y Position in window coordinates where the user clicked.\nnewPlace = self.createNewMT_post__Concat (self, wherex, wherey)\n'))
self.objMT_post__Concat.graphClass_= graph_ButtonConfig
if self.genGraphics:
from graph_ButtonConfig import *
new_obj = graph_Button... | |
<reponame>EulerWong/director
from director import lcmUtils
from director import objectmodel as om
from director import visualization as vis
from director.utime import getUtime
from director import transformUtils
from director.debugVis import DebugData
from director import ioUtils
from director import robotstate
from di... | |
# 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 ... | |
"""
Stars module, modified to work with crystal class
Classes to generate star sets, double star sets, and vector star sets; a lot of indexing functionality.
NOTE: The naming follows that of stars; the functionality is extremely similar, and this code
was modified as little as possible to translate that functionality... | |
<reponame>wclark3/machine-learning
#!/usr/bin/env python
'''Main Program for Training over the Facial Keypoints dataset.
'''
import argparse
import code
import datetime
import json
import os
import re
import subprocess
import sys
import time
import argcomplete
import lasagne
import numpy as np
import pandas as pd
imp... | |
<filename>pyDubMod.py
#pydub imports
import os
from requests import Request
import requests
import json
import uuid
import string
from pydub import AudioSegment
import io, subprocess, wave, aifc, base64
import math, audioop, collections, threading
import platform, stat, random, uuid
# define exceptions
class TimeoutE... | |
<gh_stars>10-100
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 .. impor... | |
< 1:
this_event_type = 1
if this_event_type > n_types:
this_event_type = n_types
event_types[model_name][this_e_range]['true'].append(this_event_type)
if return_partition:
return event_types, event_type_bins
else:
return event_types
def predicted_event_types(dtf_e_test, trained_models, n_types=2):
'''
Get ... | |
subsystem: [None, cygwin, msys, msys2, wsl]
WindowsStore:
version: ["8.1", "10.0"]
WindowsCE:
platform: ANY
version: ["5.0", "6.0", "7.0", "8.0"]
Linux:
Macos:
version: [None, "10.6", "10.7", "10.8", "10.9", "10.10", "10.11", "10.12", "10.13", "10.14", "10.15", "11.0", "13.0"]
sdk: [None, "macosx"]
subsystem:... | |
exit_on_failure: bool = True,
exit_code: int = 3,
quiet: bool = False) -> Union[None, bytes]:
"""
Pack 8 bit data
:param data: Input data
:param exit_on_failure: Exit in case of error (default: False)
:param exit_code: Set exit code integer (default: 3)
:param quiet: Quiet mode, if True no console output (defau... | |
to select the appropriate nested schema for serialization.
"""
if self.__class__.__name__ != raw_node.__class__.__name__:
raise TypeError(f"Cannot serialize {raw_node} with {self}")
return raw_node
class KerasHdf5WeightsEntry(WeightsEntryBase):
bioimageio_description = "Keras HDF5 weights format"
weights_forma... | |
'''
A generic target capture task
'''
import numpy as np
import time
import os
import math
import traceback
from collections import OrderedDict
from riglib.experiment import traits, Sequence, FSMTable, StateTransitions
from riglib.stereo_opengl import ik
from riglib import plants
from .target_graphics import *
####... | |
<filename>encode.py
#!/usr/bin/env python
# vim:set ts=8 sw=4 sts=4 et:
# Copyright (c) 2012 <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 l... | |
<gh_stars>0
import json
import sys
from ..Resource import Resource
from ..Crawler.Fs import FsPath
from ..Crawler import Crawler
from ..Template import Template
from collections import OrderedDict
# compatibility with python 2/3
try:
basestring
except NameError:
basestring = str
class TaskTypeNotFoundError(Exceptio... | |
mock_containers_run.return_value = None
self.assertIs(self.obj.launch_job(job_id, job_exec_id, nuvla), None,
'Unable to launch job execution container')
mock_containers_run.assert_called_once()
mock_net_connect.assert_called_once_with(job_exec_id, 'bridge')
def test_collect_container_metrics_cpu(self):
cpu_stat ... | |
the transition scores
args['output_dir'] - the directory to hold the activity scores
args['activity_weights']: a dictionary of transition names to
dictionary of activity weights, ex: {'transition_name_0': {
'activity0: 1 or 0,
...
},
...}
args['results_suffix'] - a suffix to append to each output filename
args... | |
= 13
# legendsize = 12
# fig1 = plt.figure(constrained_layout=False)
# gs1 = fig1.add_gridspec(nrows=2, ncols=1, bottom=0.55, top=0.95, left=0.12, right=0.35, height_ratios=[1, 1])
# gs2 = fig1.add_gridspec(nrows=1, ncols=1, bottom=0.55, top=0.95, left=0.5, right=0.98)
# gs3 = fig1.add_gridspec(nrows=1, ncols=2, ... | |
"<NAME> <<EMAIL>>" formats
'''
)
#####################
#
# END LEGACY SUPPORT
#
#####################
def _check_values(self):
'''
Make sure all values are of the appropriate
type and are not missing.
'''
if not self.__api_key:
raise PMMailMissingValueException('Cannot send an e-mail without a Postmark ... | |
# 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... | |
#
# Copyright 2012 WebFilings, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
<gh_stars>0
"""
CHAS builtin output modules.
We contain the built in output modules for CHAS.
These modules are to be used with the OutputHandler,
as it will handle the process of getting, mixing, and sending
the audio information to each module.
We offer some useful output modules:
(An asterisk denotes that a depen... | |
# -*- coding: utf-8 -*-
from random import random
from datetime import timedelta
from django.conf import settings
from django.utils import timezone
from django.views.generic import TemplateView
from uncharted.chart import *
class Area100PercentStacked(TemplateView):
template_name = 'area/chart.html'
chartData =... | |
<gh_stars>10-100
""" File Submission Service and Interfaces.
The Submission service encapsulates the core functionality of accepting,
triaging and forwarding a submission to the dispatcher.
SubmissionServer is typically exposed via HTTP interface implemented by al_ui,
however the core logic is implemented in Submissi... | |
sync.
:param user: requesting user
:param res_id: resource uuid
:param zip_with_rel_path: the zip file name with relative path under res_id collection to
be unzipped
:param bool_remove_original: a bool indicating whether original zip file will be deleted
after unzipping.
:param bool overwrite: a bool indicating ... | |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
<filename>adapter/i_o.py
import os
import numpy as np
import pandas as pd
from adapter.to_python import Excel, Db, Db_sqlalchemy, Debugger
from adapter.label_map import Labels
from adapter.comm.tools import convert_network_drive_path
from datetime import datetime
import re
import sqlite3
from shutil import copy
impo... | |
# Copyright (C) 2015 Catalyst IT Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
import mock
import mpi4py.MPI
import numpy as np
import pytest
import unittest
import chainer
import chainer.cuda
import chainer.initializers
import chainer.links
import chainer.testing
import chainer.testing.attr
import chainermn
from chainermn.communicators import _communication_utility
from chainermn.communicators.... | |
<reponame>conzty01/RA_Scheduler
from unittest.mock import MagicMock, patch
from scheduleServer import app
from flask import Response
import unittest
import datetime
from helperFunctions.helperFunctions import stdRet, getCurSchoolYear, AuthenticatedUser
class TestSchedule_editSched(unittest.TestCase):
def setUp(self... | |
Services"
self._cm.update_config({"TSQUERY_STREAMS_LIMIT": 1000})
hosts = management.get_hosts(include_cm_host=True)
# pick hostId that match the ipAddress of cm_server
# mgmt_host may be empty then use the 1st host from the -w
try:
mgmt_host = [x for x in hosts if x.ipAddress == socket.gethostbyname(cmx.cm_serve... | |
jsgParser.OBRACE) | (1 << jsgParser.STAR) | (1 << jsgParser.QMARK) | (1 << jsgParser.PLUS))) != 0):
self.state = 204
self.ebnfSuffix()
self.state = 207
self.match(jsgParser.CBRACKET)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self... | |
<gh_stars>0
import os
import traceback
from flask import Flask, request, url_for, render_template, redirect, Response, session, make_response
import StringIO
from data_reader import DataReader
import xlwt #excel writing. used for the excel output.
import sys
import mimetypes
from werkzeug.datastructures import Headers... | |
<reponame>cimatosa/tsquad
"""
Numeric Integration Using Tanh-Sinh Variable Transformation
This is the main module which implements the Tanh-Sinh method for numeric integration.
"""
# python import
import logging
import math
import cmath
import traceback
import typing
# tsquad module imports
from . import shanks
fr... | |
# Copyright (c) 2021 <NAME>.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""GEMPAK calculations."""
import numpy as np
# Gravitational constant
g = 9.80616 # m / s^2
# Dry air gas constant
Rd = 287.04 # J / K / kg
def interp_logp_height(sounding, missing=-9999... | |
to be able to set a list of public keys: call the ``UpdateDevEndpoint`` API with the public key content in the ``deletePublicKeys`` attribute, and the list of new keys in the ``addPublicKeys`` attribute.
- *(string) --*
- **SecurityConfiguration** *(string) --*
The name of the SecurityConfiguration structure to be... | |
#!/usr/bin/env python
# coding: utf-8
# # Tarea #1
# ## Estudiante: <NAME>
# In[2]:
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import confusion_matrix
fro... | |
conv=e_arch.CALL_CONV_CDECL)
def strcat(self, emu, argv, ctx={}):
"""
char *strcat(
char *strDestination,
const char *strSource
);
"""
_str1, _str2 = argv
s1 = self.read_mem_string(_str1, 1)
s2 = self.read_mem_string(_str2, 1)
argv[0] = s1
argv[1] = s2
new = (s1 + s2).encode("utf-8")
self.mem_write(_str1,... | |
= X[:, 1+shift+dim] # 4
global_dim_3 = X[:, 2+shift+dim] # 5
# Sort with respect to ground truth
# data = zip(ground_dim,pred_dim_1, ground_dim_2, ground_dim_3)
# data = sorted(data, key=lambda tup: tup[0])
# ground_dim_sort, pred_dim_sort_1, ground_dim_sort_2, ground_dim_sort_3 = zip(*data)
# sorts all three d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.