input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#!/usr/bin/python2.7
'''
DownloadHygeine - Fetch software and other media safely and easily.
TODO:
multiple git repos
mostly non-interactive command line operations
gpg - ugh, no one uses consistent means of signing stuff. back-burner! :'(
once gpg is supported,allow per-source authenticators
test mirrors
least... | |
e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpack
a, b, c, d, e, f, g, h, i, j = to_unpa... | |
# Copyright 2021 Hathor Labs
#
# 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, soft... | |
**range:** 250..2000
**units**\: millisecond
**default value**\: 1000
"""
_prefix = 'ip-rsvp-cfg'
_revision = '2017-05-01'
def __init__(self):
super(Rsvp.Interfaces.Interface.IfSignalling.IntervalRate, self).__init__()
self.yang_name = "interval-rate"
self.yang_parent_name = "if-signalling"
s... | |
# -*- coding:utf-8 -*-
import json
import os
import numpy as np
import random
import config
import jieba
import re
class file_data_loader:
def __next__(self):
raise NotImplementedError
def next(self):
return self.__next__()
def next_batch(self, batch_size):
raise NotImplementedError
class cmp():
def __ini... | |
<reponame>knjcode/imgdupes
#!/usr/bin/env python
# coding: utf-8
from __future__ import (absolute_import, division, print_function)
from logging import getLogger, StreamHandler, DEBUG
logger = getLogger(__name__)
handler = StreamHandler()
# handler.setLevel(DEBUG)
# logger.setLevel(DEBUG)
logger.addHandler(handler)
l... | |
<reponame>sireliah/polish-python
"""Interface to the libbzip2 compression library.
This module provides a file interface, classes dla incremental
(de)compression, oraz functions dla one-shot (de)compression.
"""
__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor",
"open", "compress", "decompress"]
__author__ =... | |
"""
Throughout this file, the following notations are consistently used for variables:
* `x` always refers to user histories, and will generally be a tensor of dimension
num_interactions x num_users x compress_dim
* `y` always refers to the output probabilities of the neural net, and will generally
be of the dimens... | |
<gh_stars>1-10
# Copyright 2017 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 ... | |
sticky='e', padx=20)
lbl_max_move_title = ttk.Label(master=self.controller_frame, text="Movement Speed", font=self.big_font)
lbl_max_move_title.grid(row=0, column=3, sticky='e', padx=20)
self.lbl_max_move = tk.Label(master=self.controller_frame, text="", font=self.reg_font, bg='gray28', fg='gray70')
self.lbl_max_mo... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import pdb, importlib, inspect, time, datetime, json
# from PyFin.api import advanceDateByCalendar
# from data.polymerize import DBPolymerize
from data.storage_engine import StorageEngine
import time
import pandas as pd
import numpy as np
from datetime import timedelta, datetime
... | |
with
a hosting service will have those credentials removed.
"""
from reviewboard.scmtools.models import Repository
# Due to a bug in Review Board 2.0.x < 2.0.25 and 2.5.x < 2.5.7,
# the browser could end up filling in the hidden "password" field
# on repositories that were set up to use a hosting service. For
#... | |
import sys
import os
import time
import socket
import logging
import traceback
from collections import deque
try:
# Use simplejson instead of json because it is released more frequently and
# is generally faster.
import simplejson as json
# However, if speedups are not installed, simplejson will be slow, so use
... | |
<filename>ctdcal/process_ctd.py
import logging
import warnings
from datetime import datetime, timezone
from pathlib import Path
import gsw
import numpy as np
import pandas as pd
import scipy.signal as sig
from . import get_ctdcal_config, io, oxy_fitting
cfg = get_ctdcal_config()
log = logging.getLogger(__name__)
wa... | |
scorer_tf(self, doc_term_freq, concepts=None, use_existing_data=False):
return doc_term_freq
def scorer_tfidf(self, doc_term_freq, concepts=None, use_existing_data=False, norm='l2'):
if use_existing_data:
(doc_term, _) = tf_to_tfidf(doc_term_freq, idf_diag=self.idf_diag, sublinear_tf=True, smooth_idf=True,
norm=n... | |
<filename>angr/analyses/veritesting.py
import logging
from collections import defaultdict
import networkx
from simuvex import SimProcedures, o
from ..errors import AngrError, AngrCFGError
from ..analysis import Analysis, register_analysis
from ..path_group import PathGroup
from ..path import Path, AngrPathError
l =... | |
<reponame>sneklingame/FakahedaSEServerBackupManager
#!/usr/bin/env python
# encoding: utf-8
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction,... | |
population that escapes from |11> to |02>.
Formula for unitary propagator: population = |<02|U|11>|^2
and similarly for the superoperator case.
The function assumes that the computational subspace (:= the 4 energy levels chosen as the two qubits) is given by
the standard basis |0> /otimes |0>, |0> /otimes |1>, |1>... | |
"""passlib.handlers.django- Django password hash support"""
#=============================================================================
# imports
#=============================================================================
# core
from base64 import b64encode
from hashlib import md5, sha1
import re
import logging; ... | |
# -*- coding: utf-8 -*-
import json
import random
import string
from unittest import TestCase
from hypothesis import given
from hypothesis import settings
from hypothesis.strategies import dictionaries
from hypothesis.strategies import floats
from hypothesis.strategies import integers
from hypothesis.strategies import... | |
transition matrix for an all-ones routing params should be a
# (weighted) directed adjacency matrix. We use 3 variants, 2 states.
ones_routing_params = automaton_builder.RoutingParams(
move=jnp.ones([3, 12, 2, 2]), special=jnp.ones([3, 5, 2, 3]))
ones_transition_matrix = builder.build_transition_matrix(
ones_rout... | |
<filename>caql/caql_agent.py
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | |
<reponame>graeme-winter/dials<filename>command_line/combine_experiments.py
import logging
import os
import random
import sys
import dxtbx.model.compare as compare
import xfel.clustering.cluster
from dxtbx.command_line.image_average import splitit
from dxtbx.model.experiment_list import (
BeamComparison,
DetectorComp... | |
a sentence
# * *Pattern matching*: looking for specific syntactical patterns
# * *Third-party models*: using an pre-trained model (usually a model for a different task than the one at hand)
# * *Distant supervision*: using external knowledge base
# * *Crowdworker labels*: treating each crowdworker as a black-box functi... | |
separate path
components regardless of the separator character for this platform. This method will perform the necessary
conversion.
"""
converted_path = convert_path(path)
try:
os.makedirs(converted_path)
except OSError, error:
if error.errno == errno.EEXIST and os.path.isdir(converted_path):
pass
else:
rai... | |
self.under_test.veracrypt_post_processor)
# THEN
expected = [
('notify_secondary_progress()', 0.126),
('notify_file()', 'Done: 0.126% Speed: 3.7 MiB/s Left: 36 minutes', False),
('notify_secondary_progress()', 0.504),
('notify_file()', 'Done: 0.504% Speed: 14 MiB/s Left: 9 minutes', False),
('notify_secondary_pr... | |
<reponame>paran0ids0ul/binjitsu
from pwnlib.constants.constant import Constant
__NR_read = Constant('__NR_read',0)
__NR_write = Constant('__NR_write',1)
__NR_open = Constant('__NR_open',2)
__NR_close = Constant('__NR_close',3)
__NR_stat = Constant('__NR_stat',4)
__NR_fstat = Constant('__NR_fstat',5)
__NR_lstat = Consta... | |
self.variables.select_rect_id
self.variables.active_tool = TOOLS.SELECT_TOOL
self.variables.current_tool = TOOLS.SELECT_TOOL
def set_current_tool_to_draw_line_by_dragging(self, line_id=None):
self.variables.current_shape_id = line_id
self.show_shape(line_id)
self.variables.active_tool = TOOLS.DRAW_LINE_BY_DRAGGI... | |
queue = sorted(set(queue))
seen = set(queue)
while queue:
lowest = queue.pop()
if lowest == 0:
continue
needed_budget = (37 - len(placed)) * lowest
for p in placed:
needed_budget += max(0, lowest - p)
if budget < needed_budget:
continue
remaining_budget = budget - needed_budget
partial = len([p for p in pla... | |
"""
Double entry accounting system:
A debit is an accounting entry that either increases an asset or expense account,
or decreases a liability or equity account. It is positioned to the left in an accounting entry.
Debit means "left", dividends/expenses/assets/losses increased with debit.
A credit is an accounting en... | |
__all__ = ()
from os import listdir as list_directory
from os.path import (
basename as base_name, exists, isabs as is_absolute_path_name, isdir as is_directory, isfile as is_file,
join as join_paths
)
from sys import path as route_paths
from scarletio import CallableAnalyzer, HybridValueDictionary
from .constants... | |
<gh_stars>0
import unittest
import packet
class TestDummy(unittest.TestCase):
def test_dummy(self):
self.assertEqual(True, True)
class TestBasicPacket(unittest.TestCase):
"""
Basic packet & helpers tests.
"""
def test_too_small_packet(self):
"""
Tests if too small packets are rejected due to the
minim... | |
of rmsg
# attach reciept message to existing message with val's incept message
vmsg.extend(rmsg)
assert vmsg == bytearray(b'{"v":"KERI10JSON0000e6_","i":"EpDA1n-WiBA0A8YOqnKrB-wWQYYC49i5zY'
b'_qrIZIicQg","s":"0","t":"icp","kt":"1","k":["D8KY1sKmgyjAiUDdUBP'
b'NPyrSz_ad_Qf9yzhDNZlEKiMc"],"n":"EOWDAJvex5dZzDxeHBANy... | |
import sys
import time
import numpy as np
import readers.utils as utils
from readers.Mention import Mention
from readers.config import Config
from readers.vocabloader import VocabLoader
import ccg_nlpy
from ccg_nlpy.core.text_annotation import TextAnnotation
start_word = "<s>"
end_word = "<eos>"
# Reader for Text Ann... | |
bytes out - takes pid - InRaw<8,8,8>, InRaw<4,4,0>'),
('nn::hid::IHidServer', 101, '8 bytes in - 4 bytes out - takes pid - InRaw<8,8,0>, OutRaw<4,4,0>'),
('nn::hid::IHidServer', 102, '8 bytes in - 0 bytes out - takes pid - InRaw<8,8,0>, Buffer<0,9,0>'),
('nn::hid::IHidServer', 103, '8 bytes in - 0 bytes out - takes ... | |
DefaultJobs.append(['DARPin', '', 'GACGTTAACGCT', 'GGATCC', 'AAGCTT', 2, [['ACTCCGCTGCACCTGGCTGCT', 6, 6, 0], ['GGTCACCTGGAAATCGTTGAAGTTCTGCTGAAGTACGGTGCT', 2, 2, 0], ['', 4, 6, 2], ['', 4, 6, 2], ['', 4, 6, 2], ['', 4, 6, 2], ['', 4, 6, 2], ['', 4,6, 2]]])
DefaultJobs.append(['Fibronectin_Fn3HP','High_affinity.fasta... | |
on save only if it hasn't already been done and the
# build is complete.
if self.build.status == BUILD_SUCCESS and not self.hash:
self.hash = self.compute_hash()
validate_config_marshaling(self)
super(Release, self).save()
@reversion.register
@six.python_2_unicode_compatible
class Host(models.Model):
name = mod... | |
("report_date_stamp", pymongo.ASCENDING),
("f_ann_date_stamp", pymongo.ASCENDING)])
if fields:
df = pd.DataFrame(cursor).drop(columns="_id")[fields].set_index("code")
df.report_date = pd.to_datetime(df.report_date)
df.ann_date = pd.to_datetime(df.ann_date)
df.f_ann_date = pd.to_datetime(df.f_ann_date)
else:
df ... | |
'|' ^ bitwise_xor_expr
pass
char_literal211 = self.match(self.input, 133, self.FOLLOW_133_in_bitwise_or_expr1783)
if self._state.backtracking == 0:
char_literal211_tree = self._adaptor.createWithPayload(char_literal211)
root_0 = self._adaptor.becomeRoot(char_literal211_tree, root_0)
self._state.following.appe... | |
pair should have normal behavior for that (user, stream) pair.
# A normal muted topic. No notifications and unreads hidden.
MUTED = 1
# This topic will behave like an unmuted topic in an unmuted stream even if it
# belongs to a muted stream.
UNMUTED = 2
# This topic will behave like `UNMUTED`, plus will also a... | |
""" Cisco_IOS_XR_ncs5500_coherent_node_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ncs5500\-coherent\-node package operational data.
This module contains definitions
for the following management objects\:
coherent\: Coherent node operational data
Copyright (c) 2013\-2016 by Cisco S... | |
te:
result.te = te
oprot.writeMessageBegin("get", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_get_slice(self, seqid, iprot, oprot):
args = get_slice_args()
args.read(iprot)
iprot.readMessageEnd()
result = get_slice_result()
try:
result.success = se... | |
output[0, :] = (params[1, :] * 2.0 + params[3, :] * 0.5) / (2.0 + 0.5)
output[1, :] = (params[0, :] * 1.0) / 1.0
output[2, :] = (params[1, :] * 3.0) / 3.0
```
Raises:
TypeError: If `sp_ids` is not a `SparseTensor`, or if `sp_weights` is
neither `None` nor `SparseTensor`.
ValueError: If `combiner` is not one of ... | |
twist. This option has meaning
only when *dimensionality*=AXISYMMETRIC. Possible values are ON and OFF. The default
value is OFF.
Returns
-------
part: Part
A Part object
"""
pass
def PartFromOdb(self, name: str, odb: str, fileName: str = '', instance: str = '', elementSet: str = '',
shape: SymbolicConst... | |
<gh_stars>0
import py
from rpython.rlib.rstrategies import rstrategies as rs
from rpython.rlib.objectmodel import import_from_mixin
from rpython.compat import with_metaclass
# === Define small model tree
class W_AbstractObject(object):
pass
class W_Object(W_AbstractObject):
pass
class W_Integer(W_AbstractObject)... | |
blobUrl=self.sapRfcSdkBlobUrl,
storageAccount=blobStorageAccount)
if (not doesPackageExist):
self.tracer.error("%s User provided RFC SDK blob does not exist %s, skipping...", self.logTag, self.sapRfcSdkBlobUrl)
return False
self.tracer.info("%s user provided RFC SDK blob exists for download %s, lastModified=%s... | |
{ "depth":2, "flags":0, \n'
' "label":"C:\\Users\\athomas\\Documents\\Audacity\\Spoken '
'Tones\\Gigs\\Highball\\2020-02-16\\Raw Tracks\\TRK15.WAV", "accel":"" '
'},\n'
' { "depth":2, "flags":0, \n'
' "label":"C:\\Users\\athomas\\Documents\\Audacity\\Spoken '
'Tones\\Gigs\\Highball\\2020-02-16\\Raw Tracks\\TRK14.... | |
<filename>cellpainter/moves.py
'''
robotarm moves
'''
from __future__ import annotations
from dataclasses import *
from typing import *
from pathlib import Path
import abc
import re
import textwrap
from . import utils
class Move(abc.ABC):
def to_dict(self) -> dict[str, Any]:
res = utils.to_json(self)
assert isinst... | |
<reponame>nyuvis/explanation_explorer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import os
import csv
import sys
import json
import math
import time
import random
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from scipy.spa... | |
status of {}".format(service))
if thread is None:
# no thread means the service is not running
# self.logger.info("{} is stopped".format(service))
reply = 'stopped'
elif thread.is_alive():
# self.logger.info("{} is running".format(service))
reply = 'running'
else:
# self.logger.info("{} is stopped".format(serv... | |
@param resp: The string response returned from the SMTP Server
@param numOK: the number of addresses accepted by the remote host.
@param addresses: is a list of tuples (address, code, resp) listing
the response to each RCPT command.
@param log: is the SMTP session log
"""
raise NotImplementedError
def _disconne... | |
must be nonnegative'
i = from_index
v = self.vector
l = len(v)
o = i >> 4
s = i & 0x0F
i = o << 4
while o < l:
h = v[o]
if h:
i += s
m = 1 << s
while m != (1 << 0x10):
if h & m: return i
m <<= 1
i += 1
else:
i += 0x10
s = 0
o += 1
return -1
def rank_of_bit_set_at_index(self, position):
'''
For ... | |
<reponame>ValentinSilvestri/cammesa
import os
import re
import pymongo
import pandas as pd
import numpy as np
import streamlit as st
from bokeh.plotting import figure
from bokeh.palettes import Set1_9, Set3_12, Inferno256
@st.cache(suppress_st_warning=True, allow_output_mutation=True)
def get_caudales():
"""Function... | |
ndata and edata are maintained by Frames. So to maintain compatibility
# with older code, DGLHeteroGraphs and other graph storages are handled separately: (1)
# DGLHeteroGraphs will preserve the lazy feature slicing for subgraphs. (2) Other graph storages
# will not have lazy feature slicing; all feature slicing will b... | |
dref[rid]['val'].shape[0]==dref[otherid]['val'].size
if c0:
dref[rid]['indother'] = None
else:
assert dref[rid]['indother'].ndim == 1
# Get nn
val = dref[rid]['val']
# Check if is2d
ltypes = []
for ax in dax.keys():
if rid in dax[ax]['ref'].keys():
ltypes.append(dax[ax]['ref'][rid])
ltypes = sorted(set(lt... | |
"""
Harness for GP Bandit Optimisation.
-- <EMAIL>
"""
from __future__ import division
import numpy as np
from argparse import Namespace
from . import gpb_acquisitions
from .blackbox_optimiser import blackbox_opt_args, BlackboxOptimiser, \
CalledMFOptimiserWithSFCaller
# Local imports
from ..exd import domains
fro... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
.. module:: volume
:synopsis: Volume Indicators.
.. moduleauthor:: <NAME> (Bukosabino)
"""
import numpy as np
import pandas as pd
from .utils import get_drift, get_offset, signed_series, verify_series
from .momentum import roc
from .overlap import hl2, hlc3, ema
def ad(h... | |
train[['loan_status']]
x_test = test.iloc[(slice(0, None, None), slice(1, 34, None))]
return x_test
#=============
# Function 57
def cleaning_func_37(df):
# additional context code from user definitions
def status_binary(text):
if (text == 'Fully Paid'):
return 0
elif ((text == 'Current') or (text == 'Issue... | |
<filename>aminator/util/linux.py
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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
#
#... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2021 <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 ... | |
<gh_stars>0
import warnings
import math
from pythermalcomfort.psychrometrics import p_sat
warnings.simplefilter("always")
def transpose_sharp_altitude(sharp, altitude):
altitude_new = math.degrees(
math.asin(
math.sin(math.radians(abs(sharp - 90))) * math.cos(math.radians(altitude))
)
)
sharp = math.degrees(
... | |
characteristics."""
subclass = None
superclass = None
def __init__(self, Machine=None, Number_Of_Sections=None, Time_Date_Stamp=None, Pointer_To_Symbol_Table=None, Number_Of_Symbols=None, Size_Of_Optional_Header=None, Characteristics=None, Hashes=None):
self.Machine = Machine
self.Number_Of_Sections = Number_Of_S... | |
CHINESE RESTAURANT', 'RAFAELLA CAFE', 'DUKES', 'JOEY PEPPERONI PIZZA', 'WGC SOLUTIONS',
"BONNIE'S GRILL", 'SUSHI OF GARG46', 'ROBERT SILMAN ASSOC STRUCT ENG DPC', 'ZHENG & ASSOCIATES LLC',
'BUILDING ENGINEERING SYSTEMS PLLC', '<NAME>', "MAMA'S FAMOUS PIZZA",
'MG NEW YORK ARCHITECTS,PLLC', 'PLAN B ENGINEERING', 'C.M.... | |
"""
A commandline tool for semi-automatically converting CSV to RDF
try: ``csv2rdf --help``
"""
from __future__ import print_function
import sys
import re
import csv
import getopt
import fileinput
import codecs
import time
import datetime
import warnings
import configparser
from urllib.parse import quote
import r... | |
<gh_stars>0
import validators
from elasticsearch import Elasticsearch
from pymongo import MongoClient
import random
from semantic_labeling.lib.column import Column
from semantic_labeling.lib.source import Source
from semantic_labeling.main.random_forest import MyRandomForest
from semantic_labeling.search.indexer import... | |
from s3db.pr import pr_descendants
if current.deployment_settings.get_auth_user_realms_include_persons():
exclude_persons = False
else:
exclude_persons = True
descendants = pr_descendants(entities, exclude_persons = exclude_persons)
# Add the subsidiaries to the realms
for group_id in realms:
realm = realms[gr... | |
<reponame>byteface/domonic<filename>domonic/__init__.py
"""
domonic
====================================
API for creating and loading .pyml
"""
__version__ = "0.8.3"
__license__ = 'MIT'
__author__ = "@byteface"
'''
__uri__ = "https://github.com/byteface/domonic"
# https://domonic.readthedocs.io/
__title__ = 'dom... | |
and namespaceURI and prefix: # filename is label, prefix is language
thisDoc.extensionRoleLabels[namespaceURI].add( (filename, prefix) )
elif filetype == "schema-version" and filename:
thisDoc.extensionSchemaVersion = filename
elif filetype == "table-style" and filename == "xbrl-us":
isUSGAAP = True
elif filetype... | |
the data by metadata properties to include only data in the data cube which
all given conditions return `true` for (AND operation). Specify key-value-pairs with the key being the
name of the metadata property, which can be retrieved with the openEO Data Discovery for Collections.
The value must a condition (user-def... | |
del_items(0x8007B664)
SetType(0x8007B664, "int GetTpY__FUs(unsigned short tpage)")
del_items(0x8007B680)
SetType(0x8007B680, "int GetTpX__FUs(unsigned short tpage)")
del_items(0x8007B68C)
SetType(0x8007B68C, "void Remove96__Fv()")
del_items(0x8007B6C4)
SetType(0x8007B6C4, "void AppMain()")
del_items(0x8007B7DC)
SetType... | |
<filename>botbot/apps/logs/views.py<gh_stars>1-10
import datetime
import json
import math
import random
import re
from django.conf import settings
from django.contrib.humanize.templatetags import humanize
from django.core.cache import cache
from django.db.models import Q
from django.http import Http404, HttpResponse
f... | |
<filename>src/robot/parsing/model.py
# Copyright 2008-2010 Nokia Siemens Networks Oyj
#
# 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... | |
"Searchlight": 0xEFF0BF,
"Seared Earth": 0x9A5633,
"Seared Grey": 0x495157,
"Searing Gorge Brown": 0x6B3B23,
"Seascape Blue": 0xA6BAD1,
"Seascape Green": 0xB5E4E4,
"Seashell": 0xFFF5EE,
"Seashell Cove": 0x104C77,
"Seashell Peach": 0xFFF6DE,
"Seashell Pink": 0xF7C8C2,
"Seashore Dreams": 0xB5DCEF,
"Seaside San... | |
= %s ) )'
txt = fix_query( txt )
execute( c, txt, data )
# --------------------------------------------------------------
if MYSQL:
txt = "ALTER TABLE raw_index ADD INDEX( src ), ADD INDEX( title_id ), ADD INDEX( local )"
execute( c, txt )
if SQLITE:
txt = "CREATE INDEX raw_index_index ON raw_index( src, lo... | |
[107.58996,-6.97689],
[107.58992,-6.97698],
[107.5899,-6.97705],
[107.58988,-6.9771],
[107.58987,-6.97725],
[107.58988,-6.97729],
[107.5899,-6.9774],
[107.58992,-6.97745],
[107.58994,-6.9775],
[107.58998,-6.97758],
[107.59,-6.97761],
[107.59006,-6.97769],
[107.59009,-6.97772],
[107.59014,-6.97778],
[107.5... | |
['port:eth101/1/36'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/37'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/38'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth1... | |
<reponame>revnav/sandbox
# coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/license... | |
read')
class InflowBoundaryField(BaseProperties):
def __init__(self, casename, casedir='.', boundarydata_folder='boundaryData', avg_folder='Average', debug=False, **kwargs):
self.casename, self.casedir = casename, casedir
self.case_fullpath = casedir + '/' + casename + '/' + boundarydata_folder + '/'
self.inflow_... | |
params["localid"] = "Y"
# default value
# Entry ID is a unique-enough string used w/ search and replace
#
params["defval"] = None
if row[2].find( ".Entry_ID" ) >= 0 : params["defval"] = "NEED_ACC_NUM"
elif row[24] is not None :
params["defval"] = row[24].strip()
if params["defval"] in ("?", ".") : params["defval"... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2020-2021, Pelion and affiliates.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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... | |
#!/usr/bin/env python
#TODO
# add text colors and decorations
# ##############################################################################
#
# Prerequisites
#
# ##############################################################################
#
# ####################################################################... | |
# Copyright The PyTorch Lightning team.
#
# 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 wr... | |
tile in self.faces[LEFT].get_tiles():
output += c2f_map[tile]
for tile in self.faces[BACK].get_tiles():
output += c2f_map[tile]
return output
# End def
def print_cube(self):
space = " "
output = ""
# Print Top
face = self.faces[TOP]
for row in range(self.dimension):
output += space * self.dimension
o... | |
<gh_stars>0
from copy import deepcopy
from collections import namedtuple
from contextlib import contextmanager
try:
import sqlite3
except ImportError:
sqlite3 = None
try:
import psycopg2
except ImportError:
psycopg2 = None
try:
import MySQLdb as mysql
except ImportError:
mysql = None
__version__ = "0.4.4"
__... | |
'EncryptedID'
c_namespace = NAMESPACE
c_children = EncryptedElementType_.c_children.copy()
c_attributes = EncryptedElementType_.c_attributes.copy()
c_child_order = EncryptedElementType_.c_child_order[:]
c_cardinality = EncryptedElementType_.c_cardinality.copy()
def encrypted_id_from_string(xml_string):
return s... | |
LoaderFactory(loaders_config)
datasets, task = create_parsers(config, loader_factory.get_base_transforms())
assert datasets and task is not None, "invalid dataset configuration (got empty list)"
for dataset_name, dataset in datasets.items():
logger.info(f"parsed dataset: {str(dataset)}")
logger.info(f"task info: {... | |
If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the ``Marker`` parameter and retrying the command. If the ``Marker`` field is empty, all response records have been retrieved for the request.
- **Snapshots** *(list) --*
A list of Snapshot inst... | |
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,... | |
s:
trace_id = (s.src,s.dst,1,s.type)
else:
trace_id = (s.src,s.dst,s.proto,0)
trace = rt.get(trace_id,{})
ttl = IPv6 in s and s.hlim or s.ttl
if not (ICMP in r and r[ICMP].type == 11) and not (IPv6 in r and ICMPv6TimeExceeded in r):
if trace_id in ports_done:
continue
ports_done[trace_id] = None
p = ports.get... | |
g = (special.erf((d+dx/2.)/n) - special.erf((d-dx/2.)/n))/2.
return g/dx if density else g
def find_largest_coherent_region(a):
"""
Find the largest coherent region in a 2D array.
This is basically a wrapper for `scipy.ndimage.label`_ that associates
adjacent pixels (including diagonally) into groups. The large... | |
<reponame>Matchoc/stockmarketpy
import sys
import os
os.environ["path"] = os.path.dirname(sys.executable) + ";" + os.environ["path"]
import glob
import operator
import datetime
import dateutil.relativedelta
import win32gui
import win32ui
import win32con
import win32api
import numpy
import json
import csv
... | |
import pytest
import os
from pathlib import Path
import shutil
import pandas as pd
from wrftamer.main import project, list_projects, list_unassociated_exp, reassociate
# -----------------------------------------------------------------------
# Trivial tests for nonexistent project
# ----------------------------------... | |
<filename>w_queues/reptod_wcancel.py<gh_stars>10-100
import numpy as np
from patch import *
from rvs import *
from howtorep_exp import *
# ############################################# Model ########################################## #
ET_MAX = 10000
def ar_ub_reptod_wcancel(ns, J, S):
EJ, ES = J.mean(), S.mean()
... | |
"""Plangym API implementation."""
from abc import ABC
from typing import Any, Callable, Dict, Generator, Iterable, Optional, Tuple, Union
import gym
from gym.envs.registration import registry as gym_registry
from gym.spaces import Space
import numpy
import numpy as np
wrap_callable = Union[Callable[[], gym.Wrapper],... | |
<filename>experimental/fitTest/templates_electron.py
inputTemplates = {
"M3": {
"QCD": [
[
0.0,
0.0004418671450315185,
0.01605229202018541,
0.05825334528354453,
0.08815209477081883,
0.1030093733105401,
0.10513254530282935,
0.09543913272896494,
0.08512520799056993,
0.07489480051367764,
0.06022183... | |
because average line height is used when create docx. However, the contained lines
# may be not reasonable after this step. So, this is just a pre-processing step focusing
# on processing lines in horizontal direction, e.g. merging inline image to its text line.
# Further steps, e.g. split back to original blocks,... | |
"""
Class to create jira tickets for security group issues.
"""
import sys
import logging
import warnings
import ipwhois
from functools import lru_cache
from ipwhois import IPWhois
from collections import Counter
from library.logger import set_logging, add_cw_logging
from library.config import Config
from library.jir... | |
<reponame>rajeshkumarkarra/strawberryfields
# Copyright 2019 Xanadu Quantum Technologies 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
# U... | |
<reponame>alexaushev/LFIwithDGPs
"""
Kernel Means Learning Module.
Core methods for Bayesian learning of hyperparameters for likelihood-free inference with kernel means.
"""
import numpy as np
import tensorflow as tf
from kelfi.tensorflow_kernels import gaussian_kernel_gramix, gaussian_density_gramix_multiple, gaussia... | |
0xFD7C6E,
"Hipsterfication": 0x88513E,
"Hiroshima Aquamarine": 0x7FFFD4,
"His Eyes": 0x9BB9E1,
"Hisoku Blue": 0xABCED8,
"Historic Cream": 0xFDF3E3,
"Historic Shade": 0xADA791,
"Historic Town": 0xA18A64,
"Historic White": 0xEBE6D7,
"Historical Grey": 0xA7A699,
"Historical Ruins": 0xBFB9A7,
"Hisui Kingfisher":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.