input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>main.py
from utils import *
import pickle
import copy
from sklearn.preprocessing import normalize
from matching.pfnm import layer_wise_group_descent
from matching.pfnm import block_patching, patch_weights
from matching.gaus_marginal_matching import match_local_atoms
from combine_nets import compute_pdm_matc... | |
"""Classes for representing a Collection+JSON document."""
from __future__ import absolute_import, unicode_literals
import json
__version__ = '0.1.1'
class ArrayProperty(object):
"""A descriptor that converts from any enumerable to a typed Array."""
def __init__(self, cls, name):
"""Constructs typed array prop... | |
#!/usr/bin/python3
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Interface Innovations"
__credits__ = ["<NAME>"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import os
import sys
import inspect
top_folder = \
os.path.split(os.path... | |
elif isinstance(col.cols, SFuncTrig2):
vAlias = col.cols.funcion
elif isinstance(col.cols, SFuncBinary):
vAlias = col.cols.funcion
elif isinstance(col.cols, SFuncBinary2):
vAlias = col.cols.funcion
elif isinstance(col, SColumnasMulti):
vAlias = col.id.valor
contador=contador+1
auxCols = TS.colsConsulta(vNombre... | |
<filename>model/main_model/smap.py
"""
The code and network structure are based on https://github.com/megvii-detection/MSPN.
"""
import sys
sys.path.append('/home/xuchengjun/ZXin/smap')
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from matplotlib impor... | |
<gh_stars>1-10
import math
import gdspy
import pyclipper
import numpy as np
from numpy.linalg import norm
from copy import copy, deepcopy
from spira.yevon.utils import *
from spira.yevon import constants
from spira.yevon.geometry import bbox_info
from spira.core.parameters.variables import *
from spira.core.transform... | |
<reponame>mrcsantos1/pySEP
import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
<<<<<<< HEAD
=======
import networkx as nx
<<<<<<< HEAD
from PIL import Image, ImageTk
>>>>>>> 61cee31 (logo adicionada)
=======
>>>>>>> c68287f (cál... | |
print "Decisions: ", bestDecisions, "\tValues: ", bestValues
offsetScores.append( bestScore )
offsetPhase.append( phaseOffset )
bestScore = sys.maxint
bestIndex = -1
for i in range( len( offsetScores ) ):
if( offsetScores[ i ] < bestScore ):
bestScore = offsetScores[ i ]
bestIndex = i
print "Best offset: ... | |
we do not
# complete the connection (FIXME: make sure that all uses of this
# do the right thing in that case).
while 1:
try:
mpd_signum = 0
self.sock.connect(*args)
break
except socket.error, errinfo:
if errinfo[0] == EINTR: # sigchld, sigint, etc.
if mpd_signum == signal.SIGINT or mpd_signum == signal.SIGAL... | |
from the hic file,
using them to build and return a chunk of counts
"""
[binX0, binX1, binY0, binY1] = region_indices
block_results = []
global reqarr
req = reqarr[mpi]
for block_record in block_info:
records = read_block(req, block_record)
# skip empty records
if not records.size:
continue
#result[str(mpi)... | |
datetime.timedelta(days=1)
return [{'%s__lt' % get_field_part(lookup_parser): date}]
def process_day_gte(self, lookup_parser, values):
date = datetime.datetime.strptime(values[0], "%Y-%m-%d")
return [{'%s__gte' % get_field_part(lookup_parser): date}]
def process_today(self, lookup_parser, values):
return [{
'%... | |
def stim_plan_model_templates(self):
"""StimPlan Model Templates
Returns:
List of StimPlanModelTemplate
"""
return self.children("StimPlanModelTemplates", StimPlanModelTemplate)
class SummaryCaseSubCollection(PdmObjectBase):
"""
Attributes:
id (int): Ensemble ID
is_ensemble (str): Is Ensemble
name_count (s... | |
from unittest import TestCase
import errno
from mock import ANY, Mock, call, mock_open, patch
from os import path
try:
import __builtin__ as builtins
except ImportError:
import builtins
from ceres import CeresNode, CeresSlice, CeresTree
from ceres import DATAPOINT_SIZE, DEFAULT_NODE_CACHING_BEHAVIOR, DEFAULT_SLI... | |
<filename>pyrqa/recurrence_analysis.py
#!/usr/bin/python
#
# This file is part of PyRQA.
# Copyright 2015 <NAME>, <NAME>.
"""
Recurrence analysis
"""
import abc
import math
import Queue
import numpy as np
import processing_order as po
from abstract_classes import AbstractSettings, \
AbstractVerbose
class Recurre... | |
import sys
import time
import json
import ssl
import asyncio
import unittest
import http.client
from unittest import mock
import nats
from nats.aio.client import __version__
from nats.aio.client import Client as NATS
from nats.aio.utils import new_inbox, INBOX_PREFIX
from nats.aio.errors import ErrConnectionClosed, Er... | |
None
self.ShowCurrentFrame()
self.start_frame = 0
return
if not self.has( 'movie' ):
return
if new_movie:
self.start_frame = 0
# close settings windows
if self.has( 'bg_imgs' ):
self.OnQuitBGModel( None )
if self.bg_window_open:
self.OnQuitBG( None )
if self.tracking_settings_window_open:
self.OnQuitTr... | |
<filename>datahub/dnb_api/test/test_views.py
import json
from unittest.mock import Mock, patch
from urllib.parse import urljoin
from uuid import UUID
import pytest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
from freezegun imp... | |
from __future__ import print_function
import argparse
import glob
import os
from datetime import datetime
from os import path
import numpy as np
import pandas as pd
import scipy.io as sio
from h5py import File
from nwbext_ecog import CorticalSurfaces, ECoGSubject
from pynwb import NWBFile, TimeSeries, get_manager, NW... | |
<reponame>ronaldahmed/SLAM-for-ugv
# Natural Language Toolkit: Brill Tagger
#
# Copyright (C) 2001 University of Pennsylvania
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: brill.py,v 1.4 2004/11/18 01:14:37 adastra Exp $
... | |
SR IOD': ['Document'],
'VL MICROSCOPIC IMAGE IOD': ['Image'],
'RT BEAMS TREATMENT RECORD IOD': ['Treatment Record'],
'DEFORMABLE SPATIAL REGISTRATION IOD': ['Deformable Registration'],
'IMPLANT ASSEMBLY TEMPLATE IOD': ['Implant Assembly'],
'VIDEO PHOTOGRAPHIC IMAGE IOD': ['Image'],
'RT IMAGE IOD': ['Image'],
'SC... | |
<reponame>Next-Trends/rasa
import json
from pathlib import Path
from typing import Optional, List, Dict, Text, Type
import tensorflow as tf
import numpy as np
import pytest
from _pytest.monkeypatch import MonkeyPatch
from _pytest.logging import LogCaptureFixture
import logging
from rasa.core.featurizers.single_state_f... | |
('fWetDryMix', ctypes.c_float), # float fWetDryMix;
('fDepth', ctypes.c_float), # float fDepth;
('fFeedback', ctypes.c_float), # float fFeedback;
('fFrequency', ctypes.c_float), # float fFrequency;
('lWaveform', ctypes.c_ulong), # DWORD lWaveform; // 0=triangle, 1=sine
('fDelay', ctypes.c_float), # float fDelay;
... | |
pathology in pathologies:
# collect all patients with this pathology
patients = df[df['pathology'] == pathology]['patient'].unique()
logging.debug('{} Patients found for pathology: {}'.format(len(patients), pathology))
# create k fold of train/test splits
# split with the patient ids
# to make sure that one pati... | |
admin user in a shared network with scope=domain with subdomain access
"""
# Deploy VM as an admin user in a domain that has shared network with subdomain access
self.apiclient.connection.apiKey = self.default_apikey
self.apiclient.connection.securityKey = self.default_secretkey
self.vmdata["name"] = self.acldat... | |
<reponame>eval1749/elang
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/win_precompile.gypi',
'base.gypi',
],
'targets': [
{
'... | |
0x06, 0x03, 0x00, # OO OO
0x01, 0xFC, 0x00, # OOOOOOO
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
# @9792 '' (21 pixels wide)
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x00, 0x00, #
0x00, 0x0... | |
df_gear.loc[mask, "a"] = df_gear.loc[mask].apply(lambda x: (x["scope"]**2 - x["depth"]**2) / (2*x["depth"])
if x["depth"] != 0 and not math.isnan(x["depth"]) else None, axis=1)
df_gear.loc[mask, "range"] = df_gear.loc[mask] \
.apply(lambda x: x["a"] * math.log((x["scope"] / x["a"]) + math.sqrt((x["scope"] / x["a"]) ... | |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
#!/usr/bin/python3
#
# MIT License
#
# Copyright (c) 2018-2021 heckie75
#
# 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... | |
"""Discord bot display module
It contains all the functions and the strings that can be outputed by the bot.
It must be used by the rest of the programm for all the messages sent by the bot.
All the strings sent can then be modified easely in this file.
Import this module and use only the following public function:... | |
<reponame>fractalego/python-nlulite<gh_stars>10-100
import os
import unittest
from pynsett.drt import Drs
from pynsett.knowledge import Knowledge
from pynsett.metric import MetricFactory
from pynsett.drt.drs_matcher import DrsMatcher
_path = os.path.dirname(__file__)
metric = MetricFactory.get_best_available_metric(... | |
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Create a popup window with FFT window information
"""
import lo... | |
k = model.n_components
if lines:
left_pair_inds = self.left_pair_inds
right_pair_inds = self.right_pair_inds
else:
left_pair_inds = None
right_pair_inds = None
fig, ax = plot_cluster_pairs(
self.X_,
self.left_inds,
self.right_inds,
model,
self.meta["merge_class"].values,
left_pair_inds=left_pair_inds,
rig... | |
import string
# the class-based expressions are mostly for organization
# but sometimes they're just too clunky
LEFT_BRACKET = '['
RIGHT_BRACKET = ']'
class FormalDefinition(object):
"""
The basic operators and elements of a regular expression
"""
empty_string = '^$'
alternative = '|'
OR = alternative
klee... | |
# -*- coding: utf-8 -*-
"""
Node definition
Gate definition
Slot definition
Nodetype definition
default Nodetypes
"""
from micropsi_core.nodenet.node import Node, Gate, Slot
from .dict_link import DictLink
from micropsi_core.nodenet.dict_engine.dict_netentity import NetEntity
import micropsi_core.nodenet.gatefunct... | |
<gh_stars>0
"""
.. module:: djangosnapshotpublisher.tests
:synopsis: djangosnapshotpublisher unittest
"""
import json
import uuid
from django.core.management import call_command
from django.db.models.query import QuerySet
from django.test import TestCase
from django.utils import timezone
from djangosnapshotpublishe... | |
<filename>spytest/apis/system/pfc.py
import json
from spytest import st
from apis.system.interface import interface_status_show, clear_interface_counters
from spytest.utils import filter_and_select
from utilities.common import make_list
from utilities.utils import get_interface_number_from_name
from apis.system.rest i... | |
self.security_group = security_group
self.enable_private_ipv6_access = enable_private_ipv6_access
self.enable_intra_node_visibility = enable_intra_node_visibility
self.enable_vertical_pod_autoscaling = enable_vertical_pod_autoscaling
self.security_profile = security_profile
self.security_profile_runtime_rules = se... | |
>>> result = thread.get()
Args:
did (str):
eid (str):
wvm (str):
wvmid (str):
Keyword Args:
transaction_id (str): [optional]
change_id (str): [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPRes... | |
import csv
from datetime import datetime, timezone
import numpy as np
from exetera.core.session import Session
from exetera.core.persistence import DataStore
from exetera.core import utils, dataframe, dataset
from exetera.core import persistence as prst
from exeteracovid.algorithms.test_type_from_mechanism import tes... | |
import itertools
import ghost_aws
from ghost_log import log
from libs.autoscaling import get_autoscaling_group_object
LB_TYPE_AWS_CLB = 'elb'
LB_TYPE_AWS_ALB = 'alb'
LB_TYPE_AWS_MIXED = 'aws_mixed'
def get_lb_manager(cloud_connection, region, lb_type):
"""
Returns a Load Balancer Manager depending on parameters
:... | |
import math
import random
import threading
import time
import arrow
import numpy
import socketio
import tenacity
from lokbot.client import LokBotApi
from lokbot import logger, builtin_logger
from lokbot.exceptions import OtherException
from lokbot.enum import *
from lokbot.util import get_resource_index_by_item_code,... | |
6, 19]
list = ReferenceType.objects.filter(id__in=ids)
list.update(group="academic")
ids = [29]
list = ReferenceType.objects.filter(id__in=ids)
list.update(group="theses")
ids = [27,11]
list = ReferenceType.objects.filter(id__in=ids)
list.update(group="reports")
ids = [25,12,31,33,30, 24, 26, 2, 15]
list =... | |
is the degree of the generator. If the degrees are not
distinct, then the generators will be called ``g_{d,i}`` where
``d`` is the degree and ``i`` is its index in the list of
generators in that degree.
EXAMPLES::
sage: from sage.modules.fp_graded.free_module import FreeGradedModule
sage: E.<x,y,z> = ExteriorAl... | |
import math
import torch
import numpy as np
import pandas as pd
import boardom as bd
def slide_window_(a, kernel, stride=None):
"""Expands last dimension to help compute sliding windows.
Args:
a (Tensor or Array): The Tensor or Array to view as a sliding window.
kernel (int): The size of the sliding window.
str... | |
continue
value = self.experiments[ex_id]['mdv_exp_original'][i]
stdev = self.experiments[ex_id]['mdv_std_original'][i]
fluxlist = [
mdvdd[1][fragment][number] for mdvdd in mdv_data
]
temprssd = []
temprssd.append(ex_id) # 1 ex
temprssd.append(fragment_number) # 2 fragment
temprssd.append(int(0)) # 3 Timecour... | |
"""
Alternative method for estimating the canopy inertial properties. Very ugly and
hacky, but still useful for checking the much improved mesh-based method.
"""
import numpy as np
from scipy.integrate import simps
import pfh.glidersim as gsim
# Yanked from from `AirfoilGeometry`
def airfoil_mass_properties(airfoil... | |
values from energy (i.e. exajoule) to
# resource terms (i.e. tons of biomass)
"""
schema.SupplyPotentialConversion.__init__(self, supply_node, scenario=scenario)
self.init_from_db(supply_node, scenario)
self.input_type = 'intensity'
def calculate(self, resource_unit):
if self._has_data:
self.resource_unit = re... | |
<filename>ceof/ceof.py
#!/usr/bin/env python
# -*- coding: Latin-1 -*-
""" Class to deal with Complex EOF
"""
from UserDict import UserDict
import numpy
import numpy as np
from numpy import ma
import scipy.fftpack
from pyclimate.svdeofs import svdeofs, getvariancefraction
from utils import scaleEOF
def ceof_scal... | |
point in square.points]) + ']'
print(f"{tracing}points_after={points_text}")
# Load values into *square* (i.e. *self*) and *lock* it:
self.center: P2D = center
self.corner_count: int = corner_count
self.corner_radius: float = corner_radius
self.dx: float = dx
self.dy: float = dy
self.rotate: float = rotate
sq... | |
32.
sizeout = (not specified in usearch helpstring)
maxrejects = Max rejected targets, 0=ignore, default 32.
log_name: string to specify log filename
usersort = Enable if input fasta not sorted by length purposefully, lest
usearch will raise an error.
HALT_EXEC: Used for debugging app controller
save_intermediat... | |
<reponame>jonathanGR3450/estocasticos
import numpy as np
arranque = [[10.19825875, 10.8602621, 11.468341, 12.35114893, 12.45085492
,14.65071836, 14.24620061, 13.64372954, 14.99352274, 13.2267395
,11.82172843, 11.71370868, 11.07514606, 13.26561174, 12.54720813
,11.43655713, 12.15091642, 13.6624598, 12.27963872, 10.7... | |
# -*- coding: utf-8 -*-
"""
Bregman projections for regularized OT
"""
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: MIT License
import numpy as np
def sinkhorn(a, b, M, reg, method='sinkhorn', numItermax=1000,
stopThr=1e-9, verbose=False, log=False, **kwargs):
u"""
Solve the entropic regularization... | |
else:
# 6. While listening to the stream, each new event's U should be equal to the previous event's u+1.
conditional = ((U - 1) == orderbook['nonce'])
if conditional:
self.handle_order_book_message(client, message, orderbook)
if nonce < orderbook['nonce']:
client.resolve(orderbook, messageHash)
else:
# todo: c... | |
top5.update(t5.item(), outputs[-1].size(0))
losses.update(loss.item(), outputs[-1].size(0))
batch_time.update(time.time() - t0)
t0 = time.time()
print_and_save('[Epoch:{}, Batch {}/{} in {:.3f} s][Loss {:.4f}[avg:{:.4f}], Top1 {:.3f}[avg:{:.3f}], Top5 {:.3f}[avg:{:.3f}]], LR {:.6f}'.format(
cur_epoch, batch_idx, l... | |
'N/A'
print('WARNING. Sensor = %s. Setting as N/A' % sensor)
print(stan)
if phase_write:
model = TauPyModel(model=taup_model)
dist_deg = kilometer2degrees(tr.stats.sac['dist'],radius=6371)
Phase1arrivals = model.get_travel_times(source_depth_in_km=ev.origins[0].depth/1000,distance_in_degree=dist_deg,phase_lis... | |
'''Trains CGAN on MNIST using Keras
CGAN is Conditional Generative Adversarial Network.
This version of CGAN is similar to DCGAN. The difference mainly
is that the z-vector of geneerator is conditioned by a one-hot label
to produce specific fake images. The discriminator is trained to
discriminate real from fake image... | |
<gh_stars>0
# coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# 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 applic... | |
<gh_stars>10-100
input = """
c num blocks = 1
c num vars = 200
c minblockids[0] = 1
c maxblockids[0] = 200
p cnf 200 860
-87 168 -59 0
173 31 193 0
138 -66 -157 0
32 153 200 0
-134 -8 108 0
149 -24 183 0
152 188 -189 0
64 -89 -132 0
-104 -107 -98 0
91 -69 -192 0
-126 -57 -44 0
-148 74 35 0
14 94 -150 0
75 -48 197 0
78 ... | |
= 0
lt_index = 0
# get the x, y at the ends of the matrices, then difference them.
# If the difference is less than zero then the matrix is going in the opposite convention than the bag
# so we need to flip the compare logic for walking along the gap between the two
pos_rows = numpy.sign(right_or_bottom_rcb[0, -1... | |
import re
#f = open('E:\\All Projects\\AssemblyConverter\\BeforeCompressAssembly.txt', 'r')
f = open('BeforeCompressAssembly.txt', 'r')
x = f.readlines()
f.close()
Pointer = []
Machine = []
Assembly = []
nochange = []
c = -1
for i in x:
c += 1
Ex1 = re.findall(' (\S+)\t', i)
Pointer.append(Ex1)
... | |
import itertools
import re
import os
import time
import copy
import json
import Amplo
import joblib
import shutil
import warnings
import numpy as np
import pandas as pd
from tqdm import tqdm
from typing import Union
from pathlib import Path
from datetime import datetime
from shap import TreeExplainer
from shap import K... | |
<reponame>LGWingEmulator/tools-acloud
# Copyright 2016 - The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
# Copyright 2021 The Trieste Contributors
#
# 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 ... | |
carga > 1:
if xf in dist1.values() or xf in dist2.values():
CA = corte_final[carga-1]
xf += .1
# CALCULO DE MOMENTO MAXIMO POR AREAS DEL DIAGRAMA DE CORTE
if seguir == True:
if dist_apli[carga] != dist_apli2[carga]:
if corte_inicial[carga] > 0 and corte_final[carga] > 0:
mom_max += (dist_apli2[carga]-dist_apli[... | |
pRF directory
if self.prf_dir == None:
if derivatives != None:
self.prf_dir = opj(self.derivatives, 'prf', self.subject, f'ses-{self.prf_ses}')
# get design matrix, vertex info, and analysis file
if self.prf_dir != None:
self.design_fn = get_file_from_substring("vis_design.mat", self.prf_dir)
self.design_matrix... | |
too jagged?"""
extras = (
(0,6,1), (0,7,1), (0,8,1), (0,9,1), (0,10,1),
(1,5,0), (2,4,0), (3,3,0), (4,2,0), (5,1,0),
(1,11,0), (2,11,0), (3,11,0), (4,11,0), (5,11,0),
(6,0,1), (7,0,1), (8,0,1), (9,0,1), (10,0,1),
(6,10,1), (7,9,1), (8,8,1), (9,7,1), (10,6,1),
(11,1,0), (11,2,0), (11,3,0), (11,4,0), (11,5,0),)
... | |
0 0", targetname: str="", parentname: str="", LightingLandmark: str=""):
Entity.__init__(self, "info_lighting_relative", vmf_map)
# Origin : This entity's location in 3D space.
self.origin: "Origin" = origin
# Name : The name that other entities refer to this entity by.
self.targetname: str = targetname
# Paren... | |
data coordinates.
See Also
--------
set_xlim
set_xbound, get_xbound
invert_xaxis, xaxis_inverted
Notes
-----
The x-axis may be inverted, in which case the *left* value will
be greater than the *right* value.
"""
return tuple(self.viewLim.intervalx)
def _validate_converted_limits(self, limit, convert):
... | |
#!/usr/bin/python
# vim: ts=4 :
# vim: sw=4 :
# Copyright (C) 2007 <NAME>
#
# This program 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 2 of the License, or
# (at your option) any later vers... | |
<filename>green/config.py
from __future__ import unicode_literals # pragma: no cover
"""
Configuration settings are read in this order:
1) ~/.green
2) A config file specified by the environment variable $GREEN_CONFIG
3) A config file specified by the command-line argument --config FILE
4) Command-line arguments.
Any ... | |
print "fashion"
localisedformdata = request.form['annotation']
print localisedformdata
# formats it after reading
loadedtestformdataformatted = json.loads(localisedformdata)
print "itsme"
print loadedtestformdataformatted
localiseddata.insert(
{"localisation_data":loadedtestformdataformatted,"image_id": image... | |
<gh_stars>0
import contextlib
import numpy as np
import os
import pathlib
import shutil
import tempfile
import tifffile
import unittest
from tsv import volume
from tsv.convert import main
from tsv.raw import raw_imsave
import xml.etree.ElementTree as ET
xml_path = os.path.join(os.path.dirname(__file__), "example.xml")... | |
rule tags that identify registrations that need reprocessing.
"""
# By default if the rules don't implement this function then no
# registrations are reprocessed.
return []
class RuleRegisterResource(RuleRegister):
"""Base class for registration rules that deal with resource allocation."""
def _BuildContext(se... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
N=12,
origin=(ypi-cutout_size, xpi-cutout_size),
filter=psf_filter, get_extended=True)
psf = EPSF.get_ePSF(psf_params,
origin=(ypi-cutout_size, xpi-cutout_size),
shape=sci.shape, filter=psf_filter,
get_extended=True)
except:
continue
mask = satpix[sly, slx]
sci[mask] = psf[mask]
dq[mask] -= (dq[ma... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
# We disable pylint because we need python3 compatibility.
from tensorflow.contrib.rnn.python.ops import core_rnn
from tensorflow.contrib.rnn.python.ops import core_rnn_cell
from tensorflow.contri... | |
#!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... | |
have an index qualifier
if the index value is larger than or equal to zero.
Get: HasIndex(self: GH_Item) -> bool
"""
HasName = property(
lambda self: object(), lambda self, v: None, lambda self: None
) # default
"""Gets the name validity of this item.
The item is considered to have an ... | |
<filename>src/diffjson/diff.py
import os
import csv
from .branch import *
# External Variables
reportmode = None
# Utilities
def _report(line):
if reportmode == 'stdout':
print(line)
class PCounter():
"""Progress Counter.
Args:
total(int): Total Count.
reportmode(str): Report mode. 'stdout' only now.
Def... | |
import shelve
import gzip
import shutil
import json
import os
import logging
from . import DIR_PATH, HISTORY_PATH, STORAGE_PATH, STORAGE_GZ_PATH, DEFAULT_BOARD
from .utils import get_time, to_datetime
logger = logging.getLogger("noteboard")
class NoteboardException(Exception):
"""Base Exception Class of Noteboard.... | |
<reponame>gaudel/ranking_bandits
#!/usr/bin/python3
# -*- coding: utf-8 -*-
""" Target """
# Packages
from __future__ import division
import math
import scipy.stats as st
import scipy as sp
from bandits_to_rank.data.Methode_Simulation_KappasThetasKnown import *
""" Target"""
class Target :
"""
Target_XXXXXXX: init... | |
height, and optionally: height of the roof, roof type, block model top modelling rule, walls modelling rule.
Output: CityGML code of the cityObjectMember.
"""
cityObject = etree.SubElement(CityModel, "cityObjectMember")
bldg = etree.SubElement(cityObject, "{%s}Building" % ns_bldg)
bldg.attrib['{%s}id' % ns_gml] = ... | |
import asyncio
import functools
import logging
import re
import textwrap
from collections import OrderedDict
from typing import Any, Callable, Optional, Tuple
import discord
from bs4 import BeautifulSoup
from bs4.element import PageElement
from discord.ext import commands
from markdownify import MarkdownConverter
from... | |
#!/usr/bin/env python3
# Copyright 2020 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
<reponame>pmwheatley/eve
import time
from datetime import datetime
import simplejson as json
from bson import ObjectId
from bson.dbref import DBRef
from eve.methods.common import serialize, normalize_dotted_fields
from eve.tests import TestBase
from eve.tests.auth import ValidBasicAuth, ValidTokenAuth, ValidHMACAuth
... | |
"1394")),
((Standards.JSIC13, "1153"), (Standards.ISIC4, "1394")),
((Standards.JSIC13, "1154"), (Standards.ISIC4, "1399")),
((Standards.JSIC13, "1155"), (Standards.ISIC4, "1399")),
((Standards.JSIC13, "1156"), (Standards.ISIC4, "1311")),
((Standards.JSIC13, "1157"), (Standards.ISIC4, "1399")),
((Standards.JSIC13,... | |
#! /usr/bin/env python
# System imports
import os
import os.path
import logging
from logging.handlers import TimedRotatingFileHandler
import math
from datetime import datetime
from time import time
# Third-party imports
import sqlite3
class aftershockDB(object):
"""Class to build or retrieve a database for aftersh... | |
just the data
# this changes the file modification time to the time of the copy
shutil.copy(source_path, dest_path)
os.chmod(dest_path, mode)
return dest_path
def get_file_state(self, path, ingested = False, position = None):
"""
Create a state object for a file. If a position is passed then add a parser stat... | |
base_variable_reference_variable(self, p):
return p[0]
@pg.production("base_variable : simple_indirect_reference "
"reference_variable")
def base_variable_simple_indirect_reference_variable(self, p):
counter = p[0]
assert isinstance(counter, ConstantInt)
var = p[1]
for i in range(counter.intval):
var = Variab... | |
# name = ...
# class A(name):
# def name(self): ...
#
# import name
# class A(name.Name):
# def name(self): ...
frame = self.parent.frame(future=True)
# line offset to avoid that class A(A) resolve the ancestor to
# the defined class
offset = -1
else:
frame = self
return frame._scope_lookup(node, name, of... | |
SQUAD_IDS = {
'besa kavajë': '2fdee617',
'besa kavaje': '2fdee617',
'fk kukësi': 'f1e85b1e',
'fk kukesi': 'f1e85b1e',
'fk partizani tirana': '3ba2fddf',
'flamurtari vlorë': '3d81ccdb',
'flamurtari vlore': '3d81ccdb',
'kf elbasani': 'ddab4421',
'kf feronikeli': 'abffa138',
'kf laçi': '7a40cd8b',
'kf laci': '7... | |
#!/usr/bin/env python3
'''
-------------------------
Usage: make_metagenome.py [options] SNPfile.bed genome.fa outprefix
See below for more detail.
Version history:
v.1.0 03/12/2016 - initial build
v.1.1 11/13/2018 - added option to provide a GTF file, which is then modified to
work with the metagenome. See ... | |
# =================================================================
#
# Authors: <NAME>
# <<EMAIL>>
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# ... | |
<gh_stars>1-10
"""
OptMAGE Unit Tests
"""
import os
import unittest
from Bio import SeqIO
from Bio.Alphabet import generic_dna
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from optmage.oligo_designer import DEFAULT_GENOME
from optmage.oligo_designer import DEFAULT_OLIGO_SIZE
from optmage.oligo_designe... | |
run_command: Run command.
:type run_command: str
:param url: Job URL.
:type url: str
:param extra_info_url: Extra Info URL.
:type extra_info_url: str
:param web_job_type: Job type. Possible values include: "Continuous", "Triggered".
:type web_job_type: str or ~azure.mgmt.web.v2020_06_01.models.WebJobType
:param... | |
# -*- coding: utf-8 -*-
"""
Simple Data Protocol
Date: 9.11.2017
@author: <NAME>
@source http://damogranlabs.com/, https://github.com/damogranlabs
"""
import sys
import threading
import time as systime
import crcmod
import serial
__version__ = 1.1
##################################################################
# ... | |
this Virtual Machine Scale Set be limited to a Single Placement Group, which means the number of instances will be capped at 100 Virtual Machines. Defaults to `true`.
:param pulumi.Input[str] sku: The Virtual Machine SKU for the Scale Set, such as `Standard_F2`.
:param pulumi.Input[str] source_image_id: The ID of an ... | |
def __init__(self, _delete, _from, delete_cont, condicion):
self._delete = _delete
self._from = _from
self.delete_cont = delete_cont
self.condicion = condicion
class DeleteCont(Sentencia):
def __init__(self, _only, identificador):
self._only = _only
self.identificador = identificador
class DeleteCont2(Sente... | |
<reponame>zishanqin/Symbolic-transfer
'Author: <NAME>'
'''email: <EMAIL>'''
# -------------------------------------------------------------------------------------------------- #
# This code can run 4 different models of Reinforcement Learning:
# Q-Learning (QL), DQN, SRL (DSRL), SRL+CS(DSRL_object_near) and some o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.