input
stringlengths
2.65k
237k
output
stringclasses
1 value
# coding: utf-8 from __future__ import absolute_import """ Copyright 2020 Jackpine Technologies Corporation 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/LICEN...
for listval in itemvalue[1:]: # print 'Formatting %s' % `listval` stringsink.write(self.list_delimiter,do_tab=False) self.format_value(listval,stringsink,compound=True) stringsink.write(']',unindent=True) elif isinstance(itemvalue,dict): stringsink.set_tab(0) stringsink.write('{',newindent=True,mustbreak=compoun...
<gh_stars>1-10 # This file is part of the Data Cleaning Library (openclean). # # Copyright (C) 2018-2021 New York University. # # openclean is released under the Revised BSD License. See file LICENSE for # full license details. """Generic outlier detector that uses scikit-learn outlier detection or clustering algorith...
<filename>dataset_builder.py import datetime from pathlib import Path import numpy import io import math from pydub import AudioSegment, silence, effects from pydub.utils import mediainfo from pydub.playback import play from dearpygui.core import * from dearpygui.simple import * import os import ntpath impo...
<reponame>andhus/tensorflow # Copyright 2015 The TensorFlow 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 # # Un...
option in options: if not isinstance(option, int): raise Exception("Invalid value in options of multiple choice integer field, " + str( option) + ', expected int value but found ' + str(type(option))) if len(options) != len(set(options)): raise Exception("Duplicate values passed for options of multiple choice inte...
<reponame>TieWei/molecule # Copyright (c) 2015 Cisco Systems # # 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, mod...
# Copyright Epic Games, Inc. All Rights Reserved. import datetime import logging import os import threading from typing import List, Optional, Set from PySide2 import QtCore from PySide2 import QtGui from PySide2 import QtUiTools from PySide2 import QtWidgets from switchboard import config from switchboard import co...
<gh_stars>0 import numpy as np import pytest from obp.dataset import linear_behavior_policy_logit from obp.dataset import logistic_reward_function from obp.dataset import SyntheticSlateBanditDataset from obp.ope import SlateIndependentIPS from obp.ope import SlateRewardInteractionIPS from obp.ope import SlateStandardI...
<reponame>DjBushido/libcvautomation<gh_stars>1-10 """ libcvautomation_funcs.py This is a high-level wrapper intended to give you easy access to libcvautomation, while staying flexible and powerful. This wrapper was designed to be like the Bash wrapper of the same name, but allows access to the advanced features of Pyt...
import numpy as np from .VariationalPrinciple import VariationalPrinciple from Florence import QuadratureRule, FunctionSpace from Florence.FiniteElements.LocalAssembly.KinematicMeasures import * from Florence.FiniteElements.LocalAssembly._KinematicMeasures_ import _KinematicMeasures_ from .DisplacementPotentialApproac...
= Button(keyboard_lbl, text=row2[3], bg=buttoncolor_char, border=0, highlightthickness=0, activebackground=buttoncolor_char, font=font, command=lambda: keyboard_entry.insert(END, row2[3])) b2_3.grid(row=2, column=3) b2_4 = Button(keyboard_lbl, text=row2[4], bg=buttoncolor_char, border=0, highlightthickness=0, act...
<filename>uwsgi_it_api/views.py from django.shortcuts import render from uwsgi_it_api.models import * from uwsgi_it_api.config import UWSGI_IT_BASE_UID from django.http import HttpResponse,HttpResponseForbidden,HttpResponseNotFound from django.template.loader import render_to_string import json from functools import wr...
'a2' not in x.attributes and x.a2 == 5: raise Success @TestCase def test_attributes_recurse_3(): argh = pint.uint32_t x = pint.uint32_t().a x.__update__(recurse={'a2':5}) if 'a2' in x.attributes and x.a2 == 5: raise Success @TestCase def test_attributes_static_4(): class argh(parray.type): length = 5 _ob...
# -*- coding: utf-8 -*- from .helpers import EPSILON from .song import Song import dj_feet.feedback from collections import defaultdict import os import random import librosa import numpy from sklearn.decomposition import PCA from copy import copy import scipy import logging l = logging.getLogger(__name__) class Pi...
<filename>gym/envs/ant_v2_cross_maze.py<gh_stars>1-10 import numpy as np import random from gym import utils from gym.envs.mujoco import mujoco_env from gym.envs.mujoco.utils import q_inv, q_mult import xml.etree.ElementTree as ET from os import path class AntCrossMazeEnv(mujoco_env.MujocoEnv, utils.EzPickle): def ...
<gh_stars>0 # https://github.com/Connectome/GoPiGo/blob/master/GoPiGoConnectome.py import math import copy import random class Brain(): thisState = 0 nextState = 1 # Maximum accumulated value that must be exceeded before the Neurite will fire fireThreshold = 30 # Accumulators are used to decide the value to se...
localctx.i is None else localctx.i.text) + (None if localctx.s is None else localctx.s.text) + (localctx.st.type if not localctx.st.type == None else "") pass elif la_ == 9: self.enterOuterAlt(localctx, 9) self.state = 95 localctx.sl = self.match(SessionTypeParser.SLPAR) self.state = 96 localctx.n = self.match...
# -*- coding: utf-8 -*- ''' Optimize the distirbution of material under given displacement boundary conditions so that the stored (hyper/linear) elastic energy is minimized. This script is prepared in a way that enables many different cases to be run one after another thanks to the parametrization of different problem...
import math import struct import btypes from btypes import BinaryRecordType from bprocessor import UnexpectedRecordException, RecordProcessor, RecordRepository, RecordDescriptor error_lookup = { 0x00: '#NULL!', 0x07: '#DIV/0!', 0x0F: '#VALUE!', 0x17: '#REF!', 0x1D: '#NAME?', 0x24: '#NUM!', 0x2A: '#N/A', 0x2...
import collections import pandas as pd big_list = [[{'абсолютно': 1}, {'автомобилеи': 1}, {'аккумулятор': 1}, {'анонимнои': 1}, {'батарея': 2}, {'бесплатно': 1}, {'большой': 1}, {'бонус': 1}, {'будущее': 1}, {'ведущие': 1}, {'вести': 1}, {'весьма': 1}, {'ветряный': 1}, {'внедрять': 1}, {'внутренний': 1}, ...
<reponame>fmareuil/Galaxy_test_pasteur<filename>tools/mytools/ARIA/src/py/aria/Network.py """ Authors: <NAME> Institut Pasteur, Paris IBPC, Paris Copyright (C) 2005 <NAME>, <NAME> and <NAME> No warranty implied or expressed. All rights reserved. $Author: bardiaux $ $Revision: 1.1.1.1 $ $Date: 2010/03/23 15:27:...
<reponame>mmuellerstoffels/GBSTools<gh_stars>1-10 import datetime import matplotlib.dates as md import netCDF4 import numpy as np import pandas as pd from matplotlib import pyplot as plt '''Some helper routines to fix data''' def fillTimeAndPowerVector(inptTime, spacing, inptPwr): outputTime = [] outputPwr = [] ...
<reponame>polyusmart/Poll-Question-Generation<filename>pykp/modules.py import torch import torch.nn as nn from pykp.masked_softmax import MaskedSoftmax class RNNEncoder(nn.Module): def __init__(self, vocab_size, embed_size, hidden_size, num_layers, bidirectional, pad_token, dropout=0.0): super(RNNEncoder, self).__i...
<filename>sample/test_instances.py<gh_stars>0 from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model from django.utils.translation import ugettext_lazy as _ from arcanelab.ouroboros.executors import Workflow from arcanelab.ouroboros.mode...
with self.bg_lock: self.clients.remove(client) client.ap.clients.remove(client) self.service_ctx[client.ap.port_id]['synced'] = False for key, val in dict(self.client_by_id).items(): if val == client: del self.client_by_id[key] @staticmethod def _get_ap_per_port(aps): ap_per_port = {} for ap in aps: if ap....
if locales: for locale in locales: action.pull_translations(locale, locale_ext, no_ext, auto_format) else: action.pull_translations(None, locale_ext, no_ext, auto_format) except UninitializedError as e: print_log(e) logger.error(e) return @ltk.command(name="rm", short_help="Disassociates local doc(s) from Lin...
<gh_stars>0 import torch import torch.nn as nn import math import copy from collections import OrderedDict import torch.utils.model_zoo as model_zoo from core.config import cfg import utils.net as net_utils from deform.torch_deform_conv.layers import ConvOffset2D model_urls = { 'resnet50': 'https://s3.amazonaws.com/p...
based on the paper: "Effective Approaches to Attention-based Neural Machine Translation" by Luong et al. This layer is an attention layer, which can be wrapped around arbitrary RNN layers. This way, after each time step an attention vector is calculated based on the current output of the LSTM and the entire input ...
sessionsUp = int(stats[session]['Sessions Up']) totalSessions = int(stats[session]['Sessions Total']) sessionsNotStarted = int(stats[session]['Sessions Not Started']) expectedSessionsUp = totalSessions - sessionsNotStarted self.ixnObj.logInfo('%-16s %-14s %-16s %-23s %-22s' % (label, sessionsUp, sessionsDown, ex...
<gh_stars>0 ''' Helper module for basic database functionality. Prerequisites: mysql-connector-python. Created on Aug 29, 2017 @author: thay838 ''' # BIZARRE STUFF: Importing pandas at the end of this block causes a # segmentation fault in my docker container. However, having it here # does not. import pandas as pd ...
<gh_stars>1-10 """ This is a module of utilities for manipulation of urban data See my projects that use this module here: https://nbviewer.jupyter.org/github/DmytroTym/urban/tree/master/ """ import pandas as pd import numpy as np import osmnx as ox import io import os from shapely.geometry import Polygon,...
(1, 3, 1)) )/3 - \ sqrt(15)*JzKetCoupled(1, 0, (1, 1, 1), ((1, 2, 2), (1, 3, 1)) )/15 + \ sqrt(3)*JzKetCoupled(2, 0, (1, 1, 1), ((1, 2, 1), (1, 3, 2)) )/3 + \ sqrt(10)*JzKetCoupled(3, 0, (1, 1, 1), ((1, 2, 2), (1, 3, 3)) )/10 assert couple(TensorProduct(JzKet(1, 1), JzKet(1, -1), JzKet(1, -1))) == \ sqrt(3)*JzKetC...
record in punycode format. enable_immediate_discovery: Determines if the discovery for the record should be immediately enabled. extattrs: Extensible attributes associated with the object.For valid values for extensible attributes, see the following information. ipv4addrs: This is a list of IPv4 Addresses for the ...
from collections import defaultdict import contextlib import functools import itertools from typing import ( Callable, Tuple, TypeVar, cast, ) from rlp.codec import encode_raw from eth_hash.auto import ( keccak, ) from eth_utils import ( to_list, to_tuple, ) from trie.constants import ( BLANK_NODE, BLANK_N...
parameter=inspect.Parameter( name="z", kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, ), ), ), ): self.assertEqual(add3(1, 2, 3), 6) def test_multiple_function_parameters_keyword_only(self): @self.regret.parameter(version="1.2.3", name="y") @self.regret.parameter(version="1.2.3", name="z") def add3(x, *, y, ...
0), # 6 to 3 skip -1 (7, -1, -3, 0), # 6 to 4 skip -1 (7, -1, -2, 0), # 6 to 5 thru -1 (7, -1, -1, 0), # 6 to 5 thru -1 ]) def test_rotated_toric_smwpm_decoder_tparity(time_steps, a_t, b_t, expected): tparity = RotatedToricSMWPMDecoder._tparity(time_steps, a_t, b_t) assert tparity == expected def test_rotated_to...
userList.append(arg[0]) timelist.append(arg[1]) uL = list(set(userList)) for ll in range(len(uL)): try: getIndexUser = userList.index(uL[ll]) timeSeen.append(time.strftime("%H:%M:%S", time.localtime(int(timelist[getIndexUser]) / 1000))) recheckData.append(userList[getIndexUser]) except IndexError: conName.appe...
user = user , date = date.Date ('2012-06-21') ) db.time_record.create \ ( daily_record = dr , start = '09:00' , end = '11:30' , work_location = '1' , wp = '9' ) db.time_record.create \ ( daily_record = dr , start = '11:30' , end = '12:45' , work_location = '1' , wp = '22' ) db.time_record.create \ ( d...
in ctx.guild.roles if r.id in rsets["requires_any"] ) output += f"\nThis role requires any of the following roles: {rstring}" if rsets["requires_all"]: rstring = ", ".join( r.name for r in ctx.guild.roles if r.id in rsets["requires_all"] ) output += f"\nThis role requires all of the following roles: {rstring}" ...
the volumes attributes are returned # def get_volume(self, cloud_volume, project_number, auth, verbose): cloud_volume_candidate = run_command(["/bin/findmnt", cloud_volume, "-no", "SOURCE"], False, return_result=True, suppress_error=True) if cloud_volume_candidate != HANA_NOT_RUNNING: value = (cloud_volume_cand...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
# If the package maintainer doesn't want a .sublime-package try: package_zip.getinfo(no_package_file_zip_path) unpack = True except (KeyError): pass # Dependencies are always unpacked. If it doesn't need to be # unpacked, it probably should just be part of a package instead # of being split out. if is_depende...
""" Various codes to work with the initial mass function Written by <NAME>. Distributed under the MIT license (below): -------------------------------------------------------------------------------- The MIT License (MIT) Copyright (c) 2013 <NAME> Permission is hereby granted, free of charge, to any person obtainin...
<reponame>joeshow79/nn_dataflow<gh_stars>0 """ $lic$ Copyright (C) 2016-2019 by The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in ...
: 'gnaw' , '31355' : 'gnome' , '31356' : 'gnp' , '31361' : 'gnu' , '31362' : 'go' , '31363' : 'goa' , '31364' : 'goad' , '31365' : 'goal' , '31366' : 'goat' , '31411' : 'gob' , '31412' : 'goer' , '31413' : 'goes' , '31414' : 'goff' , '31415' : 'gog' , '31416' : 'goggle' , '31421' : 'gogh' , '31422' : 'gogo' , '31423' :...
<gh_stars>1-10 # coding=utf-8 # adapted from https://github.com/huggingface/transformers/tree/master/src/transformers/modeling_utils.py import transformers from transformers import GPT2LMHeadModel import torch import warnings import torch.nn as nn from torch import Tensor from torch.nn import functional as F from torch...
11][2][layer_2] = -1 * context_matrices[i + 11][2][layer_2] context_multiplication(model, context_matrices, i + 11, None) results = model.evaluate(permute_images(X_test, i), y_test, verbose=0) print('index:' , number_of_options, 'test acc: ', round(results[1] * 100, 2)) # save result if it's the best until no...
#!/usr/bin/env python from __future__ import print_function from future import standard_library standard_library.install_aliases() import urllib.request, urllib.parse, urllib.error import json import os import sys import psycopg2 import urlparse import pymongo from flask import Flask from flask import request, render...
/ 2 + max_radius for i, radius in enumerate(proportions): word, freq = top_keys[i], words[top_keys[i]] actual_radius = radius * self.height / 2 if i == 0: canvas.create_oval(self.width / 2 - actual_radius, self.height / 2 - actual_radius, self.width / 2 + actual_radius, self.height / 2 + actual_radius, fill=col...
<gh_stars>0 """Utility functions for working with Climate Cabinet ID's. The Climate Cabinet ID, or CCID, is Climate Cabinet's official specification for giving each region a unique identifying code built out of meanigful sub-codes. We're aiming to keep CCID's as similar to the US Census's GeoID system as possible. The...
import numpy as np import scipy.special import scipy.interpolate import copy from ._dblquad import dblquad try: import pygsl.sf HAVE_GSL = True except ImportError: import scipy.special HAVE_GSL = False class HybridEB(object): def __init__( self, tmin_in, tmax_in, Nbins, linear=False, useArcmin=True, windows...
""" Sharingan project We will try to find your visible basic footprint from social media as much as possible """ from json import loads from typing import Generator from urllib.parse import urljoin import moment from box import Box from sharingan.models import config, person def upload(*args, **kwargs): return p...
<filename>embyapi/models/live_tv_listings_provider_info.py # coding: utf-8 """ Emby Server API Explore the Emby Server API # noqa: E501 OpenAPI spec version: 4.1.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class LiveTvListingsProvi...
# NOTE: DO NOT UPDATE THIS FILE - Create a new views_common.py and place any views there if you need it. then reference # your new one in the urls.py file (which should be edited by you) import os import logging import mimetypes import importlib.util import json import codecs from django.conf import settings # from d...
<filename>junk/color_test.py import cv2 import numpy as np from time import time from math import sqrt from scipy import interpolate def color_gradient_v4(img, edges_x): # new_img = np.zeros_like(img, dtype=np.float32) new_img = img.copy().astype(np.float32) color = np.mean(img[np.argwhere(edges_x[:, 0] > 0), img....
# -------------------------------------------------------------------------- # 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...
y1=min([y1, y2]), x2=max([x1, x2]), y2=max([y1, y2]))] return ia.BoundingBoxesOnImage(bbs, shape=self.image.shape) @property def bbsoi_ud(self): x1 = 0 y1 = 3-0 x2 = 1.5 y2 = 3-1.0 bbs = [ia.BoundingBox(x1=min([x1, x2]), y1=min([y1, y2]), x2=max([x1, x2]), y2=max([y1, y2]))] return ia.BoundingBoxesOnImage(b...
<filename>nipy/neurospin/utils/mask.py # Standard libraries imports import warnings # Major scientific libraries imports import numpy as np # Neuroimaging libraries imports from nipy.io.imageformats import load, nifti1, save, AnalyzeImage import nipy.neurospin.graph as fg def _largest_cc(mask): """ Return the la...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 4 12:32:53 2017 @author: wroscoe """ import os import sys import time import json import datetime import random import glob import numpy as np import pandas as pd from PIL import Image class Tub(object): """ A datastore to store sensor data in ...
<reponame>nickmoreton/wagtail-wordpress-import<gh_stars>10-100 import copy import json from datetime import datetime from functools import cached_property from xml.dom import pulldom from bs4 import BeautifulSoup from django.apps import apps from django.conf import settings from django.utils.module_loading import impo...
import asyncio import discord from datetime import datetime from operator import itemgetter from discord.ext import commands from Cogs import Nullify from Cogs import DisplayName from Cogs import UserTime from Cogs import Message def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") ...
fid.ncattrs()): CS_l2_mds['METADATA']['SPH']['SEA_ICE_FILE'] = fid.xref_sea_ice if ('xref_snow_depth' in fid.ncattrs()): CS_l2_mds['METADATA']['SPH']['SNOW_DEPTH_FILE'] = fid.xref_snow_depth #-- close the netCDF4 file fid.close() #-- return the output dictionary return CS_l2_mds #-- PURPOSE: Get scal...
x = xy[1:1+size] x = int.from_bytes(x,'big') y = xy[1+size:1+size+size] y = int.from_bytes(y,'big') else: raise ECPyException("Invalid encoded point") return Point(x,y,self,False) @staticmethod def _aff2jac(x,y, q): return(x,y,1) @staticmethod def _jac2aff(x,y,z, q): invz = pow(z,q-2,q) sqinvz = ...
from heapq import heappop, heappush import time from scipy import ndimage as ndi import numpy as np import napari from skimage import filters, morphology, feature from skimage.morphology._util import _offsets_to_raveled_neighbors, _validate_connectivity SLEEP_PER_PIX = 0 # --------- # Watershed # --------- def wate...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 14 22:17:32 2021 @author: jmontp """ # %% from os import remove import h5py import numpy as np import pandas as pd from pandas import DataFrame from functools import lru_cache def get_column_name(column_string_list, num_last_keys): ...
"""To add a popup window to the Mahlo HMI PC at the laminators. Designed to be called from the command line over ssl.""" import datetime import json import tkinter import tkinter as tk from tkinter import ttk from dev_common import add_show_messages_button, blank_up, dt_to_shift, exception_one_line, recurse_hover, \ ...
<reponame>miguelsousa/fontbakery import pytest import os from fontTools.ttLib import TTFont from fontbakery.checkrunner import (DEBUG, INFO, WARN, ERROR, SKIP, PASS, FAIL, ENDCHECK) from fontbakery.codetesting import (assert_results_contain, assert_PASS, assert_SKIP, portable_path, TEST_FILE, GLYPHSAPP_TEST_FILE...
= self.pmReadSettings(pmDownloadItem_t["MSG_DL_MR_ZONES"]) setting = self.pmReadSettings(pmDownloadItem_t["MSG_DL_ZONES"]) #zonesignalstrength = self.pmReadSettings(pmDownloadItem_t["MSG_DL_ZONESIGNAL"]) #log.debug("ZoneSignal " + self.toString(zonesignalstrength)) #log.debug("[Process Settings] DL Zone settings "...
to be shown. columns, data = self.cmd.take_action(parsed_args) # Ensure the userdata file is opened mock_open.assert_called_with('userdata.sh') # Ensure the userdata file is closed mock_file.close.assert_called_with() # Set expected values kwargs = dict( meta=None, files={}, reservation_id=None, min_count...
when possible -- currently when all inputs have # an alloc all but one is optimized. local_elemwise_alloc = register_specialize( gof.local_optimizer([T.Elemwise])( local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)), 'local_alloc_elemwise') @gof.local_optimizer([T.Elemwise]) def local_fill_sink(node): ""...
"ValueAxis-1", "labels": { "filter": False, "rotate": 0, "show": True, "truncate": 100 }, "name": "LeftAxis-1", "position": "left", "scale": { "mode": "normal", "type": "linear" }, "show": True, "style": {}, "title": { "text": "Median Indexing Throughput [docs/s]" }, "type": "value" } ] }, "title"...
import os import time from typing import Any, Tuple import pytest from requests.exceptions import HTTPError from autouri.autouri import AutoURI, URIBase from autouri.httpurl import HTTPURL, ReadOnlyStorageError from autouri.s3uri import S3URI from .files import ( common_paths, make_files_in_dir, recurse_raise_if_...
<filename>gym_anm/simulator/simulator.py from collections import OrderedDict import numpy as np import copy from scipy.sparse import csc_matrix from logging import getLogger from .components import Load, TransmissionLine, \ ClassicalGen, StorageUnit, RenewableGen, Bus, Generator from .components.constants import DEV_...
59, 26)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(13) font.setBold(False) font.setItalic(True) font.setWeight(50) self.threshold_vdo_5.setFont(font) self.threshold_vdo_5.setObjectName("threshold_vdo_5") self.threshold_vdo_6 = QtWidgets.QLabel(self.vdo_module) self.threshold_vdo...
<gh_stars>0 """ Preprocessing functions for images. See also nilearn.signal. """ # Authors: <NAME>, <NAME> # License: simplified BSD import collections.abc import copy import warnings import nibabel import numpy as np from joblib import Parallel, delayed from scipy import ndimage from scipy.stats import scoreatperce...
from django.conf import settings from django.contrib.auth.models import User from theJekyllProject.models import ( Page, Post, PostCategory, SiteData, SiteSocialProfile, SiteTheme, Repo ) from github import Github from markdown2 import Markdown import html2markdown import os import re import shutil import subprocess...
# -*- coding: utf-8 -*- import inspect from unittest import mock from collections import OrderedDict from datetime import date, datetime, time, timedelta from django import forms from django.test import TestCase, override_settings from django.utils import translation from django.utils.translation import ugettext as _ ...
"""MH interface -- purely object-oriented (well, almost) Executive summary: import mhlib mh = mhlib.MH() # use default mailbox directory and profile mh = mhlib.MH(mailbox) # override mailbox location (default from profile) mh = mhlib.MH(mailbox, profile) # override mailbox and profile mh.error(format, ...) # print ...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import osirix.pb2.browsercontroller_pb2 as browsercontroller__pb2 import osirix.pb2.dcmpix_pb2 as dcmpix__pb2 import osirix.pb2.dicomimage_pb2 as dicomimage__pb2...
spaces == 56: sys.stdout.write(textwrap.indent(Padding.ScriptsGenerator( self, mixerLengthArg=mixerLengthArg, mixerLevelArg=mixerLevelArg), self.space60) ) countScriptsAdded += 1 elif spaces == 60: sys.stdout.write(textwrap.indent(Padding.ScriptsGenerator( self, mixerLengthArg=mixerLengthArg, mixerLeve...
REAL, flux_ivar_g REAL, flux_ivar_r REAL, flux_ivar_z REAL, maskbits SMALLINT, ref_id BIGINT, ref_cat TEXT, gaia_phot_g_mean_mag REAL, gaia_phot_bp_mean_mag REAL, gaia_phot_rp_mean_mag REAL, parallax REAL, brickname TEXT, ebv REAL, flux_w1 REAL, flux_w2 REAL, flux_ivar_w1 REAL, flux_ivar_w2 REAL, fiber...
funcType: funcRetType = funcType[:funcType.find("(")] funcRetType = funcRetType.replace("__cdecl", "") funcRetType = funcRetType.replace("__fastcall", "") funcRetType = funcRetType.replace("const ", "") funcRetType = funcRetType.strip() returnType = funcRetType returnTinfo = getTinfoForTypeStr(returnType) if no...
{'execute.return_value': '''\ N95_1# show mac address-table Legend: * - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC age - seconds since last seen,+ - primary entry using vPC Peer-Link, (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan VLAN MAC Address Type age Secure NTFY Ports ----...
# -*- coding=utf8 -*- # !/usr/bin/env python try: import cPickle except: import pickle as cPickle import csv import json import random from datetime import datetime import dateutil import matplotlib.pyplot as plt import numpy as np import pandas as pd import pylab as plb import scipy.stats from sklearn.metrics imp...
video_path = 'video/'+ f.filename print(video_path) cap = cv2.VideoCapture(video_path) if not cap.isOpened(): flash('Video cannot Open','error') print("Video cannot Open") return redirect(url_for('current')) _, img_bgr = cap.read() padding_size = 0 resized_width = 1920 video_size = (resized_width, int(img_b...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import random import sys import unicodedata import my_conexion sys.stdout.encoding 'UTF-8' # PROCESAR MENSAJE DE USUARIO def generarRespuesta(mensaje, STATES, username): message_=sinAcentos(mensaje) ans='' v...
something else (e.g., raw integers) will probably cause an # garbage collection error. # # 2) Object Layout: # Besides the Int, String, and Bool objects (which are handled # separately), the garbage collector assumes that each attribute # in an object is a pointer to another object. It, however, # still does as much as...
<filename>Board.py from Coordinates import Coordinates from Cell import Cell import time from termcolor import colored, cprint from AIBoard import AIBoard from copy import deepcopy class Board: def __init__(self, b_or_w): self.grid = [] for row in range(8): self.grid.append([]) for col in range(8): coordinates =...
submodule should at least define these # attributes: # * "_FUNC_WRAPPER_MODULE_NAME_TO_CODE", a dictionary mapping from # the unique fake module names assigned to @beartype-generated # wrapper functions by the @beartype decorator to the compressed # source strings for those fake modules. # * get_source(), a funct...
}) logger.info('Altered current profile to %s' % (data)) emit_node_tuning(noself=True) @SOCKET_IO.on('delete_profile') def on_delete_profile(): '''Delete profile''' if (DB.session.query(Database.Profiles).count() > 1): # keep one profile profile = getCurrentProfile() profile_id = profile.id DB.session.delete(p...
0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), (0.76471, 0.00000, 1.00000), ...
user or group: uid, gid = -1, -1 if user: uid = pwd.getpwnam(user).pw_uid gid = pwd.getpwnam(user).pw_gid if group: gid = grp.getgrnam(group).gr_gid os.fchown(fileno, uid, gid) def shutil_setuid(user = None, group = None, xgroups = None): """ set fork-child uid/gid (returns pw-info env-settings)""" if group: ...
""" @Author Jchakra""" """ This code is to download project information using GitHub API (Following Amrit's Hero paper criteria of how to find good projects) """ from multiprocessing import Process,Lock import time import json import requests ## Downloading all the projects def func1(): repo_result = [] Token...
- member.bdate.year - ((today.month, today.day) < (member.bdate.month, member.bdate.day)) return render_template('runner_detail.html', image_file = member_image, member = member, age = member_age, participated_events = member_participated_events) @app.route("/search_runner") def search_runner(): import re i...
# -*- coding: utf-8 -*- """This module defines functions for query CATH database.""" from os import getcwd, remove from os.path import sep as pathsep from os.path import isdir, isfile, join, split, splitext, normpath import re from numbers import Integral from prody import LOGGER, SETTINGS, PY3K from prody.proteins ...
28.09*m.x583 - 52.17*m.x604 - 52.17*m.x628 - 52.17*m.x635 - 52.17*m.x644 - 52.17*m.x655 - 18.57*m.x666 - 18.57*m.x690 - 18.57*m.x701 + 17.16*m.x712 + 17.16*m.x736 + 17.16*m.x743 - 34.59*m.x752 - 34.59*m.x770 - 34.59*m.x778 - 34.59*m.x785 - 38.19*m.x794 - 38.19*m.x820 - 38.19*m.x828 - 38.19*m.x839 + 16.94*m.x851 - 4...
""" Course API Views """ from completion.exceptions import UnavailableCompletionData from completion.utilities import get_key_to_last_completed_block from django.conf import settings from django.urls import reverse from django.utils.translation import ugettext as _ from edx_rest_framework_extensions.auth.jwt.authentic...
# Copyright 2016, 2017, 2018, 2019, 2020 <NAME> # PhD Thesis # # Copyright 2015, 2016 <NAME> # Master Thesis # Tutor: <NAME> # Winter semester 2015/2016 # # Chair of Bioinformatics # Department of Computer Science # Faculty of Engineering # Albert-Ludwigs-University Freiburg im Breisgau __author__ = 'joachimwolff' fr...
>>> mp.dps = 15 >>> quad(lambda t: t**2.5*(1-t)**2, [0, 1]) 0.0230880230880231 >>> beta(3.5, 3) 0.0230880230880231 >>> quad(lambda t: sin(t)**4 * sqrt(cos(t)), [0, pi/2]) 0.319504062596158 >>> beta(2.5, 0.75)/2 0.319504062596158 """ betainc = r""" ``betainc(a, b, x1=0, x2=1, regularized=False)`` gives the gen...