input
stringlengths
2.65k
237k
output
stringclasses
1 value
network and returns behavior traces :param stimulus: The stimulus to present to the network :return: [0]: Behavior instantiations (-1: none, 0: stay, 1: straight, 2: left, 3: right) [1]: Speed trace [2]: Angle trace """ history = GlobalDefs.hist_seconds*GlobalDefs.frame_rate step = history model_in = np.zeros(...
assert Task.select().where(Task.task_type == TaskType.FUNDING).count() == 4 task = Task.select().where(Task.task_type == TaskType.FUNDING).order_by(Task.id.desc()).first() assert task.records.count() == 2 # Activate a single record: resp = client.post( "/admin/fundingrecord/action/", follow_redirects=True, data...
<gh_stars>0 #! usr/bin/env python import numpy as np import datetime import random import numpy as np from collections import deque import json from collections import defaultdict from keras.models import model_from_json from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatt...
from djitellopy import Tello import cv2 import socket import numpy as np import time import datetime import imutils def rescale_frame(frame, percent=75): width = int(frame.shape[1] * percent/ 100) height = int(frame.shape[0] * percent/ 100) dim = (width, height) return cv2.resize(frame, dim, interpolation =cv2.IN...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
in self.meal_plans['Present']: for subitem in self.meal_plans['Present'][item]: for subsubitem in self.meal_plans['Present'][item][subitem]: self.totals[i] += int(self.get_nutrient(subsubitem, temp_nutrients[i][0])) self.totals[i] /= 28 self.totals[i] = int(self.totals[i]) if self.nutrition_labels[i] != None: se...
import numpy as np import numba import scipy import scipy.interpolate from near_finder.utilities import fourier_derivative_1d from near_finder.utilities import interp_fourier as _interp from near_finder.utilities import have_better_fourier if have_better_fourier: from near_finder.utilities import interp_fourier2 as _i...
<= _text_meter_sofar_size: _text_meter_total_size = 0 _text_meter_sofar_size = 0 text_progress_meter = TextMeter class MultiFileHelper(BaseMeter): def __init__(self, master): BaseMeter.__init__(self) self.master = master def _do_start(self, now): self.master.start_meter(self, now) def _do_update(self, amoun...
when we attend over the # span representations that we generate from these indices, we # need them to be <= 0. This is only relevant in edge cases where # the number of spans we consider after the pruning stage is >= the # total number of spans, because in this case, it is possible we might # consider a masked spa...
self.xmu + self.xr self.ird_min = -999 self.ird_max = 999 self.irq_min = -999 self.irq_max = 999 self.irq_off = zeros(self.n, 1) self.u0 = mul(self.u, self.ugen) # self.omega_ref0 = ones(self.n, 1) self.mva_mega = 100000000.0 def init1(self, dae): """New initialization function""" self.servcall(dae) retval...
promoted if i in multigpu_list] # 2gpu job ['3','3','4','4','10'] demoted_1gpu = [i for i in demoted if i not in multigpu_list] # 1gpu job demoted_2gpu = [i for i in demoted if i in multigpu_list] # 2gpu job condition1 = len(K80_avail) >= len(demoted) and 2*len(K80_2gpu) >= len(demoted_2gpu) condition2 = len(V100_...
<reponame>ludaavics/yogam import codecs import logging import re from enum import Enum from math import ceil, floor from typing import ( Any, Callable, Dict, Iterable, List, Mapping, Match, Optional, Tuple, Union, cast, ) from urllib.parse import unquote, urljoin, urlparse import requests from bs4 import Be...
be monitored, whereas *ALL_OUTPUT_PORTS* specifies that *every* OutputPort of every Mechanism be monitored. | The default for the **monitor_for_control** argument is *MonitoredOutputPortsOption.PRIMARY_OUTPUT_PORTS*. The OutputPorts specified in the **monitor_for_control** argument are added to any already specifie...
<filename>src/sqlfluff/parser/segments_common.py """Common Segment Definitions. Here we define: - KeywordSegment - ReSegment These depend on the base segments, and extend them for some more useful use cases. The intent here is that these segments have meaning regardless of what dialect we use, and will be common betw...
if stat_set == "1": # stat totals stat_name = "Stat Total" test_bounds = (100, 600) stat_values = loaddata.total_points stat_stats = loaddata.total_points_stats unit = '' elif stat_set == "2": # hp stat_name = "HP" test_bounds = (20, 256) stat_values = loaddata.hp stat_stats = loaddata.hp_stats unit = '' el...
#!/usr/bin/env python # Copyright (c) 2007-2008 ActiveState Software Inc. # License: MIT (http://www.opensource.org/licenses/mit-license.php) """Test the Python markdown2.py.""" import os import sys from os.path import join, dirname, abspath, exists, splitext, basename import re from glob import glob from pprint impo...
database, if project data base does not exist, throw an exception inputs: fileName = name of raw telemetry data file with full directory and extenstion dbName = name of project database with full directory and extension recName = official receiver name''' # declare the workspace - in practice we will identify a...
# Importations from keras.applications import ResNet50, VGG16, imagenet_utils from sklearn.preprocessing import LabelEncoder from keras.preprocessing.image import img_to_array, load_img from keras.utils import to_categorical from imutils import paths import numpy as np import pickle import random import os # Extract ...
from multiprocessing.sharedctypes import Value import pandas as pd from pyomo.environ import * from pyomo.environ import units as pyunits # from pyomo.repn.plugins.baron_writer import NonNegativeReals from watertap3.utils import financials from watertap3.wt_units.wt_unit import WT3UnitProcess import idaes.core.util.sc...
<reponame>GavinPass/dash-sample-apps #!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import pandas as pd import pyvista as pv import xarray as xr from jupyter_dash import JupyterDash import dash import dash_html_components as html import vtk import dash_vtk from dash_vtk.utils import...
# 查询文档信息 project = Project.objects.get(id=doc.top_doc) # 查询文档所属的文集信息 pro_colla = ProjectCollaborator.objects.filter(project=project, user=request.user) # 查询用户的协作文集信息 if (request.user == doc.create_user) or (pro_colla[0].role == 1): history = DocHistory.objects.get(id=his_id) if history.doc == doc: return JsonResp...
<gh_stars>1-10 # -*- coding: utf-8 -*- ######################################################################################################################## # # Copyright (c) 2018, Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without mo...
<reponame>razariah/UC_BERKELEY_DATA_ANALYTICS<filename>3_Py_Poll_with_Python/Python_practice.py print(type(3)) ballots = 1341 type("Hello World") type(True) num_candidates = 3 winning_percentage = 73.81 candidate = "Diane" won_election = True print(num_candidates) print(winning_percentage) print(c...
# simulation object contains the current state of the simulation. # It is analogous to the "bundle" object in the original FMS code. import os import shutil import time import copy import types import numpy as np import h5py import numpy.linalg as la from pyspawn.fmsobj import fmsobj from pyspawn.traj import traj impo...
from numpy import random, mean #note: Project completed with the use of lecture notes, notes from TA discussion section, #and work on past assignements #note: The provided code shows +2 results over number of itterations shown, # and if I run world.run() without running the rest of the code the output in incorrect...
# -*- coding:utf-8 -*- # # Copyright (C) 2008 The Android Open Source Project # # 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 require...
#!/usr/bin/python3 ''' * Copyright (C) 2021 <NAME> * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE.txt file for details. ''' ################## #Needed libraries# ################## import matplotlib as mpl mpl.use('TkAgg') import matplotlib.pyplot as plt i...
matching criteria matchLevel = self.searchMatchLevels[resolvedEntityMatchInfo['MATCH_LEVEL']] matchKey = resolvedEntityMatchInfo['MATCH_KEY'] ruleCode = resolvedEntityMatchInfo['ERRULE_CODE'] #--scoring bestScores = {} bestScores['NAME'] = {} bestScores['NAME']['score'] = 0 bestScores['NAME']['value'] = '' for...
"""Neighbor models for regression.""" from .base import (NeighborsBase, KNeighborsMixin, RadiusNeighborsMixin, NeighborsRegressorMixin) class KNeighborsRegressor(NeighborsBase, NeighborsRegressorMixin, KNeighborsMixin): """Regression based on k-nearest neighbors. Regression with scalar, multivariate or function...
import time import math from dronekit import * from pymavlink import mavutil """ Most functions come from examples from dronekit, specifically the guided example http://python.dronekit.io/examples/guided-set-speed-yaw-demo.html#guided-example-source-code """ def arm_and_takeoff(vehicle, aTargetAltitude): """ Arms v...
<reponame>h4yn0nnym0u5e/OSCAudio<gh_stars>1-10 import re import fileinput import os import json ############################################################################################## # User settings dynamic = True ftrl = ['play_wav' # files to reject ] limit = 1000 rp = '../../Audio' idxf = '../../Audio/gui...
"0", # "http": { "_datetime": " May 14 10:46:59", "_ident": "1829102019201192", "_type": "http", "method": "GET", # "usergaent": "Mozilla Firefix 1.0", "cookie": "1029100929101834810380101308084745785723978", # "fullurl": "https://www.adisa.com/index.html"} } } } } # def insertIPTCPHTTP(self, jdata, digest): d...
# This file is part of the sphinx-cmake_domain Sphinx extension. # See <https://github.com/marcokoch/sphinx-cmake_comain> for recent information. # # # Copyright 2020 <NAME> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are m...
<reponame>orbitalturtle/python-teos import pytest from multiprocessing import Event from shutil import rmtree from teos.api import API import common.errors as errors from teos.watcher import Watcher from teos.inspector import Inspector from teos.gatekeeper import UserInfo from teos.internal_api import InternalAPI from...
<reponame>esoma/woosh<filename>test/python/sample/stdlib/test_operator.py<gh_stars>0 # this file was generated using test/python/sample/generate.py # python import io import pathlib # pytest import pytest # woosh import woosh def tokenize_file_like(source): return list(woosh.tokenize(io.BytesIO(source))) def token...
.. ... 'axis': 'Y'}, .. ... data=cf.Data([15, 45, 75]), .. ... bounds=cf.Bounds(data=cf.Data([[0, 30], [30, 60], [60, 90]])) .. ... ), .. ... axes=f.set_construct(cf.DomainAxis(size=3)) .. ... ) .. >>> lon = f.set_construct( .. ... cf.DimensionCoordinate( .. ... properties={'standard_name': 'longitude', .. ......
'0' else: string += str(letter) return string def channels_preview_update(self): if not (isinstance(self.gl.pyimage, list) and len(self.gl.pyimage) != 0): return pyimage = self.gl.pyimage[0] if self.gl.input_format_24bit.get(): pyimage = swap_channels24_c(pyimage, self.channel_get_mode()) pyim...
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d from scipy.optimize import curve_fit from scipy import integrate from matplotlib import ticker %matplotlib notebook plt.rcParams['figure.dpi']=150 plt.rcParams['figure.figsize']=(6,4) def XASload(dir,de,ate,ext,interp,groupA,grou...
3] - gt_box[:, 1] gt_center_y = gt_box[:, 0] + 0.5 * gt_height gt_center_x = gt_box[:, 1] + 0.5 * gt_width dy = (gt_center_y - center_y) / height dx = (gt_center_x - center_x) / width dh = np.log(gt_height / (height + eps)) dw = np.log(gt_width / (width + eps)) return np.stack([dy, dx, dh, dw], axis=1) def c...
0 && b < 0 && a >= sum) # sum = INT64_MAX; # } # # Optimizations similar to the iadd_sat case are applied here. (('isub_sat@64', a, b), ('bcsel', ('iand', ('iand', ('ilt', a, 0), ('ige', b, 0)), ('ige', ('isub', a, b), 0)), 0x8000000000000000, ('bcsel', ('ior', ('ior', ('ilt', a, 0), ('ige', b, 0)), ('ige', ('...
import sys import six import threading import traceback from queue import PriorityQueue from collections import namedtuple from datetime import datetime, timedelta import pytz import html from sqlalchemy import Column, Integer, ForeignKey, Unicode, Enum, func from monitorrent.db import Base, DBSession, row2dict, UTC...
<reponame>zeou1/maggot_models<gh_stars>0 import math from collections import defaultdict from operator import itemgetter import colorcet as cc import matplotlib import matplotlib.colors as mplc import matplotlib.pyplot as plt import networkx as nx import numpy as np import pandas as pd import seaborn as sns from matpl...
torch.no_grad(): pto = pt_model(**pt_inputs_dict) tfo = tf_model(self._prepare_for_class(inputs_dict, model_class)) tfo = tfo[0].numpy() pto = pto[0].numpy() tf_nans = np.copy(np.isnan(tfo)) pt_nans = np.copy(np.isnan(pto)) pto[tf_nans] = 0 tfo[tf_nans] = 0 pto[pt_nans] = 0 tfo[pt_nans] = 0 max_diff = np.a...
LB_ID, LISTENER_ID, APP_PROFILE_ID, LB_VS_ID) mock_create_pp.assert_called_once() mock_successful_completion = ( self.lbv2_driver.listener.successful_completion) mock_successful_completion.assert_called_with(self.context, listener, delete=False) def test_create_listener_with_session_persistence_fail(self): li...
color:#a5c261;">\'color\'</span><span style=" font-family:\'Co' \ 'nsolas\'; font-size:9.8pt; color:#a9b7c6;">: [</span><span style=" font-family:\'Consolas\'; font-si' \ 'ze:9.8pt; color:#6897bb;">40</span><span style=" font-family:\'Consolas\'; font-size:9.8pt; color:#c' \ 'c7832;">, </span><span style=" font-f...
/ SOURCES_DIR_NAME}, 'LOGS_DIR': {'default': lambda c: c['OUTPUT_DIR'] / LOGS_DIR_NAME}, 'CONFIG_FILE': {'default': lambda c: Path(c['CONFIG_FILE']).resolve() if c['CONFIG_FILE'] else c['OUTPUT_DIR'] / CONFIG_FILENAME}, 'COOKIES_FILE': {'default': lambda c: c['COOKIES_FILE'] and Path(c['COOKIES_FILE']).resolve()}, ...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is govered by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """Unittests for monorail.tracker.issuedetail.""" import logging import mox import time import ...
<reponame>4ekin/raw-packet<filename>raw_packet/Scanners/scanner.py # region Description """ scanner.py: Scan local network Author: <NAME> License: MIT Copyright 2020, Raw-packet Project """ # endregion # region Import # region Raw-packet modules from raw_packet.Utils.base import Base from raw_packet.Scanners.arp_scan...
import typing import discord import asyncio import re from discord.ext import commands from collections import Counter from utilities import decorators from utilities import converters from utilities import checks from utilities import helpers def setup(bot): bot.add_cog(Server(bot)) class Server(commands.Cog): "...
<reponame>mikan/racm # -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Jun 17 2015) ## http://www.wxformbuilder.org/ ## ## PLEASE DO "NOT" EDIT THIS FILE! ############################################################...
""" File: gromos++ topo file functions Warnings: this CLASS IS NOT IMPLEMENTED! TODO:REWORK Description: in this lib, gromos topo file mainpulating functions are gathered Author: <NAME>, <NAME> """ #imports from copy import deepcopy from typing import TypeVar, Union import warnings import math from pygromos.utils im...
'get_qos_policy_group_name_from_info', return_value=fake.QOS_POLICY_GROUP_NAME) self.mock_object(na_utils, 'is_qos_policy_group_spec_adaptive', return_value=is_adaptive) self.library._add_lun_to_table = mock.Mock() self.zapi_client.move_lun = mock.Mock() mock_set_lun_qos_policy_group = self.mock_object( self.zap...
<reponame>LX-doctorAI/LR1 import numpy as np from torchvision import datasets, transforms from tqdm import tqdm import os import pickle as pkl import torch import pickle import time from torch.utils.data import DataLoader, Dataset from PIL import Image class FastDataSet(Dataset): def __init__(self, data_path, label_...
new values in text boxes # Format with 8 decimal places. #-------------------------------- self.map_minlon.value = "{:.8f}".format( minlon ) self.map_maxlon.value = "{:.8f}".format( maxlon ) self.map_maxlat.value = "{:.8f}".format( maxlat ) self.map_minlat.value = "{:.8f}".format( minlat ) # replace_map_bounds...
<reponame>hisiter97/TextRecognitionDataGenerator_Full import numpy as np import torch import torch.nn as nn import torch.nn.functional as F def concatenate_dict(main_dict, new_dict): for key in main_dict.keys(): main_dict[key] += [new_dict[key]] def mixture_of_bivariate_normal_nll( data, log_pi, mu, log_sigma, rho...
<gh_stars>1-10 # # Copyright 2016-2017 Games Creators Club # # MIT License # import math import time import traceback import pyroslib DEBUG_LEVEL_OFF = 0 DEBUG_LEVEL_INFO = 1 DEBUG_LEVEL_DEBUG = 2 DEBUG_LEVEL_ALL = 3 DEBUG_LEVEL = DEBUG_LEVEL_ALL INITIAL_SPEED = 40 INITIAL_SIDE_GAIN = 0.4 INITIAL_FORWARD_GAIN = 1....
self.__total def _set_total(self, v, load=False): """ Setter method for total, mapped from YANG variable /system/cpus/cpu/state/total (container) If this variable is read-only (config: false) in the source YANG file, then _set_total is considered as a private method. Backends looking to populate this variable s...
<reponame>jinxu06/MetaFun-Tensorflow<filename>model.py from six.moves import zip import math from absl import flags import numpy as np import tensorflow as tf import sonnet as snt from tensorflow.contrib.layers import layer_norm import data.classification as cls_data FLAGS = flags.FLAGS # Model Specification flags.DEF...
of each sequence must be equal to the length of each sequence of `entity_spans`. If you specify `entity_spans` without specifying this argument, the entity sequence or the batch of entity sequences is automatically constructed by filling it with the [MASK] entity. entities_pair (`List[str]`, `List[List[str]]`, *opt...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Parser ------ Parser for extracting relevant information from Texas Dallas County Felony and Misdemeanor Courts using regular expressions. """ from dallasparser.regex import * from dallasparser.utils import * from openpyxl import load_workbook from dateutil.parser impo...
import numpy as np from itertools import cycle from numba import jit from functools import lru_cache from hierarch.internal_functions import ( nb_unique, id_cluster_counts, msp, set_numba_random_state, _repeat, nb_fast_shuffle, nb_strat_shuffle, weights_to_index, ) class Bootstrapper: """Bootstrapper(random_...
# <NAME> # <EMAIL> # November 2014 # Stanford University # This script calculates H12 and H2/H1 from population genomic data import sys from optparse import OptionParser import copy import csv import linecache import random import time import numpy #import Bio ###################### def clusterSingleWindow(inFile, o...
''' pass class VIEW3D_MT_view_regions(bpy_types.Menu, bpy_types._GenericUI): bl_label = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def append(self, draw_func): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_s...
<gh_stars>1-10 # encoding: UTF-8 import zmq import itchat import time import os import json from befh.subscription_manager import SubscriptionManager from befh.OkcoinAPI.OkcoinMarket import OkcoinMarket from befh.FinexAPI.BitfinexMarket import BitfinexMarket import logging import re import random import numpy as np d...
<gh_stars>1-10 # -*- coding: iso-8859-1 -*- """ This code creates the Results plots for Ranjan & Sasselov 2016b. """ ######################## ###Import useful libraries ######################## import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pdb from matplotlib.pyplot i...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Thu Aug 8 17:55:48 2013 @author: michal """ import scipy.interpolate as inter import numpy as np import matplotlib.pyplot as plt import numpy.random import os os.system('rm /tmp/fig*') import vtk import vtk.util.numpy_support as VN #G = np.zeros(9) #G[1:5] = ...
# -*- coding: utf-8 -*- from itertools import product import os import uuid import dask import dask.array as da from dask.array.core import normalize_chunks from dask.highlevelgraph import HighLevelGraph import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal import pyrap.tables as ...
can you find this man, Mr. Stone?” “We’ve got to find him,” Stone returned, “whether we can or not. It’s really a baffling case. I think we’ve discovered the origin of the fire in the garage.” He told the story that Fibsy had learned from the chauffeur, and Keefe was greatly interested. “What are the acids?” he aske...
#!/usr/bin/env python """ This module implements more advanced transformations. """ from __future__ import division __author__ = "<NAME>, <NAME>" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __date__ = "Jul 24, 2012" import numpy as np f...
<filename>src/geneflow/workflow.py """This module contains the GeneFlow Workflow class.""" import time import copy import requests from slugify import slugify import yaml from geneflow.log import Log from geneflow.data import DataSource, DataSourceException from geneflow.data_manager import DataManager from geneflo...
import copy from keras import optimizers from keras import backend as K from keras import objectives from keras.models import Model from keras.layers import Input, Dense, Lambda, LSTM, Concatenate, LeakyReLU from keras.layers.core import Dense, Activation, Flatten, RepeatVector from keras.layers.wrappers import TimeDis...
<reponame>r-o-b-e-r-t-o/sphinxcontrib-needs import math import os import matplotlib import numpy from docutils import nodes from sphinxcontrib.needs.filter_common import FilterBase, filter_needs if not os.environ.get("DISPLAY"): matplotlib.use("Agg") import hashlib from docutils.parsers.rst import directives from...
'0277-1691', '1432-5195': '0341-2695', '1943-2836': '0020-7284', '1439-3964': '0172-4622', '1473-5660': '0342-5282', '1873-6386': '0160-2527', '1872-8464': '0165-5876', '1563-5279': '0020-7454', '1873-491X': '0020-7489', '1879-0135': '0020-7519', '1573-2630': '0165-5701', '1541-3527': '0091-2174', '1745-831...
!= METHOD_HEAD) \ or (response.status in (301, 302) and response.method == METHOD_POST): method = METHOD_GET data = None content_length = headers.get(CONTENT_LENGTH, None) if (content_length is not None) and content_length: del headers[CONTENT_LENGTH] redirect_url = response.headers.get(LOCATION, None) if r...
<filename>apcupsd.indigoPlugin/Contents/Server Plugin/plugin.py<gh_stars>1-10 #! /usr/bin/env python # -*- coding: utf-8 -*- #################### # Copyright (c) 2013, <NAME> All rights reserved. # with much credit to <NAME> (kormoc) -- https://github.com/BrightcoveOS/Diamond/blob/master/src/collectors/apcupsd/apcupsd....
import os import pandas from BirdRoostDetection.ReadData import Labels import numpy as np from BirdRoostDetection import utils from BirdRoostDetection.PrepareData import NexradUtils class Batch_Generator(): """This class organized the machine learning labels and creates ML batches. Class Variables: self.root_dir:...
end)] if 'STRAIGHT' in self.nose_type or 'OPEN' in self.steps_type: # face bottom matids.append(self.idmat_bottom) faces.append((f + end, f + start, f + offset + start, f + offset + end)) uvs.append([(u, v), (u, 0), (0, 0), (0, v)]) if self.steps_type != 'OPEN': if 'STRAIGHT' in self.nose_type: # front face b...
<reponame>netMedi/hl7apy # -*- coding: utf-8 -*- # # Copyright (c) 2012-2018, CRS4 # # 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 righ...
points.append(seg.c1) shape = Shape(points) shapes.append(shape) points = [] if len(points) > 0: points.append(self.c1) shape = Shape(points) shapes.append(shape) def add_points(self): """ add points from intersection data """ points = [] if self.nbsegs > 0: for seg in self._segs: points.append(seg.c0) ...
null=True, on_delete=models.SET_NULL, help_text="Цель посещения") fin_source = models.ForeignKey(IstochnikiFinansirovaniya, default=None, blank=True, null=True, on_delete=models.SET_NULL, help_text="Перезаписать источник финансирования из направления") first_time = models.BooleanField(default=False, help_text="Впервы...
ColumnFilter(hxl.data(url), include_tags=['org', 'sector', 'activity']) # or filter = hxl.data(url).with_columns(['org', 'sector', 'activity']) @see: L{RowFilter} """ def __init__(self, source, include_tags=[], exclude_tags=[], skip_untagged=False): """Construct a column filter. @param source: a L{hxl.model...
<reponame>HighEloDevs/atus_tests # -*- coding: utf-8 -*- """ MIT License Copyright (c) 2021 <NAME>, <NAME> 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 l...
<gh_stars>10-100 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overlo...
= { 'server': { 'name': 'no-personality-files', 'imageRef': '6b0edabb-8cde-4684-a3f4-978960a51378', 'flavorRef': '2', 'networks': 'auto', 'personality': [{ 'path': '/path/to/file', 'contents': 'ZWNobyAiaGVsbG8gd29ybGQi' }] } } req = fakes.HTTPRequestV21.blank('/servers', version='2.57') req.body = jsonutil...
""" usage: train.py [options] options: --config=<path> path of the config file --checkpoint-dir=<dir> directory where to save checkpoint --checkpoint=<path> path of the checkpoint from which the model is restored --weight-loss=<list> list of weights in loss function --loss=<string> names of loss function --stride-mod...
None if not set """ return self["Distance from Top of Thermal Chimney to Inlet 15"] @distance_from_top_of_thermal_chimney_to_inlet_15.setter def distance_from_top_of_thermal_chimney_to_inlet_15(self, value=None): """Corresponds to IDD field `Distance from Top of Thermal Chimney to Inlet 15`""" self["Distance f...
self.rpnLsb[channel]==self.rpnMsb[channel]==0: self.semitoneRange[channel]=value def patch_change(self, channel, patch): pass def channel_pressure(self, channel, pressure): pass def pitch_bend(self, channel, value): # Pitch bend is sometimes used for slurs # so we'd better interpret it (only MSB for now; fu...
#!/usr/bin/env python3 """ Command Line Arguments """ import argparse import logging import os import platform import re import sys import textwrap from importlib import import_module from lib.logger import crash_log, log_setup from lib.utils import safe_shutdown from lib.model.masks import get_available_masks, get_d...
from ..v2019_07_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2019-08-01': from ..v2019_08_01.aio.operations_async import AzureFirewallFqdnTagsOperations as OperationClass elif api_version == '2019-09-01': from ..v2019_09_01.aio.operations_async import AzureFi...
# -*- coding: utf-8 -*- """Graph traversal methods.""" from typing import Any, Dict, Iterable, Tuple, List, Union from networkx import DiGraph __all__ = [ 'compute_all_paths_multitarget', 'compute_all_paths_multitarget_dict', ] def _compute_all_paths_multitarget(graph, source, targets, history, lmax): """Compu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Jan 2018 hacer calib extrisneca con pymc3 @author: sebalander """ # %% # import glob import os import corner import time import seaborn as sns import scipy as sc import scipy.stats as sts import matplotlib.pyplot as plt from copy import deepcopy as dc imp...
sage: X(q) (-2, 3) """ if isinstance(coords, ManifoldPoint): point = coords # for readability # This should actually never happen by the coercion framework... if point.parent() is self: return point if point in self: resu = self.element_class(self, name=point._name, latex_name=point._latex_name) for chart, ...
from detectron2.utils.logger import setup_logger setup_logger() import cv2, os, re import numpy as np from detectron2.engine import DefaultPredictor from detectron2.config import get_cfg from densepose.config import add_densepose_config from densepose.vis.extractor import DensePoseResultExtractor import torch import a...
job_run["StartedOn"] end = job_run["CompletedOn"] if "CompletedOn" in job_run else None execution_details = ComputeExecutionDetails(start, end, dict(job_run)) session_state = get_glue_job_run_state_type(job_run) if session_state == ComputeSessionStateType.FAILED: failure_type = get_glue_job_run_failure_type(job_r...
""" Each source in a data set has file(s) that contain keys and meta info file. To read from a dataset, supply the path to a meta file to DataSet.prepare(). To read multiple data sets, use DataSet.find(). Then get a DataSetIterator using DataSet.iterator(). To output keys, use Writer.import_meta() with the proper Da...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main_window.ui' # # Created by: PyQt5 UI code generator 5.12.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.s...
<filename>unit.py import database as d import jobs as j import incubator as inc import bigData as big import staff import copy import math #Not all units, but all units you can create (no house, church) def all_units(): unit_list = [Farm, Mill, Brewery, Bakery, Lumberyard, Joinery] return unit_list #units use Busi...
<gh_stars>1-10 """Test ``sfini.state._state``.""" from sfini.state import _state as tscr import pytest from unittest import mock from sfini.state import _base import datetime import sfini class TestFail: """Test ``sfini.state._state.Fail``.""" @pytest.fixture def state(self): """An example Fail instance.""" ret...
this task, but it will have to be done in that separate process, because its results can't be serialized and transmitted. (On the other hand, if we have a dependent task to run *in this same process*, we'll want to bring this task to the CACHED level instead.) As with (a), for a task with non-persistable output, t...
noise', 'Outlet valve closure noise'] add_cyl_num=['Exhaust temperature','Exhaust temperature delta', 'Ignition voltage', 'ITP','Knock integrator','Knock noise', #'Exhaust temperature delta' added for delta to mean value 'Pressure 49° before TDC', 'Mechanical noise', 'Cylinder state', 'Close current gradient', 'Inle...