input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
refreshed (and thus marks
the end of the menu).
:param str menu_name: (optional; default same as menu_title)
string that is printed in progress messages to describe the
menu.
"""
assert isinstance(target, tcfl.tc.target_c)
assert isinstance(menu_title, str)
assert canary_end_menu_redrawn == None \
or isinsta... | |
<reponame>msg-byu/gblearn
"""Tests collection.py
"""
from pyrelate.collection import AtomsCollection
import numpy as np
import sys
import shutil
import io
import re
import unittest
import os
'''Functions to help in writing and designing clear, functional unit tests'''
def _delete_store(my_col):
'''Function to delet... | |
<reponame>pauliacomi/CoolProp<filename>dev/inject_melting_curves.py
import os, json
Simon_curves = {
"n-Propane": {
"BibTeX": "Reeves-JCP-1964", "T_m": -187.75 + 273.15, "parts": [{"T_0": 85.3, "a": 7.180e8, "c": 1.283, "p_0": 0.0, "T_max": 168.63}]
},
"n-Pentane": {
"BibTeX": "Reeves-JCP-1964", "T_m": -129.89 +... | |
<reponame>DalavanCloud/tmppy<gh_stars>1-10
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
<filename>oops_fhir/r4/code_system/v3_hl7_standard_version_code.py
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3HL7StandardVersionCode"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3HL7Stand... | |
import ast
from typing import NamedTuple
import yapypy.extended_python.extended_ast as ex_ast
from yapypy.extended_python.symbol_analyzer import SymTable, Tag
from yapypy.utils.namedlist import INamedList, as_namedlist, trait
from yapypy.utils.instrs import *
from Redy.Magic.Pattern import Pattern
from bytecode import ... | |
D V
# + + + - - -
# addressing assembler opc bytes cyles
# --------------------------------------------
# accumulator ROR A 6A 1 2
# zeropage ROR oper 66 2 5
# zeropage,X ROR oper,X 76 2 6
# absolute ROR oper 6E 3 6
# absolute,X ROR oper,X 7E 3 7
address = None
cycles = None
if (op_code == 0x6A): # accumulat... | |
<reponame>pgriewank/ASR_tools
#todo
#make timesteps adaptive
#read in dz
import numpy as np
import math
from netCDF4 import Dataset
import os
from datetime import datetime,timedelta
#from unionfind import Unionfind
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
from matplotlib.pyplot i... | |
= DlpServiceAsyncClient(credentials=credentials.AnonymousCredentials(),)
# Attempting to call a method with both a request object and flattened
# fields is an error.
with pytest.raises(ValueError):
await client.get_deidentify_template(
dlp.GetDeidentifyTemplateRequest(), name="name_value",
)
def test_list_deid... | |
<reponame>rthartley/reacombiner
import subprocess
from pathlib import PurePath
from time import strptime, mktime
import rpp
from ReaCombiner import db, file_utils
from ReaCombiner import rppFile
from ReaCombiner.data import *
sg.theme('LightGreen')
sg.SetOptions(element_padding=(5, 5))
bg_color = "cadetblue"
window... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Optional, Union, Dict
from dbas.database import DBDiscussionSession
from dbas.database.discussion_model import ClickedStatement, ClickedArgument, User, MarkedArgument, MarkedStatement, \
Argument, Statement
from dbas.lib import get_author_data, Relation... | |
'allocation_state': {'key': 'allocationState', 'type': 'str'},
'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'},
'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'},
'current_node_count': {'key': 'currentNodeCount', 'type': 'int'},
'target_node_count'... | |
''' This notebook will perform some amount of wrangling, repeat all previous
Natural Language Processing (NLP) preprocessing, and conduct feature engineering.
The feature engineering leverages work conducted in Step_5_Create_Stop_and_Unique_words
and will be used to domain-specifc scoring (like sentiment) and expand... | |
'laser')
elif laser == 'em':
if isinstance(filter, bool):
if cycle not in cycle_dict[laser]:
cycle_dict[laser][cycle] = filter
else:
error('ConfigFile::Duplicated emission filter cycle')
else:
error('ConfigFile::Invalid filter for', laser, 'laser')
else:
error('ConfigFile:Invalid laser')
# Add default/home ... | |
"""
Utilities to parse files in CHILDES CHAT format.
"""
import sys, os
import re
import ast
import fileinput
from itertools import chain
from typing import List, Tuple, Dict, Union
from pathlib import Path
from collections import OrderedDict
from logger import logger
from helpers.sentence import Sentence
from helper... | |
<gh_stars>0
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Gory implementation details of CAS service.
Append only currently. Once object is added, it can't be removed.
Upload protocol:
1) Client as... | |
add a repository's owner as a collaborator.")
collaborators = self.list_collaborators(repo)
if collaborator in (c['username'] for c in collaborators):
raise ValueError(
"{0} is already a collaborator of {1}.".format(
collaborator, repo))
db_privileges = [p.upper() for p in db_privileges]
file_privileges = [p.l... | |
_eval_func(x: ConstantType, y: ConstantType) -> bool:
"""calculation function for 2 elements"""
return bool(x) & bool(y)
@staticmethod
def _simplify(children: list[Node], env: Optional[Environment] = None) -> list[Node]:
"""returns a simplified version of the tree"""
for i, child in enumerate(children):
if isin... | |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Wher... | |
Mass_tooth_stator : float, [kg]
Teeth and copper mass
Mass_yoke_rotor : float, [kg]
Rotor yoke mass
Mass_yoke_stator : float, [kg]
Stator yoke mass
rotor_mass : float, [kg]
Total rotor mass
stator_mass : float, [kg]
Total stator mass
"""
def initialize(self):
super(PMSG_Outer, self).initialize()
def set... | |
* chunksize, (i + 1) * chunksize),),
columns,
categories,
lock,
)
for i in range(0, int(ceil(len(x) / chunksize)))
}
meta = dataframe_from_ctable(x, slice(0, 0), columns, categories, lock)
result = DataFrame(dsk, new_name, meta, divisions)
if index:
assert index in x.names
a = da.from_array(x[index], chunk... | |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... | |
<reponame>z3z1ma/dbt-osmosis
from enum import Enum
from itertools import chain
from pathlib import Path
from typing import (Any, Dict, Iterable, Iterator, List, Mapping,
MutableMapping, Optional, Set, Tuple, Union)
import agate
import dbt.config.runtime as dbt_config
import dbt.parser.manifest as dbt_parser
from dbt.... | |
import argparse
import logging
import os
import platform
import re
import threading
from enum import Enum
from os import environ
from subprocess import CalledProcessError
from typing import Iterable, Optional
from packaging import version
from packaging.version import InvalidVersion
from . import CONFIG_VERSION_PATH,... | |
start time/frame for later
blankscreen.frameNStart = frameN # exact frame index
blankscreen.tStart = t # local t and not account for scr refresh
blankscreen.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(blankscreen, 'tStartRefresh') # time at next scr refresh
blankscreen.setAutoDraw(True)
if bla... | |
the first *n* rows of the given Dataset"""
try:
df = next(
pd.read_sql_table(
table_name=self._table.name,
schema=self._table.schema,
con=self.engine,
chunksize=n,
)
)
except (ValueError, NotImplementedError):
# it looks like MetaData that is used by pd.read_sql_table
# cannot work on a temp table.
# If i... | |
<filename>manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py
# Copyright (c) 2015 <NAME>. 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.... | |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from edibles import DATADIR
from edibles import PYTHONDIR
from edibles.utils.edibles_spectrum import EdiblesSpectrum
class EdiblesOracle:
"""
This class will process the EDIBLES obs log and target info files.
Users can... | |
car_data['labels']:
onehot[car_data['labels']['model'] + offset] = 1.0
offset += offsets[1]
if 'color' in car_data['labels']:
onehot[car_data['labels']['color'] + offset] = 1.0
offset += offsets[2]
if 'manufacturer' in car_data['labels']:
onehot[car_data['labels']['manufacturer'] + offset] = 1.0
offset += off... | |
# -*- coding: utf-8 -*-
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
import pandas as pd
from app import app
import os
from plotly.colors import sequential, n_colors
im... | |
Haskell'
ProgrammingLanguage__Java = 'Programming Language :: Java'
ProgrammingLanguage__JavaScript = 'Programming Language :: JavaScript'
ProgrammingLanguage__Lisp = 'Programming Language :: Lisp'
ProgrammingLanguage__Logo = 'Programming Language :: Logo'
ProgrammingLanguage__ML = 'Programming Language :: ML'
Programm... | |
<reponame>daisyden/lpot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | |
<reponame>muhlba91/pulumi-proxmoxve
# 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, Sequ... | |
replace=False):
time_from = spot - 100
time_to = spot + 100
stick_start_bin = np.zeros([len(astroA.stick_bin)])
stick_start_bin[astroA.indices_d['stick_exact_start']] = 1
stick_signal = stick_start_bin[time_from:time_to]
#Obtain running signal
running_signal = astroA.speed_values[time_from:time_to]
fig_runni... | |
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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... | |
<reponame>duc90/marvin
# !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2017-08-21 17:11:22
# @Last modified by: <NAME>
# @Last Modified time: 2018-02-26 13:46:30
from __future__ import print_function, division, absolute_import
from marvin import con... | |
693 695
1 695 0 0
1 696 1 0 693
1 697 1 0 690
1 698 1 0 687
1 699 1 0 684
1 700 1 0 681
1 701 1 0 678
1 702 1 0 675
1 703 1 0 672
1 704 1 0 669
1 705 1 0 666
1 706 1 0 663
1 707 1 0 660
1 708 1 0 657
1 709 1 0 654
1 710 1 0 651
1 711 1 0 648
1 712 1 0 645
1 713 1 0 642
1 714 1 0 639
1 715 1 0 636
1 716 1 0 633
1 717 1 ... | |
return target_name_list
def get_endpoint_url_for_workload(p_client, workload, timeout=600):
fqdn_available = False
url = ""
start = time.time()
while not fqdn_available:
if time.time() - start > timeout:
raise AssertionError(
"Timed out waiting for endpoint to be available")
time.sleep(.5)
workload_list = p_... | |
<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... | |
<reponame>starofrainnight/ncstyler<gh_stars>0
#!/usr/bin/env python
import argparse
import CppHeaderParser
import re
import sys
import yaml
import copy
import six
import os.path
import traceback
class CppDefine(dict):
def __init__(self):
self["name"] = None
self["parameters"] = []
self["line_number"] = -1
class ... | |
flag
for block in self.blocks.values():
block.behave_as_preset = val
def apply_preset(self, preset, voxel=(0,0,0), block_run=False, presetfile=''):
'''
Given a 'preset' dataset object (an actual dataset object that may
or may not have data in it depending on whether it was saved as a
preset file or dataset fil... | |
<reponame>asanchezyali/optrees<gh_stars>0
from __future__ import annotations
import numpy as np
class Vertex:
def __init__(self, label: str):
self.__label = label
self.__neighbors = dict()
self.__edges = dict()
self.__loops = dict()
def __del__(self):
"""
Delete the vertex.
"""
print(f'Vertex {self.labe... | |
<reponame>SyyBach/slybot
#!/usr/bin/python3
import discord
from discord.ext import commands
import asyncio
#from concurrent.futures import CancelledError
#from json import load as jsonloadfile
#from gc import collect as gc_collect
#from os import makedirs
#from os.path import exists as path_exists, dirname
from rand... | |
= ctx.clean_prefix
correct_usage = f"{p}automod whitelist add/remove @role/#channel"
example = f"{p}automod whitelist add @boosters"
you_idiot = error_embed(
f"{EMOJIS['tick_no']} Invalid Usage!",
f"Correct Usage: `{correct_usage}`\nExample: `{example}`"
)
if choice is None or setting is None:
ctx.command.reset... | |
# encoding: utf-8
from __future__ import unicode_literals
class Commands(object):
def __init__(self, lang):
if lang == "cz":
self.add = "add"
self.answer = "answer"
self.ask = "ask"
self.clear = "clear"
self.comment = "comment"
self.delete = "delete"
self.faq = "faq"
self.help = "help"
self.joke = "joke"
... | |
sequence
"""
if start < 0:
raise ValueError(f'cannot pad DNA with negative start, but start = {start}')
elif start >= length:
raise ValueError(f'cannot pad DNA with start >= length, but start = {start} and '
f'length = {length}')
if len(sequence) > length:
sequence = sequence[start:start + length]
elif len(seq... | |
# Essentials
import numpy
import pandas
import datetime
import random
import time
# Plots
import seaborn
import matplotlib.pyplot as plt
# Models
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor, AdaBoostRegressor, BaggingRegressor
from sklearn.kernel_ridge import KernelRidge
from sklear... | |
_, record = input_tuple
records.append(record)
query.foreach(callback)
assert len(records) == 3
expected = [{'coordinates': [-122.0, 37.5], 'type': 'Point'},
{'coordinates': [-121.8, 37.7], 'type': 'Point'},
{'coordinates': [-121.6, 37.9], 'type': 'Point'}]
for r in records:
assert r['loc'].unwrap() in expect... | |
"""tictac.py
This module defines objects for use in experimenting with reinforcement learning
as well as hand-coded bots for playing tic-tac-toe.
If you want to change what kind of player your bot is
playing against, you need to change some lines
at the very end of the program -- talk to me if you're not
sure what to... | |
{mac} route announced by other EVPN proxy {originator_id.value} with different VTEP: {event.nexthop}" )
WithdrawRoute( state, mac_vrf, cur['vtep'], mac, cur['ip'] )
cur['vtep'] = "tbd" # Mark as withdrawn
else:
logging.warning( "TODO: Compare/update mobility sequence number, even if same VTEP nexthop?" )
else:
lo... | |
t: ErrorType) -> Type:
return t
def visit_any(self, t: AnyType) -> Type:
return t
def visit_void(self, t: Void) -> Type:
return t
def visit_none_type(self, t: NoneTyp) -> Type:
return t
def visit_uninhabited_type(self, t: UninhabitedType) -> Type:
return t
def visit_erased_type(self, t: ErasedType) -> Ty... | |
+ self.highlight_offset[0]
Yc = self.logo_offset[1] + self.highlight_offset[1]
Color(self.highlight_color[0],self.highlight_color[1],self.highlight_color[2],self.highlight_color[3])
for j in range(len(self.radius_list)) :
xc = self.dx_list[j]*self.logo_size + Xc
yc = self.dy_list[j]*self.logo_size + Yc
rc = self.... | |
"""
.. module:: sparse_rep
.. moduleauthor:: <NAME>
.. moduleauthor:: <NAME>
The original SparsePZ code to be found at https://github.com/mgckind/SparsePz
This module reorganizes it for usage by DESC within qp, and is python3 compliant.
"""
__author__ = '<NAME>'
import numpy as np
from scipy.special import voigt_prof... | |
################################################################################
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Softwa... | |
<NAME>, <NAME>, and <NAME>, "Consistent Weighted Sampling", Unpublished technical report, 2010.
Parameters
-----------
repeat: int, default: 1
the number of repeating the algorithm as the part of the seed of the random number generator
Returns
-----------
fingerprints_k: ndarray, shape (n_instances, dimension_nu... | |
import sys, itertools, os
from collections import deque
ACCEPT = 'aceita'
STATES = 'estados'
INITIAL = 'inicial'
TRANSITIONS = 'transicoes'
operations = ['-u','-i','-d','-s','-c','-m']
OP_UNION = operations[0]
OP_INTERSECTION = operations[1]
OP_DFACONVERSION = operations[2]
OP_STAR = operations[3]
OP_COMPLEMENT = ope... | |
<filename>scripts/scriptmaker.py
#! /bin/python3
## imports
import sys, os, getopt
import re, json
import shutil
import copy
from collections import defaultdict, namedtuple
from datetime import datetime
import pandas as pd
##############################################################################################... | |
All tests passed:
return True
def is_in_interfaces(self, s):
"""
Check whether ports comprised by a selector are in the stored interfaces.
Parameters
----------
s : str or unicode
Port selector.
Returns
-------
result : bool
True if the comprised ports are in any of the stored interfaces.
"""
try:
# ... | |
<gh_stars>10-100
#!/usr/bin/env python3
"""
Get read depth over breakpoints.
An SV has 3 breakpoints. Two are on one contig and one is on another.
* DEL: 2 breakpoints on reference, 1 on the local assembly.
* INS: 1 breakpoint on reference, 2 on the local assembly.
For the purposes of this script, the two breakpoint... | |
"<NAME>", "Y<NAME>", "Ai Fairouz"],
],
["TRF", ["YU-KI", "DJ KOO"]],
["Amasia Landscape", ["Akico"]],
["Mother Ninja", ["MOTSU", "Akico"]],
["Do As Infinity", ["<NAME>"]],
["siraph", ["Annabel"]],
["kanon x kanon", ["<NAME>"]],
["Aoi Gakuen 3-nin Musume", ["<NAME>", "Yuki Matsuoka", "Yuka Inokuchi"]],
[
"Tenb... | |
<reponame>ammirato/tdid_demo<filename>utils.py
import torch
import torch.nn as nn
from torch.autograd import Variable
import torchvision.models as models
import os
import cv2
import numpy as np
import math
import sys
import h5py
import active_vision_dataset_processing.data_loading.active_vision_dataset as AVD
import a... | |
<gh_stars>10-100
import numpy as np
import weakref
import copy
import collections
from weakref import WeakValueDictionary
# TODO
# - composite exception for constructor
# - resources (new class generated as _silk_types['ResourceX'], where X is name of Silk class)
# elsewhere:
# - update bracketlength macro:
# XArray[s... | |
len(x)
# outputs a data frame assigning each column a title
# IN:
# s F - fileName
# l COL - colNames
# OUT:
# dataFrame DF with content of x
def df(f,col):
x = lol(f)
col_names = {}
for i in range(0,len(x[0,:])):
col_names[col[i]]=x[:,i]
df = pd.DataFrame(col_names)
return df
# returns dir, stm, ext from input... | |
steps, labels = self._xAxisTicker(xEOM)
else:
steps, labels = self._xAxisTicker(xVals)
return steps, labels
def configure(self, data):
self._convertXV(data)
from reportlab.lib.set_ops import union
xVals = reduce(union,map(lambda x: map(lambda dv: dv[0],x),data),[])
xVals.sort()
steps,labels = self._... | |
<reponame>dicomgrid/sdk-python<filename>ambra_sdk/service/entrypoints/generated/webhook.py
""" Webhook.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import AccountNotFound
from ambra_sdk.exceptions.service import CustomNotHash
from ambra_sdk.ex... | |
"""
Link Layer Discovery Protocol
IEEE 802.1AB
DCB eXchange protocol
IEEE 802.1Qaz
"""
import struct
from pypacker import pypacker, triggerlist
from pypacker.pypacker import (mac_str_to_bytes, mac_bytes_to_str,
ip4_str_to_bytes, ip4_bytes_to_str,
ip6_str_to_bytes, ip6_bytes_to_str)
from pypacker.pypack... | |
"id": "5<PASSWORD>",
"username": "Token",
}
response = self.client.post(
"/api/liveregistrations/",
{"email": "<EMAIL>", "should_send_reminders": True},
content_type="application/json",
HTTP_AUTHORIZATION=f"Bearer {jwt_token}",
)
self.assertEqual(response.status_code, 201)
created_liveregistration = LiveRegis... | |
print("Walking the line: ",p1,p2)
hits = [ ['v',v1] ]
# do the search:
# Note that we really need a better equality test here
# hits[-1][1] != v2 doesn't work beac
def obj_eq(a,b):
return type(a)==type(b) and a==b
while not obj_eq(hits[-1][1], v2):
# if we just came from a vertex, choose a new face in the... | |
# We set the population sizes after the split to nu1 and nu2 and the migration rates to m12 and m21
phinr = dadi.Integration.two_pops(phinr, xx, Ts, nu1, nu2, m12=m12, m21=m21)
## calculate the spectrum.
fsnr = dadi.Spectrum.from_phi(phinr, (n1,n2), (xx,xx))
#### Spectrum of low-recombining regions
# phi for the... | |
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright 2018 Cisco and its affiliates
#
# 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
#... | |
width=100, disabled=True
)
self.port_status = bokeh.models.Div(
text="<p><b>port status:</b> disconnected</p>", width=200
)
self.time_column = bokeh.models.Select(
title="time column",
value=timecolumn,
options=[str(tc) for tc in allowed_time_columns],
width=100,
)
self.time_units = bokeh.models.Select(
... | |
# pylint: skip-file
"""
UBC Eye Movement Data Analysis Toolkit
Generic Participant Class
Created on 2011-09-25
@author: skardan
"""
import string
from skgaze.EMDAT.data_structures import *
import skgaze.EMDAT.params as params
from skgaze.EMDAT.Scene import Scene
import skgaze.EMDAT.Recording as Recording
class Part... | |
"""
Global settings - these are loaded then overwritten in hostname specific files
See __init__.py in this dir for details
"""
import os
import socket
from collections import defaultdict
from library.django_utils.django_secret_key import get_or_create_django_secret_key
from library.git import Git
# if certain user... | |
## evolution.py
## <NAME>
from thesis_utils import *
from thesis_defaults import *
from thesis_poincare_utils import *
from thesis_plot_utils import *
class Evolution:
"""
Evolution functions defining a dynamical systems on C^2. Need to specify a __call__ and __str__ method.
"""
def __init__(self, dt = 0.01):
se... | |
from copy import deepcopy
import logging
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy.stats import norm
from sklearn.model_selection import cross_val_predict, KFold, train_test_split
from xgboost import XGBRegressor
from causalml.inference.meta.utils import (check_treatment_vector, check_p_c... | |
<filename>utils/plot_helper.py
# Plotly Graphs
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
from scipy.spatial.distance import pdist, squareform
# ML funcs
from .ml_helper import calculate_cm
# Others
import numpy as np
import pandas as pd
from itertools import chai... | |
<filename>lambdo/Column.py
__author__="<NAME>"
import json
from lambdo.utils import *
from lambdo.resolve import *
from lambdo.transform import *
from lambdo.Workflow import *
from lambdo.Table import *
from lambdo.Column import *
import logging
log = logging.getLogger('lambdo.column')
class Column:
"""
The cla... | |
<filename>codes/models/modules/loss.py<gh_stars>0
import torch
import torch.nn as nn
import math
import numbers
from torch.nn import functional as F
import numpy as np
def LoG(imgHF): #Laplacian of Gaussian
# The LoG operator calculates the second spatial derivative of an image.
# This means that in areas where the... | |
# Copyright (c) 2018-2021 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# 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 ... | |
<filename>ptmcmc.py
import numpy as np
from scipy import interpolate
import matplotlib
from datetime import datetime
from scipy.stats.mstats import mquantiles
import os
from astropy.io import fits
import glob
from parameters import *
import sys
import argparse
from astropy.table import Table
##sys.path.insert(0, 'pytho... | |
# -*- coding: utf-8 -*-
# %% [markdown]
# # 🚀 Snorkel Intro Tutorial: Data Labeling
# %% [markdown]
# In this tutorial, we will walk through the process of using Snorkel to build a training set for classifying YouTube comments as spam or not spam.
# The goal of this tutorial is to illustrate the basic components and ... | |
noisefilters = []
preconditioners = []
for offset_slice, sigmasqs in offset_slices:
nstep = offset_slice.stop - offset_slice.start
filterlen = nstep * 2 + 1
filterfreq = np.fft.rfftfreq(filterlen, self.step_length)
noisefilter = truncate(np.fft.irfft(interpolate(filterfreq, logfilter)))
noisefilters.append(noise... | |
(self.shift_x, "X axis shift of input optic")
if hasattr(self, 'shift_y'):
phdu.header['SHIFTY'] = (self.shift_y, "Y axis shift of input optic")
if hasattr(self, 'rotation'):
phdu.header['ROTATION'] = (self.rotation, "Rotation of input optic, in deg")
hdul = fits.HDUList(hdus=[phdu])
if outname is not None:
ph... | |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required, user_passes_test
from django.db.models import Q, Count
from django.http import HttpResponse, StreamingHttpResponse, HttpRe... | |
given an input.
Arguments:
inp:
the input.
clip:
clips the weights to positive values if set to '+' and to
negatives if set to '-'
save_output:
Whether to save the output in the node.
Returns:
the output of the node.
"""
assert inp is not None or self.from_node[0].output is not None
inp = self.from_node... | |
<reponame>TeamICSTECHNOS/DOCoMETRe
from py4j.clientserver import ClientServer, JavaParameters, PythonParameters;
import sys;
import os;
import numpy;
import io;
import re;
import time;
class DOCoMETRe(object):
#global experiments;
global jvmMode;
def __init__(self, gateway):
self.gateway = gateway;
self.exp... | |
Whether this site is enabled for authentication with Bot Framework.
:param Sequence[str] trusted_origins: List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True.
"""
pulumi.set(__self__, "is_enabled", is_enabled)
pulumi.set(__self__, "is_v1_enabled", is_v1_enabled)
... | |
status = request_status (mac)
nic1 = blade_nic_info (mac)
nics.append (response_category ("NicInfo", status = status, results = [nic1]))
if (check_success (mac)):
status = request_status (set_failure_dict ("Not Present", "Success"))
nic2 = blade_nic_info ()
nics.append (response_category ("NicInfo", status = st... | |
mstart >= wpos + window_radius:
anno_scaled = process_anno(
[[mstart, mend, "black"], [mend, wpos + window_radius, "gray"]],
base=wpos - window_radius,
window_radius=window_radius,
)
else:
anno_scaled = process_anno(
[[wpos - window_radius, mend, "black"], [mend, wpos + window_radius, "gray"],],
base=wpos - wi... | |
iiiIIIII1iIi
if 8 - 8: o0oOOo0O0Ooo * OoO0O00 % IiII / OoooooooOO * ooOoO0o - i11iIiiIii
if 14 - 14: Oo0Ooo . iII111i
if 50 - 50: iIii1I11I1II1
if 48 - 48: Ii1I - o0oOOo0O0Ooo - Oo0Ooo . iIii1I11I1II1
if 1 - 1: i1IIi % OoooooooOO
if 30 - 30: ooOoO0o % I11i
if 4 - 4: oO0o / OoO0O00
if 90 - 90: I11i . IiII / OoO0... | |
<reponame>mrdragonbear/recmetrics
import numpy as np
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
import scipy.sparse as sp
from sklearn.metrics import mean_squared_error
from math import sqrt
import itertools
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
imp... | |
#!/usr/bin/env python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# Getters & Setters for AWS EKS Clusters resource tags
# This class supports the main "resources_tags" class
# Included class & methods
# class - eks_clusters_tags
# method - get_eks_clusters_i... | |
<reponame>sixpi/ProDy
# -*- coding: utf-8 -*-
"""This module defines MSA analysis functions."""
from numpy import all, zeros, dtype, array, char, cumsum
from .sequence import Sequence, splitSeqLabel
from prody import LOGGER
__all__ = ['MSA', 'refineMSA', 'mergeMSA', 'specMergeMSA']
try:
range = xrange
except Name... | |
<reponame>jonasbgood/StreetTreesOfNYC
# -*- coding: utf-8 -*-
"""
@author: Jonas
Created on Fri Apr 23 11:05:04 2021
To do and nice to have:
- start with empty map for faster load?
- Keep zoom and location of user when filter change
- show empty map of nyc when no data selected or keep latest viewer setting
- cre... | |
`T_i \cdot x`, where `T_i` is the `i`-th generator. This is
coded individually for use in ``x._mul_()``.
EXAMPLES::
sage: R.<q> = QQ[]; H = IwahoriHeckeAlgebra("A2", q).T()
sage: T1, T2 = H.algebra_generators()
sage: [H.product_by_generator(x, 1) for x in [T1,T2]]
[(q-1)*T[1] + q, T[2,1]]
sage: [H.product_by_g... | |
<gh_stars>1-10
import netket as nk
import numpy as np
import netket.experimental as nkx
from netket.experimental.operator._fermions_2nd import _convert_terms_to_spin_blocks
from netket.experimental.operator.fermion import destroy, create, number
import pytest
op_ferm = {}
hi = nkx.hilbert.SpinOrbitalFermions(3)
op_fe... | |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_impor... | |
<reponame>cheshire3/cheshire3
# -*- coding: utf-8 -ü-
import os
import re
import types
try:
from zopyx.txng3.ext import stemmer as Stemmer
except ImportError:
Stemmer = None
from cheshire3.baseObjects import Normalizer
from cheshire3.exceptions import (
ConfigFileException,
MissingDependencyException
)
class S... | |
async def handle_messages(self) -> None:
"""
Read messages from the queue. If it matches a pending request to auxin-cli/signal-cli,
set the result for that request. If said result is being rate limited, retry sending it
after pausing. Otherwise, concurrently respond to each message.
"""
metrics_salt = utils.get_s... | |
# -*- coding: utf-8 -*-
"""
/*------------------------------------------------------*
| Spatial Uncertainty Research Framework |
| |
| Author: <NAME>, UC Berkeley, <EMAIL> |
| |
| Date: 07/11/2019 |
*------------------------------------------------------*/
"""
from __future__ import absolute_import, division, print_f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.