input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""Script to run pose and shape evaluation for different datasets and methods."""
import argparse
import os
from datetime import datetime
import time
from typing import List, Optional, Tuple
import random
import sys
from scipy.spatial.transform import Rotation
import numpy as np
import matplotlib.pyplot as plt
import ... | |
#!/usr/bin/env python
"""Train HMMs for alignment of signal data from the MinION
"""
from __future__ import print_function, division
import sys
import os
import urlparse
import textwrap
import yaml
import h5py
from argparse import ArgumentParser
from random import shuffle
from shutil import copyfile
from multiproces... | |
#!/usr/bin/python
#############################################################################
# Classes of CyRIS features
#############################################################################
INSTANTIATION_DIR = "instantiation"
# External imports
from entities import Command
##############################... | |
-1:
command = 'ALTER TABLE ' + db + ' ADD ' + column + ' varchar(3000)'
else:
command = 'ALTER TABLE ' + db + ' ADD ' + column + ' varchar(100)'
print "save_fit| command=",command
c.execute(command)
except:
print 'save_fit| traceback.print_exc(file=sys.stdout)=',traceback.print_exc(file=sys.stdout)
for column ... | |
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import make_regression
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import numpy as np, tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
impor... | |
if task_id:
proc.submitted_at = datetime.datetime.utcnow()
def get_panda_task_id(self, processing):
from pandatools import Client
start_time = datetime.datetime.utcnow() - datetime.timedelta(hours=10)
start_time = start_time.strftime('%Y-%m-%d %H:%M:%S')
status, results = Client.getJobIDsJediTasksInTimeRange(st... | |
<reponame>HPCCS/PARIS
import pdb
import csv
import numpy as np
from numpy import linalg as LA
from scipy import stats
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.kernel_ridge import KernelRidge
from sklearn.neural_network import MLPRegressor
from sklearn import preprocessing
from skle... | |
input, target):
assert input.dim() in [4, 5]
num_class = input.size(1)
if input.dim() == 4:
input = input.permute(0, 2, 3, 1).contiguous()
input_flatten = input.view(-1, num_class)
elif input.dim() == 5:
input = input.permute(0, 2, 3, 4, 1).contiguous()
input_flatten = input.view(-1, num_class)
target_flatten ... | |
<reponame>plucena24/tda-api
'''Defines the basic client and methods for creating one. This client is
completely unopinionated, and provides an easy-to-use wrapper around the TD
Ameritrade HTTP API.'''
from abc import ABC, abstractmethod
from enum import Enum
import datetime
import json
import logging
import pickle
im... | |
new angle parameters
new_indices = [self._topology_proposal.old_to_new_atom_map[old_atomid] for old_atomid in old_angle_parameters[:3]]
new_angle_parameters = self._find_angle_parameters(new_system_angle_force, new_indices)
if not new_angle_parameters:
new_angle_parameters = [0, 0, 0, old_angle_parameters[3], 0.0*u... | |
prev_input_feed,
reduced_output_weights,
)
futures.append(fut)
elif isinstance(model, transformer.TransformerModel) or isinstance(
model, char_source_transformer_model.CharSourceTransformerModel
):
encoder_output = inputs[i]
# store cached states, use evaluation mode
model.decoder._is_incremental_eval = True
... | |
<reponame>peter-zyj/awsCLI
#!/usr/bin/env python
import os, sys
import time
import re
import socket
import fcntl
import struct
import pexpect
import yaml, hashlib
########SSH logon stuff############
default_passwd = "<PASSWORD>"
prompt_firstlogin = "Are you sure you want to continue connecting \(yes/no.." # update to ... | |
clustal, stockholm, phylip and many others.
The full list of supported fileformat arguments is `provided here <https://biopython.org/wiki/AlignIO>`_).
Parameters
----------
fileformat : str, default='fasta'
text format requested
to_file : str | TextIO, optional
filename or buffer to write into. If not specifi... | |
would mean
# that this filter would do nothing, so assume that this
# is really a configuration error.
assert items_matching, 'rank_features: missing or empty item match dict'
assert rank_key, 'rank_features: missing or empty rank key'
if zoom < start_zoom:
return None
layer = _find_layer(feature_layers, sourc... | |
(1 + w * 1j * t_values[1]))
+ (R3 / (1 + w * 1j * t_values[2]))
+ (R4 / (1 + w * 1j * t_values[3]))
+ (R5 / (1 + w * 1j * t_values[4]))
+ (R6 / (1 + w * 1j * t_values[5]))
+ (R7 / (1 + w * 1j * t_values[6]))
+ (R8 / (1 + w * 1j * t_values[7]))
+ (R9 / (1 + w * 1j * t_values[8]))
+ (R10 / (1 + w * 1j * t_values[... | |
+ m.b214 <= 1)
m.c159 = Constraint(expr= - 0.9*m.x71 + m.x95 + m.b215 <= 1)
m.c160 = Constraint(expr= - 0.9*m.x72 + m.x96 + m.b216 <= 1)
m.c161 = Constraint(expr= - 0.9*m.x73 + m.x97 + m.b217 <= 1)
m.c162 = Constraint(expr= - 0.9*m.x70 + m.x94 - m.b214 >= -1)
m.c163 = Constraint(expr= - 0.9*m.x71 + m.x95 - m.b215 ... | |
"""
This module contains functions for building and loading NMODL mechanisms
Author: <NAME> (<EMAIL>)
Copyright: 2012-2014 <NAME>.
License: This file is part of the "NineLine" package, which is released under
the MIT Licence, see LICENSE for details.
"""
from __future__ import absolute_import
from __future__ imp... | |
below
:param bool bucket_key_enabled: Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
"""
if apply_server_side_encryption_by_default is not None:
pulumi.set(__self__, "apply_server_side_encryption_by_default", apply_server_side_encryption_b... | |
<reponame>BishoyAbdelmalik/discordbot<filename>poopiBot.py
# poopiBot.py
import discord
import threading
import asyncio
from discord import channel
import substring
import random
import requests
import os
import subprocess
from discord.ext import commands
import aiohttp
from io import BytesIO
from requests... | |
<gh_stars>1-10
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
#!/usr/bin/env python
# encoding: utf-8
"""
analyze.py
Command line tool for analyzing variants that are annotated with genmod.
Created by <NAME> on 2014-09-03.
Copyright (c) 2014 __MoonsoInc__. All rights reserved.
"""
from __future__ import print_function
import sys
import os
import click
import inspect
try:
im... | |
<gh_stars>1-10
import argparse
import korbinian
import pandas as pd
import numpy as np
import random
import sys
# import debugging tools
from korbinian.utils import pr, pc, pn, aaa
def calc_aa_propensity_from_csv_col(seq_list_csv_in, aa_prop_csv_out, col_name, sep=","):
"""Calculation of amino acid propensity for TM ... | |
<reponame>olvrou/CCF
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import time
from enum import Enum
import paramiko
import logging
import subprocess
import getpass
from contextlib import contextmanager
import infra.path
import json
import uuid
import cty... | |
# Hangman Game
# -----------------------------------
# Helper code
# You don't need to understand this helper code,
# but you will have to know how to use the functions
# (so be sure to read the docstrings!)
import random
import string
import re
WORDLIST_FILENAME = "words.txt"
def load_words():
"""
Returns a list... | |
<filename>pyhdb/cursor.py
# Copyright 2014, 2015 SAP SE
#
# 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... | |
adapter_seq_read2=adapter_seq_read2,
max_adapter_removal=max_adapter_removal, overlap_length=overlap_length,
zero_cap=zero_cap, quality_base=quality_base, error_rate=error_rate,
min_qual_score=min_qual_score, min_read_len=min_read_len,
keep_temp_files=keep_temp_files,
sort_mem=sort_mem)
total_input += lib_input
... | |
<filename>API/AdminPanel/admin_panel_filters/request_list/url_filter_assessments_journal.py
from API.setting_tests import TokenSave
# Dev01 Staging
staging_dev01 = 'https://api-test-ege.interneturok.ru/api/v1/journal/admin/school_users?'
put_mark_in_user = 'https://api-test-ege.interneturok.ru/api/v2/results/homeworks... | |
# helper functions for testing properties of candidate schedules
import requests
from sets import Set
import json
import calendar
import itertools
import os
from collections import OrderedDict
import random
from definitions import ROOT_DIR, lessonTypeCodes, LOCAL_API_DIR
from z3 import *
LUNCH_HOURS = [11, 12, 13]
def... | |
# -*- coding: utf-8 -*-
from openerp import tools, models, fields, api, exceptions
############################################################################################################################ Üzem picking ###
class RaktarUzemPicking(models.Model):
def sajat_raktar(self):
return self.env.user.sajat_r... | |
self.TestEnv.Sequential = True
self.TestEnv.Validate()
# note: to create a train / test split of pats, do this:
# all = etable.NewIdxView(self.Pats)
# splits = split.Permuted(all, []float64{.8, .2}, []string{"Train", "Test"})
# self.TrainEnv.Table = splits.Splits[0]
# self.TestEnv.Table = splits.Splits[1]
se... | |
<filename>async_strava/strava.py
"""
Ignoring non run activities
None in results of club_activities represents an error in activity. For example - ActivityNotExist
429 - StravaTooManyRequests is called:
- When the user goes to the activity page.
"""
import logging
import re
import json
import asyncio
from typing imp... | |
<gh_stars>1-10
# 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... | |
#!/usr/bin/env python2.7
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contextlib import contextmanager
from collections import namedtuple
import argparse
import mmap
import os
import struct
import s... | |
<gh_stars>1-10
# Copyright 2017 <NAME>
#
# Licensed under the MIT License (the License); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at https://opensource.org/licenses/MIT#
import glob
import re
import sys
import time
from src.io.storage import get_reques... | |
if iii==6:
wue_d_wmclimate_gsl+=[wue]
nue_d_wmclimate_gsl+=[nue]
A_d_wmclimate_gsl+=[A]
if iiii==11:
if iii==4:
wue_d_dmclimate_temps+=[wue]
nue_d_dmclimate_temps+=[nue]
A_d_dmclimate_temps+=[A]
if iiii==12:
if iii==5:
wue_d_wmclimate_temps+=[wue]
nue_d_wmclimate_temps+=[nue]
A_d_wmclimate_temps+=[A]
... | |
<gh_stars>0
from math import pi, sin
import typing as t
from pyglet import gl
from pyglet.graphics.shader import ShaderProgram
from pyglet.image import AbstractImage, TextureArrayRegion
from pyglet.math import Vec2
import pyday_night_funkin.constants as CNST
from pyday_night_funkin.core.context import Context
from p... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
The module contains functions to evaluate the optical depth,
to convert this to observed transmission and to convolve the
observed spectrum with the instrumental profile.
"""
__author__ = '<NAME>'
import numpy as np
from scipy.signal import fftconvolve, gaussian
from numba... | |
<gh_stars>0
import copy
import random
import sys
from operator import sub, add
import gym
import numpy as np
import math
import warnings
from od_mstar3.col_set_addition import OutOfTimeError, NoSolutionError
from od_mstar3 import od_mstar
# from GroupLock import Lock
from matplotlib.colors import *
from gym.envs.classi... | |
<filename>runtime/tests/test_webservice.py
import warnings
from copy import deepcopy
# the following line in hetdesrun.service.webservice causes a DeprecationWarning concerning
# imp module usage:
# from fastapi import FastAPI
# Therefore we ignore such warnings here
warnings.filterwarnings("ignore", message="the imp... | |
<reponame>TimBeishuizen/Meta-modelling
from unittest import TestCase
from MetaModels import MetaModel as MM
import numpy as np
import warnings
class TestAbstractModel(TestCase):
""" A class to test the AbstractModel meta-model structure
"""
# Construct an example Abstract meta-model
__in_par_interva... | |
# -*- coding: utf-8 -*-
"""Tests for the Wikidata parts of the page module."""
#
# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import copy
import json
from decimal import Decimal
try:
from unittest import mock
except Im... | |
import os
import numpy as np
import tensorflow as tf
import shutil, sys
from datetime import datetime
import h5py
from xsleepnet import XSleepNet
from xsleepnet_config import Config
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
from sklearn.metrics import cohen_kappa_score
from dat... | |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://plankton-toolbox.org
# Copyright (c) 2010-2018 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import sys
import pathlib
import os.path
import glob
import local... | |
cs.add(input())
print(len(cs))
# es30: Set .discard(), .remove() & .pop()
def es30():
n = int(input())
s = set(map(int, input().split()))
n_op = int(input())
for _ in range(n_op):
line = input()
if ' ' in line:
op, val = line.split()
if op == 'remove':
s.remove(int(val))
else:
s.discard(in... | |
<filename>projects/project2/multiagent/multiAgents.py<gh_stars>0
# multiAgents.py
# <NAME>
# aderbiqu
# CSE571 Fall 2020
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this n... | |
# 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 .. import _utilities
from... | |
<gh_stars>10-100
# TALON: Techonology-Agnostic Long Read Analysis Pipeline
# Author: <NAME>
#------------------------------------------------------------------------------
import edge as Edge
import edgetree as EdgeTree
import sam_transcript as SamTranscript
import transcript as Transcript
import pdb
class MatchTrack... | |
SlabEx("CRC Error in PC to Board link")
if response != ACK:
raise SlabEx("Unknown Board Response")
'''
Start command
Parameters:
code : Code of command
'''
def startCommand(code):
startTx()
startRx()
sendByte(ord(code))
'''
Check Magic
Check magic code in an opened serial connection
re... | |
cons2,
cons3,
cons50,
cons127,
cons64,
)
rule6656 = ReplacementRule(pattern6656, replacement6656)
pattern6657 = Pattern(
Integral(
(x_ * WC("f", S(1)) + WC("e", S(0))) ** WC("m", S(1))
* acoth(S(1) / tan(x_ * WC("b", S(1)) + WC("a", S(0)))),
x_,
),
cons2,
cons3,
cons50,
cons127,
cons64,
)
rule6657 =... | |
in polygonObj.getSiblings()] # These should all be initialized through the .getSiblings method
# Process this object and its siblings
for polygonStruct in [polygonObj] + polygonSiblingObjs:
# Get info on this polygon object's display list
displayListLength, displayListPointer = polygonStruct.getValues()... | |
some stations didnt have a solution (e.g
insufficient cross-correlations) it will assign a correction of zero.
Meaning than in the worst case scenario the data will stay the same as
at the beginning.
params
-------
method:
Can be "lstsq" for performing a least-squares inversion.
Or "weighted_lstsq" for doing a... | |
'''
Read input from cryspy.in
'''
import configparser
import os
from . import io_stat
def readin():
# ---------- read cryspy.in
if not os.path.isfile('cryspy.in'):
raise IOError('Could not find cryspy.in file')
config = configparser.ConfigParser()
config.read('cryspy.in')
# ---------- basic
# ------ global ... | |
import numpy as np
import numpy.linalg as la
import torch
import torch.nn.functional as F
import torchvision
import json
import time
from matplotlib import pyplot as plt
#from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm, trange
from lietorch import SE3, LieGroupParameter
from scipy.spatial.transf... | |
components/resources. These metrics types are
explicit and internally represented as 'external' metric types such as CW_METRIC, etc."""
return []
# overrides
def hook_internal(self, route: "Route") -> None:
# not interested in data routes, should keep a track
pass
def hook_internal_signal(self, signal: "Signal... | |
+ playertxid + "%22]" + '"'
player_info = rpc_connection.cclib("playerinfo", "17", player_info_arg)
return player_info
def rogue_extract(rpc_connection, game_txid, pubkey):
extract_info_arg = '"' + "[%22" + game_txid + "%22,%22" + pubkey + "%22]" + '"'
extract_info = rpc_connection.cclib("extract", "17", extract_... | |
import pytest,warnings
import os,sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
warnings.resetwarnings()
warnings.simplefilter('ignore', FutureWarning)
warnings.simplefilter('ignore', DeprecationWarning)
from jax import numpy as jnp, lax, vmap
from deltapv import simulator,materials,sun,bcond,solve... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .constant import Constant
__NR_osf_syscall = Constant('__NR_osf_syscall',0)
__NR_exit = Constant('__NR_exit',1)
__NR_f... | |
in zero field in a dictionary where the keys are the element
symbols and the values are the numpy force array for all atoms of that element.
for_1 : dict
Ionic forces in applied efield but with clamped ions in a dictionary formatted like for_0.
z_exp : dict
Expected born effective charge for each element type fr... | |
'int', 'false', '0'),
('finish_macro_block_count', 'int', 'false', '0'),
('partition_count', 'int', 'false', '0'),
('finish_partition_count', 'int', 'false', '0'),
('restore_info', 'varchar:OB_INNER_TABLE_DEFAULT_VALUE_LENTH'),
],
columns_with_tenant_id = [],
)
def_table_schema(**all_backup_log_archive_status_def... | |
<gh_stars>0
import requests
import requests_cache
from bs4 import BeautifulSoup
import json
from lxml import html
import pdb
import re
import sys
import logging
import datetime
import time
# import winsound
from jinja2 import Environment, FileSystemLoader
import math
import itertools
from playsound import playsound
... | |
this;
b = w.__number__ == 0x04 ? w : new $long(w);
if (x === null || typeof x == 'undefined') {
c = null;
} else {
c = x.__number__ == 0x04 ? x : new $long(x);
}
if (b.ob_size < 0) {
if (c !== null) {
throw pyjslib['TypeError']("pow() 2nd argument cannot be negative when 3rd argument specified");
}
return M... | |
+= s * dx
if nx == nxL:
iL += 1
return iL
def func_001b15acc807450c90cda8803e3be4d6(nx, nxU, nxL):
if nx == nxL:
iL += 1
if nx == nxU:
iU += 1
return iU
def func_149e53146763406c98f7ec2894c4f17b(nx, nxU, nxL):
if nx == nxL:
iL += 1
if nx == nxU:
iU += 1
return iL
def func_a6a9c6e6681d40079297ea078438... | |
from pathlib import Path
from typing import Any, Callable, List, Tuple, Union
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QWidget
from src.database_commander import DB_COMMANDER
from src.dialog_handler import DialogHandler, UI_LANGUAGE
from src.models import Cocktail, Ingredi... | |
<reponame>nkran/malariagen-data-python
import os
import random
import shutil
import dask.array as da
import numpy as np
import pandas as pd
import pytest
import scipy.stats
import xarray as xr
import zarr
from numpy.testing import assert_allclose, assert_array_equal
from pandas.testing import assert_frame_equal
from ... | |
<filename>plgx-esp-ui/polylogyx/blueprints/v1/hosts.py
from flask_restplus import Namespace, Resource, inputs
from polylogyx.blueprints.v1.utils import *
from polylogyx.utils import assemble_configuration, assemble_additional_configuration
from polylogyx.dao.v1 import hosts_dao, tags_dao, common_dao
from polylogyx.wra... | |
# -- Imports ------------------------------------------------------------------
# base
import json
import gc
# third party
import fastText as ft
import pandas as pd
# project
from lib.data import Loader
from lib.clustering import Clusterer, ClusterConstructor
from lib.labelling import EditDistance, WordGram, CharGra... | |
Reason]
1) Result - FAIL if there is any exception
in the operation or pool state does not change
to expected state in given time else PASS
2) Reason - Reason for failure"""
return validate_state(api_client, self, state, timeout, interval)
@staticmethod
def state_check_function(objects, state):
return str(obj... | |
is ok
except Exception as e:
logger.warning('removing invalid xml_cachefile %s : %s' % (xml_cachefile, str(e)))
os.unlink(xml_cachefile)
root = None
if root is not None:
cache_status = True
else:
# request not cached
try:
xmlout = requests.get(urlapi, auth=(user, password), params=params)
except:
raise_fro... | |
import nn
class PerceptronModel(object):
def __init__(self, dimensions):
"""
Initialize a new Perceptron instance.
A perceptron classifies data points as either belonging to a particular
class (+1) or not (-1). `dimensions` is the dimensionality of the data.
For example, dimensions=2 would mean that the percep... | |
"unknown") == "inactive":
logg.warning("the service is already down once")
return True
for cmd in conf.getlist("Service", "ExecStop", []):
exe, newcmd = self.exec_newcmd(cmd, env, conf)
logg.info("%s stop %s", runs, shell_cmd(newcmd))
forkpid = os.fork()
if not forkpid:
self.execve_from(conf, newcmd, env) # pra... | |
self.__dict__ == other.__dict__
def __ne__(self, other: 'TableBodyCells') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
class TableCellKey():
"""
A key in a key-value pair.
:attr str cell_id: (optional) The unique ID of the key in the table.
:attr T... | |
"""
Store and visualise the webclient status in the browser.
This modules keeps track of whether user is logged in, displays the
LED status buttons for server, RFID reader status etc.
"""
import typing
import qailib.common.base as base
import qailib.common.serversocketbase as serversocketbase
import qailib.transcry... | |
<filename>regparser/grammar/amdpar.py
# -*- coding: utf-8 -*-
# @todo: this file is becoming too large; refactor
import logging
import string
import attr
from pyparsing import (CaselessLiteral, FollowedBy, LineEnd, Literal,
OneOrMore, Optional, QuotedString, Suppress, Word,
ZeroOrMore)
from six.moves import reduce
... | |
518918400),
(3839, 122, 17, 983, 207567360),
(3840, 123, 17, 1073, 389188800),
(3841, 124, 17, 127, 13343616),
(3842, 125, 17, 12911, 544864320),
(3843, 126, 17, -5693, 518918400),
(3844, 127, 17, -37381, 4670265600),
(3845, 72, 18, 419, 2113413120),
(3846, 73, 18, 6133, 6706022400),
(3847, 74, 18, 1087, 95800... | |
display width of string values to at least 10
(it's annoying that SPSS displays e.g. a one-character variable in
very narrow columns). This also sets all measurement levels to
"unknown" and all variable alignments to "left". This function is
only called if column widths, measurement levels and variable
alignments ... | |
list()
uval = packet.get_hex_uint8()
while uval is not None:
bytes.append(uval)
uval = packet.get_hex_uint8()
value_str = '0x'
if g_byte_order == 'little':
bytes.reverse()
for byte in bytes:
value_str += '%2.2x' % byte
return '%s' % (value_str)
def __str__(self):
'''Dump the register info key/value pairs''... | |
cmds.manipScaleContext('Scale', q=True, cah=True)
active_list = scl_move_active_list
if mode == 1:
if maya_ver >= 2015:
handle_id = cmds.manipRotateContext('Rotate', q=True, cah=True)
active_list = rot_active_list
if mode == 2:
if maya_ver >= 2015:
handle_id = cmds.manipMoveContext('Move', q=True, cah=True)
ac... | |
from crispy_forms.bootstrap import InlineCheckboxes
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, ButtonHolder, Div, Fieldset, Layout, Submit
from datetimewidget.widgets import DateWidget
from django import forms
from .models import (
CHF,
CKD,
IBD,
PVD,
Alcohol,
AllopurinolHyp... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
case, to replace
# nom_val_str: could this be avoided while avoiding to
# duplicate the formula for nom_val_str for the common
# case (robust_format(...))?
nom_val_str = r'%s\infty' % ('-' if nom_val_main < 0 else '')
value_str = nom_val_str + value_end
# Global width, if any:
if fmt_parts['width']: # An indi... | |
"""Plotting methods for model evaluation.
This module can be used to evaluate any kind of weather model (machine learning,
NWP, heuristics, human forecasting, etc.). This module is completely agnostic
of where the forecasts come from.
--- REFERENCES ---
<NAME>., and <NAME>, 1986: "The attributes diagram: A geometric... | |
85
},
]
},
{
'id': 'mount_2',
'title': 'Mount_2',
'val': 40
},
]
}
if InstData.inst_info[id_now]['type'] == 'LST':
inst_health[id_now]['mirror'] = {
'id':
'mirror',
'title':
'Mirror',
'val':
10,
'children': [
{
'id': 'mirror_0',
'title': 'Mirror_0',
'val': 3
},
{
'id':
'mirror_1',
'title':
... | |
= [String]
csp_rtable_check.restype = c_int
# /home/johan/git/pygnd/lib/libcsp/include/csp/csp_rtable.h: 118
if hasattr(_libs['csp'], 'csp_rtable_clear'):
csp_rtable_clear = _libs['csp'].csp_rtable_clear
csp_rtable_clear.argtypes = []
csp_rtable_clear.restype = None
# /home/johan/git/pygnd/lib/libcsp/include/csp/... | |
#!/usr/bin/env python3
#
# Modified by <NAME>
#
# Copyright (c) Facebook, Inc. and its affiliates.
"""
Panoptic-DeepLab Training Script.
This script is a simplified version of the training script in detectron2/tools.
"""
# tensorboard --logdir="d:/Segmentacija/panoptic-deeplab-master/tools_d2/output/"
# python train_p... | |
<reponame>juliomateoslangerak/microscope-metrics
# Import sample infrastructure
from itertools import product
from microscopemetrics.samples import *
from typing import Union, Tuple, List
# Import analysis tools
import numpy as np
from pandas import DataFrame
from skimage.transform import hough_line # hough_line_pea... | |
False, rev = False, open_revs = False) :
try :
if rev :
return self.db.get(name, rev = rev)
elif open_revs :
return self.db.get(name, open_revs = open_revs)
else :
return self.db[name]
except couch_ResourceNotFound, e :
# This happens during DB timeouts only for the _users database
if name.count("org.couchdb.... | |
-name] {
# foreach file [glob -nocomplain -directory /tmp -types f ${router} ${router}_*] {
# catch {file delete -force $file}
# }
# }
# xscale_connect_routers
# enaDestructor -id on_resolve_fail [list xscale_forget_enxr_topology]
# } else {
# enaLogVerify -skip "No subset applicable to EnXR" -fail false
# }
... | |
# last update: 11/19 - cleaned up the last several tests to not try to delete the
# addresses the host would use for comunication, but rather
# an address they would use to communicate between each other.
# past updates:
# 11/17/18 - changed to use subnets, since Mac and Linux apparently really need them
# 11/10/1... | |
# coding: utf-8
from __future__ import print_function, unicode_literals
import re
import pytest
import sqlitefts as fts
from sqlitefts import fts5, fts5_aux
apsw = pytest.importorskip("apsw")
class SimpleTokenizer(fts.Tokenizer):
_p = re.compile(r"\w+", re.UNICODE)
def tokenize(self, text):
for m in self._p.f... | |
<reponame>dmsteck/Fusion360GalleryDataset
"""
Test export functionality of the Fusion 360 Server
"""
import unittest
import requests
from pathlib import Path
import sys
import os
import numpy
from stl import mesh
import importlib
import json
import shutil
import common_test
# Add the client folder to sys.path
CLIEN... | |
"""
gtp_connection.py
Module for playing games of Go using GoTextProtocol
Parts of this code were originally based on the gtp module
in the Deep-Go project by <NAME> and <NAME>
at the University of Edinburgh.
"""
import signal, os
import traceback
from sys import stdin, stdout, stderr
from board_util import GoBoardU... | |
port,
unix_socket = sys_settings.database.socket,
use_utf = use_utf,
)
def _create_protein_deletion_stored_procedure(self):
'''This stored procedure returns 1 on error, -1 when there was no associated Protein record, and 0 on success.'''
self.execute('DROP PROCEDURE IF EXISTS _DELETE_PROTEIN')
if '_DELETE_PROT... | |
<gh_stars>0
from mesh.generic.nodeComm import NodeComm
from switch import switch
import random, time, math
from math import ceil
from mesh.generic.slipMsg import SLIP_END_TDMA
from mesh.generic.radio import RadioMode
from mesh.generic.cmds import TDMACmds
from mesh.generic.tdmaState import TDMAStatus, TDMAMode, TDMABlo... | |
<reponame>spensmith/tsfl<filename>tsfl.py
import os
import pathlib
import subprocess
import sys
import time
import tkinter as tk
from tkinter import filedialog
import numpy as np
import pandas as pd
root = tk.Tk()
width = int(1.0 * root.winfo_screenwidth())
height = int(0.8 * root.winfo_screenheight())
root.geometry(... | |
to 0" fat, select, raw
23174: [], # Beef, rib eye steak, boneless, lip off, separable lean only, trimmed to 0" fat, all grades, cooked, grilled
23175: [], # Beef, rib eye steak, boneless, lip off, separable lean only, trimmed to 0" fat, all grades, raw
23176: [], # Beef, rib eye steak, boneless, lip off, separable l... | |
import base64
import math
import os
import uuid
from datetime import datetime
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Q
""" Project model."""
class Project(models.Model):
name = mod... | |
<reponame>marvintau/congram<gh_stars>0
# -*- encoding: utf-8 -*-
import os
import sys
import itertools
import time
import numpy as np
def flatten(l):
if l == []:
return []
elif not isinstance(l[0], list):
return l
else:
return list(itertools.chain.from_iterable(l))
def group_by(lis, key):
groups = itertools.... | |
- 29: iIii1I11I1II1 - OoO0O00 + I1IiiI % iIii1I11I1II1 % OOooOOo
if 84 - 84: IiII + I1ii11iIi11i + Ii1I + iII111i
if 62 - 62: i11iIiiIii + OoOoOO00 + i1IIi
if 69 - 69: OoOoOO00
if 63 - 63: OoO0O00 / OoOoOO00 * iIii1I11I1II1 . I1Ii111
def lisp_get_local_interfaces ( ) :
for Ooooo in netifaces . interfaces ( ) :
iI... | |
<filename>data_editor_no_chars/snippest.py
#".QFrame{border: 1px solid black;}"
# import sys
# from PyQt5 import QtWidgets
# app = QtWidgets.QApplication(sys.argv)
# screen = app.primaryScreen()
# print('Screen: %s' % screen.name())
# size = screen.size()
# print('Size: %d x %d' % (size.width(), size.height()))
# re... | |
at .errdump ')
print('Also the .lastdf contains .errdump, for inspecting ')
self.print_eq_values(errvar,self.errdump,per=[self.periode])
if hasattr(self,'dumplist'):
self.dumpdf= pd.DataFrame(self.dumplist)
del self.dumplist
self.dumpdf.columns= ['fair','per','iteration']+self.dump
pass
def newton1p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.