input
stringlengths
2.65k
237k
output
stringclasses
1 value
( x ) to if x: converts while ( x ) to while x: """ statements = ('elif', 'for', 'if', 'while',) i = 0 while i < len(aList): if self.is_string_or_comment(aList, i): i = self.skip_string_or_comment(aList, i) elif any(self.match_word(aList, i, z) for z in statements): i = self.handle_keyword(aList, i) # elif ( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import re import collections import copy __version__ = '1.5.1' class Pyasciigraph: def __init__(self, line_length=79, min_graph_length=50, separator_length=2, force_max_value=None, graphsymbol=None, multivalue=T...
= 6 ) ), 'polar2014': dict( radialaxis = dict( angle = 0 ), angularaxis = dict( direction = "clockwise", period = 6 ) ), 'polar2015': dict( radialaxis = dict( angle = 0 ), angularaxis = dict( direction = "clockwise", period = 6 ) ), 'polar2016': dict( radialaxis = dict( angle = 0 ), angu...
#!/usr/bin/env python # -*- python -*- # <NAME> <<EMAIL>> # Code generation support: emitting files, emitting functions, etc. #BEGIN_LEGAL # #Copyright (c) 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
** 2) / grid.rho channel = grid.new_channel_to(instance.grid) channel.copy() instance.stopping_conditions.number_of_steps_detection.enable() ybound = instance.get_boundary_grid('ybound1') self.assertEquals(ybound.shape, (4+8,4,1)) memybound = ybound.copy() memybound.rho = 0.02 | density memybound.rhovx = 0....
pooled_output = self.dense(first_token_tensor) pooled_output = self.activation(pooled_output) return pooled_output class NeZhaModel(BertPreTrainedModel): def __init__(self, config): super(NeZhaModel, self).__init__(config) self.embeddings = BertEmbeddings(config) self.encoder = BertEncoder(config) self.pooler ...
<gh_stars>1-10 #!/usr/bin/env python # coding: utf-8 # In[ ]: # This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # l...
patch : matplotlib.patches Matplotlib patch for the specified region. """ pass def intersection(self, other): raise NotImplementedError def symmetric_difference(self, other): raise NotImplementedError def union(self, other): raise NotImplementedError class Region2D(Region): """ Abstract Region class to ...
with integer labels for rows. As mentioned above, note that both the start and stop of the slice are included. >>> df.loc[7:9] max_speed shield 7 1 2 8 4 5 9 7 8 """ def __init__(self, df_or_s): from databricks.koalas.frame import DataFrame from databricks.koalas.series import Series assert isinstance(df_o...
from flask import Blueprint, request, session, redirect, render_template import core import tools import logging import bcrypt import json import traceback import sys from whenareyou import whenareyou try: import queue as Queue except ImportError: import Queue db = None configuration_data = None log = logging.getLo...
<gh_stars>1-10 import os,stat import sys import glob import shutil import numpy as np from pathlib import Path import tarfile import subprocess from shutil import copyfile from abc import ABCMeta, abstractmethod import datetime from shutil import copy2 import json from json import JSONEncoder from pyearth.toolbox.da...
<reponame>schlamar/latexmk.py #!/usr/bin/env python # coding: utf-8 ''' latexmake ~~~~~~~~~ Python module for latexmk.py which completely automates the process of generating a LaTeX document. :copyright: (c) 2013 by <NAME> :license: MIT, see LICENSE for more details. ''' from __future__ import with_statement ...
228: return 'tpgrd' if table2Version == 129 and indicatorOfParameter == 227: return 'crnhgrd' if table2Version == 129 and indicatorOfParameter == 226: return 'htlcgrd' if table2Version == 129 and indicatorOfParameter == 225: return 'htccgrd' if table2Version == 129 and indicatorOfParameter == 224: return '...
= BatchNormalization()(conv2_1) relu2_1 = Activation('relu')(bn2_1) conv2_2 = Conv1D(128, 4, padding='same')(relu2_1) bn2_2 = BatchNormalization()(conv2_2) relu2_2 = Activation('relu')(bn2_2) cnn2 = MaxPooling1D(pool_size=4)(relu2_2) # kernel_size = 5 conv3_1 = Conv1D(256, 5, padding='same')(embed) bn3_1...
from collections import Counter from Bio import SeqIO import numpy as np import warnings import math warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim') from gensim.models import Word2Vec Max_length = 100 # maximum length of used peptides def check_length(file): length ...
#! /bin/python3 import os import re import sys import HTSeq import argparse import textwrap import itertools import pandas as pd from tqdm import tqdm from pandas import Series, DataFrame from collections import defaultdict # Regular expression patterns for parsing SAM alignment read names (mainly use NOT_COLLAPSED) ...
expiration(self) -> Optional['outputs.BucketLifecycleConfigurationV2RuleExpiration']: """ Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker documented below. """ return pulumi.get(self, "expiration") @property @...
from __future__ import absolute_import, print_function, division import os import numpy import warnings from six import integer_types import theano from theano import Apply, tensor, config, Variable from theano.scalar import as_scalar, constant, Log from theano.gradient import DisconnectedType, grad_not_implemented f...
= len([a for a in activities if a is not None and a.name == 'upload_episode']) num_shares = len([a for a in activities if a is not None and a.name in ['share_existing', 'share_new']]) num_unshares = len([a for a in activities if a is not None and a.name == 'unshare']) num_comment_posts = len([a for a in activities i...
0.1, 0.1, 0.1, ... A=A, mu=0.0) >>> static_conesta = StaticCONESTA(max_iter=10000) >>> beta1 = static_conesta.run(function, np.zeros((50, 1))) >>> beta2 = np.dot(np.linalg.pinv(X), y) >>> np.linalg.norm(beta1 - beta2) # doctest: +ELLIPSIS 0.96629070... """ INTERFACES = [properties.NesterovFunction, properties....
<filename>rtk/analyses/pof/PhysicsOfFailure.py #!/usr/bin/env python """ ========================= Physics of Failure Module ========================= """ # -*- coding: utf-8 -*- # # rtk.analyses.pof.PhysicsOfFailure.py is part of The RTK Project # # All rights reserved. # Copyright 2007 - 2017 <NAME> <EMAIL>rew.rowla...
rdz=False, realspace=False): if realspace: if rdz: self._rdz_real = data else: self._xyz_real = data else: if rdz: self._rdz = data else: self._xyz = data def _get_gals(self, rdz=False, realspace=False): if rdz: xyz = self.get_data(realspace=realspace) xyz = util.ra_dec_z(xyz - self.origin, np.zeros_like...
rebalance_tuple = self._GetRebalanceTuple() recover_tuple = self._GetRecoverTuple() while recover_tuple is not None: if job_key.IsCancelled(): break ( prefix, recoverable_location, correct_location ) = recover_tuple text = 'Recovering \'' + prefix + '\' from ' + recoverable_location + ' to ' + c...
#I. cleangot(): clean dfgot from wikiling.de #1. insert links() #2. every lemma() to own row #3. occurences() to own col #4. certainty() to own col #5. reconstructedness() to own col #6.a clean col lemma #6.b clean col lemma #6. translations() #7.a activate got-ipa transcription file #8 clean English transla...
both antpols for ap in antpols: per_ant_corr_cross_pol_metrics[(a1, ap)] = np.nanmax([np.nanmean(d) for d in diffs]) return per_ant_corr_cross_pol_metrics def load_antenna_metrics(filename): """Load cut decisions and metrics from an HDF5 into python dictionary. Loading is handled via hera_qm.metrics_io.load_me...
# Copyright (c) 2018, 2019, 2020 Nordic Semiconductor ASA # Copyright 2018, 2019 Foundries.io Ltd # # SPDX-License-Identifier: Apache-2.0 ''' Parser and abstract data types for west manifests. ''' import configparser import enum import errno import logging import os from pathlib import PurePosixPath, Path import re i...
<reponame>poleha/google-maps-services-python<gh_stars>1-10 # # Copyright 2015 Google 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/lice...
<filename>benchmarks/benchmarks/go_benchmark_functions/go_funcs_D.py # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import numpy as np from numpy import abs, cos, exp, arange, pi, sin, sqrt, sum, zeros, tanh from numpy.testing import assert_almost_equal from .go_benchmark impo...
<filename>examples/faster-rcnn/util.py<gh_stars>1-10 # ---------------------------------------------------------------------------- # Copyright 2016 Nervana Systems 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 ...
# tagmerge.py - merge .hgtags files # # Copyright 2014 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # This module implements an automatic merge algorithm for mercurial's tag files # # The tagmerge algorithm imp...
<filename>reconcile/cli.py import json import logging import os import sys import re import click import sentry_sdk from reconcile.utils import config from reconcile.utils import gql import reconcile.dyn_traffic_director import reconcile.github_org import reconcile.github_owners import reconcile.github_users import r...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ multiPlot version 1.2 cleans up to make Pi and Windows use easier multiPlot version 1.1 adds sunrise sunset times for location of lat long in first file requires suntime library https://github.com/SatAgro/suntime multiPlot version v1.0 plots up to 10 PSWS "rawdata" f...
<gh_stars>0 # # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:twisted # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryPro...
except Exception as e: raise UnmarshallError(resp, e.message) def GetAvatars(self, username, headers=None, query_params=None, content_type="application/json"): """ List all avatars for the user It is method for GET /users/{username}/avatar """ uri = self.client.base_url + "/users/" + username + "/avatar" resp ...
ndarray(shape, self.dtype, offset=offset, strides=strides, buffer=self) def __setitem__(self, key, value): # Get info for view offset, shape, strides = self._index_helper(key) # Is this easy? if not shape: self._data[offset] = value return # Create view to set data to view = ndarray(shape, self.dtype, ...
return _wrap(min(self, key=func)) def find(self, func): """ Finds the first element of the sequence that satisfies func. If no such element exists, then return None. >>> seq(["abc", "ab", "bc"]).find(lambda x: len(x) == 2) 'ab' :param func: function to find with :return: first element to satisfy func or None...
<gh_stars>1-10 import streamlit as st import numpy as np import pandas as pd from gspread_dataframe import get_as_dataframe, set_with_dataframe import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive'] c...
now...') if args.create_batch: # ------------------------------------------------------------ # # Create batch files and exit batch(args.config_file, args.create_batch, args.batch_dir) # ------------------------------------------------------------ # else: # ------------------------------------------------------...
#!/usr/bin/python # -*- coding: utf-8 -* import os import glob import sys import numpy as np import getpass from ftplib import FTP import shutil import subprocess as sp import multiprocessing as mp sys.path.append(os.path.join(os.path.dirname(__file__),"../projects/tools")) import msh import executable_paths as exe im...
import libjevois as jevois import cv2 as cv import numpy as np import sys ## Object detection and recognition using OpenCV Deep Neural Networks (DNN) # # This module runs an object detection deep neural network using the OpenCV DNN # library. Detection networks analyze a whole scene and produce a number of # bounding ...
0 } ], "iSCSIPaths": [], "persona": 1, "initiatorChapEnabled": False, "targetChapEnabled": False }, { "id": 68, "name": "powerpath", "FCPaths": [ { "wwn": "21000024FF36D406", "hostSpeed": 0 }, { "wwn": "21000024FF36D407", "hostSpeed": 0 } ], "iSCSIPaths": [], "persona": 1, "initiatorChapEnabled":...
= True, resolve_addrs = False): p = rep.p ns = walk_model (rep, tag, m) trace = [] for (n, vc) in ns: if (n, vc) not in rep.arc_pc_envs: # this n_vc has a pre-state, but has not been emitted. # no point trying to evaluate its expressions, the # solve won't have seen them yet. continue n_nm = rep.n...
ts_acquiring = Cpt(EpicsSignal, "TSAcquiring", string=True, doc="0='Done' 1='Acquiring'") ts_control = Cpt(EpicsSignal, "TSControl", string=True, doc="0=Erase/Start 1=Start 2=Stop 3=Read") ts_current_point = Cpt(EpicsSignal, "TSCurrentPoint") ts_num_points = Cpt(EpicsSignal, "TSNumPoints") ts_read = Cpt(EpicsSignal...
aws, return the IP address for you "free" of charge # as part of the instance information for the VM. This might be returned # only after the VM creation has been completed. # # This function is genericly called after the VM has been found to be # running, to either simply verify that we have a valid IP address i...
<reponame>ashantanu/CMC """ Training MoCo and Instance Discrimination InsDis: Unsupervised feature learning via non-parametric instance discrimination MoCo: Momentum Contrast for Unsupervised Visual Representation Learning """ from __future__ import print_function import os import sys import time import torch import...
# Microsoft Azure Linux Agent # # Copyright Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
None: raise ValueError( 'host/port and sock can not be specified at the same time') f1 = self.getaddrinfo( host, port, family=family, type=socket.SOCK_STREAM, proto=proto, flags=flags) fs = [f1] if local_addr is not None: f2 = self.getaddrinfo( *local_addr, family=family, type=socket.SOCK_STREAM, proto=proto...
them as a list""" if not l: outer = True else: outer = False l.append(gg) if gg.subgraph_list: for g in gg.subgraph_list: getGraphList(g,l) if outer: return l class EndOfGraphElement: def __init__(self): pass def getAllGraphElements(graph, l=[]): """Return all nodes and edges, including elements in subgra...
Brain instance containing the plot. """ from .._wxgui import get_app get_app(jumpstart=True) from ._brain_object import Brain, get_source_dim if isinstance(src, SourceSpace): if cmap is not None or vmin is not None or vmax is not None: raise TypeError("When plotting SourceSpace, cmap, vmin and vmax " "can not ...
<filename>cloudsearch2/layer1.py # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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, includ...
import numpy as np import pandas as pd import joblib import tensorflow as tf import sys import functools import os import tensorflow.keras.backend as K from matplotlib import pyplot as plt # from IPython.display import clear_output from scipy.stats import gaussian_kde, binned_statistic as binstat from tensorflow.keras....
the user.""" raise NotImplementedError def urllink(self, page, url): """Display a URL to the user.""" raise NotImplementedError def itemized_list(self, page, title, items): """Display an itemized list.""" raise NotImplementedError def step(self, page, text, func): """Add a step of a multi-step operation. ...
the index depth frame down the stack. If fException is True use the exception stack (traceback). """ if fException: tb = get_traceback(base_frame, self) if tb is None: raise NoExceptionFound while tb.tb_next is not None: tb = tb.tb_next f = tb.tb_frame else: f = base_frame while f is not None: if...
key_expiration=2, key_algs=sig_keys, enc_keys=enc_keys) self.write_openid_keys(self.oxauth_openid_jwks_fn, jwks) def generate_base64_string(self, lines, num_spaces): if not lines: return None plain_text = ''.join(lines) plain_b64encoded_text = base64.encodestring(plain_text.encode('utf-8')).decode('utf-8').stri...
# <NAME> # new version of hex_walker_driver, first created in fall2019 project1. # moved some contents from here to hex_util or hex_walker_constants files for cleanliness and organization. # adds interpolation & threading improvments to the Leg object driver, some of the Hex_Walker driver, more improvements pending. ...
tw = textwrap.TextWrapper(break_long_words=False, break_on_hyphens=False, width=width, initial_indent=prefix, subsequent_indent=indent) result = '\n'.join(tw.wrap(text.strip())) # XXX: Remove the dummy prefix. if indent_only: result = result[len(indent):] return result def max_name(names): if len(names) =...
import os import copy import time import glob import re import datetime import argparse import csv import math from pathlib import Path from scipy.stats import gaussian_kde from XAI_utils.tp_fp import * from XAI_utils.metrics import * # XAI related imports import matplotlib.pyplot as plt import matplotlib.patches as p...
os.path.join(filepath,filename)) if len(lst) > 0 or ndtype: if len(newst.ndarray[0]) > 0 or len(newst) > 1: logger.info('write: writing %s' % filename) #print("Here", num2date(newst.ndarray[0][0]), newst.ndarray) success = writeFormat(newst, os.path.join(filepath,filename),format_type,mode=mode,keys=keys,version=...
<filename>Stanford/10_BinarySearchTrees/red_black_tree.py # red_black_tree.py import red_black_node as rbn from typing import Tuple class RedBlackTree: """ A class used to represent a red-black binary search tree. Attributes: Methods: insert(key) Inserts an element into the search tree. _re...
current_actual_value=(1,)) n_actions = Categorical(hp_name='n_actions', obj_name='n_actions_'+str(self.model.__name__), current_actual_value=self.info_MDP.action_space.n) elif(self.regressor_type == 'q_regressor'): output_shape = Categorical(hp_name='output_shape', obj_name='output_shape_'+str(self.model.__name__)...
# PlayStation RSD export plug-in v1.00 # Written by Lameguy64/TheCodingBrony of Meido-Tek Productions. # # Notes: # - All polygons of the model must only be triangles (3 point polygons) or # quads (4 point polygons). # - Textures must be applied through the UV/Image Editor panel as materials are not # used since...
<reponame>SAP-samples/acl2020-commonsense # # SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company # # SPDX-License-Identifier: Apache-2.0 # # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team., 2019 Intelligent Systems Lab, University of Oxford, SAP SE # # Licens...
<reponame>sahadikr1/sahadikr1sasa import asyncio, discord, base64, binascii, re, math, shutil, tempfile, os from discord.ext import commands from Cogs import Nullify, DL def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(Encode(bot, settings)) class Encode(commands.Cog):...
<reponame>RelevanceAI/RelevanceAI<filename>relevanceai/_api/endpoints/datasets/datasets.py<gh_stars>10-100 """All Dataset related functions """ from typing import List, Optional from relevanceai.client.helpers import Credentials from relevanceai.utils.base import _Base from relevanceai._api.endpoints.datasets.do...
string :param bondIdx: Bond Index Value according to ParentMol. If None, it will try to identified all breakable single bonds :type bondIdx: int or ndarray or tuple or list :param simplifyHydro: Whether to not include normal Hydro in the SMILES (Default to be True) :type simplifyHydro: bool :param reverse: Whe...
<reponame>adambernier/flaskr<filename>flaskr/blog.py import datetime as dt import itertools as it from functools import wraps from flask import ( Blueprint, current_app, flash, g, json, jsonify, redirect, render_template, request, url_for ) from flask_login import ( current_user, login_required, login_user, log...
<gh_stars>0 import re import numpy as np import scipy.sparse as sp from scipy import linalg from sklearn.decomposition import NMF, non_negative_factorization from sklearn.decomposition import _nmf as nmf # For testing internals from scipy.sparse import csc_matrix import pytest from sklearn.utils._testin...
1 and lambda = 0, then using BAR to compute the free energy difference. As the test is designed so that both endpoints are the same, the free energy difference should be zero. Parameters ---------- topology_proposal : TopologyProposal The topology proposal to test. This must be a null transformation, where topol...
<filename>of13/parser.py """ Parser of the OpenFlow 1.3 message """ import netaddr from tcpiplib.parser import * from tcpiplib.prints import * from struct import unpack import of13.packet import of13.dissector import of13.prints # ################## OFPT_HELLO ############################ def parse_hello(msg, pac...
dest . afi = LISP_AFI_IPV4 if 98 - 98: Ii1I if 92 - 92: iII111i % i1IIi . OoOoOO00 * iIii1I11I1II1 if 17 - 17: OoooooooOO . OOooOOo if 32 - 32: OoOoOO00 . oO0o + O0 i111 = struct . pack ( "H" , 0 ) ooOO = struct . calcsize ( "HHIBB" ) oO0Ooo = struct . calcsize ( "H" ) packet = packet [ : ooOO ] + i111 + packet...
<reponame>ace-ecosystem/ACE # vim: sw=4:ts=4:et # # instance types # INSTANCE_TYPE_PRODUCTION = 'PRODUCTION' INSTANCE_TYPE_QA = 'QA' INSTANCE_TYPE_DEV = 'DEV' INSTANCE_TYPE_UNITTEST = 'UNITTEST' # # required fields for every alert # F_UUID = 'uuid' F_ID = 'id' F_TOOL = 'tool' F_TOOL_INSTANCE = 'tool_instance' F_TY...
couplings = {(0,0):C.GC_877}) V_259 = Vertex(name = 'V_259', particles = [ P.e__plus__, P.n1, P.sl1__minus__ ], color = [ '1' ], lorentz = [ L.FFS3 ], couplings = {(0,0):C.GC_100}) V_260 = Vertex(name = 'V_260', particles = [ P.e__plus__, P.n2, P.sl1__minus__ ], color = [ '1' ], lorentz = [ L.FFS3 ], coupling...
import time import json import tempfile import re import ffmpeg import cv2 import numpy as np import pandas as pd from pathlib import Path from tqdm import tqdm from argparse import ArgumentParser WIDTH = 1280 HEIGHT = 960 GAMMA = 0.5 SYNC_FRAMERATE = 36 AUTORANGELOWDROPOUT = 0.0035 AUTORANGEHIGHDROPOUT = 0.007 def ...
Cs-(Cds-Cds)(Cds-Cds)(Cds-Cdd-O2d)Cs L8: Cs-(Cds-Cds)(Cds-Cds)(Cds-Cdd-S2d)Cs L8: Cs-(Cds-Cds)(Cds-Cds)(Cds-Cdd-Cd)Cs L7: Cs-(Cds-Cds)(Cds-Cdd)(Cds-Cdd)Cs L8: Cs-(Cds-Cds)(Cds-Cdd-O2d)(Cds-Cdd-O2d)Cs L8: Cs-(Cds-Cds)(Cds-Cdd-O2d)(Cds-Cdd-Cd)Cs L8: Cs-(Cds-Cds)(Cds-Cdd-S2d)(Cds-Cdd-S2d)Cs L8: Cs-(Cds-Cds)(Cds-Cdd...
= True # # Define Chords for pausing TerminalVi # def do_say_more(self): # Vim ⌃G """Reply once with more verbose details""" count = self.get_vi_arg1_int() editor = self.editor if editor.finding_line: editor.finding_highlights = True self.say_more(count) # Vim ⌃G Quirk doesn't turn Search highlights ba...
<reponame>tobiasbp/workbook_exporter #!/usr/bin/env python3 import argparse from datetime import datetime, timedelta import logging import os import random import time from prometheus_client import start_http_server, Summary from prometheus_client.core import GaugeMetricFamily, HistogramMetricFamily, REGISTRY import ...
sweep, unless using external reference. elif not using_external_references: logger.debug("First sweep will be used as reference for reindexing") first = self._sweep_handler.get_epochs()[0] si = self._sweep_handler.get_sweep_information(first) reference_expt = si.get_experiments() reference_refl = si.get_reflectio...
from urbansim.utils import misc import os import sys import orca import yaml import datasources import variables from utils import parcel_id_to_geom_id, geom_id_to_parcel_id, add_buildings from urbansim.utils import networks import pandana.network as pdna from urbansim_defaults import models from urbansim_defaults impo...
called each frame, as # rerendering is done only when needed. def update_info_boards(self, players): for i in xrange(10): # for each player number update_needed = False if self.player_info_board_images[i] == None: self.player_info_board_images[i] = self.gui_images["info board"].copy() update_needed = True ...
numpy.ndarray" "for slices of a matrix with diagonal-origin or" "a tuple/list of a couple of numpy.ndarray-s" "for a slice of matrix with an arbitrary origin." ) # kernels must be a dict with kernel-names as keys # and kernel ndarrays as values. if not isinstance(kernels, dict): raise ValueError( "'kernels' mu...
# Copyright 2020 QuantRocket - 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 or agre...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
<reponame>cameronliang/pycos ######################################################################################## # # align.py (c) <NAME> # University of Chicago # <EMAIL> # <EMAIL> # ######################################################################################## """ This module corrects ...
<reponame>UdK-VPT/BIM2Modelica # -*- coding: utf-8 -*- # import ifcopenshell import ifcopenshell.geom import libdm.BuildingDataModel as bdm import libdm.DataModelGenerator as dmg import IfcLib.Ifc2x3Lib as ifcLib from IfcLib import DataClasses import math import re import os def cmp(a, b): ''' Compares a and b and ...
# # Blueprint for the GUI # from flask import Flask, Blueprint, url_for, jsonify, make_response, app, \ render_template, request, session, redirect, flash, g from flask_login import login_required, login_user, logout_user, current_user from flask_mail import Message import re import logging from datetime import date...
return opts class ZabbixAPIEvent(ZabbixAPISubClass): @checkauth @dojson('event.get') def get(self,**opts): """ * Get events data * * {@source} * @access public * @static * @since 1.8 * @version 1 * * @param _array $options * @param array $options['itemids'] * @param array $options['host...
<reponame>s-kganz/yodapy<filename>yodapy/datasources/ooi/m2m_client.py # -*- coding: utf-8 -*- """ m2m_client.py Client module for the M2M Interface, originally developed by <NAME>. https://github.com/kerfoot/uframe-m2m """ from __future__ import (division, absolute_import, print_function, unicode_literals) impor...
<reponame>S3v3ru5/Monkey """Evaluator of Monkey Language""" from typing import List import operator as py_operator from monkey.ast import ast from monkey.evaluator import mobjects from monkey.evaluator.environment import Environment from monkey.evaluator.builtins import builtins TRUE = mobjects.Boolean(True) FALSE =...
<gh_stars>10-100 # Copyright (c) 2017-2019 Carnegie Mellon University. All rights reserved. # Use of this source code is governed by BSD 3-clause license. import argparse import base64 import datetime from datetime import timedelta from datetime import datetime import json import queue import os import socket import s...
{'март': 1}, {'конкурент': 1}, {'наглядно': 1}, {'сервис': 1}, {'имущество': 1}, {'подробно': 1}, {'вебинар': 1}, {'неликвид': 3}, {'непрофильный': 1}, {'оптовый': 1}, {'скапливаться': 1}, {'скупка': 1}, {'фирмам': 1}], [{'возврат': 1}, {'плохо': 1}, {'стоять': 1}, {'время': 1}, {'связать': 1}, {'сдел...
import numpy as np import cv2 import os import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from sklearn import linear_model from scipy import stats from collections import deque from camera_cal_test import camera_cal import gradients_colors_thresholding_test as grad_color_thres from perspective_...
from random import shuffle import numpy as np import torch import torch.nn as nn import math import torch.nn.functional as F from matplotlib.colors import rgb_to_hsv, hsv_to_rgb from PIL import Image from utils.utils import bbox_iou, merge_bboxes def clip_by_tensor(t,t_min,t_max): t=t.float() result = (t >= t_min...
render the dendrogram. Its has the following keys: ``'color_list'`` A list of color names. The k'th element represents the color of the k'th link. ``'icoord'`` and ``'dcoord'`` Each of them is a list of lists. Let ``icoord = [I1, I2, ..., Ip]`` where ``Ik = [xk1, xk2, xk3, xk4]`` and ``dcoord = [D1, D2, ..., D...
<filename>optimade/filtertransformers/elasticsearch.py from typing import Dict, Union, Type, Optional from lark import v_args from elasticsearch_dsl import Q, Text, Keyword, Integer, Field from optimade.filtertransformers import BaseTransformer, Quantity from optimade.server.mappers import BaseResourceMapper __all__ ...
#!/usr/bin/env python # # Author: <NAME> [tg (at) isi (dot) edu] # Created: 2019-10-25 import collections as coll import copy import time from typing import List, Dict, Tuple, Union, Iterator, Set from nlcodec import log, DEF_MIN_CO_EV from nlcodec.codec import Type, Level, Reseved from nlcodec.dstruct import LnNode...
#!/usr/bin/python3.9 import asyncio import logging import re import time from asyncio import Queue, Task, create_task, wait_for from copy import deepcopy from dataclasses import asdict, dataclass, field from typing import Any, Optional, Union from aiohttp import web import mc_util from forest import utils from forest...
<gh_stars>1-10 from argparse import ArgumentParser import airsimdroneracinglab as airsim # import keyboard import numpy as np import gym # import cv2 import pygame as pg from pathlib import Path from pyinstrument import Profiler from platform import system from collections import deque import pickle import os import co...
<reponame>flowerah/PythoMS """ IGNORE: CHANGELOG: - ---2.7 building to add: try to extract timepoints and tic from chromatogramList (x values are sorted, so this probably won't work) IGNORE """ import sys import os import zlib import gzip import base64 import struct import subprocess import xml.dom.minidom import sci...
# execute essa linha de código para importar as funções do 'plot_helper' import numpy from numpy.linalg import inv, eig from math import ceil from matplotlib import pyplot, ticker, get_backend, rc from mpl_toolkits.mplot3d import Axes3D from itertools import cycle # interactive backends _int_backends = ['GTK3Agg', 'G...
""" Return container object, with each array entry in the container cast to a list """ def to_list(x, _=''): try: return self._ivy.to_list(x) except (AttributeError, ValueError): return x return self.map(to_list) def reshape_like(self, target_dict, leading_shape=None, return_cont=None): """ Set shapes of co...