input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>dataflow/RDFDatabank # -*- coding: utf-8 -*- """ Copyright (c) 2012 University of Oxford 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...
<reponame>zuru/MappedConvolutions<filename>package/layers/util/spherical_projections.py import torch import math import numpy as np import _mapped_convolution_ext._cube2rect as _cube2rect from .conversions import * from .grids import * def get_projection_map(shape, kernel_size, proj='grid', stride=1, dilation=1): ...
wp = '1' ) dr = db.daily_record.create \ ( user = user , date = date.Date ('2012-05-02') ) db.time_record.create \ ( daily_record = dr , start = '14:30' , end = '17:15' , work_location = '1' , wp = '4' ) db.time_record.create \ ( daily_record = dr , start = '08:00' , end = '14:00' , work_location = '1'...
<filename>corecircuits.py<gh_stars>0 """ Some useful hardware generators (e.g. muxes, signed multipliers, etc.) """ from __future__ import division import six import math from .pyrtlexceptions import PyrtlError, PyrtlInternalError from .core import LogicNet, working_block from .wire import Const, WireVector from pyr...
ncols : int (default=nchannels/15) Number of columns to use for layout. start : float (default=0) Time used as T0, by default timing is taken from ``d.feat_lab[1]``, but can be specified if missing. fig : :class:`matplotlib.Figure` If speficied, a reference to the figure in which to draw the ERP plot. By default...
# Generated by rpcgen.py from /home/nickolai/proj/go-rpcgen/rfc1813/prot.x on Fri Dec 6 10:47:13 2019 import rpc import const import pack class NFS_PROGRAM(object): class RawTCPNFS_V3(rpc.RawTCPClient): def __init__(self, host, port, **kwargs): if 'program' in kwargs or 'version' in kwargs: raise TypeError('Unexpe...
<gh_stars>100-1000 """Provide validation of structural variations against truth sets. """ import csv import os import six import toolz as tz import numpy as np import pandas as pd import pybedtools from bcbio.log import logger from bcbio import utils from bcbio.bam import ref from bcbio.pipeline import datadict as dd...
models.IntegerField(blank=True, null=True) child_order = models.IntegerField() description = models.TextField(blank=True, null=True) gid = models.UUIDField() class Meta: managed = False db_table = 'recording_attribute_type' class RecordingAttributeTypeAllowedValue(models.Model): id = models.AutoField(db_colum...
os.path.splitext(file)[-1].lower() if ext in src_ext: type = "SOURCE" elif ext in hdr_ext: type = "HEADER" else: type = "IMPORTANT" # Generate file symbol symbol = fileSymbol + srcPath.replace("/", "_").upper() + baseFileName.upper() + "_" + type.upper() exec("component.getSymbolByID(\"" + symbol + "\").setEn...
<filename>stage/test_jdbc_stages.py # Copyright 2017 StreamSets 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 appl...
# import libraries import os import io import math import time import picamera from fractions import Fraction from collections import OrderedDict import PIL.Image import PIL.ImageTk import PIL.ImageDraw import PIL.ImageFile import PIL.ImageFont from tkinter import * import tkinter as tk from tkinter import filedialog ...
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import bisect import collections import numpy as np import scipy import matplotlib.pyplot as plt import seaborn as sns import allel import graphviz import pyximport pyximport.install(setup_args=dict(include_dirs=np.ge...
<filename>FIT/decoder.py # Copyright 2019 <NAME> # See LICENSE for details import importlib import warnings from typing import Dict, Union, Optional, Tuple, Any import sys from FIT.base_types import UnsignedInt8, UnsignedInt16, UnsignedInt32, UnsignedInt64, BASE_TYPE_NUMBER_TO_CLASS from FIT.model import M...
<filename>ostap/fitting/convolution.py<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= ## @file ostap/fitting/convolution.py # Set of useful basic utilities to use convolution # @author <NAME> <EMAIL> # @date 2011-07-25 # ===...
super(VAE_v3_4x, self).__init__() self.up_factor = up_factor self.init_feat = nn.Sequential( nn.Conv2d(512, 64, 1, 1, 0), nn.BatchNorm2d(64), nn.LeakyReLU(), nn.Conv2d(64, 64, 3, 1, 1), nn.BatchNorm2d(64), nn.LeakyReLU(), ) self.VAE_encoder = nn.Sequential( nn.Linear(16384, 512), # nn.ReLU(), # nn.Linear...
<reponame>pettni/treeabstr import numpy as np import networkx as nx import scipy.sparse as sp from collections import deque from optimization_wrappers import * # Augment a cycle with outgoing mode # Todo: select correct mode def augment(G, c): outg = [G[c[i]][c[(i + 1) % len(c)]]['modes'][0] for i in range(len(c))...
or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'notPublished', 'published' :type state: str or ~azure.mgmt.apimanagement.models.ProductState :param id: Identifier...
import sys,os,copy import numpy as np from math import log,sqrt import pyrosetta as PR import utils CURR = os.getcwd() MEFF=0.0001 DELTA = [-99.0,-17.5,-12.5,-7.0,-3.0,-1.5,-0.75, 0.0, 0.75,1.5,3.0,7.0,12.5,17.5,99.0] MYPATH = os.path.dirname(os.path.realpath(__file__)) REFSTAT_FILE = MYPATH + '/refstat.dbin.seqsep...
norm # res_conv = tf.layers.conv3d(inputs, filters=feature_size, # kernel_size=res_kernel_size, padding=padding, use_bias=False, # kernel_initializer=tf.contrib.layers.xavier_initializer(), # kernel_regularizer=regularizer, trainable=trainable, # name='res_conv') # res_norm = normalize(res_conv, type=norm...
<reponame>drdanio/eve-simple-esi # Thanks Qandra-Si (https://github.com/Qandra-Si) for help and basis of implementation import urllib import requests import base64 import hashlib import secrets import sys import time import json import webview from http.server import HTTPServer, CGIHTTPRequestHandler, BaseHTTPRequestHa...
for connecting no such node or project """ C.project.create('proj-06') with pytest.raises(FailedAPICallException): C.project.connect('proj-06', 'no-such-node') with pytest.raises(FailedAPICallException): C.project.connect('no-such-project', 'free_node_1') def test_project_connect_node_reserved_chars(self): """ ...
# ------------------------------------------------------------------------------------------------------------ # # # アドオン情報 # bl_info = { "name": "結合済みFBX出力", "author": "eijis-pan", "version": (0, 5), # "blender": (2, 79, 0), "blender": (2, 80, 0), "location": "View3D > Sidebar", "description": "Mikoko、Nekoma向...
from numpy import (array, zeros, arange, searchsorted, unique, cross) from numpy.linalg import norm # type: ignore from pyNastran.dev.bdf_vectorized.cards.elements.shell.shell_element import ShellElement from pyNastran.bdf.field_writer_8 import print_card_8 from pyNastran.bdf.bdf_interface.assign_type import (intege...
<filename>bal.py from __future__ import print_function import sys sys.path.append('.') import logging import numpy as np import pandas as pd import time import copy import tqdm import xlsxwriter import csv import urllib.request import os import zipfile from sklearn.datasets import fetch_20newsgroups from sklearn.featur...
import os import re import requests import json import random import string import geopy.distance from pprint import pprint from jollof.models import * class Buy(object): def __init__(self): self.BUYER_ACCESS_TOKEN = os.environ.get('BUYER_ACCESS_TOKEN') self.BLUMAN_ID = os.environ.get('BLUMAN_ID') self.NEAREST...
bbox=None, sim_time=0.0, mass_unit = None, time_unit = None, velocity_unit=None, magnetic_unit=None, periodicity=(True, True, True), n_ref = 64, over_refine_factor = 1, geometry = "cartesian", unit_system="cgs"): r"""Load a set of particles into yt as a :class:`~yt.frontends.stream.data_structures.StreamParticle...
= basic_map(ctx=ctx, ptr=res) return obj def set_domain_tuple(*args): if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): args = list(args) try: if not args[1].__class__ is id: args[1] = id(args[1]) except: raise ctx = args[0].ctx res = isl.isl_map_set_domain_tuple_id(isl.isl_map_copy(ar...
_svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format( hours, minutes) except AttributeError: pass return _svalue @classmethod def gds_parse_date(cls, input_data): tz = None if input_data[-...
<reponame>aps-sids/zulip # -*- coding: utf-8 -*- from zerver.lib.test_helpers import AuthedTestCase from zerver.lib.test_runner import slow from zerver.models import Message import ujson class JiraHookTests(AuthedTestCase): def send_jira_message(self, action): email = "<EMAIL>" api_key = self.get_api_key(email) ...
ctx:PlSqlParser.Directory_nameContext): return self.visitChildren(ctx) # Visit a parse tree produced by PlSqlParser#directory_path. def visitDirectory_path(self, ctx:PlSqlParser.Directory_pathContext): return self.visitChildren(ctx) # Visit a parse tree produced by PlSqlParser#alter_library. def visitAlter_li...
], "audioCodecs": [ "AAC" ] } ] }) elif device.PLATFORM == 'tv': capabilities.append({ "type": "AlexaInterface", "interface": "Alexa.ChannelController", "version": "3", "properties": { "supported": [ {"name": "channel"} ], "proactivelyReported": False, "retrievable": False, } }) if 'channel_control...
<filename>appengine/swarming/swarming_bot/bot_code/task_runner.py # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Runs a Swarming task. Downloads all the necessary files to run the task, exe...
<gh_stars>1000+ # 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...
''' .. module:: skrf.media.media ======================================== media (:mod:`skrf.media.media`) ======================================== Contains Media class. ''' import warnings import numpy as npy from numpy import real, imag, ones, any, array from scipy import stats from scipy.constants import c, inch...
<filename>vespid/pipeline.py # -*- coding: utf-8 -*- import logging import numpy as np import pandas as pd from tqdm import tqdm from datetime import timedelta from time import time from joblib import dump as dump_obj, load as load_obj from copy import copy, deepcopy import os import ray import pathlib from vespid imp...
2287, 4859, 4865, 2286) model.createElement(3120, 5099, 5100, 5106, 5105, 4859, 4860, 4866, 4865) model.createElement(3121, 5100, 5101, 5107, 5106, 4860, 4861, 4867, 4866) model.createElement(3122, 5101, 5102, 5108, 5107, 4861, 4862, 4868, 4867) model.createElement(3123, 5102, 5103, 5109, 5108, 4862, 4863, 4869, 4868) ...
not isinstance(module_node, ast.Module): throw(TypeError) stmt_node = module_node.node if not isinstance(stmt_node, ast.Stmt) or len(stmt_node.nodes) != 1: throw(TypeError) discard_node = stmt_node.nodes[0] if not isinstance(discard_node, ast.Discard): throw(TypeError) result = string2ast_cache[s] = discard_node.e...
def set_base_fuel(self, techs: list = None): """ Defines the base fuel properties according to the technologies tagged as is_base = True or a list of technologies as input. If no technologies are passed as input and no technologies are tagged as is_base = True, then it calculates the base fuel properties consideri...
If None (or not specified), results of any ilk are returned. Returns a list of 2-tuples: (<ilk>, <name>). """ self.merge_expired(time.time()) # Need to check merged and on-deck items: cplns = [] # ...on-deck items for base, (timestamp, res_data, res_data_pivot) in list(self._on_deck.items()): if res_data_p...
<gh_stars>10-100 from __future__ import print_function import argparse import math import os import queue import time import cv2 import torch import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim import torchvision.transforms as transform_lib from torch.utils.data import ConcatDataset...
<reponame>tharleycsouza/mammoth<gh_stars>0 # Copyright (C) 2011-2020 2ndQuadrant Limited # # This file is part of Barman. # # Barman 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, either version 3 of the Lice...
1 7 1 1 4 1 1 tegar_ID 3 \ 2 1 1 8 9 7 1 1 4 9 5 9 7 1 1 4 1 tegar_ID 3 1 1 5 4 6 1 1 2\ 9 7 1 1 4 1 1 5 1 tegar_ID 1 9 5 9 7 1 1 4 1 tegar_ID 3 1 1 \ 5 4 tegar_ID 4 1 1 tegar_ID 1 tegar_ID 1 tegar_ID 1 tegar_ID teg\ ar_ID 1 tegar_ID 1 1 tegar_ID 2 3 2 9 9 1 tegar_ID 4 1 1 7 1 1 \ tegar_ID 1 tegar_ID 7 9 5 1 1 5 1 1 6...
Actions iff the action is new. if not old_action == new_url_action: old_action.Name = "Original Action Before Changing To Executable PlayAction" game.OtherActions.Add(old_action) else: PlayniteApi.Dialogs.ShowMessage("No file selected, will continue with PlayAction as a URL.") else: message = "Didn't find any ex...
a supplied description, if any description = kwargs.pop("description", "") # Create a sane lockstring if one wasn't supplied lockstring = kwargs.get("locks") if account and not lockstring: lockstring = cls.lockstring.format(account_id=account.id) kwargs["locks"] = lockstring # Create object try: obj = create...
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Enable 'with' statements in Python 2.5 from __future__ import with_statement import os.path import platform import re import sh...
"Shared Cockpit"), (b'EGT2_SET', "Sets EGT bug 2 (0 to 32767),", "Shared Cockpit"), (b'EGT3_INC', "Increments EGT bug 3", "Shared Cockpit"), (b'EGT3_DEC', "Decrements EGT bug 3", "Shared Cockpit"), (b'EGT3_SET', "Sets EGT bug 3 (0 to 32767),", "Shared Cockpit"), (b'EGT4_INC', "Increments EGT bug 4", "Sha...
1 counter = 0 while rc > 0 and counter < 4: cmd = "cd %s;git pull origin %s" % (dest, branch) self.logger.debug(cmd) rc, out, err = self.execute(cmd, timeout=timeout, executor=executor, die=False) if rc > 0: if "Please commit your changes" in err or "would be overwritten" in err: if interactive: cmsg = j.tools...
from __future__ import print_function, unicode_literals, absolute_import from fabric.api import local, lcd, run, sudo, cd, prompt, get, put, hosts, settings, task from fabric.utils import abort from fabric.state import env from fabric.contrib import files import datetime import calendar import sys import os import co...
list(range(levels)) + (axis_names if axis_names else []): modin_multi_level_result = modin_df_multi_level.count( axis=axis, numeric_only=numeric_only, level=level ) pandas_multi_level_result = pandas_df_multi_level.count( axis=axis, numeric_only=numeric_only, level=level ) df_equals(modin_multi_level_result, pan...
hidden = fluid.layers.fc(input=data, size=10) loss = fluid.layers.mean(hidden) adam = fluid.optimizer.AdamaxOptimizer(learning_rate=0.2) adam.minimize(loss) # Run the startup program once and only once. exe.run(startup_program) x = numpy.random.random(size=(10, 1)).astype('float32') outs = exe.run(program=trai...
import ast import functools import importlib import inspect import os import pkgutil import random import re import traceback from datetime import timedelta from pprint import pformat, pprint import sys from collections import OrderedDict from allauth.account.forms import PasswordField, SetPasswordField from django i...
"""Tests for computational algebraic number field theory. """ from sympy import S, Rational, Symbol, Poly, sin, sqrt, I, oo from sympy.utilities.pytest import raises from sympy.polys.numberfields import ( minimal_polynomial, primitive_element, is_isomorphism_possible, field_isomorphism_pslq, field_isomorphism, ...
import doctest import math import os import random import sklearn import pandas as pd import numpy as np from datetime import timedelta from sklearn.utils.estimator_checks import check_transformer_general, check_transformers_unfitted from unittest2 import TestSuite, TextTestRunner, TestCase # or `from unittest import ....
described in detail in at http://musicdsp.org/files/Audio-EQ-Cookbook.txt Parameters ---------- frequency : float The filter's center frequency in Hz. width_q : float, default=2.0 The filter's width as a Q-factor. See Also -------- equalizer, highpass, lowpass, sinc ''' if not is_number(frequency) or fre...
[] for fileentry in data['storage']['files']: if fileentry['path'] not in paths: storagefinal.append(fileentry) paths.append(fileentry['path']) data['storage']['files'] = storagefinal try: result = json.dumps(data, sort_keys=True, indent=indent, separators=separators) except: result = json.dumps(data, indent=i...
# coding: utf-8 """ Mailchimp Transactional API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0.46 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_...
#!/usr/bin/env python # # Copyright 2007 Google 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 ag...
import math import pygame import thorpy from thorpy.gamestools.basegrid import BaseGrid from thorpy.gamestools.grid import PygameGrid from RpgMap.rendering.tilers.tilemanager import get_couple import RpgMap.logic.constants as const VON_NEUMAN = [(-1,0), (1,0), (0,-1), (0,1)] MOORE = [(-1,-1), (1,1), (1,-1), (-1,1)] WA...
traceback.format_tb(exc_traceback): detailedText += "- %s"%line msgBox.setDetailedText(detailedText) msgBox.exec_() def openBackup(self): newBackupPath = QtGui.QFileDialog.getExistingDirectory(self, "Open Directory", "", QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontResolveSymlinks); ...
import glob import os import pathlib import plistlib import sqlite3 import json import textwrap import scripts.artifacts.artGlobals from packaging import version from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows from scripts.ccl import cc...
it from another object. WRITEABLE (W) The data area can be written to. Setting this to False locks the data, making it read-only. A view (slice, etc.) inherits WRITEABLE from its base array at creation time, but a view of a writeable array may be subsequently locked while the base array remains writeable. (The o...
<gh_stars>1-10 # coding: utf-8 """ Web API Swagger specification No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import ...
'<td>Start-up date</td>' + \ '<td>' + r5c1 + '</td>' + \ '<td>' + r5c2 + '</td>' + \ '<td>' + r5c3 + '</td>' + \ '</tr>' + \ '<tr>' + \ '<td>Ownership type</td>' + \ '<td>' + r6c1 + '</td>' + \ '<td>' + r6c2 + '</td>' + \ '<td>' + r6c3 + '</td>' + \ '</tr>' + \ '<tr>' + \ '<td>Distribution type</td>' + \ '...
assert isinstance(out["d"].data, dask.array.Array) assert isinstance(out["c"].data, dask.array.Array) # the data of ds1 and ds2 was loaded into numpy and then # concatenated to the data of ds3. Thus, only ds3 is computed now. out.compute() assert kernel_call_count == 24 # Finally, test that originals are unalter...
delayDeletes.append(DelayDelete.DelayDelete(toon, 'LawbotBoss.enterReward')) ival.delayDeletes = delayDeletes ival.start() self.storeInterval(ival, intervalName) base.playMusic(self.battleThreeMusic, looping=1, volume=0.9, time=self.battleThreeMusicTime) def __doneReward(self): self.notify.debug('----- __doneRe...
if data_ptr: self._sfinfo.append( Surface( irow, icol, datetime.combine(row_head.DATE, row_head.TIME), col_head.STID + col_head.STD2, col_head.STNM, col_head.SLAT, col_head.SLON, col_head.SELV, col_head.STAT, col_head.COUN, ) ) elif self.surface_type == 'ship': irow = 0 for icol, col_head in enumerate(...
import csv import sys import time import datetime from openpyxl import Workbook from openpyxl.styles import PatternFill from difflib import SequenceMatcher import xml.etree.ElementTree as ET from decimal import Decimal datacompareFooter= "" datacompareDataFormat="" colsToConsider=["DC #","Product #"] #put pk/compo...
<reponame>ax-le/nn_fac<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Jun 11 15:49:25 2019 @author: amarmore """ import numpy as np import time import nn_fac.nnls as nnls import nn_fac.mu as mu import nn_fac.beta_divergence as beta_div import nn_fac.errors as err from nimfa.methods import seeding def nmf(dat...
params: query_params.append(('ids', params['ids'])) collection_formats['ids'] = 'csv' if 'names' in params: query_params.append(('names', params['names'])) collection_formats['names'] = 'csv' header_params = {} if 'authorization' in params: header_params['Authorization'] = params['authorization'] if 'x_reques...
claim = BASE_CLAIM + claim_mod newBalance = bank + claim bot.db.set_nick_value(user, DB_BANK, newBalance) newBalance = f'${newBalance:,}' return bot.say(f'{user} claimed ${claim}. New balance: {bold(newBalance)}') # get casino leaderboard @plugin.command('lb') @plugin.rate(user=5) def casino_leaderboard(bot, tri...
<filename>baza.py<gh_stars>0 import csv import sqlite3 import model import os PARAM_FMT = ":{}" # za SQLite class Tabela: """ Razred, ki predstavlja tabelo v bazi. Polja razreda: - ime: ime tabele - podatki: ime datoteke s podatki ali None """ ime = None podatki = None def __init__(self, conn): """ Konst...
pts1 = P.integral_points() # Sage's own code sage: all(P.contains(p) for p in pts1) True sage: pts2 = LatticePolytope(v).points() # PALP sage: for p in pts1: p.set_immutable() sage: set(pts1) == set(pts2) True sage: timeit('Polyhedron(v).integral_points()') # not tested - random 625 loops, best of 3: 1.41 ms p...
string also supports recursive attribute retrieval using the '.' character. For example: a.b.c will retieve c from b which was found in a. Only c will be output. Output Ports attrs: a list of attributes Notes If one of the object is missing a required attribute an exception is raised. """ def __init__(self, na...
# coding: utf-8 import copy import win32api import pythoncom import pyHook import threading import time import numpy as np from scipy.integrate import odeint from matplotlib import pyplot as plt from matplotlib import animation import vehicle import bridge start_flag = False finish_flag = Fals...
import numpy from .parameters import * from .spatialHashTable import SpatialHashTable def isCellData(cell): return [cell.getX(), cell.getY(), cell.getRadius()] def checkNan(value): if math.isnan(value): print("ERROR: predicted reward is nan") quit() def getRelativeCellPos(cell, left, top, size): if cell is ...
decode. count: The number of bytes to decode. Returns: The number of characters produced by decoding the specified sequence of bytes. """ pass def GetChars(self,bytes,*__args): """ GetChars(self: UTF32Encoding,bytes: Byte*,byteCount: int,chars: Char*,charCount: int) -> int Decodes a sequence of b...
<filename>scripts/create_tflm_arduino.py # Lint as: python3 # Copyright 2021 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...
# coding: utf-8 # In[2]: import os import numpy as np import pylab import imageio from matplotlib import pyplot as plt import cv2 import time from os.path import isfile, join from keras.applications import mobilenet from keras.models import load_model from scipy.ndimage.measurements import label from scipy.ndimage....
29362, 29363, 29364, 29365, 29366, 29367, 29368, 29369, 29370, 29371, 29372, 29373, 29374, 29375, 29376, 29377, 29378, 29379, 29380, 29381, 29382, 29383, 29384, 29385, 29386, 29387, 29388, 29389, 29390, 29391, 29393, 29394, 29395, 29396, 29397, 29398, 29399, 29400, 29401, 29411, ...
(str) : stimulus to analyse ("bricks", "gabors", "both") - bri_dir (str or list) : brick direction values ("right", "left", "both") - bri_size (int, str or list): brick size values (128, 256, "both") - gabfr (int, list or str) : gabor frame value (0, 1, 2, 3, "0_3", [0, 3]) - gabk (int, str or list) : gabor k...
<reponame>nya3jp/tast-tests<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tool for creating go code from policy_templates.json. Used to...
<filename>python/opscore/RO/Comm/BaseSocket.py """Base class for sockets using event-driven programming. The intention is to work with TCPConnection and all the infrastructure that uses it. These sockets allow nonblocking event-driven operation: - Connection and disconnection are done in the background. - You may beg...
# Copyright 2016 Pinterest, 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, ...
node.nodeName == name: return node return None def find_children_named(self, parent, name): """Return all of a nodes children who have the given name""" for node in parent.childNodes: if node.nodeName == name: yield node def extract_text(self, node): """Get the text field contained by the given node""" if l...
ir, i64, r) op_store = bldr.gen_sym() bldr.new_store(op_store, False, rmu.MuMemOrd.NOT_ATOMIC, i64, ir, c_1_i64) op_load = bldr.gen_sym() bldr.new_load(op_load, res, False, rmu.MuMemOrd.NOT_ATOMIC, i64, ir) op_ret = bldr.gen_sym() bldr.new_ret(op_ret, [res]) bldr.new_bb(blk0, [], [], rmu.MU_NO_ID, [op_new, op_ge...
<filename>utils.py import numpy as np import torch import matlab import csv import os import shutil import torch.nn as nn from torch.autograd import Variable import matplotlib.pyplot as plt import matlab.engine from numpy import random import json from skimage import img_as_float from skimage.metrics import structural_...
+ str(vect2) U = self.U + vect2[0] # we use (x,y) for external interface, not i,j V = self.V + vect2[1] mask = self.mask.copy() key = self.key + " plus " + str(vect2) title = self.title+" plus " + str(vect2) gridSize = self.gridSize else: name = self.name + "_plus_" + vect2.name U = self.U + vect2.U V = self....
"1019467505", b'\xe2\xdb\x9e\xcc\x07'), TestCase("%d", "353536599", "%u", "353536599", b'\xae\xa9\x94\xd1\x02'), TestCase("%d", "1275925671", "%u", "1275925671", b'\xce\xd2\xe8\xc0\x09'), TestCase("%d", "1250514267", "%u", "1250514267", b'\xb6\xd5\xca\xa8\x09'), TestCase("%d", "1600951834", "%u", "1600951834", b'\xb4\x...
('html_class', 'id', 'is_class_direct', 'nodes', 'parent') def __new__(cls, id_): """ Creates a new ``TokenClassNode`` instance with the given identifier. Parameters ---------- id_ : `int` The identifier of the token. """ self = object.__new__(cls) self.id = id_ self.html_class = None self.is_class_dire...
from urllib.request import urlopen import sys import re import datetime import json #cat basket_10036_columns2.txt | cut -f2 | sed '1d' > basket_10036_columns3.txt begin_time = datetime.datetime.now() error_report = [] lost_columns = [] def get_input(): if len(sys.argv) > 2: input_columns_file = sys.argv[1] out...
<filename>aea/protocols/generator/common.py # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import inspect import math from datetime import datetime, time, timedelta from decimal import Decimal import numpy import pygal import pytz from django.conf import settings from django.db.models import Avg, Min, Q, Count, Max, Sum from djang...
<filename>radloc.py from scipy import linalg from PIL import Image import numpy as np import sys import math import json # Simple Kriging (Euclidean Covariance) class SKI(object): def dimension_filter(self,r_filename, r_filetype=''): data = np.genfromtxt(fname=r_filename, delimiter=r_filetype) n = len(data) z...
<filename>models/bisenet.py #! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright @ 2019 <NAME> HuNan University # from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.contrib import slim from Dataset.dataset import...
within ALARA. Parameters ---------- mesh : PyNE Mesh object The Mesh object for which the geometry is discretized. cell_fracs : structured array The output from dagmc.discretize_geom(). A sorted, one dimensional array, each entry containing the following fields: :idx: int The volume element index. :cell: in...
R.execute([1, 2, 3, 4]) np.testing.assert_allclose(val, [[1., 2., 3., 4.]]) np.testing.assert_allclose( R.matrix.base, [[3, -3, -2, -1], [-4, 3, -2, -1], [-4, -3, 3, -1], [-4, -3, -2, 3]] ) def test_recurrent_mech_auto_hetero_matrix_spec_v3(self): R = RecurrentTransferMechanism( name='R', size=4, auto=[3], ...
self.assertIs(parts, p.parts) # When the path is absolute, the anchor is a separate part p = P('/a/b') parts = p.parts self.assertEqual(parts, (sep, 'a', 'b')) def test_fspath_common(self): P = self.cls p = P('a/b') self._check_str(p.__fspath__(), ('a/b',)) self._check_str(os.fspath(p), ('a/b',)) def test_e...
<filename>mango/__init__.py # In --strict mode, mypy complains about imports unless they're done this way. # # It complains 'Module has no attribute ABC' or 'Module "mango" does not explicitly export # attribute "XYZ"; implicit reexport disabled'. We could dial that back by using the # --implicit-reexport parameter, bu...
contour_labels_colors = "black", contour_labels_fontsize = 'smaller', contour_labels_inline=True, contour_labels_inline_spacing=5, contour_labels_format="%1.3f", # Colors option alpha=1, colors=None, levels=None, cmap=None, norm=None, center=None, vmin=None, vmax=None, robust=False, extend='both'...
cmd_brace_block") def command_method_call_args_brace_block(self, p): return self.combine_send_block(self.new_call(p[0], p[2], p[3]), p[4]) @pg.production("command : primary_value COLON2 operation2 command_args", precedence="LOWEST") def command_colon_call_args(self, p): return self.new_call(p[0], p[2], p[3]) @p...