input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'3375552':{'en': 'Legos'},
'3375553':{'en': 'Legos'},
'3375554':{'en': 'Legos'},
'3375555':{'en': 'Euroinformation Telecom'},
'3375556':{'en': 'Intercall'},
'3375557':{'en': 'Intercall'},
'3375558':{'en': 'Sewan communications'},
'3375559':{'en': 'Sewan communications'},
'3375560':{'en': 'Prixtel'},
'3375561':... | |
<gh_stars>1-10
''' This program runs on the main computer. It requests and receives
images of the chess board and analyses them. It identifies and
displays the position. It uses a chess engine make replies.
'''
import cv2, chess, chess.engine, chess.pgn
import numpy as np
import socket, io, time, pathlib
import tkinter... | |
if target < 0 or not isinstance(target, int):
raise ValueError("Target gate should be not-negative integer.")
# Add one qubit gates
def X(self, target:int):
"""Add X gate (logical NOT) to the stack of current moment.
Args:
target: An index of a qubit node on which X gate acts.
Returns: None.
Raise: ValueErro... | |
import numpy as np
import scipy
import torch
perm_dict = {
"xyz": [0, 1, 2, 0, 2],
"zyx": [2, 1, 0, 1, 3],
}
def coords3inds(coords, nz, ny, nx):
coords = coords.to(torch.int32)
# gperm = nx * ny * nz
# gperm1 = nx * ny
# gperm2 = nx
gperm = torch.tensor(nx * ny * nz, dtype=torch.int32, device="cuda")
gperm1... | |
<reponame>freingruber/JavaScript-Raider<filename>modes/import_corpus.py<gh_stars>10-100
# Copyright 2022 @ReneFreingruber
#
# 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.apach... | |
<filename>tests/TestModules/HRewrite_doubleRHS.py<gh_stars>1-10
from core.himesis import Himesis, HimesisPostConditionPattern
import cPickle as pickle
from uuid import UUID
class HRewrite_doubleRHS(HimesisPostConditionPattern):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HRewrit... | |
weights in network
- options are core, accessory or euclidean distance
Returns:
processed_weights (list)
Edge weights
"""
processed_weights = []
if weights_type is not None and distMat is not None:
# Check weights type is valid
if weights_type not in accepted_weights_types:
sys.stderr.write("Unable to calcul... | |
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401... | |
<gh_stars>1-10
import re
import logging
import argparse
import ruamel.yaml
import pandas as pd
from python_tools.constants import VARIANTS_INPUTS, SV_INPUTS, VERSION_PARAM
from python_tools.util import (
find_bams_in_directory,
include_yaml_resources,
include_version_info,
create_yaml_file_objects,
extract_samp... | |
<filename>tests/macsec/test_macsec.py<gh_stars>0
from time import sleep
import pytest
import logging
import re
import scapy.all as scapy
import ptf.testutils as testutils
from tests.common.utilities import wait_until
from tests.common.devices.eos import EosHost
from macsec_helper import *
from macsec_config_helper imp... | |
the weights corresponding to the movements
between regions. Edges must contain weight and delta_adjustment attributes (assumed 1.0)
:type graph: networkx.Digraph
:param currentState: The current state for every region.
:type currentState: A dictionary with the region as a key and the value is a dictionary of
state... | |
<filename>chroma/camera.py
#!/usr/bin/env python
import numpy as np
import itertools
import threading
import multiprocessing
import os
from subprocess import call
import shutil
import tempfile
import sys
import pycuda.driver as cuda
from pycuda import gpuarray as ga
from chroma.geometry import Mesh, Solid, Geometry, ... | |
# coding: utf-8
"""
see README.md
"""
__version__ = '1.0'
__autor__ = u"<NAME>; <NAME>.; <NAME>."
def Bezout(f, g, every_step=False):
"""
Compute Bezout's divisor of f and g, where f an g can be
- bivariate polynomials
- affine curves
- projective curves
- homogenous polynomials in three variables
The ... | |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
from biopharma import units
from biopharma.core import SpecificationViolatedError
from biopharma.specs import *
from enum import Enum
import os
from math import inf
import pandas as pd
import pytest
from pytest import fixture, raises
def test_quantity_specs():
spec = Q('m', 'desc')
assert spec.description == 'd... | |
<gh_stars>0
"""Parser of expressions."""
# Copyright 2020 by California Institute of Technology
# Copyright (c) 2008-2013 INRIA and Microsoft Corporation
# All rights reserved. Licensed under 3-clause BSD.
#
# This module is based on the file:
#
# <https://github.com/tlaplus/tlapm/blob/main/src/expr/e_parser.ml>
#
impo... | |
<reponame>bolero2/DeepLearning-dc<gh_stars>1-10
"""
Title : mobilenetv2_1.py
Date : 2019-02-25
Author : <NAME>
Network : MobileNet V2(2D)
Dataset : ImageNet 100 Labels
Dropout : 0.5
"""
import cv2
import os
import random
import numpy as np
import tensorflow as tf
import time
TrainDir = "D:\\Tiny_ImageNet\\Tiny_Image... | |
of derivative"""
value_type = [mstype.int32, mstype.int64, mstype.float32, mstype.float64]
if not dtype(primals_item) in value_type:
raise TypeError(f"For `F.derivative`, the elements of primals should belong to "
f"`mstype.int32, mstype.int64, mstype.float32, mstype.float64`, but got"
f" {dtype(primals_item).__na... | |
<filename>sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protected_items_operations.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# L... | |
1.788007E+06, 1.817455E+06, 1.847247E+06, 1.877383E+06, 1.907867E+06,
])
# ---------------------- M = 2, I = 3 ---------------------------
M = 2
I = 3
TIPS_2017_ISOT_HASH[(M,I)] = TIPS_2017_ISOT[2]
TIPS_2017_ISOQ_HASH[(M,I)] = float64([
2.260550E+00, 3.809072E+01, 7.584727E+01, 1.136063E+02, 1.513692E+02, 1.891574E+0... | |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from scipy import stats
import statsmodels.api as sm
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_recall_fscore_support as score
from sklearn.metrics import confusion_matrix
from sklearn.util... | |
<gh_stars>1-10
from __future__ import absolute_import, division, print_function
import dolfin as dl
dl.dx = dl.dx(metadata={'quadrature_degree':2, "representation":'uflacs'})
import numpy as np
path = "../../"
import sys
sys.path.append(path)
from soupy.utils.variables import STATE, PARAMETER, ADJOINT, OPTIMIZATION
... | |
import sys
from dataclasses import dataclass
import logging
import curses
from tx.functional.either import Left, Right
from coloredtext import ColoredText, toColoredText
logging.basicConfig(filename="qctool.log",
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S',
l... | |
<gh_stars>0
import collections
import io
import logging
import os
import subprocess
import re
import threading
import warnings
from imagemounter import _util, filesystems, FILE_SYSTEM_TYPES, VOLUME_SYSTEM_TYPES, dependencies
from imagemounter.exceptions import SubsystemError, NotMountedError, ImageMounterError
from im... | |
:
fi = open("unusedproj.txt","r")
unusedproj=[]
for line in fi:
unusedproj.append(line.split('\n')[0])
return unusedproj
def findInputLinks(dtcphirange) :
fi = open(dtcphirange,"r")
ilinks=[]
for line in fi:
dtcname=line.split()[0]
layerdisk=int(line.split()[1])
phimin=float(line.split()[2])
phimax=... | |
<filename>python/paddle/fluid/contrib/layers/rnn_impl.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | |
<reponame>bobbypaton/FullMonte
#!/usr/bin/python
### ### ### ### ###
### ### ### ### ###
#####b. ####b. ###### .d##b. #####b. ### ####b. #####b. ###
### ### "##b "##b ### d##""##b ### "##b ### "##b ### "##b ###
### ### ### .d###### ### ### ### ### ### ### .d###### ### ###
### ### d##P ### ### Y##b. Y##..##P ### ### #... | |
plot_args.nx_item
assert node in plot_args.solution
val = plot_args.solution.overwrites[node]
val_str = "\n ".join(f"{i}. {v}" for i, v in reversed(list(enumerate(val))))
tooltip = f"(x{len(val)} overwrites) {val_str}"
return quote_html_tooltips(tooltip)
def make_op_prune_comment(plot_args: PlotArgs):
op = plot... | |
3, 5, 6, 9], None),
("21", [[3, 4], [6, 9], [4, 8]], ["22", "20", "21"], None, [4, 5, 8], "21"),
("21", [[3, 4], [5, 8], [4, 8]], ["22", None, None], None, [4, 5, 8], "21"),
("21", [[3, 4], [3, 8], [4, 8]], [None, None, None], None, [3, 4, 8], "21"),
(None, [[3, 4], [6, 9], [4, 8]], ["22", "20", "21"], None, [4, 5,... | |
'918380':{'en': 'Idea'},
'559999641':{'en': 'Oi'},
'9178882':{'en': 'Idea'},
'559999643':{'en': 'Oi'},
'559999642':{'en': 'Oi'},
'559999645':{'en': 'Oi'},
'559999644':{'en': 'Oi'},
'559999647':{'en': 'Oi'},
'559999646':{'en': 'Oi'},
'918220':{'en': 'Airtel'},
'658571':{'en': 'StarHub'},
'658570':{... | |
_form)
indices = _digest_indices(indices)
tmp_indices = get_component_index_from_component(item, indices=indices, check=False)
all_indices = item.atoms_dataframe['component_index'].to_numpy()
right_locs = [next((idx for idx, val in _np.ndenumerate(all_indices) if val==ii))[0] for ii in tmp_indices]
output = item.... | |
that are of type 'typed_relation'. Each value (don't forget multivalued fields) needs to have
# this pattern: string:string:int.
validate_typed_relation_values(config, field_definitions, csv_data)
validate_csv_field_cardinality_csv_data = get_csv_data(config['input_dir'], config['input_csv'], config['delimiter'])
... | |
globalpath = f'{datapath}/global_datasets'
_,_,_ = get_global_soil(globalpath,sitedata)
_,_ = get_global_qanth(globalpath,sitedata)
_,_ = get_climate(globalpath,sitedata)
# site attrs
print('setting attributes\n')
siteattrs = pd.Series(name='siteattrs',dtype='object')
siteattrs['sitename'] = sitename
siteattrs... | |
<reponame>dhrone/pyIOT
# -*- coding: utf-8 -*-
from threading import Lock, Thread
import logging
import re
import queue
import time
class Component(object):
''' Components are responsible for monitoring the underlying physical component, updating dependent properties associated with the component, and respond... | |
<filename>loguetools/og.py
from loguetools import common
import struct
import copy
from collections import namedtuple
patch_value = namedtuple("Field", ["name", "type"])
minilogue_og_patch_struct = (
# 0
("str_PROG", "4s"),
("program_name", "12s"),
("reserved1", "4B"),
("vco_1_pitch_b2_9", "B"),
("vco_1_shape... | |
experiment.configuration)
def check_cmd_args_config(self, tmp_path, conf_file, monkeypatch):
"""Check that cmdargs configuration overrides global/envvars/local configuration"""
command = f"hunt --worker-max-trials 0 -c {conf_file} --branch-from test-name --enable-evc"
command += " " + " ".join(
"--{} {}".format(n... | |
<reponame>sorrento/sdopt-tearing
# Copyright (C) 2014, 2015 University of Vienna
# All rights reserved.
# BSD license.
# Author: <NAME> <<EMAIL>>
from __future__ import print_function
from itertools import chain, groupby
from six import itervalues
from networkx import Graph, NetworkXUnfeasible, relabel_nodes
from netwo... | |
"""
Create an interactive map for selecting satellite imagery and exporting image files.
"""
# Load modules
import datacube
import itertools
import numpy as np
import matplotlib.pyplot as plt
from odc.ui import select_on_a_map
from datacube.utils.geometry import CRS
from datacube.utils import masking
from skimage impo... | |
import requests
from bs4 import BeautifulSoup
import dateparser
from espncricinfo.exceptions import PlayerNotFoundError
from espncricinfo.match import Match
class Player(object):
def __init__(self, player_id):
self.url = "https://www.espncricinfo.com/ci/content/player/{0}.html".format(str(player_id))
self.json_url... | |
xero_tenant_id,
}
local_var_files = {}
form_params = []
body_params = credit_notes
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json"]
)
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type(
["applic... | |
"""A class that defines the network being modeled and that contains all
modeled objects in the network such as Nodes, Interfaces, Circuits,
and Demands."""
import networkx as nx
from pprint import pprint
from .circuit import Circuit
from .demand import Demand
from .interface import Interface
from .exceptions import M... | |
<filename>daceml/onnx/onnx_importer.py
import collections
import logging
from itertools import chain, repeat
from typing import Dict, Union, Tuple, Any, List, Optional, OrderedDict, Callable
import numpy as np
import torch
import onnx
from dace.codegen import compiled_sdfg
from onnx import numpy_helper
import dace
f... | |
<filename>ome_zarr/reader.py
"""Reading logic for ome-zarr."""
import logging
from abc import ABC
from typing import Any, Dict, Iterator, List, Optional, Type, Union, cast
import dask.array as da
from vispy.color import Colormap
from .io import BaseZarrLocation
from .types import JSONDict
LOGGER = logging.getLogger... | |
new = self.__newInstance(newArr, self.__q)
for ri in new.__arr:
ri._Num__q = new.__q
openUnit()
return new
def __rmul__(self, obj):
closeUnit()
if type(obj) == int or type(obj) == float:
new = self.__newInstance([n.__rmul__(obj) for n in self.__arr], self.__q, dv=self.__gd_valid)
elif type(obj) == Const:
ne... | |
'''
Author: <NAME>
Date: 3/15/19
Summary:
- Contains computation methods that board.py uses to
manage valid move seeks and piece placement.
- Methods use Numba with jit decorator that precompiles
types and makes runtime faster than normal python.
'''
from numba import jit
import numpy as np
import math
# def dummy... | |
from http import HTTPStatus
from django.db.models import F, Q, Case, When, Sum, Count
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.test import TestCase, RequestFactory, override_settings
from django.test import TransactionTestCase
from django.urls impo... | |
'+str(ic))
connect('button_press_event',self.closewin)
show()
def histDialog(self):
"histogramDialog(self) - dialog to setup histogram plot"
import Tkinter
if self.histFrame != None: self.histDone()
top=Toplevel()
self.histFrame=top
fm = Frame(top,borderwidth=0)
top.title('Histogram Dialog...')
self.histV... | |
CalcLines(dbase, display_repl, _gui._locale, _gui._nd)
self.__blank_father = None
self.__blank_mother = None
self.__blank_father = \
self.__calc_l.calc_lines(None, None, self.disp_father)
self.__blank_mother = \
self.__calc_l.calc_lines(None, None, self.disp_mother)
self.__blank_marriage = \
self.__calc_l.ca... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
__all__ = [
"is_token_expired",
"SpotifyClientCredentials",
"SpotifyOAuth",
"SpotifyOauthError",
"SpotifyStateError",
"SpotifyImplicitGrant",
"SpotifyPKCE"
]
import base64
import json
import logging
import os
import time
import warnings
import webbrowser
import requests
... | |
<reponame>basepipe/developer_onboarding
# encoding: utf-8
# module _ast
# from (built-in)
# by generator 1.147
# no doc
# no imports
# Variables with simple values
PyCF_ONLY_AST = 1024
__version__ = '82160'
# no functions
# classes
class AST(object):
# no doc
def __delattr__(self, name): # real signature unknown... | |
<reponame>systemsbiology/dsPyspark
import collections
from Bio.Alphabet import IUPAC
from Bio.Seq import Seq
from Bio import motifs
from contextlib import contextmanager
from pyspark import SparkContext, SparkConf
from tral.sequence import sequence
import re
import pandas as pd
import os
import argparse
import datetime... | |
上距离为 stride)
# x_col[x,x,i,x,x,x]: stride = stride (这个 stride 是指卷积的步长) * base_stride (x_col[x,x,1,1,1,1] -> x_col[x,x,2,1,1,1] 这两个数在 x_pad 上距离为 stride)
# x_col[x,i,x,x,x,x]: stride = stride (这个 stride 是指卷积的步长) * (W_in+2*pad) * base_stride (x_col[x,1,1,1,1,1] -> x_col[x,2,1,1,1,1] 这两个数在 x_pad 上距离为 stride)
# x_col[i,x... | |
<gh_stars>100-1000
# Test the runpy module
import unittest
import os
import os.path
import sys
import re
import tempfile
from test.test_support import verbose, run_unittest, forget
from test.script_helper import (temp_dir, make_script, compile_script,
make_pkg, make_zip_script, make_zip_pkg)
from runpy import _run_c... | |
<reponame>victorrsouzas/TeoriaDosGrafos
import time
import networkx as nx
import matplotlib.pyplot as plt
import sys
import numpy as np
import glob
buffer = 0
d = 1
e = 1
G = nx.DiGraph() # Direcionado
G2 = nx.Graph() # Não Direcionado
contaAresta = 0
def menu_Grafos():
print("""
-----------------------------
Teo... | |
from PIL import ImageTk, Image, ImageGrab, EpsImagePlugin, ImageFont, ImageDraw
from tkinter import ttk, font
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter.messagebox import showinfo
import tkinter as tk, numpy as np, webbrowser, serial, time, math, cv2, os
from threading import Thread
... | |
np.zeros((sz, sz), order='F', dtype=np.float64)
# apply boundary values
phi[0, :] = lower_bndy; phi[:, 0] = lower_bndy
phi[-1, :] = upper_bndy; phi[:, -1] = upper_bndy
# apply source term
rho = np.zeros((sz, sz), order='F', dtype=np.float64)
rho[sz//2, sz//2] = -100/h**2
# iterate PDE steps to get solution
for ... | |
// receptive_field_for_pool_layer[1]
)
if (feature_map_for_pool_layer[0] <= 0) or (feature_map_for_pool_layer[1] <= 0):
raise ValueError('Pooling layer 1: ({0}, {1}) is wrong size of feature map!'.format(
feature_map_for_pool_layer[0], feature_map_for_pool_layer[1]
))
l_pool = lasagne.layers.Pool2DLayer(
l_conv,... | |
"""
Cityscape Database
"""
from __future__ import print_function
import cv2
import os
import numpy as np
import multiprocessing
from six.moves import cPickle
from multiprocessing.dummy import Pool
from imdb import IMDB
from ..processing.bbox_transform import bbox_overlaps
from ..core.helper import get_scale_factor
... | |
"video_gold": 3600
},
"68": {
"level": 68,
"exp": 42000,
"cost": 49000,
"order_good_min": 3,
"order_good_max": 20,
"order_refresh_min": 600,
"order_refresh_max": 900,
"worker_gold": 6.79999999999999,
"video_gold": 3650
},
"69": {
"level": 69,
"exp": 43000,
"cost": 50000,
"order_good_min": 3,
"order_go... | |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from scipy.constants import pi
from scipy.special import binom
import warnings
from .utilities import _initialize_figure, _format_axes
class _BasePipe(object):
"""
Template for pipe classes.
Pipe classes inherit from this class.
Attribu... | |
from typing import Tuple
from NewDeclarationInQueue.processfiles.customprocess.formulars.davere import DAvere
from NewDeclarationInQueue.processfiles.customprocess.search_text_line_parameter import SearchTextLineParameter
from NewDeclarationInQueue.processfiles.customprocess.table_config_detail import TableConfigDeta... | |
Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location da... | |
import math
import os
import itertools
from tqdm import tqdm
import IPython
import numpy as np
import sklearn.cluster
import cv2
from ..models import basnet
from ..utils.downloads import *
from ..utils.console import *
from ..utils import EasyDict
from ..image import *
from .canvas import *
default_color_labels = [
... | |
else:
plt.plot(h_min, c_min, 'k')
plt.plot(h_max, c_max, 'k')
plt.plot(h_cen, c_cen, 'g')
plt.ylabel('Complexity (C)')
plt.xlabel('Entropy (H)')
plt.plot(D.nsent[cnl], D.jscom[cnl], 'o')
for i, c in enumerate(cnl):
plt.annotate(D.clist[c], (D.nsent[c], D.jscom[c]))
plt.show()
def js_complexity... | |
'fastd-enabled': False, 'adx-enabled': False, 'rsi-enabled': False, 'trigger': 'macd_cross_signal'}, 'sell': {'sell-mfi-value': 98, 'sell-fastd-value': 72, 'sell-adx-value': 51, 'sell-rsi-value': 82, 'sell-mfi-enabled': True, 'sell-fastd-enabled': True, 'sell-adx-enabled': True, 'sell-rsi-enabled': True, 'sell-trigger'... | |
<gh_stars>0
# (C) Copyright 2021- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an int... | |
mag, dir):
for id in self.mGidSensor[whichfoot]['force_vec']:
self.mFeetCanvas.delete(id)
self.mGidSensor[whichfoot]['force_vec'] = []
if self.mDataClass == BpDataClassCooked:
self._forcevector(whichfoot, mag, dir)
#--
def FeetCanvasDrawCenterOfMass(self, whichfoot, sensors):
for id in self.mGidSensor[whichfoo... | |
<reponame>SUNET/ni
# -*- coding: utf-8 -*-
__author__ = 'ffuentes'
import graphene
import norduniclient as nc
import apps.noclook.vakt.utils as sriutils
from apps.noclook import activitylog, helpers
from apps.noclook.forms import *
from apps.noclook.models import Role as RoleModel, \
DEFAULT_ROLES, DEFAULT_ROLES, DE... | |
'geologic',
'geology',
'geometry',
'gland',
'glass',
'glucose',
'glycine',
'glycines',
'glycosylamine',
'glycosylamines',
'gold',
'growth',
'guild',
'gαs',
'haematopoiesis',
'health',
'heat',
'helix',
'hematological',
'hematopoiesis',
'hematoxylin',
'heredity',
'heterokont',
'heterokontae',
'het... | |
O0OooO0oo = lisp_process_api_database_mapping ( )
if 10 - 10: OoOoOO00 % I11i
if 49 - 49: oO0o % ooOoO0o + II111iiii
if 21 - 21: i1IIi + OoO0O00 . I1IiiI - Oo0Ooo
if 99 - 99: OoOoOO00
if 46 - 46: I1ii11iIi11i / II111iiii / OoooooooOO / Ii1I
O0OooO0oo = json . dumps ( O0OooO0oo )
Oooo000 = lisp_api_ipc ( process ... | |
<reponame>cgarcia-UCO/AgentSurvival
'''
Esta clase tiene agentes (clase anterior) que se mueven en el laberinto. Los agentes tienen métodos para moverse hacia adelante
y para girar a ambos lados.
HECHO Cuando un agente hace una acción, el Laberinto debería comprobar si ha agotado el número de movimientos en su turno... | |
import json
import time
from configparser import ConfigParser
from datetime import datetime
from captcha.helpers import captcha_image_url
from captcha.models import CaptchaStore
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.ha... | |
"""Obtains a meter.
Obtains meter either from cache or from Ceilometer meter list
joined with statically defined meter info like label and description.
:Parameters:
- `meter_name`: A meter name we want to fetch.
"""
meter_candidates = self._cached_meters.get(meter_name, None)
if not meter_candidates:
meter_ca... | |
eps_sp = params['epss']
eps_t = params['epst']
# Conditions:
# gyroradius / lengthscale < eps_sp
# and
# gyroperiod / timescale < eps_t
if self.field.static:
return self.cycrad() / self.field.lengthscale(self.trajectory[-1,:4]) < eps_sp
else:
return self.cycrad() / self.field.lengthscale(self.trajectory[-1,:... | |
0.10318303432144482,
0.1328119530274221,
0.1758696096352922,
0.25000788081411496,
0.31184480110955365,
0.35624810835927434,
0.46272121272437644,
0.5265482261571047,
0.5435536167799155,
0.5461021554512147,
0.5463637065698664,
0.622818968965978,
0.7144836403223405,
0.7803053944901569,
0.816938634686397,
0.... | |
DiscreteVoltageControlBranchAndGenState14BusEnvTestCase(
unittest.TestCase):
"""Quick testing of DiscreteVoltageControlBranchAndGenState14BusEnv.
"""
@classmethod
def setUpClass(cls) -> None:
# Initialize the environment. Then, we'll use individual test
# methods to test various attributes, methods, etc.
# Def... | |
kw else kw.pop('inv')
to = 'to' in kw and kw.pop('to')
pattern_objs = []
for pattern in patterns:
pattern_objs.append(re.compile(pattern, **kw))
for data in prev:
match = None
for pattern_obj in pattern_objs:
match = pattern_obj.match(data)
if match is not None:
break
if bool(inv) ^ (match is not None):
if... | |
MOL 2 8.447 13.786 6.178 1.00 0.00 H1- \n',
'ATOM 514 H3 MOL 2 7.524 11.986 6.711 1.00 0.00 H1- \n',
'ATOM 515 H4 MOL 2 8.102 10.674 4.848 1.00 0.00 H1- \n',
'ATOM 516 H5 MOL 2 6.609 10.669 4.357 1.00 0.00 H1- \n',
'ATOM 517 H6 MOL 2 7.090 8.640 5.466 1.00 0.00 H1- \n',
'ATOM 518 H7 MOL 2 7.485 9.434 6.763 1.00 0.... | |
<reponame>xamox/SimpleCV
from SimpleCV.base import *
from SimpleCV.Color import *
from SimpleCV.Features.Features import Feature, FeatureSet
class TrackSet(FeatureSet):
"""
**SUMMARY**
TrackSet is a class extended from FeatureSet which is a class
extended from Python's list. So, TrackSet has all the properties
... | |
<filename>tools/webdriver/webdriver/client.py<gh_stars>1-10
from . import error
from . import protocol
from . import transport
from six import string_types
from six.moves.urllib import parse as urlparse
def command(func):
def inner(self, *args, **kwargs):
if hasattr(self, "session"):
session = self.session
else:... | |
= overlap.overlap_count + overlap_count
n = overlap.overlap.get ( field_id, 0 )
overlap.overlap [ field_id ] = n + overlap_count
# Return overlap
return [ x0, y0, x1, y1, w0, h0 ]
# No overlap
return None
# Update the overlap fields
def update_overlap_fields () :
# Load the overlap results if availabl... | |
<gh_stars>1-10
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | |
size')
# save into data frames
self.importance = pd.DataFrame({'feat_idx':feat_idx,
'feature':self.feat_names.iloc[feat_idx] if self.feat_names is not None else None,
'imp_val':feat_imp})
#--------------------------------------------------------------------
# Feature selection methods
class selectMixedDT(_featS... | |
started.
When iterating over this object, batches might contain overlapping trajectories.
Args:
transitions (:class:`TransitionBatch`): the transition data used to built
the iterator.
trajectory_indices (list(tuple(int, int)): a list of [start, end) indices for
trajectories.
batch_size (int): the batch size to ... | |
<reponame>robingong/imgaug
from __future__ import print_function, division, absolute_import
import time
import warnings
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in ... | |
array like object where each element corresponds to a specific camera parameter,
corresponding to the element represented by each column coming from the :meth:`~CameraModel.compute_jacobian`
method. For a concrete example of the update vector and how it works, see the concrete camera model
implementations.
:param... | |
#!/usr/bin/python
import sys, math, itertools
import numpy as np
from scipy.optimize import fmin_powell
import random
import argparse
from ast import literal_eval as make_tuple
# Used to call datgnom and outsource Dmax determination.
import general_scripts as gs
import saxscalc as sc
def read_xvgs_all(filelist):
out_... | |
buflen = space.len_w(w_value) + 1
elif typ == rwinreg.REG_MULTI_SZ:
if space.is_w(w_value, space.w_None):
buflen = 1
buf = lltype.malloc(rffi.CCHARP.TO, buflen, flavor='raw')
buf[0] = '\0'
elif space.isinstance_w(w_value, space.w_list):
strings = []
buflen = 0
# unwrap strings and compute total size
w_iter ... | |
be of type string.")
if feature_name not in self.all_features():
raise UnsatisfiedRequirments(f"'{feature_name}' doesn't exist in any features.")
self.__feature_value_representation = copy.deepcopy(feature_value_representation)
def set_feature_to_dummy_encoded(self,
feature_name,
dummy_encoded_list):
self.__d... | |
'1'],
'open': ['-', '4', '3']})
def test_operator_ready(self):
"""test the method ready of Operator"""
op = qt.Operator()
print(f'operator is ready? "{op.ready}"')
def test_operator_add_strategy(self):
"""test adding strategies to Operator"""
op = qt.Operator('dma, all, urgent')
self.assertIsInstance(op, qt... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" run.py
Code to run the PatchVAE on different datasets
Usage:
# Run with default arguments on mnist
python run.py
Basic VAE borrowed from
https://github.com/pytorch/examples/tree/master/vae
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = ... | |
try:
from source.Multiprocessing import *
except:
from Multiprocessing import *
def print_citation_mantis():
paper_doi='https://doi.org/10.1093/gigascience/giab042'
separator='##########################################################################################################################'
res=f'{separ... | |
termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
"""
if post_start is not None:
pulumi.set(__self__, "post_start", post_sta... | |
import os
import sys
import serial
class Autostar():
def __init__(self):
self.port = serial.Serial(
port='/dev/ttyAMA0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1
)
# ACK - Alignment Query
def alignment_query(self):
self.port.write('0x0... | |
'action': action,
'global': global_,
'metered': metered,
'resource_group': resource_group,
'updates': updates
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
url = ... | |
"▁Bun": 7672,
"▁Missouri": 7673,
"▁Four": 7674,
"▁UV": 7675,
"▁SO": 7676,
"▁Zlatan": 7677,
"▁Larry": 7678,
"if": 7679,
"vor": 7680,
"XU": 7681,
"▁Security": 7682,
"-80": 7683,
"▁Baker": 7684,
"/2000": 7685,
"▁Alfred": 7686,
"▁Bug": 7687,
"ios": 7688,
"BL": 7689,
"board": 7690,
"yp": 7691,
"▁Kings": ... | |
import copy
import logging
import random
logging.getLogger('transformers').setLevel(level=logging.WARNING)
from nltk.tokenize import sent_tokenize
import torch
import tqdm
from transformers import BertForMaskedLM, BertTokenizer, AdamW, get_linear_schedule_with_warmup
from utils import (
BertInput,
Defaults,
batch... | |
fake_images=fake_images,
discriminator=self.Dis,
device=self.local_rank)
dis_acml_loss += self.LOSS.maxgp_lambda * maxgp_loss
# apply LeCam reg. for data-efficient training if self.LOSS.apply_lecam is set to True
if self.LOSS.apply_lecam:
if self.DDP:
real_adv_output = torch.cat(losses.GatherLayer.apply(real_di... | |
<reponame>mbattistello/lambda_converters<filename>pythonocc/lib/OCC/BRepMAT2d.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if v... | |
<filename>kernelmethods/operations.py
# -*- coding: utf-8 -*-
"""
This module implements the common kernel operations such as
- normalization of a kernel matrix (KM),
- centering (one- and two-sample cases),
- evaluating similarity, computing alignment,
- frobenius norms,
- linear combinations and
- checking wh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.