input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import argparse
import os
import pytest
import vcf
from ..dumpSTR import *
# Set up base argparser
@pytest.fixture
def args(tmpdir):
args = argparse.ArgumentParser()
args.vcf = None
args.vcftype = "auto"
args.out = str(tmpdir / "test")
args.min_locus_callrate = None
args.min_locus_hwep = None
args.min_locus_... | |
<reponame>leo-oliveiraa/wa-automation-tool
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.common.exceptions i... | |
"champion's",
'champions',
'championship',
'champs',
'chan',
'chance',
'chanced',
'chances',
'chancing',
'chancy',
'chandelier',
'chandler',
'chanel',
'change',
'change-o',
'changeable',
'changed',
'changer',
'changers',
'changes',
"changin'",
'changing',
'channel',
"channel's",
'channeled',
'c... | |
{float: 'float', int: 'short'}
if dtype in dtypes:
dtype = dtypes[dtype]
prefix, ext = afni.split_out_file(out_file)
outputs = {'out_file': f"{prefix}{ext}"}
mean_file = utils.temp_prefix(suffix=ext)
utils.run(f"3dTstat -mean -prefix {mean_file} -overwrite {in_file}")
if mask_file is not None:
utils.run(f"3dcal... | |
* t_values[37]))
+ (R_values[38] / (1 + w * 1j * t_values[38]))
+ (R_values[39] / (1 + w * 1j * t_values[39]))
+ (R_values[40] / (1 + w * 1j * t_values[40]))
+ (R_values[41] / (1 + w * 1j * t_values[41]))
+ (R_values[42] / (1 + w * 1j * t_values[42]))
+ (R_values[43] / (1 + w * 1j * t_values[43]))
+ (R_values[44... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of web2py Web Framework (Copyrighted, 2007-2009).
Developed by <NAME> <<EMAIL>>.
License: GPL v2
Holds:
- SQLFORM: provide a form for a table (with/without record)
- SQLTABLE: provides a table for a set of records
- form_factory: provides a SQLFORM ... | |
% (
dbid, current["entitytype"], network_type, throughput)))
update_virtual_resoures_tree_network(db, current["parententityid"], network_type, slice_id, class_id,
reset_flag, LOG=LOG)
except:
cloud_utils.log_exception(sys.exc_info(), LOG=LOG)
process_network_services = [
"nat_network_service",
"rts_network_ser... | |
#!/router/bin/python
from collections import namedtuple, OrderedDict, deque
from client_utils import text_tables
from common.text_opts import format_text, format_threshold, format_num
from client.trex_async_client import CTRexAsyncStats
import copy
import datetime
import time
import re
import math
import copy
GLOBAL_S... | |
index0 = 1
output = "permutation"
if self.base_ring().is_exact():
def rational_approximation(c):
return c
else:
c_list = []
def rational_approximation(c):
# Implementation detail: Return unique integer if two
# c-values are the same up to machine precision. But
# you can think of it as a uniquely-chosen rat... | |
<gh_stars>1-10
import tkinter as tk
import copy as copy
import time
import random
import math
import sys
import queue
import cProfile
import operator
class MCTSNode:
def __init__(self, state, player):
self.state = state #type State
self.player = player #black or white
self.children = [] #list of MCTSNode
self.pa... | |
<reponame>Bhaskers-Blu-Org1/ImageNet-Robustness<filename>l1_attack.py
## l1_attack.py -- attack a network optimizing elastic-net distance with an l1 decision rule
##
## Copyright (C) 2017, <NAME> <<EMAIL>>.
## Copyright (C) 2016, <NAME> <<EMAIL>>.
##
## This program is licenced under the BSD 2-Clause licence,
## contai... | |
<reponame>SmartElect/SmartElect
# -*- coding: utf-8 -*-
# Python imports
import base64
from decimal import Decimal, InvalidOperation
import functools
from http.client import UNAUTHORIZED
import logging
import random
import re
import string
# Django imports
from django.conf import settings
from django.contrib.auth.mode... | |
"",
"SMKE" : "",
"LEHC" : "HSK",
"LRBG" : "",
"GUFA" : "FIG",
"SYOR" : "ORJ",
"ZUYB" : "YBP",
"KTPL" : "TPL",
"KTPA" : "TPA",
"KIPP" : "",
"KIPL" : "IPL",
"NZWO" : "",
"HEBL" : "ABS",
"HEBA" : "HBE",
"CNU8" : "NU8",
"OOKB" : "KHS",
"KHVN" : "HVN",
"KHVR" : "HVR",
"EINC" : "",
"EDJA" : "FMM",
"RCCM" ... | |
+ (R_values[31] / (1 + w * 1j * t_values[31]))
+ (R_values[32] / (1 + w * 1j * t_values[32]))
+ (R_values[33] / (1 + w * 1j * t_values[33]))
+ (R_values[34] / (1 + w * 1j * t_values[34]))
+ (R_values[35] / (1 + w * 1j * t_values[35]))
+ (R_values[36] / (1 + w * 1j * t_values[36]))
+ (R_values[37] / (1 + w * 1j * ... | |
"1.B-10510", "9374-10510"],
"info": {"numerical_ids": ["9374"]},
"children": [["1.B.1", "1.B.2"]],
},
"1.B.1": {
"title": "Solid Fuels",
"alternative_codes": ["9455", "1B1", "1 B 1", "1.B.1-10510", "9455-10510"],
"info": {"numerical_ids": ["9455"]},
"children": [["1.B.1.a", "1.B.1.b", "1.B.1.c"]],
},
"1.B.1.a... | |
<reponame>vidkidz/crossbridge
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import urlparse, urllib, time
from zope.interface import Interface
from twisted.web impor... | |
<filename>sfoda/suntans/sundriver.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Driver classes for generating suntans input files
<NAME>
Stanford University
April 2013
"""
from .sunpy import Grid, Spatial
from .sundepths import DepthDriver, adjust_channel_depth
from .sunboundary import modifyBCmarker, Bound... | |
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import logging
import typing
import uuid
from xml.etree import ElementTree
from psrpcore._crypto import PSRemotingCrypto
from psrpcore._events import PSRPEvent, SessionCapabi... | |
<reponame>KVSlab/vascularManipulationToolkit<gh_stars>10-100
import math
from scipy.interpolate import splrep, splev
from morphman.common.common import get_distance
from morphman.common.vmtk_wrapper import *
from morphman.common.vtk_wrapper import *
### The following code is adapted from:
### https://github.com/vmt... | |
format=("%Y-%m-%dT%H:%M:%S.%f", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d")
):
super(DefaultDateDeserializer, self).__init__()
self.format = format
def deserialize(
self, name: str, block: Any, parameterized: param.Parameterized
) -> None:
if self.check_if_allow_none_and_set(name, block, parameterized):
return
from date... | |
"""
Project Module.
"""
import os
from optparse import Values
from pathlib import Path
from typing import List, Optional, Any, Dict, Callable, TYPE_CHECKING
# from pineboolib.fllegacy.flaccesscontrollists import FLAccessControlLists # FIXME: Not allowed yet
from PyQt5 import QtWidgets
from pineboolib.core.utils im... | |
<gh_stars>1-10
#!/usr/bin/env python
import string, re
from DOM import Element, Text, Node, DocumentFragment, Document
from Tokenizer import Token, BeginGroup, EndGroup, Other
from plasTeX import Logging
log = Logging.getLogger()
status = Logging.getLogger('status')
deflog = Logging.getLogger('parse.definitions')
#
... | |
"ve\u010der",
"vlastn\u011b",
"vy",
"v\u00e1m",
"v\u00e1mi",
"v\u00e1s",
"v\u00e1\u0161",
"v\u00edce",
"v\u0161ak",
"v\u0161echno",
"v\u0161ichni",
"v\u016fbec",
"v\u017edy",
"z",
"za",
"zat\u00edmco",
"za\u010d",
"zda",
"zde",
"ze",
"zpr\u00e1vy",
"zp\u011bt",
"\u010dau",
"\u010di",
"\u010dl\u0... | |
from functools import reduce
import networkx as nx
def identity(*args):
if len(args) == 1:
return args[0]
return args
def er(e):
"""
This function returns the reverse of an edge represented as a tuple
"""
s, d = e
return (d, s)
def cer(e):
"""
Canonicalize the representation of an undi... | |
called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_clus_run_job_summary_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_clus_run_job_summary_with_http_info(**kwargs) # noqa: E501
return data
def get_clus_run_job_... | |
<filename>src/whacked4/ui/mainwindow.py
#!/usr/bin/env python
#coding=utf8
from whacked4 import config, utils
from whacked4.dehacked import engine, patch
from whacked4.doom import wadlist, wad
from whacked4.ui import windows, workspace
from whacked4.ui.dialogs import startdialog, aboutdialog, patchinfodialog
from whac... | |
(1 - ps) * c
return new_h, new_h
else:
with tf.variable_scope(scope or type(self).__name__): # "GRUCell"
with tf.variable_scope("Gates"): # Reset gate and update gate.
# We start with bias of 1.0 to not reset and not udpate.
r, u = tf.split(1, 2, lfe.enhanced_linear([inputs, state],
2 * self._num_units, True, 1... | |
<gh_stars>10-100
from __future__ import absolute_import, division, print_function
import collections
import torch
import torch.nn as nn
import torch.nn.functional as F
# from torch.nn.utils.spectral_norm import spectral_norm
from model.pwc_modules import conv, rescale_flow, upsample2d_as, initialize_msra, upsample2d_fl... | |
import yaml
from collections import namedtuple
from github import Github
from psycopg2 import connect, Error
from tqdm import tqdm
from .generator import ExtractorGenerator
from .models.model_manager import ModelManager
from .scanners.git_scanner import GitScanner
Rule = namedtuple('Rule', 'id regex category descri... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
= X[:, None]
_check_assertions(X, binary_operators, unary_operators,
use_custom_variable_names, variable_names, weights, y)
if len(X) > 10000 and not batching:
warnings.warn("Note: you are running with more than 10,000 datapoints. You should consider turning on batching (https://pysr.readthedocs.io/en/latest/doc... | |
life easier! If you'd like to read more on how the compiler operates, check the docs [here](https://www.tensorflow.org/api_docs/python/tf/keras/Model#compile).
# In[69]:
happy_model.compile(optimizer='adam',
loss='binary_crossentropy',
metrics=['accuracy'])
# It's time to check your model's parameters with the `... | |
'due', 'id']) for header in headers_as_dicts ]
matching_forms = []
matching_forms += add_and_replace_objects(headers_to_match_against, {"id": "matched_to"}, {"value": -100})
# by entering -100 we are creating a negative payment which has a positive balance
# so we match the positive balance of 100.00
matching_data... | |
"""Data structure for CAtlas."""
import argparse
import cProfile
import os
import sys
import tempfile
import gzip
import copy
from .rdomset import rdomset, domination_graph
from .graph_io import read_from_gxt, write_to_gxt
from .graph import Graph
from spacegraphcats.utils.logging import log_command
from io import Tex... | |
import os
import io
import sys
import stat
import glob
import click
import shlex
import subprocess
import pandas as pd
from datetime import datetime, timedelta
from typing import Tuple, List, Dict, Optional
from fabrica import date_format, control_prefix, calculate_prefix, Operator, GenerateMode, EntityFactory, MMPFa... | |
<reponame>poly451/Tutorials
import random
import constants
import os, sys
from shutil import copyfile
import math
import time
def get_unique_number():
tt = time.gmtime()
return "{}{}{}{}{}{}".format(tt.tm_year, tt.tm_mon, tt.tm_mday, tt.tm_hour, tt.tm_min, tt.tm_sec)
def reset_data(player_name, profession):
# rese... | |
(
self._validate_external_net_create(
net_data, az._default_tier0_router,
self._tier0_validator))
nsx_net_id = None
is_backend_network = False
else:
is_provider_net, net_type, physical_net, vlan_id, nsx_net_id = (
self._create_network_at_the_backend(context, net_data, az,
vlt))
is_backend_network = True
try... | |
mesh = TensorMesh([h, h], x0="CC")
Then we create a discrete vector on mesh edges
>>> edges_x = mesh.edges_x
>>> edges_y = mesh.edges_y
>>> u_ex = -(edges_x[:, 1] / np.sqrt(np.sum(edges_x ** 2, axis=1))) * np.exp(
... -(edges_x[:, 0] ** 2 + edges_x[:, 1] ** 2) / 6 ** 2
... )
>>> u_ey = (edges_y[:, 0] / np.sqrt... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas
from pandas.compat import string_types
from pandas.core.dtypes.cast import find_common_type
from pandas.core.dtypes.common import (
is_list_like,
is_numeric_dtype,
is_dateti... | |
<gh_stars>1-10
# Copyright (C) 2021 University of Glasgow
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | |
the 2.5th, 50th and 97.5th percentiles of parameter distributions are extracted
# params_cred then contains the tuple (median (50th), lower bound (2.5th), upper bound (97.5th))
# to provide a 95%-credible interval
params_cred = tuple(map(lambda v: (v[1], v[0], v[2]),
zip(*np.percentile(samples, [2.5, 50, 97.5], axi... | |
(tuple(succStatements), state[1])
results.append((whitespace + "Or Introduction: " + disjunction, succState, cost))
# We deliberately hamper this rule because it is not very interesting.
if len(sentence) == 1:
for symbol in self.symbols:
disjunction = sentence + " || " + symbol
if disjunction not in sentences:
a... | |
ing2, contours, hierarchy = cv2.findContours(edgedForProp, method,
cv2.CHAIN_APPROX_SIMPLE)
innerCnts = []
for cnt, h in zip (contours, hierarchy[0]):
if h[2] == -1 :
innerCnts.append(cnt)
sortedContours = sorted(innerCnts, key = cv2.contourArea, reverse = True)
selectedContours = [cnt for cnt in sortedCon... | |
import asyncio
import os
import random
from contextlib import suppress
from time import sleep
from unittest import mock
import pytest
from tlz import first, partition_all
from dask import delayed
from distributed import Client, Nanny, wait
from distributed.comm import CommClosedError
from distributed.compatibility i... | |
get_text_for_premisegroup_uid(uid):
"""
Returns joined text of the premise group and the premise ids
:param uid: premisegroup_uid
:return: text, uids
"""
warnings.warn("Use PremiseGroup.get_text() instead.", DeprecationWarning)
db_premises = DBDiscussionSession.query(Premise).filter_by(premisegroup_uid=uid).jo... | |
<filename>src/ramprate/build_features.py
# -*- coding: utf-8 -*-
from typing import Dict, Optional, Union, Tuple
import pandas as pd
import numpy as np
import networkx as nx
idx = pd.IndexSlice
CAMD_FUEL_MAP = {
"Pipeline Natural Gas": "gas",
"Coal": "coal",
"Diesel Oil": "oil",
"Natural Gas": "gas",
"Process ... | |
<gh_stars>10-100
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : final_subpipe.py
@Time : 2019/11/28 20:05:43
@Author : <NAME>
@Contact : <EMAIL>
@Desc : None
'''
# .::::.
# .::::::::.
# :::::::::::
# ..:::::::::::'
# '::::::::::::'
# .::::::::::
# '::::::::::::::..
# ..::::::::::::.
# ``::::::::::::::::
#... | |
<gh_stars>1-10
from enum import Enum, unique
from nmigen import *
from nmigen.cli import main
from nmigen.asserts import *
from .muxing import *
from .arch import Registers
from .mcycler import *
from .transparent_latch import TransparentLatch
from ..z80fi.z80fi import Z80fiInterface
class Sequencer(Elab... | |
identifier (see below and Section 9.7.7).
value (required, string): The identifier itself.
expires (optional, string): The timestamp after which the server will consider this authorization invalid, encoded in the format specified in [RFC3339]. This field is REQUIRED for objects with "valid" in the "status" field.
st... | |
<reponame>isandlaTech/cohorte-devtools
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Python modules repository
:author: <NAME>
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance... | |
# -*- coding: utf-8 -*-
#
# ramstk.db.base.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright 2019 <NAME> doyle.rowland <AT> reliaqual <DOT> com
"""RAMSTK Base Database Module."""
# Standard Library Imports
import sqlite3
from typing import Any, Dict, List, TextIO, Tuple
# Third Party Imports
impor... | |
<filename>azure-iot-device/tests/iothub/pipeline/test_pipeline_stages_iothub.py
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----... | |
sizenotcolor=False, z2=None, colorbar=False, reversecolorbar=False)
for key in defaults:
if (not kw.has_key(key)):
kw[key] = defaults[key]
map = kw.pop('map')
zmin = kw.pop('zmin')
zmax = kw.pop('zmax')
z2min = kw.pop('z2min')
z2max = kw.pop('z2max')
sizenotcolor = kw.pop('sizenotcolor')
z2 = kw.pop('z2')
... | |
<filename>src/app/voltdb/voltdb_src/lib/python/voltcli/utility.py
# This file is part of VoltDB.
# Copyright (C) 2008-2021 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, ei... | |
from typing import Any
from jsonschema.exceptions import ValidationError
import urllib.request
import json
import pytest
from mojap_metadata import Metadata
from mojap_metadata.metadata.metadata import (
_parse_and_split,
_get_first_level,
_unpack_complex_data_type,
_table_schema,
_get_type_category_pattern_dic... | |
= '''MATCH (n:{}:word)
WITH n.label as label, count(n.label) as c
ORDER BY c DESC, label
with label
LIMIT {}
return label'''.format(c.cypher_safe_name, count)
results = c.execute_cypher(statement)
results = [x['label'] for x in results]
return Response(results)
@action(detail=True,methods=['get'])
def defaul... | |
<filename>prometheus/fx3/prometheus_fx3.py
#! /usr/bin/python
# -*- coding: UTF-8 -*-
#Distributed under the MIT licesnse.
#Copyright (c) 2013 <NAME> (<EMAIL>)
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal ... | |
gl['JournalLib'] = gl["JournalLib"].str.replace("NET PAY", "SALAIRE NET")
gl['JournalLib'] = gl["JournalLib"].str.replace("CASH ", "ARGENT ")
gl['JournalLib'] = gl["JournalLib"].str.replace("Repayment ", "Repaiement ")
gl['JournalLib'] = gl["JournalLib"].str.replace("Acct. ", "Comptab. ")
gl['JournalLib'] = g... | |
# Copyright 2015 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
#
# Unless required by applicable ... | |
<reponame>HiKapok/DAN
# Copyright 2018 <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... | |
T)
I_C = bsr_matrix( array([[ 0.]]), blocksize=(1,1))
I_F = bsr_matrix( array([[ 1.]]), blocksize=(1,1))
P_I = bsr_matrix( array([[ 0.]]), blocksize=(1,1) )
assert_equal(array([ ]), params['Cpts'])
assert_equal(array([0]), params['Fpts'])
assert_equal(I_C.indptr, params['I_C'].indptr)
assert_equal(I_C.indices, p... | |
open('stru_mutation.txt', 'w') as s:
with open(file_pdb, 'rU') as raw:
for i in raw:
i = i.split()
with open('mutation_id.txt') as mu:
for m in mu:
m = m.split()
if i[0] == m[0]:
try:
if m[3] == 'Error:':
with open('stru_mutation.txt', 'a') as s:
s.write("input file contains error position for" +m[2]+ "prot... | |
from functools import cached_property
from warnings import warn
import esda
import geopandas as gpd
import scikitplot as skplt
from sklearn.metrics import silhouette_samples
from ..visualize.mapping import plot_timeseries
from .dynamics import predict_markov_labels as _predict_markov_labels
from .incs import lincs_fr... | |
len(conf_scores)-1):
c_mask = conf_scores[cl] > score_thresh
if c_mask.sum() == 0: continue
scores = conf_scores[cl][c_mask]
l_mask = c_mask.unsqueeze(1).expand_as(box_coords)
boxes = box_coords[l_mask].view(-1, 4)
ids, count = nms(boxes.data, scores, nms_overlap, 50)
ids = ids[:count]
out1.append(scores[ids])
... | |
<reponame>Mynti207/TimeDB
from timeseries import TimeSeries
import numpy as np
from scipy.stats import norm
from tsdb import *
import time
identity = lambda x: x
schema = {
'pk': {'convert': identity, 'index': None},
'ts': {'convert': identity, 'index': None},
'order': {'convert': int, 'index': 1},
'blarg': {'conv... | |
: [u'g'] ,
u'㗛' : [u'x'] ,
u'譤' : [u'j'] ,
u'惩' : [u'c'] ,
u'巫' : [u'w'] ,
u'汶' : [u'm', u'w'] ,
u'裹' : [u'g'] ,
u'䗻' : [u'j'] ,
u'㰁' : [u'l'] ,
u'钆' : [u'q', u'g'] ,
u'冈' : [u'g'] ,
u'欏' : [u'l'] ,
u'禘' : [u'd'] ,
u'㪚' : [u's'] ,
u'錟' : [u'y', u'x', u't'] ,
u'䰡' : [u'c'] ,
u'憨' : [u'h'] ,
u'琱' : [u'd'] ,
u'覸' : [u'x',... | |
= nnn / nu_c
# define a mask for integration
m = (log(x) > self.__start) & (log(x) < self.__end)
# and for the maximum extension
m &= rrr <= self._r0
result = np.full(x.shape, 1e-80)
# synchrotron function
result[m] = exp(self.log_xF(log(x[m])))
# electron spectrum
# dN / dV d gamma
result[m] *= self._n_e... | |
<reponame>rnk/llvm-premerge-checks<filename>scripts/patch_diff.py<gh_stars>0
#!/usr/bin/env python3
# Copyright 2019 Google LLC
#
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... | |
= self.context.ldap_session.search
res = search(baseDN=dn)[0]
return ensure_text(res[1][self._key_attr][0])
except ldap.NO_SUCH_OBJECT:
raise KeyError(dn)
@override
@property
def ids(self):
return list(self.__iter__())
@default
@locktree
def __delitem__(self, key):
principal = self[key]
context = princip... | |
<reponame>alisaifee/coredis
from __future__ import annotations
import asyncio
import functools
import inspect
import textwrap
from abc import ABCMeta
from ssl import SSLContext
from typing import TYPE_CHECKING, Any, cast, overload
from deprecated.sphinx import versionadded
from packaging.version import Version
from ... | |
<filename>data/corpus/raw_to_formated_script/raw_to_formated.py
# <NAME>
# <EMAIL>
# Developed for my internship at the LIS lab during my 4th year in the Computer Science Engineer program at Polytech Marseille
# Feel free to use this code as you wish as long as you quote me as author
# There is a notebook version of t... | |
from datetime import datetime
from decimal import Decimal
from django.conf import settings
import pytz
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.db import models
from guardian.shortcuts import get_objects_for_user
from associations.models impor... | |
self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Date':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Date')
value_ = self.gds_validate_string(value_, node, 'Date'... | |
failure_function[matched_len]
matched_len = matched_len + 1
if matched_len == len(pat):
matches_done += 1
matched_len = 0
if matches_done == max_repl:
break
cumulative_offset += match_len_change * matches_done
output_offsets[length] = cumulative_offset
output_buffer = np.empty(cumulative_offset, dtype=np.u... | |
<gh_stars>0
apitypes = {
'DWORD': 'unsigned int',
'HANDLE': 'unsigned int',
}
api = {
# libc
'plt___libc_start_main':( 'int', None, 'cdecl', '*.__libc_start_main', (('int', 'main'), ('int', 'argc'), ('int', 'argv')) ),
'plt_main_entry':( 'int', None, 'stdcall', '*.main_entry', (('int', None), ('int', None), ('int... | |
<filename>test/test_writers_readers.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
import tempfile
import shutil
import zlib
import unittest
import copy
########### Debug print... | |
/home/ubuntu/setup/benchmarking.csv && touch /home/ubuntu/setup/benchmarking.log")
# wait_and_log(stdout, stderr)
"""
time.sleep(experiment_config['duration']/2)
logger.info("Shutting down the raft leader")
# Fabric_Network.shutdown_raft_nonleader(blockchain_config, blockchain_ssh_clients, blockchain_scp_clients,... | |
<gh_stars>10-100
import matplotlib.pyplot as plt
from collections import defaultdict
import seaborn as sns
# import pandas as pd
from sklearn.decomposition import TruncatedSVD
import sklearn.manifold
import numpy as np
import math
import wordcloud
from .nlp import create_tfidf
from .clean import clean_attributes, get_... | |
= """
</cfdi:Conceptos>
<cfdi:Impuestos TotalImpuestosTrasladados="{TotalImpuestosTrasladados}">
<cfdi:Traslados>""".format(**locals())
cfdi += cfdi_conceptos
cfdi += cfdi_traslados
cfdi_complemento = ""
cfdi_emisor = ""
cfdi_receptor = ""
cfdi_header = """
</cfdi:Traslados>
</cfdi:Impuestos>
</c... | |
all plots
self.list_ids.append(image_data.id)
self.list_all.append(image_data)
# Update model
self.modelImages._model_data.append(image_data.model_style)
self.modelImages.layoutChanged.emit()
def __updateImagesDataStyle(self):
"""
Something style-related changed in the model; thus, need to change \
these el... | |
# 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... | |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/16_agent.ipynb (unless otherwise specified).
__all__ = ['Agent', 'PredictiveAgent', 'BaselineAgent', 'CriticAgent', 'GenerativeAgent', 'SupervisedCB', 'Rollback',
'RetrainRollback', 'ResetAndRetrain', 'MetricResetAndRetrain', 'SaveAgentWeights']
# Cell
from ..imports ... | |
density, g_local, g_local_FWHM)
data_error += ' %3d %6.3s %6.3f %6.3f %6.3f %6.3f %6.3f %6.3s %6.3s %6.3s %6.3s %6.3s %6.3f %6.3f\n'\
%(index+1, "NA", Eww_self_error, Eww_error, Esw_error, dTStrans_error, dTSorient_error, "NA", "NA", "NA", "NA", "NA", g_local_half_maximum*volume, g_local_FWHM)
if return_it:
retur... | |
- 1. # to network input -1..1 format
# Get visibility map from depth if needed
if self.use_custom_visibility:
visibility_map_input = ClassicMapping.is_visible_from_depth(depth, self.local_map_shape, sim=self.params.sim, zoom_factor=self.brain_requirements.transform_window_scaler,
fix_habitat_depth=self.params.fix_... | |
'''
BSD 3-Clause License
Copyright (c) 2021, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions an... | |
import sys
import os
import unittest
import shutil
from io import StringIO
sys.path.append(".")
from mock_gff3 import Create_generator
import annogesiclib.merge_manual as mm
class TestGensRNAOutput(unittest.TestCase):
def setUp(self):
self.example = Example()
self.test_folder = "test_folder"
if (not os.path.exis... | |
mut=m.mut,
masked=m.masked,
)
mdel_num += 1
upd_mut_list.append(new_m)
ex_stat_[m.exon] = "M"
continue
elif frame_pres and fp_ex_len_cond:
# exon del is frame-preserving and short
masked_m = mask_mut(m) # mask this mutation then
upd_mut_list.append(masked_m)
ex_stat_[m.exon] = "mD" # mD -> minor deletion
el... | |
index):
"""Loads 1 image from dataset, returns img, original hw, resized hw
:param self: self
:param index: index
:return: img, original hw, resized hw
"""
img = self.imgs[index]
if img is None: # not cached images
path = self.img_files[index]
img = cv2.imread(path) # BGR
if img is None:
raise AssertionErr... | |
from __future__ import unicode_literals
from builtins import bytes, dict, list, int, float, str
import json
import re
import traceback
version = '0.7.6'
json_types = ['int', 'bool', 'float', 'string', 'array', 'hash', 'base64']
def json2py(json_type):
mapping = {'bool': 'bool', 'int': 'int', 'float': 'float', 'str... | |
"""
Модуль леса
"""
import math
from pygame.draw import *
from random import *
from apple import Apple
from house import House
from tree import Tree
from village import Village
from stick import Stick
class Forest(object):
"""
Описывает лес
"""
def __init__(self, game):
"""
Параметры
game - объект игры
"... | |
# Global Sinks:
delCStores_SINKS[scenario][Q10][O3[1]]={}
for exp in FactExps:
#print(exp)
delCStores_SINKS[scenario][Q10][O3[1]][exp] = pd.DataFrame(
{ sink: pd.Series({gcm:COMPS[exp][scenario][Q10][O3[1]][sink][gcm].sum()
for gcm in GCMs } ) for sink in StoreSinks } )
# Append to full uncertatinty lists... | |
<gh_stars>1-10
"""
BSD 3-Clause License
Copyright (c) 2019, <NAME>, Aalto University, Finland
All rights reserved.
Edited: 2019, <NAME>, Aalto University, Finland - for CES cooperative firewalling solution.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are perm... | |
0x19, 0x01, 0x81,
0x42, 0x42, 0x00, 0x82, 0x8c, 0x09, 0x11, 0x20,
0x12, 0x04, 0x20, 0x42, 0x49, 0x82, 0x04, 0xa0,
0x42, 0x40, 0x22, 0x01, 0x40, 0x04, 0x2d, 0x24,
0x80, 0x01, 0x11, 0x82, 0x42, 0x12, 0x20, 0x2c,
0x44, 0x32, 0x82, 0x8c, 0x08, 0x30, 0x44, 0x10,
0x04, 0xdf, 0x16, 0x0e, 0x6f, 0x62, 0xd2, 0x22,
0xa2, 0... | |
# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This file is automatically generated by mkgrokdump and should not
# be modified manually.
# List of known V8 instance types.
# yapf: disable
INSTANCE_T... | |
conv.events.store(EV_PROTOCOL_RESPONSE, ACCESS_TOKEN_RESPONSE_1)
chk = CheckIdTokenNonce()
kwargs = {}
chk._kwargs = kwargs
res = chk._func(conv)
assert chk._status == ERROR
def test_check_query_part():
"""
arg={'foo': 'bar'}
"""
_info = setup_conv()
conv = _info['conv']
# Need AuthorizationRequest
_areq... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import itertools
import os, shutil
"""Used for process original data."""
class Seq:
def __init__(self, name, seq, no):
self.name = name
self.seq = seq.upper()
self.no = no
self.length = len(seq)
def __str__(self):
"""Output seq when 'print' method is... | |
"b_bot")
ps = geometry_msgs.msg.PoseStamped()
ps.header.frame_id = set_name + "tray_2_screw_m" + str(screw_size) + "_" + str(screw_number)
if set_name == "set_1_":
self.go_to_named_pose("feeder_pick_ready", "c_bot")
ps.pose.orientation = geometry_msgs.msg.Quaternion(*tf_conversions.transformations.quaternion_from... | |
out just about everything from the style
st = re.sub('fill-opacity:[0-9\.]+','',st)
st = re.sub('stroke-opacity:[\d.]+;','',st)
st = re.sub('stroke-width:[^;]+;','',st)
st = re.sub('stroke:[^;]+;','',st)
st = re.sub('fill:[^;]+;','',st)
st = re.sub('stroke-dasharray:[^;]+;','',st)
st = re.sub('stro... | |
If no source points or polygons can be associated to a target polygon (e.g.
no intersection), the created destination layer will be empty.
Data Model is built upon OGR Implementation of ESRI Shapefile
* one src DataSource (named 'src') holding source polygons or points
* one trg DataSource (named 'trg') holding t... | |
<filename>QDTModel.py<gh_stars>1-10
from __future__ import division
from scipy import stats, std
import numpy
import warnings
from DecisionMaking.Configuration import ConfigurationError
from DecisionMaking.Constants import *
from DecisionMaking.QModel import QState
from pprint import pprint
"""
Class to represent a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.