text stringlengths 3.07k 12.6k |
|---|
from torch.utils.data import Dataset
import os,sys
sys.path.append('../')
import settings
import torch
import pandas as pd
import numpy as np
import cv2
from PIL import Image
from imgaug import augmenters as iaa
from sklearn.model_selection import KFold
config=settings.config
np.random.seed(8)
def ov... |
#! /Users/rkrsn/miniconda/bin/python
from __future__ import division
from __future__ import print_function
import os
import sys
from os import getcwd
from os import remove as rm
from os.path import expanduser
from random import randint
# Update PYTHONPATH
root = os.path.abspath(os.path.join(os.getcwd().split('src')[0... |
# -*- coding: utf-8 -*-
import torch
import pandas
import numpy
import argparse
import time
import os
import shutil
import matplotlib.pyplot as plt
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from data_to_dict import getTestSet,getTrainingSet,getTrainingBatch
from dataset import... |
"""
Sizun - Software Quality Inspection
MIT License
(C) 2015 <NAME>
"""
from flask import Flask, request, jsonify, Response
from flask.ext.cors import CORS, cross_origin
from sizun.controllers.filehandler import FileHandler
from sizun.controllers.rulehandler import RuleHandler
from sizun.errorhandlers.concrete_error ... |
from scipy.stats import pearsonr as pho
from scipy.spatial.distance import euclidean as eDist
import time
import numpy as np
import os
import six.moves.urllib as urllib
import tarfile
import tensorflow as tf
tf.logging.set_verbosity(0)
from matplotlib import pyplot as plt
from PIL import Image
from os import path
from ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 15:35:31 2020
@author: Moritz
"""
import sys
sys.path.append('../')
import numpy as np
import ampartrafficking.stochastic_model as sm
import ampartrafficking.rate_model as rm
#%%
def D_FP(kendo,kexo0,S_exo_0,kout,kin,Conc):
return ((kendo+kout)*Conc-kexo0*S_exo... |
import numpy as np
import pytest
from slise.utils import (
sigmoid,
log_sigmoid,
sparsity,
log_sum,
log_sum_special,
)
from slise.optimisation import (
loss_smooth,
loss_sharp,
loss_numba,
optimise_loss,
graduated_optimisation,
regularised_regression,
)
from slise.data import... |
import os
import json
import numpy as np
import tensorflow as tf
from cotk.dataloader import MSCOCO
from cotk.dataloader import LanguageGeneration
from cotk.wordvector import WordVector, Glove
from utils import debug, try_cache, SummaryHelper
import time
import random
from discriminator import Discriminator
from g... |
import numpy as np
from skimage.graph import MCP
from scipy.spatial.distance import cityblock
import traitlets
DUNGEON = [] # will eventually store the dungeon as numpy array
class Unit(traitlets.HasTraits):
"""
A generic class to represent units in the dungeon.
Eeally the only difference is what side ... |
"""
SPC's scripts to process gmx trajectories using gmxapi.
"""
def process_trajectory(
files,
path=".",
begin=0,
end=1.0e20,
skip=1,
output_group="all",
center_group="protein",
align=False,
name_base="",
name=None,
ndx_path="index.ndx",
tpr_path="topol.tpr",
cat_ov... |
import os
import numpy as np
import pickle
import tensorflow as tf
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.datasets import cifar10
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, LayerNormalization, BatchNorm... |
# Copyright (C) 2014 The Android Open Source Project
#
# 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 ... |
import sys
from json import dumps
from datetime import datetime
import time
import uuid
import re
import hashlib
import random
from os import path, mkdir, remove
# from flask_cors import CORS
from flask import Flask, request, jsonify
from db import *
import jwt
def encode(data):
return jwt.encode(data, "fivebluepe... |
# -*- coding: utf-8 -*-
# * Copyright (c) 2009-2018. Authors: see NOTICE file.
# *
# * 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... |
import datetime
import asyncio
import aiohttp
import discord
from discord.ext import commands
from pytz import timezone
import loadconfig
class mod(commands.Cog):
'''Praktische Befehle für Administratoren und Moderatoren'''
def __init__(self, bot):
self.bot = bot
def _currenttime(se... |
from src import DEFAULT_DATA_DIR
import logging
import time
from PIL import ImageDraw
from pathlib import Path
from src.pipeline.posenet_model import Posenet_MobileNet
from src.pipeline.movenet_model import Movenet
log = logging.getLogger(__name__)
KEYPOINTS = (
'nose',
'left eye',
'right eye',... |
# Copyright (c) 2016 Yubico AB
# 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, this list of conditi... |
from collections import defaultdict
import importlib
import logging
import time
import threading
import msgpack
import zmq
LOGGER = logging.getLogger("zmqdrpc-broker")
LOGGER.setLevel("INFO")
_ = logging.StreamHandler()
_.setLevel('INFO')
_.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(m... |
#
# ENVISIoN
#
# Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above... |
#!/usr/bin/env python
""" vis.py: A script to enable visualisation of N-body simulations in image and video formats.
PYTHONPATH=''
"""
import os
import numpy as np
import dask.array as da
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_too... |
import discord, asyncio
from discord.ext import commands
import logging
import time
import quote_manager as qm
import tag_manager as tm
import corpus_manager as cm
from quote_utils import qparse, to_filename, is_number
token = '<KEY>'
description = None
bot = commands.Bot(command_prefix='.', descripti... |
#!/usr/bin/env python
import sys, os, json, time
import lambda_function as lh
import request as Req
import response as Res
EVENT_FROM_ALB = {
u"body": u"",
u"requestContext":
{u"elb":
{
u"targetGroupArn": u"arn:aws:elb:ap-region-1:11:targetgroup/FROM_TARGET-GROUP/abc"
... |
# fault analysis
import numpy as np
import sys
sys.path.append('..')
import apis
from apis import apis_system
from apis import apis_basic
import network
def solve_bus_asymmetry_fault(node, fault_type, Zf):
'''
Solve the bus asymmetric short circuit fault after the situation.
Args:
... |
from django import forms
from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
ReadOnlyPasswordHashField)
from django.db.models import Q
from .models import User, UserFaceImage
from .utils import base64_file
from accounts.models import Profile
from PIL im... |
# coding=utf-8
# Copyright (c) 2020 Alibaba PAI team and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
import csv
import cv2
import numpy as np
import sklearn
import math
import gc
import tensorflow as tf
import pandas as pd
import json
import random
import csv
from keras.regularizers import l2
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, Dropout, ELU
from keras.layers.convoluti... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import subprocess
import numpy
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
def find_path(file_regexp):
# Search for a path containing the file matchin... |
import tflearn
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d, global_max_pool, global_avg_pool
from tflearn.layers.merge_ops import merge
from tflearn.layers.estimator import regression
import librosa
import numpy as np
from . import feature
im... |
from _random import Random
from collections import deque
from inspect import isgenerator
import os
import unittest
from hwt.doc_markers import internal
from hwt.hdl.constants import Time
from hwt.hdl.types.arrayVal import HArrayVal
from hwt.hdl.value import Value
from hwt.simulator.agentConnector import valToInt
from ... |
import argparse
import glob
import os
from typing import Tuple, List
import pygame
from pygame import Surface
import json
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 900
NORMAL_DELAY = 20
SPEEDUP_DELAY = 5
HALT_DELAY = 100
def load_target_image(path_to_images: List[str], index: int, screen_width: int) -> Tuple[Surface, T... |
import pytest
import pickle
import pandas as pd
import daskperiment
from daskperiment.backend import (init_backend, LocalBackend,
MongoBackend, RedisBackend)
from daskperiment.backend.base import maybe_mongo, maybe_redis
class TestInitBackend(object):
def test_local_init_str(... |
import _init_environment
from os import mkdir
from os.path import exists, join
import numpy as np
import torch
from gym_derk.envs import DerkEnv
from sklearn.preprocessing import MinMaxScaler
from torch import optim, nn
from torch.utils.data import Dataset, DataLoader
import config
from agent.bot import DerkAgent
fr... |
# -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... |
'''
show_traffic_collector.py
Parser for the following show commands:
* 'show traffic-collector external-interface'
* 'show traffic-collector ipv4 counters prefix <prefix> detail'
'''
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any,... |
# @Author: Ivan
# @LastEdit: 2020/9/25
import os
import argparse
import cv2 # install
from PIL import Image, ImageDraw, ImageFont # install
from keras.models import load_model
from keras import backend as K
import numpy as np # install
# input shape
width, height, depth = 100, 100, 3
def load_keras_model(path):
... |
#!/usr/bin/python3
import psycopg2 as psy
import affichage_tables as aff
import addTraitement as trait
import json
# ajout d'un animal
def InsertionAnimal(connexion):
print("Vous avez choisi d'inserer un animal")
id = input('Id: ')
while not id.isdigit():
id = input('Input invalide, veuillez entre... |
# This script will generate the Resources interface for Python.
# It uses the "bgen" package to generate C code.
# It execs the file resgen.py which contain the function definitions
# (resgen.py was generated by resscan.py, scanning the <Resources.h> header file).
from macsupport import *
class ResMixIn:
def che... |
import os
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
from typing import NoReturn
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
TRAIN_SET_PORTION = 0.75
REDUNDANT_FEAT = ["id", "date"... |
#
# Copyright (c) 2019, Neptune Labs Sp. z o.o.
#
# 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 agr... |
"""A set of commonly used functions."""
import hashlib
import random
import re
import time
import uuid
from typing import Any
import orjson
from pydantic import Field
def json_loads(data: str) -> Any:
"""Load JSON data."""
return orjson.loads(data)
def json_dumps(data: Any, *, default=None) -> str:
""... |
#!/usr/bin/env python
#=========================================================================
#
# Copyright NumFOCUS
#
# 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://... |
#!/usr/bin/env/python3
"""Extract connection status from my sky router and log them"""
from datetime import datetime
from sys import platform
import time
import argparse
import ctypes
import logging
import sky_router_data
import utils
def display_system_details(router_system):
display_helper ... |
'''
Created on Dec 29, 2015
@author: <NAME> <<EMAIL>>
'''
from __future__ import division, absolute_import
import numpy as np
from ..binary_response.sparse_mixtures.lib_spr_numeric import \
LibrarySparseNumeric
from .pc_base import PrimacyCodingMixin
from utils.math import take_popcount
def nlargest_indices(... |
import re
from collections import defaultdict
from typing import Tuple, List
from LexicalException import LexicalException
tokens_list = ["identifier", "constant", "[", "]", "{", "}", "(", ")", ":", ";",
"+", "-", "/", "*", "<", ">", "<=", ">=", "==", "=", "!=", "if", "else", "for", "while", "pr... |
import html2text
import os
from pynliner import Pynliner
from .util import (
format_paymentInfo,
format_payment,
format_date,
display_form_dict,
human_readable_key,
)
from pydash.objects import get
import logging
from jinja2 import Environment, Undefined
import flatdict
from chalicelib.config import... |
import tensorflow as tf
# https://github.com/tensorflow/tensorflow/blob/b07791f6e9b306937eb58f7bb6c3300cd26583af/tensorflow/python/training/optimizer.py
# https://github.com/tensorflow/tensorflow/blob/b07791f6e9b306937eb58f7bb6c3300cd26583af/tensorflow/python/training/adam.py
from tensorflow.python.framework import ... |
"""
Module with all Payment Expirience Web Profiles related entities.
"""
from enum import Enum
from typing import Type, List
from pypaypal.entities.base import (
T,
PayPalEntity,
ResponseType
)
class LandingPageType(Enum):
BILLING = 1
LOGIN = 2
class UserAction(Enum):
CONTINUE = 1
... |
from json import dump
from selenium import webdriver
from urllib.parse import urlparse, parse_qs
from requests import post, get
def getCode():
driver = webdriver.Edge(executable_path=r'C:\Program Files (x86)\Microsoft\Edge\Application\msedgedriver.exe')
driver.get('https://login.live.com/oauth20_authorize.srf?clien... |
#!/usr/bin/env python
# Copyright 2015 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.
import argparse
import logging
import os
import platform
import subprocess
import sys
import tempfile
# The path to the "infra/bootst... |
"""PyTorch implementation of Wide-ResNet taken from
https://github.com/jeromerony/fast_adversarial/blob/master/fast_adv/models/cifar10/wide_resnet.py"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.FiLM import FiLM_Layer
from models.DualBN import DualBN2d
class BasicBlo... |
import argparse
from collections import defaultdict
import logging
import sys
import numpy as np
import minn
import minn.contrib.functions as F
class Vocab(object):
def __init__(self):
self.w2i = defaultdict(lambda: len(self.w2i))
def add(self, word):
return self.w2i[word]
def get(sel... |
from . import connected_components_double_threshold
from . import crop
from . import threshold
import logging
import sys
import os
from CNNectome.utils import config_loader
shapes = {
"A+": (125, 1529, 1448),
"B+": (125, 1701, 2794),
"C+": (125, 1424, 1470),
"A": (125, 1438, 1322),
"B": (125, 1451,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__email__ = "<EMAIL>"
from ddf_library.bases.context_base import ContextBase
from ddf_library.bases.metadata import OPTGroup
from ddf_library.ddf import DDF
from ddf_library.bases.ddf_model import ModelDDF
from ddf_library.utils import generate_in... |
"""Unit Tests for radio_box/client.py."""
from pathlib import Path
from typing import Dict
from unittest.mock import MagicMock, call, patch
import pytest
from radio_box.client import PLAY, QUIT, STOP, main, parse_args, play, quit_, stop, yaml
def test_parse_args(mocker):
"""Test that argument parser is configur... |
from . import constants, utils
class Base:
def __init__(self, response):
self.response = response
class Player(Base):
def __init__(self, response):
super().__init__(response)
self.name = self.response.get('displayName')
self.id = self.response.get('id')
class... |
from bisect import bisect_left as bisect
import random
def coding_problem_11(strings, prefix):
"""
Implement an autocomplete system. That is, given a query string s and a dictionary of all possible query strings,
return all strings in the dictionary that have s as a prefix. Hint: Try pre-processing the di... |
#!/usr/bin/env python
"""docker monitor using docker /events HTTP streaming API"""
import os
from contextlib import closing
from functools import partial
from socket import AF_UNIX
from subprocess import Popen, PIPE
from sys import version_info
import json
import shlex
import logging
import logging.config
import socket... |
import json
import time
import requests
from struct import unpack, pack
MDNS_TEMPLATE = r'http://{0}:{1}@eagle-{0}.local/cgi-bin/post_manager'
ADDR_TEMPLATE = r'http://{0}:{1}@{2}/cgi-bin/post_manager'
CMD_TOP_TEMPLATE = r'''<Command>\n
<Name>{0!s}</Name>\n
<Format>JSON</Format>'... |
from __future__ import print_function
import argparse
import pandas as pd
import numpy as np
import json
from function import read_merged_data, extract_feature_and_label, reshape_data_into_2_dim
from xgboost import XGBClassifier
from sklearn.linear_model import LogisticRegression
from random_forest_classification impo... |
"""
consensys_utils.flask.cli
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flask application CLI commands
:copyright: Copyright 2017 by ConsenSys France.
:license: BSD, see :ref:`license` for more details.
"""
import click
import flask
from click.decorators import _param_memo
from flask.cli import DispatchingApp... |
"""Pytest utility classes, functions and fixtures."""
import inspect
import os
import types
import numpy as np
import pytest
import geomstats.backend as gs
smoke = pytest.mark.smoke
random = pytest.mark.random
def autograd_backend():
"""Check if autograd is set as backend."""
return os.environ["GEOMSTATS_... |
#!/usr/bin/env python
"""Rountines to deal with quantum statistics of bosons and fermions"""
from __future__ import division, print_function
import numpy as np
import scipy.sparse as sp
#############################################
# Distinguishable manybody quantum sytems #
#######################################... |
import jaydebeapi
import requests
import time
class HsqlDBClient:
SQL_QUERY = """
select status_info.subject_id, status_info.fcm_token, status_info.notification_task_uuid,
status_info.fcm_message_id, status_info.delivered, notification_info.title, notification_info.ttl_seconds,
notification_info.mes... |
from flask import Flask, jsonify, request, abort,render_template,session,redirect,url_for
from ShopDAO import ShopDAO
#app = Flask(__name__, static_url_path='', static_folder='.')
app = Flask(__name__)
app.secret_key = '<KEY>'
#<EMAIL>.route('/')
#def index():
# return "Hello, World!"
@app.route('/')
def index():... |
"""Fill gaps in Python time API-s.
parse_iso_timestamp:
Parse reasonable subset of ISO_8601 timestamp formats.
[ http://en.wikipedia.org/wiki/ISO_8601 ]
datetime_to_timestamp:
Get POSIX timestamp from datetime() object.
"""
import re
import time
from datetime import datetime, timedelta, tzinfo
__all__... |
# Copyright 1999-2021 Alibaba Group Holding 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 applicable law or a... |
import nolds
import numpy as np
from scipy.stats import chi2_contingency
def max_lyapunov_exp(data, delay=None, emb_dim=3,
min_tsep=None, min_neighbors=20,
tau=1, trajectory_len=20,):
"""
Parameters:
-----------
data (array-like of float):
input data
... |
def split_query(q):
"""
Split input query into components
"""
pos = 0
start = 0
level = 0
is_function = False
while pos < len(q):
if q[pos] in """([{'""":
level += 1
elif q[pos] in """)]}'""":
level -= 1
if level == 0:
y... |
'''
script to test the functionality of model_gen
'''
# my imports
import init_path
from config.config import get_config
# import os
import pdb
from env import fish_env_wrapper
from env import walker_env_wrapper
# import lxml
import lxml.etree as etree
import numpy as np
# local imports
from env import model_gen... |
import matplotlib as mpl
from ..common.data_plotter import *
from ..classifier.perceptron import Perceptron
from .aad_support import *
"""
bash ./aad.sh toy2 35 1 0.03 7 1 0 2 512 0 1 1
"""
logger = logging.getLogger(__name__)
def get_angles(x, w):
n = x.shape[0]
a = np.zeros(n, dtype=float)
# logger... |
import logging
import os
import numpy as np
import tensorflow as tf
from ..Network.networks import ActorNetwork, CriticNetwork
from ..Noise.ou_action_noise import OUActionNoise
from ..Buffer.buffer import ReplayBuffer
def update_target(model_target, model_ref, rho=0):
'''
Update target's weights with the give... |
# Copyright 2021 Huawei Technologies Co., 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 applicable law or agreed to... |
import ntpath
import pandas as pd
import numpy as np
from sklearn import metrics
import math
class Trial:
"""Class to hold all relevant info of a single tape response assay trial."""
def __init__(self, path_to_file):
self.path_to_file = path_to_file
self.trial_name = ntpath.basename(path_to_fi... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import datetime
import sys
import MySQLdb
conn = MySQLdb.connect(host="192.168.1.3", user="yaca", passwd="<PASSWORD>", db="yaca")
cursor = conn.cursor()
def unhex(s):
hexchars = '0123456789ABCDEF'
hexchars2 = '0123456789abcdef'
hexsum = 0
for i in range(0, len(s)):... |
#!/usr/bin/env python
# encoding: utf-8
import datetime
import proxies
import util
def get_suggested_users(results=10):
get_function = proxies.get_json_resource
raw = proxies.get_listed_things(get_function, "suggestedPeople", 'people', results)
return [TIMJUser(**util.fix(raw_person)) for raw_person in ra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This file is part of the django ERP project.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND ... |
import os
import sys
import numpy as np
import torch
from torch import nn, optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
from tqdm import tqdm
# our code
import pi
from datasets import davis17
from models.unet_model import UNetMedium, UNetSmall
sys.path.append(o... |
import torch
from scipy.misc import imresize
from scipy.ndimage.interpolation import zoom
import numpy as np
from path import Path
import argparse
from tqdm import tqdm
from ptsemseg.models.fcn_depth import *
from ptsemseg.models.segnet_depth import *
from ptsemseg.models.frrn_depth import *
from ptsemseg.models.deep... |
from django.db.models import Q
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.decorators import api_view
from django.utils import timezone
from company.models import Company
from company.serializers import CompanySerializer
from jobapps.models import Sourc... |
# coding=utf-8
"""
Map a signal track from one species/assembly to another
"""
import os as os
import numpy as np
import pandas as pd
import collections as col
import multiprocessing as mp
import psutil as psu
from crplib.metadata.md_signal import gen_obj_and_md, MD_SIGNAL_COLDEFS
from crplib.auxiliary.file_ops impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: hgnc.py
"""
import copy
import datetime
import gzip
import json
import os
import re
import sys
import tempfile
from pathlib import Path
from typing import TextIO
import structlog
import yaml
import app.settings as settings
import app.setup_logging
import typ... |
#!/usr/bin/env python
# Copyright (C) 2021 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance... |
#!/usr/bin/env python3
import curses
import logging
import os
import re
import time
from socket import socket, socket_collection
class screen:
def __init__(self, stdscr, sockets, config):
self.scr = stdscr
self.sockets = sockets
self.config = config
def refresh(self):
self.scr.clear()
i = 1
for sock in... |
"""
Usage: ec2.py [options]
Options:
--profile PROFILE profile to use for AWS access. Note that you can
update multiple accounts by using a wildcard '*' in
the profile name, like this:
python ec2.py --profile Aut... |
import contextlib
from itertools import chain
import logging
import sys
import time
from typing import Any, Dict, List
import torch
import numpy as np
import os
from fairseq.modules import TransformerSentenceEncoderLayer
from fairseq.models.roberta import RobertaModel
# INSTRUCTIONS
# Run this script in the I-BERT di... |
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import tensorflow as tf
from tensorflow import keras
from tensorflow.python import ipu
from outfeed_callback import OutfeedCallback
from outfeed_optimizer import OutfeedOptimizer, OutfeedOptimizerMode
import outfeed_layers
from outfeed_wrapper import MaybeOutfee... |
"""
Description: Command line application which extends YaraBuilder to parse a JavaScript file,
and output a YARA rule based off the variable/function names of the script
Author: @BitsOfBinary
License: MIT
"""
import re
import argparse
import yarabuilder
class YaraBuilderJavaScriptParser(yarabuilder.YaraBuilder):
... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_slides.tests import common as slides_common
from odoo.tests.common import users
class TestSlidesManagement(slides_common.SlidesCase):
@users('user_publisher')
def test_get_categorized_... |
import pytest
from api.users.serializers import UserSerializer
from api_tests.utils import create_test_file
from osf_tests.factories import (
UserFactory,
RegistrationFactory,
WithdrawnRegistrationFactory,
PreprintFactory,
ProjectFactory,
InstitutionFactory,
OSFGroupFactory,
)
from tests.u... |
import json
from rest_framework import serializers
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from .models import Author, FriendRequest, Post, Comment, Like
from .converter import *
class AuthorSerializer(serializers.ModelSerializer):
type = serializers... |
"""Test for stocal.examples
Most tests simply check that the example can be run without error.
"""
import unittest
import sys
import os
from stocal.tests.test_transitions import TestReactionRule as TestTransitionRule, TestMassAction
from stocal.examples.pre2017 import DegradationRule
from stocal.examples.pre2017 imp... |
#!/usr/bin/env python
import csv
import io
import re
import sys
import requests
import lxml.html
from os.path import dirname, join as pjoin
CURRENT_URL = 'http://www.suttonkersh.co.uk/properties/listview/?section=auction&auctionPeriod=current&perPage=all' # noqa
TABLE_ROW_XPATH = "//tr[contains(@id, 'header_')]"
... |
import torch
import numpy as np
import torch.nn.functional as F
from torch.nn.utils.rnn import pad_sequence
#reference https://github.com/allenai/allennlp/blob/a7265c04078964ea2b80a78fc3967bde8d16072d/allennlp/nn/util.py#L403
@torch.jit.script
def viterbi_decode_single_jit(tag_sequence, transition_matrix):
top_k ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains functionality for Maya windows
"""
from __future__ import print_function, division, absolute_import
from Qt.QtCore import Qt, QSize
from Qt.QtWidgets import QWidget, QMainWindow
import maya.cmds
import maya.OpenMayaUI
import maya.app.general.ma... |
# ------------------------------------------------------------------------------
# Multi-Centre, Multi-Vendor & Multi-Disease Cardiac Image Segmentation
# Challenge (M&Ms) dataset.
# ------------------------------------------------------------------------------
import os
import numpy as np
import csv
import SimpleITK... |
#!/usr/bin/env python
# encoding: utf-8
# <NAME>, 2006-2010 (ita)
"""
Support for translation tools such as msgfmt and intltool
Usage::
def configure(conf):
conf.load('gnu_dirs intltool')
def build(bld):
# process the .po files into .gmo files, and install them in LOCALEDIR
bld(features='intltool_po', appna... |
import abc
import ast
import os
import six
import sys
from django.conf.urls import url
from django.contrib import messages
from django.shortcuts import redirect
from job_system_api.models import JobSource, JobTemplate, \
JobParameterDeclaration, JobParameterDeclarationChoice
@six.add_metaclass(abc.ABCMeta)
clas... |
"""Lock files are created to prevent multiple people from grading an assignment simultaneously."""
import collections
import csv
import os
import time
from datetime import datetime, timedelta
from typing import Union
from zygrader import logger, utils
from zygrader.config.shared import SharedData
from .model import ... |
"""
Run searches and write files.
"""
from __future__ import annotations
import functools
import time
from dataclasses import dataclass
from datetime import timedelta
from pathlib import Path
from typing import Sequence
from pocketutils.core.exceptions import IllegalStateError
from typeddfs import Checksums, TypedDf... |
from scene import *
import random
negative_textures = [Texture('card:HeartsA'), Texture('card:Hearts2'), Texture('card:Hearts3'), Texture('card:Hearts4'), Texture('card:Hearts5'), Texture('card:Hearts6'), Texture('card:Hearts7'), Texture('card:Hearts8'), Texture('card:Hearts9'), Texture('card:Hearts10'), Texture('car... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.