text
stringlengths
3.07k
22.1k
####################################################################### # This file is part of Pyblosxom. # # Copyright (C) 2003-2011 by the Pyblosxom team. See AUTHORS. # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. ###############################################...
#!/usr/bin/env python from __future__ import print_function, unicode_literals import argparse import codecs import json import os import time from datetime import timedelta, datetime from pprint import pprint from slacker import Slacker import requests import shutil import subprocess SLACK_ACTIONS = ['post_message',...
# ______________________________________________________________________________ # importation import pygame import numpy as np from pygame.rect import Rect from pygame.gfxdraw import pie from math import sin, cos, fabs, acos, pi, inf from robot_soccer_python.constants import * from robot_soccer_python.utils import * ...
""" this class represents a cell stored in the data frame with its trace """ import copy import random from configuration import config # two special symbols used in the language HOLE = "_?_" UNKNOWN = "_UNK_" class TableCell(object): def __init__(self, value, exp): self.value = value self.exp = e...
import torch import numpy as np import torchvision from tqdm import tqdm POINT_GROUND_TRUTH = torch.tensor([ 0., 0., 255. ]) POINT_OUT_TRUE = torch.tensor([ 0., 255., 0. ]) POINT_OUT_FALSE_VOID = torch.tensor([ 0., 0., 0. ]) POINT_OUT_FALSE_SURFACE = torch.tensor([ 255., 0., 0. ]) def img2mse(img_src, img_tgt): ...
import bpy import bmesh import mathutils import os import math import bpy_extras class Node: def __init__(self, indented_line): self.children = [] self.level = len(indented_line) - len(indented_line.lstrip()) self.text = indented_line.strip() def add_children(self, nodes):...
"""Functions that link tokens together based on defined criteria and behavior.""" from lexer import Token class Graft(object): """As the name implies, a graft of the AST's leaves.""" __slots__ = ('value', 'index') def __init__(self, value, index): self.value = value self.index =...
import tkinter from math import * from built_in import * from user_define import * #------------------- devloper variable ---------------------------------- devloper = "<NAME>" version = "v1.0" #--------------------------- main window(root) ---------------------------- root = tkinter.Tk() root.title("ACulator") root.r...
def split_space_data( X_normalized, X, Y, file_path, observation_number, test_size ): '''Seperate the data in a stratified way. The function takes in a few different datasets, where the indices of each are aligned to be of the same object. | X_normalized...
#!/usr/bin/env python """ EM algorithm for learning rhyming words and rhyme schemes with independent stanzas. Original implementation: <NAME> (<EMAIL>), 2011. """ from __future__ import division, print_function, unicode_literals import argparse import json import logging import os import sys from collections import ...
# -*- coding: utf-8 -*- # Copyright (c) 2011, 2012, <NAME> <<EMAIL>> # 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 copyright notice, # ...
# -*- coding: utf-8 -*- # @Date : 2020/8/17 # @Author : mingming.xu # @Email : <EMAIL> # @File : two_stage_fine_tuning.py """ 实验验证 bert-of-theseus 中 theseus的必要性:即不添加theseus,训练完predecessor后直接使用其前三层与classifier做fine tuning 结果:即使对classifier 设置不同的学习率,结果依然无法突破bert直接3层fine tuning的结果,所以theseus还是需要的 blog: https://xv445...
import os import argparse import subprocess from tqdm import tqdm from semantic_text_similarity.models import WebBertSimilarity from semantic_text_similarity.models import ClinicalBertSimilarity web_model = WebBertSimilarity(device='cpu', batch_size=10) #defaults to GPU prediction # clinical_model = Clinic...
import numpy as np import time, json, pickle # activation functions def sigmoid(x,deriv=False): if deriv: return sigmoid(x)*(1-sigmoid(x)) return 1/(1+np.exp(-x)) def relu(x,deriv=False): if deriv: return (x>0).astype(int) else: return np.maximum(x,0) def softmax(inputs,deriv=...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Wk 1 Homework # Upload a single file named as # soc01hw-firstname-lastname.py # Include all exercised from A Few Things to Try sections. # If it says Optional, then the homework is of course optional, it is for those who would like more / or more advanced exercises. #I have not done any optional exercises. ...
# -*- coding: utf8 -*- """ @todo: Update argument parser options """ # Imports. {{{1 import sys # Try to load the required modules from Python's standard library. try: import os import argparse from time import time import hashlib except ImportError as e: msg = "Error: Failed to load one of the r...
import logging import uuid from abc import ABC, abstractmethod from copy import deepcopy from typing import List, Optional, Dict, Any import stopcovid.dialog.models.events from stopcovid.dialog.models.events import ( DrillStarted, ReminderTriggered, UserValidated, UserValidationFailed, CompletedPro...
from django.shortcuts import render, redirect from SystemModel import models from django.http import HttpResponse from django.contrib.auth import logout # Create your views here. idc=0 def login(request): return render(request, "./login.html") def studentLogin(request): if request.method == 'POST': ...
#!/usr/bin/python """This is a short description. Replace this with a more detailed description of what this file contains. """ import argparse import os.path as osp import os import time from datetime import datetime from collections import defaultdict as dd import numpy as np from tqdm import tqdm import torch imp...
"""CARLA Wrapper This script provides actor wrappers with continuous and discrete action control for the CARLA simulator. Classes: * BaseWrapper - wrapper base class * ContinuousWrapper - actor with continuous action control * DiscreteWrapper - actor with discrete action control """ import sys import os i...
import json import logging from datetime import datetime from pathlib import Path import matplotlib.pyplot as plt from dateutil import rrule import os """ btc_sentiment.py looks at the sentiment for all coins on Reddit by fetching sentiment scores for all coins overall and then plots the co...
import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import itertools from pandas.core.indexes import interval from scipy import signal import time class Make_dataset(): def __init__(self): self.list_i = [1]+list(range(3,22)) self.df_original = pd.read_csv("data/df_ori...
"""API fuzzer logic.""" from fastlog import log import json import os import itertools import copy import random from setup import add_slash, yes_no, enabled_disabled from rest_api_calls import send_payload from test_result import TestResult from random_payload_generator import RandomPayloadGenerator def load_jso...
import sys import os import json import struct import re import subprocess import shutil import string #constants TAGS = { 0x5: "color", 0xB: "name", 0xF: "voice", 0x6: "size", 0xC: "item", 0xD: "button", } names = { 1: "Veigue", 2: "Mao", 3: "Eugene", 4: "Annie", 5: "Tytre...
import cv2 import fitz import numpy as np import os from api.document_helpers.field_helper_geometry import detect_fillable_boxes, filter_non_lines, define_line_objects, find_closest from api.classes.Geometry import Point import glob def pix2np(pix): im = np.frombuffer(pix.samples, dtype=np.uint8).reshape(pix.h, pi...
import requests from bs4 import BeautifulSoup import os import sys import urllib import json import generate_pcm_from_wav from lib.functions import system_command, get_folder_final_info import socket import requests socket.setdefaulttimeout(120) # Loading config variables with open('config.json') as f: config = ...
from __future__ import print_function, division from warnings import warn from nilmtk.disaggregate import Disaggregator from keras.layers import Conv1D, Dense, Dropout, Reshape, Flatten import os import pickle import pandas as pd import numpy as np from collections import OrderedDict from keras.optimizers import SGD fr...
import time import re import yaml import collections from csmpe.context import PluginError from csmpe.core_plugins.csm_custom_commands_capture.plugin import Plugin as CmdCapturePlugin SUPPORTED_HW_SPECS_FILE = "./asr9k_x64/asr9k_x64_supported_hardware.yaml" ADMIN_RP = r"\d+/RS?P\d+" ADMIN_LC = r"\d+/\d+" def log_a...
from copy import deepcopy from pytest import raises import numpy import chaospy UNIVARIATE = chaospy.Uniform(-2, 3) MULTIVARIATE = chaospy.J(chaospy.Uniform(-1, 2), chaospy.Uniform(2, 4)) DEPENDENT1 = chaospy.J(UNIVARIATE, chaospy.Uniform(-2, 1)*UNIVARIATE) DEPENDENT2 = chaospy.J(UNIVARIATE, UNIVARIATE*chaospy.Unifo...
import os import common from pytz import timezone from datetime import datetime import pandas as pd import hashlib import yaml from copy import deepcopy common_dir = os.path.dirname(os.path.abspath(__file__)) config_path = os.path.join(common_dir, 'config.yml') types_map = {'categorical': str, 'float': ...
# -*- coding: utf-8 -*- """ Created on Thu Nov 18 21:03:14 2021 @author: wangy79 Generate ground truth and raw trajectories using TransModeler (TM) simulation data """ import utils import pandas as pd import matplotlib.pyplot as plt import numpy as np import utils_optimization as opt from tqdm import tqdm import rando...
import os, pickle, gzip, numpy as np from relpron_variational import load_scoring_fn, load_baseline_scoring_fn from testing import get_test_relpron, get_test_relpron_ensemble, get_relpron_separated, load_freq_lookup_dicts, convert_name, convert_settings from __config__.filepath import AUX_DIR from utils import cosine ...
from decimal import * from django.utils.translation import gettext_lazy as _ from task.models import Task from task.const import NUM_ROLE_PRICE ELECTRICITY = 1 GAS = 2 WATER = 3 WATER_SUPPLY = 4 SEWERAGE = 5 NOT_SET = 6 ELECTRICITY_2 = 7 LAND_TAX = 8 TV = 9 INTERNET = 10 PHONE = 11 COLD_WATER = 20 HOT_WATER = 21 HSC =...
from math import sqrt import torch from torch import nn, einsum import torch.nn.functional as F from einops import rearrange, repeat from einops.layers.torch import Rearrange from vit_pytorch.face_losses import CosFace, ArcFace, SFaceLoss, Softmax from vit_pytorch.do_conv_pytorch import DOConv2d from ConvLayers.dyna...
# Copyright 2018 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...
import os import torch.utils.data as data import numpy as np from PIL import Image, ImageFile import random from torchvision.transforms import ToTensor from torchvision import transforms import cv2 ImageFile.LOAD_TRUNCATED_IMAGES = True def is_image_file(filename): return any(filename.endswith(extension) for ext...
import mock import os import utils from core import checks, constants from plugins.rabbitmq.pyparts import ( cluster_checks, services, synchronization_checks, ) SYSTEMD_UNITS = """ UNIT FILE STATE rabbitmq-server.service enabled """ # noqa ...
""" CompositeType provides means to interact with `PostgreSQL composite types`_. Currently this type features: * Easy attribute access to composite type fields * Supports SQLAlchemy TypeDecorator types * Ability to include composite types as part of PostgreSQL arrays * Type creation and dropping Installation ^^^^^^^^...
import operator import warnings import numpy as np import pandas as pd from pandas import DataFrame, Series, Timestamp, date_range, to_timedelta import pandas._testing as tm from pandas.core.algorithms import checked_add_with_arr from .pandas_vb_common import numeric_dtypes try: import pandas.core.computation.e...
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # <NAME> (<EMAIL>), Blue Yonder Gmbh, 2016 """ Contains a feature selection method that evaluates the importance of the different extracted features. To do so, for every feature the influenc...
import torch import torch.nn.functional as F from torch import nn, optim from torch.utils.data import Dataset, TensorDataset, DataLoader, BatchSampler, RandomSampler from PIL import Image from datasets.cifar10.preprocess import transform class Client_Dataset(Dataset): def __init__(self, X, y, transform = transform...
# -*- coding: utf-8 -*- import re import string import time import unicodedata import argparse import getpass import requests import urllib import sys import os BANNER=""" .__ .__________ | | |__\_____ \ __ __ | | | |/ ____/| |...
""" Adapted from: extract_features.py Modification by: <NAME> Modification started: 2nd April 2019 large parts of this files are from many github repos mainly adopted from https://github.com/gurkirt/realtime-action-detection Please don't remove above credits and give star to these rep...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 <NAME> <EMAIL> # import logging log = logging.getLogger('view') from PyQt4 import QtGui, QtCore, QtOpenGL from PyQt4.Qt import Qt from .. import model LINE_SIZE = 512 PAGE_SIZE = 4096 # LINE_SIZE=512*4 # PAGE_SIZE=4096*16 class MemoryMappingSc...
import re from typing import Any, List, Tuple, Union from django.db.backends.base.base import BaseDatabaseWrapper from django.db.models.expressions import CombinedExpression, Expression, Value from django.db.models.fields import BooleanField, Field from django.db.models.sql.compiler import SQLCompiler class LexemeCo...
"""Test line_break_from_paper.""" # pylint: disable=invalid-name,fixme,line-too-long,bad-whitespace,too-many-instance-attributes,missing-function-docstring import textwrap import line_break_from_paper import line_adjust # The sample text from the paper: PAPER_TEXT = textwrap.dedent(""" We live in a print-orient...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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 ap...
# Copyright 2021, Google LLC. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
from six import string_types, text_type, PY2 import sys import copy import datetime import re if __name__ == "__main__": cron_type = 'cron_daily' arguments = copy.deepcopy(sys.argv) remaining_arguments = list() while len(arguments): if arguments[0] == '-type' and len(arguments) > 1: ...
import os os.environ["CUDA_VISIBLE_DEVICES"] = "1" import random import numpy as np from keras.layers import Dense, Activation, Dropout, Layer from keras.layers import SimpleRNN, Embedding, Bidirectional,TimeDistributed, Input, Flatten from keras.models import load_model import keras.backend as K import keras import p...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import sys sys.path.append('/home/jjw036/Roller/pipelines') import Pipelines as pl import numpy as np import pandas as pd from datetime import datetime import time from Swing.util.Evaluator import Evaluator import pickle import pdb def parse_metho...
from datetime import datetime, timedelta import re def check_time_in(pubtime: datetime, curtime: datetime, diff=60): # 60单位分钟 delta = (curtime - pubtime) return delta.days == 0 and delta.seconds // 3600 <= 1 now = datetime.now() MINUTE = 60 * 1 HOUR = MINUTE * 60 DAY = HOUR * 24 timestamp_pattern = re.co...
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. 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 re...
# Import Numpy, Matplotlib and csv reader import numpy as np import matplotlib.pyplot as plt import csv # Import Savitzky–Golay filter and command line input from scipy.signal import savgol_filter from parser import parse_input # Function to find lines of file - from online def file_len(fname): with open(fname) a...
# Copyright 2018 SAS Project 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 requ...
#!/usr/bin/python import traceback import pdb from ansible.module_utils.basic import AnsibleModule try: from viptela_python.viptela import Viptela HAS_LIB=True except ImportError: HAS_LIB=False ANSIBLE_METADATA = { 'metadata_version': '0.2.6', 'status': ['preview'], 'supported_by': 'communi...
import argparse import boto3 from datetime import datetime, date, timezone import gzip from io import BytesIO import json import logging from os import path import uuid import yaml # FIXME: refactor and generalize this to more log types for more scenarios # example: # python send_data.py # --account-id 05060362992...
#!/usr/bin/env python ########################################################################## # # Copyright 2011 <NAME> # All Rights Reserved. # # 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 Soft...
"""Utility functions with files""" import gzip import os import re import shutil import subprocess as sp import tarfile from contextlib import contextmanager from glob import glob from tempfile import TemporaryDirectory, mkdtemp from typing import Optional, Tuple, Union from zipfile import ZipFile from tqdm.auto impor...
import os import cv2 import numpy as np from torch.utils.data.dataset import Dataset from torch.utils.data.sampler import RandomSampler import matplotlib.pyplot as plt from timeit import default_timer as timer from utility.file import read_list_from_file from utility.draw import image_show from common import DATA_DIR ...
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation # All rights reserved. # # MIT License # # 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 limi...
import pytest from numpy.testing import assert_equal, assert_array_equal from thinc.api import get_current_ops from spacy.language import Language from spacy.training import Example from spacy.util import fix_random_seed, registry OPS = get_current_ops() SPAN_KEY = "labeled_spans" TRAIN_DATA = [ ("Who is <NAME>?...
#!/usr/bin/env python3 import os import sys import hashlib import struct import argparse class VmaHeader(): def __init__(self, fo, skip_hash): # 0 - 3: magic # VMA magic string ("VMA\x00") magic = fo.read(4) assert magic == b'VMA\0' # 4 - 7: version # ...
import inspect import re import traceback import typing as ty import warnings try: import asyncclick as click except ImportError: import click from docutils import nodes from docutils.parsers import rst from docutils.parsers.rst import directives from docutils import statemachine from sphinx import application...
#! /usr/bin/env python3 import os # bulletproofing if os.sys.version_info <= (3,0): print( "" ) print( "ERROR: Your python version [" + str( os.sys.version_info ) + "] is too old.\n" + \ " You must use version 3.0 or greater. \n" ) exit( 1 ) import shutil import platform import socket import res...
import keras from keras.layers.core import Layer import keras.backend as K import tensorflow as tf from keras.datasets import cifar10 from keras.models import Model from keras.layers import Conv2D, MaxPool2D, Dropout, Dense, Input, concatenate, GlobalAveragePooling2D, AveragePooling2D , Flatten import cv2 import nu...
#!/usr/bin/python # # portions referenced from Deepmind/pysc2 replay_actions.py # in accordance with the license below: # # Copyright 2017 Google Inc. 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 obt...
# -*- coding: utf-8 -*- ''' Return salt data via Slack using Incoming Webhooks :codeauthor: :email:`<NAME> <<EMAIL>>` The following fields can be set in the minion conf file: .. code-block:: yaml slack_webhook.webhook (required, the webhook id. Just the part after: 'https://hooks.slack.com/services/') slack...
from __future__ import with_statement import os import sys import hashlib import logging import tempfile import inspect pkg_digest = hashlib.sha1(__name__.encode('utf-8')) try: import pkg_resources except ImportError: logging.info("Setuptools not installed. Unable to determine version.") else: for path i...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your option) any later version. # # This program is distrib...
import copy import math import numpy as np import torch from torch import nn from torch.nn import functional as F import commons import modules from modules import LayerNorm class Encoder(nn.Module): def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., window_size...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals from ast import literal_eval import codecs from errno import EACCES, EPERM, EROFS import logging from operator import itemgetter import o...
''' Basic functions for reading and writing vtk images, scalars and vectors Not all vtk data types are supported, only those needed for BICCN standardized image datasets ''' import numpy as np # dataType is one of the types bit, unsigned_char, char, # unsigned_short, short, unsigned_int, int, unsigned_long, # lon...
"""Support for scripts.""" from __future__ import annotations import asyncio import logging from typing import Any, cast import voluptuous as vol from voluptuous.humanize import humanize_error from homeassistant.components.blueprint import BlueprintInputs from homeassistant.const import ( ATTR_ENTITY_ID, ATT...
#To run: xvfb-run -s "-screen 0 1400x900x24" python3 run_dist_script.py |& tee output_dist.log # -*- coding: utf-8 -*- import sys, types, time, random, os, copy import json import logging import copy import time from queue import PriorityQueue import pickle from logging import FileHandler, StreamHandler import gym i...
from molsysmt._private.exceptions import * from molsysmt.api_forms.common_gets import * import numpy as np from molsysmt import puw from molsysmt.native.molecular_system import molecular_system_components form_name='openmm.System' from_type='class' is_form={ 'openmm.System' : form_name, } info=["",""] has = mol...
""" Routines to load a corpus and perform the necessary pre processing on the audio files and labels. Contains helper methods to load audio files, too. """ import csv import os import random import numpy as np import python_speech_features as psf import tensorflow as tf from scipy.io import wavfile from asr.dataset....
# Copyright 2018 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 by applicable law or agreed to in writing, ...
#!/usr/bin/env python """ A script for converting SUMO's fcd-output into files readable by PHEM and communication simulators. @file traceExporter.py @author <NAME> @author <NAME> @author <NAME> @date 2013-01-15 @version $Id$ SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2013-2017 ...
#!/usr/bin/env python3 # Copyright 2019 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 by applicable law o...
import numpy as np import random import math import time def makespan(order, tasks, machines_val): times = [] for i in range(0, machines_val): times.append(0) for j in order: times[0] += tasks[j][0] for k in range(1, machines_val): if times[k] < times[k-1]: ...
import json import operator import pytest from flask import Blueprint, Flask, g, jsonify, request from flask.views import MethodView from flask_allows import ( Additional, Allows, And, C, Not, Or, Override, Permission, Requirement, exempt_from_requirements, guard_entire, ...
# pylint: disable=pointless-string-statement # Copyright (c) 2013 OpenStack Foundation. # # 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 # # U...
# from keras.datasets import mnist from keras.layers import * from keras.models import Model # from keras.utils.vis_utils import plot_model from keras.utils import np_utils import keras import keras.backend as K import numpy as np from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt # from IPytho...
#!/usr/bin/env python3 """Fetch holidays from gov.cn """ import argparse import json import re from datetime import date, timedelta from itertools import chain from typing import Iterator, List, Optional, Tuple import bs4 import requests SEARCH_URL = "http://sousuo.gov.cn/s.htm" PAPER_EXCLUDE = [ "http://www.go...
"""Utilities for managing github repos""" import datetime import os import time from typing import Optional, Union, Tuple import github3 import github3.pulls import github3.repos import github3.exceptions import github3.repos from doctr.travis import run_command_hiding_token as doctr_run from .xonsh_utils import env,...
#!/usr/bin/python # # 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 distribut...
""" Spike train statistics plots ---------------------------- .. autosummary:: :toctree: toctree/statistics/ plot_isi_histogram plot_time_histogram plot_instantaneous_rates_colormesh """ # Copyright 2017-2020 by the Viziphant team, see `doc/authors.rst`. # License: Modified BSD, see LICENSE.txt.txt f...
import sys import os import subprocess from sqlalchemy import create_engine, MetaData from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.automap import automap_base import json from datetime import datetime from time import sleep from random import random from re import sub from email.mime.text import MIMEText...
""" Manager and Serializer for histories. Histories are containers for datasets or dataset collections created (or copied) by users over the course of an analysis. """ import operator from sqlalchemy import desc, asc from galaxy import model from galaxy import exceptions as glx_exceptions from galaxy.managers import...
#!/usr/bin/env python """ EODataDown - provide the main class where the functionality of EODataDown is accessed. """ # This file is part of 'EODataDown' # A tool for automating Earth Observation Data Downloading. # # Copyright 2018 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier from sklearn.metrics import mean_squared_error from sklearn.utils import check_array from xgboost import XGBRegressor from ...
import collections import copy import math import os import matplotlib.pyplot as plt import numpy as np import habitat_sim import habitat_sim.bindings as hsim from habitat_sim.agent import AgentState from habitat_sim.utils.common import quat_from_two_vectors from habitat_sim.utils.data.data_structures import Extracto...
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: <EMAIL> # Maintained By: <EMAIL> import datetime from behave import given, when, then from iso8601 import parse_date from .utils import \ Exam...
# -*- coding: utf8 -*- """ ====================================== Project Name: NLP File Name: globalpointer_test_sujianlin Author: czh Create Date: 2021/8/9 -------------------------------------- Change Activity: ====================================== """ # 用GlobalPointer做中文命名实体识别 # 数据集 https://gi...
import socket import threading HEADER = 64 # Default length for a message that indicates next message's length PORT = 5050 SERVER = socket.gethostbyname(socket.gethostname()) ADDR = (SERVER, PORT) FORMAT = 'utf-8' known_users = [] active_users = [] organizations = [] msg_bank = [] server = socket.socket(socket.AF_I...
import torch from torchvision import datasets, transforms from torch.utils.data import DataLoader,Dataset import numpy as np import scipy.io import gzip import wget import h5py import pickle import urllib import os import skimage import skimage.transform from skimage.io import imread import matplotlib.image as mpimg ...
import os import numpy as np import math import rdkit.Chem as Chem import matplotlib.pyplot as plt import seaborn as sns class ComponentSpecificParametersEnum: __LOW = "low" __HIGH = "high" __K = "k" __TRANSFORMATION = "transformation" __SCIKIT = "scikit" __CLAB_INPUT_FILE = "clab_input_file"...
# MIT License # # Copyright (c) 2022 Quandela # # 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, pub...