input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
`(lat, lon, Y2P, P2Y, Dx, Dy)`.
The transforms returned by this method can be used to easily convert back
and forth between spherical harmonic coefficients and intensities on a
discrete pixelized grid. Projections onto pixels are performed on an
equal-area Mollweide grid, so these transforms are useful for applyin... | |
#!/usr/bin/env python3
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Class holds default settings for json requests to Ghost -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
import sys
import os
import importlib
import requests
import jwt
from datetime import datetime
import jso... | |
<reponame>piraz/firenado
# -*- coding: UTF-8 -*-
#
# Copyright 2015-2021 <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 requi... | |
<reponame>wyq24/suncasa<filename>suncasa/pygsfit/gsutils.py
import numpy as np
# import sys
import math
import os, sys, platform
import astropy.units as u
from sunpy import map as smap
from astropy.coordinates import SkyCoord
from suncasa.io import ndfits
import lmfit
from astropy.time import Time
import matplotlib.pyp... | |
<reponame>bayeshack2016/icon-service
# -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# 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
#... | |
<gh_stars>100-1000
#!/usr/bin/env python
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
# python system package
import json
import datetime
import uuid
import random
import string
import logging
import copy
from traceback import format_exc
# django package
from iondb.bin.djangoinit import *
from d... | |
"""Functions for loading/saving/reducing flash data
General terminology
-------------------
dat: Integrated time-series quantities found in [model].dat file
chk: Checkpoint data found in 'chk' files
profile: Radial profile data as extracted from chk files
multiprofile: A single Dataset of multiple profiles
log: D... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import os
import queue
import sys
import time
from .model import DeepSpeechReconstructionModel, get_variable_by_name
LOG_LEVEL_INDEX = sys.argv.index('--log_level') + 1 if '--log_level' in sys.a... | |
exn:
# smooth over race condition with multiple processes trying to init swarm
if "already part of a swarm" not in str(exn):
raise exn
logger.notice( # pyre-fixme
_(
"waiting for local docker swarm manager & worker(s)",
manager=state,
workers=len(worker_nodes),
)
)
time.sleep(2)
miniwdl_services = [
d
f... | |
not self.pp_stack[-1].seen_else:
# This is the first #else or #elif block. Remember the
# whole nesting stack up to this point. This is what we
# keep after the #endif.
self.pp_stack[-1].seen_else = True
self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack)
# Restore the stack to how it was before the ... | |
##
# Copyright (c) 2013-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
"""
Utility methods to deal with "names" of relations.
To be safe, we always delimit names in queries but would prefer not to during logging.
See TableName.
There are additional methods and classes here to support the feature of choosing relations
by a pattern from the command line.
"""
import fnmatch
import re
impo... | |
VNI pool ID (required)
:type vni_pool: :class:`com.vmware.nsx.model_client.VniPool`
:param vni_pool: (required)
:rtype: :class:`com.vmware.nsx.model_client.VniPool`
:return: com.vmware.nsx.model.VniPool
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Service Unavailable
:raise: :class:`com... | |
<filename>pycatia/hybrid_shape_interfaces/hybrid_shape_conic.py<gh_stars>10-100
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are ther... | |
#######################################################################
############################# PART 1 - Import CSV FILE ################
#######################################################################
# First we'll import the os module
# This will allow us to create file paths across operating systems
i... | |
import abc
import six
import inspect
from functools import partial
import numpy as np
from tsfuse.data import Tags
from ..data import Collection
from ..errors import InvalidPreconditionError
@six.add_metaclass(abc.ABCMeta)
class Node(object):
"""
Node of a computation graph.
Parameters
----------
parents : l... | |
import pprint
import re
from typing import Any, Dict
import numpy as np
import pytest
from qcelemental.molutil import compute_scramble
from qcengine.programs.tests.standard_suite_contracts import (
contractual_accsd_prt_pr,
contractual_ccd,
contractual_ccsd,
contractual_ccsd_prt_pr,
contractual_ccsdpt_prccsd_pr,
... | |
objs, pyObjs
elif not ready:
objs = objs + updates
objs.append(NotesEnd)
pyObjs[acnt][tableName]['deltas']['all'] = '[E] ERROR'
raise ValueError('[E] Table is not ready ', tableName, title)
return
objs = objs + updates
# printer ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
# printer ("~~~~~~~... | |
from django.utils.translation import gettext_lazy as _
SLICE_EFFECTIVE = (
("00", _("0 salarié (n'ayant pas d'effectif au 31/12 mais ayant employé des salariés au cours de l'année de référence)")),
("01", _("1 ou 2 salariés")),
("02", _("3 à 5 salariés")),
("03", _("6 à 9 salariés")),
("11", _("10 à 19 salariés")),
("... | |
0, 0, 2, -1]
waste -1.8 0.9798 [-2, -2, -1, -3, -2, -1, -1, -4, -1, -1]
wasted -2.2 0.6 [-2, -3, -2, -3, -1, -3, -2, -2, -2, -2]
wasting -1.7 0.9 [-3, -1, -2, -2, -1, -2, -3, 0, -1, -2]
wavering -0.6 1.0198 [-1, -1, 0, 0, -1, -1, -1, 2, -1, -2]
weak -1.9 0.7 [-1, -3, -2, -2, -3, -2, -2, -1, -2, -1]
weaken -1.8 0.6 [-2,... | |
= "tensor",
input = 0.5 * T.mean(T.sqr(gan_net.layers['D(x)'].output - 1)) + \
0.5 * T.mean(T.sqr(gan_net.layers['D(G(z))'].output)),
input_shape = (1,),
id = "discriminator_task"
)
gan_net.add_layer ( type = "objective",
id = "discriminator_obj",
origin = "discriminator_task",
layer_type = 'value',
objectiv... | |
socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.SOL_TCP)
else:
this_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
if this_socket:
try:
if self.useInetSocket:
this_socket.connect((self.socketHost, self.socketPort))
else:
this_socket.connect(self.socket_name)
except:
this_socket.close()
... | |
#!/usr/bin/env python3
# -*- coding : utf-8 -*-
# PyAX-12
# The MIT License
#
# Copyright (c) 2010,2015 <NAME> (http://www.jdhp.org)
#
# 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... | |
<gh_stars>0
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import (QGridLayout, QGroupBox, QLineEdit, QHBoxLayout,
QWidget, QLabel, QPushButton, QVBoxLayout,
QComboBox, QScrollArea, QMainWindow)
import pyqtgraph as pg
from ecogvis.functions.misc_dialogs import SelectChannelsDialog
from .FS_colorLUT import get_l... | |
of TypedList support all operations available for
Python Lists (as of Python version 1.5.2a2)
"""
_is_a_typed_list = 1
def __init__(self, function, elements=None):
self._func = function
self.elements = []
if not elements is None:
if self._func(elements):
self.elements.append(elements)
else:
for el in elem... | |
import json
import os
import torch
import torch.nn as nn
from utils import get_latest_timestamp
def create_embedding(size):
return nn.Embedding(*size, _weight=torch.zeros(*size).normal_(0, 0.01))
def create_embeddings(embedding_meta_dict):
embedding_dict = dict()
for key, value in embedding_meta_dict.items():
... | |
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.048789,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic':... | |
cb.set_active(self.tree_view_dict['songs'].get_rules_hint())
hbox.pack_start(cb)
display_box.pack_start(hbox, False, False, 0)
hbox = gtk.HBox()
hbox.pack_start(gtk.Label(" "), False, False, 0)
cb = gtk.CheckButton(_("Playlist Column"))
cb.connect("toggled", self.toggle_alternate_row_colors, 'playlist')
cb.set_... | |
= block
def diff_info(self):
return (While, self.condition)
def get_children(self, f):
f(self)
for i in self.block:
i.get_children(f)
def chain(self, next): # @ReservedAssignment
self.next = next
chain_block(self.block, self)
def replace_next(self, old, new):
Node.replace_next(self, old, new)
if self.... | |
<reponame>dyahalomi/koi3278<filename>JointModel/JointMCMC_analyze.py
"""
Analyze the results of an MCMC run.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
from scipy import interpolate
from JointMCMC_funcs import msage, kepler_problem, isointerp, loadisos, solve_WDmassRV, ... | |
sorted_arguments_list
# print("ordered results_list: ", results_list)
# print("ordered arguments_list: ")
for arguments in arguments_list:
print(arguments)
if dimensions is not None:
validity_values = []
for i, arguments in enumerate(arguments_list):
valid = True
for j, dim in enumerate(dimensions):
arg_valu... | |
<reponame>shilpiprd/sympy<filename>sympy/sets/handlers/intersection.py
from sympy import (S, Dummy, Lambda, symbols, Interval, Intersection, Set,
EmptySet, FiniteSet, Union, ComplexRegion, Mul)
from sympy.multipledispatch import dispatch
from sympy.sets.conditionset import ConditionSet
from sympy.sets.fancysets import... | |
)
# clusters = main.topo.getAllClusters( main )
# mnSwitches = main.Mininet1.getSwitches()
# mnLinks = main.Mininet1.getLinks()
# mnHosts = main.Mininet1.getHosts()
# main.step( "Comparing MN topology to ONOS topology" )
# for controller in range( main.numCtrls ):
# controllerStr = str( controller + 1 )
# if ... | |
# coding: UTF-8
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import warnings
warnings.filterwarnings("ignore")
import argparse
import numpy as np
import shutil
import PIL
import time
from imageio import imread, imsave
from googletrans import Translator
import torch
import torchvision
import torch.nn.functional as ... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import time
import logging, socket, traceback
from os import path as opath
from struct import pack
import cPickle as pickle
import aerospike
from aerospike.exception import RecordNotFound, AerospikeError
from leveldb import LevelDBError
from threathunter_common.util import ip_mat... | |
# Copyright 2013 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | |
"""
Django settings for vmi (Verify My Identity) project.
Copyright Videntity Systems Inc.
Generated by 'django-admin startproject' using Django 2.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.django... | |
#
# BSD 3-Clause License
#
# Copyright (c) 2019, Analog Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, ... | |
#!/usr/bin/env python
################################
# Interactive UPNP application #
# <NAME> #
# 07/16/2008 #
################################
import sys
import os
import re
import platform
import xml.dom.minidom as minidom
import IN
import urllib
import urllib2
import readline
import time
import pickle
import str... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from subprocess import call
import pygraph.readwrite
from pygraph.classes.digraph import digraph
from propsde.graph_representation.newNode import Node, isDefinite, getCopular, \
getPossesive, EXISTENSIAL
from pygraph.algorithms.accessibility import accessibility
from propsde.grap... | |
backup copy is stored in "
iIiIIIi = lisp . lisp_print_sans ( iIiIIIi )
iIiIIIi += lisp . lisp_print_cour ( "./lisp.config.before-clear" )
return ( lispconfig . lisp_show_wrapper ( iIiIIIi ) )
if 19 - 19: iIii1I11I1II1
if 26 - 26: OoooooooOO % I1IiiI % Oo0Ooo . I1IiiI % Ii1I
if 34 - 34: IiII / OoOoOO00
if 87 - 8... | |
self._PGenr.TimeType
DateType = self._PGenr.DateType
IntegerType = self._PGenr.IntegerType
DecimalType = self._PGenr.DecimalType
PositiveIntegerType = self._PGenr.PositiveIntegerType
NegativeIntegerType = self._PGenr.NegativeIntegerType
NonPositiveIntegerType = self._PGenr.NonPositiveIntegerType
NonNegativeInteg... | |
= self.storage_config['dimensions']
dimensions = dimension_config.keys()
index_dimensions = indices_dict.keys()
dimension_names = [dimension_config[dimension]['dimension_name'] for dimension in dimensions]
# Dict of dimensions and sizes read from netCDF
nc_shape_dict = {dimensions[index]: len(self.netcdf_object.di... | |
# +--------------------------------------------------------------------------+
# | Licensed Materials - Property of IBM |
# | |
# | (C) Copyright IBM Corporation 2009-2014. |
# +--------------------------------------------------------------------------+
# | This module complies with Django 1.0 and is |
# | Licensed und... | |
from __future__ import unicode_literals
import glob
import shutil
from os.path import basename, dirname
from typing import Iterable
from jsonpickle import json
from ledger.compact_merkle_tree import CompactMerkleTree
from ledger.genesis_txn.genesis_txn_file_util import create_genesis_txn_init_ledger
from ledger.genes... | |
<filename>pymustache/mustache.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import copy
try:
from html import escape as html_escape
except:
# python 2
import cgi
def html_escape(text):
return cgi.escape(text, quote=True)
DEFAULT_DELIMITERS = ('{{', '}}')
EMPTYSTRING = ""
spaces_not_newline = ' \t\r... | |
reply = f"{reply} {ASK_ABOUT_OFFERED_BOOK}"
confidence = self.super_conf
if not reply:
reply = f"{ACKNOWLEDGE_AUTHOR}. By the way,"
reply = reply.replace("AUTHOR", author_name)
reply = self.book_linkto_reply(reply, human_attr)
confidence = self.default_conf
elif is_wikidata_entity(plain_bookname) and n_years_ago... | |
dict_sku_perf_table,
'BranchType': BranchType, # for naver map api permission
'ALLOWED_HOSTS': settings.ALLOWED_HOSTS # for naver map api permission
})
def post(self, request, *args, **kwargs):
o_sv_db = SvSqlAccess()
if not o_sv_db:
raise Exception('invalid db handler')
dict_rst = get_brand_info(o_sv_db, req... | |
<reponame>WD-stefaang/USD<filename>pxr/usd/lib/usdUtils/complianceChecker.py
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A lightweight privacy method based on time shuffling designed for sharing \
power profiles based data in open forums.
Conceptulised in the Energy and Power Group.
Energy and Power Group is part of the Department of Engineering Science,
University of Oxford.
A profile... | |
import re
import string
import time
import xml.etree.ElementTree as ET
import enchant
import numpy as np
import pandas as pd
import spacy
# Try this if you get a problem with "spacy.load('en')":
# pip install spacy && python -m spacy download en
from nltk.corpus import stopwords
from nltk.stem.snowball import EnglishS... | |
import json
import logging
import os
import re
import shutil
import types
from collections import namedtuple, defaultdict, Counter
from dataclasses import dataclass
from datetime import timedelta
from functools import total_ordering
from io import StringIO
from typing import Tuple, Optional, Dict, List, Set, Union, Ite... | |
Set(Succ(x)) @ (4, REPLACE, 2, 3)
(Set(x) >> Set(Succ(x))) @ (5, DEDUCE)
All(x_, Set(x_) >> Set(Succ(x_))) @ ("successor_is_set", CLOSING, 5)
# infinity
clear()
Exist(a_, (Set(a_) & (Empty() *in_* a_)) & All(x_, (x_ *in_* a_) >> (Succ(x_) *in_* a_))) @ ("infinity", AXIOM)
# choice
clear()
Exist(G_, Function(G_) & All... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Kramers-Kronig Calculator software package.
#
# Copyright (c) 2013 <NAME>, <NAME>
#
# The software is licensed under the terms of the zlib/libpng license.
# For details see LICENSE.txt
"""This module implements a GUI using the wxPython toolkit."... | |
<reponame>hansthienpondt/ansible-networking-collections
# (c) 2020 Nokia
#
# Licensed under the BSD 3 Clause license
# SPDX-License-Identifier: BSD-3-Clause
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
author:
- "<NAME> (@HansThienpondt)"
- "<NAME... | |
dtype=numpy.float32)
else:
error = self._error
if mask_fit is not None and self.getMask() is not None:
self.setMask(numpy.logical_or(self.getMask(), mask_fit))
elif mask_fit is not None:
self.setMask(mask_fit)
if self._mask.sum() == self._mask.size:
raise ValueError('No data points in spectrum left for fitting.... | |
#importar cosas
from tkinter import *
from tkinter import messagebox
import os
from time import strftime
import time
import pickle
import random
import os
import sys
import fpdf
from fpdf import FPDF
global continuo
continuo=0
def VentanaPrincipal():
#configuracion ventana principal
Ventana_C=Tk()
V... | |
import copy
import numpy as np
from circuits.circuit_pack import aRCb
# from circuits.ecm import ecm_serial_matcher
from circuits.ecm_simulator import ecm_simulator_1
from circuits.elements import ele_C, ele_L
class L_M_0:
"""
简单实现L-M的核心部分,并能拟合简单的函数
"""
def __init__(self, input_x_arr, input_y_arr, para_arr, obj_f... | |
#!/usr/bin/env python
#
# Copyright 2016 MIT Lincoln Laboratory, Massachusetts Institute of Technology
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with
# the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | |
def _get_all_matches(self, instance):
# a match is a raw parameter instance
matches = []
multikey_exceptions = []
for filepath, raw_parameters in iteritems(instance.raw_data):
match, error = self._raw_parameters_from_single_source(raw_parameters)
if match is not None:
matches.append(match)
if error:
multikey_e... | |
Enterprise+ and Edge licenses only.
:param pulumi.Input[str] excludes_pattern: List of artifact patterns to exclude when evaluating artifact requests, in the form of x/y/**/z/*. By default no
artifacts are excluded.
:param pulumi.Input[str] includes_pattern: List of artifact patterns to include when evaluating artif... | |
version=self.version),
self.version, nsMap)
result.append(ret)
if samlToken:
result.append('%s %s %s' %
(WSSE_HEADER_START, samlToken, WSSE_HEADER_END))
result.append(SOAP_HEADER_END)
result.append('\n')
# Serialize soap body
result.extend([
SOAP_BODY_START,
'<%s xmlns="%s">' % (info.wsdlName, defaultNS),
... | |
= "Disable Associated Widget"
else:
strs = "Enable Associated Widget"
else:
strs = "Enable Associated Widget"
item6 = menu.Append(wx.ID_ANY, strs)
if not haswin:
item6.Enable(False)
item7 = menu.Append(wx.ID_ANY, "Disable Item")
menu.AppendSeparator()
item8 = menu.Append(wx.ID_ANY, "Change Item Icons")
m... | |
#!/usr/bin/env python
"""
.. module:: belt
:synopsis: The belt function.
.. moduleauthor:: <NAME>
"""
import math
import numbers
import numpy
import opensdraw.lcad_language.curveFunctions as curveFunctions
import opensdraw.lcad_language.geometry as geometry
import opensdraw.lcad_language.interpreter as interp
impor... | |
"福建省厦门市杏林区", "350206", "福建省厦门市湖里区",
"350211", "福建省厦门市集美区", "350221", "福建省同安县", "3503", "福建省莆田市",
"350301", "福建省莆田市市辖区", "350302", "福建省莆田市城厢区", "350303",
"福建省莆田市涵江区", "350321", "福建省莆田县", "350322", "福建省仙游县", "3504",
"福建省三明市", "350401", "福建省三明市市辖区", "350402", "福建省三明市梅列区", "350403",
"福建省三明市三元区", "350421", "福建省明溪县", "3... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# FILE: Base.py
#
# A base class for making asynchronous web service requests
#
# Copyright by Author. All rights reserved. Not for reuse without
# express permissions.
#
import sys, gc, json, time, logging, random, copy
import requests
from requests.exceptions import HTTPEr... | |
<gh_stars>10-100
# ro_annotation.py
"""
Research Object annotation read, write, decode functions
"""
__author__ = "<NAME> (<EMAIL>)"
__copyright__ = "Copyright 2011-2013, University of Oxford"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import sys
import os
import os.path
import datetime
import logging
... | |
import copy
import crc32
import hashlib
import json
import random
import socket
# from multiprocessing.process import Process
# from multiprocessing.queues import Queue
import threading
import time
import uuid
import zlib
from random import Random
from TestInput import TestInputServer
from TestInput import TestInputSin... | |
setting.
:type ui_name: Array of String
| ``api version min:`` 2.4
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param visible: A flag indicating if this setting visible.
:type visible: Boolean
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default... | |
import xarray as xr
import numpy as np
class SplitAndStandardize:
"""Class instantiation of SplitAndStandardize:
Here we will be preprocessing data for deep learning model training.
This module includes methods for training and testing data splits and standardization.
Attributes:
climate (str): The climate pe... | |
<reponame>Truth0906/PTTLibrary
import time
import progressbar
import threading
import re
try:
from . import data_type
from . import config
from . import lib_util
from . import i18n
from . import connect_core
from . import log
from . import screens
from . import exceptions
from . import command
from . import... | |
# Copyright (C) 2019 Red Hat, Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
import numpy as np
import sys
import string
M=4
N=5
# grille rempli par sequence
s_grille=np.full((M+N,M+N),0)
# grille remplit par 0 -1 1
grille=np.full((M,N), -1)
#grille[1][0]=0
sequence1=[1,1]
sequence2=[2,1]
# non-colore -1
# blanche 0
# noire 1
def lire_fichier(s_grille):
#file=sys.argv[1:]
try:
in_file = op... | |
'files': ['tvd', 'c3d', 'amc'],
'fps': 120},
11: {'desc': 'clean',
'files': ['tvd', 'c3d', 'amc'],
'fps': 120},
12: {'desc': 'clean',
'files': ['tvd', 'c3d', 'amc'],
'fps': 120},
13: {'desc': 'clean',
'files': ['tvd', 'c3d', 'amc'],
'fps': 120},
14: {'desc': 'clean',
'files': ['tvd', 'c3d', 'amc'],
'fps': ... | |
*bo, int bolen, int dimslow, int dimmid, int dimfast, int padding){
/* safety check on args */
size_t els, ele;
void *array;
char byteorder[15];
if(len == elsize*elements && elements==dimfast*dimmid*dimslow){
array = data;
els = elsize;
ele = elements;
strncpy(byteorder,bo,bolen<15?bolen:14);
byteorder[bolen<... | |
= lambda: or_clear(e)
def OrEvent(*events):
or_event = threading.Event()
def changed():
bools = [e.is_set() for e in events]
if any(bools):
or_event.set()
else:
or_event.clear()
for e in events:
orify(e, changed)
changed()
return or_event
def any_event(*events, **kwargs):
"""Returns when the any of the e... | |
divide 3 * 2^8,
# which forces some rounding to happen.
rb.add_dev({'id': 0, 'region': 0, 'zone': 0, 'weight': 1,
'ip': '127.0.0.1', 'port': 10000, 'device': 'sda'})
rb.add_dev({'id': 1, 'region': 0, 'zone': 0, 'weight': 1,
'ip': '127.0.0.1', 'port': 10000, 'device': 'sdb'})
rb.add_dev({'id': 2, 'region': 0, 'zon... | |
import os
import json
from numpy import genfromtxt
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
# there is a bug in log files, some of them have __ instead of _
EPISODE_LOG_NAME = "episode_logfile__average.csv"
EPISODE_LOG_NAME_2 = "episode_logfile_average.csv"
METADATA_FILE... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.947164,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime ... | |
different ETags.
"""
path1 = f'/ldp/{uuid4()}'
path2 = f'/ldp/{uuid4()}'
content1 = b'some interesting content.'
content_cksum1 = hashlib.new(digest_algo, content1)
content2 = b'Some great content.'
content_cksum2 = hashlib.new(digest_algo, content2)
self.client.put(path1, data=content1, content_type='text/pl... | |
"Reconstructed Augmented Input MRBrainS Image"}},
every=10), Event.ON_TEST_EPOCH_END) \
.with_event_handler(
PlotCustomVariables(visdom_logger, "Reconstructed Input ABIDE Image", PlotType.IMAGE_PLOT,
params={"opts": {"store_history": True,
"title": "Reconstructed Input ABIDE Image"}},
every=10), Event.ON_TEST_EPO... | |
# ==============================================================================
# Copyright (c) 2022 The PersFormer 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... | |
postprocessing
result = self._repetition_postcall(sds, node, result)
if space:
# XXX maybe try to get something more informative from the
# processing node (e.g. in 0.5 it used to be 'chunks'->'chunks'
# to indicate what was trained and what was tested. Now it is
# more tricky, because `node` could be anything
r... | |
def test_impl(S):
return S.mean()
for data in self._mean_data_samples():
with self.subTest(data=data):
S = pd.Series(data)
self._check_mean(test_impl, S)
@skip_sdc_jit("Series.mean() any parameters unsupported")
def test_series_mean_skipna(self):
def test_impl(S, skipna):
return S.mean(skipna=skipna)
for s... | |
sorted(feature_list, key=operator.itemgetter(0))
return(feature_list)
def check_hit_within_hit(intersect_left, left_range, intersect_right, right_range):
if (intersect_left[0] in right_range and intersect_left[1] in right_range):
return True
elif (intersect_right[0] in left_range and intersect_right[1] in left_ran... | |
<filename>deploy/virenv/bin/gdb.py
#!/home/liuwei/virenv/bin/python
from __future__ import print_function
from ptrace import PtraceError
from ptrace.debugger import (PtraceDebugger, Application,
ProcessExit, NewProcessEvent, ProcessSignal,
ProcessExecution, ProcessError)
from optparse import OptionParser
from os impo... | |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 3 14:47:12 2021
@author: dwinge
"""
import matplotlib.pyplot as plt
#import pandas as pd
import networkx as nx
import matplotlib.colors as mcolors
# Define parameters
my_dpi = 300
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = p... | |
import os
import utils.file_utils as file
import utils.system_utils as system
import utils.db_utils as db
BIBLE_BOOKS = {
'oldTestament': {
'gen': 'Genesis',
'exo': 'Exodus',
'lev': 'Leviticus',
'num': 'Numbers',
'deu': 'Deuteronomy',
'jos': 'Joshua',
'jdg': 'Judges',
'rut': 'Ruth',
'1sa': '1 Samuel',
'2sa'... | |
self._segment_path = lambda: "linktrace-reply"
self._is_frozen = True
def __setattr__(self, name, value):
self._perform_setattr(Cfm.Global.TracerouteCaches.TracerouteCache.LinktraceReply, ['raw_data'], name, value)
class Header(Entity):
"""
Frame header
.. attribute:: level
MD level
**type**\: :py:cla... | |
<gh_stars>1-10
class MapInterpolation:
"""
Create a MapInterpolation class where the data for drawing an interpolation
map can be downloaded, modified, manually provided.
Keyword arguments:
country -- a country or a list of countries for which the shapefile will
be drawn. Alternatively, if you pass the 'EUROPE' ... | |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... | |
vertex3 = vertices[_i2]
subdivisions.append(Triangle(triangle.vertex1, vertex1, vertex3, color))
subdivisions.append(Triangle(triangle.vertex2, vertex2, vertex1, color))
subdivisions.append(Triangle(triangle.vertex3, vertex3, vertex2, color))
subdivisions.append(Triangle(vertex1, vertex2, vertex3, color))
... | |
<filename>COVID19_prediction/COVID_model/model_util.py
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 9 17:18:28 2020
@author: XT
"""
from __future__ import print_function
import random
import joblib
import numpy as np
import pandas as pd
import requests
from sklearn import metrics
SR = 16000 # sample rate
import o... | |
point to return a set of response records. When the results of a DescribeClusterSnapshots request exceed the value specified in MaxRecords , AWS returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retry... | |
of psychedelia in your sound
code. Calling this function with `flip` set to non-zero reverses the
chunks's usual channels. If `flip` is zero, the effect is unregistered.
This uses the `Mix_RegisterEffect` API internally, and thus is probably
more CPU intensive than having the user just plug in his speakers
correc... | |
import unittest
import threading
import socket
import re
import random
from time import sleep
from coapthon.resource_directory.resourceDirectory import ResourceDirectory
from coapthon.messages.response import Response
from coapthon.messages.request import Request
from coapthon import defines
from coapthon.serializer im... | |
"""
Implementation of textX language in Arpeggio.
The idea for this language is shamelessly stolen from the Xtext language but
there are some differences in both syntax and semantics. To make things clear I
have named this language textX ;)
"""
from __future__ import unicode_literals
import re
from arpeggio import St... | |
from tally import tally
from collections import OrderedDict
import json
from cktgen.transformation import Rect, Transformation, Tech
class GR:
def __init__( self, netName=None, layer=None, width=None, rect=None):
self.netName = netName
self.layer = layer
self.width = width
self.rect = rect
def encode_GR( tech, ... | |
account, acceptable_statuses=(2, HTTP_NOT_FOUND)):
"""
Returns (container_count, object_count) for an account.
:param account: Account on which to get the information.
:param acceptable_statuses: List of status for valid responses,
defaults to (2, HTTP_NOT_FOUND).
:raises UnexpectedResponse: Exception raised wh... | |
#definimos bloque como conjunto de lineas que poseen una funcion
#bloque OPIN: Este tipo de bloque es utilizado para que el usuario no ingrese opciones incorrectas
# Presentación del programa
print ("BIENVENIDO AL PROGRAMA DE TRANSFORMACION DE CADENAS")
print ("")
print ("Ingrese a continuación la cadena de caracteres... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.