input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
add data for stats
# efficiency_data_mouse.append(efficiency[trial_num])
# # duration_data_mouse.append(end_idx[trial_num]) #TEMP COMMENTING
# duration_data_mouse.append(RT)
# prev_homings_data_mouse.append(num_prev_homings_EV[trial_num])
#
# t += 1
#
# # append data for stats
# if efficiency_data_mouse:
# efficiency_d... | |
<reponame>dax-1895/magenta
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | |
<reponame>sappelhoff/ecomp_analysis
"""Calculate RSA neurometrics.
- import subj/stream wise rdm_times arrays
- for each subj/stream, average over time window: 9x9 RDM
- create an array of numberline RDMs with different parameters each: kappa, bias
- for each subj/stream/meantime RDM, correlate with all model RDMs -->... | |
"""
dense_electrode.py
Class file for dense metal (e.g. Li) electrode methods
"""
import cantera as ct
from math import tanh
import numpy as np
class electrode():
"""
Create an electrode object representing the dense electrode
"""
def __init__(self, input_file, inputs, sep_inputs, counter_inputs,
electrode_n... | |
# -*- coding: utf-8 -*-
"""
module for implementation of indicator class, which is designed as MinIn for systems with netvalues
"""
import pandas as pd
from pyecharts.globals import CurrentConfig, NotebookType
from pyecharts import options as opts
from pyecharts.charts import Kline, Line, Bar, Grid
from pyecharts.comm... | |
<reponame>idevopscloud/python-kubernetes
#!/usr/bin/env python
#
# Copyright 2014 tigmi
#
# 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
#
# Unle... | |
name of the environment (`None` for the base environment)
name: Optional[str]
@property
def conda_exe(self) -> Path:
"""The path to the Conda executable"""
if ON_WINDOWS:
return self.basepath / "Scripts" / "conda.exe"
else:
return self.basepath / "bin" / "conda"
@property
def bindir(self) -> Path:
"""
The... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 16 13:44:19 2018
@author: sven
"""
import scipy.stats as sps
import scipy.spatial as spp
import numpy as np
import copy
from ..utils.utils import MyException
def trim_mean(x,trimming,axis=0):
"""
computes the trimmed mean of array x according to... | |
is written into output_tar (as a tar file)
"""
stopwatch.sw.start('write_output')
base.MakeDirs(os.path.join(self._temp_dir, OUTPUT_DIR))
base.MakeDirs(os.path.join(self._temp_dir, MODIFIED_DIR))
for file_obj in self.files:
# We want to be able to show all the modifications in one place.
# Therefore, each file ... | |
<filename>test_network.py
import tensorflow as tf
from utils import weights_spectral_norm
class STDFusionNet():
def feature_padding(self, x, kernel=3, stride=1, pad=1):
if (kernel - stride) % 2 == 0:
pad_top = pad
pad_bottom = pad
pad_left = pad
pad_right = pad
else:
pad_top = pad
pad_bottom =... | |
one of {task_keys} "
f'for {cls.__name__}: "{k}" is not allowed.\n{mes}'
)
@classmethod
def print_config(cls, file=sys.stdout) -> None:
assert check_argument_types()
# Shows the config: e.g. python train.py asr --print_config
config = cls.get_default_config()
file.write(yaml_no_alias_safe_dump(config, indent=4... | |
<reponame>thomasbazeille/public_protocols
import numpy as np
from psychopy import core, visual, event
from utils import show_fixation_cross
def get_wedge(angular_position,
checker_phase=0.,
checker_cycles_radial=10,
checker_cycles_angular=2.5,
outer_radius=500,
inner_radius=80,
size=None,
angular_width=30,
... | |
or len(xlis) < 1:
return
detail: dict = {}
idx: int = 0
for xli in xlis:
try:
xli: etree._Element = xli
if xli is None:
continue
xdiv: etree._Element = xli.find('div/div/div/div/div[2]')
if xdiv is None:
continue
# url
xa: etree._Element = xdiv.find('div[1]/a')
if xa is None:
continue
schoolurl: str = ... | |
<gh_stars>10-100
#!/usr/bin/python
import socket
import errno
import logging
import os
import platform
if platform.system() != 'Java':
from select import select
else:
from select import cpython_compatible_select as select
# Disable socks support in Jython
if platform.system() != 'Java':
import socks
else:
if 'so... | |
= {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json'])
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json'])
# Auth... | |
self.locationUri = locationUri
self.parameters = parameters
self.privileges = privileges
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode... | |
which PLS2 was run.
"""
self.settingsDict = {}
self.settingsDict['numComp'] = self.numPC
self.settingsDict['arrX'] = self.arrX_input
self.settingsDict['arrY'] = self.arrY_input
self.settingsDict['Xstand'] = self.Xstand
self.settingsDict['Ystand'] = self.Ystand
self.settingsDict['analysed X'] = self.arrX
self.s... | |
from flask import jsonify, request
from marshmallow import ValidationError
from app import schemas, models
from flask_restx import Resource, reqparse
import flask_praetorian
from app import task_ns as ns
from app.api.task.task_utilities.task_socket_actions import *
from app.api.task.task_utilities.task_socket_function... | |
<reponame>expertailab/embrelassess<gh_stars>1-10
import matplotlib.pyplot as plt
import seaborn
import numpy as np
import warnings
import itertools
import os
import os.path as osp
import torch
import pandas as pd
# The 'analyse' module provides methods for analysing embedding relation
# learn_results
def expand_test... | |
0.434294481903252*log(1 +
0.08157272772815*m.x2660) + 0.434294481903252*log(1 + 0.06957939374923*m.x2661) +
0.434294481903252*log(1 + 0.2211715375748*m.x2662) + 0.434294481903252*log(1 + 0.190599795073*
m.x2663) + 0.434294481903252*log(1 + 0.1464862148544*m.x2664) + 0.434294481903252*log(1 +
0.4069493717309*m.x2... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 4 15:23:46 2018
@author: Jared
"""
from collections import Counter
import pymongo
import pandas as pd
from ast import literal_eval
from ml.elements import *
#import machineLearner as ml #get rid of if doing oqmd database
#from qmpy import * #use ... | |
from django.db import models
from django.urls import reverse_lazy
from .informacion_personal import(Declaraciones, Domicilios, Observaciones,
InfoPersonalVar)
from .catalogos import (CatTiposInmuebles, CatTiposTitulares,
CatFormasAdquisiciones, CatSectoresIndustria,
CatMonedas, CatTiposOperaciones, CatTiposMuebles,
... | |
#!/usr/bin/env python
#===============================================================================
# Copyright 2017 Geoscience Australia
#
# 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
... | |
= int(j150)
if j150 not in list(self.spikeShape.keys()):
return
if jthr == j150 and self.verbose:
#print '\n%s:' % self.filename
print('Threshold current T and 1.5T the same: using next up value for j150')
print('jthr, j150, len(spikeShape): ', jthr, j150, len(self.spikeShape))
print('1 ', self.spikeShape[jthr][... | |
<gh_stars>10-100
import mindspore.ops as P
from mindspore import nn
class Module0(nn.Cell):
def __init__(self, batchnorm2d_1_num_features, conv2d_3_in_channels):
super(Module0, self).__init__()
self.concat_0 = P.Concat(axis=1)
self.batchnorm2d_1 = nn.BatchNorm2d(num_features=batchnorm2d_1_num_features,
eps=9.999... | |
<reponame>insikk/quora_question_duplicate
import random
import itertools
import numpy as np
import tensorflow as tf
from read_data import DataSet
from tensorflow.contrib.rnn import BasicLSTMCell, LSTMStateTuple
from tensorflow.python.ops.rnn import dynamic_rnn
from mytensorflow import get_initializer
from rnn import... | |
address must have a unique identifier.",
required=True,
),
"location_id": pa.Column(
dtype="string",
description="The identifier of the location for which this is the address.",
required=False,
nullable=True,
),
"attention": pa.Column(
dtype="string",
description="The person or entity whose attention should ... | |
<reponame>Alexhuszagh/XLDiscoverer<filename>xldlib/export/dataframes/base.py
'''
Export/Dataframes/base
______________________
Inheritable base-class for dataframe instances.
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU GPLv3.txt for more details.
'''
# l... | |
work on a task.
def requestPause(self): # Request the thread running the task to suspend its work.
self.pauseRequested.rise() # Raise the flag requesting the thread to suspend its work.
def _checkPauseReq(self): # Check for pause requests.
if self.pauseRequested(): # If someone is asking us to pause,
self._pause... | |
<filename>modape/modis/smooth.py
"""
MODIS smooth HDF5 class.
This file contains the class representing a smoothed MODIS HDF5 file.
"""
# pylint: disable=import-error
from array import array
from datetime import datetime, timedelta
import logging
from pathlib import Path
import h5py
from modape.constants import TEMPI... | |
"sqlite>=3.9.0"])
@property
def temp_table_names(self):
"""target dialect supports listing of temporary table names"""
return only_on(["sqlite", "oracle"])
@property
def temporary_views(self):
"""target database supports temporary views"""
return only_on(["sqlite", "postgresql"])
@property
def update_nowa... | |
#!/usr/bin/env python3
from __future__ import print_function
import os
from os import environ, chmod
import json
import shutil
import hashlib
import pathlib
import logging
from time import sleep
from types import GeneratorType
from collections import Counter, defaultdict
import psutil # sigh
import appdirs
import reque... | |
<reponame>NonExistentUsername/explosive-kittens-bot
from os import makedirs
from notifications import Notifications
from chats_manager import ChatsManager
from notifications_processor import NotificationsProcessor
from games_manager import GamesManager
from commands import Commands
from messages import Messages
... | |
<filename>heat/tests/test_translation_rule.py
#
# 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... | |
= mask_ds.GetRasterBand(1)
src_ds = gdal.Open(str(line_params.params.in_df.path))
cell_areas = _get_cell_areas(
line_params.y, line_params.lat, line_params.win_ysize,
line_params.image_info
)
results = []
for x in range(
0, line_params.image_info.x_size, line_params.image_info.x_block_size
):
if x + line_p... | |
from parsimonious.grammar import Grammar
# https://docs.python.org/3/reference/grammar.html
# 3.10.3 Documentation » The Python Language Reference » 10. Full Grammar specification
YiPGrammar = Grammar("""
# PEG grammar for Yi (Python) syntax
file = statements? # ENDMARKER
interactive = statement_newline
eval = exp... | |
import tensorflow as tf
import algos_tf14.models
from common import tr_helpers, experience, env_configurations
import numpy as np
import collections
import time
from collections import deque
from tensorboardX import SummaryWriter
from datetime import datetime
from algos_tf14.tensorflow_utils import TensorFlowVariables
... | |
OS '
'Independent\\nClassifier: Programming Language :: Python\\nClassifier: '
'Programming Language :: Python :: 2\\nClassifier: Programming Language :: '
'Python :: 2.7\\nClassifier: Programming Language :: Python :: '
'3\\nClassifier: Programming Language :: Python :: 3.5\\nClassifier: '
'Programming Language :... | |
in a new "
'execution\n'
'frame (see section Naming and binding), using a newly created '
'local\n'
'namespace and the original global namespace. (Usually, the '
'suite\n'
"contains only function definitions.) When the class's suite "
'finishes\n'
'execution, its execution frame is discarded but its loc... | |
<filename>models/networks.py<gh_stars>1-10
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
###############################################################################
# Helper Functions
#############################################################... | |
frequencies[i:],
for other_frequency_index, other_row in enumerate(ons_or_offs[frequency_index + 1:, :], start=frequency_index + 1):
# for each non-claimed 1 which is less than theshold_ms away in time,
upper_limit_index = top_level_frequency_one_index + threshold_samples
lower_limit_index = top_level_frequency_on... | |
<filename>umbra/scenario/environment.py
import re
import os
import json
import yaml
import logging
import psutil
import subprocess
import time
from mininet.net import Containernet
from mininet.node import Controller, OVSKernelSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.lin... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, <NAME>
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import functools
import os
import re
import tempfile
from anima.ui.progress_dialog import ProgressDialogManager
from anima.env.maya... | |
'zipcode': 215000},
2072: {'name': '昆山市', 'pid': 166, 'zipcode': 215000},
2074: {'name': '相城区', 'pid': 166, 'zipcode': 215000},
2075: {'name': '苏州工业园区', 'pid': 166, 'zipcode': 215000},
2076: {'name': '虎丘区', 'pid': 166, 'zipcode': 215000},
2078: {'name': '启东市', 'pid': 167, 'zipcode': 226000},
2079: {'name': '如东县',... | |
<filename>rumblesdk/models/scan_options.py
# coding: utf-8
"""
Rumble API
Rumble Network Discovery API # noqa: E501
OpenAPI spec version: 2.11.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ScanOptions(object):
""... | |
import unittest
import auto_diff
import numpy as np
class AutoDiffUnitTesting(unittest.TestCase):
def _assertAllClose(self, actual, desired, rtol=1e-07, atol=1e-12, equal_nan=True):
np.testing.assert_allclose(actual, desired, rtol, atol, equal_nan)
class TestSingleVariableAutoDiff(AutoDiffUnitTesting):
def _test... | |
in Lrowstruc[i]:
if i != j:
L[i, j] = self[i, j]
summ = 0
for p1 in Lrowstruc[i]:
if p1 < j:
for p2 in Lrowstruc[j]:
if p2 < j:
if p1 == p2:
summ += L[i, p1]*L[j, p1]*D[p1, p1]
else:
break
else:
break
L[i, j] -= summ
L[i, j] /= D[j, j]
elif i == j:
D[i, i] = self[i, i]
summ = 0
for k in Lrowstruc[i]:... | |
milliseconds
time, _ = time.split(".", 1)
except ValueError:
pass
kw["date"], kw["time"] = date, time
except ValueError: # need more than one item to unpack
kw["date"] = kw["time"] = ""
date_options = dict(
kw.get("date_options")
or self.date_options
or self.default_date_options
)
date_options["formatSubmi... | |
get_rse(rse_id=get_rse_id(rse=rse_name, **self.vo))
assert rse.rse == rse_name
assert rse.deterministic == properties['deterministic']
assert rse.volatile == properties['volatile']
assert rse.city == properties['city']
assert rse.region_code == properties['region_code']
assert rse.country_name == properties['coun... | |
int|float
"""
return self["borderpad"]
@borderpad.setter
def borderpad(self, val):
self["borderpad"] = val
# borderwidth
# -----------
@property
def borderwidth(self):
"""
Sets the width (in px) of the border enclosing the annotation
`text`.
The 'borderwidth' property is a number and may be specified a... | |
<gh_stars>0
from __future__ import annotations
from enum import Enum, IntEnum
import math
from dataclasses import dataclass, field
from typing import Tuple, List, Union
from pydantic import BaseModel, Field
import numpy as np
class Point(BaseModel):
x: float
y: float
def __mul__(self, r: TransformationMatrix)... | |
22360143,
92416,
-65192,
22421877,
92481,
-1,
22479932,
92451,
-1,
22351846,
92456,
22741340,
22295412,
92433,
-1,
22685146,
92477,
-65187,
22685043,
92492,
-65186,
22812508,
92513,
-1,
22873108,
92491,
23069033,
22224003,
-1,
23134566,
23007072,
-1,
23200100,
23081844,
-1,
-65181,
2... | |
<filename>Lab2/Step3.py
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 17 17:58:26 2020
@author: <NAME>
"""
import pymongo as pm
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter, DayLocator
import numpy as np
import pandas as pd
import warnings
import ... | |
For the delay cal_type the gain is calculated as:
gain = 1 * exp((+/-) * 2 * pi * j * delay * frequency)
where the (+/-) is dictated by the delay_convention
Args:
delay_convention: exponent sign to use in the conversion. Defaults to minus.
run_check: Option to check for the existence and proper shapes of
paramet... | |
self.assertEqual(p1.age, 17)
self.assertEqual(p1.first, 'John')
self.assertEqual(p1.last, 'Doe')
def test_creation_with_some_keywords(self):
Person = NamedTuple('Person', 'age first last')
p1 = Person(17, first='John', last='Doe')
self.assertEqual(p1[0], 17)
self.assertEqual(p1[1], 'John')
self.assertEqual(p1[... | |
bezier_box_clear_sharpness(self, pos, arguments=None):
status = None
hov_status = False
if self.hover:
for cont in self.containers:
if cont.hover:
hov_status, status = cont.bezier_box_clear_sharpness(
[pos[0]+self.scale_pos_offset[0], pos[1]+self.scale_pos_offset[1]+self.scroll_offset * self.scale], arguments)
... | |
search, such as a specified header or a query string.
"""
return pulumi.get(self, "field_to_match")
@field_to_match.setter
def field_to_match(self, value: pulumi.Input['RegexMatchSetRegexMatchTupleFieldToMatchArgs']):
pulumi.set(self, "field_to_match", value)
@property
@pulumi.getter(name="regexPatternSetId")
... | |
import math
from collections import Counter
import pytest
import torch
from neuralpp.inference.graphical_model.representation.factor.pytorch_table_factor import PyTorchTableFactor
from neuralpp.inference.graphical_model.representation.table.pytorch_log_table import (
PyTorchLogTable,
)
from neuralpp.inference.graphic... | |
from __future__ import absolute_import, division, print_function
import itertools as it
import os
import gzip
import bz2
from functools import partial
from contextlib import contextmanager
from ..dispatch import dispatch
from cytoolz import partition_all, merge, keyfilter, pluck
from toolz import concat, get, pipe, i... | |
not in ncandidates:
ncandidates.add(ndir)
candidates.append(dir)
elif nhome and ndir.startswith(nhome) \
and ndir[len(nhome)+1:].count(os.path.sep) < 2:
if ndir not in ncandidates:
ncandidates.add(ndir)
candidates.append(dir)
#print candidates
print("""\
It appears that `go' is not setup properly in your envi... | |
in
dframe_2017[[
'Yearly_Day',
'Hour',
'Minute',
'Second']].values]
dframe_2017.drop(columns=['file', 'Year', 'Hour', 'Minute', 'Yearly_Day', 'Second'], inplace=True)
dframe_2017 = dframe_2017[dframe_2017['date'] < end_date]
dframe_2017 = dframe_2017[dframe_2017['date'] > start_date]
dframe_2017.set_index('da... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
import os
import sys
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError, ClientError, ParamError
from tencentcloud.common ... | |
{'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations'} # type: ignore
def list_product_families_metadata(
self,
skip_token=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ProductFamiliesMetadata"]
"""This method provides the list of pro... | |
variance_level (float): vertical line at % variance explained
Returns:
Nothing.
"""
plt.figure()
plt.plot(np.arange(1, len(variance_explained) + 1), variance_explained, '--k', label='Variance Explained')
# plot vertica line wher variance explained exceeds variance_level
PC = np.argmax(variance_explained>variance... | |
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: © 2010 by California Institute of Technology.
#
# statefbk.py - tools for state feedback control
#
# Author: <NAME>, <NAME>
# Date: 31 May 2010
#
# This file contains routines for designing state space controllers
#
# Copyright (c... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Toxine project: Text Preprocessing pipeline
#
# Copyright (C) 2019-present by <NAME>
# License: BSD, see LICENSE for details
"""
Tag emojis, emails, dates, phones, urls, html/xml fragments etc.
Tag tokens with unallowed symbols.
Punctuation correction.
Tokenization.
"""
import d... | |
<reponame>wayneferdon/WallpaperEngine.NeteaseMusicLyricDesktop
from pykakasi import kakasi
import datetime
import json
import re
import os
import requests
import time
import sqlite3
from enum import Enum
APPDATA = os.getenv("LOCALAPPDATA")
LOGPATH = os.path.expanduser(APPDATA + "/Netease/CloudMusic/cloudmusic.elog")
... | |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Modul is used for skeleton binary 3D data analysis
"""
# import sys
# import os.path
# path_to_script = os.path.dirname(os.path.abspath(__file__))
# sys.path.append(os.path.join(path_to_script, "../extern/dicom2fem/src"))
import logging
logger = logging.getLogger(__name... | |
<reponame>ContactEngineering/SurfaceTopography<gh_stars>1-10
#
# Copyright 2020-2021 <NAME>
# 2020-2021 <NAME>
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without re... | |
"""
A jGrid is a georeferenced nD array (n >= 3) chunked into fractions along its
x/y axes AND the time axis (and NOT chunked over the other axes).
It is suitable to process pixels as timeseries.
It can be viewed as a nD array (e.g. [width, height, ndates]).
A jGrid consists of a header (a .jghdr3 file, which is just... | |
program source
(http://www.freebsd.org/cgi/man.cgi?query=indent)
The options of the IndentFormatter are based on the union of
options of indent versions for FreeBSD, OpenBSD, OS X and GNU indent.
Many options will not be valid for the indent version that is used.
The complains about unknown options are registered... | |
used to find IPv4 network overlaps
. overlapping addresses in stdout will be highlighted with 'Match Found!'
"""
parser = argparse.ArgumentParser(description='VPC Report Generator', epilog=argv_epilog, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('-filename', '-f', nargs=1, help='Input ... | |
<reponame>gleichdick/rosdep
# Copyright (c) 2012, <NAME>, Inc.
# 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 above copyright
# notice, this l... | |
tok_list, _global_call):
single_line = False
left_brack = ""
right_brack = ""
str_to_ret = ""
if tok_list[0] in [IF, ELIF, ELSE]:
if tok_list[0] == ELIF:
tok_list[0] = ELSE_IF
if tok_list[0] != ELSE:
if tok_list[1] != LEFTBRACK:
left_brack = LEFTBRACK
right_brack = RIGHTBRACK
str_to_ret += tok_list[0]... | |
not None:
result['tenant_id'] = self.tenant_id
if self.tenant_name is not None:
result['tenant_name'] = self.tenant_name
if self.status is not None:
result['status'] = self.status
if self.commodity_code is not None:
result['commodity_code'] = self.commodity_code
return result
def from_map(self, m: dict = None... | |
#######Supplement for "Interpretable classifiers using rules and Bayesian analysis: Building a better stroke prediction model."
###LICENSE
#
#This software is released under the MIT license.
#
#Copyright (c) 2013-14 <NAME>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this softwar... | |
<reponame>barry-scott/PythonWinAppPackager
#!/usr/bin/python3
#
# win_app_package_exe_config.py
#
import sys
import ctypes
import ctypes.wintypes
import struct
from namedstruct import namedstruct
is_64bit = (ctypes.sizeof( ctypes.c_voidp ) * 8) == 64
# DumpRange used for debug
struct_DumpRange = namedstruct( 'DumpR... | |
TREATMENT RECORD IOD': ['Study'],
'DEFORMABLE SPATIAL REGISTRATION IOD': ['Study'],
'VIDEO PHOTOGRAPHIC IMAGE IOD': ['Study'],
'RT IMAGE IOD': ['Study'],
'SC IMAGE IOD': ['Study'],
None: ['Study'],
'SEGMENTATION IOD': ['Study'],
'PET IMAGE IOD': ['Study'],
'PSEUDO-COLOR SOFTCOPY PRESENTATION STATE IOD': ['Study... | |
import os
import System.Drawing.Color
import Rhino.Geometry as rg
import Rhino
import ghpythonlib.components as ghcomp
from collections import OrderedDict
from collections import defaultdict
import math
import subprocess
import alpaca4dUtil
#TODO
# USE SELF.TYPEELEMENT TO WRITE THE OBJECT TYPE
# GEOMTRANSFORMATIO... | |
<reponame>rcbops/glance-buildpackage<filename>glance/store/swift.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack, LLC
# 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 obta... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Automatically initialize and run idealized experiments in WRF
on a single computer or cluster.
@author: <NAME>
"""
import numpy as np
import math
import os
import datetime
import argparse
import glob
import importlib
import inspect
from copy import deepcopy
from path... | |
"external_name", value)
@property
@pulumi.getter
def parameters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ServiceSpecParametersArgs']]]]:
return pulumi.get(self, "parameters")
@parameters.setter
def parameters(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ServiceSpecParametersArgs']]]]):... | |
= fake_calls[:]
# set testing
self.for_testing = isinstance(test_size, int)
# setup driver type
self.driver_type = driver_type
# and pinned
self.use_pinned = use_pinned
# mark owners
self.owner = None
# validation
self.for_validation = False
def __mark(dep):
for x in dep.depends_on:
x.owner = dep
__mark(... | |
# Controller.py
# author: <NAME>
# Adapted from <NAME>' code here: http://pydoc.net/Python/jaraco.input/1.0.1/jaraco.input.win32.xinput/ under the MIT licence terms
# last update: 8/14/2018
# Description:
# Provides XBOX controller interface to communicate with DeepNNCar
# BUTTON LAYOUT
# Right trigger => accele... | |
vocab_size : int
The vocabulary size.
Examples
--------
>>> train_data, valid_data, test_data, vocab_size = tl.files.load_ptb_dataset()
References
---------------
- ``tensorflow.models.rnn.ptb import reader``
- `Manual download <http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz>`__
Notes
------
... | |
'''
Segmentation of handtools from Handtool dataset using Mask R-CNN.
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>:
Estimating 3D Motion and Forces of Person-Object Interactions from Monocular Video,
CVPR 2019.
https://arxiv.org/abs/1904.02683
<NAME>, 2019-2021
Intelligent Machine Perception Project (IMPACT)
http:/... | |
element
:param words: Words to speak
:param kwargs: additional attributes
:returns: <P> element
"""
return self.p(words=words, **kwargs)
def phoneme(self, words, alphabet=None, ph=None, **kwargs):
"""
Create a <Phoneme> element
:param words: Words to speak
:param alphabet: Specify the phonetic alphabet
:... | |
# write a python program to multiply three numbers
num1 = 1.5
num2 = 6.3
num3 = -2.3
product = num1 * num2 * num3
print(f'Product: {product}')
# write a python function that when given two numbers, would divide the first number by second number and return the quotient and remainder
def divide_first_number_by_second(n... | |
from __future__ import print_function
import json
import time
import math
import sys
import os
import traceback
from hashlib import sha1
from tempfile import NamedTemporaryFile
from multiprocessing import Process, Queue
from itertools import starmap, chain, islice
from boto3.s3.transfer import TransferConfig
try:
#... | |
<reponame>yutiansut/pika
# Disable warning Missing docstring
# pylint: disable=C0111
# Disable warning Invalid variable name
# pylint: disable=C0103
# Suppress pylint warning about access to protected member
# pylint: disable=W0212
# Suppress no-member: Twisted's reactor methods are not easily discoverable
# pylint:... | |
<reponame>ArcGIS/public-transit-tools
############################################################################
## Tool name: BetterBusBuffers - Count Trips at Stops by Route and Direction
## Created by: <NAME>, https://github.com/d-wasserman and <NAME>, Esri
## This tool was developed as part of Transit R&D Efforts... | |
{'REGISTER', 'UNDO'}
def execute(self, context):
ob = get_last_object() # returns tuple with list and last cloth objects or None
if not ob: return {'CANCELLED'}
for i, pin in reversed(list(enumerate(ob[1].mclo.pins))):
bpy.data.objects.remove(pin.hook)
ob[1].mclo.pins.remove(i)
bpy.context.scene.objects.acti... | |
excl += Outputs.template_nonsmooth
if 'raw' not in cfg.post_processing['z-scoring']['output']:
excl += Outputs.native_raw
excl += Outputs.template_raw
if not cfg.pipeline_setup['output_directory']['write_debugging_outputs']:
substring_excl.append(['desc-reginput', 'bold'])
excl += Outputs.debugging
for resou... | |
import bisect
from copy import deepcopy
from Bio.Seq import Seq
from mutalyzer_crossmapper import Coding, Genomic, NonCoding
from mutalyzer_mutator.util import reverse_complement
from ..description_model import (
variant_to_description,
variants_to_description,
yield_sub_model,
)
from ..reference import (
extract... | |
# -*- coding: utf-8 -*-
# Licensed under The MIT License
#
# Parses layour DXF file format.
import dxfgrabber
import sys
class _Line(object):
def __init__(self, start, end):
self._start = start
self._end = end
def _get_other_end(self, c):
if c == self._start:
return self._end
if c == self._end:
return self... | |
<reponame>SongweiGe/DoodlerGAN
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import cv2
import torch
import numpy as np
import argparse
import torchvision
from PIL import Image
fr... | |
<reponame>TolaAbiodun/pyavo
# -*- coding: utf-8 -*-
"""
Class for modelling fluid properties for gas, oil and brine saturated sands.
References: Wang(2001), Batzle and Wang(1992), Geophysics.
"""
import warnings
import math
from typing import Union
warnings.filterwarnings("ignore")
def k_rho_matrix(v_cly: float, k... | |
<filename>tests/st/ops/cpu/test_resize_bilinear_op.py<gh_stars>1000+
# Copyright 2020-2021 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.o... | |
'1607865':{'en': 'Walton, NY'},
'1607869':{'en': 'Ovid, NY'},
'1607898':{'en': 'Groton, NY'},
'1607936':{'en': 'Corning, NY'},
'1607937':{'en': 'Corning, NY'},
'1607962':{'en': 'Corning, NY'},
'1607965':{'en': 'Edmeston, NY'},
'1607967':{'en': 'Bainbridge, NY'},
'1608':{'en': 'Wisconsin'},
'1608204':{'en': 'Ma... | |
bad commit
return render(request, 'deploys/all_history.html', {
"deploy_summaries": [],
"filter_title": filter_title,
"pageIndex": index,
"pageSize": size,
"from_date": from_date,
"from_time": from_time,
"to_date": to_date,
"to_time": to_time,
"commit": commit,
"repo": repo,
"branch": branch,
"reverse_date... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.