input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import os
import shutil
import sys
import threading
import _thread
import time
import channelpy
import configparser
from aga import Agave
from auth import get_tenant_verify
from channels import ActorMsgChannel, ClientsChannel, CommandChannel, WorkerChannel, SpawnerWorkerChannel
from codes import ERROR, READY, BUSY, C... | |
tn13)
n131 = self.context.mk_or(n60, tn12)
self.nets['A7E_requirements/Enum2'] = n131
# A7E_requirements/Assumption2
self.context.mk_assumption(n131)
# A7E_requirements/AflyUpd
n133 = self.context.mk_number('22', self.context.mk_int8_type())
self.nets['A7E_requirements/AflyUpd'] = n133
# A7E_requirements/ro21 -... | |
Calendar, etc_)": 388,
# "mobile_apps.Corporate portal (MS Sharepoint, Pingboard, etc_)": 389,
# "mobile_apps.Service desk/Help desk (Zendesk, Jira Service Desk, etc_)": 390
# },
# "corporate_mail_server": {
# "corporate_mail_server": 391
# },
# "corporate_suite": {
# "corporate_suite.None": 392,
# "corporate_suite.G S... | |
# Copyright 2021, Blue Brain Project, EPFL
#
# 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... | |
<gh_stars>0
import numpy as np
import sys
import copy
sys.setrecursionlimit(100000)
from numba import njit,jit
from timeit import default_timer as timer
import qcqc
from util import Fgamma,hyp1f1_in_njit
@njit('int64(int64)')
def shell_to_basis(am):
return (am+1)*(am+2)/2
@njit('int64(int64)')
def fact2(n):
if (n <... | |
is not None and 'name' not in already_processed:
already_processed.append('name')
showIndent(outfile, level)
outfile.write('name = "%s",\n' % (self.name,))
if self.deviceset is not None and 'deviceset' not in already_processed:
already_processed.append('deviceset')
showIndent(outfile, level)
outfile.write('devic... | |
bond2params = OrderedDict() # store a tuple with the 2-body bond
# interaction type, and its parameters
# for every type of bond
bond2priority = OrderedDict() # What is the priority of this interaction?
bond2style = OrderedDict() # What LAMMPS bond style (formula)
# is used for a given interaction?
bond_styles = ... | |
#!/usr/bin/env python3
# coding: utf-8
# Author:<NAME> <<EMAIL>>
import warnings
import time
import numpy as np
import re
import random
from random import randint
from ..normalization.normalizer import Normalizer
from ..duplicate_detection.duplicate_detector import Duplicate_detector
from ..outlier_detection.outlier_... | |
# -*- coding: utf-8 -*-
"""
This module contains functions for common path operations used by Maestral.
"""
# system imports
import os
import os.path as osp
import shutil
import itertools
from typing import List, Optional, Tuple
# local imports
from .content_hasher import DropboxContentHasher
def _path_components... | |
import pdb
from typing import Tuple, Optional
import numpy as np
import optuna
import torch
from mujoco_py import load_model_from_xml, MjSim
from scipy.optimize import minimize
from torch import Tensor
from dair_pll import state_space
from dair_pll.integrator import StateIntegrator
from dair_pll.system import System
... | |
<reponame>TheDemonLife/Lineage2Server-Interlude
# Made by Mr. Have fun! Version 0.2
import sys
from ru.catssoftware.gameserver.model.quest import State
from ru.catssoftware.gameserver.model.quest import QuestState
from ru.catssoftware.gameserver.model.quest.jython import QuestJython as JQuest
qn = "219_TestimonyOfFate... | |
<filename>ibrnet/data_loaders/spaces_dataset.py
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | |
the initial floating species concentrations
#
#Example: vec = rrPython.getFloatingSpeciesInitialConcentrations()
#
#\return Returns a string containing the intial concentrations
def getFloatingSpeciesInitialConcentrations():
values = rrLib.getFloatingSpeciesInitialConcentrations(gHandle)
return rrVectorToPythonArray ... | |
return _snap.TIntIntVH_GetI(self, *args)
def Gen(self, *args):
"""
Gen(TIntIntVH self, int const & ExpectVals)
Parameters:
ExpectVals: int const &
"""
return _snap.TIntIntVH_Gen(self, *args)
def Clr(self, *args):
"""
Clr(TIntIntVH self, bool const & DoDel=True, int const & NoDelLim=-1, bool const & ResetD... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import re
import time
import traceback
import logging
import six
import copy
import hashlib
from checkmate.helpers.issue import group_issues_by_fingerprint
from checkmate.management.helpers import (filter_filenames_by_analyzers,
filter_filena... | |
# 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, overload
from .. import... | |
import csv
import math
import os
import sys
from itertools import islice
from os import path
import numpy as np
import tensorflow as tf
from PIL import Image
TRAINING_SHARDS = 60
VALIDATION_SHARDS = 30
TRAIN_DIRECTORY = 'train'
VALIDATION_DIRECTORY = 'validation'
# List of folders for training, validation and test.
... | |
]['FF'] = 26880
CR_AREA[4][4 ]['FF'] = 25920
CR_AREA[5][4 ]['FF'] = 26880
CR_AREA[4][5 ]['FF'] = 27840
CR_AREA[5][5 ]['FF'] = 28800
CR_AREA[4][6 ]['FF'] = 27840
CR_AREA[5][6 ]['FF'] = 28800
CR_AREA[4][7 ]['FF'] = 25920
CR_AREA[5][7 ]['FF'] = 26880
CR_AREA[4][8 ]['FF'] = 25920
CR_AREA[5][8 ]['FF'] = ... | |
<reponame>ermongroup/pirank<gh_stars>10-100
from sacred import Experiment
from sacred.stflow import LogFileWriter
from sacred.observers import SqlObserver, MongoObserver
# Uncomment if using GPU
# import setGPU
from tfdeterminism import patch
patch()
import random
import numpy as np
import tensorflow as tf
import tenso... | |
: href:task,
"job_instance" : href:job_instance
}
}
"""
@blueprint.route("/root/<string:m_wf_id>/workflow/<string:wf_id>/job")
def get_workflow_jobs(username, m_wf_id, wf_id):
"""
Returns a collection of Jobs.
:query int start-index: Return results starting from record <start-index> (0 indexed)
:query int max-... | |
KeyError:
pass
if self.isThreatNoneForEntireStorm:
return statements
if self._tr is not None:
specialStatements = self._specialImpactsStatements()
if self._tr in specialStatements.keys():
if self._tr in ["recovery", "hunker down"] and self.isThreatNoneForEntireStorm:
return statements
else:
return specialSt... | |
from the future. For exmaple, for the scheme
:math:`x_{t+1} - x_{t-1}`, at time :math:`t`, then the new assigned time value
is `t+1`. See also :py:meth:`.TSCAccessor.time_derivative`.
Parameters
----------
zeta
A scalar between :math:`[0, 1)` that controls the angular influence . The
weight from one point to a... | |
"custom": False,
"facet": "CONDITION",
"generatedByTerm": "Medullary thyroid carcinoma"
},
{
"priority": 0,
"term": "Neoplasm of endocrine system",
"suppress": False,
"generatedBy": "CONDITION",
"filterType": "include",
"custom": False,
"facet": "CONDITION",
"generatedByTerm": "Medullary thyroid carcinoma"
... | |
phases.append(torch.cumsum(dphase, dim=-1)) # global spike phase
self.phases = torch.stack(phases) # tr, n, time
def geodesic(x, y):
"""
Returns the geodesic displacement between x and y, (x-y).
"""
xy = (x-y) % 1.
xy[xy > 0.5] -= 1.
return xy
def sample_helper(self, h, b, neuron, scale, samples):
"""
... | |
<filename>main.py<gh_stars>0
import yaml
import pandas as pd
import numpy as np
import os
import re
from functools import cache
from fuzzywuzzy import process, fuzz
from time import sleep
# Load config
config = yaml.safe_load(open('config.yml'))
VERBOSE = config['verbose']
# reading all the meta data in from url
me... | |
= params.get("Content")
self.IsPass = params.get("IsPass")
self.IgnoreCount = params.get("IgnoreCount")
self.RiskCount = params.get("RiskCount")
self.LastCheckTime = params.get("LastCheckTime")
self.AssetType = params.get("AssetType")
self.ResCount = params.get("ResCount")
self.UUID = params.get("UUID")
self.St... | |
<filename>checker.py
#! /usr/bin/env python3
import heapq
from queue import Queue
def buffer_push(buffer, min_size, packet):
buffer.append(packet)
return min(packet[0], min_size)
def buffer_pop(buffer, min_size):
# print(buffer)
# print(min_size)
stop_flag = False
ans_packet = None
for i in range(len(buffer... | |
Fence White":0xebe7db,
"Pickford":0xc9f0d1,
"Pickle":0x85a16a,
"Pickle Juice":0xbba528,
"Pickled":0xb3a74b,
"Pickled Avocado":0x99bb11,
"Pickled Bean":0x6e4826,
"Pickled Beet":0x4d233d,
"Pickled Beets":0xaa0044,
"Pickled Bluewood":0x314459,
"Pickled Cucumber":0x94a135,
"Pickled Ginger":0xffdd55,
"Pickled Grape Leaves":... | |
<filename>src/twisted/mail/test/test_pop3.py
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Ltwisted.mail.pop3} module.
"""
from __future__ import print_function
import hmac
import base64
import itertools
from collections import OrderedDict
from io import BytesIO
from zo... | |
size
boundXl = px - glareSize
if boundXl < 0: boundXl = 0
boundXu = px + glareSize
if boundXu > cols - 1: boundXu = rows - 1
boundYl = py - glareSize
if boundYl < 0: boundYl = 0
boundYu = py + glareSize
if boundYu > rows - 1: boundYu = cols - 1
# judge if the sun is located on obstruction or open s... | |
Model, or set a different '_name'.")
raise TypeError(msg % (cls, model_class._name))
@classmethod
def _build_model_check_parent(model_class, cls, parent_class):
""" Check whether ``model_class`` can inherit from ``parent_class``. """
if model_class._abstract and not parent_class._abstract:
msg = ("In %s, the abs... | |
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | |
<filename>tests/unittests/core/test_pickleddb.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Collection of tests for :mod:`orion.core.io.database.pickleddb`."""
import logging
import os
import random
import uuid
from datetime import datetime
from multiprocessing import Pool
import pytest
from filelock import File... | |
<filename>crowdsource/views.py
from main.customdecorators import check_honeypot_conditional
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.http.response import HttpResponseRedirect, JsonResponse
from rest_framework.decorators import action
from api.models import ObjectType
from django.core.... | |
as auxiliary data and will be returned by the gradient function if `return_values=True`.
All arguments for which the gradient is computed must be of dtype float or complex.
wrt: Arguments of `f` with respect to which the gradient should be computed.
Example: `wrt_indices=[0]` computes the gradient with respect to th... | |
is None:
return self.copy()
elif isinstance(other, (Query, QueryCompound)):
return self.or_(other)
else:
out = self.copy()
out.addMath(Query.Math.Or, other)
return out
def __sub__(self, value):
"""
Subtracts the value from this query.
:param value | <variant>
:return <Query> self
"""
out = self.copy(... | |
a[0], a[1]) for i, a in enumerate(guilds.values()))),
# color=0x9326ff)
# await ctx.send(embed=embed)
@bot.command(description='上位10プレーヤーのランキングを表示する')
async def brank(ctx):
"""上位10プレーヤーのランキングを表示する"""
embed = Embed(description="`!!ranking`を使ってください")
await ctx.send(embed=embed)
return
# playerlist = conn.execute(... | |
<filename>nanoblocks/account/account.py<gh_stars>1-10
import base64
import sys
from io import BytesIO
import pandas as pd
import numpy as np
import qrcode
from nanoblocks import rcParams
from nanoblocks.account.account_history import AccountHistory
from nanoblocks.account.account_pending_history import AccountPending... | |
__all__ = ["Signal", "Audio", "Value", "Parameter", "signal", "control_method"]
from functools import wraps
import time
from dataclasses import dataclass, fields
from copy import copy
import numpy as np
# and IPython.display for audio output
import IPython.display as ipd
import matplotlib.pyplot as plt
# Librosa f... | |
old properties if user was renamed
userOldValue = getOldValue(self, services, user_properties["config"], user_properties["propertyName"])
if userOldValue is not None and userOldValue != user_name:
putCoreSitePropertyAttribute("hadoop.proxyuser.{0}.hosts".format(userOldValue), 'delete', 'true')
services["forced-conf... | |
# TS4 Python decompiler front-end
# by Scumbumbo @ Mod The Sims
# and Andrew @ Sims 4 Studio
#
# May be freely modified for personal use
#
# May be redistributed AS-IS or in modified form, providing:
# - All comments and code authorship attributions remain unmodified except as required for clarity
# - This redistributi... | |
<reponame>jellybean4/yosaipy2
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"Lice... | |
<reponame>thijstriemstra/w1thermsensor<filename>src/w1thermsensor/core.py
"""
w1thermsensor
~~~~~~~~~~~~~
A Python package and CLI tool to work with w1 temperature sensors.
:copyright: (c) 2020 by <NAME> <<EMAIL>>
:license: MIT, see LICENSE for more details.
"""
import subprocess
import time
from functools import lr... | |
Subst(
Int(
x ** (S(-1) + (m + S(1)) / n) * (a1 + b1 * x) ** p * (a2 + b2 * x) ** p,
x,
),
x,
x ** n,
),
x,
)
def replacement763(a, b, c, m, n, p, x):
return Dist(
c ** IntPart(m) * x ** (-FracPart(m)) * (c * x) ** FracPart(m),
Int(x ** m * (a + b * x ** n) ** p, x),
x,
)
def replacement764(a1, a2, b1... | |
self.tag_2.changesets.add(self.changeset)
def test_detail_view_by_normal_user(self):
self.client.login(username=self.user.username, password='password')
response = self.client.get(reverse('changeset:detail', args=[self.changeset.id]))
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data[... | |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import unittest
from GoogleScraper import scrape_with_config
from GoogleScraper.parsing import get_parser_by_search_engine
from GoogleScraper.config import get_config
from collections import Counter
config = get_config()
base = os.path.dirname(os.path.realpath(__fi... | |
mutual_info_self, mutual_info_skl, ars_flow
def MI_meta(self, colours, meta_clust):
adj_mutual_info = np.zeros(len(colours))
mutual_info = np.zeros(len(colours))
adj_rand_score = np.zeros(len(colours))
norm_mi = np.zeros(len(colours))
for i in range(len(colours)):
adj_mutual_info[i] = adjusted_mutu... | |
- len(placed) + partial
if lowest_cnt == 0:
continue
larger = [p for p in placed if p > lowest]
if larger:
next_larger = min(larger)
can_replicate = min(next_larger - lowest - 1, remaining_budget /
lowest_cnt)
else:
can_replicate = remaining_budget / lowest_cnt
if can_replicate > 0:
if lowest + can_replicate... | |
<reponame>JustAPerson/ep_rename<gh_stars>0
#!/usr/bin/env python3
"""
Copyright 2020 <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 ri... | |
"""
Support functions for the RTL-SDR using pyrtlsdr
Copyright (c) July 2017, <NAME>
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 must retain the above cop... | |
if norm:#正規化オプション
a = self.normalize(a)
b = self.normalize(b)
dot = (a[0]*b[0])+(a[1]*b[1])
#print u'内積 :', dot
return dot
#ベクトルを正規化して戻す
def normalize(self, a):
length = self.get_length(a)
return [a[0]/length, a[1]/length]
#長さを出す
def get_length(self, a):
return math.sqrt(a[0]**2+a[1]**2)
#入力を計算して返す
de... | |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 <NAME>
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ... | |
# Initialize Population
pop = empty_individual.repeat(n_pop)
for i in range(n_pop):
pop[i].position = random.randrange(var_min, var_max)
pop[i].cost = 1 # costfxn(pop[i].position, attr_keys, d_set)
# if pop[i].cost < best_sol.cost:
# best_sol = pop[i].deepcopy()
# Best Solution Ever Found
best_sol = empty_indi... | |
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends.util import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (SI... | |
<gh_stars>0
# Copyright (C) 2011-2018 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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 ... | |
there is four quarters of circle and
signs for movement and solving expressions are different. So
we use additional variables to control it.
:param delta: finish position delta from the beginning, must be on
circle on specified plane. Zero means full circle.
:param radius: vector to center of circle.
:param plane... | |
37, 10, 10, 1)
self.cnn_layer_names = ['cnn_layer_{}'.format(i) for i in range(n_layer)]
first_conv_in = self.col_size
if self.cnn_channel_size_list is None:
later_conv_in = self.cnn_channel_size
conv_in = np.ones([n_layer + 1], dtype="int32") * later_conv_in
conv_in[0] = first_conv_in
# conv_in[1] = first_con... | |
from flask import request
from flask_table import create_table,Table, Col, LinkCol, ButtonCol, DateCol
from functools import partial
from lightserv.main.utils import table_sorter
from lightserv.main.tables import (DateTimeCol, DesignatedRoleCol,
ConditionalRequestNameLinkCol,NACol)
import os
def dynamic_clearing_man... | |
###############################################################################
# @todo add Pilot2-splash-app disclaimer
###############################################################################
""" Get's KRAS states """
import MDAnalysis as mda
from MDAnalysis.analysis import align
from MDAnalysis.lib.mdamath ... | |
(IOError, zipfile.BadZipfile) as err: # TODO: Test this branch
log.warning("Not a valid K3b project file. Moving: %s", path)
files = {os.path.abspath(path): os.path.basename(path)}
for src_path, dest_rel in sorted(files.items()):
if args.mode == 'mv':
dest_path = mounty_join(args.target, dest_rel)
filesystem.mer... | |
#!/usr/bin/env python
# coding=UTF-8
import os
import sys
import getpass
import traceback
from operators.op import op
from globalConfig import globalConfig
from db.controllers.ServidorController import ServidorController
serverManager = None
class ServerManager():
'''
# Base Server Manager
Description ::
-----... | |
If you enable private access, Kubernetes API requests from within your cluster's VPC use the private VPC endpoint. The default value for this parameter is false, which disables private access for your Kubernetes API server. If you disable private access and you have nodes or AWS Fargate pods in the cluster, then ensure... | |
<filename>cogs/botconfig.py
import os
import json
import typing
import aiohttp
import discord
from discord.ext import commands, menus
from utilities import utils
from utilities import checks
from utilities import converters
from utilities import decorators
from utilities import pagination
def setup(bot):
bot.add_c... | |
failures due to non-blocking socket 'unavailable' errors
if not is_unavailable_exception(e):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
def test_dotted_attribute(self):
# Raises an AttributeError because private methods are not allowe... | |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ... | |
roslibpy.actionlib.ActionClient(client,"isaacs_server/control_drone",'isaacs_server/ControlDroneAction')
goal = roslibpy.actionlib.Goal(action_client, roslibpy.Message({'id': uid, "control_task":"start_mission"}))
goal.on('feedback', lambda f: print(f['progress']))
goal.send()
result = goal.wait(10)
self.assertTru... | |
('fax_id' not in params) or (params['fax_id'] is None):
raise ValueError("Missing the required parameter `fax_id` when calling `get_fax_file`")
collection_formats = {}
resource_path = '/faxes/{faxId}/file'.replace('{format}', 'json')
path_params = {}
if 'fax_id' in params:
path_params['faxId'] = params['fax_id... | |
},
Optional('create_time'): str,
Optional('last_status_change_time'): str,
Optional('signaling_protocol'): {
Any(): {
'mpls_vc_labels': {
'local': str,
'remote': str,
},
'group_id': {
'local': str,
'remote': str,
},
'mtu': {
'local': str,
'remote': str,
},
Optional('mac_withdraw'): {
'sent': int,
're... | |
import tensorflow as tf
import numpy as np
from net.ops import random_bbox, bbox2mask, local_patch
from net.ops import priority_loss_mask
from net.ops import gan_wgan_loss, gradients_penalty, random_interpolates
from net.ops import free_form_mask_tf
from net.vgg import Vgg19
from util.util import f2uint
from functools ... | |
<reponame>muminkoykiran/computervision-recipes
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from time import time
from typing import Any, Callable, List, Optional
import fastai.basic_train
from fastai.basic_train import _loss_func2activ, LearnerCallback
from fastai.tor... | |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2016
# --------------------------------------------------------------------------
from six import iteritems
f... | |
<reponame>awslabs/aws-serverless-financial-functions<gh_stars>10-100
import lambda_handlers as handlers
REQUIRED_PROPERTY_ERR = "'{}' is a required property"
INCORRECT_TYPE_ERR = "'{}' is not of type '{}'"
def test_fv_handler():
# TODO test data types
# rate, nper, pmt
response = handlers.fv_handler({
"rate": 0.0... | |
def find_shortest_sub_array(nums: [int]) -> int:
nums_dict = {num: 0 for num in nums} # dictionary hold the nums elements a keys and 0 a a value
for num in nums:
nums_dict[num] += 1 # update the value of each of the dictionary keys to the frequency of the numbers in num
most_rep_num = max(nums_dict, key = nums_dict... | |
bpy.path.abspath(
no.image.filepath,
library=no.image.library)
)
if outputs_empty or not no.image or not image_path_exists:
users_images = []
for ob in bpy.data.objects:
if ob.material_slots and ma.name in ob.material_slots:
users_images.append("%s%s%s" % (
"[L] " if ob.library else "",
"[F] " if ob.use_fa... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------------------------
# Copyright (c) 2017-2018, <NAME> (<EMAIL>)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | |
<gh_stars>1-10
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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
#... | |
# File: ticTacToeTests.py
# from chapter 18 of _Genetic Algorithms with Python_
#
# Author: <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http... | |
<reponame>andreicnica/hrl_attention
import torch
import sys
import gym
from argparse import Namespace
import numpy as np
import glob
import re
import os
import copy
try:
import gym_minigrid
except ImportError:
pass
from models import get_model
from agents import get_agent
from utils import utils, get_wrappers, sav... | |
= concentrations[0][0].container.plate.layout
res = None
sample_concs = np.zeros_like(layout, dtype=float)
for comp, r_conc, _ in concentrations:
well = comp.container
row = well.row - 1
col = well.column - 1
sample_concs[row][col] = r_conc
res = QuantificationProcess._compute_pico_concentration(
sample_con... | |
"lIndex3.rotateX" 2.13')
mel.eval('setAttr "lIndex3.rotateY" -2.89')
mel.eval('setAttr "lIndex3.rotateZ" 0.5')
mel.eval('setAttr "rIndex3.rotateX" 2.13')
mel.eval('setAttr "rIndex3.rotateY" 2.89')
mel.eval('setAttr "rIndex3.rotateZ" -0.5')
mel.eval('setAttr "lCarpal2.rotateX" 0.0')
mel.eval('setAttr "lCarpal2.... | |
acceptedEqnsUnraveled = np.zeros( [N,N] )
acceptedEqnsUnraveled[unravelIndices[0], unravelIndices[1]] = acceptedEqns
acceptedEqnsUnraveled = np.pad( acceptedEqnsUnraveled, ((0,1),(1,0)), mode=constantPad )
# Ok so how big is relativeEst? Can we add in zeros?
# Or maybe I should just give weights as weights*a... | |
``p_TimedMetadataId3Frame``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-udpgroupsettings.html#cfn-medialive-channel-udpgroupsettings-timedmetadataid3frame
- ``p_TimedMetadataId3Period``: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-med... | |
# -*- coding: utf-8 -*-
import datetime
import json
from freezegun import freeze_time
from mantarray_desktop_app import COMPILED_EXE_BUILD_TIMESTAMP
from mantarray_desktop_app import create_magnetometer_config_dict
from mantarray_desktop_app import CURRENT_SOFTWARE_VERSION
from mantarray_desktop_app import MICRO_TO_BA... | |
<gh_stars>100-1000
# coding=utf-8
# Copyright (c) 2020 Alibaba PAI team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from math import fabs
from math import sqrt
from compas.utilities import pairwise
from compas.geometry._core import add_vectors
from compas.geometry._core import add_vectors_xy
from compas.geometry._core impo... | |
<gh_stars>0
"""
Copyright 2019 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
softwar... | |
<reponame>RyanEGuerra/FARAD_Tutorial
# -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
WARPNet Utilities
------------------------------------------------------------------------------
Authors: <NAME> (chunter [at] mangocomm.com)
<NAME> (murphpo [at] mangocomm.co... | |
# coding: utf-8
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
'''
# These tests should now work collectively, this way:
# export CLI_TESTS_ADMIN_PASS_PHRASE="XXXXXXXX"
# pytest -s --enable-long-running --vcr-record-mode=none tests/test_database.py
# Or individually:
# pytest -s --enab... | |
#!/usr/bin/env python
#coding: utf-8
"""
This module simply sends request to the Digital Ocean API,
and returns their response as a dict.
"""
import requests
import json as json_module
from six import wraps
API_ENDPOINT = 'https://api.digitalocean.com'
class DoError(RuntimeError):
pass
def paginated(func):
@wrap... | |
<filename>pythonProject1/venv/Lib/site-packages/jsonmodel/validators.py
''' a package of data validation classes '''
__author__ = 'rcj1492'
__created__ = '2015.11'
__license__ = 'MIT'
import re
import sys
import json
from base64 import b64decode
from jsonmodel.exceptions import InputValidationError, ModelValidationErr... | |
<reponame>sanglee/XAI-threshold-calibration
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from .layers import *
import torch
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
... | |
9894.1621],
[115.7186, 416.6787, 735.6442, 269.8496, 0.0000, 1877.3934, 0.0000, 6179.7742, 0.0000, 20067.9370],
[1073.8232, 416.6787, 735.6442, 269.8496, 0.0000, 1877.3934, 0.0000, 0.0000, 0.0000, 21133.5080],
[1073.8232, 416.6787, 735.6442, 269.8496, 0.0000, 1877.3934, 0.0000, 0.0000, 0.0000, 20988.8485],
[1073.82... | |
<gh_stars>1000+
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import di... | |
for semantic_type, column_list in self.semantic_types_dict.items():
for column_name in column_list:
processed_column = self.column_info.get(column_name)
if semantic_type == "datetime":
assert processed_column.get("type") in ("DATETIME", "STRING",), (
f"Column {column_name} must be a datetime column or a string but... | |
self.pool.imap(
recon.scout, hosts):
if status == 200:
scan[url] = response['drive_audit_errors']
stats = self._gen_stats(scan.values(), 'drive_audit_errors')
if stats['reported'] > 0:
self._print_stats(stats)
else:
print("[drive_audit_errors] - No hosts returned valid data.")
print("=" * 79)
def umount_chec... | |
data frames will have full time range, even if data is missing
:return: d - dict with one dataframe per area
"""
conn = sqlite3.connect(self.db)
# print(sqlite3.version)
c = conn.cursor()
# %% Select day ahead data from tables
# time_format = 'CET'
# starttime = '20161201:00'
# endtime = '20180112:00'
# cate... | |
_write_det2im(self, hdulist):
"""
Writes a Paper IV type lookup table to the given
`astropy.io.fits.HDUList`.
"""
if self.det2im1 is None and self.det2im2 is None:
return
dist = 'D2IMDIS'
d_kw = 'D2IM'
err_kw = 'D2IMERR'
def write_d2i(num, det2im):
if det2im is None:
return
str('{0}{1:d}').format(dist, n... | |
Parameters
----------
image:
A np.array image to be padded size of (target_width, target_height)
offset_height:
Number of rows of padding_values to add on top.
offset_width:
Number of columns of padding_values to add on the left.
target_height:
Height of output image.
target_width:
Width of output image.
pa... | |
<reponame>Gaming32/Pyweek32Sandbox<filename>and_beyond/server/client.py
import asyncio
import logging
import math
import time
from asyncio import StreamReader, StreamWriter
from asyncio.events import AbstractEventLoop
from asyncio.tasks import Task, shield
from collections import deque
from typing import TYPE_CHECKING,... | |
one will return a non-None
argument instead. This is basically the same as
treating None as greater than any other value.
"""
if a is None:
return b
elif b is None:
return a
else:
return min(a, b)
def _sorted_attributes(features, attrs, attribute):
"""
When the list of attributes is a dictionary, use the
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.