input
stringlengths
2.65k
237k
output
stringclasses
1 value
#!/usr/bin/env python3 # encoding: UTF-8 from collections import namedtuple import datetime import operator import re import sqlite3 import tempfile import textwrap import unittest import unittest.mock import uuid import bcrypt from pyramid import testing from pyramid.exceptions import Forbidden from pyramid.excepti...
# # Copyright (c) 2019-2020 Mike's Pub, see https://github.com/mikespub-org # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php import logging import os.path import pickle import time import flask.json from flask import Flask, jsonify, request from flask.views import MethodView from ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ io.py /io/ module in the /egp/ package. Created by <NAME>. Copyright (c) 2012. All rights reserved. """ # imports import struct, os, stat, datetime, numpy as np # try: # import pyublas # import crunch # except: # print("pyublas and egp.crunch not imported!") import ...
# pylint: disable=missing-docstring,invalid-name from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser, Group from django.contrib.contenttypes.models import ContentType from django.db.models.query import QuerySet from guardian.compat import get_user_permission_full_codenam...
specified with defaults. .. note:: The actual C structure is gotten by calling an instance. This is auto-generated when called, based on the parameters in the class. .. warning:: This class will *not* deal well with parameters of the struct which are pointers. All parameters should be primitive types, except for...
if truth is not None and xi == 0: cplt.legend() if xi == 0: cplt.set_ylabel(col_to_name[yc], fontsize=font) if yi == 0: cplt.set_title(col_to_name[xc], fontsize=font) if save_path is not None: plt.savefig(save_path, dpi=500, bbox_inches="tight") def plot_all_features_hist_by_component(dfs, save_path=None, font=DE...
await r.set('c', 3) assert await r.mget('a', 'other', 'b', 'c') == [b('1'), None, b('2'), b('3')] @pytest.mark.asyncio async def test_mset(self, r): await r.flushdb() d = {'a': b('1'), 'b': b('2'), 'c': b('3')} assert await r.mset(d) for k, v in iteritems(d): assert await r.mget(k) == [v] @pytest.mark.asynci...
normalization_vector = None selected_struc = None normalization_status = -1 no_peak = 0 no_sec_peak_false = 0 no_sec_peak_true = 1 ctx = dash.callback_context element_id = ctx.triggered[0]['prop_id'].split('.')[0] # if custom rates given, check input if element_id == "opt_btn_apply" and norm_option == '...
<reponame>Merglyn/pycolor<gh_stars>0 #!/usr/bin/python3 -B # a few import things import random import sys from sys import stdout VERSION = '1.2.0' escape = '\033[' ## General things about Ansii escape sequences # 256 color sequence # foreground \033[38;5;NNNm # background \033[48;5;NNNm # where NNN is a integer bet...
""" Descartes Labs utilities for our Universal Transverse Mercator (UTM)-based projection system. """ # The Descartes Labs projection system is slightly different from the # canonical UTM standard. Only North UTM zones are used, including for the # southern hemisphere; so there are no false northings. Also, the latitu...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 <NAME> <<EMAIL>> # All rights reserved. # # This code is licensed under the MIT License. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files(the "Software"), to deal # in the Software withou...
the spatial_scale w.r.t input image. trans_std: multiplier used in 2nd phase. """ op = builtin.DeformablePSROIPooling( no_trans=no_trans, part_size=part_size, pooled_h=pooled_h, pooled_w=pooled_w, sample_per_part=sample_per_part, spatial_scale=spatial_scale, trans_std=trans_std, ) output, _ = apply(op, inp,...
= _icon_path_ + 'autorig_large.png' _cam_rig_icon_large_ = _icon_path_ + 'cam_rig_large.png' _cyclo_icon_large_ = _icon_path_ + 'cyclo_large.png' _gizmo_icon_large_ = _icon_path_ + 'gizmo_large.png' _light_rig_icon_large_ = _icon_path_ + 'light_rig_large.png' _lut_icon_large_ = _icon_path_ + 'lut_large.png' _render_gra...
rel_addr(value) if cpu.getStatus(cpu.statusFlags['v']): if (cpu.registers['PC'] & 0xFF00) != ( (cpu.registers['PC'] + value) & 0xFF00): nCycles += 2 else: nCycles += 1 advancePC(cpu, value) advancePC(cpu, size) return nCycles def CLC_Implied(cpu): size = 1 nCycles = 2 cpu.setStatus(cpu.statusFlags['c'], ...
batched ] ) + tuple( # Validate transformations of a complex matrix _make_triangular_solve_harness("complex_transformations", dtype=np.complex64, lower=lower, transpose_a=transpose_a, conjugate_a=conjugate_a) for lower in [False, True] for transpose_a in [False, True] for conjugate_a in [False, True] ) + tuple( ...
True PERFORMANCE WARNING: if keepAppearance is false, then this does not properly reuse OpenGL display lists. A better approach to changing the robot's appearances is to set the link Appearance's directly. """ return _robotsim.RobotModel_drawGL(self, keepAppearance) __swig_setmethods__["world"] = _robotsim.Ro...
<reponame>EUFAR/asmm-eufar<filename>functions/asmm_xml.py import datetime import xml.dom.minidom import logging from PyQt5 import QtCore, QtWidgets from functions.button_functions import add_read NAMESPACE_URI = 'http://www.eufar.net/ASMM' def create_asmm_xml(self, out_file_name): logging.debug('asmm_xml.py - creat...
<reponame>lmazuel/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft ...
<reponame>ViolaBuddy/EscapeFromPlegia import logging import math from app.data.database import DB from app.engine import (action, combat_calcs, engine, equations, evaluate, item_funcs, item_system, line_of_sight, pathfinding, skill_system, target_system) from app.engine.combat import interaction from app.engine.game...
* m; return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), dot(p2,x2), dot(p3,x3) ) ); } float snoise(vec2 v) { const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) -0.577350269189626, // -1.0 + 2.0 * C.x 0.024390243902439); // 1.0 / 41.0 // First corner v...
<filename>generate_wavelets.py # File: generate_wavelets.py # Author: <NAME>, <EMAIL> # Last modified: 2017 Nov. 28 # # A utility script to generate DWT image files for the image files requested. # Parse passed-in arguments: import argparse # Other imports import os import numpy as np # For math and analysis import ...
#!/usr/bin/python # Copyright (c) 2014 SUSE Linux Products GmbH # Copyright (c) 2016 SUSE LLC # # 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 limitati...
<gh_stars>10-100 ''' MIT License Copyright (c) 2017-2018 Cree-Py 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, m...
information in the database self.mainMenu.agents.set_agent_field_db("lost_limit", lostLimit, self.sessionID) # task the agent with the new lostLimit self.mainMenu.agents.add_agent_task_db(self.sessionID, "TASK_CMD_WAIT", "global lostLimit; lostLimit=%s; print('lostLimit set to %s')" % ( lostLimit, lostLimit)) #...
<reponame>moibenko/enstore<filename>sbin/xfer_stats_monthly.py #!/usr/bin/env python ############################################################################### # $Author$ # $Date$ # $Id$ # # public | xfer_by_day | table | enstore # public | xfer_by_month | table | enstore # ########################################...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals from logging import getLogger import operator as op import re from .._vendor.toolz import excepts from ..common.compat import string_type...
""" Provide a standard protocol for asking graph oriented questions of Translator data sources. """ import argparse import json import logging import os import traceback from pathlib import Path import jsonschema import requests import yaml from flasgger import Swagger from flask import Flask, request, abort, Response...
contains regulators that are not accounted for in the selected kinetics." anti_dir = os.path.join(directory, group_name, 'antimony', group_name + '_' + str(ind) + '.txt') with open(anti_dir, 'w') as f: f.write(ant_str) else: rl = [] with open(os.path.join(directory, group_name, 'networks', net[1])) as nl: for i...
wait for here, but that doesn't seem to work reliably. t.join(0.0001) for attr in ('stdout', 'stderr'): s = getattr(self, attr, None) if isinstance(s, Capture): s.add_stream(getattr(p, attr)) if not async_: logger.debug('about to wait for process') p.wait() finally: self.process_ready.set() logger.debug('ret...
from matplotlib.pyplot import plot import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math import os import csv from tripedal_kinematics import TripedalKinematics COS120 = math.cos(math.pi * 2 / 3) SIN120 = math.sin(math.pi * 2 / 3) COS240 = math.cos(-math....
<filename>dbcArchives/2021/000_0-sds-3-x-projects/student-project-17_group-TowardsScalableTDA/00_introduction.py # Databricks notebook source # MAGIC %md # MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html) # COMMAND ----...
import hashlib import json import os import shutil import time from collections import Counter from pathlib import Path from typing import Dict, List, Optional, Set, Tuple, Union import numpy as np import pandas as pd from fire import Fire from pydantic import BaseModel from pydantic.main import Extra from tqdm import...
<filename>pythoms/spectrum.py """ This class is designed to efficiently combine, add to, or otherwise manipulate spectra together whose dimensions are not equal. For example, combining mass spectra together where resolution to the 3rd decimal (not to the 10th decimal) is desired. Upon initialization, specify the number...
if 66 - 66: I11i + iII111i iI1IIII1ii1 += I111IoOo0oOOO0o . encode ( ) I111IoOo0oOOO0o . print_record ( " " , True ) if 50 - 50: IiII if ( OOOoo0ooooo0 == 0 ) : return ( iI1IIII1ii1 ) if 33 - 33: OOooOOo % I1IiiI - I1IiiI / IiII for ooOiiI1Ii11 in ddt_entry . delegation_set : i1iIiII = lisp_rloc_record ( ) i1iI...
<gh_stars>1-10 from __future__ import division import ConfigParser import numpy as np from scipy.optimize import minimize import csv import cPickle as pickle import timeit import os import multiprocessing import sys import math import shutil sys.path.insert(0,os.path.realpath('../reactions')) import parent import hairp...
<filename>Lib/defcon/test/objects/test_glyph.py import unittest from defcon import Font, Glyph, Contour, Component, Anchor, Guideline, Layer from defcon.test.testTools import getTestFontPath class GlyphTest(unittest.TestCase): def __init__(self, methodName): unittest.TestCase.__init__(self, methodName) def test_...
"""Django-like (in the sense of "class-based") forms for tkinter""" import inspect import copy import tkinter as tk import tkinter.messagebox as tk_msg from .. import tkstuff as mtk try: import typing except ImportError: typing = None import enum import collections class FormWidget(mtk.ContainingWidget): """Prov...
included. Rather # than include a complicated search, this is a # hard-coded path. It could bail out if X11 libs are # not found... # tk_include_dirs.append('/usr/X11R6/include') frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] ext.include_dirs.extend(tk_include_dirs) ext.extra_link_args.extend(frameworks...
import abc import random from . import diceast as ast from . import errors __all__ = ( "Number", "Expression", "Literal", "UnOp", "BinOp", "Parenthetical", "Set", "Dice", "Die", "SetOperator", "SetSelector" ) # ===== ast -> expression models ===== class Number(abc.ABC, ast.ChildMixin): # num """ The base class ...
<filename>abs_templates_ec/analog_mos/planar.py<gh_stars>0 # -*- coding: utf-8 -*- from typing import TYPE_CHECKING, Dict, Any, List, Optional, Union, Tuple import math from collections import namedtuple from bag.math import lcm from bag.util.search import BinaryIterator from bag.layout.util import BBox from bag.lay...
this operator's fit method. """ return self.get_schema('input_fit') def input_schema_predict(self): """Returns the schema for predict method's input. Returns ------- dict Logical schema describing input required by this operator's predict method. """ return self.get_schema('input_predict') def input_...
<reponame>JainSamyak8840/deepchem<gh_stars>0 class Loss: """A loss function for use in training models.""" def _compute_tf_loss(self, output, labels): """Compute the loss function for TensorFlow tensors. The inputs are tensors containing the model's outputs and the labels for a batch. The return value should be ...
"""Implements an algorithm for stacking velocity computation""" import numpy as np import networkx as nx from numba import njit @njit(nogil=True) def get_closest_index_by_val(val, array): """Return indices of the array elements, closest to the values from `val`.""" return np.array([np.argmin(np.abs(v - array)) for...
focus. """ focus_vals = [np.var(z) / (np.mean(z)+1e-8) for z in zstack] best_focus_slice = np.argmax(focus_vals) return best_focus_slice def find_best_focus_stacks(zstacks): """ Finds the best focus slice of a series of z-slice stacks and constructs an array composed of the best-focus slices. Parameters -...
from sympy import (Symbol, S, exp, log, sqrt, oo, E, zoo, pi, tan, sin, cos, cot, sec, csc, Abs, symbols) from sympy.calculus.util import (function_range, continuous_domain, not_empty_in, periodicity, lcim, AccumBounds) from sympy.core import Add, Mul, Pow from sympy.sets.sets import Interval, FiniteSet, Complement, ...
import numpy as np import math import bisect import scipy.stats as stats from typing import TypeVar, Callable from gym_fabrikatioRL.envs.env_utils import UndefinedInputType from copy import deepcopy # indicates generic types T = TypeVar('T') class SchedulingDimensions: """ Initializes and stores scheduling problem...
unreachable / succeeded. The results are put in (Class).ansible_results, keyed by category name. """ # The json_end_idx reference below is important. The playbook run is in json output, # however the text we're opening here is a mix of free-text and json. # it's formatted like this. # <optional> free text # Gia...
<reponame>BubuLK/sfepy<gh_stars>100-1000 """ python3 script/gen_serendipity_basis.py > sfepy/discrete/fem/_serendipity.py """ import sympy as sm x, y, z = sm.symbols('x y z') all_bfs = { 2: { 1 : [ 0.25 * (1 - x) * (1 - y), 0.25 * (1 + x) * (1 - y), 0.25 * (1 + x) * (1 + y), 0.25 * (1 - x) * (1 + y), ], 2 : [...
# Copyright 2020 <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 ...
else: hc = convert(h["value"], h["unit"], "m") wc = convert(w["value"], w["unit"], "kg") if isinstance(hc, Left): return hc elif isinstance(wc, Left): return wc bmi = wc.value / (hc.value * hc.value) return convert(bmi, "kg/m^2", unit).map(lambda bmic: { "variableValue": { "value": bmic, "unit": unit }, "...
57, 45, 45, 45, 45, 45, 45), False, 0 , 6), 46 : ((0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 54, 0 , 0 , 0 , 0 , 0 ), True , 18, 1), 47 : ((0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 54, 0 , 0 , 0 , 0 ), True , 18, 1), 48 : ((0 , 0 , 0 , ...
#!/usr/bin/python # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
<reponame>lujiwei/impala # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
set the property to. """ pass @staticmethod def SetFontWeight(element,value): """ SetFontWeight(element: DependencyObject,value: FontWeight) Sets the value of the System.Windows.Controls.TextBlock.FontWeight�attached property on a specified dependency object. element: The dependency o...
<reponame>albertometelli/remps """ Relative entropy policy model search Reference: https://pdfs.semanticscholar.org/ff47/526838ce85d77a50197a0c5f6ee5095156aa.pdf Idea: use REPS to find the distribution p(s,a,s') containing both policy and transition model. Then matches the distributions minimizing the KL between the p ...
from typing import Dict, Iterator, List, NamedTuple, Optional, Sequence, Set, Tuple from eth_typing import BLSPubkey, Hash32 from eth_utils import ValidationError, encode_hex from eth2._utils.bls import bls from eth2._utils.hash import hash_eth2 from eth2.beacon.committee_helpers import compute_shuffled_index from et...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Models declaration for application ``django_mailbox``. """ from email.encoders import encode_base64 from email.message import Message as EmailMessage from email.utils import formatdate, parseaddr, parsedate_tz, parsedate_to_datetime from quopri import enco...
import time import h5py import hdbscan import numpy as np import torch from sklearn.cluster import MeanShift from pytorch3dunet.datasets.hdf5 import SliceBuilder from pytorch3dunet.unet3d.utils import get_logger from pytorch3dunet.unet3d.utils import unpad logger = get_logger('UNet3DPredictor') class _AbstractPred...
#!/usr/bin/env python3 """ HIASCDI Entities Module. This module provides the functionality to create, retrieve and update HIASCDI entities. MIT License Copyright (c) 2021 Asociación de Investigacion en Inteligencia Artificial Para la Leucemia <NAME> Permission is hereby granted, free of charge, to any person obtain...
#!/usr/bin/env python ############################################################################### import os, sys from copy import deepcopy #toz - syntax error r19 - missing opcode sbc # cant add opcode due to ambiguous parse (sbc/sbci) #############################################################################...
= {} assert pmnc.versioned.foo(1, 2, biz = "baz", __module_properties = module_props) == \ ((1, 2), { "biz": "baz" }) assert module_props == { "version": 1 } module_props["version"] = "should be a copy" write_module("versioned.py", "__all__ = ['foo']\n" "def foo(*args, **kwargs):\n" " return args, kwargs\n" ...
height = int(height) # Get the previous surface if the width/height is the same if width == self._widgets_surface_last[0] and \ height == self._widgets_surface_last[1]: self._widgets_surface = self._widgets_surface_last[2] else: self._widgets_surface = make_surface(width, height) self._widgets_surface_last = (w...
LA5_1 = self.input.LA(2) if (LA5_1 == 93) : alt5 = 2 elif ((0 <= LA5_1 <= 92) or (94 <= LA5_1 <= 65535)) : alt5 = 1 elif ((0 <= LA5_0 <= 92) or (94 <= LA5_0 <= 65535)) : alt5 = 1 if alt5 == 1: # src/SavedFSM/Monitor.g:166:46: . pass self.matchAny() else: break #loop5 self.match("]]") self._stat...
# -*- coding: utf-8 -*- #インポート import discord from discord.ext import commands from discord.ext.commands.errors import BotMissingPermissions from contextlib import redirect_stdout from discord.ext.commands import Bot import random import asyncio import aiohttp import os import subprocess import dateti...
""" Deletes an integration with the given ID Args: client: Demisto client instance instance_id: The instance ID to Delete Returns: True if integration was deleted else False """ self.build_context.logging_module.debug(f'Deleting {self} instance') instance_id = instance_id or self.integration_configuration_fro...
# -*- coding: utf-8 -*- """ This file contains implementations of the functions used to train a CNN model: train_cnn - Function used to facilitate the training of the Convolutinal Neural Network model. test_cnn - Function used to facilitate the testing of the Convolutinal Neural Network model. """ # Built-in/Gene...
h0=0, x0=0.25): # The plunge maneuver is defined by the following equation: # V(t) = -Vmax*sin^2(pi*t/T), where T is the maneuver duration and # Vmax is the peak plunge velocity, reached in the middle of the # maneuver, for t/T = 0.5. If we integrate V, we obtain the motion of # the airfoil in the vertical directi...
""" This file contains several abstract classes: * TorchForecastingModel is the super-class of all torch (deep learning) darts forecasting models. * PastCovariatesTorchModel(TorchForecastingModel) for torch models consuming only past-observed covariates. * FutureCovariatesTorchModel(TorchForecastingModel) for torc...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import numpy as np from scipy.constants import epsilon_0 from ipywidgets import IntSlider, FloatSlider, FloatText, ToggleButtons import matplotlib.pyplot as plt from matplotlib.colors import LogNorm f...
<reponame>Bpowers4/turicreate<filename>src/python/turicreate/toolkits/object_detector/object_detector.py # -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/l...
<reponame>matcolgit/simulator_sib<filename>sim/lib/dynamics_old.py import time import bisect import numpy as np import pandas as pd import networkx as nx import scipy import scipy.optimize import scipy as sp import os, math import matplotlib.pyplot as plt from joblib import Parallel, delayed from sympy import Symbol, i...
import FWCore.ParameterSet.Config as cms EletightIsoCut = "(gsfElectronRef.pfIsolationVariables.sumChargedHadronPt + max(0., gsfElectronRef.pfIsolationVariables.sumNeutralHadronEt + gsfElectronRef.pfIsolationVariables.sumPhotonEt - 0.5 * gsfElectronRef.pfIsolationVariables.sumPUPt) ) / gsfElectronRef.pt < 0.1" Eleloos...
<filename>pytest_docker_registry_fixtures/fixtures.py<gh_stars>0 #!/usr/bin/env python # pylint: disable=redefined-outer-name,too-many-arguments,too-many-locals """The actual fixtures, you found them ;).""" import logging import itertools from base64 import b64encode from distutils.util import strtobool from functo...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.108071, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
<filename>VAE_functions.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 16 10:59:14 2018 @author: anazabal """ import csv import numpy as np import tensorflow as tf import loglik_models_missing_normalize def place_holder_types(types_file, batch_size): # Read the types of the data from th...
# Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause """ Base Algorithm for lattice Boltzmann methods ============================================ This module describes various methods involved during the computation of a solution using lattice Boltzmann methods. The default kernels defined her...
= "minecraft:warped_planks" crimson_slab = "minecraft:crimson_slab" warped_slab = "minecraft:warped_slab" crimson_pressure_plate = "minecraft:crimson_pressure_plate" warped_pressure_plate = "minecraft:warped_pressure_plate" crimson_fence = "minecraft:crimson_fence" warped_fence = "minecraft:warped_fence" crimson...
" 3650 -nodes -subj /commonName=" "{hostname}/emailAddress={email}" " -out /etc/ssl/certs/postfix.pem" " -keyout /etc/ssl/private/" "postfix.pem" .format(hostname=EEVariables.ee_fqdn, email=EEVariables.ee_email)) EEShellExec.cmd_exec(self, "chmod 0600 /etc/ssl/private" "/postfix.pem") EEShellExec.cmd_exec(self...
<reponame>davisyoshida/finetune-transformer-lm<gh_stars>0 import os import time import math import json import joblib import random import argparse import numpy as np import tensorflow as tf from tqdm import tqdm from functools import partial from sklearn.utils import shuffle from sklearn.metrics import accuracy_score...
'VIEW_3D' bl_region_type = 'UI' bl_category = "Automation Tools" bl_options = {'DEFAULT_CLOSED'} bl_parent_id = BrushPanel.bl_idname def draw(self, context): layout = self.layout column = layout.column() column.operator("brush.draw_brush_template_settings_1", text = "Preset 1") column.operat...
94)) night1 = Shift( "Night_1", "N1", datetime.time(21, 15), 12, roles=["Night", "Night_1"], resident=True, shift_type=SHIFT_TYPES.FULL, rgb=(146, 208, 80)) night2 = Shift( "Night_2", "N2", datetime.time(21, 15), 12, roles=["Night", "Night_2"], resident=True, shift_type=SHIFT_TYPES.FULL, rgb=(79, 98, 40)) off ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v2021.2.1), on Thu Aug 5 14:03:29 2021 If you publish work using this script the most relevant publication is: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. (2019) PsychoPy2: Experim...
<reponame>govvijaycal/carla<filename>PythonAPI/util/raycast_sensor_testing.py #!/usr/bin/env python # Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. ...
5.111 8.080 7.645 1.00 20.00 N ATOM 2 CA THRA1 2 5.000 6.722 7.125 1.00 20.00 C ATOM 3 C THRA1 3 5.075 5.694 8.249 1.00 20.00 C TER ATOM 4 O THRB1 4 5.890 5.818 9.163 1.00 20.00 O ATOM 5 CB THRB1 5 6.101 6.421 6.092 1.00 20.00 C TER ATOM 6 OG1 THRA1 6 6.001 7.343 5.000 1.00 20.00 O ATOM 7 CG2 THRA1 7 5.964 5.000 5.565 ...
<filename>characterClass.py<gh_stars>1-10 import intro import itemGen from msvcrt import getch, kbhit from time import sleep from random import randint profList = ["Warrior", "Mage", "Thief", "Innkeeper", "Baker", "Fisherman", "Doctor"] class Character(object): totalChars = 0 # Static method to keep track of tota...
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
is None: umsg ('Segmentation map not opened') return if len(smod.regions) <= 1: umsg ('%s has %d regions' % (smod.name, len(smod.regions))) return csyms = None if self.useSymmetry.get() : print "Using symmetry..." self.DetectSym () csyms = [self.scenters, self.syms] regions = None if 0 and self.groupBy...
from collections import OrderedDict import ujson from django.conf import settings from utils import solr from utils.camel_case import render, parser from .uris import APIUris from .simpleserializers import SimpleSerializer, SimpleSerializerWithLookups import logging # set up logger, for debugging logger = logging.g...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import division, absolute_import, print_function import os import ate...
so_connections['name'] = "Sales Order" so_connections['count'] = sales_order_count so_connections['icon'] = "https://erpcloud.systems/icons/sales_order.png" connections.append(so_connections) if delivery_note_count > 0 and doc_data: dn_connections['name'] = "Delivery Note" dn_connections['count'] = delivery_note...
import os import platform import shutil import time from utils import FilterBlock, FilterManager import settings SHOW = 'Show' HIDE = 'Hide' DEBUG = SHOW if settings.DEBUG else HIDE CLASS_TWO_HAND = '"Bows" "Two Hand" "Staves"' CLASS_SMALL_ONE_HAND = '"Daggers" "Wands"' CLASS_BIG_ONE_HAND = '"Quivers" "Shields" "Cla...
<reponame>mesoscope/cellpack ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by # # $Header: /opt/cvs/python/packages/share1.5/mglutil/math/transformation.py,v 1.45 2007/07/24 17:30:40 vareille Exp $ # import numpy as np from . import rotax # from mglutil.math.VectorModule import Vector Vector = None # ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
"_histo_Y.png", bins=10) self.histo(pz, basename + ingr.name + "_histo_Z.png", bins=10) # do it for all ingredient cumulate? def occurence_distribution(self, ingr): basename = self.env.basename occ = self.env.occurences[ingr.name] self.simpleplot(range(len(occ)), occ, basename + ingr.name + "_occurence.png") d...
<gh_stars>0 from copy import deepcopy from ray import tune import numpy as np import os from softlearning.misc.utils import get_git_rev, deep_update DEFAULT_KEY = "__DEFAULT_KEY__" # M = number of hidden units per layer # N = number of hidden layers # M = 512 # N = 2 M = 256 N = 2 REPARAMETERIZE = True NUM_COUPLING...
# -*- coding: utf-8 -*- """ Module to compute least cost xmission paths, distances, and costs for a clipped area. """ import geopandas as gpd import logging import numpy as np import pandas as pd import rasterio from shapely.geometry import Polygon from shapely.geometry.linestring import LineString from shapely.ops imp...
### First draft of a Quantum Circuit object import numpy as np def kron(*args): ## multiple kronecker product qb = np.array([[1.0]]) for q in args: qb = np.kron(qb, q) return qb def n_kron(n, vector): ## n kronecker product with itself ret = np.array([[1.0]]) for _ in range(n): ret = np.kro...
# Graph ensemble for AMR from random import shuffle import argparse import penman from amrlib.evaluate.smatch_enhanced import compute_smatch from ensemble.utils import match_pair, align, get_entries import re from penman.model import Model import time import warnings model = Model() warnings.filterwarnings("ignore")...
<filename>BackmanAlgorithm/SmoothPlannerClass.py import numpy as np from numpy import sin, cos, tan import matplotlib.pyplot as plt from PathSegmentClass import SpiralSegment, CCSegment, LineSegment, C2ArcSegment, C2LineSegment, FullPath class SmoothPathPlanner: """ Class for implementation of Smooth curvature path ...
trains on each day of the week that start, end or make an intermediate stop at a TIPLOC Input parameters: ----------------- flow_dataframe: Pandas dataframe with details of the weekly train timetable information path_criteria: String column name that contains the TIPLOC path information of each train Result: ...