text stringlengths 957 885k |
|---|
def main():
import argparse
import os
parser = argparse.ArgumentParser(description='')
parser.add_argument('--cutoff', type=str, help='')
parser.add_argument('--prd', type=str, nargs='*', default='S J F O',
help='The CFI initial letter for each product category to be downloa... |
<reponame>worldmaker18349276/K-AIKO<filename>kaiko/menu/profiles.py<gh_stars>1-10
import os
import traceback
import tempfile
import subprocess
from pathlib import Path
from kaiko.utils import config as cfg
from kaiko.utils import biparsers as bp
from kaiko.utils import commands as cmd
from kaiko.utils import datanodes ... |
"""
nnabla trainers and models
"""
import os
import time
from functools import partial
#https://neon.nervanasys.com/index.html/models.html
import neon as nn
class Trainer(object):
def __init__(self, model, ngpu, options=None):
self.model = model
self.ngpu = ngpu
self.gpu_mode = True if ngp... |
<filename>distances_rkhs.py
"""
Pairwise distance functions between time series in a RKHS
=========================================================
They all have the following prototype:
function(K, T1, T2, **kwargs)
"""
import numpy as np
from scipy.linalg import solve, eigvals, inv
from scipy.signal impor... |
from datetime import datetime, timedelta
from random import randrange
from uuid import uuid4
from flask import Blueprint, jsonify, request, url_for
from flask_login import current_user, login_required
from ..helper import admin_required_decorator as admin_required
from ..helper.youtube import build_youtube_api
from .... |
<gh_stars>0
import gym
from gym import spaces
from gym.envs.registration import EnvSpec
from gym.utils import seeding
import numpy as np
import pandas as pd
from enum import Enum
import matplotlib.pyplot as plt
from typing import Union, Tuple
class Actions(Enum):
"""
Actions agents can take in the environment... |
#!/usr/bin/env python3
"""
A script for calculating the best uptake and depuration constants given historical data as input.
"""
import argparse
import pandas as pd
import numpy as np
from math import isnan,sqrt
from statistics import mean
import os
def calc_rms(x,y):
"""
Calculate the root mean square deviat... |
<filename>tracker/materials/db.py
import datetime
from typing import Optional
from uuid import UUID
import sqlalchemy.sql as sa
from sqlalchemy.engine import RowMapping
from tracker.common import database, models
from tracker.common.log import logger
from tracker.materials import schemas
async def get_materials(*,
... |
<filename>tests/integration/test_integration_scan.py
import cloudpassage
import datetime
import os
import pytest
from cloudpassage.utility import Utility as utility
config_file_name = "portal.yaml.local"
tests_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
config_file = os.path.join(tests_dir, "... |
import torch
from collections import OrderedDict
import torchvision.transforms as transforms
from PIL import Image
import numpy as np
from .discriminator import Discriminator
from .generator import Generator
from .loss import Loss
from ..common import utils as util
from .blocks import *
import os
class DarkNight():
... |
from typing import List
from typing import Mapping
from typing import Optional
import logging
import pathlib
import os
import json
import shutil
import structlog
import click
from covidactnow.datapublic.common_fields import CommonFields
from covidactnow.datapublic.common_fields import FieldName
from libs import googl... |
# Copyright 2014 The Chromium OS 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 logging
import re
import time
from cros.factory.device import device_types
from cros.factory.device import sensor_utils
from cros.factory.utils im... |
<filename>algorithm/BrainAC.py
import numpy as np
import tensorflow as tf
import copy
np.random.seed(1)
tf.set_random_seed(1)
class ActorCritic():
def __init__(
self,
n_actions=2,
n_features=87,
LR_A = 0.001, # learning rate for actor
LR_C = 0.01, # lear... |
# -*- coding: utf-8 -*-
import time, os
#import re, sys
from decode import decoder
from combine import csvcombine
dir_path = './' #Default path
confirm = ['true','yes','1'] #Possible responses to indicate "True"
deny = ['false','no','0'] #Possible responses to indicate "False"
try:
dir_path = os.p... |
<filename>examples/regular_2d_mesh_tally_example.py
# A minimal example that obtains TBR on the blanket and fast neutron flux on all
# cells in the DAGMC geometry.
# Particular emphasis is placed on explaining the openmc-dagmc-wrapper
# extentions of openmc base classes.
import openmc
import openmc_dagmc_wrapper as o... |
<reponame>C3BI-pasteur-fr/ReMoTE
#!/usr/bin/env python
from lxml import etree
import json
import argparse
import requests
import os.path
import getpass
from requests.packages import urllib3
ns = {'btr':'http://biotoolsregistry.org'}
HOST = 'https://bio.tools'
SSL_VERIFY = False #verify SSL certificates
def auth(log... |
<gh_stars>0
import random
import numpy as np
import torch
from metrics.average_meter import AverageMeter
from metrics.average_ensemble_meter import AverageEnsembleMeter
from models.shapes_trainer import ShapesTrainer
class TrainHelper():
def __init__(self, device):
self.device = device
def train_one... |
<gh_stars>0
#!/usr/bin/env python
"""
.. py:currentmodule:: experimental.nanopico.test_LogFile
.. moduleauthor:: <NAME> <<EMAIL>>
description
"""
# Script information for the file.
__author__ = "<NAME> (<EMAIL>)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2012 <NAME>"
__license__ = ""
# Standard l... |
#!/home/alus_soft/matt_EMAN2/bin/python
####################################################################################################
from EMAN2 import *
import mrcfile
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
#######################################################################... |
<filename>train.py
from keras.preprocessing import sequence
import nltk
import numpy as np
import pandas as pd
import os
import random
import tensorflow as tf
from config.msrvtt_config import *
from nets.obj_feat_att_net import VideoCaptionGenerator
from utils.msrvtt_utils import get_video_data, preProBuildWordVocab
... |
<reponame>ivanmkc/helpdesk-assistant<filename>data_generation/common_nlu/common_intent_creators.py
from data_generation.common_nlu.parameterized_intents import (
ParameterizedIntentCreator,
)
from actions import find_objects_action as find_objects_action
intent_is_there_a_type_creator = ParameterizedIntentCreator... |
# -*- coding: utf-8 -*-
__ver_major__ = 0
__ver_minor__ = 3
__ver_patch__ = 0
__ver_sub__ = "dev"
__version__ = "%d.%d.%d" % (__ver_major__, __ver_minor__, __ver_patch__)
"""
:authors: <NAME>
:copyright: Copyright 2019, BYaka
:license: Apache License 2.0
:license:
Copyright 2019 BYaka
Licensed under the Apache... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... |
<reponame>ihaeyong/drama-graph<gh_stars>1-10
import os
import pandas as pd
import numpy as np
from tqdm import tqdm
import librosa
from sklearn.utils import shuffle
from utils import extract_features, read_audio_file
delta = False
def addSmpls(train, test, samples, class_name):
randf = np.random.rand(le... |
# Variables y Comentarios
# Cadena de caracteres String
"""
Este es un comentario de muchas lineas que describe este programa escrito en python
TODO Debemos de limpiar este codigo mas, es decir separarlo por funciones
FIXME Debemos de corregir el codigo que a veces da errores en la linea 4
"""
palabra = "esta es una pa... |
import struct
import wtforms
from wtforms.validators import Length, NumberRange
from . import core
class BasicBinaryField(core.BinaryField):
# Some BinaryFields will have inherent value restrictions, based on the
# limitations of the serialized form. For example, a UInt8Field cannot
# store numbers abov... |
'''
This reads images from caltech256 and makes them into tfrecords file.
'''
import tensorflow as tf
import numpy as np
from PIL import Image
import os
import shutil
main_dir='/media/yukun/Barracuda Hard Drive 2TB/Data/Caltech256'#The main directory to work in
num_tffile=5#The number of tfrecord files to create.... |
<filename>tests/setup.py<gh_stars>1-10
import unittest
class Setup(unittest.TestCase):
"""A Class to host all the Setup data to avoid a lot of copy pasting between modules"""
def setUp(self):
"""!killmails dont have items!
C O M P L E T E :
uk00 = complete Killmail
A T T A C... |
# Copyright 2015 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import bisect
import math
import os
import operator
import random
import six
import sys
import yaml
from collections import defaultdict
from marisa_trie import BytesTrie
from geodata.text.phrases import PhraseFilter
from geodata.encoding import safe_encode, safe_decode
from geodata.i18n.unicode_paths import DATA_DIR
... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:44:05 2020
@author: Andy
"""
import os
import re
import time
from datetime import datetime
from random import randrange
# Extract table content in each Oracle script
def LoadTableContent(filename):
with open(os.path.join(oracle_path, filename), ... |
<filename>channels/saghe.py
# -*- coding: utf-8 -*-
# StreamOnDemand Community Edition - Kodi Addon
# ------------------------------------------------------------
# streamondemand - XBMC Plugin
# <NAME>"
# http://www.mimediacenter.info/foro/viewforum.php?f=36
# ----------------------------------------------------------... |
<reponame>ChangHoon-Sung/streamlit
# Copyright 2018-2022 Streamlit 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 b... |
# encoding=utf8
import sys
import spacy as sp
from flask import Flask, request, jsonify, session
from flask_cors import CORS, cross_origin
import urllib.request
import urllib.parse
app = Flask(__name__)
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
CORS(app, support_credentials=True)
#print('Initiating ontology server...'... |
<gh_stars>1-10
# Module: Natural Language Processing
# Author: <NAME> <<EMAIL>>
# License: MIT
def setup(data,
target=None,
custom_stopwords=None,
session_id = None):
"""
Description:
------------
This function initializes the environment in p... |
from mirage.core import scenario, interpreter, module
from mirage.libs import io, ble, bt, utils
from mirage.libs.ble_utils.firewall import *
import configparser,os.path,subprocess
class mitm_test(scenario.Scenario):
def onStart(self):
self.a2sEmitter = self.module.a2sEmitter
self.a2sReceiver = se... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.urls import reverse
from mock import patch
from rest_framework import status
from rest_framework.test import APITestCase
from referral.faker_factories import FakeCampaignFactory, faker
from referral.models import Campaign
cl... |
from django.utils.translation import ugettext as _
from django.db import models
from django.utils.safestring import mark_safe
from django.core.files.storage import FileSystemStorage
from django.conf import settings
import os
# Visualization XML templates:
#
# These files are designed and uploaded by an administrator... |
import argparse
import os, time
import numpy as np
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
import torch
import models
import utils
from matplotlib.backends.backend_pdf import PdfPa... |
from VintageousPlus.vi.utils import modes
from VintageousPlus.state import State
from VintageousPlus.tests import get_sel
from VintageousPlus.tests import first_sel
from VintageousPlus.tests import ViewTest
from VintageousPlus.ex_commands import CURRENT_LINE_RANGE
class Test_ex_copy_Copying_InNormalMode_SingleLine... |
<filename>src/openprocurement/tender/simpledefense/tests/tender_blanks.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from copy import deepcopy
from datetime import timedelta
from openprocurement.tender.belowthreshold.tests.base import test_organization, test_criteria
from openprocurement.api.constants import NOT_REQUIRED_A... |
<reponame>slamavl/quantarhei
# -*- coding: utf-8 -*-
"""
*******************************************************************************
MODIFIED REDFIELD RATE MATRIX
*******************************************************************************
"""
import numpy
from scipy import integrate
import scipy
fr... |
from flask import Flask, render_template, request, session, redirect, Markup, jsonify
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
import requests
from xml.etree import ElementTree
app = Flask(__name__ ,template_folder='template')
app.secret_key = 'key'
app... |
# pylint: disable=no-self-use,invalid-name
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.fields import TextField, ListField, SequenceLabelField, LabelField, SpanField
from allennlp.data.tokenizers.token import Token
import pytest
from propara.propara.data import ProStructDatasetReader, _find_... |
<reponame>LSaffin/scripts
"""Cross sections of theta_e at different points along a front
"""
from string import ascii_uppercase
import numpy as np
import matplotlib.pyplot as plt
import iris.plot as iplt
from irise import convert, grid
from irise.plot.util import multilabel, add_map
from myscripts.models.um import cas... |
<filename>src/kalman/scripts/kfilter/kfilter.py
import math
import numpy as np
from gmap import GlobalMap
from gposition import GlobalPosition
from math import cos, sin
from scipy.linalg import block_diag
from threading import Lock
def scale_angle(angle):
while angle <= -math.pi:
angle = angle + 2*math.pi... |
import utils
import logging
import json
import requests
from threading import Thread
import pycarwings2
import time
from time import sleep
from configparser import SafeConfigParser
import sys
import datetime
from datetime import datetime
import _thread
import traceback
class LeafHandler(utils.BaseApp):
#Persiste... |
<filename>main.py
# -*- coding: utf-8 -*-
import argparse
from functools import partial
import re
import os
from toolz.curried import curry, memoize
from toolz import curried as tz
import pandas as pd
import numpy as np
import scipy
import networkx as nx
from gensim.summarization import keywords, summarize
import ... |
<filename>manifest_lambda/tests/unit/test_iiifImage.py
import unittest
import json
import os
from pathlib import Path
from iiifImage import iiifImage
current_path = str(Path(__file__).parent.absolute())
media_extensions_list = ['.mp3', '.mp4', '.pdf', '.wav']
class Test(unittest.TestCase):
def setUp(self):
... |
# Copyright 2016 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... |
<filename>scripts/generate_farfield_scattering_movie.py
import sys, os, time
from tqdm import tqdm
import numpy as np
import matlab.engine
import ott_plotting
ott_plotting.update_base_plotting_directory(\
'/home/cblakemore/plots/ott_farfield/movies')
base_data_path = '../raw_data/movies/zsweep_test'
###... |
<reponame>CodingNowNow/jiaoyi<filename>testdata.py
#!/usr/bin/python
# -*- coding: utf8 -*-
# cp936
import tables
class FiveMinDataRecordH5File(tables.IsDescription):
datetime = tables.UInt64Col() #IGNORE:E1101
openPrice = tables.UInt32Col() #IGNORE:E1101
highPrice = tables.UInt32Col() ... |
import pathlib
study_name = "age-prediction-benchmark"
bids_root = pathlib.Path(
'/storage/store/data/camcan/BIDSsep/rest')
deriv_root = pathlib.Path('/storage/store3/derivatives/camcan-bids/derivatives')
subjects_dir = pathlib.Path('/storage/store/data/camcan-mne/freesurfer')
source_info_path_update = {'proce... |
from __future__ import print_function
import inspect
import os
import subprocess
import sys
from pprint import pprint
import pytest
from hunter import Backlog
from hunter import CallPrinter
from hunter import CodePrinter
from hunter import Debugger
from hunter import ErrorSnooper
from hunter import Q
from hunter imp... |
<gh_stars>1-10
import numpy as np
# import pdb
def PMTcm_defaultout(n_traces, n_windows):
default_output = dict(nPMThit=n_traces +
np.zeros([n_traces], dtype=np.int32),
iPMThit=1 +
np.arange(n_traces, dtype=np.int32),
... |
<gh_stars>10-100
from jabber.objects.x_event import X_Event, X_EVENT_NS
from jabber.objects.chatstates import ChatState, CHATSTATES_NS
from common.Conversation import Conversation
from pyxmpp.message import Message
from logging import getLogger
from jabber import JabberBuddy
from util import callsback
from pyxmpp.util... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import click as ck
from sklearn.metrics import classification_report
from sklearn.metrics.pairwise import cosine_similarity
import sys
from collections import deque
import time
import logging
from sklearn.metrics import roc_curve, auc, matthews_corrcoef
from... |
from flask import request, make_response, send_from_directory
from functools import wraps
import jwt
import datetime
import os
from app import app, db
from app.models import JobPosts, JobPostsReqs, Talent
# from app.get_details import get_details
from app.utils import hash_file
from app.model_rank import model_rank
d... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
import array
import compas
from compas.utilities import flatten
try:
from compas.numerical.alglib.core import Array
from compas.numerical.alglib.core import Zeros
from compas.numerical.... |
<filename>ingestion/functions/parsing/argentina/argentina_test.py
import os
import unittest
from datetime import date
from argentina import argentina
_SOURCE_ID = "placeholder_ID"
_SOURCE_URL = "placeholder_URL"
class ArgentinaTest(unittest.TestCase):
def setUp(self):
self.maxDiff = None
def test_pa... |
import argparse
import csv
import os
import time
from core_data_modules.cleaners import Codes
from core_data_modules.traced_data import Metadata, TracedData
from core_data_modules.traced_data.io import TracedDataJsonIO, TracedDataCSVIO
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Joins... |
<gh_stars>1-10
'''
Created on Dec 12, 2013
@author: Mark V Systems Limited
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
Input file parameters may be in JSON (without newlines for pretty printing as below):
[ {# current fields in JSON structure from Arelle Wrapper, per instance
"file": "file pa... |
<reponame>wilmerm/unolet-2022
"""
Objetos para interpretar etiquetas HTML básicas.
"""
VALUES_HTML_FORMAT = {
True: "true", False: "false", None: "none",
}
class attr(object):
def __init__(self, parent, name, value=None):
self.__dict__["parent"] = parent
self.__dict__["... |
#
# Copyright (C) 2008, <NAME>
#
# http://rl-glue-ext.googlecode.com/
#
# 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... |
#-*-coding:utf-8
#########################################################################################################
# name : whois_api.py
# desc : whois open api search as number
# :
#--------------------------------------------------------------------------------------------------------
# open ap... |
<reponame>thefirstofthe300/python-harvest_apiv2
# Copyright 2020 Bradbase
#
# 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 requir... |
<reponame>suulcoder/ProjectGenerator
"""
Class Databae will be util to make conection with Neo4J
Project Generator
Universidad del Valle de Guatemala
<NAME>
<NAME>
<NAME>
-Algunos proyectos almacenados en la base de datos fueron obtenidos de la siguiente fuente de información:
Sciencebuddies.(2019). Recommendation pro... |
# UpDown Triangle Co-ordinates
# This module provides sample code for working with equilateral triangles in an up-down configuration, i.e.
# ____________
# /\ /\ /
# / \ / \ /
# /____\/____\/
# /\ /\ /
# / \ / \ /
# /____\/____\/
# Each triangle is defined by three co-or... |
import requests
import base58
import ipfshttpclient
import multiaddr
import decimal
import csv
from _pysha3 import keccak_256
from decimal import Decimal
from typing import Any
from collections import defaultdict
from pathlib import Path
REGISTRY_ADDRESS = "0x0Ee5AFF42564C0D293164b39D85653666ae151Eb"
IPFS_GATEWAY = ... |
#!/usr/env/python3
from main import *
from pathlib import Path
import re
import os
from subprocess import getoutput
from monty.os import cd
import pymongo
COMPATH=Path("/WORK/nscc-gz_material_1/ICSD_vasp/abacus_calc/matgen_scf/completed")
ERRORS = Path("/WORK/nscc-gz_material_1/ICSD_vasp/abacus_calc/matgen_scf/some_... |
from infrastructure import *
from indputils import *
from gurobipy import GRB, Model, LinExpr
import string
import networkx as nx
import matplotlib.pyplot as plt
import copy
import random
import time
import math
import pickle
import sys
# HOME_DIR="/Users/Andrew/"
# if platform.system() == "Linux":
# HOME_DIR="/ho... |
<filename>tests/util.py
import os
from functools import partial
import pytest
from ldap3 import Connection
from rest_tools.client import RestClient
from rest_tools.server import from_environment
import requests
from krs import bootstrap
from krs.token import get_token
from krs import ldap
from krs import rabbitmq
@p... |
<gh_stars>10-100
from __future__ import absolute_import, unicode_literals
from collections import OrderedDict
from django.urls import reverse, reverse_lazy
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from arctic.generics import (
CreateView,
DeleteView... |
import pandas as pd
import numpy as np
import os
import pandas as pd
from sklearn.neighbors import KDTree
import pickle
import random
###Building database and query files for evaluation
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
base_path= "../jittered_dataset_4096/"#"../partial_dataset/"
query_path = '../... |
# 角色简体中文名字典(Dictionary)
characterSChineseDic = {
'Reimu_Hakurei': '博丽灵梦',
'Marisa_Kirisame': '雾雨魔理沙',
# 'SinGyoku': '神玉',
'Mima': '魅魔',
# 'Kikuri': '菊理',
'Konngara': '矜羯罗',
# 'YuugenMagan': '幽幻魔眼',
# 'Elis': '依莉斯',
# 'Sariel': '萨丽爱尔',
# 'Onmyou_gyoku': '阴阳玉',
# 'Yamaaruki': '... |
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""
Abstract base class for time series classifiers.
class name: BaseClassifier
Defining methods:
fitting - fit(self, X, y)
predicting - predict(self, X)
- predict_proba(self, X... |
from os.path import dirname, join
import numpy as np
import pandas as pd
import pytest
from bambi.models import Model, Term
@pytest.fixture(scope="module")
def diabetes_data():
data_dir = join(dirname(__file__), "data")
data = pd.read_csv(join(data_dir, "diabetes.txt"), sep="\t")
data["age_grp"] = 0
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from pprint import pprint
from loaddata import load_xlsx
import pyrotein as pr
import numpy as np
# [[[ OBTAIN THE CONSENSUS SEQUENCE ]]]
# Read the sequence alignment result...
# [WARNING] !!!sequence alignment is not trustworthy
fl_aln = 'step3.msa.fasta'
... |
# HSV limit finder
import cv2
import numpy as np
def empty(a): # argument required
pass
def stackImages(scale,imgArray):
rows = len(imgArray)
cols = len(imgArray[0])
rowsAvailable = isinstance(imgArray[0], list)
width = imgArray[0][0].shape[1]
height = imgArray[0][0].shape[0]
... |
<reponame>Cladett/imitation<filename>tests/test_tabular.py
"""Test tabular environments and tabular MCE IRL."""
import gym
import jax.experimental.optimizers as jaxopt
import numpy as np
import pytest
from imitation.algorithms.tabular_irl import (
LinearRewardModel,
MLPRewardModel,
mce_irl,
mce_occupa... |
from requests import Response
from test import TestAPI
from test.test_api.constants import ACTION, Actions, NAME, NEW_NAME, SEG_NAME, Types, TYPE, ErrorMsg
class Rename(TestAPI):
def setUp(self):
self.rename_body = {
ACTION: Actions.RENAME,
NAME: TestAPI.NAME,
NEW_NAM... |
import math
from algorithm import heft_time_reservation,heft,greedy,lbck,greedy_time_reservation,get_algorithm_timelist,set_paramerters,greedy_nlook_back,greedy_time_reservation_nlook_back,heft_n_look_back,NSGA_n_look_back
from Dataset import get_connect_task_graph,generate_randomtimeline,get_connect_multiple_task_grap... |
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, aggregates
from django.db.backends.mysql.oper... |
<gh_stars>10-100
import os
import pandas as pd
import numpy as np
import argparse
def load_datasets(data_dir, tasks):
datasets = {}
for task in tasks:
# TODO: implement all GLUE tasks
dataset = {}
dirname = os.path.join(data_dir, task)
if task in ["QNLI", "CoLA", "QQP", "SST-2"... |
from app import app
from flask import request, jsonify, session, make_response
import hashlib, uuid
import os
import binascii
from functools import wraps
import sys
sys.path.insert(0, 'app/services')
from dbservice import *
def jres(s, type='message'):
return jsonify({type:s})
def get_user_from_session(sessionid... |
<filename>run_all_benchmark_functions.py
import sys
sys.path.insert(0,'..')
sys.path.insert(0,'../..')
from bayes_opt import BayesOpt,BayesOpt_KnownOptimumValue
import numpy as np
#from bayes_opt import auxiliary_functions
from bayes_opt import functions
from bayes_opt import utilities
import warnings
#from bayes_op... |
<filename>vendor/packages/translate-toolkit/translate/convert/test_po2csv.py
#!/usr/bin/env python
from translate.convert import po2csv
from translate.convert import csv2po
from translate.convert import test_convert
from translate.misc import wStringIO
from translate.storage import po
from translate.storage import csv... |
from uuid import getnode as get_mac
import threading
import signal
import requests
import json
import hashlib
import sys
import os
def to_error_message(errs):
"""
Formats an array of error dicts into an error message string. Returns an error message.
"""
return ', '.join(map(lambda e: f"{e['title']}: {e['deta... |
# Copyright 2019-2020 The Kale 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 agree... |
# coding=utf-8
"""
Most serialisation tests are coupled with the type tests (test_type.py)
"""
from __future__ import absolute_import
import datetime
import uuid
from hypothesis import given
from hypothesis.strategies import dictionaries as dictionary, characters, integers
from pathlib import Path
from eodatasets im... |
# 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 u... |
<reponame>alvarolopez/cloud-bdii-provider
import argparse
import mock
import xml.etree.ElementTree
from cloud_info import exceptions
from cloud_info.providers import opennebula
from cloud_info.tests import base
from cloud_info.tests import data
FAKES = data.ONE_FAKES
class OpenNebulaBaseProviderOptionsTest(base.Tes... |
<reponame>tzhanl/azure-sdk-for-python<filename>sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Cor... |
<reponame>sdjespersen/pyzinc
import io
from typing import Iterable, Iterator, IO, List
from . import tokens
from .tokens import NumberToken, Token, TokenType
EOF = 'EOF'
class ZincTokenizerException(Exception):
"""An exception indicating that the string could not be tokenized."""
pass
def _is_letter(c: s... |
<filename>Image/main.py
import torch
from torchvision import transforms
from torchvision.datasets.folder import ImageFolder
from torch.utils.data import DataLoader
import numpy as np
import os
import visdom
import matplotlib.pyplot as plt
import SegmentVGG16
import train_extractor
import MutualInformation
import decod... |
<reponame>AlexHopsworks/airflow-chef<filename>files/default/hopsworks_plugin/sensors/hopsworks_sensor.py
# -*- coding: utf-8 -*-
#
# 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
# regardi... |
<reponame>salfamusic/DisentangledFaceGAN<filename>preprocess/preprocess_utils.py<gh_stars>0
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
import os
from scipy.io import loadmat,savemat
from PIL import Image,ImageOps
from array import array
from mtcnn import MTCNN
from ker... |
<gh_stars>1-10
# knotClassifier.py
# Author = <NAME>
# This script trains a convolutional neural network on a dataset of images
# The final weights are then saved within the same directory as 'first_try.h5'
# Script Usage: python knotClassifier.py
# For example: When this script is in the same directory as a dataset f... |
<gh_stars>1-10
# Copyright 2021 <NAME>
#
# 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 agree... |
import collections
import json
import os
import time
import torch
import yaml
import torch.nn as nn
from abc import abstractmethod
class Runner:
def __init__(self, args):
# register variables
self.model_path = None
self.tensorboard_path = None
self.dataset = {'train': None, 'tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.