input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
method for S3AddPersonWidget2
"""
site_id = r.id
if not site_id:
output = current.xml.json_message(False, 400, "No id provided!")
raise HTTP(400, body=output)
db = current.db
s3db = current.s3db
ltable = s3db.hrm_human_resource_site
htable = db.hrm_human_resource
query = (ltable.site_id == site_id) & \
(lt... | |
is completed. Useful for nested loops.
"""
if text_prompts not in [[], None] and not isinstance(text_prompts, str):
raise ValueError('text_prompts must be a string')
if image_prompts not in [[], None] and not isinstance(image_prompts, str):
raise ValueError('image_prompts must be a string')
if noise_prompts not in... | |
842],
["Ruyi", "如意", "pleasant", 838],
["Shusong", "疏松", "loose", 837],
["Fanchang", "反常", "unusual", 837],
["Zhenqie", "真切", "clear", 836],
["Keke", "苛刻", "harsh", 833],
["Kuangre", "狂热", "frantic", 829],
["Paiwai", "排外", "antiforeign", 828],
["Chimi", "痴迷", "infatuated", 827],
["Xiaozhang", "嚣张", "rampant", ... | |
<gh_stars>0
# 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.
# -----------------------------------------... | |
#!/usr/bin/env python3
import argparse
import hashlib
import io
import logging
import os
import subprocess
import sys
DRY_RUN=True
DEBUG_LEVEL=30
class FileSystemEntry:
source = ""
target = ""
mtype = ""
options = ""
freq = ""
passno = ""
def __str__(self):
return self.source + " " + self.target + " " + self... | |
from __future__ import print_function, division, absolute_import
import subprocess
import numpy as np
import pandas as pd
import hashlib
import argparse
import sys
from classification import metadata
import six
remapping = {
# 'seismic_vessel' : 'research'
}
def read_ids(gcs_path):
id_text = subprocess.check_outpu... | |
<reponame>jabozzo/delta_sigma_pipe_lascas_2020<filename>calib/calib/gen.py
#! /usr/bin/env python
import abc
import copy
from itertools import islice
import numpy as np
import calib.gen as gen
import calib.data as data
from calib.misc import default, push_random_state
def pipe_map(n_caps, n_refs, differential=Fals... | |
<reponame>groboclown/petronia
# This prevents the self-referential KeyComboTree from causing Any errors.
# mypy: allow-any-expr
"""
Hotkey processing.
The system should allow for only one type of chain to be used at a time.
"""
from typing import Dict, List, Tuple, Sequence, Iterable, Union, Optional
from .....base... | |
<filename>nio/responses.py
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME> <<EMAIL>>
# Copyright © 2020-2021 Famedly GmbH
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice... | |
<gh_stars>0
"""
Flyter
Tool for transferring files on the same network using raw sockets.
Doesn't use encryption.
"""
__version__ = (0, 0, 0)
__author__ = "CryptoNyxz"
__license__ = """
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this softwa... | |
close\r\nX-Storage-Token: '
't\r\nContent-Length: 0\r\nContent-Type: foo/bar'
'\r\n\r\n')
fd.flush()
headers = readuntil2crlfs(fd)
exp = 'HTTP/1.1 201'
self.assertEquals(headers[:len(exp)], exp)
# Ensure getting the copied file gets original content-type
sock = connect_tcp(('localhost', prolis.getsockname()[1])... | |
be used is "svm_qa_dataframe". The default location that the
output file will be written to is the current working directory
crpt: bool, optional
Uses extended dataframe index name to differentiate from normal svm data, by default 0 (False)
save_csv: bool, optional
store h5 data into a CSV file, by default False
... | |
"""
请求查询投资者持仓响应
:param pInvestorPosition:
:param pRspInfo:
:param nRequestID:
:param bIsLast:
:return:
"""
status = self.resp_common(pRspInfo, nRequestID, bIsLast)
if status < 0:
return
self.logger.info('持仓:%s', pInvestorPosition)
if pInvestorPosition is None:
return
instrument_id_str = bytes_2_str(p... | |
index is None or isinstance(index, int), "i must be an int"
self._index = index
def __str__(self):
return "OP2 IterationIndex: %s" % self._index
def __repr__(self):
return "IterationIndex(%r)" % self._index
@property
def index(self):
"""Return the integer value of this index."""
return self._index
def __g... | |
<filename>statsmodels/stats/tests/test_diagnostic.py
# -*- coding: utf-8 -*-
"""Tests for Regression Diagnostics and Specification Tests
Created on Thu Feb 09 13:19:47 2012
Author: <NAME>
License: BSD-3
currently all tests are against R
"""
import json
import os
import numpy as np
import pandas as pd
import pytest... | |
if not isinstance(entity, entities.PlayerDroid):
entity.getTeam().actors.append(entity)
return entity
def serverUpdate(self, aiWorld, entityGroup, packetUpdate):
p = ObjectController.serverUpdate(
self, aiWorld, entityGroup, packetUpdate)
self.componentsNeedUpdate = False
for component in self.entity.components... | |
that depend on
# them for access control
if link.left.state not in ('found', link.state):
raise MQLInternalError(
query,
'Found link in state %(state)s with left in state %(leftstate)s',
state=link.state,
leftstate=link.left.state)
# if we're changing the permission it's legal to talk about has_permission.
# b... | |
display(self, **attr):
return self.realWidget().display(**attr)
# -------------------------------------------------------------------------
def onaccept(self, value):
"""
Method to format the value that has just been put on the database
"""
type = self.get("Type")
return self.realWidget().onaccept(value)
# -... | |
self.chaindb.get_canonical_block_header_by_number(block.number, self.wallet_address)
if existing_block_header.hash == block.header.hash:
self.logger.debug("tried to import a block that has a hash that matches the local block. no import required.")
return block
else:
if not journal_enabled:
self.enable_journal_db... | |
<filename>EF-SAI-main/codes/Networks/submodules.py
import math
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
import functools
# Channel Attention from CBAM
clas... | |
from __future__ import division, print_function
from os.path import join
import os
import sys
import helpers
import textwrap
import load_data2 as ld2
import match_chips2 as mc2
import report_results2 as rr2
import draw_func2 as df2
import vizualizations as viz
import params
import itertools
import numpy as np
import db... | |
从设备范围和地图范围构造"""
_gskernel.GsDisplayTransformation_swiginit(self, _gskernel.new_GsDisplayTransformation(mapExtent, deviceExtent))
__swig_destroy__ = _gskernel.delete_GsDisplayTransformation
def SpatialReference(self, *args) -> "void":
r"""
*Overload 1:*
当前空间参考
|
*Overload 2:*
设置当前空间参考
"""
ret... | |
"""
The equilibrium module defines routines for interacting with
calculated phase equilibria.
"""
import warnings
import pycalphad.variables as v
from pycalphad.core.utils import unpack_components, unpack_condition, unpack_phases, filter_phases, instantiate_models, get_state_variables
from pycalphad import calculate
fr... | |
DOMAIN + Common.ACTIONS_ADD
ACTIONS_EDIT = DOMAIN + Common.ACTIONS_EDIT
ACTIONS_DELETE = DOMAIN + Common.ACTIONS_DELETE
BUCKETLIST_READ = DOMAIN + Common.BUCKETLIST_READ
BUCKETLIST_EDIT = DOMAIN + Common.BUCKETLIST_EDIT
CAMPAIGNS_READ = DOMAIN + Common.CAMPAIGNS_READ
CAMPAIGNS_ADD = DOMAIN + Common.CAMP... | |
256 bins for each channel, a choice
# between 32-96 bins are normally used, but this tends
# to be application dependent
print("flattened feature vector size: %d" % (np.array(features).flatten().shape))
plt.show()
print('dominant color:'+str(dom_color))
return dom_color
def test_dominant_colors():
images = ['wh... | |
except:
world.send_message(-1001351496983,
'[' + x['pionername'] + '](tg://user?id=' + str(id) + ')' + random.choice(worldtexts) + text,
parse_mode='markdown')
worldtexts = [
', чтобы знать, что происходит в лагере (в том числе и с вами), советую отписаться мне в личку. Можете считать меня своим внутренним голосо... | |
'type': 'str'},
'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'},
'data_mover_run_as_account_id': {'key': 'dataMoverRunAsAccountId', 'type': 'str'},
'snapshot_run_as_account_id': {'key': 'snapshotRunAsAccountId', 'type': 'str'},
'target_vm_name': {'key': 'targetVmName', 'type': 'str'},
'ta... | |
# -*- coding: utf-8 -*-
"""
Created on 2020/8/11
@project: SPAIC
@filename: Node
@author: <NAME>
@contact: <EMAIL>
@description:
定义神经网络的输入输出接口
"""
from ..Network.Assembly import Assembly
import torch
import numpy as np
class Node(Assembly):
'''Base class for input encoder and output decoders.
'''
_class_label = '<... | |
# CPLEX model for the choice-based facility location
# and pricing problem with discrete prices (compact formulation)
# Alternatives are duplicated to account for different possible price levels.
# General
import time
import numpy as np
# CPLEX
import cplex
from cplex.exceptions import CplexSolverError
#... | |
# File: pan_connector.py
#
# Copyright (c) 2014-2022 Splunk Inc.
#
# 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 applicab... | |
),
),
#
COMMETHOD(
[],
HRESULT,
'CreateComputeShader',
(
['in'],
POINTER(VOID),
'pShaderBytecode'
),
(['in'], SIZE_T, 'BytecodeLength'),
(
['in'],
POINTER(ID3D11ClassLinkage),
'pClassLinkage'
),
(
['out'],
POINTER(POINTER(ID3D11ComputeShader)),
'ppComputeShader'
),
),
#
COMMETHOD(
[],
HRESU... | |
) + '&$select=name,selfLink&$filter=partition eq ' + \
folder
pr_res = self.bigip.icr_session.get(
type_link, timeout=const.CONNECTION_TIMEOUT)
if pr_res.status_code < 400:
pr_res_obj = json.loads(pr_res.text)
if 'items' in pr_res_obj:
for profile in pr_res_obj['items']:
if profile['name'].find(match) > -1:
pr... | |
""" Functions that pertain to creating and writing output for the model results."""
# External Libraries
import numpy as np
import netCDF4 as nc
from time import strftime
import matplotlib.pyplot as plt
# Local Libraries
import pygem_input as input
def netcdfcreate(filename, main_glac_rgi, main_glac_hyps,... | |
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(
hours, minutes)
except AttributeError:
pass
return _svalue
@classmethod
def gds_parse_date(cls, input_data):
tz = None
if input_data[-... | |
<reponame>Nullius-2020/SSL-Competitioin-Top-10-solution
# coding: utf8
# Copyright (c) 2020 PaddlePaddle 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
#
... | |
"""
Time stepping solvers.
"""
import numpy as nm
from sfepy.base.base import output, Struct, IndexedStruct, basestr
from sfepy.solvers.solvers import make_get_conf, TimeSteppingSolver
from sfepy.discrete.mass_operator import MassOperator
from sfepy.solvers.ts import TimeStepper, VariableTimeStepper
class StationaryS... | |
0, 0, 0, 0, 0, 0, 0],
'hours': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
})
]
)
def test_get_an_hourly_report_properly_II_less_than_23_hours(self, config_rollback_cameras, metric, expected):
camera, camera_2, client, config_sample_path = config_rollback_cameras
camera... | |
#add new infected to queue
self.infected_queue.append(len(self.people))
#add person to tracked people
self.people[len(self.people)] = Person(parent_key, inf_time, detect_time,recovery_time, category)
def simulate(self, end_time,sim,seed):
"""
Simulate forward until end_time
"""
from collections import deque
... | |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -*- mode: Python; tab-width: 4; indent-tabs-mode: nil; -*-
# Do not modify previous lines. See PEP 8, PEP 263.
"""
Copyright (c) 2020-2021, kounch
All rights reserved.
SPDX-License-Identifier: BSD-2-Clause
This is a tool that analyzes, extracts and injec... | |
import boto3
import datetime
import json
import os
import pytest
import tempfile
import sys
import zipfile
from unittest.mock import MagicMock, patch
SOURCES_BUCKET = "gdh-sources"
try:
import common_lib
except ImportError:
sys.path.append(
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.pardir, 'c... | |
n_space: return
self.__space = n_space
self.update()
@property
def pixmap(self) -> QPixmap: return self.__pixmap
@pixmap.setter
def pixmap(self, n_pixmap: QPixmap) -> None:
self.__pixmap = n_pixmap
self.update()
@property
def name(self) -> str: return self.__name
@name.setter
def name(self, n_name: str)... | |
[x for x in os.listdir(rsid_path) if os.path.isfile(os.path.join(rsid_path,x)) and x.endswith('.bed')]
# if conversion files found, perform conversion
if len(files) > 0:
rsid_path = os.path.join(rsid_path,files[0])
script = """join {} {} -1 1 -2 4 -o 2.1 -o 2.2 -o 2.3 -o 2.4 -o 2.5 -o 2.6 | sed 's/\ /\t/g' > {}.tem... | |
is 0.05. \
If your map has low overall contrast you might need to make this\
bigger such as 0.2.
allow_box_if_b_iso_set = False
.type = bool
.short_caption = Allow box if b_iso set
.help = Allow box_in_auto_sharpen (if set to True) even if \
b_iso is set. Default is to set box_n_auto_sharpen=False \
if b_iso ... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: <EMAIL>
##
## This file is part of VisTrails.
##
## "Redistributio... | |
<filename>qa/common/gen_qa_models.py
# Copyright 2018-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the abov... | |
writeFile.write(" # Get back to \"Home\" folder\n")
writeFile.write(" cd.go(\"~\")\n")
writeFile.write(" # Reset the lastdir variable\n")
writeFile.write(" systemvariables.lastdir = \"\"\n\n")
writeFile.write(" # Do this until told to exit\n")
writeFile.write(" while(zzz == 1):\n")
writeFile.write(" # Chang... | |
'body')
if self.body:
self.body.validate()
def to_map(self):
_map = super().to_map()
if _map is not None:
return _map
result = dict()
if self.headers is not None:
result['headers'] = self.headers
if self.body is not None:
result['body'] = self.body.to_map()
return result
def from_map(self, m: dict = Non... | |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 i... | |
# 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... | |
import sublime
import sublime_plugin
import datetime
import re
import os
import fnmatch
import OrgExtended.orgparse.node as node
import OrgExtended.orgutil.util as util
import OrgExtended.orgutil.navigation as nav
import OrgExtended.orgutil.template as templateEngine
import logging
import sys
import traceback
import O... | |
done since the last commit or just some"
" things, or just save what you have done?"
)
return title, body
class CommittedReallyState(State):
"""The committed really state.
Ancestors are StartState -> CommitedQuestionState -> CommittedState.
"""
def __init__(self, parent):
"""Initialize the state."""
super(... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------... | |
<filename>code/UI/OpenAPI/python-flask-server/swagger_server/models/edge.py
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
from swag... | |
from __future__ import unicode_literals
from decimal import Decimal
import logging
import warnings
from future.utils import python_2_unicode_compatible
from .ewsdatetime import UTC_NOW
from .extended_properties import ExtendedProperty
from .fields import BooleanField, IntegerField, DecimalField, Base64Field, TextFie... | |
much
more flexibility to study different types of driving forces. We can
reuse our earlier code by simply adding a driving force. If we stay in
the $x$-direction only this can be easily done by adding a term
$F_{\mathrm{ext}}(x,t)$. Note that we have kept it rather general
here, allowing for both a spatial and a tempor... | |
) )
] :
merge["operation"].setValue( operation )
self.assertAlmostEqual( sampler["color"]["r"].getValue(), expected[0], msg=operation )
self.assertAlmostEqual( sampler["color"]["g"].getValue(), expected[1], msg=operation )
self.assertAlmostEqual( sampler["color"]["b"].getValue(), expected[2], msg=operati... | |
import psycopg2
import re
import json
from MedTAG_sket_dock_App.models import *
import os
import pandas as pd
import numpy
from psycopg2.extensions import register_adapter, AsIs
def addapt_numpy_float64(numpy_float64):
return AsIs(numpy_float64)
def addapt_numpy_int64(numpy_int64):
return AsIs(numpy_int64)
register_a... | |
<filename>colormaps/twilights512_colormap.py
from numpy import array
# ****************************************************************************************
# 512-level colormap created by make_colormap utility from file twilight.png
# ********************************************************************************... | |
import os
import re
import cv2
import sys
import glob
import json
import shutil
import numpy as np
import torch
from PIL import Image
from easydict import EasyDict
from torchvision.transforms import transforms
# Profile
def load_profile(filepath):
"""
Load experiment profile as EasyDict
:param filepath: path to... | |
maximal cells
sage: p4 = Polyhedron(vertices=[(0, -1), (0, 0), (1, 0), (1, -1)])
sage: pc.union(PolyhedralComplex([p4]))
Traceback (most recent call last):
...
ValueError: the given cells are not face-to-face
"""
maximal_cells = list(self.maximal_cell_iterator()) + list(
right.maximal_cell_iterator())
return P... | |
# coding: utf-8
import os
from io import StringIO
from typing import TYPE_CHECKING, Any, BinaryIO, Dict, List, Optional, Union
from .constants import UP_AMAZON_S3
from .exceptions import InvalidBatch
from .utils import guess_mimetype
if TYPE_CHECKING:
from .endpoint import APIEndpoint
# Base classes
class Model(... | |
import subprocess
import yaml
import subprocess
from pathlib import Path
from ctfcli.utils.utils import errorlogger,redprint,DEBUG
from ctfcli.utils.utils import debugblue,debuggreen,debugred,debugyellow
class Linter():
"""
I wasnt thinking the best when I wrote this so its pretty procedural
Class to lint challe... | |
import numpy as np
import copy
import sys
from nsrl.helper import tree
try:
import cPickle as pickle
except ModuleNotFoundError:
import pickle
class DataSet(object):
"""A replay memory consisting of circular buffers for observations, actions, rewards and terminals."""
def __init__(self, env, random_state=None, m... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
##########################################################################
#
# OpenMP code generator
#
# This routine is called by op2_fortran which parses the input files
#
# It produces a file xxx_kernel.F90 for each kernel,
# plus a master kernel file
#
###############################################################... | |
= {
'userKey': user_id,
}
service = get_service(
'admin',
'directory_v1',
['https://www.googleapis.com/auth/admin.directory.user.security'])
result = service.tokens().list(**command_args).execute()
return result.get('items', [])
def search_all_mailboxes():
next_page_token = None
service = get_service('adm... | |
file...")
print('Writing dataset to a file...Please wait...')
f = open(full_path_to_TXT_dataset, 'wb')
f.write(TXT_String.encode('utf-8', 'replace'))
f.close()
print('Dataset was saved as:', full_path_to_TXT_dataset)
print('Task complete! Enjoy :)')
##############################################################... | |
import datetime
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import casadi as cas
##### For viewing the videos in Jupyter Notebook
import io
import base64
from IPython.display import HTML
# from ..</src> import car_plotting
# from .import src.car_plotting
PROJECT_PATH = '/home/nbuckman/Dropbox (... | |
Bar) is '
'incorrect.',
six.text_type(ex))
self.stack.delete()
self.assertEqual((self.stack.DELETE, self.stack.COMPLETE),
self.stack.state)
def test_stack_load_no_param_value_validation(self):
"""Test stack loading with disabled parameter value validation."""
tmpl = template_format.parse('''
heat_template_v... | |
<filename>training/instance_segmentation/mask-rcnn/train_maskrcnn.py
# Sample code from the TorchVision 0.3 Object Detection Finetuning Tutorial
# http://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
import os
import sys
sys.path.append("/home/native/projects/cranberry_counting/")
import numpy as np
imp... | |
<filename>CapsuleRoute.py
from CapsuleMemory import CapsuleMemory
from NeuralNet import NeuralNet
from NeuralNetGamma import NeuralNetGamma
from NeuralNetG import NeuralNetG
from Attribute import Attribute
from Utility import Utility
from Observation import Observation
from itertools import permutations
from HyperPara... | |
############## downloadGreenspace.py ###################
# Author: <NAME>
# Developed for <NAME>, Oregon State University
# Date last modified: June 5, 2018
# Description: this script downloads annual MODIS NDVI averages from Google Earth Engine.
# Annual averages range from 2003-2017. NDVI values are based on TOA-sca... | |
"""
* Returns true if this bounding box is open in the Ymax direction.
:rtype: bool
"""
return _Bnd.Bnd_Box_IsOpenYmax(self, *args)
def IsOpenZmin(self, *args):
"""
* Returns true if this bounding box is open in the Zmin direction.
:rtype: bool
"""
return _Bnd.Bnd_Box_IsOpenZmin(self, *args)
def IsOpen... | |
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import pygame
DEFAULT_LOAD_ADDRESS = 0x0801
SYMBOLS = {
'D6510': 0x0000,
'R6510': 0x0001,
}
IRQ_RATE = 50
ROMSLIST = [
# (File)Name, begin address, end address, bit of bank switch register (R6510)
("basic", 0xA000, 0xBFFF, 0),
("chargen", 0xD... | |
<gh_stars>10-100
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Reza(User:reza1615), 2011
# Distributed under the terms of the MIT license.
#
#copy
#
#become checkdictation-fa
#cp zz_checkDictation_cmd.py /data/project/checkdictation-fa/www/python/src/
#
#source www/python/venv/bin/activate
#webservice2 uwsgi-python res... | |
import time
import numpy as np
import types
import torch.nn as nn
import torch.utils.data
import ummon.utils as uu
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.data.dataset import ConcatDataset
from torch.utils.data.dataset import Subset
from .logger import Logger
from .s... | |
in books:
content_id = b['ContentID']
isbn = b['ISBN']
title = b['Title'].strip() # ugh. not sure about that, but sometimes helped
author = b['Attribution']
# TODO not so sure about that; it was the case for KoboShelfes databases
time_spent = b.get('TimeSpentReading', 0)
percent = b['___PercentRead']
status = ... | |
db_chains_ids:
#colortext.warning('PDB chains: {0}\t DB chains: {1}'.format(','.join(chain_ids), ','.join(db_chains_ids)))
#colortext.error('Missing chains.')
new_chain_ids = sorted(set(chain_ids).difference(db_chains_ids))
for c in new_chain_ids:
db_chain = get_or_create_in_transaction(tsession, PDBChain, dict(
... | |
is missing from i_currents calculation", m
)
if showinfo:
print(
"\n [soma] find_i0 Species: %s cell type: %s Temp %6.1f"
% (self.status["species"], self.status["modelType"], h.celsius)
)
print(" *** found V0 = %f" % v0)
print(" *** and cell has mechanisms: ", self.mechanisms)
return v0
def compute_rmrintau... | |
<filename>wildlifecompliance/utils/excel_utils.py
from __future__ import unicode_literals
from django.conf import settings
from collections import OrderedDict
from wildlifecompliance.components.applications.models import Application, ApplicationType, ExcelApplication, ExcelActivityType
from wildlifecompliance.componen... | |
# 0x8d Mask for rockers/buttons present in variant
('transmission_options', c_uint8), # 0x8e Transmission options
('variant_options', c_uint8), # 0x8f variant
('misc_options', c_uint8), # 0x90 state report, add/del facility, et.
('button_transmit_options', c_uint8), # 0x91 mask for what transmits
('output_options'... | |
#! /usr/bin/env python
"""Python Functions for CellRanger BCL->Fastq->SCP Pipeline
Arguments:
-c command to be run:
count:
-id, --sampleId Id of sample being run
-cf, --commaFastqs Comma seperated String with list of fastq directories
-fs, --fastqs List of fastq directories
-E, --expectCells Number of cells to exp... | |
%s" % repro.state)
with build_ssh_command(
repro.ip, repro.auth.private_key, command="-T"
) as ssh_cmd:
gdb_script = [
"target remote | %s sudo /onefuzz/bin/repro-stdout.sh"
% " ".join(ssh_cmd)
]
if debug_command:
gdb_script += [debug_command, "quit"]
with temp_file("gdb.script", "\n".join(gdb_script)) as... | |
import os
import errno
import numpy as np
from torch.nn import init
import torch
import torch.nn as nn
from torch.autograd import Variable
import torchvision
from PIL import Image, ImageDraw, ImageFont
from copy import deepcopy
import skimage.transform
import ntpath
import sys
from miscc.config import cfg
# For vi... | |
<filename>dim/dim/models/ip.py
import datetime
import logging
import re
from sqlalchemy import Column, BigInteger, Integer, String, Numeric, TIMESTAMP, ForeignKey, UniqueConstraint
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.orm import relationship, backref, validates
from sqlalchemy.sql import bindpa... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
SCRIPT # 6
Created on Sun Aug 2 12:19:09 2020
@author: omid
"""
import pandas as pd
import numpy as np
from datetime import datetime
from khayyam import *
import statsmodels.api as sm
from scipy.stats import ttest_ind
# seed the random number generator
allFund... | |
SINGLE_LIST_ENTRY()
self.VerifierContext = v_ptr64()
self.KernelStackReference = v_uint32()
self._pad0758 = v_bytes(size=4)
self.AdjustedClientToken = v_ptr64()
self.UserFsBase = v_uint32()
self._pad0768 = v_bytes(size=4)
self.UserGsBase = v_uint64()
self.PicoContext = v_ptr64()
class PROCESS_DISK_COUNTERS(vs... | |
# Copyright 2020 Advanced Micro Devices, Inc
# 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 wri... | |
= [args.arch]
for arch in archs:
if not self._check_tools_arg_combination(os_name, tool_name, arch):
self.logger.warning(
"Specified target combination is not valid: {} {} {}".format(
os_name, tool_name, arch
)
)
try:
tool_archives = ToolArchives(
os_name=os_name,
tool_name=tool_name,
target=target,
base... | |
str(r))
return self._render_response(r, OK_CODE)
def jsonrpc_is_first_run(self):
"""
Check if this is the first time lbrynet daemon has been run
Args:
None
Returns:
True if first run, otherwise False
"""
log.info("Check if is first run")
try:
d = self.session.wallet.is_first_run()
except:
d = defer.fai... | |
import sys
import os
import glob
import string
import logging
import yaml
import yamlordereddictloader
def extract_data(c, param_map):
"""
Method to generate a CPAC input subject list
python file. The method extracts anatomical
and functional data for each site( if multiple site)
and/or scan parameters for each s... | |
"""
TODO:
Resolve the following bug in the firmware:
>>> spdc.heater_voltage_limit = 3
>>> spdc.heater_voltage = 2
>>> spdc.heater_voltage_limit = 1
>>> spdc.heater_voltage # expected: 1.0
2.0
This in contrast to laser current:
>>> spdc.laser_current_limit = 3
>>> spdc.laser_current = 2
>>> spdc.laser_curren... | |
<filename>sdk/lusid/api/calendars_api.py<gh_stars>0
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3192
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and py... | |
<filename>src/theanets-0.6.1/theanets/layers/recurrent.py
# -*- coding: utf-8 -*-
r'''Recurrent layers for neural network computation graphs.
Recurrent layers are basically defined by the presence of explicitly modeled
time dependencies in the computation graph.
'''
from __future__ import division
import climate
im... | |
**kwargs
):
self.channel_widths = channel_widths
self.final_pool_shape = final_pool_shape
self.init_kernel_shape = init_kernel_shape
self.init_kernel_strides = init_kernel_strides
self.kernel_shape = kernel_shape
self.output_size = dense_hidden_size
self.activation = get_tf_activation(act_name)
self.reg_coef... | |
#!/usr/bin/env python3
"""
c19_make_pipeline.py: creates a snakemake-based pipeline directory, given a set of input .fastq.gz files.
The input .fastq.gz filenames must contain substrings such as '_R1_' or '_R2_' indicating the read direction.
Usage:
# First create the directory $HOME/data, which should contain a co... | |
labels_cityscapes = [
# name id trainId category catId hasInstances ignoreInEval color
( 'unlabeled' , 0 , 255 , 'void' , 0 , False , True , ( 0, 0, 0) ),
( 'ego vehicle' , 1 , 255 , 'void' , 0 , False , True , ( 0, 0, 0) ),
( 'rectification border' , 2 , 255 , 'void' , 0 , False , True , ( 0, 0, 0) ),
( 'out of r... | |
'zvalue'):
self.zvalue.list()
elif (single == 'tvalue'):
self.tvalue.list()
elif (single == 'mean'):
self.mean.list()
elif (single == 'min'):
self.min.list()
elif (single == 'max'):
self.max.list()
elif (single == 'xtic1'):
self.xtic1.list()
elif (single == 'xtic2'):
self.xtic2.list()
elif (single == 'xmi... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 8 13:55:16 2016 as a copy+paste of the previous version of
this file. For making a journal figure.
Calculate the color and magnitude (3.6 - 4.5 microns) of IC 10 X-2,
and compare it to the population of massive stars in the LMC with
IRAC and SAGE measurements.
Source for c... | |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
import pickle
import pandas as pd
import xml.etree.ElementTree as ET
import math
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import csv
import glob
import scikit_posthocs as sp
from scipy import stats
import os
from scipy import stats
import scik... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.