text
stringlengths
1
927k
""" Text Parsers to find url from content. Every url item should contain: - url - location(`filepath:row:column`) """ from abc import abstractmethod from typing import List class Link: def __init__(self, url: str, path: str, row: int, column: int): """init link object :param str url: link's hre...
import base64 from django.db import models from django.contrib.auth.models import User from django.utils.text import slugify import string import random DEFAULT_ENVIRONMENT_ID = 1 class Flavor(models.Model): name = models.CharField(max_length=512) slug = models.CharField(max_length=512) cpu = models.Te...
import hashlib import hmac import json import logging import os import re import struct import tempfile import time import uuid from base64 import urlsafe_b64encode from binascii import unhexlify import m3u8 from Crypto.Cipher import AES from tqdm import tqdm def is_channel(url): url = re.findall('(slot)', url) ...
""" The basic date shifting rule.. Original Issue: DC-1005 This is an abstract class and cannot be directly instantiated. It must be extended to be used. """ # Python Imports import logging from abc import abstractmethod # Project imports from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule fr...
# 201005: rename/restructure .yml files for consistency with xtb-level data # 201006: in read_conformer() fix error message when log files are missing import os,re,itertools,time #import pybel #from openbabel import pybel import numpy as np import pandas as pd import pathlib as pl cwd = pl.Path.cwd() import yaml from...
# Copyright 2021 The T5 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# # 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...
class Node: """Class for storing linked list node.""" def __init__(self, element, next_pointer, prev_pointer=None): self._element = element self._next = next_pointer self._prev = prev_pointer
import logging import random from math import sqrt, log from stellar_system import Star from stellar_system import Planetesimal from stellar_system import Protoplanet from stellar_system import Protomoon from stellar_system import Planet from stellar_system import Orbit from accrete import CircumstellarDisk from consta...
try: from PyQt5.QtWidgets import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog from PyQt5 import QtCore except: from PyQt4.QtGui import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog from PyQt4 import QtCore from vqt.main import idlethread from vqt.basics import VBox ...
"""test Bit operations""" import pytest from aiomysql.bit import Bit @pytest.mark.parametrize( 'length, value, expected', ( (10, None, ValueError), (10, 1, 1), (10, '123', TypeError), (10, '0', 0), (10, '1', 1), (10, '010', 2), (10, '1010', 10), (10...
#!/usr/bin/env python """ """ __docformat__ = 'restructuredtext' __version__ = '$Id: $' import ctypes import pyglet from pyglet.libs.darwin import carbon, _oscheck, create_cfstring from pyglet.libs.darwin.constants import * import input import usage # non-broken c_void_p void_p = ctypes.POINTER(ctypes.c_int) cl...
import json class Struct(object): def __init__(self, data): for name, value in data.items(): setattr(self, name, self._wrap(value)) def _wrap(self, value): if isinstance(value, (tuple, list, set, frozenset)): return type(value)([self._wrap(v) for v in value]) ...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Example for commanding robot with position control using moveit planner """ import time from pyrobot import Robot def main(): targe...
import board import busio import time import random dotstar = busio.SPI(board.APA102_SCK, board.APA102_MOSI) #colors = [1, 128, 244] # set colors all to 1 colors = [random.randint(3, 240), random.randint(3, 240), random.randint(3, 240), ] # selects random start color in "safe zone" steps = [1, 3, 4] # se...
# Akachukwu Obi, 2018 # Project Euler #6 # see .js file for build up def diffOfSumOfSquares(max): sumOfNumbers = max * (max + 1) / 2 # sum of n natural numbers is n(n + 1)/2 sumOfSquares = (max / 6.0) * (2 * max + 1) * (max + 1) # I used 6.0 to avoid getting a math.floor situation in puthon2.7 return sumOfNumbers ...
import numpy as np atoms_to_save = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 15, 18]) u_cdl = np.load("u_cdl.npy") v_cdl = np.load("v_cdl.npy") np.save("u_cdl_modified.npy", u_cdl[atoms_to_save]) np.save("v_cdl_modified.npy", v_cdl[atoms_to_save])
#!/usr/bin/python # -*- coding: utf-8 -*- """Windows resource types Requires packages: pefile WARNING: This module is deprecated, broken, and will be removed eventually. """ __version__ = '0.0.1' __date__ = '2020-01-01' __author__ = 'Robert Jordan' __all__ = ['ResourceName', 'ResourceId'] #####################...
import os from scrapy.crawler import CrawlerProcess import pandas as pd import logging import nltk import json_reader from sentiment_score import clean_text, calculate_sentiment_score from reddit_scraper.reddit_scraper.spiders.reddit_post_scraper import RedditPostCrawler if __name__ == '__main__': # Initial setup...
"""The sqlalchemy model for a polloption.""" from __future__ import annotations from sqlalchemy import Column, ForeignKey, Index, func from sqlalchemy.orm import relationship from sqlalchemy.types import BigInteger, DateTime, Integer, String from pollbot.db import base from pollbot.enums import ReferenceType class ...
""" Runs the scoring procedure for the challenge. It assumes that there exists a ./model_dir folder containing both the submission code and the saved learner. It will create a folder named ./scoring_output (default) in which a txt file will contain the average score over 600 episodes. You can change the folder name...
#!/usr/bin/env python # pylint: disable=W0201 import sys import argparse import yaml import numpy as np # torch import torch import torch.nn as nn import torch.optim as optim # torchlight import torchlight from torchlight import str2bool from torchlight import DictAction from torchlight import import_class from .pro...
# Generated by Django 3.2.10 on 2022-01-25 22:13 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Author', fields=[ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the iPod plist plugin.""" from __future__ import unicode_literals import unittest from plaso.formatters import ipod as _ # pylint: disable=unused-import from plaso.lib import definitions from plaso.parsers.plist_plugins import ipod from tests import test_l...
""" Provide the groupby split-apply-combine paradigm. Define the GroupBy class providing the base-class of operations. The SeriesGroupBy and DataFrameGroupBy sub-class (defined in pandas.core.groupby.generic) expose these user-facing objects to provide specific functionailty. """ import types from functools import wr...
valores = [[], []] val = 0 for c in range(1, 8): val = int(input(f'Digite o {c}° valor: ')) if val % 2 == 0: valores[0].append(val) else: valores[1].append(val) valores[0].sort() valores[1].sort() print(f'valores impares: {valores[1]}') print(f'valores pares: {valores[0]}')
""" Base class for all posixish platforms """ from pypy.translator.platform import Platform, log, _run_subprocess from pypy.tool import autopath import py, os class BasePosix(Platform): exe_ext = '' def __init__(self, cc=None): if cc is None: cc = 'gcc' self.cc = cc def _libs...
__mf_customization__ = 'test' tl_value = 42 __version__ = None
#!/usr/bin/env python # -*- coding: utf-8 -*- # modified from: # https://gist.github.com/rotemtam/88d9a4efae243fc77ed4a0f9917c8f6c import os import glob import click import pandas as pd import xml.etree.ElementTree as ET def xml_to_csv(path: str) -> pd.DataFrame: xml_list = [] for xml_file in glob.glob(pat...
#!/usr/bin/env python # coding: utf-8 # In[8]: ## Advanced Course in Machine Learning ## Week 6 ## Exercise 2 / Random forest import numpy as np import scipy import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.animation as animation from numpy import linalg as LA from sklearn...
import torch import torch.nn as nn from threading import Thread from models.layers.mesh_union import MeshUnion import numpy as np from heapq import heappop, heapify class MeshPool(nn.Module): def __init__(self, target, multi_thread=False): super(MeshPool, self).__init__() self.__out_target = ...
""" $lic$ Copyright (C) 2016-2019 by The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it will be useful, but WITHOU...
import base64 import re from dataclasses import dataclass from enum import Enum from typing import Union, List from kubernetes import client, config from kubernetes.client import V1ConfigMapList, V1SecretList, CoreV1Api, V1Secret, V1ConfigMap from nexuscasc.logger import Logger class ResourceType(Enum): SECRET,...
import datetime import os from unittest.mock import Mock from bnc.cli import cli from bnc.utils.utils import json_to_str from tests.commands.common import read_json_test_file, get_headers from tests.commands.common_fixtures import * def get_json_filename(): return os.path.join(os.path.dirname(os.path.abspath(__f...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-09-02 20:22 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0008_auto_20160801_1937'), ] operations = [...
""" Django settings for dockerdjango project. Generated by 'django-admin startproject' using Django 2.2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import ...
import pybullet as p import pybullet_data p.connect(p.SHARED_MEMORY) p.setAdditionalSearchPath(pybullet_data.getDataPath()) objects = [ p.loadURDF("plane.urdf", 0.000000, 0.000000, -.300000, 0.000000, 0.000000, 0.000000, 1.000000) ] objects = [ p.loadURDF("quadruped/minitaur.urdf", [-0.000046, -0.000068, 0.20...
from itertools import chain from pathlib import Path import nltk import torchtext from quati.dataset.fields.words import WordsField from quati.dataset.fields.tags import TagsField from quati.dataset.corpora.corpus import Corpus def create_single_file_for_pos_and_neg(corpus_path): new_file_path = Path(corpus_pat...
from memstatsbeat import BaseTest import os class Test(BaseTest): def test_base(self): """ Basic test with exiting Memstatsbeat normally """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*" ) memstatsbeat_proc = self.star...
# Copyright 1997 - 2018 by IXIA Keysight # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish,...
# from model.base.fcn import CustomFcn # from model.best.fcn import DeepLabv3Fcn # from model.better.fcn import Resnet101Fcn # from model.sota.fcn import LightFcn from model.alexnet.alexnet_model import AlexNet from model.lenet5.lenet_5_model import LeNet5 from model.vggnet.vggnet16 import VGG16 from model.densenet.den...
# qubit number=4 # total number=10 import pyquil from pyquil.api import local_forest_runtime, QVMConnection from pyquil import Program, get_qc from pyquil.gates import * import numpy as np conn = QVMConnection() def make_circuit()-> Program: prog = Program() # circuit begin prog += H(1) # number=2 pr...
from django.shortcuts import render # Create your views here. def home(request): return render(request, 'blog/index.html', {'title': 'Home'})
import click import time import platform import os from minifier import minify from .board import Board, BoardException, DirectoryExistsError from .board import PyboardError _board = None @click.group() @click.option( "--port", "-p", envvar="ATRON_PORT", default="", type=click.STRING, help="N...
f = open('surf.txt') notas = [] nomes = [] for linha in f: nome, pontos = linha.split() notas.append(float(pontos)) nomes.append(nome) f.close() notas.sort(reverse=True) nomes.sort(reverse=True) print ('%s %4.2f' %(nomes[0], notas[0])) print ('%s %4.2f' %(nomes[1], notas[1])) print ('%s %4.2f' %(nomes[2], n...
from flask import Flask from flask_bootstrap import Bootstrap from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy app = Flask('sayhello') app.config.from_pyfile('settings.py') app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True db = SQLAlchemy(app) bootstrap = Bootstrap(app) moment...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ The GenSen training process follows the steps: 1. Create or load the dataset vocabulary 2. Train on the training dataset for each batch epoch (batch size = 48 updates) 3. Eval...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ---------------------------------------------------------- @file: acoustic_docking.py @date: Wed Jun 3, 2020 @author: Alejandro Gonzalez Garcia @e-mail: alexglzg97@gmail.com @brief: Motion planning. ROS node to follow an acoustic signal for ...
import numpy as np import torch from torch import nn from torch.nn import functional as F class MaskedLinear(nn.Module): def __init__(self, base_layer, m_in, m_out): """ The standard nn.Linear layer, but with gradient masking to enforce the LULA construction. """ super(MaskedLinea...
#!/usr/bin/env python3 # Some useful POD-Variables # The Program names: PROGRAMS = [ "1A", "1B", "1C", "1D", "2A", "2B", "2C", "2D", "3A", "3B", "3C", "3D", "4A", "4B", "4C", "4D", "5A", "5B", "5C", "5D", "6A", "6B", "6C", "6D", "7A", "7B",...
async def Main(self, message, command, arguments): await self.run_file("section_slot_assign", message, arguments)
"""Highly unreliable way to register "preflight hooks", which are run every time you run a script (but not an editor action).""" from __future__ import absolute_import, division, print_function def run(): print(u"Installing preflight hooks...") # There's no official way to add hooks that run before every...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import pytest from cryptography import utils from cryptography.exception...
# 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 from ... import _utilities, _tables __a...
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the Partially Signed Transaction RPCs. """ from decimal import Decimal from itertools import prod...
# Generated by Django 1.11.18 on 2019-01-28 14:05 import re import django.core.validators import django.db.models.deletion import django.utils.timezone import django_fsm import model_utils.fields from django.db import migrations, models import waldur_azure.validators import waldur_core.core.fields import waldur_core....
#!/home/daniel/anaconda3/bin/python # -*- coding: utf-8 -*- """ ================================================ rewrite_monitoring ================================================ This program rewrites a monitoring time series files into the correct time order """ # Author: fvj # License: BSD 3 clause import date...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\jog_interaction.py # Compiled at: 2020-07-22 05:56:20 # Size of source mod 2**32: 16676...
# -*- coding: utf-8 -*- # Copyright 2018 IBM. # # 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 agre...
"""Let's Encrypt user-supplied configuration.""" import os import urlparse import zope.interface from acme import challenges from letsencrypt import constants from letsencrypt import errors from letsencrypt import interfaces class NamespaceConfig(object): """Configuration wrapper around :class:`argparse.Namesp...
#!/usr/bin/python # -*- coding: utf-8 -*- # GUI import import tkinter as tk # Styling the GUI from tkinter import ttk # Database connection from modules.create_db_components import create_connection # Deletes the ticket from the database from modules.removing_tickets import delete_ticket """This module is used to ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- from logging import DEBUG from logging import INFO from logging import Formatter from logging import StreamHandler from logging import getLogger from sys import stderr from sys import stdout class LogLevelFilter: def __init__(self, level): self.__level = level ...
# # @lc app=leetcode.cn id=1603 lang=python3 # # [1603] running-sum-of-1d-array # None # @lc code=end
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) try: with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() except IOError: long_description = 'Python module to get stock data from ...
#!/usr/bin/env python """ Copyright (C) 2014 Ivan Gregor This program 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. ...
import requests, csv, sys, os, time, json, codecs server = "https://cloudrf.com" # dir = "calculations/antennas_1W_2m" # Open CSV file import codecs # csvfile = csv.reader(codecs.open('antennas.csv', 'rU', 'utf-16')) uid = 'YOUR CLOUDRF UID HERE' key = 'YOUR CLOUDRF KEY HERE' def calc_area(dir,csvfile_loc): ...
import smart_imports smart_imports.all() class Bill(django_models.Model): CAPTION_MIN_LENGTH = 6 CAPTION_MAX_LENGTH = 256 created_at = django_models.DateTimeField(auto_now_add=True, null=False) updated_at = django_models.DateTimeField(auto_now_add=True, null=False) # MUST setupped by hand voti...
class Solution: def furthestBuilding(self, H, bricks, ladders): jumps_pq = [] for i in range(len(H) - 1): jump_height = H[i + 1] - H[i] if jump_height <= 0: continue heappush(jumps_pq, jump_height) if len(jumps_pq) > ladders: bricks -=...
from itertools import product listA = list(map(int, input().split())) listB = list(map(int, input().split())) productLists = list(product(listA, listB)) for i in range(len(productLists)): print(productLists[i], end=" ")
# Coyright 2017-2019 Nativepython 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
from abc import abstractmethod from typing import Any, Optional from mlagents_envs.base_env import BaseEnv class BaseRegistryEntry: def __init__( self, identifier: str, expected_reward: Optional[float], description: Optional[str], ): """ BaseRegistryEntry allows...
# 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 from ... import _utilities, _tables __a...
from .models import ExamVenue from django.forms import ModelForm class RestrictedResponseForm(ModelForm): def __init__(self, *args, **kwargs): super(RestrictedResponseForm, self).__init__(*args,**kwargs) try: self.fields['assigned_venue'].queryset = ExamVenue.objects.filter(exam=self.i...
# -*- coding: utf8 -*- ''' ======================================================================== CygnusCloud ======================================================================== File: configuration.py Version: 3.0 Description: Database configurator...
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-03-11 01:54 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('shop', '0023_auto_20200311_0137'), ] operations =...
import abc import torch.nn import itertools from typing import Optional, Tuple, Union __all__ = ["Manifold", "ScalingInfo"] class ScalingInfo(object): """ Scaling info for each argument that requires rescaling. .. code:: python scaled_value = value * scaling ** power if power != 0 else value ...
from django.urls import path, include from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register('tags', views.TagViewSet) app_name = 'recipe' urlpatterns = [ path('', include(router.urls)) ]
#!/usr/bin/env python3 import math import numpy as np from common.numpy_fast import interp from common.cached_params import CachedParams import cereal.messaging as messaging from common.realtime import DT_MDL from selfdrive.modeld.constants import T_IDXS from selfdrive.config import Conversions as CV from selfdrive.co...
# 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 ...
from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCommentSectionSortActionTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "motion_comment_section/31": ...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests the includeconf argument Verify that: 1. adding includeconf to the configuration file causes the inc...
#!/usr/bin/env python # coding=utf-8 from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import filecmp import os import unittest from unittest import TestCase import numpy as np import pandas as pd from pandas.testing import assert_frame_equal from p...
# # 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...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validate_json.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure tha...
# -*- coding: utf-8 -*- ''' Module to manage filesystem snapshots with snapper .. versionadded:: 2016.11.0 :codeauthor: Duncan Mac-Vicar P. <dmacvicar@suse.de> :codeauthor: Pablo Suárez Hernández <psuarezhernandez@suse.de> :depends: ``dbus`` Python module. :depends: ``snapper`` http://snapper.io, a...
#!/usr/bin/python # # Copyright 2019 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
''' Created on Oct 20, 2020 @author: chb69 ''' import sys import os import types import mysql.connector from mysql.connector import errorcode import csv import argparse """ this list includes the prefixes for several informatics resources found in the PheKnowLator mapping data. This might be useful ...
# !/usr/bin/env python from baselines.common import set_global_seeds, tf_util as U from baselines import bench import os.path as osp import gym, logging from mpi4py import MPI import pdb from gym_extensions.continuous import mujoco import gym_miniworld from baselines import logger import sys def train(env_id, num_tim...
import os, sys, time, Transposition.transpositionEncrypt as ENC, \ Transposition.transpositionDecrypt as DEC def main(): f_key = 10 # f_mode = 'encrypt' f_mode = 'decrypt' if f_mode == 'decrypt': input_filename = 'frankenstein.encrypt.txt' else: input_filename = 'frankenstein.t...
# Owner(s): ["oncall: jit"] from typing import Any, Dict, List, Optional, Tuple from torch.testing._internal.jit_utils import JitTestCase, make_global from torch.testing import FileCheck from torch import jit from jit.test_module_interface import TestModuleInterface # noqa: F401 import os import sys import torch imp...
import json from config import Config import elasticsearch import time from datetime import datetime import logging from opencensus.trace import execution_context from opencensus.trace import span as span_module import semver class ElasticClient: es = None lastReconnectAttempt = None mapping = {} natlasIndices = ...
import json import logging import mimetypes import os import re from datetime import datetime, time, timedelta from decimal import Decimal, DecimalException from urllib.parse import urlencode import vat_moss.id from django.conf import settings from django.contrib import messages from django.core.files import File from...
#!/usr/bin/env python # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright ...
"""A python client interface for ProofAssistantService.""" from __future__ import absolute_import from __future__ import division # Import Type Annotations from __future__ import print_function import grpc import tensorflow as tf from deepmath.proof_assistant import proof_assistant_pb2 from deepmath.proof_assistant im...
from PIL import Image from torch.utils.data import Dataset from src.data_utils.utils import load_data class ImageDataset(Dataset): def __init__(self, samples: list, transform, preload: bool = False, num_workers=None): self.transform = transform self.samples = samples self.targets = [label...
# commit.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from gitdb import IStream from git.util import ( hex_to_bin, Actor, Iterable, Stats, ...
# %matplotlib notebook import os, re, sys, urllib, requests, base64, IPython, io, pickle, glob sys.path.append("/home/monoid/Development/fresh_atomizer_checks/atomizer/SBMLparser/test/manual") import itertools as itt import numpy as np import subprocess as sb import pandas as pd import matplotlib.pyplot as plt import m...
from os.path import join from email.mime.image import MIMEImage from django.conf import settings from django.forms import ModelForm, ValidationError, ChoiceField from django.forms.models import BaseInlineFormSet from django.forms.models import inlineformset_factory from django.contrib.auth.forms import ReadOnlyPasswor...
from dora.share import dump, load def test_dump_load(): x = [1, 2, 4, {'youpi': 'test', 'b': 56.3}] assert load(dump(x)) == x
# =============================================================================== # Author: Xianyuan Liu, xianyuan.liu@outlook.com # Raivo Koot, rekoot1@sheffield.ac.uk # Haiping Lu, h.lu@sheffield.ac.uk or hplu@ieee.org # =============================================================================== ...