input
stringlengths
2.65k
237k
output
stringclasses
1 value
"unicode": "1f1ee-1f1e9" }, ":flag_ie:": { "category": "flags", "name": "ireland", "unicode": "1f1ee-1f1ea" }, ":flag_il:": { "category": "flags", "name": "israel", "unicode": "1f1ee-1f1f1" }, ":flag_im:": { "category": "flags", "name": "isle of man", "unicode": "1f1ee-1f1f2" }, ":flag_in:": { "catego...
<filename>examples/inducing_points/inducing_points.py # -*- coding: utf-8 -*- hlp = """ Comparison of the inducing point selection methods with varying noise rates on a simple Gaussian Process signal. """ if __name__ == "__main__": import matplotlib matplotlib.use("Agg") import sys reload(sys) sys.setdefaultencod...
<filename>btb_manager_telegram/handlers.py<gh_stars>0 import json import os import shutil import sqlite3 import subprocess import sys from configparser import ConfigParser from telegram import Bot, ReplyKeyboardMarkup, ReplyKeyboardRemove, Update from telegram.ext import ( CallbackContext, CommandHandler, Conversat...
<gh_stars>0 #!/usr/bin/env python3 import time as timer import sys import logging from collections import deque from angr.exploration_techniques import ExplorationTechnique import psutil class ToolChainExplorer(ExplorationTechnique): """ TODO """ def __init__( self, simgr, max_length, exp_dir, nameFileShort,...
<filename>dataloader.py # coding:utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import cPickle import h5py import os, time, pdb import numpy as np import random import torch import torch.utils.data as data import multiproces...
resources[index + 1], resources[index] self.collection.set_dirty(True) indexes = [index + 1 for index in indexes] self.update_table(table, resources, indexes) self.update_ui() message = "Resource moved" if len(indexes) == 1 else "Resources moved" self.statusBar().showMessage(message, 5000) def edit_move_left(s...
""" This code is based on https://github.com/ekwebb/fNRI which in turn is based on https://github.com/ethanfetaya/NRI (MIT licence) """ import numpy as np import torch from torch.utils.data.dataset import TensorDataset from torch.utils.data import DataLoader import torch.nn.functional as F from torch.autograd import V...
<reponame>DangoMelon/turbo-octo-winner import datetime import os import argopy import geopandas as gpd import gsw import numpy as np import pandas as pd import xarray as xr from argopy import DataFetcher as ArgoDataFetcher from argopy import IndexFetcher as ArgoIndexFetcher from dmelon.ocean.argo import build_dl, laun...
cmds.nodeType(input_value) == 'multiplyDivide': new_multi.append(input_value) if new_multi: multi = new_multi if not new_multi: multi = [] attributes = self._get_message_attribute_with_prefix('multiply') for attribute in attributes: input_attr = attr.get_attribute_input('%s.%s' % (self.pose_con...
# Copyright (c) MONAI Consortium # 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, softwa...
import loaddata import pokemon_regression import pokemon_stat_analysis import pokemon_test_are_dragons_taller import pokemon_normal_dist_and_actual_vals separator_char = ", " separator = '---------------------------------------------------------------' tab: str = "\t" def do_normal_dist_against_actual_values(options...
import requests import xml.etree.ElementTree as ET from typing import List from typing import Union from datetime import date from datetime import datetime from pysec.parser import EDGARParser # https://www.sec.gov/cgi-bin/srch-edgar?text=form-type%3D%2810-q*+OR+10-k*%29&first=2020&last=2020 class EDGARQuery(): d...
appropriately loaded!") return self.__init_blank_net @abc.abstractmethod def remove_before_save(self) -> _TypeBuffer: raise NotImplementedError("Abstract method!") @abc.abstractmethod def reload_after_save(self, data: _TypeBuffer, /) -> None: raise NotImplementedError("Abstract method!") # ------------------...
if is_zero(Hvec*Vvec + Hconst): incidence_matrix[Vindex, Hindex] = 1 # A ray or line is considered incident with a hyperplane, # if it is orthogonal to the normal vector of the hyperplane. for Vvec, Vindex in Vvectors_rays_lines: if is_zero(Hvec*Vvec): incidence_matrix[Vindex, Hindex] = 1 incidence_matrix.set_...
import tensorflow as tf import numpy as np import PIL as pil import scipy import skimage.measure from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D, Cropping2D, ZeroPadding2D, Convolution2D, Activation, AveragePooling2D, Flatten, Reshape from keras.layers import Deconvolution2D as Conv2DTranspos...
<gh_stars>10-100 # coding: utf-8 # In[853]: # for C4, C6, C7, C8, C10 outliers, lookit cat variables to see if we can identify groupings... #C8,c10 we can kinda tell, 0.51 # C12=0.553 # Hard winsorize: traintr.loc[traintr.D4>484,'D4'] = 485 testtr.loc[testtr.D4>484,'D4'] = 485 data.loc[data.D4>484,'D4'] = np.nan t...
import numpy import numpy.linalg def weights(basis, X, deriv=None): """ Calculates the interpolant value or derivative weights for points X. :param basis: interpolation function in each direction, eg, ``['L1', 'L1']`` for bilinear. :type basis: list of strings :param X: locations to calculate interpolant weigh...
delete_group" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'group_id' is set if self.api_client.client_side_validation and ('group_id' not in local_var_params or # noqa: E501 local_var_params['group_id'] is None): # noqa: E501 raise ApiValueError("Missing the...
<gh_stars>10-100 ''' Test the preference_features module with some simple synthetic data test Created on 3 Mar 2017 @author: edwin ''' import logging import os import sys from gp_pref_learning import GPPrefLearning logging.basicConfig(level=logging.DEBUG) sys.path.append("./python") sys.path.append("./python/analy...
<reponame>usegalaxy-no/usegalaxy #!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERA...
marking_definition_instance["id"]) return_obj.append(marking_definition_instance) else: if get_option_value("spec_version") == "2.1": warn("ACS data markings only supported when --acs option is used. See %s", 436, isa_marking.identifier) else: warn("ACS data markings cannot be supported in version 2.0.", 217) re...
<reponame>mgeeky/Penetration-Testing-Tools<filename>clouds/aws/exfiltrate-ec2.py #!/usr/bin/python3 # # This script abuses insecure permissions given to the EC2 IAM Role to exfiltrate target EC2's # filesystem data in a form of it's shared EBS snapshot or publicly exposed AMI image. # # CreateSnapshot: # Abuses: # ec2:...
# coding: utf-8 """ Layered Witness & Control LI Witness provides deep insight and analytics into containerized applications. Control provides dynamic runtime security and analytics for containerized applications. You can find out more about the Layered Insight Suite at [http://layeredinsight.com](http://layeredins...
jx] * m.delta[it, jt, ix, jx] * (1 - m.ed[it, jt, ix, jx]) * \ sum(m.rgc[it, jt, ix, jx, k] * m.cpgcgc[k] for k in m.sp) * m.Tgc[it, jt, ix, jx]) * m.hi_t[it] else: return Constraint.Skip # equation A.5 Solid phase adsorbed species balance # dNse_dt def de_nsc_rule(m, it, jt, ix, jx, k): if 0 < jt <= m.ncp_t and ...
<reponame>sjklipp/autochem_1219 """ molecular graph """ import itertools import functools import numpy import future.moves.itertools as fmit from qcelemental import periodictable as pt from automol import dict_ from automol.graph import _networkx import automol.dict_.multi as mdict import automol.create.graph as _creat...
<reponame>ToucanToco/toucan-data-sdk<gh_stars>1-10 from typing import Any, List import numpy as np import pandas as pd __all__ = ( 'lower', 'upper', 'title', 'capitalize', 'swapcase', 'length', 'isalnum', 'isalpha', 'isdigit', 'isspace', 'islower', 'isupper', 'istitle', 'isnumeric', 'isdecimal', 'stri...
# Copyright 2019 SiFive, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You should have received a copy of LICENSE.Apache2 along with # this software. If not, you may obtain a copy at # # https://www.apache.org/licenses/LICEN...
feature_maps """ feature_map_shapes = [ shape_utils.combined_static_and_dynamic_shape( feature_map) for feature_map in feature_maps ] return [(shape[1], shape[2]) for shape in feature_map_shapes] def postprocess(self, prediction_dict): """Converts prediction tensors to final detections. This function convert...
HIRS report and ensure it passes - Ensure that there are no new alerts """ logging.info("***************** Beginning of broad repo successful appraisal test *****************") @collectors(['TPM'], COLLECTOR_LIST) @unittest.skipIf(not is_tpm_1_2(TPM_VERSION), "Skipping this test due to TPM Version " + TPM_VERSION...
that confuses the algorithm # for finding th end of the structure. Or if there is another # structure definition embedded in the structure. i = 0 while i < num_tokens - 2: if (b.tokens[i].kind != TokenKind.KEYWORD or b.tokens[i].id != "struct"): i += 1 continue if (b.tokens[i + 1].kind == TokenKind.IDENTIFIER ...
<reponame>Anthonyive/scattertext import collections import re import numpy as np import pandas as pd from scattertext.CSRMatrixTools import delete_columns, CSRMatrixFactory from scattertext.FeatureOuput import FeatureLister from scattertext.Common import SPACY_ENTITY_TAGS, MY_ENGLISH_STOP_WORDS, DEFAULT_BACKGROUND_SC...
'''Local.py - CGAT project specific functions ============================================= The :mod:`Local` module contains various utility functions for working on CGAT projects and are very specific to the CGAT directory layout. .. note:: Methods in this module need to made to work with arbitrary project layout...
<reponame>dksifoua/NMT<filename>nmt/train/trainer.py import os import tqdm import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchtext.data import Dataset, Field from torchtext.data.metrics import bleu_score from torcht...
r, s = line(infile) A = [((i * p + q) % r + s) for i in xrange(N)] total = sum(A) totalsum = [a for a in A] for i in xrange(1, N): totalsum[i] += totalsum[i - 1] best = total b = 0 for a in xrange(N): if b < a: b += 1 while b < N - 1 and getsum(a, b, total, totalsum) >= getsum(a, b + 1, total, totalsum): ...
``self``. INPUT: - ``i`` -- integer between ``0`` and ``n-1`` where ``n`` is the cardinality of this set EXAMPLES:: sage: G = NumberField(x^3 - 3*x + 1,'a').galois_group() sage: [G.unrank(i) for i in range(G.cardinality())] [(), (1,2,3), (1,3,2)] TESTS:: sage: G = NumberField(x^3 - 3*x + 1,'a').galois_gr...
import numpy, sys from PyQt5.QtGui import QPalette, QColor, QFont from PyQt5.QtWidgets import QMessageBox from orangewidget import gui from orangewidget import widget from orangewidget.settings import Setting from oasys.widgets import gui as oasysgui from oasys.widgets import congruence from oasys.widgets.gui import ...
<filename>unorganized_code/two_species.py #!/usr/bin/python import argparse import datetime import os import subprocess import numpy as np from simulation_parameters import DefineRegion class SharedCommands(object): def __init__(self, n_initial, record): self.n_initial = n_initial self.record = record def ini...
], [ 708, 676, 73, 708, 676, 29, 708, 676, -3, 728, 552, 48, 721, 409, 24, 689, 405, 7, 656, 402, 22, 634, 539, 47, 556, 662, -6, 556, 662, 21, 556, 662, 51, 693, 305, 18, 697, 204, 43, 701, 104, 62, 638, 194, 16, 559, 277, 4, 558, 308, -7, 558, 308, -21, 757, 21...
<gh_stars>0 ########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redist...
import copy import numpy as np import numpy.linalg as la from scipy.optimize import linprog # TODO: REMOVE from _errors import ConvergenceError # ====================================================================================================================== # Root-finding Methods # =================...
(start position, length) """ buf = [] for i, elt in enumerate(mask): if elt: buf.append(i) elif buf: yield buf[0], len(buf) buf = [] if buf: yield buf[0], len(buf) def greedy_matching(seq1, seq2, min_match_size): """ Greedy search for common substrings between seq1 and seq2. Residual substrings (smaller...
Please wait... \n") for i in range(0, 1): browser.reload() time.sleep(2) browser.back() print("Sleeping for 30 seconds to emulate humans. \n") time.sleep(30) browser.forward() playsound('./sounds/break_pedal.wav') break_pedal_ayh = input("Please click a laptop item, and add or remove it from ...
<reponame>BSchilperoort/python-dts-calibration # coding=utf-8 import os import numpy as np import scipy.sparse as sp from scipy import stats from dtscalibration import DataStore from dtscalibration import read_xml_dir from dtscalibration.calibrate_utils import wls_sparse from dtscalibration.calibrate_utils import wls...
#!/usr/bin/python # (c) 2021, NetApp, Inc # 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 DOCUMENTATION = """ module: na_ontap_volume_efficiency short_description: NetApp ONTAP enables, ...
import argparse import subprocess import random import math import os class sWCSimGenerateData(object): def __init__(self): # Set parameters to choose. # parser = argparse.ArgumentParser(description="Generate several .root files of data for " "different particles, energy, directions and initial positions " "of...
) subnetId = serializers.CharField( help_text="Subnet defined by the identifier of the subnet resource in the VIM.", required=False, allow_null=True, allow_blank=True ) class IpOverEthernetAddressSerializer(serializers.Serializer): macAddress = serializers.CharField( help_text="MAC address.", required=False,...
<gh_stars>10-100 # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in...
<reponame>abel-gr/AbelNN # Copyright <NAME>. All Rights Reserved. # https://github.com/abel-gr/AbelNN import numpy as np import copy as copy import random import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm from pylab import text import math class ConvNetAbel: version = 1.2 def __init__...
- len(ws_tokens[ws_token_id].split()) + attractor_len if rep_id == src_rep_loc: updated_ambiguous_focus_term_ws_id = updated_rep_id updated_ambiguous_term_ws_ids.append(updated_rep_id) assert ws_tokens[spacy_to_ws_map[src_rep_loc][0]] == new_sent_tokens[updated_ambiguous_focus_term_ws_id], \ 'Mismatch between tok...
<gh_stars>0 #!/usr/bin/env python # Copyright (c) 2019 Diamond Key Security, NFP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # - Redistributions of source code must retain the above copyrigh...
# Copyright 2016 <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 in writing, software ...
# -*- coding: utf-8 -*- ## File = "SipmQuerryRoot.py" ## ## Modified by cmj2018Mar28... Changed the directory structure and calls DataLoader versions so these could be accounted for. ## This version uses the old hdbClient_v1_3a ## Modifed by cmj2018Mar28... Change "crvUtilities2017.zip" to "crvUtilities.zip" ## Modifie...
TType.LIST, 12) oprot.writeListBegin(TType.STRUCT, len(self.Dependencies)) for iter112 in self.Dependencies: iter112.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.Events is not None: oprot.writeFieldBegin('Events', TType.LIST, 13) oprot.writeListBegin(TType.STRING, len(self.Events)) for iter1...
from keeper_secrets_manager_helper.field import Field, FieldSectionEnum from keeper_secrets_manager_helper.common import load_file from keeper_secrets_manager_helper.v3.record_type import get_class_by_type as get_record_type_class from keeper_secrets_manager_helper.v3.field_type import get_class_by_type as get_field_ty...
import copy import datetime import logging import pathlib import typing from typing import List, Dict, Union, Tuple from shapely.geometry import Polygon, MultiPolygon, mapping from openeo.imagecollection import ImageCollection from openeo.internal.graphbuilder_040 import GraphBuilder from openeo.metadata import Colle...
<filename>dan_gui.py import pygame import math # RGB colour definitions for referring to later black = (0, 0, 0) white = (255, 255, 255) grey = (100, 100, 100) darkGrey = (50, 50, 50) light_grey = (130, 130, 130) # Base/parent class used for all other classes # Should be treated as abstract - there should never be a...
# Copyright 2016 Open Source Robotics Foundation, 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 ...
<reponame>kamperh/vqwordseg<filename>vqwordseg/algorithms.py """ VQ phone and word segmentation algorithms. Author: <NAME> Contact: <EMAIL> Date: 2021 """ from pathlib import Path from scipy.spatial import distance from scipy.special import factorial from scipy.stats import gamma from tqdm import tqdm import numpy as...
system self._send_command('SetControlMode ArmAssist Global') def set_trajectory_control(self): #trajectory control with global reference system self._send_command('SetControlMode ArmAssist Trajectory') def send_vel(self, vel): vel = vel.copy() # units of vel should be: [cm/s, cm/s, rad/s] assert len(vel) == s...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.core.agents import create_agent_from_shared from parlai.mturk.core.legacy_2018.agents import TIMEOUT_MESSAGE ...
array, this is a required to be the sample rate. Defaults to 0. :param phase_correction: bool, perform phase checking before summing to mono. Defaults to False. :param dev_output: bool, when False return the depth, when True return all extracted features. Default to False. :param threshold_db: float/int (negative)...
before : `None`, `str`, `list` of `str` = `None`, Optional Any content, what should go before the exception's traceback. If given as `str`, or if `list`, then the last element of it should end with linebreak. after : `None`, `str`, `list` of `str` = `None`, Optional Any content, what should go after the excep...
id_data = None ''' ''' def append(self, draw_func): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def draw(self, context): ''' ''' pass def driver_add(self): ''' ''' pass def driver_...
<reponame>formatechnologies/models # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
+ 1}: {temp_stat_changes[i][2].name}") print(f"Description: '{temp_stat_changes[i][2].dscrpt}'\n") print(f"Turns left: {temp_stat_changes[i][0] - self.battle_dict['turn_counter']}") print(f"Health Modifier: {temp_stat_changes[i][1][Stat_Sheet.health] * -1}\n" if temp_stat_changes[i][1][Stat_Sheet.health] != 0 els...
PageSize: The maximum number of items to return with this call. :rtype: dict :returns: """ pass def list_portfolios_for_product(self, ProductId: str, AcceptLanguage: str = None, PageToken: str = None, PageSize: int = None) -> Dict: """ Lists all portfolios that the specified product is associated with. See al...
allocated. Default is GPU if available, otherwise CPU. dropout: The proportion of dropout to use for this layer, default 0.0. mean: The mean of the normal distribution to initialize weights, default 0.0. std: The standard deviation of the normal distribution to initialize weights, default 0.05. activation: The act...
each row in the sampled dataset. Otherwise, the first 100 rows of the RDD are inspected. Nested collections are supported, which can include array, dict, list, Row, tuple, namedtuple, or object. Each row could be L{pyspark.sql.Row} object or namedtuple or objects. Using top level dicts is deprecated, as dict is u...
<gh_stars>1-10 from smac.env.starcraft2.starcraft2 import StarCraft2Env from smac.env.starcraft2.starcraft2 import races, difficulties, Direction from smac.env.starcraft2.starcraft2 import actions as actions_api from operator import attrgetter from copy import deepcopy import numpy as np from absl import logging from...
<gh_stars>100-1000 import os import sys import gc import ctypes import psutil import pytest import warnings import threading from time import sleep from multiprocessing import util, current_process from pickle import PicklingError, UnpicklingError from distutils.version import LooseVersion import loky from loky import...
# -*- coding: utf-8 -*- """ Helper functions and classes for general use. """ from __future__ import division from functools import partial, update_wrapper from time import localtime, strftime import numpy as np from numpy.linalg import norm import rospy from geometry_msgs.msg import Point, PoseStamped, Quaternion f...
graph. elem_type = _execute.make_type(elem_type, "elem_type") _, _, _op, _outputs = _op_def_library._apply_op_helper( "StackPop", handle=handle, elem_type=elem_type, name=name) _result = _outputs[:] if _execute.must_record_gradient(): _attrs = ("elem_type", _op._get_attr_type("elem_type")) _inputs_flat = _op.inp...
"reference_image")]), (norm, map_wmmask, [ ("reverse_transforms", "transforms"), ("reverse_invert_flags", "invert_transform_flags"), ]), (map_wmmask, inu_n4_final, [("output_image", "weight_image")]), ]) # fmt: on if use_laplacian: lap_tmpl = pe.Node( ImageMath(operation="Laplacian", op2="1.5 1", copy_header...
<filename>src/amuse/ext/orbital_elements.py<gh_stars>100-1000 """ orbital element conversion and utility functions this module provides: generate_binaries orbital_elements get_orbital_elements_from_binary get_orbital_elements_from_binaries get_orbital_elements_from_arrays and the following deprecated functions (assu...
<gh_stars>1-10 # Virtual memory analysis scripts. # Developed 2012-2014 by <NAME>, <EMAIL> # Copyright (c) 2012-2014 <NAME> and University of Washington from util.pjh_utils import * from plotting.PlotEvent import PlotEvent import brewer2mpl import copy import itertools import numpy as np import plotting.plots_style as...
get_trace_list(self): """Return raw trace fit parameters.""" return self._trace_list # Return full primary data header: def get_metadata(self): return self._metadata # Return traces as pixel masks (requires appropriate metadata): def get_trace_masks(self, vlevel=0): """Returns traces as pixel masks.""" if no...
not self.slice_from(u"eux"): return False except lab14: pass elif among_var == 12: # (, line 150 # call R1, line 150 if not self.r_R1(): return False if not self.out_grouping_b(FrenchStemmer.g_v, 97, 251): return False # delete, line 150 if not self.slice_del(): return False elif among_var == 13: # (, li...
<gh_stars>100-1000 from collections import namedtuple from .. import backends as be from .layer import Layer, CumulantsTAP ParamsBernoulli = namedtuple("ParamsBernoulli", ["loc"]) class BernoulliLayer(Layer): """ Layer with Bernoulli units (i.e., 0 or +1). """ def __init__(self, num_units, center=False): """ ...
"gmsa_credential_spec") @property @pulumi.getter(name="gmsaCredentialSpecName") def gmsa_credential_spec_name(self) -> Optional[str]: """ GMSACredentialSpecName is the name of the GMSA credential spec to use. """ return pulumi.get(self, "gmsa_credential_spec_name") @property @pulumi.getter(name="runAsUserNam...
<filename>migrations/versions/be21086640ad_country_added.py """Country added Revision ID: be21086640ad Revises: <PASSWORD> Create Date: 2021-11-09 15:34:04.306218 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'be21086640ad' down_revision = '<PASSWORD>' branch...
<reponame>RebeccaYin7/hyppo import numpy as np class _CheckInputs: """ Check if additional arguments are correct """ def __init__(self, n, p): self.n = n self.p = p def __call__(self, *args): if type(self.n) is not int or type(self.p) is not int: raise ValueError("n and p must be ints") if self.n < 5 or se...
<filename>src/sage/rings/finite_rings/finite_field_ext_pari.py """ Finite Extension Fields implemented via PARI POLMODs (deprecated) AUTHORS: - <NAME>: initial version - <NAME> (2010-12-16): fix formatting of docstrings (:trac:`10487`) """ #****************************************************************************...
import sys import os import copy import collections try: Counter=collections.Counter pass except AttributeError: # python 2.6 and earlier don't have collections.Counter. # Use local version py26counter.py instead import py26counter Counter=py26counter.Counter pass import numpy as np if "gi" in sys.modules...
from __future__ import division from os.path import join, basename, exists from os import makedirs from nilearn import input_data, datasets, plotting, regions from nilearn.image import concat_imgs from nilearn.input_data import NiftiLabelsMasker from nilearn.connectome import ConnectivityMeasure from scipy.stats impor...
<gh_stars>1-10 # 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 Genera...
import keras.backend as K import cv2, time, os import numpy as np import model as modellib from skimage import morphology class MAPCallback: def __init__(self, model, val_dataset, class_names, threshold=5, inference_num=50, batch_size=1, old_version=False): super(MAPCallback, self).__init__() self.model = m...
source.startswith(rev)) return subset.filter(lambda r: _matchvalue(r)) def date(repo, subset, x): """``date(interval)`` Changesets within the interval, see :hg:`help dates`. """ # i18n: "date" is a keyword ds = getstring(x, _("date requires a string")) dm = util.matchdate(ds) return subset.filter(lambda x: dm...
import sys import os import time import queue import random import logging import concurrent.futures as cf from multiprocessing import Process from multiprocessing import Queue # PROGRAM CONFIG STOPONFE = True; DEBUG = False; LOG = True; # logger_format = "[%(asctime)s %(msecs)03dms] [PID %(process)d] %(message)s"...
(geometry.wkbType() == QGis.WKBMultiLineString) or \ (geometry.wkbType() == QGis.WKBMultiLineString25D): lines = geometry.asMultiPolyline() line = lines[0] fromx = line[0].x() fromy = line[0].y() line = lines[len(lines) - 1] tox = line[len(line) - 1].x() toy = line[len(line) - 1]...
<filename>datacommons_pandas/df_builder.py # Copyright 2020 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 a...
<gh_stars>0 import asyncio import discord import random from discord.ext import commands from Cogs import Settings from Cogs import DisplayName from Cogs import Nullify def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(UserRole(bot, settings)) class UserRole(command...
<filename>robot_motion_planning/code/robot.py import numpy as np import json import random from sys import stderr class Robot(object): def __init__(self, maze_dim): """ set up attributes that the robot will use to learn and navigate the maze. Some initial attributes are provided based on common information, inclu...
from IPython import get_ipython if get_ipython().__class__.__name__ == 'ZMQInteractiveShell': from tqdm import tqdm_notebook as tqdm else: from tqdm import tqdm import os import numpy as np import pandas as pd import matplotlib.pyplot as plt # Sarkas Modules import sarkas.tools.observables as obs class Transport...
- y1) * (y2 - y1) + (x2 - x1) * (x2 - x1) # print("line: slope={:.2f}, x_mid={:.2f}, intercept={:.2f}:({:.2f},{:.2f})-({:.2f},{:.2f})".format( # slope, x_mid, intercept, x1, y1, x2, y2)) if (slope >= min_pos_slope) and (slope <= max_pos_slope): pos_slopes.append(slope) pos_intercepts.append(intercept) pos_sq_dist...
maxHs: break startingPoint = sortedTBuoy.T[0] hsBin1.append(sortedTBuoy.Hs[0]) tBin1.append(sortedTBuoy.T[0]) while True: tempNextBinTs = sortedTBuoy.T[sortedTBuoy.T < startingPoint + tStepSize] tempNextBinHs = sortedTBuoy.Hs[sortedTBuoy.T < startingPoint + tStepSize] nextBinTs = tempNextBinTs[tempN...
configured m = p5.match(line) if m: password_text = m.groupdict()['password_text'] if flag: parsed_dict['peer_session'][template_id]['inherited_session_commands']\ ['password_text'] = password_text else: parsed_dict['peer_session'][template_id]['password_text'] = password_text continue # shutdown m = p6.mat...
<reponame>Ayyub29/transformer-quantization<gh_stars>1-10 # Copyright (c) 2021 Qualcomm Technologies, Inc. # All Rights Reserved. import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import CrossEntropyLoss, MSELoss from transformers.models.mobilebert.modeling_mobilebert import...
import torch.nn as nn import torch from torch.autograd import Variable class InitialBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_size=3, padding=0, bias=False, relu=True): super(InitialBlock,self).__init__() if relu: activation = nn.ReLU() else: activation = nn.PReLU() # Main...
import re import inflect import nltk from src.pre_process.common_nlp import lemmatizer, text_into_sentence from src.identify_relationship import binary_relationship_dic_list, ternary_relationship_list, \ unary_relationship_dic_list from src.utils.file_manipulation import get_root_of_input_xml one_to_one_relationshi...
1 0] sage: asm = A([[0, 1, 0],[1, -1, 1],[0, 1, 0]]) sage: asm.height_function() [0 1 2 3] [1 2 1 2] [2 1 2 1] [3 2 1 0] sage: asm = A([[0, 0, 1],[1, 0, 0],[0, 1, 0]]) sage: asm.height_function() [0 1 2 3] [1 2 1 2] [2 3 2 1] [3 2 1 0] """ asm = self.to_matrix() n = asm.nrows() + 1 return matrix([[i+j-2...