input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
c in node:
repl_super(node, c, node.parents[0], gets, sets, methods)
traverse(result, ClassNode, visit)
flatten_statementlists(result, typespace)
def expand_requirejs_class(typespace, cls):
node = FunctionNode(cls.name, 0)
params = ExprListNode([])
slist = StatementList()
vars = [];
cls_scope... | |
off with this setting
self.offhour = self.conf.get_int("schedule", "offhour") # Use 24 hour time. Set hour to turn off display
self.offminutes = self.conf.get_int("schedule", "offminutes") # Set minutes to turn off display
self.onhour = self.conf.get_int("schedule", "onhour") # Use 24 hour time. Set hour to turn on ... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | |
from random import choice
from copy import deepcopy
from game_data import GameData
from agents import Agent
import numpy as np
import random
import pickle
import pandas as pd
class IsaacAgent(Agent):
def __init__(self, max_time=2, max_depth=300):
self.max_time = max_time
self.max_depth = max_depth
# self.heuris... | |
"""Generated message classes for cloudbuild version v1.
Builds container images in the cloud.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
from apitools.base.py import extra_types
package =... | |
paths = []
# Add in starting point.
paths.append(([AtomImage(self.atom, [0, 0, 0])], 1.0))
# Increment until desired shell.
for step in range(shell):
# Get the new list.
new_paths = []
# For each current path.
for path in paths:
# Get last atom in current path.
last_step = path[0][len(path[0]) - 1]
# Get eac... | |
i get something by merging with the previous component?
if len(composingElements) > 0:
tmp,tmp2 = analyzeByParticle([composingElements[-1] + '_' + splitp], species)
if tmp != [] and tmp2 != []:
flag = False
splitp = composingElements[-1] + '_' + splitp
composingElements.pop()
closestList = tmp
localEquivalenceT... | |
#!/usr/bin/env python3
import os
import sys
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pandas as pd
import seaborn as sn
import column_names as cols
file_formats = ["pdf", "svg"]
def save(name):
if not os.path.isdir("figs"):
os.mkdir("figs")
for fmt in file_formats:
plt.savefig(
"figs/... | |
from abc import ABC, abstractmethod
import numpy as np
import cv2
class PoseEstimator(ABC):
"""
Abstract base class for pose estimators decoding the NN results.
Provides a common interface for all decoders. Specifically provides:
- get_input_frame method to convert an arbitrary image into the right
size/shape ... | |
= {
'Elite': levelSwitchE.get(self.level),
'Common': levelSwitchC.get(self.level)
}
return typeSwitch.get(self.unitType)
def MageAttributes(self):
levelSwitchE = {
1: self.setAttributes([4,1,3,3,1,1,0,0,0]),
2: self.setAttributes([4,1,3,3,1,1,0,0,0]),
3: self.setAttributes([5,1,3,3,2,1,0,0,0]),
4:... | |
# Copyright 2018 PayTrace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
<gh_stars>0
"""
This module contains the class SRacos, which is the sequential version of Racos (a classification based optimization algorithm).
Author:
<NAME>
Updated by:
<NAME>
"""
import time
import numpy as np
from zoopt.algos.opt_algorithms.racos.racos_classification import RacosClassification
from zoopt.al... | |
self._diagnostics.append(
Diagnostic(
range=value.range(),
message=f"Imported library '{value.name}' contains no keywords.",
severity=DiagnosticSeverity.WARNING,
source=DIAGNOSTICS_SOURCE_NAME,
)
)
elif isinstance(value, ResourceImport):
if value.name is None:
raise NameSpaceError("Resource setting requires v... | |
<gh_stars>1-10
# fbdata.models
# PYTHON
from datetime import timedelta
# DJANGO
from django.conf import settings
from django.core.paginator import Paginator
from django.db import models
# DJANGO FACEBOOK
from django_facebook.models import FacebookProfile
# FBDATA
from .fields import IntegerListField
from .utils imp... | |
inputs=[x, y],
outfeed_queue=outfeed_queue,
accumulate_outfeed=True)
with ops.device("/device:IPU:0"):
pipeline = ipu_compiler.compile(my_net, inputs=[1.0, 2.0])
utils.move_variable_initialization_to_cpu()
outfed = outfeed_queue.dequeue()
sess.run(variables.global_variables_initializer())
sess.run(pipeline)... | |
order, e.g.: 1. on one hand,
listing docs created by the user, sorted by the created time ascending
will have undefinite expiration because the results cannot change while
the iteration is happening. This cursor would be suitable for long term
polling. 2. on the other hand, listing docs sorted by the last modified
... | |
<reponame>vst/defx
#!/usr/bin/env python3.6
"""
Copyright 2017 <NAME> <<EMAIL>>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditi... | |
generalize this function to gray scale, black/white image, it does not make any sense for
non RGB image. if you look at their MNIST examples, the mean and stddev are 1-dimensional
(since the inputs are greyscale-- no RGB channels).
"""
if self.blob.dtype == np.uint8 and self.blob.ndim == 3:
blob = (self.blob / 2... | |
value = 'Rn2x2',
texname = '\\text{I43x22}')
I43x33 = Parameter(name = 'I43x33',
nature = 'internal',
type = 'complex',
value = 'Rn3x3',
texname = '\\text{I43x33}')
I44x33 = Parameter(name = 'I44x33',
nature = 'internal',
type = 'complex',
value = 'Rn3x3*complexconjugate(ye3x3)',
texname = '\\text{I44x33}')
... | |
<filename>pysiaf/utils/rotations.py<gh_stars>10-100
"""A collection of basic routines for performing rotation calculations.
Authors
-------
<NAME>
<NAME>
"""
from __future__ import absolute_import, print_function, division
import copy
import numpy as np
import astropy.units as u
from astropy.modeling.rotations imp... | |
<reponame>hendrikdutoit/beetools<gh_stars>0
'''Tools for Bright Edge eServices developments & projects
Designed for the use in the Bright Edge eServices echo system. It defines
methods and functions for general use purposes.
Archiver creates an archive of the key project files, print coloured messages
to console with... | |
ip_sec_vpn_service: :class:`com.vmware.nsx_policy.model_client.IPSecVpnService`
:param ip_sec_vpn_service: (required)
:rtype: :class:`com.vmware.nsx_policy.model_client.IPSecVpnService`
:return: com.vmware.nsx_policy.model.IPSecVpnService
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable`
Servi... | |
# 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, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... | |
<filename>pyGPGO/covfunc.py
import numpy as np
from scipy.special import gamma, kv
from scipy.spatial.distance import cdist
default_bounds = {
'l': [1e-4, 1],
'sigmaf': [1e-4, 2],
'sigman': [1e-6, 2],
'v': [1e-3, 10],
'gamma': [1e-3, 1.99],
'alpha': [1e-3, 1e4],
'period': [1e-3, 10]
}
def l2norm_(X, Xstar):
... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @namespace pyfortified_requests
import logging
import csv
import datetime as dt
import gzip
import http.client as http_client
import io
import ujson as json
import os
import re
import time
import requests
from pyfortified_logging import (LoggingFormat, LoggingOutput)
f... | |
<reponame>reinforcementdriving/cvat
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import io
import os
import os.path as osp
import random
import shutil
import tempfile
import xml.etree.ElementTree as ET
import zipfile
from collections import defaultdict
from enum import Enum
from glob import... | |
"""
--------------------------
OFFLINE OPTIMAL BENCHMARK:
---------------------------
It uses IBM CPLEX to maximise the social walfare of a current network structure and task list by solving the current environment given the usual problem restrictions.
This represents the upper bound of the social walfare.
In order ... | |
<reponame>mclark58/kb_PRINSEQ<filename>test/kb_PRINSEQ_server_test.py<gh_stars>0
# -*- coding: utf-8 -*-
import os # noqa: F401
import shutil
import time
import unittest
from configparser import ConfigParser # py3
from os import environ
import requests
from installed_clients.DataFileUtilClient import DataFileUtil
fro... | |
= \
self._create_instance_with_personality_json(None)
self.assertEquals(response.status_int, 202)
response = json.loads(response.body)
self.assertTrue('adminPass' in response['server'])
self.assertEqual(16, len(response['server']['adminPass']))
def test_create_instance_admin_pass_xml(self):
request, response, d... | |
<reponame>oliviertilmans/flowcorder
"""
Classes to create and start a daemon process.
This module defines the following classes and compositions:
* Daemon: the base class to create a daemon.
|
| is made of
v
* DaemonComponent: factories that will create the components of the daemon,
see the Component class for an ... | |
is not None:
try:
getattr(oldLink, signal).disconnect(slot)
oldLink.sigResized.disconnect(slot)
except (TypeError, RuntimeError):
## This can occur if the view has been deleted already
pass
if view is None or isinstance(view, str):
self.state['linkedViews'][axis] = view
else:
self.state['linkedViews'][axis]... | |
{limits}
:param shape: {shape}
:param binby: {binby}
:param limits: {limits}
:param shape: {shape}
:param sort: return mutual information in sorted (descending) order, and also return the correspond list of expressions when sorted is True
:param selection: {selection}
:param delay: {delay}
:return: {return_stat... | |
the superstate.
if Hsm.exit(me, me.state) == Hsm.RET_HANDLED:
Hsm.trig(me, me.state, Signal.EMPTY)
t = me.state
# Step into children until we enter the target
for st in reversed(path[:path.index(t)]):
Hsm.enter(me, st)
@staticmethod
def init(me, event = None):
"""Transitions to the initial state. Follows any... | |
<filename>eagle/eagle.py
import argparse
import sys
from datetime import datetime
from .groups import add_group, delete_group, soft_delete_group
from .meta import CONFIG
from .storage import get_storage
from .tasks import add_task, delete_task, edit_task, prune
def clear():
"""
Clears todo list - removes all tasks... | |
iraf
from numpy import array, compress
import string
import re
import sys
import os
from ntt import delete
from ntt.util import readhdr, readkey3, delete
import ntt
hdr = readhdr(img)
_ra = readkey3(hdr, 'RA')
_dec = readkey3(hdr, 'DEC')
iraf.imcoords(_doprint=0)
iraf.astcat(_doprint=0)
toforget = ['imco... | |
word[1] == "r" :
toGuess = toGuess[:1] + "r" + toGuess[2:]
if word[2] == "R" or word[2] == "r" :
toGuess = toGuess[:2] + "r" + toGuess[3:]
if word[3] == "R" or word[3] == "r" :
toGuess = toGuess[:3] + "r" + toGuess[4:]
if word[1] != "R" and word[1] != "r" and word[2] != "R" and word[2] != "r" and w... | |
<filename>src/Charsiu.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import torch
from itertools import groupby
sys.path.append('src/')
import numpy as np
#sys.path.insert(0,'src')
from models import Wav2Vec2ForAttentionAlignment, Wav2Vec2ForFrameClassification, Wav2Vec2ForCTC
from utils import seq2dura... | |
tabela 'cargos'
cargoID = db.Column(db.Integer, db.ForeignKey('cargos.id'))
# Relação de medidores de um usuário
medidores = db.relationship('Medidor', backref='usuario', lazy='dynamic')
### Métodos ###
# Criar o primeiro administrador, caso ainda não haja um
@staticmethod
def criar_administrador():
if not ... | |
<filename>fortiosapi/fortiosapi.py
#!/usr/bin/env python
# Copyright 2015 Fortinet, 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/lice... | |
<gh_stars>10-100
# Author: <NAME> <<EMAIL>> <<EMAIL>>
# License: BSD 3 clause (C) 2017
# As of 02 July 2017 those implementations are available here:
# https://lvdmaaten.github.io/tsne/
# https://github.com/scikit-learn/scikit-learn/tree/master/sklearn/manifold
# - <NAME>
# References:
# [1] <NAME> and <NAME>. Visua... | |
0.6718750,
0.6835938, 0.6914062, 0.7031250, 0.7148438, 0.7265625, 0.7343750,
0.7460938, 0.7578125, 0.7656250, 0.7773438, 0.7851562, 0.7929688,
0.8046875, 0.8125000, 0.8203125, 0.8320312, 0.8398438, 0.8476562,
0.8554688, 0.8632812, 0.8710938, 0.8789062, 0.8867188, 0.8945312,
0.8984375, 0.9062500, 0.9140625, 0.92187... | |
If the queryset is being used for a list of comment resources,
then this can be further filtered by passing ``?interdiff-revision=``
on the URL to match the given interdiff revision, and
``?line=`` to match comments on the given line number.
"""
q = super(FileDiffCommentResource, self).get_queryset(
request, revi... | |
the socket is closed) only works for
# sockets. On other platforms it works for pipes and sockets.
if is_socket or (is_fifo and not IS_AIX):
loop.add_reader(fileno, self._read_ready)
except:
self.close()
raise
return self
def __repr__(self):
"""Returns the ``UnixWritePipeTransport``'s representation."""
r... | |
network_name = f"{container.full_name}_network"
if container.name == 'router':
continue
# We are creating a new subnet with a new subnet number
subnet += 1
# We maintain a map of container_name to subnet for use by the router.
container_to_subnet[container.name] = subnet
actual_name = '{0}_Actual'.format(contain... | |
<filename>geomstats/geometry/special_orthogonal.py
"""The special orthogonal group SO(n).
i.e. the Lie group of rotations in n dimensions.
"""
import geomstats.backend as gs
from geomstats.geometry.embedded_manifold import EmbeddedManifold
from geomstats.geometry.general_linear import GeneralLinear
from geomstats.geo... | |
\
% self.ioctx.name)
def __iter__(self):
return self
def next(self):
"""
Get the next object name and locator in the pool
:raises: StopIteration
:returns: next rados.Ioctx Object
"""
key = c_char_p()
locator = c_char_p()
nspace = c_char_p()
ret = run_in_thread(self.ioctx.librados.rados_nobjects_list_nex... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import xlrd
import sys,csv
# import codecs
from datetime import date,datetime
from pyh import *
page = PyH('JIRA看板')
#默认只打印3列
PRT_COL = 3
NEW_LINE = ''
SPRINT_DATE = '0901'
class Utils():
def __init__(self):
self.p = 0;
def add(self,param):
self.p += param
return... | |
from random import shuffle
from full_brevity import *
from relational import *
from incremental import *
from util import generate_phrase, generate_phrase_rel
if __name__ == '__main__':
# This data is based on the drawer pictures from Vienthen and Dale (2006)
# Drawers are numbered (oddly) from left to right on even... | |
for _ in range(not_matching_col_count + matching_col_count):
print("N")
print(not_matching_col_words)
mod_word = not_matching_col_words[0][0]
print(mod_word)
self._col_data.append((self.col_names[col_index], make_transformer(affix_type, mod_word)))
not_matching_col_words.pop(0)
not_matching_col_words = [(data[0]... | |
import discord
import asyncio
import random
import pekofy as peko
import replies
# import os - use this if you want to use the for filename method instead of the bot.load_extension
import datetime
from discord.ext import commands, tasks
from itertools import cycle
from discord.ext.commands import CommandNotFou... | |
<filename>subaligner/utils.py
import os
import subprocess
import pysubs2
import requests
import shutil
import cchardet
from pycaption import (
CaptionConverter,
SRTWriter,
SRTReader,
DFXPWriter,
DFXPReader,
SAMIWriter,
SAMIReader,
)
from typing import Optional, TextIO, BinaryIO, Union, Callable, Any, Tuple
from... | |
OF INPUT FILES']['clean']
paramDict['num_cores'] = configObj.get('num_cores')
paramDict['rules_file'] = configObj['rules_file'] if configObj['rules_file'] != "" else None
log.info('USER INPUT PARAMETERS for Separate Drizzle Step:')
util.printParams(paramDict, log=log)
paramDict['logfile'] = logfile
# override ... | |
= "Folder Path").grid(row = 3, column = 0, padx = 10 , pady = 10)
tk.Label(self, text = "Saving Path").grid(row = 4, column = 0, padx = 10 , pady = 10)
tk.Label(self, text = "One Min Matrix File").grid(row = 5, column = 0, padx = 10 , pady = 10)
# Single Bin File Analysis
ttk.Button(self, text="Calliper & Movemen... | |
shape (n_leads, seq_len), or (seq_len,)
class_map: dict,
class map, mapping names to waves to numbers from 0 to n_classes-1,
the keys should contain "pwave", "qrs", "twave"
fs: real number,
sampling frequency of the signal corresponding to the `masks`,
used to compute the duration of each waveform
mask_format: s... | |
from_json_dict(d):
sbp = SBP.from_json_dict(d)
return MsgBaselineNED(sbp, **d)
def from_binary(self, d):
"""Given a binary payload d, update the appropriate payload fields of
the message.
"""
p = MsgBaselineNED._parser.parse(d)
for n in self.__class__.__slots__:
setattr(self, n, getattr(p, n))
def to_bin... | |
metaseq(self.interleaved_wmma_shape[0], 1)
self.lds_iterations = metaseq(
warp_tile_shape_km[1] // self.lds_shape[0], 1)
self.stride_in_access = tile_shape_km[1] // self.element_per_acc
self.add_member("pointer_", self.const_access_pointer)
self.add_member("byte_offset_, wmma_k_index_", self.index_t)
# cudasim m... | |
np.zeros((nr_mol - 1, 3))
for i, index in enumerate(to_be_added):
configset_cog[i, :] = resgroup[index].atoms.center(None)
while nr_added < nr_mol:
# Find indices of nearest neighbours of a) res in micelle
# (imin) and b) res not yet in micelle (jmin). Indices
# w.r.t. resgroup
imin, jmin = self._unwrap_ns(
re... | |
<reponame>davidbradway/openclto
# -*- coding: utf-8 -*-
"""
This module implements a simple interface to UspPlugin DLLs
The basic class in the module is UspPlugin which implements an API to
UspPlugin DLL.
The API functions are:
UspPlugin
GetPluginInfo
Initialize
InitializeCL
Cleanup
SetParams
SetInBufSize
Pre... | |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
import time
import ctypes
import tempfile
import numpy
import h5py
from pyscf import lib
from functools import reduce
from pyscf.lib import logger
from pyscf import gto
from pyscf import ao2mo
from pyscf.cc import ccsd
from pyscf.cc import _ccsd
from pyscf.cc import... | |
<gh_stars>1-10
"""
:Author: <NAME> <<EMAIL>>
Module implementing non-parametric regressions using kernel methods.
"""
import numpy as np
import scipy
from scipy import linalg
import kde
import kernels
import py_local_linear
from compat import irange
from cyth import HAS_CYTHON
local_linear = None
def useCython():
... | |
a maximum of 32. The password can contain letters, numbers, and special characters (!/@#$%^&+=_). The password must contain at least one lower case letter, one upper case letter, one number, and one special character. When no CHEF_DELIVERY_ADMIN_PASSWORD is set, one is generated and returned in the response.
**Attribu... | |
<filename>pyro/util.py
from __future__ import absolute_import, division, print_function
import functools
import numbers
import random
import warnings
from collections import defaultdict
from contextlib import contextmanager
import graphviz
import torch
from six.moves import zip_longest
from pyro.poutine.util import ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Module for xml parsing"""
# Libraries
from lxml import etree
# Modules
import datamodel
from jarvis.shared_orchestrator import (function_inheritance, fun_elem_inheritance,
fun_inter_inheritance, phy_elem_inheritance,
phy_inter_inheritance)
class XmlParser3SE:
def ... | |
# Code adapted from SMP. Add Scheduler
# Implement Logging
import sys
import os
import numpy as np
import torch
import datetime as dt
import matplotlib.pyplot as plt
import time
import torchvision
import random
import seaborn as sns
import pickle
from segmentation_models_pytorch.utils.metrics import IoU
from sklearn.m... | |
<reponame>jdlarsen-UA/LB-colloids<filename>lb_colloids/Colloids/Colloid_Math.py
"""
ColloidMath is the primary mathematics module for Colloid Simulations.
This module contains both Physical and Chemical formulations of colloid forces within a
porous media. The DLVO and ColloidColloid classes contain complex formulation... | |
input: rxn_list_I = list of reaction IDs
# output: rxn_net_O = net reaction (cobra Reaction object)
from cobra.core.Reaction import Reaction
#rxn_net_O = cobra_model_I.reactions.get_by_id(rxn_list_I[0]);
#for r in rxn_list_I[1:]:
# if cobra_model_I.reactions.get_by_id(r).reversibility:
# print r + " is reversibl... | |
# -*- coding: utf-8 -*-
from copy import deepcopy
from functools import lru_cache, partial
from io import FileIO
from json import dumps, loads
from logging import debug, exception, info, warning
from re import findall
from time import sleep, time
from typing import Any, Dict, Generator, List, Optional, Sequence, Tuple
... | |
from Scripts import DataStructures
from src.Miscellaneous import bcolors
import os
import pandas as pd
import numpy as np
import matlab.engine
import matplotlib; matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from glob import glob
from shutil import copyfile
from scipy.signal import savgol_filter
matlab_smo... | |
this before?
# dist_word_idx = list_name.index(last_dist_word) # if list_dist.__len__() > 0 else 0
dist_word_idx = list_name.index(last_dist_word) if list_dist.__len__() > 0 else 0
offset_idx, word_idx, word_idx_offset, composite_token_offset = self.adjust_word_index(
self.analysis_response.name_as_submitted,
self... | |
-self.state_equations.jacobian(self.expec)
self.C_in = simplify(self.state_equations
- self.Gamma0 @ self.endog
+ self.Gamma1 @ self.endogl
+ self.Psi @ self.exog
+ self.Pi @ self.expec)
# Obs Equation
if generate_obs:
self.obs_matrix = Matrix(eye(self.n_obs))
self.obs_offset = Matrix(zeros(self.n_obs))
else... | |
method)
assert url.endswith('GetItemAudioFulfillment')
eq_('<AudioFulfillmentRequest><ItemId>bib id</ItemId><PatronId>patron id</PatronId></AudioFulfillmentRequest>', kwargs['data'])
eq_(200, response.status_code)
eq_("A license", response.content)
def test_fulfill(self):
patron = self._patron()
# This miracl... | |
<filename>PlusBot/bot.py
import ConfigParser
import decimal
import os
import pickle
import re
import praw
from copy import deepcopy
from flair import Flair
from source import Source
from trader import Trader
from util import replace_markdown, create_table_markdown, format_millis_date, parse_markdown, initVariables, get... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Ejercicio del Algoritmo de Colonia de Hormigas
Taller de la PyConEs 2015: Simplifica tu vida con sistemas complejos y algoritmos genéticos
Este script contiene las funciones y clases necesarias para el ejercicio del laberinto.
Este script usa arrays de numpy, aunque... | |
<reponame>anukaal/pywikibot
"""
A window with a textfield where the user can edit.
Useful for editing the contents of an article.
*New in version 6.1:* Python 3.6 or highter is required.
"""
#
# (C) Pywikibot team, 2003-2021
#
# Distributed under the terms of the MIT license.
#
import tkinter
from tkinter import simp... | |
"""AWS Glue Catalog Module."""
# pylint: disable=redefined-outer-name
import itertools
import logging
import re
import unicodedata
from typing import Any, Dict, Iterator, List, Optional, Tuple
from urllib.parse import quote_plus
import boto3 # type: ignore
import pandas as pd # type: ignore
import sqlalchemy # type: ... | |
wrong failing to close?
pass
# try to reconnect a few times
tries = 0
while tries < 3 and not websocket.open:
try:
websocket = await websockets.connect(self.websocket_url)
except websocket_errors:
await asyncio.sleep(2)
tries += 1
self.logs[kind]["end"] = time.time()
logger.info(f"Process exited with {pro... | |
<gh_stars>1-10
#!/usr/bin/env python
"""This script does x.
Example:
Attributes:
Todo:
"""
import os
import sys
import glob
import numpy as np
import pandas as pd
import radical.analytics as ra
def initialize_entity(ename=None):
entities = {'session': {'sid' : [], # Session ID
'session' : [], # RA session obje... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_squared_error
import seaborn as sns
from scipy import stats
import math
def clean_data(df):
"""
INP... | |
<reponame>HBOMAT/AglaUndZufall<filename>zufall/lib/objekte/zufalls_groesse.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# ZufallsGroesse - Klasse von zufall
#
#
# This file is part of zufall
#
#
# Copyright (c) 2019 <NAME> <EMAIL>
#
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may... | |
instruction address
return DDGViewInstruction(self._cfg, self._ddg, key, simplified=self._simplified)
class DDG(Analysis):
"""
This is a fast data dependence graph directly generated from our CFG analysis result. The only reason for its
existence is the speed. There is zero guarantee for being sound or accurate. ... | |
# (c) 2014, <NAME> <<EMAIL>>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible ... | |
# Copyright 2017 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | |
feedback for the task (the type of feedback is different across tasks)
def get_task_feedback(self, dataframe, feedback_type):
"""
gets overall feedback of the task based on the feedback type
Args:
dataframe(pandas df) - response dataframe
feedback_type (str) - feedback type for the task
Returns:
feedback (dict... | |
the Option is performed
between the two sections, RID1 and RID2. If RINC > 0, the
Option is performed among all specified sections (RID1 to RID2
with increment of RINC).
intertype
The type of contact interface (pair-based versus general
contact) to be considered; or the type of contact pair to be
trimmed/unsele... | |
word was a verb to handle auxiliary verbs
if a > 3:
# print('More than 3 consecutive verbs detected in the following sentence: ', nltk_tagged)
a = 0
break
tag_prev = tag
word_prev = word.lower()
elif a >= 1 and (tag[:2] == 'RB' or word.lower() in ['not' , "n't", 't', "'t"]):
a += 1
# if word.lower() in ["n't",... | |
added "custom" validation method from a certain
attribute, avoiding its execution at runtime.
This method should be used carefully and should be considered a secondary
resource for attribute validation.
:type attribute_name: String
:param attribute_name: The name of the attribute that will have
the prov... | |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.1.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # Sentiment Analysis
#
# ## Updating a Model in Sag... | |
<gh_stars>10-100
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate ... | |
<gh_stars>0
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Core\sims4\tuning\serialization.py
# Compiled at: 2020-08-14 01:56:25
# Size of source mod 2**3... | |
than the number of busy bots, but not more than the
# configured maximum and not less than the configured minimum. In order
# to prevent drastic drops, do not allow the target size to fall below 99%
# of current capacity. Note that this dampens scale downs as a function of
# the frequency with which this function r... | |
"enum_values": null,
"fields": [
{
"__class__": "ConfigFieldSnap",
"default_provided": true,
"default_value_as_json_str": "{\\"log_level\\": \\"INFO\\", \\"name\\": \\"dagster\\"}",
"description": null,
"is_required": false,
"name": "config",
"type_key": "Shape.241ac489ffa5f718db6444bae7849fb86a62e441"
}
],
... | |
self.assertEquals(maxz, 5)
for i in range(2,7):
minx, maxx, miny, maxy, minz, maxz, error = instance.get_boundary_index_range_inclusive(i,1)
self.assertEquals(error, 0)
self.assertEquals(minx, 0)
self.assertEquals(maxx, 0)
self.assertEquals(miny, 0)
self.assertEquals(maxy, 0)
self.assertEquals(minz, 0)
self.... | |
from enum import Enum, IntEnum
from math import isfinite
from typing import List, Optional, Union
from pydantic import validator
from geolib.geometry.one import Point
from geolib.models import BaseDataClass
from .soil_utils import Color
class SoilBaseModel(BaseDataClass):
@validator("*")
def fail_on_infinite(cls... | |
_progress_i += 1
if ((_progress_i % _progress_N) == 0):
if (_log_level > SILENT) and ( force or (_log_level < DEBUG ) ):
if (_progress_obj != None):
if (_progress_id == id):
_progress_obj.next(_progress_N)
return True
else:
return False
else:
print('.', end='', flush=True)
return True
return False
def f... | |
o00OooO = "sudo iptables -t nat -C POSTROUTING -o {} -j MASQUERADE"
if ( commands . getoutput ( o00OooO . format ( o00oO0O ) ) != "" ) :
IIiii1 = lisp . lisp_get_loopback_address ( )
if ( IIiii1 ) :
iiI = "sudo iptables -t nat -A POSTROUTING -s {} -j ACCEPT"
os . system ( iiI . format ( IIiii1 ) )
if 14 - 14: OOo... | |
<reponame>vespa-mrs/vespa
# Python Modules.
import copy
import math
# 3rd party stuff
import numpy as np
# Local imports
import vespa.common.rfp_rf_result as rfp_rf_result
from vespa.common.transform_run_exception import TransformRunException
from pylab import *
PI = np.pi
def run(trans_desc):
"""
Stub Summa... | |
<reponame>rlatawiec/fastai<filename>fastai/vision/data.py<gh_stars>0
"Manages data input pipeline - folderstransformbatch input. Includes support for classification, segmentation and bounding boxes"
from ..torch_core import *
from .image import *
from .transform import *
from ..data_block import *
from ..basic_data imp... | |
<reponame>kurli/chromium-crosswalk
# Copyright (c) 2012 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.
import copy
import json
import logging
import os
from collections import defaultdict, Mapping
import svn_constants
im... | |
- m.x2695 - m.x2696 - m.x2697
- m.x2698 - m.x2699 - m.x2700 + m.x3009 == 0)
m.c5 = Constraint(expr= - m.x2701 - m.x2702 - m.x2703 - m.x2704 - m.x2705 - m.x2706 - m.x2707 - m.x2708 - m.x2709
- m.x2710 - m.x2711 - m.x2712 - m.x2713 - m.x2714 - m.x2715 - m.x2716 - m.x2717 - m.x2718
- m.x2719 - m.x2720 - m.x2721 - m.x2... | |
jnp.pi
)
return -0.5 * M - normalize_term
@lazy_property
def covariance_matrix(self):
return jnp.matmul(self.scale_tril, jnp.swapaxes(self.scale_tril, -1, -2))
@lazy_property
def precision_matrix(self):
identity = jnp.broadcast_to(
jnp.eye(self.scale_tril.shape[-1]), self.scale_tril.shape
)
return cho_solv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.