input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>10-100
import re
from django.db import models, transaction
from django.utils import timezone
from django.utils.six import iteritems, with_metaclass
from django.utils.translation import ugettext_lazy as _
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.co... | |
<reponame>andreatramacere/jetset
__author__ = "<NAME>"
import matplotlib as mpl
try:
from matplotlib import pyplot as plt
except:
try:
from matplotlib import pylab as plt
except:
try:
import pylab as plt
except:
raise RuntimeError('Unable to import pylab/pyplot from matplotlib')
from matplotlib import... | |
# -*- coding: utf-8 -*-
import datetime as dt
import pydash as _
from . import fixtures
from .fixtures import parametrize
today = dt.date.today()
@parametrize('case,expected', [
(({'name': 'fred'}, {'employer': 'slate'}),
{'name': 'fred', 'employer': 'slate'}),
(({'name': 'fred'}, {'employer': 'slate'}, {'emp... | |
from sqlalchemy.sql.functions import func
from model.db import db
import json
from controller.util import DictToGeoJsonProp,InitFlow,MergeRowsToGeoJson
from controller.style import *
from colour import Color
class LogicTopoBasin():
def FindBasinByID(self,param):
if not "nodeID" in param:
return {"error":"no id para... | |
"""
Wiki core
~~~~~~~~~
"""
from collections import OrderedDict
from io import open
import os
import re
from flask import abort
from flask import url_for
import markdown
import smtplib
from string import Template
from tempfile import mkstemp
from shutil import move
from os import remove
def clean_url(url):
"""
C... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 01 10:00:58 2021
@author: <NAME>
"""
#------------------------------------------------------------------#
# # # # # Imports # # # # #
#------------------------------------------------------------------#
from math import e
import numpy as np
import... | |
>>> result = thread.get()
:param async_req bool
:param str orcid: (required)
:param str put_code: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['orcid', 'put_code'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_da... | |
import os,fortnitepy,datetime,asyncio,sys,json,random
from termcolor import colored
from random import shuffle
from Fortnite.Events import SetCosmetics
CosmeticCommands = ["!SKIN","!BACKPACK","!PICKAXE","!EMOJI","!EMOTE"]
async def SwitchSkins(fnClient,Skins):
for Skin in Skins:
await fnClient.user.party... | |
node_templates = get_dict(topology_template, NODE_TEMPLATES)
for node_template_name, node_template_yaml in node_templates.items():
node_template_type = node_template_yaml.get(TYPE)
merged_node_template_type = self.type_system.merge_node_type(
node_template_type
)
node_template_uml_id = "node_" + normalize_name(no... | |
<gh_stars>0
# BSD 3-Clause License
#
# Copyright (c) 2017, Science and Technology Failities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from io import open
from builtins import map
from builtins import range
from builtins import chr
from builtins import str
from future import standard_library
standard_libr... | |
[
# typed_ast3.Str(s=ET.tostring(node).decode().rstrip()),
# typed_ast3.Num(n=len(node))]
# return [
# typed_ast3.Expr(value=typed_ast3.Call(
# func=typed_ast3.Name(id='print', ctx=typed_ast3.Load()),
# args=args, keywords=[])),
# typed_ast3.Pass()]
# ast_module.FunctionDef, ast_module.AsyncFunctionDef, ast_mo... | |
f"rgb({red}, {green}, {blue})"},
"Colorsource": {"source": "RGB"},
}
message = {
"wire": self.wire_id,
"method": "controlUnit",
"id": unit_id,
"targetControls": target_controls,
}
self.web_sock.send(json.dumps(message))
def set_unit_color_temperature(self, *, unit_id: int, value: int, source="TW"):
"""
S... | |
"""
Displays Agg images in the browser, with interactivity
"""
# The WebAgg backend is divided into two modules:
#
# - `backend_webagg_core.py` contains code necessary to embed a WebAgg
# plot inside of a web application, and communicate in an abstract
# way over a web socket.
#
# - `backend_webagg.py` contains a concr... | |
<reponame>ekjyot07/triNNity-compiler
import math
import numpy as np
from triNNity.util.errors import CompilerError, print_stderr
from triNNity.frontend.graph import IRGraphBuilder, IRNodeMapper
from triNNity.frontend.layers import LayerKind
from triNNity.util.transformers import (DataInjector, DataReshaper, NodeRename... | |
import os
import numpy as np
import torch
import torch.nn as nn
from layer import *
## 네트워크 구축하기
# CycleGAN
# https://arxiv.org/pdf/1703.10593.pdf
class CycleGAN(nn.Module):
def __init__(self, in_channels, out_channels, nker=64, norm='bnorm', nblk=6):
super(CycleGAN, self).__init__()
self.in_channels = in_chann... | |
import argparse
import json
import logging
import os
import sys
import time
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
from paccmann_sets.models.set_matching.rnn import RNNSetMatching
from paccmann_sets.utils.hyperparameters import (
DISTRIBUTION_FUNCTION_FACTORY, LR_SCHEDUL... | |
#!/usr/bin/env python
# encoding: utf-8
# Copyright 2014 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
#
# deploy.py - Deploy the IPDA site into operations
import argparse, sys, logging, os, os.path, re, subprocess, pwd, urllib2, contextlib, tempfile, tarfile, str... | |
<filename>SUAVE/SUAVE-2.5.0/regression/scripts/industrial_costs/industrial_costs.py<gh_stars>0
# industrial_costs.py
#
# Created: Sep 2016, <NAME>
""" regression for industrial costs methods
"""
# ----------------------------------------------------------------------
# Imports
# ---------------------------------------... | |
to disk iallproj",projdisk,iallproj
phiprojmin=phirange/nallprojdisks[projdisk-1]*(iallproj-1)
phiprojmax=phirange/nallprojdisks[projdisk-1]*iallproj
if projrange[0]<phiprojmax and projrange[1]>phiprojmin :
proj_name="TPROJ_D"+str(idisk)+"D"+str(idisk+1)+xx+letter(tc_count)+"_D"+str(projdisk)+"PHI"+letter(iallproj)... | |
= [self.bin2num(s) for s in trajectory[idxatt:-1]]
trajectory = trajectory[:(idxatt + 1)]
if return_attractor:
return trajectory, attractor
else:
return trajectory
def attractor(self, initial):
"""Computes the trajectory starting at ``initial`` until it reaches an attracor (this is garanteed)
Args:
initial ... | |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
Licensed u... | |
<gh_stars>1-10
##############################################################################
#The MIT License (MIT)
#
#Copyright (c) 2018 IBM Corporation, Carnegie Mellon University and others
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation... | |
<reponame>r33did/SkripsiEmosiRNN
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'emg.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
fr... | |
from bezier_utility import *
from triangle import *
from bbw_wrapper import bbw
from itertools import izip as zip
from tictoc import tic, toc
# kEnableBBW = True
kBarycentricProjection = False
def uniquify_points_and_return_input_index_to_unique_index_map( pts, threshold = 0 ):
'''
Given a sequence of N points 'pts... | |
# mypy: ignore-errors
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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 ... | |
<reponame>bio-hpc/metascreener
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
#############################################################################
#
# Author: <NAME>, <NAME>
#
# Copyright: <NAME> TSRI 2000
#
#############################################################################
# $Head... | |
#!/usr/local/sci/bin/python
# PYTHON2.7
#
# Author: <NAME>
# Created: 7 October 2016
# Last update: 7 October 2016
# Location: /data/local/hadkw/HADCRUH2/MARINE/EUSTACEMDS/ANALYSIS_PLOTS/
# GitHub: https://github.com/Kate-Willett/HadISDH_Marine_Build/
# -----------------------
# CODE PURPOSE AND OUTPUT
# --------... | |
from typing import Tuple, Optional, Union
from requests import Response
from requests.exceptions import HTTPError
import pandas as pd
import numpy as np
from logging import Logger
from redata.commons.logger import log_stdout
from redata.commons.issue_request import redata_request
class FigshareInstituteAdmin:
"""... | |
import os
import unittest
import logging
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
#
# CTLungAnalyzer
#
class CTLungAnalyzer(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/bl... | |
# cde.py
import re
from openpyxl import load_workbook
from mipqctool.helpers import edit_distance_f1
from mipqctool.exceptions import CdeDictError
from mipqctool.model.mapping.functions import Replacement
from mipqctool.config import LOGGER
QC_FROM_CDE_NUMERICAL = ['numerical', 'numeric', 'real']
QC_FROM_CDE_INTEGER... | |
= -dSf_dVm.real + diags(Kdp) * dVmf_dVm
# Partials of Pfdp w.r.t. ThetaSh for PST, VSCI and VSCII
dPfdp_dPfsh = -dSf_dPfsh.real
# Partials of Pfdp w.r.t. ma
dPfdp_dQfma = -dSf_dQfma.real
dPfdp_dQtma = -dSf_dQtma.real
dPfdp_dVtma = -dSf_dVtma.real
# Partials of Pfdp w.r.t. Beq
dPfdp_dBeqz = -dSf_dBeqz.real
d... | |
np.array([
filter_convolve(transf_Sj, self.Phi_filters, filter_rot=True)
for transf_Sj in transf_data
])
return utils.rca_format(data)
def cost(self, x, y):
r"""Return cost."""
return 0
class OLD_Learnlets(ProximityParent):
r"""Apply Learnlets denoising.
Parameters
----------
model: str
Which denoising a... | |
<filename>Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/adodbapi/test/adodbapitest.py<gh_stars>1-10
""" Unit tests for adodbapi version 2.4.3"""
"""
adodbapi - A python DB API 2.0 interface to Microsoft ADO
Copyright (C) 2002 <NAME>
This library is free software; you can redistr... | |
tenderIssuedAwardsSum = 0.0
for id,row in companyTenders.items():
tenderIssuedAwardsSum += float(row['koncnavrednost'])
# add tender data
tender_key = row['idizpobrazca']
if tender_key not in issuedTenders:
issuedTenders[tender_key] = {}
issuedTenders[tender_key]['tender'] = []
issuedTenders[tender_key]['winner... | |
kls_all = numpy.concatenate(tuple(kls_list))
p0s_all = numpy.concatenate(tuple(p0s_list))
track(
drv.In(numpy.array([distance], dtype=self.numpy_dtype)),
drv.In(numpy.array([footstep], dtype=self.numpy_dtype)),
drv.In(kls_all),
drv.In(p0s_all),
drv.In(numpy.array([current_element_number], dtype=numpy.int32)),
... | |
import gc
import pytest
import vanilla
import vanilla.message
# TODO: remove
import logging
logging.basicConfig()
@pytest.mark.parametrize('primitive, a', [
('pipe', ()),
('dealer', ()),
('router', ()),
('channel', ()), ])
class TestAbandoned(object):
@staticmethod
def assert_abandoned_sender(sender, check)... | |
"""Joint-density of states calculation."""
# Copyright (C) 2020 <NAME>
# All rights reserved.
#
# This file is part of phono3py.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | |
the mute config was created.
This field is set by the server and will be ignored if provided on
config creation.
description: A description of the mute config.
displayName: The human readable name to be displayed for the mute config.
filter: Required. An expression that defines the filter to apply across
create/u... | |
if len(data) == self.server.send(data, self.peer.address): break
elif _debug and i > 1: print 'Session.flush() socket send error on sessin %u, all data was not sent'%(self.id,)
if not message:
self._writer.clear()
def writeMessage(self, type, data, flowWriter=None):
self._writer.limit = 1181
if not self.failed:
... | |
# 27-05-001-01 Устройство мостовых толщиной 14 см из колотого и булыжного камня по готовому основанию с уплотнением при трех проходах катка
# "27-03-001-01" (рабочие): 552.24 нормо-часа
# "27-03-001-01" (машинисты): 17.53 нормо-часа
'_-Работа на дорожном строительстве (нормо-часов)':552.24 + 17.53,
'Щебень фракции ... | |
gain, integer
# This is the RF gain when starting.
#default_rf_gain = 11
################ Sound Devices. Quisk recognizes eight sound capture and playback devices.
# Playback devices:
# name_of_sound_play Play radio sound on speakers or headphones
# playback_rate The sample rate, normally 48000, 96000 or 192000
# nam... | |
from storage.avl import avlMode as avl
from storage.b import BMode as b
from storage.bplus import BPlusMode as bPlus
from storage.dict import DictMode as diccionario
from storage.isam import ISAMMode as isam
from storage.hash import HashMode as hash
from storage.json import jsonMode as json
from Binary import verify_st... | |
#
# Copyright (c) SAS Institute 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 writi... | |
file: v1.6.1/cuda7.0-k40c/sgeqrf.txt
# numactl --interleave=all ./testing_sgeqrf -N 100 -N 1000 --range 10:90:10 --range 100:900:100 --range 1000:9000:1000 --range 10000:20000:2000
sgeqrf = array([
[ 10, 10, nan, nan, 0.01, 0.00, nan ],
[ 20, 20, nan, nan, 0.04, 0.00, nan ],
[ 30, 30, nan, nan, 0.12, 0.00, nan ],
[... | |
<gh_stars>10-100
import os
import uuid
import yaml
import time
import datetime
import gitdb
import redis_lock
from contextlib import contextmanager
from redis import StrictRedis
from typing import (Any, Dict, List, Optional, Tuple)
from gtmcore.configuration import Configuration
from gtmcore.exceptions import Gigantum... | |
cnt:
for q in g_checkspots:
if PP[q][0] != v: PP[q][0] = PP[q][0] - (PP[q][0] & v)
# update the list of unsolved indices
newS = []
for q in QQ:
if countbits(PP[q][0]) == 1:
newS.append(q)
SS = newS
QQ = listdiff(QQ,SS)
return PP, SS, QQ
def pipe(PP,SS,QQ):
'''
The pipe reduction function:
In every grid ... | |
how='left')
def right_join(left_frame, right_frame, left_on, right_on=None, keep_columns=None):
"""Keeps all data from right frame and any matches in left using the on_columns
Args:
left_frame (`pandas.DataFrame`): The first frame to join
right_frame (`pandas.DataFrame`): The second frame to join on
left_on (st... | |
<gh_stars>0
from collections import namedtuple
import tensorflow as tf
import numpy as np
from .import utils
HParams = namedtuple('HParams',
'batch_size, num_gpus, num_cpus,num_classes, input_dim, weight_decay, '
'momentum, finetune,'
##########################################
'layer_num,net_class,activation_cl... | |
self.use_sdf:
# best_idxs = select_index(idxs_in_batch[valid_boxes], pose_idx[valid_boxes].int()[:, 0],
# bboxes_confidence[valid_boxes])
bboxes_confidence = outputs["pred_logits"][idx][:, 1]
best_idxs = select_index(idxs_in_batch[valid_boxes, None], pose_idx[valid_boxes].int(),
bboxes_confidence[valid_boxes])
s... | |
UCF(0)._rational_()
0
sage: UCF.gen(5)._rational_()
Traceback (most recent call last):
...
TypeError: No conversion of E(5) to the rational field QQ.
"""
if self.is_zero():
return QQ.zero()
elif self.is_rational():
return self.value._monomial_coefficients[(1,0)]
else:
raise TypeError("No conversion of %s t... | |
is not None:
# take as singular value
OPTIONS.debug(2, ".. define word $%x, %d" % (n, n))
assyrec.bytes.append(n & 0xff)
assyrec.bytes.append((n & 0xff00) >> 8)
else:
if stage == 1:
OPTIONS.debug(2, ".. %s cannot be evaluated as sequence of bytes!" % (part))
else:
# more severe
OPTIONS.error(109, "%s cannot b... | |
"""
Creates a hole inside polygon according to defined depth of border
:return: GeoDataFrame
"""
if type(depth) == int:
depth = [depth for i in self.gdf.index]
# Offset shape boundary according to defined depth to find inner boundary
inner = self.gdf.copy()
inner['geometry'] = [geom.buffer(-float(d)) for d,... | |
logL, label='_Shafter+ 2011',
ls=' ', **plotkwargs)
return
def plot_recurrent_novae(timemetric='t2', luminositymetric='Lpk',
plotbands = 'gBVR', ax=None, **plotkwargs):
"""
plot the peak luminosity vs decline time for recurrent novae,
using data from Schaefer 2010
and the fast-recurrence RN from Darnley+ 2014... | |
dot() has decreased or is equal to prev step => one orbit complete. calculate cutoff timer for end of Measurement data
else:
# calculate multiple orbits based on data end
cutoff_timer = cur_timer * QuotientFront
# steps for one orbit
OneOrbitSteps = cur_timer
stopDotProd = True
if DEBUG_MODE:
print("forward cut... | |
import vim
import os
import re
import subprocess
import xml.etree.ElementTree as ET
import signal
from collections import deque
import vimbufsync
vimbufsync.check_version("0.1.0", who="coquille")
#: Pipe used to discuss with coqtop
coqtop = None
#: See vimbufsync ( https://github.com/def-lkb/vimbufsync )
saved_syn... | |
<gh_stars>1-10
# Copyright 2020 DeepMind Technologies Limited. 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 r... | |
<reponame>niallrmurphy/pyvern<filename>abstract_network_device.py
#!/usr/bin/env python
# encoding: utf-8
"""
abstract_network_device.py
These classes attempt to represent various network devices and associated
easily identifiable subsystems in an abstract way.
Think carefully before extending these objects - not th... | |
journal_spec = JournalSpec(id=journal_id, bugout_user_id=request.state.user_id)
update_spec = UpdateJournalSpec(name=update_request.name)
try:
journal = await actions.update_journal(
db_session,
journal_spec,
update_spec,
user_group_id_list=request.state.user_group_id_list,
)
except actions.JournalNotFound:
l... | |
<gh_stars>1-10
# 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! ***
from . import _utilities
import typing
# Export this package's modules as members:
from .access_token import *
from .alp... | |
"""Copyright 2011 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""
__author__="<NAME>"
__version__="2.1.8"
__date__ ="12-Jan-2011 3:39:00 PM"
import ctypes
from ctypes import byref, c... | |
if we can statically identify `categorical_param` as being too
large (for being closed under int32/float casting).
"""
with ops.name_scope(name, values=[categorical_param]):
x = ops.convert_to_tensor(categorical_param, name="categorical_param")
# The size must not exceed both of:
# - The largest possible int32 (s... | |
import argparse
import torch
import torch.nn as nn
import numpy as np
import os
from attention_module_lite import *
from make_tgif import DatasetTGIF
from util import AverageMeter
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def main(args):
torch.manual_seed(1)
### add arguments ###
arg... | |
"""GaussianMLPTaskEmbeddingPolicy."""
# pylint: disable=wrong-import-order
import akro
import numpy as np
import tensorflow as tf
from garage.tf.models import GaussianMLPModel
from garage.tf.policies.task_embedding_policy import TaskEmbeddingPolicy
class GaussianMLPTaskEmbeddingPolicy(TaskEmbeddingPolicy):
"""Gauss... | |
np.random.randint(0, max_steps - 1, size=batch_size)
for env_i, env in enumerate(envs):
obs = env.reset()
check_obs(obs, batch_size, grid_size)
assert_logger_buffer_size(env, n_steps=0)
assert_info(batch_deltas, n_steps, batch_size, p_red_act, p_blue_act,
env, grid_size, max_steps,
p_red_pos, p_blue_pos, c_red_... | |
| self.repeat
def create_LL_data(LLs, offsets, AWGName=''):
'''
Helper function to create LL data vectors from a list of miniLL's and an offset dictionary
keyed on the wf keys.
'''
# Do some checking on miniLL lengths
seqLengths = np.array([len(miniLL) for miniLL in LLs])
assert np.all(
seqLengths <
MAX_LL_... | |
""" 4.4 OAUTH 2 for devices
Applications that run on devices with limited input capabilities
(such as game consoles, video cameras, and printers) can access a
Compliant API on behalf of a user, but the user must have separate
access to a computer or device with richer input capabilities.
The flow is as follows:
... | |
"""
Module providing the survey scheduler.
"""
import os,sys
import copy
import numpy as np
import time
import ephem
import matplotlib.pyplot as plt
import logging
from collections import OrderedDict as odict
import obztak.utils.projector
import obztak.utils.constants
import obztak.utils.ortho
from obztak.utils impo... | |
<reponame>cypher-me/HAS-Qualifier-Challenges
from ctypes import *
X_PROTOCOL = 11
X_PROTOCOL_REVISION = 0
#~ /* Resources */
#~ /*
#~ * _XSERVER64 must ONLY be defined when compiling X server sources on
#~ * systems where unsigned long is not 32 bits, must NOT be used in
#~ * client or library code.
#~ */
#~ ty... | |
<reponame>AuraUAS/aura-core
import struct
# Message id constants
command_ack_id = 10
config_airdata_id = 11
config_board_id = 12
config_ekf_id = 13
config_imu_id = 14
config_mixer_id = 15
config_mixer_matrix_id = 16
config_power_id = 17
config_pwm_id = 18
config_stability_damping_id = 19
command_inceptors_id = 20
comm... | |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import keras
keras.__version__
# # Neural style transfer
#
#
# This notebook contains the code samples found in Chapter 8, Section 3 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python?a_aid=keras&a_bid=76564dff). Note that the ori... | |
import sqlite3
import datetime
import shutil
import os
import ntpath
from os import path
from collections import Counter
test_data = {
"name": "State POS Computer",
"item": "Card Reader",
"purpose": "Handles credit card payments",
"cost": "299.99",
"serial": "12867-9992837-2323683264823",
"date": "2018-08-25",
... | |
<filename>invite.py
import datetime
import re
import discord
from discord.ext import commands
import identifier
from identifier import error_embed_builder, warning_embed_builder, success_embed_builder
from main import InviteMonitor
class Invite(commands.Cog):
"""Manage invites"""
def __init__(self, bot):
self.b... | |
import itertools
import shutil
import subprocess
import sys
from argparse import ArgumentParser
from collections import defaultdict
from distutils import dir_util, spawn
from typing import Dict, List, Pattern, Union
from scripts.git_helpers import checkout_target_tag
from scripts.paths import DRF_SOURCE_DIRECTORY, PRO... | |
"""
Detonation cell size estimation functions, based on the work of Shepherd et al:
http://shepherd.caltech.edu/EDL/PublicResources/sdt/nb/sdt_intro.slides.html
A description of the theory, numerical methods, and applications are described
in the following report:
Numerical Solution Methods for Shock and Detonation ... | |
import re
import sys
import os
'''
# TODO: tripartite verbs (verb is third node) in files:
1659.pislarsaga.bio-aut.conllu (3)
1745.klim.nar-fic.conllu (2)
1790.fimmbraedra.nar-sag.conllu (1)
1791.jonsteingrims.bio-aut.conllu (1)
1985.sagan.nar-fic.conllu (1)
<NAME> 2019
Part of UniTree project for IcePaHC
Text ... | |
import sys
import cv2
import os
import imutils
path_above = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '../..'))
dirpath = path_above+'/Joystick/Images/HUD'
sys.path.append(path_above)
from collections import deque
import numpy as np
from TBotTools import tbt, pid, geometry, pgt
from time import time
imp... | |
""" Utilities to work with data and datasets """
import datetime
import logging
import os
import pickle
from typing import Any, Dict, Optional, Union
import matplotlib.pyplot as plt
import numpy as np
import qcodes
import scipy
from qcodes.data.data_array import DataArray
from qcodes.data.data_set import DataSet, new... | |
all individuals in study.
# MAGIC CREATE OR REPLACE GLOBAL TEMP VIEW ccu013_covid_trajectory_plot_data_tmp AS
# MAGIC SELECT * FROM
# MAGIC (SELECT DISTINCT tab1.person_id_deid, tab1.date, tab1.covid_phenotype, tab2.covid_severity,
# MAGIC (case covid_phenotype
# MAGIC when "01_Covid_positive_test" then 1
# MAGIC wh... | |
#
# This file is part of the chi repository
# (https://github.com/DavAug/chi/) which is released under the
# BSD 3-clause license. See accompanying LICENSE.md for copyright notice and
# full license details.
#
import copy
import myokit
import myokit.formats.sbml as sbml
import numpy as np
class MechanisticModel(obj... | |
<gh_stars>0
"""Script that contains all functions which load WD entities
"""
import datetime
import re
import time
from pathlib import Path
from typing import Callable, Dict, Iterator, List, Optional, Set
from urllib.error import HTTPError
from SPARQLWrapper import SPARQLWrapper
from data_extraction import map_wd_att... | |
samesign ( a.fx , c.fx ) : return c , b ## RETURN
elif samesign ( b.fx , c.fx ) : return a , c ## RETURN
return c , c
# =============================================================================
## try to find next approximation using Aitken delta-squared process
# @code
#
# xcurr , xm1 , xm2 = ...
# r = ait... | |
"""pbt main API"""
import os
import imp
import yaml
from urllib.request import urlretrieve
import logging
import xdg.BaseDirectory
from pbt import pbt_util
class PbtError(Exception):
"""pbt base exception, all pbt exceptions inherit from this one, useful
to catch this one to catch pbt specific errors only"""
pas... | |
'noun', 'a2', mingot],
# octavo nivel
['abarcar', 'noun', 'a2', mingot],
['absolutamente', 'adverb', 'a2', mingot],
['absorber', 'verb', 'a2', mingot],
['absurdo', 'noun', 'a2', mingot],
['abundar', 'verb', 'a2', mingot],
['aburrido', 'adjective', 'a2', mingot],
['acarrear', 'verb', 'a2', mingot],
['acelerar', 'verb'... | |
above the redirected package would break (since they'd
# see the redirected ancestor package contents instead of the package where they actually live).
if redirect:
# FIXME: wrap this so we can be explicit about a failed redirection
self._redirect_module = import_module(redirect)
if explicit_redirect and hasattr(s... | |
'ASTSelectAs',
tag_id=5),
Field(
'select_list',
'ASTSelectList',
tag_id=6,
field_loader=FieldLoaderMethod.REQUIRED),
Field(
'from_clause',
'ASTFromClause',
tag_id=7),
Field(
'where_clause',
'ASTWhereClause',
tag_id=8),
Field(
'group_by',
'ASTGroupBy',
tag_id=9),
Field(
'having',
'ASTHaving',
tag_i... | |
0], # U H
[3, 2, 14, 14, 6, 0, 1, 0, 0, 0, 0, 32, 0, 31, 1, 8, 0, 19, 44, 64, 1, 4, 0, 2, 0, 3], # U I
[1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0], # U J
[1, 0, 0, 1, 12, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0], # U K
[136, 4, 11, 11, 46, 14, 7, 0, 35, 0, 10... | |
capacity)
@jit(
[
uintp(
TreeClassifierType,
intp,
uintp,
boolean,
boolean,
uintp,
float32,
uint8,
float32,
uintp,
uintp,
float32,
float32,
uintp,
uintp,
uintp,
uintp,
float32,
boolean,
optional(uint8[::1]),
uint8,
),
uintp(
TreeRegressorType,
intp,
uintp,
boolean,
boolean,
uintp,
floa... | |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | |
<gh_stars>0
#!/usr/bin/env python
#
# Copyright 2014 Scalyr 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 applicab... | |
<filename>diplomacy_research/models/policy/token_based/adapter.py<gh_stars>10-100
# ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated document... | |
label='input data')
>>> create_figure_ppt_callback(fig=10, title='test')
>>> plt.show()
"""
if fig is None:
fig = plt.gcf().number
plt.figure(fig)
ax = plt.gca()
ppt_axis = plt.axes(position, label=f'figure_ppt_callback_axis {uuid.uuid1()}')
ppt_button = Button(ppt_axis, 'ppt')
ppt_axis._button = ppt_button
... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
Created on Tue Dec 15 14:39:35 2020
@author: alfred
references:
(pyserial)
> https://pythonpedia.com/en/tutorial/5744/python-serial-communication-pyserial-
> https://pyserial.readthedocs.io/en/latest/pyserial.html
(plotting)
> https://www.youtub... | |
<reponame>CloudVE/pyeventware<filename>pyeventsystem/interfaces.py
from abc import ABCMeta
from abc import abstractmethod
from abc import abstractproperty
class EventDispatcher(object):
__metaclass__ = ABCMeta
@abstractmethod
def observe(self, event_pattern, priority, callback):
"""
Register a callback to be i... | |
from collections import defaultdict
from typing import Dict, List, Optional
import re
import sys
try:
# TODO: Rewrite this module to use ldap3 which gets installed in rootless installs too.
import ldap
except ModuleNotFoundError:
print("""\
*** ldap module unavailable; this comes from "python-ldap" which is only in... | |
<reponame>OliviaNabbosa89/Disaster_Responses
"""
Module for formatting output data in HTML.
"""
from textwrap import dedent
from typing import IO, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast
from pandas._config import get_option
from pandas._libs import lib
from pandas import MultiIn... | |
IPatch = lambda: interp.L2ProjectionPatchMatrix(patch, boundaryConditions)
aPatches = aFine_Constructor(patch)
aPatch = _construct_aFine_from_mu(aPatches, aFineCoefficients, mu)
correctorsList = lod.computeBasisCorrectors(patch, IPatch, aPatch)
csi = lod.computeBasisCoarseQuantities(patch, correctorsList, aPatch)
... | |
# Copyright (c) 2020
# Author: xiaoweixiang
from __future__ import absolute_import, unicode_literals
import io
import os
import sys
import warnings
import functools
from collections import defaultdict
from functools import partial
from functools import wraps
from importlib import import_module
from distutils.errors ... | |
set use the command <b>list-breakpoints</b>.
""", filename="/mp/simics-3.0/src/core/common/commands.py", linenumber="522")
new_command("cycle-break", cycle_break_cmd,
[arg(obj_t('processor', 'processor'), "cpu-name", "?"),
arg(int_t, "cycles")],
alias = "cb",
short = "set cycle breakpoint",
namespace_copy = ("pro... | |
"""
views.py - xmlrpc request manager
Author
<NAME> <<EMAIL>>
License
Copyright (c) 2010-2012 Massachusetts Institute of Technology.
MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
"""
from base import annotations, doc_analytics
import json, sys, datetime, time
from base imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.