input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
self.assertEqual(type(i), Set(str))
def test_set_listof_tupleof_constructors(self):
s1 = Set(int)(ListOf(int)([1, 1]))
self.assertEqual(len(s1), 1)
s2 = Set(int)(TupleOf(int)((1, 1)))
self.assertEqual(len(s2), 1)
def test_list_of_tuples_transpose(self):
listOfTuples = ListOf(NamedTuple(x=int, y=str, z=bool))(... | |
tracking any tibia worlds.")
return
if params is None:
yield from self.bot.say(invalid_arguments)
return
entries = []
online_entries = []
ask_channel = get_channel_by_name(self.bot, ask_channel_name, ctx.message.server)
if ctx.message.channel.is_private or ctx.message.channel == ask_channel:
per_page = 20
... | |
and not self.__is_exported(root, self.module):
continue
fullname = '%s.%s' % (self.name, root)
m = _safe_import(fullname)
if m is None:
continue
self.doc[root] = self.__new_submodule(root, m)
# Now see if we can grab inheritance relationships between classes.
for docobj in self.doc.values():
if isinstance(do... | |
<gh_stars>1-10
from product_info import *
from scipy.stats import kurtosis
from scipy.stats import skew
## path of our program
#HEAD_PATH = "/mnt/hgfs/intern"
HEAD_PATH = '/Users/sean/Desktop/Plan B/Quant/week1'
## path of data
DATA_PATH = HEAD_PATH + "/pkl tick/"
## path of the day-to-night data set
NIGHT_PATH = H... | |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 8 11:40:54 2020
@author: <NAME>
Sept 19, 2021: altered to work with new qray.py
wherein Qvector.xyz is a property
"""
class Polyhedron:
"""
Designed to be subclassed, not used directly
"""
def scale(self, scalefactor):
if h... | |
#!/usr/bin/env python
from numpy import *
from numpy import f2py # not part of import *
from scitools.StringFunction import StringFunction
import time, sys, os
# make sys.path so we can find Grid2D.py:
sys.path.insert(0, os.path.join(os.environ['scripting'],
'src','py','examples'))
from Grid2D import Grid2D
try:
imp... | |
CSV precinct-index file.
"""
DISTRICT_HEADERS = ("Assembly", "BART", "Congressional", "Senatorial", "Supervisorial")
name = "Precinct Index File"
def __init__(self):
self.areas_info = AreasInfo()
def get_parse_return_value(self):
return self.areas_info
def parse_first_line(self, line):
# Skip the header ... | |
<filename>ex05/my_RBM_tf2.py
import tensorflow as tf
import numpy as np
import datetime
import math
import sys
from tqdm import tqdm
import random
import matplotlib.pyplot as plt
import deepdish as dd
'''
class monitoring():
def reconstruction_cross_e():
def ava_sq_error():
def pseudo_log_l():
'''
class RB... | |
#Copyright 2011 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 10 16:04:15 2019
@author: annaquinlan
Github URL: https://github.com/tidepool-org/Loop/blob/
8c1dfdba38fbf6588b07cee995a8b28fcf80ef69/Loop/Managers/LoopDataManager.swift
"""
# pylint: disable=R0913, R0914, W0105, C0200, R0916
from datetime import t... | |
10) + " MASK=0x1").splitlines()) != 0:
raise Exception("Unexpected RANGE=2-10 result")
if len(dev[0].request("BSS RANGE=0-" + str(int(id2) + 10) + " MASK=0x1").splitlines()) != 2:
raise Exception("Unexpected RANGE=0-10 result")
if len(dev[0].request("BSS RANGE=" + id1 + "-" + id1 + " MASK=0x1").splitlines()) != 1:
... | |
# Copyright 2018-2021 Arm Limited.
# SPDX-License-Identifier: Apache-2.0
#
# 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 ... | |
# Copyright 2014 Violin Memory, 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 by applicable la... | |
variation for inter-arrival time distribution
cs2 : float
squared coefficient of variation for service time distribution
Returns
-------
float
approximation for intermediate term z (see Eq 3.6)
"""
z = (ca2 + cs2) / (1.0 + cs2)
return z
def _ggm_prob_wait_whitt_gamma(m, rho, z):
"""
Equation 3.5 on p13... | |
import numpy as np
import h5py
import argparse
import sys
import re
ordered = []
overrides = {}
label_map = {}
description_map = {}
units_map = {}
tao_bandpass_name = {}
delimiters = "<",">"
regexPattern = '|'.join(map(re.escape, delimiters))
def parse_keywords(line):
keywords = {}
rest = line
pos1 = rest.find('='... | |
#!/usr/bin/env python3
# coding: utf-8
import sys
import re
import logging
import json
import asyncio
from http import HTTPStatus
from copy import deepcopy
from os import path
from collections import namedtuple
from itertools import takewhile
from tornado.ioloop import IOLoop
from tornado.web import Application, Reque... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Operations on genomic intervals stored in GTF file
note:
- all the exons of a gene should be on the same strand. Genes with exons trans-
spliced from the other strand, like mod(mdg4) in D. melanogaster, should be
excluded (before or after).
- stop codon is not part of the CDS,... | |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
"""
Check if an operat... | |
# coding: utf-8
u"""Этот модуль содержит главный класс библиотеки и набор actions для него."""
from __future__ import absolute_import
import copy
import datetime
import json
import warnings
import six
from django.core import exceptions as dj_exceptions
from django.db.models import fields as dj_fields
from django.uti... | |
TypeError('takes %d positional arguments but %d were given' %
(len(tree.args.args), len(args)))
# variable length args
if rest_args:
baseobj = tree.args.vararg
argname = (baseobj.id
if isinstance(baseobj, ast.Name) # python 2
else baseobj.arg) # python 3
self.setVarargBind(argname, rest_args)
# kwargs
for p... | |
<filename>email_router/email_router_datastore.py
import os
import datetime
import logging
import json
import re
from netaddr import IPNetwork, IPAddress
from netaddr.core import AddrConversionError, AddrFormatError
from dateutil.parser import parse
from pytz import timezone
from typing import NamedTuple, Optional, Co... | |
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
from datetime import datetime
from os import mkdir
from sklearn.preprocessing import OrdinalEncoder, KBinsDiscretizer
import concurrent
# import cProfile
from statistics import mean
# from math import factorial
# from tqdm import tqdm
... | |
tuple.size();
node.arity = len(tuple)
# node.node_data = py::reinterpret_borrow<py::object>(tuple.get_type());
node.node_data = type(tuple)
# for (py::handle entry : tuple) {
# recurse(entry);
# }
for entry in tuple:
# recurse(entry)
self.flatten_into(entry, leaves, leaf_predicate)
# break;
# }
# default:
... | |
<filename>SVGPs/kernels.py
# Copyright 2016 <NAME>, alexggmatthews
#
# 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 applic... | |
remove_indexes.append(idx_in_list)
continue
#
# If the RecvUpcall is a tunnel port, we can not map it to
# the correct tunnel. For now, we assume the first matching
# packet is the correct one. For more details see the OVS
# ukey_to_flow_netdev() function.
#
if (event.dp_port == recv.dp_port or
recv.dp_port ==... | |
<filename>src/python/pants/binaries/binary_util.py
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import argparse
import logging
import os
import posixpath
import shutil
import sys
from abc import abstractmethod
from contextlib import ... | |
m.x1341 + m.x1729 + m.x1923 >= 0)
m.c1681 = Constraint(expr= m.x1342 + m.x1730 + m.x1924 >= 0)
m.c1682 = Constraint(expr= m.x1343 + m.x1731 + m.x1925 >= 0)
m.c1683 = Constraint(expr= m.x1344 + m.x1732 + m.x1926 >= 0)
m.c1684 = Constraint(expr= m.x1345 + m.x1733 + m.x1927 >= 0)
m.c1685 = Constraint(expr= m.x1346 + ... | |
from __future__ import print_function
# logging
import logging
log = logging.getLogger(__name__)
# stdlib
import datetime
import json
import pdb
# pypi
import sqlalchemy
# localapp
from ... import lib
from .. import errors
from .. import utils
from ...model import utils as model_utils
from ...model import objects ... | |
# @Time : 2022/1/1
# @Author : <NAME>
# @email : <EMAIL>
import ipdb
import math
import torch
import numpy as np
import torch.nn.functional as F
from loguru import logger
from torch import nn
import os
from crslab.model.base import BaseModel
from crslab.model.utils.modules.info_nce_loss import info_nce_loss
from crsl... | |
#!/usr/bin/env python
# MIT License
# Copyright (c) 2018 <NAME> (@disloops)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | |
aggregate_to_count
```
This command transforms the output of an aggregation query to the output of the count command.
```
{ "group": { "name": "group_name" }, "count": 123 } --> group_name: 123
```
Expected group key: `name`
Expected function key: `count`
It is usually not invoked directly but automatically ... | |
<gh_stars>1-10
# Copyright (C) 2018 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# MIT license.
#
"""
Karstnet
========
Karstnet is a Python package for the analysis of karstic networks.
License
-------
Released under the MIT license:
Copyright (C) 2018 Karstnet Developers
<NAME> <<EMAIL>>
<NAME... | |
<filename>corehq/apps/domain/forms.py<gh_stars>0
import datetime
import io
import json
import logging
import uuid
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import SetPasswordForm
from djang... | |
self.opt_kwargs
Attributes
----------
num_pix : Int
The number of pixels of the residuals used to calculate J.
Methods
-------
set_params(new_param_names, new_damping=None)
Change the parameter names to optimize.
reset(new_damping=None)
Resets counters etc to zero, allowing more runs to commence.
See Also... | |
#
# Copyright (c) 2020 Pangeanic SL.
#
# This file is part of NEC TM
# (see https://github.com/shasha79/nectm).
#
# 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 owner... | |
# $Id: testWebBrick.py 533 2006-01-23 21:44:46Z graham $
#
# Integration testing for WebBrick hardware unit
# See http://pyunit.sourceforge.net/pyunit.html
#
# NOTE: this is not strictly a unit test, in that it requires a WebBrick to be
# available at the specified IP address
import sys, time, logging
# impor... | |
<filename>ding/model/wrapper/model_wrappers.py<gh_stars>0
from typing import Any, Tuple, Callable, Optional, List
from abc import ABC
import numpy as np
import torch
from ding.torch_utils import get_tensor_data
from ding.rl_utils import create_noise_generator
from torch.distributions import Categorical
class IModelW... | |
from the selected entry)
# The information is useful at the stage of applying quantitative normalization
eline_calib = pqa.get_calibrations_selected(<emission_line>)
# Get calibration data on all emission lines as a list of dictionaries (the function
# calls 'get_calibrations_selected' for each emission line in the... | |
# Copyright (C) 2009 The MITRE Corporation. See the toplevel
# file LICENSE for license terms.
# Readers and writers for documents.
import sys, codecs, re
# I started out with cjson, but it turns out that cjson
# doesn't decode "\/" correctly. So I've switched to
# simplejson. simplejson also appears to do the right... | |
<filename>src/api/tests/test_teams.py
from django.test import TestCase, Client
from django.conf import settings as django_settings
from urllib.parse import urlencode
from _main_.settings import BASE_DIR
from _main_.utils.massenergize_response import MassenergizeResponse
from database.models import Team, Community, User... | |
from gym import spaces
import numpy as np
class Building:
def __init__(self, buildingId, dhw_storage = None, cooling_storage = None, heating_storage = None, electrical_storage = None, dhw_heating_device = None, hvac_device = None, save_memory = True):
"""
Args:
buildingId (int)
dhw_storage (EnergyStorage... | |
# -*- coding: utf-8 -*-
#
#
# Brainbow segmentation Python XTension
#
# <CustomTools>
# <Menu name = "Brainbow plugins">
# <Item name="Brainbow PCA segmentation (Three component selection)" icon="Python" tooltip="Brainbow segmentation based on PCA.">
# <Command>PythonXT::XTBB(%i)</Command>
# </Item>
# </Menu... | |
"""!
@brief SNR losses efficient computation in pytorch.
@author <NAME> {<EMAIL>}
@copyright University of illinois at Urbana Champaign
"""
import torch
import torch.nn as nn
import itertools
from torch.nn.modules.loss import _Loss
class FixedMixIT1Source2NoisesSNRwithZeroRefs(nn.Module):
"""!
Class for SNR comput... | |
True
assert "Unexpected input for value_range" in str(e)
assert got_exception == True
def test_parameters_handle_probability_param():
for val in [True, False, 0, 1, 0.0, 1.0]:
p = iap.handle_probability_param(val, "[test1]")
assert isinstance(p, iap.Deterministic)
assert p.value == int(val)
for val in [0.0001... | |
# We need to use absolute_import so we can load the coinbase pip module without
# conflicting with our filename of coinbase.py.
from __future__ import absolute_import
import os
import base64
from collections import OrderedDict
import hashlib
import hmac
import json
import time
import urllib
from cdecimal import Decima... | |
import os
import pathlib
from datetime import datetime
import shutil
import fmpy
from fmpy import *
import yaml
import re
from typing import Any, Dict, List, Union
SIM_CONFIG_NAME_f = lambda model_fp: model_fp.replace(".fmu", "_conf.yaml")
# [TODO] dynamically read FMI version from modelDescription.xml
# ("1.0", "... | |
não especificadas - local não especificado'),
('W65.0', 'Afogamento e submersão durante banho em banheira - residência'),
('W65.1', 'Afogamento e submersão durante banho em banheira - habitação coletiva'),
('W65.2', 'Afogamento e submersão durante banho em banheira - escolas, outras instituições e áreas de administr... | |
<filename>ZCU111/packages/xsdfec/pkg/xsdfec/__init__.py
# Copyright (c) 2019, Xilinx, 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:
#
# 1. Redistributions of source code must retain the abo... | |
# dtrradarsim.py - NIST DTR Radar Target Simulator
#
# By <NAME> III
# Start Date: February 28, 2017
# Completed: March 11, 2017 (update on March 22, 2017)
# This program is used run simulations of vehicles using a graphical user interface (GUI) for testing handheld speed cameras (radar guns) for accuracy read... | |
#!/usr/bin/env python
# coding: utf-8
# # Adding a New Dataset
#
# There exist two different options to use a different dataset within the `neuralHydrology` library.
#
# 1. Preprocess your data to use the `GenericDataset` in `neuralhydrology.datasetzoo.genericdataset`.
# 2. Implement a new dataset class, inheriting ... | |
<reponame>to-aoki/my-pytorch-bert
# coding=utf-8
#
# Author <NAME>
# This file is based on
# https://github.com/huggingface/pytorch-pretrained-BERT/blob/master/examples/run_lm_finetuning.py.
# This uses the part of BERTDataset.
#
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyr... | |
delta_sync_golem__FPC9TCmdGolemiUc(struct TCmdGolem *pG, int pnum, unsigned char bLevel)")
del_items(0x80048A78)
SetType(0x80048A78, "void delta_leave_sync__FUc(unsigned char bLevel)")
del_items(0x80048CD0)
SetType(0x80048CD0, "void delta_sync_object__FiUcUc(int oi, unsigned char bCmd, unsigned char bLevel)")
del_items... | |
'num_items: ', len(files))
json_list.update({'folders': folders_list, 'files': file_list, 'positions': position_list,
'numerical_values': numerical_list})
self.json_dict = json_list
class Voc2012FilelistCreator(FilelistCreator):
"""Class to create the Pascal Voc 2012 file list"""
def __init__(self, *args, **kwa... | |
arbitraty documents (module, examples files) that cannot be parsed by Numpydoc,
as well as link to external references, like images generated.
"""
@classmethod
def _deserialise(cls, **kwargs):
# print("will deserialise", cls)
try:
instance = cls._instance()
except Exception as e:
raise type(e)(f"Error deseria... | |
# Databricks notebook source
# This creates the "team_name" field displayed at the top of the notebook.
dbutils.widgets.text("team_name", "Enter your team's name");
# COMMAND ----------
team_name = dbutils.widgets.get("team_name")
setup_responses = dbutils.notebook.run("./includes/flight_school_assignment_3_setup",... | |
cur.image = image
cur.rect = cur.image.get_rect()
pygame.mouse.set_visible(False)
font_type = pygame.font.Font(load_font('font.ttf'), 40)
label = font_type.render('Миссии', True, (255, 255, 255))
screen.blit(label, (WIDTH // 2 - label.get_width() // 2, 0))
stage_of_open_box = 1
sprites_of_particles = pygame.spri... | |
"Name",
key="name",
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
attach_popup=False ),
RepositoryGrid.DescriptionColumn( "Synopsis",
key="description",
attach_popup=False ),
RepositoryGrid.TypeColumn( "Type" ),
RepositoryGrid.MetadataRevisionColumn( "Metadata<br/>Revisions" )... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 2 23:00:44 2021
@author: carl
"""
import os.path
import numpy as np
import h5py
import csv
import traceback
import time
from .spectraldata import SpectralData
class DecompositionData(SpectralData):
"SpectralData with addition of ROI/decompositio... | |
<gh_stars>0
from __future__ import division
#import urllib2
import os,sys
import numpy as np
import pandas as pd
from collections import defaultdict
from sklearn import feature_extraction
from sklearn import preprocessing
from random import seed, shuffle
import utils as ut
import funcs_disp_mist as fdm
import time
SEE... | |
"""
self.ResourceId = None
self.Resource = None
self.Value = None
self.Percentage = None
self.BillingValue = None
self.BillingPercentage = None
def _deserialize(self, params):
self.ResourceId = params.get("ResourceId")
self.Resource = params.get("Resource")
self.Value = params.get("Value")
self.Percentage ... | |
response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_supported_cultures.metadata = {'url': '/apps/cultures'}
def download_query_logs(
self, app_id, custom_headers=None, raw=False, callback=None, **operation_config):
"""Gets the ... | |
196,
243,
236,
234,
215,
217,
224,
245,
225,
220,
247,
230,
247,
213,
246,
228,
233,
207,
224,
256,
201,
222,
211,
245,
218,
227,
240,
197,
256,
195,
208,
257,
230,
222,
239,
222,
203,
198,
225,
205,
235,
204,
264,
243,
231,
235,
221,
258,
239,
216,
260,
237,
216,
23... | |
function of time, but not of stage position
Stage is set to a position shortly after the timezero (GUI value)
"""
self.initializeStage()
position = self.stage.calcStageWay(MeasParams['timeZero'] +
MeasParams['timeoverlapp'])
self.stage.moveStage(position)
self.measureMOContrast()
def update(self):
"""
Updat... | |
= Var(within=Reals,bounds=(0,None),initialize=0)
m.x597 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x598 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x599 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x600 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x601 = Var(within=Reals,bounds=(0,None),initi... | |
client.setExplain(PacketPokerExplain.ALL)
self.assertTrue(table.joinPlayer(client, reason="MockCreatePlayerJoin"))
self.assertTrue(table.seatPlayer(client, pos))
self.assertTrue(table.buyInPlayer(client, table.game.maxBuyIn()))
table.game.noAutoBlindAnte(serial)
if should_sit:
clients[serial] = client
table.sitP... | |
# -*- coding:utf-8 -*-
"""
Copyright (c) 2013-2016 SYPH, All Rights Reserved.
-----------------------------------------------------------
Author: S.JunPeng
Date: 2016/12/22
Change Activity:
_==/ i i \==_
/XX/ |\___/| \XX\
/XXXX\ |XXXXX| /XXXX\
|XXXXXX\_ _XXXXXXX_ _/XXXXXX|
XXXXXXXXXXXxxxxxxxXXXXXXXXXXXxxxxxx... | |
#!/usr/bin/python
import glob
import functools
import os
import sys
import engine
def cache(f):
"""A decorator to cache results for a given function call.
Note: The caching is only done on the first argument, usually "self".
"""
ret = {}
def _Wrapper(*args, **kwargs):
self = args[0]
if self not in ret:
ret[... | |
<reponame>imranq2/SparkAutoMapper.FHIR<filename>spark_auto_mapper_fhir/value_sets/common_ucum_units.py
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined... | |
<gh_stars>10-100
#!/usr/bin/env python3
import configargparse
import os.path
import numpy as np
try:
import CIAlign.utilityFunctions as utilityFunctions
from CIAlign._version import __version__
except ImportError:
import utilityFunctions
from _version import __version__
def float_range(mini, maxi):
'''
Defines... | |
range (1, min((7-i), j)+1):
if game.board[i+k][j-k].islower():
break
switchPos((position[0], position[1]), (position[0]+k, position[1]-k), game)
if not isBKingChecked(game, 1):
validMoves.append((position[0]+k, position[1]-k))
switchPos((position[0]+k, position[1]-k), (position[0], position[1]), game)
if not ga... | |
is installed
installed = False
for ik in self.installed_keys["keys"]:
if (fk["fingerprint"] == ik["fingerprint"] and
fk["type"] == ik["type"] and
fk["key_capabilities"] == ik["key_capabilities"]
):
self._vv("fingerprint [{}] already installed".format(fk["fingerprint"]))
keyinfo["keys"][index]["state"] = "presen... | |
field `Relative Humidity Fraction 6`"""
self["Relative Humidity Fraction 6"] = value
@property
def moisture_content_6(self):
"""field `Moisture Content 6`
| Units: kg/m3
Args:
value (float): value for IDD Field `Moisture Content 6`
Raises:
ValueError: if `value` is not a valid value
Returns:
float: the ... | |
= client.update_connection_profile(request)
# Establish that the underlying gRPC stub method was called.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0] == clouddms.UpdateConnectionProfileRequest()
# Establish that the response is the type that we expect.
assert isinstance(respon... | |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""
Class for reading and writing casa measurement sets.
Requires casacore.
"""
import numpy as np
import os
import warnings
import astropy.time as time
from .uvdata import UVData
from ... | |
r"""
Kleber tree
A Kleber tree is a tree of weights generated by Kleber's algorithm
[Kleber1]_. The nodes correspond to the weights in the positive Weyl chamber
obtained by subtracting a (non-zero) positive root. The edges are labeled by
the coefficients of the roots of the difference.
AUTHORS:
- <NAME> (2011-05-03)... | |
#!/usr/bin/env python
#pylint: disable=line-too-long
'''in_use_do_not_archive
main_mech.py
Causal Cognitive Architecture 3 (CCA3)
June 2021 full rewrite (all previous code deprecated)
Oct 2021 CCA3 Binding Solution paper demonstration version
Note: Where you see "cca3.py" the module for the demonstration v... | |
"""
Test the quality of inference, measured by num edges + num mutations, and (if
using simulated data) the KC distance
"""
import os.path
import argparse
import collections
import itertools
import multiprocessing
import re
import time
import logging
import json
import msprime
import tskit
import numpy as np
import st... | |
<gh_stars>0
# -*- coding: UTF-8 -*-
#加载所有插件
import glob
import importlib
import os
import traceback
import functools
from inspect import getgeneratorstate
from pluginsinterface.TypeExtension import PlugMsgTypeEnum, PlugMsgReturn
from pluginsinterface.EventHandling import StandEven
from pluginsinterface.PlugSession impo... | |
<reponame>jschueller/seacas
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain righ... | |
<reponame>MichaelLenghel/Automatic_Stance_Detection_In_Media
import os
import re
import pickle
from pprint import pprint
# NLP libraries
import gensim
import gensim.corpora as corpora
from gensim.test.utils import datapath
from gensim.utils import lemmatize, simple_preprocess
from gensim.models import CoherenceModel, ... | |
read in in_file:
bc = tk_io.get_read_barcode(read)
this_bc_reads = bc_reads.setdefault(bc, [])
this_bc_reads.append(read)
sorted_bcs = sorted(bc_reads.keys())
for bc in sorted_bcs:
for read in bc_reads[bc]:
out_file.write(read)
else:
# Store the file offset locations (in bytes) by bc
bc_locs = {}
file_offs... | |
nodes
running the Apache Airflow software.
Attributes:
location (str):
Optional. The Compute Engine
`zone </compute/docs/regions-zones>`__ in which to deploy
the VMs used to run the Apache Airflow software, specified
as a `relative resource
name </apis/design/resource_names#relative_resource_name>`__.
For exa... | |
range=(0, self.height),
normed=normalize)
ret = None
if forPlot:
# for using matplotlib bar command
# bin labels, bin values, bin width
ret = (hist[1][0:-1], hist[0], self.height / bins)
else:
ret = hist[0]
return ret
def horizontal_histogram(self, bins=10, threshold=128, normalize=False,
forPlot=False):
i... | |
a line in rootLayer
>>> self.moveElement(line2,[10,10]) # moves line2 DeltaX=10, DdeltaY=10
>>> self.moveElement(groupA,[10,-10]) # moves line2 DeltaX=10, DdeltaY=-10
"""
if distance == 0:
return
transfString = ''
if 'transform' in element.attrib:
transfString = element.attrib['transform']
# if transform a... | |
from pioneer.common import linalg
from pioneer.common.platform import parse_datasource_name
from pioneer.common.gui import utils
from pioneer.common.video import VideoRecorder, RecordableInterface
from pioneer.das.api import categories, lane_types
from pioneer.das.api.platform import Platform
from pioneer.das.api.sampl... | |
success
self.e = e
def read(self, iprot):
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.rea... | |
data has changed.\n\nSave?'
dialog = gtk.MessageDialog(None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_ERROR,
gtk.BUTTONS_NONE,
message)
dialog.add_buttons(
gtk.STOCK_YES, gtk.RESPONSE_YES,
'_Discard', 1,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
)
response = dialog.run()
dialog.destroy()
... | |
"thePed": """: The ped whose vehicle seat youre looking up. """
},
result='* returns an integer containing the number of the seat that the ped is currently in:\n** 0: front-left\n** 1: front-right\n** 2: rear-left\n** 3: rear-right\nreturns false if the ped is on foot, or the ped doesnt exist.' ,
),
url='getPedOccu... | |
from dataclasses import dataclass
from enum import Enum
from typing import Callable, Iterator, Sequence, Text, Union
from collections import deque
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction import DictVectorizer
@dataclass()
class ... | |
<reponame>SomeoneSerge/trieste
# Copyright 2020 The Trieste Contributors
#
# 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 ... | |
starttime) *
self.stats.sampling_rate, 7))) * -1
# Adjust starttime only if delta is greater than zero or if the values
# are padded with masked arrays.
if delta > 0 or pad:
self.stats.starttime += delta * self.stats.delta
if delta == 0 or (delta < 0 and not pad):
return self
elif delta < 0 and pad:
try:
gap ... | |
outputs
class MRResizeInputSpec(MRTrix3Base):
in_file = File(
exists=True,
argstr='%s',
position=-2,
mandatory=True,
desc='input image to be resized')
out_file = File(
argstr='%s',
position=-1,
mandatory=True,
desc='output image')
img_size = traits.List(
traits.Float,
argstr='-size %s',
sep=',',
posit... | |
json"
print (msj)
return response_({})
@app.route('/contrato/update', methods = ['POST'])
def api_contrato_update():
print("api_contrato_update")
if request.headers['Content-Type'] == 'application/json':
# Se recuperan datos.
datos = request.json['datos']
# Persona.
persona = ContratoPersona(__CON... | |
<filename>magick.py
from binascii import crc32
from errno import ESRCH
from fcntl import fcntl, F_GETFL, F_SETFL
import logging
import os.path
from os import O_NONBLOCK
from subprocess import Popen, PIPE
from tornado.ioloop import IOLoop
from urlparse import urlparse
# Text 'stylesheets'
__all__ = ["ImageMagick", "is_... | |
\
import JSONSchemaValidatorCfbd3870405AAd55 \
as JSONSchemaValidatorCfbd3870405AAd55_v1_3_1
from .validators.v1_3_1.jsd_d09b08a3447aa3b9 \
import JSONSchemaValidatorD09B08A3447AA3B9 \
as JSONSchemaValidatorD09B08A3447AA3B9_v1_3_1
from .validators.v1_3_1.jsd_d0a1abfa435b841d \
import JSONSchemaValidatorD0A1Abfa435... | |
def __call__(self, string):
return IntegerRangeType(1, 7450 if self.gib else 8000)(string)
def SolidFireMinIOPSType(string):
return IntegerRangeType(50, 15000)(string)
def SolidFireMaxIOPSType(string):
return IntegerRangeType(100, 100000)(string)
def SolidFireBurstIOPSType(string):
return IntegerRangeType(100, 1... | |
<gh_stars>1-10
import warnings
from math import isnan
import numpy as np
from scipy import integrate
from ross.fluid_flow.fluid_flow_geometry import move_rotor_center
def calculate_oil_film_force(fluid_flow_object, force_type=None):
"""This function calculates the forces of the oil film in the N and T directions, ... | |
E501
local_var_params['sim_version'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `sim_version` when calling `sim_version_get_downloads`") # noqa: E501
collection_formats = {}
path_params = {}
if 'sim_version' in local_var_params:
path_params['simVersion'] = local_var_params['sim_v... | |
& (
signal_data_frame.values < 0)
# stop loss for buys
ind3 = (asset_data_frame.values < (asset_df_copy.values + stop_loss_df.values)) & (signal_data_frame.values > 0)
# stop loss for sells
ind4 = (asset_data_frame.values > (asset_df_copy.values - stop_loss_df.values)) & (signal_data_frame.values < 0)
# when h... | |
<filename>source/plugins/deployer.py<gh_stars>0
import sys
import os
import stat
import copy
parent_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(1, parent_dir)
import config
from util import print_help_line, get_real_path, escape_arg, ensure_json_exists, load_json, save_json, dic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.