text
stringlengths
2
999k
# PoseNet.py # Alex Dillhoff (ajdillhoff@gmail.com) # Model definition for the 2D heatmap prediction network. import torch import torch.nn as nn import torch.nn.functional as F from base import BaseModel from .TFConv2D import TFConv2D class PosePrior(nn.Module): """Implements the PosePrior architecture. Th...
# Copyright 2017 The TensorFlow 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.org/licenses/LICENSE-2.0 # # Unless required by applica...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 4 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class SettingsGlobalSettings(obj...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
#!/usr/bin/env python3 import subprocess import argparse import os import sys this_dir = os.path.dirname(os.path.realpath(__file__)) path_generate_ant = this_dir + '/generate-ant' path_fann_eval_fixed = this_dir + '/../bin/fann-eval-fixed' def parse_arguments(): parser = argparse.ArgumentParser( descript...
# Generated by Django 2.1.2 on 2018-11-20 13:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Game', '0010_auto_20181117_1613'), ] operations = [ migrations.AddField( model_name='transaction', name='visibility'...
# -*- Python -*- """Repository rule for NCCL configuration. `nccl_configure` depends on the following environment variables: * `TF_NCCL_VERSION`: Installed NCCL version or empty to build from source. * `NCCL_INSTALL_PATH`: The installation path of the NCCL library. * `NCCL_HDR_PATH`: The installation path of th...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: WorkTicketInformation_2.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import refl...
"""Figures management command to run course MAU metrics for all courses, all Sites. """ from __future__ import print_function from __future__ import absolute_import from textwrap import dedent from django.core.management.base import BaseCommand from figures.tasks import ( populate_all_mau ) class Command(Bas...
#!/usr/bin/python3 from .main import ( # NOQA 401 connect, disconnect, show_active, is_connected, gas_limit, gas_price, ) from .account import Accounts from .state import TxHistory from .rpc import Rpc from .web3 import Web3 __all__ = ["accounts", "history", "rpc", "web3"] __console_dir__ = [...
from django.shortcuts import render, redirect import crawler from calendarapp.models import Event from crawler import Subject import datetime # Create your views here. def connect_everytime(request): return render(request, 'connect-everytime.html') def post(request): if request.method == "POST": user...
from django.test import TestCase, Client from django.urls import reverse from backend.api.models import Weather, User, Stop, FavouriteStop, Review, Route, FavouriteRoute, FavouriteDirections, RouteStop import json from backend.api.views import (index_view, BusStopTimes, RegisterApi, ChangePasswo...
''' https://leetcode.com/problems/search-in-rotated-sorted-array/ There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k...
from flask import render_template, request, url_for, session from flask.views import MethodView from utils import SimpleDB from flask_security import current_user class Admin(MethodView): # load and display user data def get(self): #get db db, user_datastore, security = SimpleDB.get() ...
""" This file offers the methods to automatically retrieve the graph Reuters911. The graph is automatically retrieved from the NetworkRepository repository. References --------------------- Please cite the following if you use the data: ```bib @inproceedings{nr, title = {The Network Data Repository with Intera...
# -*- coding: utf-8 -*- """Views for PyBEL-Flask-Admin.""" from .base_view import ModelView __all__ = [ 'NetworkView', 'NamespaceView', 'NodeView', 'EdgeView', 'CitationView', 'EvidenceView', 'NameView', 'AuthorView', ] class NetworkView(ModelView): """View for PyBEL networks.""...
import os #get current path currentPath = os.getcwd() print(currentPath)
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this file. # # All configurati...
__name__ = 'utils'
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: utf-8 -*- from numpy import sin def comp_surface(self): """Compute the Slot total surface (by analytical computation). Caution, the bottom of the Slot is an Arc Parameters ---------- self : SlotW10 A SlotW10 object Returns ------- S: float Slot total su...
import os from flask import Flask from flask import render_template from flask import request import wiringpi import signal SERVO_PIN = 18 # BCM pin FREQUENCY = 50 # hz SINGLE_CYCLE = 1000.0 / FREQUENCY # ms OFF_DUTY_CYCLE = (1.0 / SINGLE_CYCLE) * 100.0 # % ON_DUTY_CYCLE = (2.1 / SINGLE_CYCLE) * 100.0 # % app = F...
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyJinja2Cli(PythonPackage): """A CLI interface to Jinja2""" homepage = "https://githu...
from pathlib import Path from monopoly.property import Colors, properties from dataclasses import dataclass, field from rich.table import Table from rich import box import os, glob, json ############################################ # PLAYER ############################################ @dataclass class Player: n...
# -*- test-case-name: twisted.trial.test.test_reporter -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. # # Maintainer: Jonathan Lange """ Defines classes that handle the results of tests. """ import sys, os import time import warnings from twisted.python.compat import set from t...
""" Defines the PlotSession class. """ # Enthoght library imports from chaco.array_plot_data import ArrayPlotData from chaco.default_colormaps import * from traits.api import Any, Bool, Dict, HasTraits, Instance, Int, \ List, Property, Trait, Str # Local, relative imports from plot_w...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import socket import struct import threading from collections import deque from enum import Enum #from threading import Lock from Utils import DebugLock as Lock from Utils import Utils try: from Event import Event except Exception as ex: Util...
__version__ = "2.0.16"
# [h] shift points dialog # debug import hTools2 reload(hTools2) if hTools2.DEBUG: import hTools2.modules.fontutils reload(hTools2.modules.fontutils) import hTools2.modules.glyphutils reload(hTools2.modules.glyphutils) # imports try: from mojo.roboFont import CurrentFont except: from robo...
import json import numpy as np import pandas as pd from pandas import DataFrame, Series from shapely.geometry import mapping, shape, Point from shapely.geometry.base import BaseGeometry from six import string_types, PY3 from geopandas.base import GeoPandasBase, _CoordinateIndexer from geopandas.geoseries import GeoSe...
# Standard Python Library imports import time import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsRegressor from sklearn.model_selection import (StratifiedKFold, RepeatedKFold, KFold, cross_val_score) from sklearn.linear_model import SGDRegressor, LogisticRegression from sklearn.ensemble impo...
# MIT License # # Copyright (c) 2018 Alexey Nikitin # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
import asyncio import inspect import re from typing import Any, Callable, Dict, Set from pydantic.typing import ForwardRef, evaluate_forwardref def get_typed_signature(call: Callable) -> inspect.Signature: "Finds call signature and resolves all forwardrefs" signature = inspect.signature(call) globalns = ...
# -*- coding: utf-8 - # # This file is part of http-parser released under the MIT license. # See the NOTICE for more information. from __future__ import with_statement from distutils.errors import CCompilerError, DistutilsExecError, \ DistutilsPlatformError from distutils.command.build_ext import build_ext from di...
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from dc.generated import dclegacy_pb2 class P2PBaseObserver(object): def __init__(self): pass @staticmethod def _validate_message(message: dclega...
import ranger.api import ranger.core.fm import ranger.ext.signals import subprocess hook_init_old = ranger.api.hook_init def hook_init(fm: ranger.core.fm.FM): def zoxide_add(signal: ranger.ext.signals.Signal): path = signal.new.path process = subprocess.Popen(["zoxide", "add", path]) proc...
""" # Mobius Software LTD # Copyright 2015-2018, Mobius Software LTD # # This 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 ve...
""" """ # python import os from datetime import datetime # 3rd party import pytz # pip install pytz class timezone_Exception(Exception): def __init__(self, message=""): self.message = message class TimezoneNotFoundError(timezone_Exception): pass def get_current_timezone(l...
# -*- coding: utf-8 -*- from .common import * from .custom import *
"""Minify Javascript with `Google Closure Compiler <https://code.google.com/p/closure-compiler/>`_. Google Closure Compiler is an external tool written in Java, which needs to be available. One way to get it is to install the `closure <http://pypi.python.org/pypi/closure>`_ package:: pip install closure No confi...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 Scipp contributors (https://github.com/scipp) # @author Neil Vaytet from .panel import PlotPanel from ..utils import make_random_color from .view1d import _make_label import ipywidgets as ipw class PlotPanel1d(PlotPanel): """ Additional widgets tha...
class Net: pass
class pipe(object): def __init__(self): self.buf = [] self.last_output = 0 def next(self): element = self.buf[0] self.buf = self.buf[1:] return element def peek(self): if len(self.buf) == 0: return None return self.buf[0] def write(self...
""" Celery config file https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html """ from __future__ import absolute_import import os from celery import Celery from celery.utils.log import get_task_logger from django.apps import apps logger = get_task_logger(__name__) # this code copied from m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 计算1+2+3+...+100: sum1 = 0 n = 1 while n <= 100: sum1 = sum1 + n n = n + 1 print("1+2+3+...+100 = ", sum) # 计算1x2x3x...x100: acc = 1 n = 1 while n <= 100: acc = acc * n n = n + 1 print("1x2x3x...x100 = ", acc)
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # # 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...
print('hello intake4')
"""Silly test case for a bad __all__ entry. This example catches a technical issue with the Python code, not an RST error directly - but since API documentation usually looks at the ``__all__`` value this is still relevant. The ``__all__`` value should be a tuple, even when it has a single entry - not a string. This ...
# 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 from .. import _utilitie...
SUBLIST = 0 SUPERLIST = 1 EQUAL = 2 UNEQUAL = 3 def check_lists(l1, l2): if l1 == l2: return EQUAL if contains(l1, l2): return SUPERLIST if contains(l2, l1): return SUBLIST return UNEQUAL def contains(l1, l2): if not l2: return True if len(l2) > len(l1): ...
# -*- coding: utf-8 -*- from ..interpreter import model, NodeContext # Python models for autorally_gazebo # Derived from: https://github.com/AutoRally/autorally/tree/melodic-devel/autorally_gazebo/nodes @model('autorally_gazebo', 'autorally_controller.py') def autorally_controller(c: NodeContext) -> None: c.rea...
# -*- coding: utf-8 -*- # # This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda # # Copyright © pyFDA Project Contributors # Licensed under the terms of the MIT License # (see file LICENSE in root directory for details) """ Create the UI for the FilterPZ class """ from __future__ impor...
# Generated by Django 3.1.2 on 2021-04-01 15:48 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Url', fields=[ ('id', models.AutoField(auto...
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from threading import Event, Lock, Thread from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast imp...
#!/usr/bin/env python import argparse import exceptions import glob import os import subprocess import sys import shutil def _find_sandbox_root(start_dir): dir = start_dir parent = os.path.abspath(os.path.join(dir, '..')) while parent != dir: if os.path.isfile(os.path.join(dir, 'sand...
#!/usr/bin/python3 # Copyright 2018 The GraphicsFuzz Project 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 License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
#!/usr/bin/env python # -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^dashboard/$', views.dashboard, name='dashboard'), url(r'^dashboard/newcontact/$', views.create_contact, name='create_contact'), url(r'^dashboard/search/$', views.dashboard_search, name='d...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. try: import hashlib _new_md5 = hashlib.md5 except ImportError: import md5 _new_md5 = md5.new """64-bit fingerprint support...
# Copyright (c) 2016-2018, Neil Booth # # All rights reserved. # # See the file "LICENCE" for information about the copyright # and warranty status of this software. '''Mempool handling.''' import itertools import time from abc import ABC, abstractmethod from asyncio import Lock from collections import defaultdict i...
"""Mock data for token""" EXPIRED_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.\ eyJpYXQiOjE1NjIxNjYyNTEsIm5iZiI6MTU2MjE2NjI1MSwianRpIjoiN2J\ jNDVhNjktNjExZC00OTJkLWI5MzctMTljN2VkYWZjMjhmIiwiZXhwIjoxN\ TYyMTY3MTUxLCJpZGVudGl0eSI6eyJpZCI6IjI5NDU1NjBhLTU4MjctNDhi\ Ni1hNTliLTRjZmIyOGQwYTI2ZCIsImNyZWF0ZWRBdCI6IjIwMTktMDc...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided t...
import numpy as np from numpy.testing import assert_array_equal, assert_allclose import pytest from pygbm.binning import BinMapper, _find_binning_thresholds, _map_to_bins DATA = np.random.RandomState(42).normal( loc=[0, 10], scale=[1, 0.01], size=(int(1e6), 2) ).astype(np.float32) def test_find_binning_thresho...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
# # 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 "License"); you may not us...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# (c) 2017 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `rekon` package.""" import unittest from rekon import rekon class TestRekon(unittest.TestCase): """Tests for `rekon` package.""" def setUp(self): """setup test fixtures, if any.""" assert rekon.__name__ == 'rekon.rekon' def t...
""" 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 "License"); you may not use this ...
""" :;: What is Canny Edge Detection? :: * Canny Edge detection is an edge detection operator that uses multi-stage algorithm to detect wide range of Edges of an image effectively. * It was discovered by John F. Canny in 1986, so named as Canny Edge detection ...
# -*- coding: utf-8 -*- from pkg_resources import iter_entry_points from sqldoc.parser.parser import Parser from sqldoc.renderer.renderer import Renderer from sqldoc.renderer.jinjarenderer.jinjarenderer import JinjaRenderer class PluginConflictException(Exception): pass class InvalidPluginException(Exception):...
# -*- coding: utf-8 -*- """ @author:XuMing(xuming624@qq.com) @description: """ import os import sys import torch import torch.nn as nn from torch.utils.data.dataset import TensorDataset sys.path.append("..") from rater.datasets.criteo import Criteo from rater.models.ctr.flen import FLEN from rater.models.model impo...
import argparse """ Here are the param for the training """ def get_args(): parser = argparse.ArgumentParser() # DDPG + HER og args parser.add_argument('--n-epochs', type=int, default=300, help='the number of epochs to train the agent') parser.add_argument('--n-cycles', type=int, default=50, hel...
from main import app from schemas import * from utils import * @app.get('/') async def index(): data = test() return data @app.post('/api/v1/summarize-text') async def summarize_text(payload: Corpus): corpus = payload.text num_words = payload.num_words num_sentences = payload.num_sentences ...
# encoding: utf-8 """ @author: BrikerMan @contact: eliyar917@gmail.com @blog: https://eliyar.biz @version: 1.0 @license: Apache Licence @file: __init__.py @time: 2019-05-17 11:15 """ import os from distutils.version import LooseVersion from typing import Any, Dict os.environ["TF_KERAS"] = "1" os.environ["TF_CPP_MIN...
from classes.Base import Base class Programa(Base): def __init__(self, **data): data['identifier'] = "PROGRAMA" super().__init__(data)
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-12-21 19:26 from __future__ import unicode_literals from django.db import migrations, models from django.utils.text import slugify def gen_unique_slug(apps, schema_editor): FrequentlyAskedQuestion = apps.get_model('cms', 'FrequentlyAskedQuestion') ...
#!/usr/bin/env python # Copyright The IETF Trust 2009-2019, All Rights Reserved # -*- coding: utf-8 -*- # Portions Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com> # # Redistribution and use in source and binary forms, with or without ...
from unittest.mock import ANY, call import pytest from graphql import get_introspection_query from opentracing.ext import tags from ariadne import graphql_sync as graphql from ariadne.contrib.tracing.opentracing import ( OpenTracingExtensionSync as OpenTracingExtension, opentracing_extension_sync as opentraci...
#!/usr/bin/env python from __future__ import absolute_import import json import logging from . import IndicatorTypes API_V1_ROOT = "{}/api/v1/" PULSES_ROOT = "{}/pulses".format(API_V1_ROOT) SUBSCRIBED = "{}/subscribed".format(PULSES_ROOT) EVENTS = "{}/events".format(PULSES_ROOT) try: # For Python2 from urlli...
from __future__ import print_function import argparse import os from math import log10 import numpy as np import sys import os import random from glob import glob from PIL import Image import random import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data ...
""" Serialization for the SimpleDMRS format. Note that this format is provided by pyDelphin and not defined anywhere, so it should only be used for user's convenience and not used as an interchange format or for other practical purposes. It was created with human legibility in mind (e.g. for investigating DMRSs at th...
import pandas as pd from features import Feature from features.raw_data import Application class Base(Feature): @classmethod def _create_feature(cls, conf) -> pd.DataFrame: return Application.get_df(conf)[["SK_ID_CURR", "TARGET"]]
import requests import asyncio import aiohttp from requests.exceptions import ConnectionError from my_fake_useragent import UserAgent import random def get_page(url, options={}): try: ua = UserAgent() except: pass try: base_headers = { 'User-Agent': ua.random(), ...
import json import os import boto3 print('Loading function') def init(): print('init() enter') my_config = json.loads(os.environ['botoConfig']) from botocore import config config = config.Config(**my_config) global personalize personalize = boto3.client('personalize', config=config) def la...
import pytest from datasets import Dataset from pathlib import Path from typing import Dict from copy import deepcopy from tio import Task __all__ = [ "DummyTask" ] EXPECTED_DUMMY_DATA = { "idx" : [0, 1, 2], "input" : ["The comment section is ", "The butcher of ", "Get "], "output": ["out of control...
from django.test import TestCase, LiveServerTestCase from django.urls import reverse from time import sleep from dbtools.models import * from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By...
from __future__ import generator_stop from __future__ import annotations from .AngleGenerator import WalkAngleGenerator from .Sigmoid import Sigmoid __all__ = [ 'WalkAngleGenerator', 'Sigmoid' ]
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) from .gp_regression import GPRegression from .gp_classification import GPClassification from .sparse_gp_regression import SparseGPRegression from .sparse_gp_classification import SparseGPClassification, Spa...
from math import cos, sin, sqrt import random class Atom: def __init__(self, x, y, z): self.x = x self.y = y self.z = z self.type = 1 v0 = 2.0 z = random.random()*2.0-1 s = random.random()*3.14*2.0 self.vx = v0*sqrt(1.0-z**2)*cos(s) ...
# Copyright European Organization for Nuclear Research (CERN) # # 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.0OA # # Authors: # - Vincent Garonne, ...
import os import json import pickle import torch import torch.nn as nn from torch.autograd import Variable import numpy as np from pytorch_pretrained_bert import BertTokenizer from commons.embeddings.graph_utils import * from datasets.schema import Schema from typing import List class WordEmbedding(nn.Module): d...
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
# encoding=utf-8 import os, collections from LxBasic import bscMtdCore, bscMethods # from LxPreset import prsConfigure, prsOutputs, prsMethods # from LxCore.config import appCfg # from LxCore.preset.prod import assetPr # from LxGui.qt import qtWidgets_ # from LxDatabase import dbGet # from LxMaya.command import maUtil...
from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import QFileDialog, QCheckBox, QComboBox, QLabel, QHBoxLayout import csv from widgets.progressbar import ProgressBar from database import * class ExportFileDialog(QFileDialog): """ Create a custom Export-File Dialog with options li...
from todo.api import get_tasks, create_task, finish_task, delete_task def test_list_tasks(test_app): # make sure there are no existing tasks assert get_tasks() == [] create_task('buy milk') create_task('buy cookies') assert len(get_tasks()) == 2 def test_create_task(test_app): create_task('G...
#!/usr/bin/env python3 print("Hello from Lotta M.")
#!/usr/bin/env python2 from __future__ import with_statement import sys, string, operator def get_cpu2net_vcs(num_vcs): assert num_vcs <= 8 return range(0,num_vcs) def get_net2cpu_vcs(num_vcs): assert num_vcs <= 8 return range(8,8+num_vcs) def concat(xs): return reduce(operator.add, xs, []) # VC...
# # Copyright (c) 2020-2021 Arm Limited and Contributors. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # """Defines a USB Identifier.""" import re from enum import Enum from typing import Optional, Pattern, Any, List, cast from mbed_tools.devices._internal.utils.python_helpers import named_tuple_with_de...
""" This parameter file is designed for continuous action environments. For discrete action environments minor modifications might be required. See Also: :ref:`ref-parameter-files` """ import numpy as np from copy import deepcopy from digideep.environment import MakeEnvironment from collections import OrderedDic...