input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
1),('qu', 4),
('qi', 1),('qi', 1),('man', 3),('bie', 2),('qing', 2),
]),
(5,[('lv', 2),('guan', 3),('wu', 2),('liang', 2),('ban', 4),
('ning', 2),('qing', 2),('zi', 4),('qiao', 3),('ran', 2),
('han', 2),('deng', 1),('si', 1),('jiu', 4),('shi', 4),
('duan', 4),('yan', 4),('jing', 3),('chou', 2),('mian', 2),
('yuan... | |
Hubei', 'zh': u('\u6e56\u5317\u7701\u9ec4\u77f3\u5e02')},
'861840715':{'en': 'Xianning, Hubei', 'zh': u('\u6e56\u5317\u7701\u54b8\u5b81\u5e02')},
'861860736':{'en': 'Changde, Hunan', 'zh': u('\u6e56\u5357\u7701\u5e38\u5fb7\u5e02')},
'861860737':{'en': 'Yiyang, Hunan', 'zh': u('\u6e56\u5357\u7701\u76ca\u9633\u5e02')}... | |
<gh_stars>0
# Copyright (c) 2019 Siemens AG
#
# 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
# use, copy, modify, merge, publi... | |
# Lint as: python3
# Copyright 2016-2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
<gh_stars>0
import argparse
import csv
import json
from collections import OrderedDict
from glob import glob
import altair
from core_data_modules.cleaners import Codes
from core_data_modules.logging import Logger
from core_data_modules.traced_data.io import TracedDataJsonIO
from core_data_modules.util import IOUtils
f... | |
-> lvar_saved_info_t
find(self, x) -> lvar_saved_info_t
"""
return _ida_hexrays.lvar_saved_infos_t_find(self, *args)
def has(self, *args):
"""
has(self, x) -> bool
"""
return _ida_hexrays.lvar_saved_infos_t_has(self, *args)
def add_unique(self, *args):
"""
add_unique(self, x) -> bool
"""
return _ida_hexr... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Simulates coupled Wendling neural mass models with and without periodic stimuli to main EXC cells,
changing parameters (EXC/A, SDI/B or coupling gain/K) to bring population activity towards the ictal state.
Features are extracted throughout each simulation - trends in t... | |
ps, compact):
return cls.format_RRY("Yields", ps)
@classmethod
def format_Returns(cls, ps, compact):
return cls.format_RRY("Returns", ps)
@classmethod
def format_Attributes(cls, ps, compact):
return cls.format_RRY("Attributes", ps)
@classmethod
def format_RRY(cls, name, ps):
out = name + "\n"
out += "-" *... | |
<gh_stars>0
import os
import time
from datetime import datetime
from redisearch import Client, TextField
import paramiko
from uuid import uuid1
from django.core.paginator import Paginator
from fdfs_client.client import Fdfs_client
from rest_framework.response import Response
from rest_framework.views import APIView
fr... | |
datasets
"""
sql += """
from acquisition
join satellite on satellite.satellite_id=acquisition.satellite_id
"""
sql += """
join
(
select
dataset.acquisition_id, tile.dataset_id, tile.x_index, tile.y_index, tile.tile_pathname, tile.tile_type_id, tile.tile_class_id
from tile
join dataset on dataset.dataset_i... | |
> 1000 * 3600 * 24 * 30 * 3
current = 1
while True:
client_params = {
'asset': asset,
'current': current,
'startTime': latest_time + 1000,
'archived': archived,
'size': 100
}
if isolated_symbol is not None:
client_params['isolatedSymbol'] = isolated_symbol
repays = self._call_binance_client('get_margin_repa... | |
compatible with the
# transfer start time
if e < 1:
# elliptical case
eccAnomEscape = 2*math.atan(math.tan(thetaEscape/2) / \
math.sqrt((1+e) / (1-e)))
dMeanAnom = eccAnomEscape - e*math.sin(eccAnomEscape)
else:
# hyperbolic case
hypAnomEscape = math.copysign( \
math.acosh((math.cos(thetaEscape)+e)... | |
== cls.onedotenleader:
return "onedotenleader"
elif sid == cls.zerooldstyle:
return "zerooldstyle"
elif sid == cls.oneoldstyle:
return "oneoldstyle"
elif sid == cls.twooldstyle:
return "twooldstyle"
elif sid == cls.threeoldstyle:
return "threeoldstyle"
elif sid == cls.fouroldstyle:
return "fouroldstyle"
eli... | |
Inv=Inverse_m,minlines=700,order0=89, \
ntotal=n_useful,npix=len(thar_order),nx=ncoef_x,nm=ncoef_m)
# Now calibrate COMPARISON orders. Use p1 above as p0
All_Pixel_Centers_co = np.array([])
All_Wavelengths_co = np.array([])
All_Orders_co = np.array([])
All_Centroids_co = np.array([])
All_Sigmas_co = np.array([]... | |
#
# 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
# distributed under the ... | |
<gh_stars>10-100
"""
Extracts LEGI tar archives into an SQLite DB
"""
from argparse import ArgumentParser
from collections import defaultdict
from fnmatch import fnmatch
import json
import os
import re
import libarchive
from lxml import etree
try:
from tqdm import tqdm
except ImportError:
print('[warning] tqdm is ... | |
`api_v1_object_device_ip_port_port_ssid_get`") # noqa: E501
# verify the required parameter 'port' is set
if self.api_client.client_side_validation and ('port' not in local_var_params or # noqa: E501
local_var_params['port'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `port` when call... | |
<gh_stars>0
# Crypto related utils
import math
from common_utils import *
# Dynamic check for necessary Crypto Python package
try:
from Crypto.Cipher import AES
from Crypto.Cipher import DES
from Crypto.Cipher import DES3
import hashlib, hmac
except:
print("Error: it seems that the Python Crypto package is not i... | |
r"""Train an EfficientNet classifier.
Currently implementation of multi-label multi-class classification is
non-functional.
During training, start tensorboard from within the classification/ directory:
tensorboard --logdir run --bind_all --samples_per_plugin scalars=0,images=0
Example usage:
python train_classifie... | |
<gh_stars>1-10
"""Functions that are run from the CLI to create, or edit a data package.
"""
from datetime import datetime
from itertools import chain
from pathlib import Path
import sys
from typing import Any, Dict, Iterable, List
from frictionless import Package
from glom import glom, Iter
from friendly_data impo... | |
# See LICENSE for licensing information
import ipaddress
import logging
import math
import os
import cPickle as pickle
import string
import sys
import yaml
from time import time
from copy import deepcopy
from base64 import b64decode
from twisted.internet import task, reactor, ssl
from twisted.internet.protocol impor... | |
Vrh, l_si, r_si, sv_tol=1E-10, dD_max=16, D_max=0):
dD = sp.zeros((self.N + 1), dtype=int)
BB12 = sp.empty((self.N + 1), dtype=sp.ndarray)
BB21 = sp.empty((self.N + 1), dtype=sp.ndarray)
dD_maxes = sp.repeat([dD_max], len(self.D))
if D_max > 0:
dD_maxes = sp.minimum(D_max - self.D, dD_max)
for n in range(1, se... | |
return struct.unpack('>' + fmt, self)[0]
def as_uint32(self):
return self.as_cell('L')
def as_int32(self):
return self.as_cell('l')
def as_uint64(self):
return self.as_cell('Q')
def as_int64(self):
return self.as_cell('q')
def as_str(self):
"""Unicode is supported by decoding from UTF-8"""
if self[-1] !... | |
# Copyright 2018-2021 <NAME>, alvarobartt @ GitHub
# See LICENSE for details.
import json
from datetime import date, datetime, timedelta
from random import randint
import pandas as pd
import pytz
import requests
from lxml.html import fromstring
from .constant import FUNDS_INTERVAL_FILTERS, INTERVAL_FILTERS, OUTDATED... | |
from tkinter import *
from tkinter import messagebox
import tkinter as tk
from tkinter import ttk
#IMAGENS DEFEITO: 240X240
class Tela:
def fechar(self, event):
janela.destroy()
exit()
def fecharPc(self, event):
self.lb_simulador.place_forget()
self.imgFundo.place_forget()
self.... | |
<reponame>kdart/pycopia
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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/l... | |
<filename>shared.py
#!/usr/bin/env python3
# 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.
# =============================================================================
#
# This file cont... | |
<reponame>geopm/geopm
#!/usr/bin/env python3
# Copyright (c) 2015 - 2021, Intel Corporation
#
# 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
# notic... | |
'''
Copyright (c) 2008 <NAME>, <<EMAIL>>
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 use, copy, modify, merge, publish, d... | |
<reponame>ishank011/gp-structure-search
'''
Created Nov 2012
@authors: <NAME> (<EMAIL>)
<NAME> (<EMAIL>)
<NAME> (<EMAIL>)
'''
import itertools
import numpy as np
try:
import termcolor
has_termcolor = True
except:
has_termcolor = False
try:
import config
color_scheme = config.COLOR_SCHEME
except:
color_scheme... | |
args.gradient_accumulation_steps > 1:
loss = loss / args.gradient_accumulation_steps
if args.fp16:
with amp.scale_loss(loss, optimizer) as scaled_loss:
scaled_loss.backward()
torch.nn.utils.clip_grad_norm_(amp.master_params(optimizer), args.max_grad_norm)
else:
loss.backward()
torch.nn.utils.clip_grad_norm_(mo... | |
<reponame>mchalela/arby
# - core.py -
# Copyright (c) 2020, <NAME>
# License: MIT
# Full Text: https://gitlab.com/aaronuv/arby/-/blob/master/LICENSE
"""ROM class and Gram-schmidt function."""
import logging
import numpy as np
from scipy.interpolate import splev, splrep
from .integrals import Integration
# =====... | |
import os
import sys
import traceback
import warnings
from optparse \
import \
Option
from bento.core.utils import \
pprint, find_package
from bento.core.package import \
static_representation
from bento.conv import \
distutils_to_package_description
from bento.core.pkg_objects import \
PathOption, DataFiles
f... | |
import os
import click
import logging
import palettable
import subprocess
import pdb
import math
from jenks import jenks # pip install -e "git+https://github.com/perrygeo/jenks.git#egg=jenks"
import sys
from jenks import jenks
import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
import matp... | |
import re
import traceback
import uuid
from cloudshell.cp.core.models import *
import googleapiclient.discovery
import os
from wait_operations import *
class GCPService:
def __init__(self, project, json_cred_path, logger=None):
self.project = project
self.logger = logger
self.client = None
os.environ["GOOGLE_APP... | |
<reponame>metalibm/metalibm
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2019 K... | |
0)), 1407),
AircraftApparentLength(ffmpeg_time_to_video_time(VideoTime(0, 33, 0)), 1633),
)
ERROR_AIRCRAFT_LENGTH_IN_PIXELS = 10
#================== Data from Google Earth ==============
#: Assumed error in positions from Google Earth ariel imagery.
GOOGLE_EARTH_ERROR = 25
RUNWAY_DISTANCE_ERROR = 25
#: Measuremen... | |
import re
from django import forms
from django.forms import (
ModelForm,
TextInput,
Select,
Textarea,
NumberInput
)
from decimal import Decimal
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import validate_password
f... | |
nonzero pdf for negative ages, which are physically impossible,
# these outflow contributions can either be ignored (violates the mass balance) or
# allocated to the zeroth year of residence, the latter being implemented in the method compute compute_o_c_from_s_c.
# As alternative, use lognormal or folded normal di... | |
import datetime
import gensim.downloader as api
import io
import json
import math
import nltk
import numpy as np
import os
import pandas as pd
import pdfminer
import pickle
import PyPDF2
import re
import sys
import pdfrw
import textract
import tldextract
import traceback
from collections import Counter
from nltk impor... | |
w] != -1
if not np.any(valididxs):
continue
f1_by_class = skm.f1_score(gt.flatten()[valididxs], annos[valididxs, w], labels=range(self.num_classes),
average=None)
f1_w = np.mean(f1_by_class[np.unique(gt[valididxs]).astype(int)])
#print(f1_w)
individual_scores.append(f1_w)
f1scores[valididxs, w] = f1_w
#pr... | |
as f:
table = f.read().splitlines()
if is_partition_transfer != "None":
table = [x.split(',')[0] for x in table]
split_message = re.findall("Starting transfer of.*\n", context.stdout_message)
if len(split_message) == 0 and len(table) != 0:
raise Exception("There were no tables transfered")
counter_table = 0
... | |
<filename>glance/image_cache/drivers/sqlite.py
# Copyright 2011 OpenStack Foundation
# 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/... | |
# import psutil
import time
import threading
from typing import List, Dict, Tuple, Any, Optional, Union
from functools import wraps
# from inspect import getfullargspec
# from datetime import datetime
import logging
from sqlalchemy.orm import load_only
from tackle.db_models import APIKeyData
from tackle.db_models imp... | |
= False
r = None
try:
if method in ['get', 'delete']:
r = getattr(requests, method)(url, headers = custom_headers, auth = auth, timeout = timeout)
else:
r = getattr(requests, method)(url, data, headers = custom_headers, auth = auth, timeout = timeout)
self.last_header = r.headers
self.last_statu... | |
acode is None:
acodes = list(self.actions.keys())
#elif type(acode) == list: # assume list of acode strings
# pass
else:# elif type(acode) == str:
acodes = [acode] if not self.actions[acode].components else self.actions[acode].components
tokens = expr.split(' ')
result = 0.
for _acode in acodes:
#if not aa[pe... | |
_, _), _ = agent.inference(data_loader.test_loader if test else data_loader.valid_loader)
split = "test" if test else "dev"
with jsonlines.open(
os.path.join(config.env.data_path, f"wikianswers-para-splitforgeneval/{split}.jsonl")
) as f:
rows = [row for row in f][: config_gen_noised["eval"].get("truncate_datase... | |
representations of the
daggered and undaggered operations corresponding to a sequence on a given subspace
Inputs:
rotation_sequence: a list of 2-tuples specifying a sequence of axis-angle pulses
subspace_num: the 1-indexed number of the subspace on which these pulses are to be applied
Returns:
two lists of 2-... | |
"%(endpoint)s, %(parameters)s",
{'endpoint': tgt_endpoint['url'], 'parameters': params})
self._issue_api_request('CompleteVolumePairing',
params,
'8.0',
endpoint=tgt_endpoint)
try:
_pair_volumes()
except SolidFireAPIException:
with excutils.save_and_reraise_exception():
params = {'volumeID': tgt_sfid}
LOG.d... | |
#
# Copyright (c) SAS Institute 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 writi... | |
1, 1), ((1, 3, 1), (1, 2, 2)) )/2 + \
sqrt(3)*JzKetCoupled(2, 1, (1, 1, 1), ((1, 3, 2), (1, 2, 2)) )/6 + \
2*sqrt(15)*JzKetCoupled(3, 1, (1, 1, 1), ((1, 3, 2), (1, 2, 3)) )/15
assert couple(TensorProduct(JzKet(1, 0), JzKet(1, 0), JzKet(1, 0)), ((1, 3), (1, 2)) ) == \
-sqrt(3)*JzKetCoupled(1, 0, (1, 1, 1), ((1, 3, 0... | |
from sklearn.utils import resample
from itertools import chain
import random
import numpy as np
import os
import math
from skfeature.function.statistical_based import CFS
from sklearn.feature_selection import SelectKBest, SelectPercentile
from sklearn.feature_selection import chi2, f_classif
from sklearn.ensemble imp... | |
<reponame>gertjanstulp/ha-react<filename>custom_components/react/lib/config.py<gh_stars>0
from datetime import datetime, timedelta
from jinja2 import Template as JinjaTemplate
from typing import Any, Callable, Dict, Tuple, Union
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exception... | |
data['num_qaids'].append(short_info.get('num_qaids', '?'))
data['num_daids'].append(short_info.get('num_daids', '?'))
data['has_bc'].append('bc_info' in short_info)
logger.info('Finished reading saved queries')
return data
def load_previous_query(self, row):
logger.info('loading previous query')
logger.info('ap... | |
'0093-934X',
'1872-6240': '0006-8993',
'1873-2747': '0361-9230',
'1097-0029': '1059-910X',
'2038-8306': '1121-760X',
'1971-1425': '1121-4171',
'1939-4586': '1059-1524',
'1878-6979': '0267-6605',
'1531-7021': '1040-8738',
'1399-0012': '0902-0063',
'1538-943X': '1058-2916',
'1090-2139': '0889-1591',
'1555-390... | |
from unittest import TestCase
from colosseum import engine as css_engine
from colosseum.colors import GOLDENROD, NAMED_COLOR, REBECCAPURPLE
from colosseum.constants import AUTO, BLOCK, INLINE, TABLE, Choices
from colosseum.declaration import CSS, validated_property
from colosseum.units import percent, px
from .utils ... | |
height+thickness)
#and last one
path.LineTo(-thickness, height)
self.drawLineVNotches(path, nb_top_notch_z, -top_notch_size_z, thickness, burn, -1)
path.LineTo(-thickness, 0)
path.Close()
path.GenPath()
def gen_lid_front(self, id_path, length, top_notch_size_x, nb_top_notch_x, height, top_notch_size_z, nb_top_... | |
<gh_stars>1-10
import os
import operator
import logging
import struct
import ctypes
import gzip
import io
from six import iteritems
from collections import namedtuple, defaultdict
from lxml import etree
from glycopeptidepy import GlycosylationType
from glycopeptidepy.structure.glycan import GlycanCompositionWithOf... | |
secondary side (district cooling network)
- ch = capacity mass flow rate secondary side
- Area_HEX_heating = are of heat excahnger.
'''
# nominal conditions network side
ch_0 = cc_0 * (tco_0 - tci_0) / ((thi_0 - tci_0) * 0.9)
tho_0 = thi_0 - Qnom / ch_0
dTm_0 = calc_dTm_HEX(thi_0, tho_0, tci_0, tco_0, 'heat')
... | |
import numpy as np
import argparse
import cv2
import subprocess
import time
import os
import pprint
import math
def show_image(img):
cv2.imshow("Image", img)
cv2.waitKey(0)
def draw_labels_and_boxes(img, boxes, confidences, classids, idxs, colors, labels):
# If there are any detections
if len(idxs) > 0:
for i in... | |
change might result in\n'
'NON-correct segmentation/tracking for those frames.\n'
)
txtLabel = QLabel(txt)
_font = QtGui.QFont()
_font.setPixelSize(13)
_font.setBold(True)
txtLabel.setFont(_font)
txtLabel.setAlignment(Qt.AlignCenter)
# padding: top, left, bottom, right
txtLabel.setStyleSheet("padding:0px 0px... | |
from fontTools.ttLib.data import dataType
import math
import copy
import sys
sys.path.append('/home/zeming/Desktop/projects/fonttools/Lib/compiler')
import AST
class Boolean(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return self.value
class Constant(object):
def __init__(self, val... | |
"""Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'.
"""
#from webhelpers.html.tags import checkbox, password
from webhelpers.pylonslib.secure_form import authentication_token, secure_form
from pylons import ... | |
string property is displayed to the user).
.. note::
The default value determines the type. So if the default value
is ``0``, the type will be int and a user won't be able to
enter a float. Use e.g. ``0.0`` in the latter case.
E.g.::
>>> Cos = function_factory.get('CosFunc')
>>> cos = Cos()
>>> ... | |
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LICENS... | |
<theS>.
:param theS:
:type theS: TopoDS_Shape &
:rtype: int
"""
return _BOPTools.BOPTools_AlgoTools_Dimension(*args)
Dimension = staticmethod(Dimension)
def IsOpenShell(*args):
"""
* Returns true if the shell <theShell> is open
:param theShell:
:type theShell: TopoDS_Shell &
:rtype: bool
"""
return _... | |
class
@ In, None
@ Out, paramDict, dict, dictionary containing the parameter names as keys
and each parameter's initial value as the dictionary values
"""
paramDict = BoostDistribution.getInitParams(self)
paramDict['location'] = self.location
paramDict['scale' ] = self.scale
return paramDict
def initializeDis... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
This file contains three main classes:
1. `Maze` is the top layer object on which we run the algorithms.
2. `GIFSurface` is the bottom layer object which holds the information
of the output GIF image.
3. `Animation` is the middle layer object that controls how a `Maze`
object i... | |
import discord
from discord.ext import commands, tasks
from datetime import datetime
import asyncio
from PIL import Image, ImageFont, ImageDraw
import os
from cogs.slothcurrency import SlothCurrency
from mysqldb import the_data_base
from mysqldb2 import the_data_base5
class CreateSmartRoom(commands.Cog):
'''
A cog r... | |
TASK_FILTER_ASSIGNED:
filter_type = 'filter_task_assigned'
show_assignee_flag = True
print( show_assignee_flag)
tasks = base_tasks.filter( state = TASK_STATE_NEW ).filter( profile2task__priority__in = TASK_PROFILE_PRIORITY_ASSIGNED_LIST ).distinct()
else:
if arg_task_filter == TASK_FILTER_UNASSIGNED:
filter_type... | |
<reponame>charles-typ/jiffy
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:no_utf8strings,slots
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol impor... | |
<reponame>Mirantis/contrail-controller<filename>src/opserver/test/test_analytics_uve.py
#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# analytics_uvetest.py
#
# UVE and Alarm tests
#
import os
import sys
import threading
threading._DummyThread._Thread__stop = lambda x: ... | |
-1.09],
[-0.26, -0.57, 0.27, -0.37, 0.87, -0.58, -0.68, -0.49],
[0.69, 0.9, -0.36, 0.65, -0.62, -1.4, -1.8, -0.67],
[-0.41, 1.48, -1.62, 1.1, -1.46, -1.06, -0.17, -1.23]],
dtype='float32'), array([0.09, 0.03, -0.08, 0.21, -0.06, -0.31, -0.63, -0.55],
dtype='float32'),
array([[1.12, 0.28, -1.39, 0.66, 2.05, -1.08,... | |
print(response)
"""
pass
def terminate_environment(EnvironmentId=None, EnvironmentName=None, TerminateResources=None, ForceTerminate=None):
"""
Terminates the specified environment.
See also: AWS API Documentation
Examples
The following operation terminates an Elastic Beanstalk environment named my-env:... | |
+ 'E_ub_d0_V1.txt', E_ub_d0_V1.reshape((-1,1)))
np.savetxt(save_results_to + 'PreS_ub_d0_V1.txt', PreS_ub_d0_V1.reshape((-1,1)))
np.savetxt(save_results_to + 'I_ub_d0_V1.txt', I_ub_d0_V1.reshape((-1,1)))
np.savetxt(save_results_to + 'J_ub_d0_V1.txt', J_ub_d0_V1.reshape((-1,1)))
np.savetxt(save_results_to + 'D_u... | |
Average # of vehicles in a sample.
"""
dataset_labels = self.get_all_subset_labels(dataset_i)
total_num_veh = 0
for sample in dataset_labels:
try:
total_num_veh += sample["num_vehicles"][0]
except KeyError: # When num of vehicles was not specified in the annotations, which means num vehicles=1.
total_num_veh... | |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the te... | |
<reponame>Beam-create/S4_projet_QUADRUS_V2
import array
import cv2
import sensor_msgs.msg
import math
import copy
import numpy
def mkmat(rows, cols, L):
mat = numpy.matrix(L, dtype='float64')
mat.resize((rows,cols))
return mat
class PinholeCameraModel:
"""
A pinhole camera is an idealized monocular camera.
""... | |
<NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# 2010-2012 <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# 2010-2013 <NAME> <<EMAIL>>
# 2010-2014 <NAME> <<EMAIL>>
# 2010-2015 <NAME> <<EMAIL>>
# 2010-2016 <NAME> <<EMAIL>>
# 2010-2017 <NAME> <<EMAIL>>
# 2010-2018 <NAME> <<EMAIL>>
# <NAME> <20100.delecroix at gmail.com>
# 2011 <NAME> <<EMAIL>... | |
<reponame>m-aleem/fprime
"""
fprime.fbuild.cmake:
File to contain basic wrappers for the CMake. This will enable basic CMake commands in order to detect the properties of
the build. This should not be imported in-person, but rather should be included by the build package. This can be the
receiver of these delegated fu... | |
<reponame>Niklaus-xie/f5-openstack-lbaasv2-driver<gh_stars>10-100
# Copyright 2106 F5 Networks 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-... | |
from random import randint
from nose.tools import *
# from legsewoc import *
# from legsewoc.leguincounter import LeGuinCounter
# from .context import legsewoc
# from legsewoc.leguincounter import LeGuinCounter
from .context import leguincounter
from leguincounter import LeGuinCounter
def test_init():
'''Test Case... | |
<filename>tests/util/answers.py
from tests.util.params import LOGO_BASE64
PROJECTS_LIST = {
'projects': [{
"id": "15c578ea47a5466db2aeb57dc8443676",
"name": "pr1",
"url": "http://11111.selvpc.ru",
"enabled": True,
"theme": {
"color": "",
"logo": "",
"brand_color": "",
}
}, {
"id": "2c578ea47a5466db2aeb57dc... | |
<gh_stars>0
from .base import WaveformModel, ActivationLSTMCell, CustomLSTM
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import einsum
from einops import rearrange, repeat
from einops.layers.torch import Rearrange, Reduce
import numpy as np
def exists(val):
return val is not None
... | |
from __future__ import unicode_literals
import base64
import uuid
from datetime import timedelta
import logging
from django.db import models
# from django.db.models import Q
from django.contrib.auth import get_user_model
from django.core import urlresolvers, signing
from django.core.exceptions import ValidationError
... | |
+ (n * ezz1 * ezz2 / eyy1 + s * ezz2 * ezz1 / eyy2)
* (
-n * ezz3 / eyy4 * eyx4 / w / (e + w)
- s * ezz4 / eyy3 * eyx3 / w / (e + w)
- (ezz4 - ezz3) * e / w / (e + w)
)
)
/ ezz4
/ ezz3
/ (n * eyy3 + s * eyy4)
/ ezz2
/ ezz1
/ (n * eyy2 + s * eyy1)
/ (e + w)
* eyy4
* eyy3
* eyy1
* w
* eyy2
* e
+ (
0.... | |
: unicode, optional
**{'horizontal', 'vertical'}**,
Labels orientation.
text_size : numeric, optional
Labels text size.
offset : array_like, optional
Labels offset as percentages of the largest rectangle dimensions.
Other Parameters
----------------
figure : Figure, optional
Figure to apply the render elemen... | |
<gh_stars>0
import gdsMill
import tech
from contact import contact
import math
import debug
import grid
from vector import vector
from vector3d import vector3d
from globals import OPTS
class router:
"""A router class to read an obstruction map from a gds and plan a
route on a given layer. This is limited to two lay... | |
<reponame>elunico/guppy
import os.path
import os
import msgpack
import time
from colors import *
from display import commify, fmt_bytes, fmt_seconds, LongTextDisplayObject, CONSOLE_WIDTH
from typing import Union
from typing import Optional
from typing import Dict
############
# Qualified repo names (user/repo) are sto... | |
if n_ID == p:
ErrMessage = 'Error! All priors are ambiguous.\nYou may uncheck the option in tab irMF+.'
return [NMFPriors, AddMessage, ErrMessage]
NMFPriors[ID, :] = 0
Mweight = np.zeros((p, nc))
for k in range(0, nc):
ID = np.where(NMFPriors[:, k] > 0)
pk = ID[0].shape[0]
if pk == 0:
ErrMessage = 'Error! Nul... | |
and present.
Q: The proportion of the genome with a reduced effective size due to selection at linked sites
n1,n2: Size of fs to generate.
pts: Number of points to use in grid for evaluation.
"""
# Define the grid we'll use
xx = dadi.Numerics.default_grid(pts)
#### Calculate the spectrum in normally-recombining... | |
bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. [See Telegram API](https://core.telegram.org/bots/api#approvechatjoinrequest)
- - - - -
**Args**:
- `chat_id` :`Union[int,str,]` Unique identifier for the target chat or userna... | |
<reponame>ssaksham9/Fusion
import json
from django.contrib.auth import logout
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.files.storage import FileSystemStorage
from django.core import serializers
from django... | |
dont_fill=False):
"""Removes modifications from :func:`MCEqRun.set_mod_pprod`.
Args:
skip_fill (bool): If `true` do not regenerate matrices
(has to be done at a later step by hand)
"""
from collections import defaultdict
info(1, 'Particle production modifications reset to defaults.')
self._interactions.mod_pp... | |
its existence is that the "nonlocal" statement is
not yet implemented in Python. Therefore, I need a mutable data type
in order to use side effects in the local functions in
apply_pre_input_method() and apply_post_input_method(). It's not nice,
but the alternatives are even uglier. BTDT.
To sum it up, Status hold... | |
{}'.format(min_poly, emb)
s = format_field('amb_space', self.ambient_dim())
if 'number_field' in data:
from copy import copy
data = copy(data)
s += 'number_field {}\n'.format(format_number_field_data(data['number_field']))
del data['number_field']
for key, value in sorted(data.items()):
s += format_field(key, ... | |
import pytest
from CrowdStrikeFalconX import Client, \
send_uploaded_file_to_sandbox_analysis_command, send_url_to_sandbox_analysis_command, \
get_full_report_command, get_report_summary_command, get_analysis_status_command, \
check_quota_status_command, find_sandbox_reports_command, find_submission_id_command, run... | |
<filename>utilization/sizing_analyzer.py
import json
import ast
import math
import pandas as pd
import numpy as np
import datetime
from influxdb import DataFrameClient
from api_service.db import resultdb
from logger import get_logger
from config import get_config
NANOSECONDS_PER_SECOND = 1000000000
class Status():
... | |
= skypos_altaz[m2,:]
coords_str = 'altaz'
prev_skymodel_success = False
if store_prev_skymodel_file is not None:
if not isinstance(store_prev_skymodel_file, str):
raise TypeError('Input store_prev_skymodel_file must be a string')
try:
with h5py.File(store_prev_skymodel_file, 'a') as fileobj:
if 'ind' in fileob... | |
# Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.