input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
""" Image editing class for virtual event only
"""
import os
import datetime
import logging
import rospy
import cv2
from markov.log_handler.logger import Logger
from markov.utils import get_racecar_idx
from mp4_saving import utils
from mp4_saving.constants import (RaceCarColorToRGB,
IconographicImageSize,
SCALE_RAT... | |
itx['recipient'] and opentx.amount == itx['amount'] and opentx.signature == itx['signature']:
try:
self.__open_transactions.remove(opentx)
except ValueError:
print('Item was already removed')
self.save_data()
return True
def resolve(self):
"""Checks all peer nodes' blockchains and replaces the local one with l... | |
###############################################################################
#
# file: filereader.py
#
# Purpose: refer to module documentation for details
#
# Note: This file is part of Termsaver application, and should not be used
# or executed separately.
#
########################################################... | |
<reponame>vfreex/doozer<gh_stars>0
import asyncio
import copy
import errno
import glob
import hashlib
import io
import logging
import os
import pathlib
import re
import shutil
import time
import sys
import traceback
from datetime import date
from multiprocessing import Event, Lock
from typing import Tuple, Union, Optio... | |
current_timestamp)
order by JobId desc,
DbUpdatedTimestamp desc,
LastChgTimestamp desc
loop
if v_job.JobId <> v_prev_job_id then
v_prev_job_id := v_job.JobId;
if v_job.State <> 'S' then
v_rec.JobId := v_job.JobId;
v_rec.JobName := v_job.JobName;
v_rec.State := v_job.State;
v_rec.Bsn := v_job.Bsn;
v_rec.User... | |
# example for accessing smeared hits and fitted tracks
import ROOT,os,sys,getopt
import rootUtils as ut
import shipunit as u
from ShipGeoConfig import ConfigRegistry
from rootpyPickler import Unpickler
import shipRoot_conf
shipRoot_conf.configure()
debug = False
chi2CutOff = 4.
PDG = ROOT.TDatabasePDG.Instance()
input... | |
import numpy as np
import ase2 as ase
import ase2.io as aio
from concurrent.futures import ProcessPoolExecutor
import time
import ase2.calculators.dftb as adftb
import qml as qml
import qml.representations as qmlrep
import scipy.spatial as sps
# Python library used for the simulation
class Trajectory:... | |
not None:
self.prefix.prefixlen = value
prefix_length = property(fset=_set_prefix_length)
def get_status_class(self):
return PrefixStatusChoices.CSS_CLASSES.get(self.status)
def get_duplicates(self):
return Prefix.objects.filter(vrf=self.vrf, prefix=str(self.prefix)).exclude(pk=self.pk)
def get_child_prefixes... | |
assert ref_sop_item.ReferencedSOPClassUID == sop_class_uid
assert ref_sop_item.ReferencedSOPInstanceUID == sop_instance_uid
assert ref_sop_item.ReferencedSegmentNumber == segment_number
with pytest.raises(AttributeError):
ref_sop_item.ReferencedFrameNumber
def test_scoord_item_construction_point(self):
name = co... | |
return bool(self._entity_data.get('OnlyRunForward'))
return bool(0)
@property
def OnlyRunBackward(self):
if "OnlyRunBackward" in self._entity_data:
return bool(self._entity_data.get('OnlyRunBackward'))
return bool(0)
@property
def LimitForward(self):
if "LimitForward" in self._entity_data:
return float(self... | |
the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
:param Sequence['DatadogAgentSpecClusterChecksRunnerAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNo... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 <NAME> <<EMAIL>>
# Copyright (C) 2011,2012 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: <NAME> <<EMAIL>>
from pkg_resources import resourc... | |
voxels])
return averaged_voxels
def get_b(latlon_dict,file_path_slope,idx_slope,file_path_drainage,idx_drainage,shapefile):
'''Create a permanent lookup file for b for study area for future processing to be used in overwinter DC procedure
Parameters
----------
latlon_dict : dictionary
dictionary of latitude a... | |
continue
if os.path.isdir(os.path.join(item_path, adm_name)):
xml_entries_relocate(item_path, from_url, to_url)
# Poor mans relocate to fix up an working copy to refer to a
# valid repository, so svn upgrade can do its work on it
def simple_entries_replace(path, from_url, to_url):
adm_name = svntest.main.get_admin... | |
Models:
model, versions, parmlist = self.parseMS(modelString)
if model is None:
continue
if not self.acceptPL(WEname, parmlist):
continue
#
# Make labels for each of the model runs we want.
# Singleton databases (like FCST or Official) that have
# no date (actually a 1970 date) have no date/run label.
#
for... | |
rets, covmatrix, periods_per_year):
'''
Returns a set of n_points optimal weights corresponding to portfolios (of the efficient frontier)
with minimum volatility constructed by fixing n_points target returns.
The weights are obtained by solving the minimization problem for the volatility.
'''
target_rets... | |
<filename>scripts/constituents.py
#!/usr/bin/env python
"""
Class and supporting code to hold all information on CCPP constituent
variables. A constituent variable is defined and maintained by the CCPP
Framework instead of the host model.
The ConstituentVarDict class contains methods to generate the necessary code
to ... | |
import sys
import traceback
import logging
import pickle
sys.path.append("..") # Adds higher directory to python modules path.
from utils import config_reference as cfg
from data import load_dataset
from models import model_loader
from models import knowledge_distillation_models
from utils import teacher_utils, helper_... | |
def GetMultiDimensionCommand(self, getter, commandType):
"""
Check multiple rows/columns for forced solution. If there are any return a command
:param getter: Function to get a specific row/column/area
:type getter: function
:param commandType: Set the command type (e.g. R, C, A)
:type commandType: str
... | |
= _get_arr_and_force_fv(xin)
pin2,fill_value_pin = _get_arr_and_force_fv(pin)
pout2,fill_value_pin = _get_arr_and_fv(pout)
# Figure out what the output fill value should be
if fill_value_xin is None:
if fill_value_pin is None:
fill_value = 1.e20
else:
fill_value = fill_value_pin
else:
fill_value = fill_value_... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from utils import *
class Mlp(nn.Module):
""" Multilayer perceptron."""
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
super().... | |
specification along with,
# strictly speaking, '16. e4 Qd8(16... dxe4)17. fxe4' since '(' and ')'
# are self-terminating and nothing is said about separation from
# adjacent tokens.
if not length:
movetext.append(token)
return len(token)
if len(token) + length >= PGN_MAXIMUM_LINE_LENGTH:
movetext.append(PGN_LIN... | |
#!/usr/bin/env python
"""
ml_color_transfer.py
Functions for transferring colors of one image onto another.
"""
import os
import sys
if '--omp_num_threads' in sys.argv:
os.environ["OMP_NUM_THREADS"] = sys.argv[sys.argv.index('--omp_num_threads')+1]
import numpy as np
import matplotlib
import numpy.linalg
import... | |
from collections import defaultdict
from copy import deepcopy
from enum import Enum
from pybbn.graph.edge import JtEdge
from pybbn.graph.graph import Ug
from pybbn.graph.node import SepSet, Clique, BbnNode
from pybbn.graph.potential import Potential, PotentialEntry, PotentialUtil
from pybbn.graph.variable import Varia... | |
4), dpi=300)
ax1.imshow(bone_img < thresh_vals[1], cmap="bone_r")
ax1.set_title("Threshold $<$ %d" % (thresh_vals[1]))
ax2.imshow(bone_img < thresh_vals[2], cmap="bone_r")
ax2.set_title("Threshold $<$ %d" % (thresh_vals[2]))
# # Baby Bear
# We can thus follow a process for ending up with a happy medium of the two
#
#... | |
Shadow":0xd7e4ed,
"Snow Storm":0xeeedea,
"Snow Tiger":0xdadce0,
"Snow White":0xeeffee,
"Snow White Blush":0xf8afa9,
"Snowball Effect":0xd9e9e5,
"Snowbank":0xe8e9e9,
"Snowbelt":0xeef1ec,
"Snowberry":0xefeced,
"Snowboard":0x74a9b9,
"Snowbound":0xddebe3,
"Snowdrop":0xeeffcc,
"Snowdrop Explosion":0xe0efe1,
"Snowfall":0xe0d... | |
from typing import List, Type, Any, Dict, Tuple, Optional
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.comment import Comment
from facebook_business.api import FacebookAdsApi, FacebookSession
from facebook_business.adobjects import abstractcrudobject
from facebook_busine... | |
from ansys.mapdl.core._commands import parse
def bsplin(self, p1="", p2="", p3="", p4="", p5="", p6="", xv1="", yv1="",
zv1="", xv6="", yv6="", zv6="", **kwargs) -> int:
"""Generate a single line from a spline fit to a series of keypoints.
APDL Command: BSPLIN
Parameters
----------
p1, p2, p3, p4, p5, p6
Key... | |
is not None:
payload = wallet.get_formatted_request_payload()
payload["network"] = network.value
payload["amount"] = amount
payload["recipient_address"] = recipient_address
payload["return_compiled_transaction"] = return_compiled_transaction
if sender_public_key is not None:
payload["sender_public_key"] = send... | |
<filename>peakhood/hoodlib.py<gh_stars>1-10
#!/usr/bin/env python3
from distutils.spawn import find_executable
import matplotlib.pyplot as plt
# import plotly.express as px
import seaborn as sns
import pandas as pd
import numpy as np
import subprocess
import statistics
import random
import math
import gzip
import uuid... | |
<reponame>erosson/pypoe-json
"""
Overview
===============================================================================
+----------+------------------------------------------------------------------+
| Path | PyPoE/poe/file/specification/data/stable.py |
+----------+--------------------------------------------------... | |
import glob
from pathlib import Path
import asyncio
import csv
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
import traceback
from django.contrib.staticfiles import finders
from praw import Reddit
from praw.const import API_PATH
from django.urls import reverse
from d... | |
'<NAME>', 'zh': u('\u6cb3\u5357\u7701\u5357\u9633\u5e02')},
'861820374':{'en': '<NAME>', 'zh': u('\u6cb3\u5357\u7701\u8bb8\u660c\u5e02')},
'861820375':{'en': '<NAME>', 'zh': u('\u6cb3\u5357\u7701\u5e73\u9876\u5c71\u5e02')},
'86181657':{'en': '<NAME>', 'zh': u('\u5e7f\u4e1c\u7701\u6df1\u5733\u5e02')},
'86181655':{'e... | |
membrane is not None:
membrane.build(input_shape)
# last layers output shape to models output shape
self.output_shape = input_shape
def add_layer(self, layer: Layer, activation: Membrane = None):
self.__layers.append(layer)
self.__membrane.append(activation)
def forward_propagation(self, X):
caches = []
A ... | |
Thumbprint of the server key.
:vartype thumbprint: str
:param auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false.
:type auto_rotation_enabled: bool
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'kind': {'readonly': True},
'uri': ... | |
from starling_sim.basemodel.trace.events import *
from starling_sim.basemodel.agent.requests import UserStop, StopPoint, StationRequest
from starling_sim.utils.constants import PUBLIC_TRANSPORT_TYPE
class KPI:
"""
Generic structure of a KPI class
Its sub-classes compute and update specific indicator
from given e... | |
if jsont.get('options') is not None:
node['data']['opts'] = jsont['options']
if jsont.get('status') is not None:
node['data']['status'] = jsont['status']
if jsont.get('path') is not None:
path_list = jsont['path'].split('/')[1:]
path = ''
for path_part in path_list:
path = '{}/{}'.format(path, path_part.split('... | |
<filename>vericred_client/configuration.py
# coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create ... | |
<reponame>xclxxl414/rqalpha<filename>rqalpha/mod/rqalpha_mod_sys_accounts/position_model/future_position.py
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | |
else:
self._config._debug_trace("cachemiss", len(view), a_end-a_beg, 1)
data = bytearray(a_end - a_beg)
self._accessor.read(seg, a_beg, data)
self._cached_data = (seg, a_beg, data)
view[:] = data[offset-a_beg:offset-a_beg+len(view)]
def xx_read(self, in_offset, in_size, *, usagehint=UsageHint.Unknown):
self._va... | |
None:
"""
- Use both caches
- Execute and cache
- Reset the mem cache
- Execute again
- Check that the cached value is found in the disk cache
"""
# Use both memory and disk cache
f, cf = self._get_f_cf_functions(use_mem_cache=True, use_disk_cache=True)
# 1) Verify that it is executed.
_LOG.debug("\n%s", hpr... | |
import numpy as np
import time
from .constants import log
from . import util
from . import convex
from . import nsphere
from . import grouping
from . import triangles
from . import transformations
try:
from scipy import spatial
from scipy import optimize
except ImportError:
log.warning('Scipy import failed!')
d... | |
<filename>nimare/meta/cbma/ale.py
"""CBMA methods from the activation likelihood estimation (ALE) family."""
import logging
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from tqdm.auto import tqdm
from nimare import references
from nimare.due import due
from nimare.meta.cbma.base import ... | |
hikari.SnowflakeishOr[hikari.Command]]] = None,
) -> Client:
"""Build a `Client` from a `hikari.traits.RESTBotAware` instance.
Notes
-----
* This sets type dependency injectors for the hikari traits present in
`bot` (including `hikari.traits.RESTBotAware`).
* The endpoint used by `declare_global_commands` has a... | |
""" inventory is an obspy Inventory object """
import six
import logging
from collections import OrderedDict
import datetime
from obspy import UTCDateTime
from sqlalchemy import text
from .schema import Abbreviation, Format, Unit, Channel, Station, SimpleResponse, AmpParms, CodaParms, Sensitivity
from .schema impor... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------... | |
<reponame>Syler1984/seismo-ml-phase-picker
from obspy.core.utcdatetime import UTCDateTime
import re
import os
from .converter import date_str
from obspy import read
def process_stations_file(path):
return None
def group_archives(archives):
"""
Takes archive definitions list and groups them together by stations a... | |
64),
(8, "hybrid", 64),
(9, "hybrid", 64),
(0, "forward", 64),
(1, "forward", 64),
(2, "forward", 64),
(3, "forward", 64),
(4, "forward", 64),
(5, "forward", 64),
(6, "forward", 64),
(7, "forward", 64),
(8, "forward", 64),
(9, "forward", 64),
(0, "ibp", 64),
(1, "ibp", 64),
(2, "ibp", 64),
(3, "ibp", 64... | |
0.023, 0.022, 0.022, 0.023, 0.025, 0.027,
0.028, 0.024, 0.019, 0.017, 0.015, 0.017, 0.019, 0.021, 0.024,
0.027, 0.031, 0.037, 0.046, 0.058, 0.074, 0.088, 0.101, 0.114,
0.128, 0.142, 0.155, 0.321, 0.525, 0.742 ]
# test equality
np.testing.assert_allclose(newpolar.cl, cl_3d, atol=1e-3)
np.testing.assert_all... | |
<filename>LDA/starter.py
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.spatial
# Gradient descent optimization
# The learning rate is specified by eta
class GDOptimizer(object):
def __init__(self, eta):
self.eta = eta
def initialize(self, layers):
pass
# This function perfor... | |
# -*- coding: utf-8 -*-
import codecs
from itertools import takewhile
from parglare import Parser
from parglare import termui as t
from .parser import SHIFT, REDUCE, ACCEPT, pos_to_line_col, Token
from .common import replace_newlines as _, position_context
from .export import dot_escape
from .termui import prints, h_pr... | |
import os
import vtk
import ctk
import qt
import slicer
from EditOptions import HelpButton
import LabelEffect
__all__ = [
'WandEffectOptions',
'WandEffectTool',
'WandEffectLogic',
'WandEffect'
]
#
# This defines the hooks to be come an editor effect.
#
#
# WandEffectOptions - see LabelEffect, EditOptions and Ef... | |
or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
# in a service.SetInstanceAcceleratorRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, service.SetInstanceAcceleratorRequest):
r... | |
"""Annotation spreadsheet import, parsing, and validation."""
from __future__ import absolute_import, division, print_function, unicode_literals
import csv
import logging
import os
from collections import OrderedDict
from copy import copy
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font,... | |
"""
Tests for the BNMF Gibbs sampler.
"""
import sys, os
project_location = os.path.dirname(__file__)+"/../../../"
sys.path.append(project_location)
import numpy, math, pytest, itertools
from BNMTF.code.models.bnmf_gibbs_optimised import bnmf_gibbs_optimised
""" Test constructor """
def test_init():
# Test getting... | |
<reponame>dgh2466/public_tools
#!/usr/bin/env python
"""
olevba.py
olevba is a script to parse OLE and OpenXML files such as MS Office documents
(e.g. Word, Excel), to extract VBA Macro code in clear text, deobfuscate
and analyze malicious macros.
Supported formats:
- Word 97-2003 (.doc, .dot), Word 2007+ (.docm, .do... | |
# -*- coding: utf-8 -*-
"""
"""
from instr import container
import numpy as np
from scipy.interpolate import interp1d
from scipy.signal import chirp
import matplotlib.pyplot as plt
from math import ceil, fsum
#import pandas as pd
#import qgrid
from copy import deepcopy
from struct import pack
import re
... | |
given by fastest framerate possible (by exposure time and readout).
"XI_ACQ_TIMING_MODE_FRAME_RATE": c_uint(1), #Selects a mode when sensor frame acquisition frequency is set to XI_PRM_FRAMERATE
"XI_ACQ_TIMING_MODE_FRAME_RATE_LIMIT": c_uint(2), #Selects a mode when sensor frame acquisition frequency is limited by X... | |
val
def get_coolant_loops(self) -> List[CoolantView]:
if self.coolant_connection == ComponentCoolantCnxn.DISCONNECTED:
return []
elif self.coolant_connection == ComponentCoolantCnxn.HAB_ONE:
return [self._parent.coolant_loops[0]]
elif self.coolant_connection == ComponentCoolantCnxn.HAB_TWO:
return [self._parent... | |
MPQ (Ctrl+Alt+O)', [NORMAL,DISABLED][FOLDER]),
('save', self.save, 'Save (Ctrl+S)', DISABLED),
('saveas', self.saveas, 'Save As (Ctrl+Alt+A)', DISABLED),
('savempq', self.savempq, 'Save MPQ (Ctrl+Alt+M)', DISABLED),
('close', self.close, 'Close (Ctrl+W)', DISABLED),
10,
('undo', self.undo,... | |
<gh_stars>1-10
"""IMAP Query builder"""
import datetime
import itertools
import functools
from collections import UserString
from typing import Iterable, Optional, Dict, Any, List, Union
from .consts import SHORT_MONTH_NAMES
from .utils import clean_uids, quote
class Header:
__slots__ = ('name', 'value')
def __in... | |
<filename>tensor2tensor/models/video/next_frame_glow.py
# coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | |
<gh_stars>100-1000
# 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, over... | |
as applied by the Moses toolkit.
"""
def __init__(self,alignment_file):
self.alignment_file = alignment_file
self.word_pairs = defaultdict(lambda: defaultdict(int))
self.word_source = defaultdict(int)
self.word_target = defaultdict(int)
def load_word_pairs(self,src_lang,target_lang):
"""main function.... | |
#!/usr/bin/env python
# pythond version: 2.7.10
import os
import sys,urllib,string,re
import urllib2
import webbrowser
from time import localtime, strftime
import json
global DEBUG
DEBUG = 0
FILENAME_SCRIPT_START_DAYTIME = '.script_starttime.conf'
# KEY name list
SUBJECT_KEY = 'subject'
_NUMBER_KEY = '_number'
OW... | |
"""
=========
numpy_ext
=========
An extension library for NumPy_ that implements common array operations not present in NumPy.
.. _numpy: https://numpy.org/
Installation
------------
**Regular installation**::
pip install numpy_ext
**Installation for development**::
git clone https://github.com/3jane/numpy_e... | |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="list_level.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwa... | |
ranging from 0 to 100 representing the
percentage of values as respect to maximum. The value
above that threshold will be 0 (Default is None)
Returns
-------
float data : numpy array |
numpy array (dim number of subject X number of network)
representing the connectivity of each network with other networks
'''... | |
<filename>samsungctl/remote_websocket.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import base64
import logging
import threading
import ssl
import websocket
import requests
import time
import json
import socket
from . import exceptions
from . import application
fr... | |
of this logical network matches
the specified value.
:return: A list of dictionaries each stands for a matched logical network
"""
if id:
# specify id ,, find it,, filter it
lgnetkey = LogicalNetwork.default_key(id)
return await self._dumpone(lgnetkey,kwargs)
else:
if physicalnetwork:
# specify physicaln... | |
0x23, 0xe4, 0x21,
0x01, 0x22, 0x1a, 0x81, 0xb5, 0xb4, 0x21, 0x22,
0x86, 0x48, 0x41, 0xa6, 0x52, 0x22, 0x2c, 0xa2,
0x18, 0x2c, 0x21, 0x85, 0xe2, 0x41, 0x08, 0x11,
0x26, 0x38, 0x21, 0x3a, 0x31, 0x21, 0xc1, 0x8a,
0x14, 0xa2, 0x35, 0xa8, 0x5e, 0x32, 0x28, 0x16,
0x62, 0x28, 0x43, 0x54, 0x28, 0xf0, 0x51, 0xe7,
0x60, 0... | |
polygon.factory()
obj_.build(child_)
self.polygon.append(obj_)
elif nodeName_ == 'wire':
obj_ = wire.factory()
obj_.build(child_)
self.wire.append(obj_)
elif nodeName_ == 'text':
obj_ = text.factory()
obj_.build(child_)
self.text.append(obj_)
elif nodeName_ == 'pin':
obj_ = pin.factory()
obj_.build(child_)... | |
''' Utilities for handling "databases" for QUAD4M analyses.
DESCRIPTION:
This module helps create and manage "databases" of:
* Geometries (db_geoms)
* Earhtquakes (db_accs)
* Non-linear properties (db_nonlins)
* Random fields (db_rfs)
MAIN FUNCTIONS:
This module contains the following functions:
* uptdate_db_ge... | |
<filename>lib/core/dump.py
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import cgi
import hashlib
import os
import re
import shutil
import tempfile
import threading
from lib.core.common import Backend
from lib.core.common i... | |
<gh_stars>10-100
# Copyright (C) 2010-2012 Canonical Ltd.
# Licenced under the txaws licence available at /LICENSE in the txaws source.
import os
from twisted.trial.unittest import TestCase
from txaws.wsdl import (
WSDLParseError, LeafSchema, NodeSchema, NodeItem, SequenceSchema,
SequenceItem, WSDLParser, etree)
... | |
stop_date, start_time, stop_time, asHistoryBuffer=False,
decimate=False, notNone=False, N=0, cache=True, fallback=True,
schemas = None, lasts = True):
sch = [s for s in self.is_attribute_archived(
attribute, preferent = True, start = start_time, stop = stop_time)
if (not schemas or s in schemas)]
if schemas... | |
# -*- coding: utf-8 -*-
"""
A Theil-Sen Estimator for Multiple Linear Regression Model
"""
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import warnings
from itertools import combinations
import numpy as np
from scipy import linalg
from scipy.s... | |
"""
xorp.py: defines routing services provided by the XORP routing suite.
"""
import logging
from core.services.coreservices import CoreService
class XorpRtrmgr(CoreService):
"""
XORP router manager service builds a config.boot file based on other
enabled XORP services, and launches necessary daemons upon startu... | |
import os
import sys
import unittest
class TestNormalizer(unittest.TestCase):
assets_dir = './test/assets'
tokenizer_filenames = [
'tokenizer_basic_ci.xml',
'tokenizer_basic_cs.xml',
'tokenizer_bypass.xml',
'tokenizer_ci_child_of_ci_parent.xml',
'tokenizer_ci_child_of_cs_parent.xml',
'tokenizer_cs_child_of_ci... | |
# -*- coding: utf-8 -*-
import inspect
import io
import logging
import os
import time
import warnings
from collections import Iterable, Iterator, defaultdict, namedtuple
from copy import copy
from functools import wraps
from typing import Any, Dict, Optional, cast
import numpy as np
import pandas as pd
import pyarro... | |
138.189444444),
"RJNT": (36.6483333333, 137.187222222),
"RJNW": (37.2933333333, 136.962222222),
"RJNY": (34.8125, 138.297777778),
"RJOA": (34.4352777778, 132.921944444),
"RJOB": (34.7569444444, 133.855555556),
"RJOC": (35.4136111111, 132.89),
"RJOE": (34.5333333333, 136.672222222),
"RJOF": (34.0344444444, 131.5... | |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# <NAME> <<EMAIL>>
import logging
import sys
import dask
from dask_jobqueue.core import Job, JobQueueCluster
from distributed.deploy import Adaptive
from distributed.scheduler import Scheduler
from bob.extension import rc
from .sge_queues import QUEUE_DEFAULT
... | |
"""
## pyart radar object
pyart.core.radar
================
A general central radial scanning (or dwelling) instrument class.
.. autosummary::
:toctree: generated/
_rays_per_sweep_data_factory
_gate_data_factory
_gate_lon_lat_data_factory
_gate_altitude_data_factory
.. autosummary::
:toctree: generated/
:tem... | |
<gh_stars>1-10
###############################################################################
# telemetry_iface_ag.py
#
# IMPORTANT NOTE: This file is auto-generated by the script: build_telemetry.py
#
# Generated on: 2018-11-16 15:33:45
# Telemetry dictionary filename: telemetry_dictionary.xml
# Telemetry dictionary ... | |
ribonucleoprotein protein IMP3'),
'P32900' : ntuniprot(RecName_Full='Protein SKG6'),
'P32901' : ntuniprot(RecName_Full='Peptide transporter PTR2'),
'P32902' : ntuniprot(RecName_Full='37S ribosomal protein MRP4, mitochondrial'),
'P32903' : ntuniprot(RecName_Full='Plasma membrane ATPase proteolipid 1'),
'P32904' : n... | |
<reponame>krishp058/hpy
from .support import HPyTest
from .test_hpytype import PointTemplate
class TestSlots(HPyTest):
ExtensionTemplate = PointTemplate
def test_tp_init(self):
mod = self.make_module("""
@DEFINE_PointObject
@DEFINE_Point_xy
HPyDef_SLOT(Point_new, HPyType_GenericNew, HPy_tp_new)
HPyDef_SLOT(... | |
#!/usr/bin/env python
u"""
esa_cryosat_ftp.py
Written by <NAME> (03/2020)
This program syncs Cryosat Elevation products
From the ESA Cryosat ftp dissemination server:
https://earth.esa.int/web/guest/-/how-to-access-cryosat-data-6842
https://earth.esa.int/web/guest/-/products-overview-6975
INPUTS:
CryoSat-2 product t... | |
= \
""""""
_PROTO_DESCRIPTOR_NAME = 'apphosting.datastore.v4.Filter'
class CompositeFilter(ProtocolBuffer.ProtocolMessage):
# Operator values
AND = 1
_Operator_NAMES = {
1: "AND",
}
def Operator_Name(cls, x): return cls._Operator_NAMES.get(x, "")
Operator_Name = classmethod(Operator_Name)
has_operator_ = ... | |
so I put my elbows into
it and made a good job. She’s kissed to pieces.”
“Dick!”
“Well, now! It’ll teach you to go careful how you start a man on them
tricks. Lynnette’s a worthy child, but I’d never have thought of
kissing her. Yet it wasn’t so bad. Rather subtle.” He licked his lips
tentatively.
“Dicky! Vulgar, vu... | |
from sqlobject import dbconnection
from sqlobject import classregistry
from sqlobject import events
from sqlobject import sqlbuilder
from sqlobject.col import StringCol, ForeignKey
from sqlobject.main import sqlmeta, SQLObject, SelectResults, \
makeProperties, unmakeProperties, getterName, setterName
import iteration
... | |
<filename>tests/test_comparisons.py
"""
Tests for comparisons of the Markov model and the simulation
"""
import numpy as np
import pytest
from hypothesis import given, settings
from hypothesis.strategies import floats, integers
from ambulance_game.comparisons import (
get_heatmaps,
get_mean_blocking_time_from_simu... | |
import asyncio
import configparser
import logging
import os
import re
import secrets
import time
import traceback
from datetime import datetime, timedelta
from decimal import ROUND_UP, Decimal
import pymongo
import qrcode
import qrcode.image.svg
from pyrogram import Client, filters
from pyrogram.errors import BadReque... | |
will be used.
@return: A L{Deferred} that fires when the lines have been delivered
and the output checked.
"""
dummy = protocolInstance if protocolInstance else DummyPOP3()
client = LineSendingProtocol(lines)
d = loopback.loopbackAsync(dummy, client)
return d.addCallback(self._cbRunTest, client, dummy, expected... | |
<reponame>SchrodingersGat/PyGen
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from rapidfuzz import fuzz
from . import debug
class PidgenElement():
"""
Base level PidgenElement class.
Provides low-level functionality inherited by all higher classes
"""
BASIC_KEYS = [
"name",
"ti... | |
<filename>periplasmic_proteome.py
from numpy.polynomial.polynomial import polyfit
from glob import glob
import pandas as pd
import numpy as np
from Bio import SeqIO
import math
import os
import cobrame
from cobrame.core.processdata import PostTranslationData
from cobrame.core.component import ProcessedProtein, Metaboli... | |
== 1:
out = Node("qualified_name", meta=[None, args[0].value]) # no namespace
else:
out = Node("qualified_name", meta=[args[0].value, args[1].value])
#print("Converter.qualified_name: returning: %s" % (out.pretty(),))
return out
def dataset(self, args):
assert len(args) in (1,2)
if len(args) == 1:
return Node... | |
heading_angle, 2)
# heading_angle = 0.0
# node_index = cal_next_node(node_poses, node_index, heading_angle, 2)
# heading_angle = -math.pi/2
# node_index = cal_next_node(node_poses, node_index, heading_angle, 4)
# print(node_index)
# print(node_poses)
# with open(filename, 'w') as f:
# pickle.dump(node_poses, f)
# ###... | |
<reponame>bopopescu/sage<filename>src/sage/groups/affine_gps/group_element.py
"""
Elements of Affine Groups
The class in this module is used to represent the elements of
:func:`~sage.groups.affine_gps.affine_group.AffineGroup` and its
subgroups.
EXAMPLES::
sage: F = AffineGroup(3, QQ)
sage: F([1,2,3,4,5,6,7,8,0], ... | |
import pygame
from pygame.locals import *
import math
from Variables_pour_importer import Objet, Types, Bouton
from Variables_pour_importer import horloge, ouvrir_terrain, terrain_vierge, enregistrer_terrain, arrondir, IA_missile_besoin_tourner, get_sign
fps = 40
class Fenetre():
def __init__(self):
self.jouer = True... | |
# get abc posterior
theta_T = np.loadtxt(os.path.join(os.environ['GALPOPFM_DIR'], 'abc',
abc_run(sim.lower()), 'theta.t%i.dat' % nabc[sim.lower()]))
theta_median = np.median(theta_T, axis=0)
theta_meds.append(theta_median)
# get sims posterior
_, _sim_sed, _ = _sim_observables(sim.lower(), theta_median)
sim_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.