text stringlengths 957 885k |
|---|
<reponame>tum-pbs/VOLSIM<gh_stars>1-10
import sys, os, random, shutil, datetime
from manta import *
import numpy as np
sys.path.append(os.getcwd() + '/tensorflow/tools')
import paramhelpers as ph
import imageio
withGUI = False
modes = ["pos", "pos_s", "pos_n", "pos_sn"] # count: 4
modesWave = ["pos", "pos_n"] # count... |
<reponame>antonisdim/haystack
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2020, University of Oxford"
__email__ = "<EMAIL>"
__license__ = "MIT"
import argparse
import hashlib
import os
import re
import sys
import pandas as pd
import yaml
REGEX_WHITELIST = r... |
<reponame>yujungcheng/website-monitor<filename>run_writer.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import json
import daemon
import os
from datetime import datetime
from argparse import ArgumentParser
from common.utils import *
from common.kafka import Kafka
from common.database import PostgreSQ... |
# -*- coding: utf8 -*-
u"""
Unit-test for the wildmatch module
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import pathmatch.wildmatch as wildmatch
from pathmatch.helpers import generate_tests... |
<filename>tests/test_core_subscribe.py
import json
from uuid import uuid4
import httpretty
from protonpack.core import Event
from protonpack.core.subscribe import SubscriberManager, Subscriber, Protocol
from .test_utils import RedisRunnerContext
def test_create_and_list_streams():
with RedisRunnerContext():
... |
<gh_stars>0
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.5
# kernelspec:
# display_name: Python 3 (ipykernel)
# language:... |
#!/usr/bin/env python
import subprocess
import random
import json
import urllib2
import itertools
import os.path
import time
import hashlib
from functools import wraps
try:
from bs4 import BeautifulSoup
except ImportError:
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
Bea... |
<gh_stars>10-100
from biogeme import *
from headers import *
from nested import *
from loglikelihood import *
from statistics import *
#import random
cons_bus = Beta('bus cons',0,-10,10,0)
cons_mrt = Beta('MRT cons',0,-10,10,0)
cons_privatebus=Beta('private bus cons',0,-10,10,0)
cons_drive1=Beta('drive alone cons... |
<gh_stars>1-10
import math
import numpy as np
def resolve_reward(name):
rewards = {
"manhattan_distance": manhattan_distance,
"euclidean_distance": euclidean_distance,
"binary": binary,
"mo_time_score": mo_time_score,
"mo_death": mo_death,
"mo_success": mo_success,
"mo_compound": mo_compound,
"collisi... |
import torch
import torch.nn as nn
from deepbond import constants
from deepbond.initialization import init_xavier, init_kaiming
from deepbond.models.model import Model
from deepbond.modules.crf import CRF
class CNNCRF(Model):
"""CNN with CRF on top"""
def __init__(self, words_field, tags_field, options):
... |
from argparse import ArgumentParser
from PIL import Image
from keras.preprocessing.image import load_img, img_to_array
import keras.backend as K
from keras.applications.vgg16 import preprocess_input
import numpy as np
from keras.applications import VGG16
from Settings import *
def build_parser():
parser ... |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import utool as ut
import vtool as vt # NOQA
import plottool as pt
import six
import networkx as nx
print, rrr, profile = ut.inject2(__name__, '[graph_inference]')
# Monkey patch n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 26
@author: bs15ansj
This module contains classes used for writing and submitting molecular
dynamics simulation files on amber.
MDInputs
This is a base class used by all of the input objects.
ProductionInput
Dataclass object storing par... |
<gh_stars>0
##//%file:kernel.py
#
# MyHtml Jupyter Kernel
#
from math import exp
from queue import Queue
from threading import Thread
from ipykernel.kernelbase import Kernel
from pexpect import replwrap, EOF
from jinja2 import Environment, PackageLoader, select_autoescape,Template
from abc import ABCMeta, abstractmet... |
import json
import mysql.connector
from mysql.connector import errorcode
import csv
from datetime import datetime
#get configuration settings from config.json
with open('config.json') as json_data_file:
data = json.load(json_data_file)
#print(data)
#print("host:"+data["mysql"]["host"])
host = data["mysql"]["host"]
... |
#!/usr/bin/env python3
################################################################################
# INTRODUCTION
################################################################################
# Encoder Title: ASCII shellcode encoder via AND, SUB, PUSH
# Date: 26.6.2019
# Encoder Author: <NAME>, www.mmquant.ne... |
<filename>check_fictionalgeoqa_answers.py
import json
import sys
import re
def test_candidate(candidate, actual_answers):
candidates = [candidate]
if not candidate.startswith('river') and not candidate.endswith('river'):
candidates.append(candidate + ' river')
candidates.append('river ' + candidate)
for c in ca... |
# Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
from typing import Any, Callable, List, Optional
import dask.dataframe as dd
import numpy as np
import pandas as pd
import pyarrow as pa
from slide.exceptions import SlideInvalidOperation
from slide.utils import SlideUtils
from triad.utils.assertion import assert_or_throw
from triad.utils.pyarrow import to_pandas_dtyp... |
from node import *
from regexes import *
from sys import argv
import pickle
if len(argv) < 3:
print("Usage: python3 %s [input code file] [output flowchart file]" % argv[0])
raise SystemExit()
"""
start = StartNode()
a_in = InputNode("A")
b_in = InputNode("B")
a_lt_b = ConditionalNode("A < B")
a_dec_b = Node(... |
# Copyright 2019, Aiven, https://aiven.io/
from logging import getLogger
from sfxbridge.mapper import Mapper
from sfxbridge.maps.metrics import DataPointType
log = getLogger(__name__)
def test_simple_mapping():
mapper = Mapper(log=log, whitelist=["load.midterm"], service=None)
mapper.process([
{
... |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import os
import sys
# Pyserver's conf.py wants the pyserver directory to be the current directory.
# And for importing pyserver sub-modules to work, we need the pyserver
# directory to be the current direc... |
<reponame>oss-spanish-geoserver/cartoframes
from __future__ import absolute_import
import re
import pandas
from . import defaults
from ..geojson import get_encoded_data, get_bounds
from ..data import Dataset, get_query, get_geodataframe
try:
import geopandas
HAS_GEOPANDAS = True
except ImportError:
HAS_G... |
<gh_stars>0
# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
from test_utils import TestCase
from remo.base.tests import requires_p... |
"""
Query-related utility functions.
"""
from defoe import query_utils
from defoe.query_utils import PreprocessWordType, longsfix_sentence, xml_geo_entities, georesolve_cmd, coord_xml, geomap_cmd, geoparser_cmd, geoparser_coord_xml
from nltk.corpus import words
import re
import spacy
from spacy.tokens import Doc
from... |
# -*- coding: ascii -*-
"""
Filename: query_weapons.py
Author: <EMAIL>
This file provides the MHWI build optimizer script's weapon database queries.
"""
import json
import logging
from abc import ABC, abstractmethod
from collections import namedtuple
from itertools import accumulate, product, zip_longest
from enum... |
<filename>nets/centernet2d.py<gh_stars>10-100
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.improc
import utils.misc
import utils.basic
import utils.geom
import utils.samp
import numpy as np
from utils.basic import print_
def compute_seg_loss(pred, pos, neg, balanced=True):
pos =... |
<reponame>Phoenix1327/MLA<filename>kNN/kNNbase.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Administrator'
from kNN import *
def createDataSet():
group = np.array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])
labels = ['A','A','B','B']
return group, labels
def classify0(inX, dataSet, labels, k... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#Here add a description
# In[2]:
'''
Importing all the needed librairies
'''
#Data Structure, scientific computing and technical computing.
import numpy as np
import pandas as pd
import pandas_datareader.data as web # pip install pandas_datareader
#Da... |
<gh_stars>0
#! /usr/bin/env python3
# Blender scripts
#author <NAME>
#copyright 2016-2017 INRIA. Licensed under the Apache License, Version 2.0.
#(see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
#needs blender. run it from the command line: blender --python siconosv.py
#to debug without blender: blen... |
# TODO Sep 08 version
import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
from PIL import Image
import torchvision
import datetime
import matplotlib.pyplot as plt
# plt.switch_backend('agg')
from mpl_toolkits.mplot3d import Axes3D
# import matpl... |
<filename>tests/excel_export.py<gh_stars>10-100
import os
import json
import logging
import openpyxl
from glob import glob
from pathlib import Path
from argparse import ArgumentParser
config = {
# Can be overridden by placing a config.json file in the directory
"base_url" : "https://github.com/eu-digital-green... |
#-*- coding:utf-8 -*-
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import os, sys
from sklearn.cluster import KMeans
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import pandas as pd
from contextual_dataset_yelp import PretrainDatasetIter
from macDAE import Recomme... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import connect, If, In
from hwt.code_utils import rename_signal
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.defs import BIT
from hwt.hdl.types.struct import HStruct
from hwtLib.amba.axi_comp.oooOp.outOfOrderCummulativeOp import OutOfOrderCummulati... |
<reponame>dujiajun/Blockchain<filename>blockchain/merkle_tree.py
from typing import Optional, List
from utils.hash_utils import sha256d
from utils.printable import Printable
def get_merkle_root_of_txs(txs) -> str:
"""
从交易列表获取梅尔克树根哈希值
:param txs: 交易列表
:return: 哈希值
"""
return get_merkle_root([t... |
import json
from os import listdir
from os.path import isfile, join
import os
import sys
# Globals
story = None
life = 3
test_budget = 10
def load_story(file):
with open(file) as fp:
data = fp.read()
return json.loads(data)
def clear():
# os.system('cls')
for line in range(0,5):
p... |
<filename>plugins/reply_funcs.py
from slackbot.bot import respond_to, listen_to, default_reply
import re
# 外部.py(自作モジュール)の読み込み
from plugins.modules.weather_module import WeatherModule
from plugins.modules.apiai_module import ApiaiModule
# 自作モジュールのインスタンス化
wm = WeatherModule()
am = ApiaiModule()
info="""[とりせつ... |
<filename>Rank_study/utils.py
############################################################
#
# utils.py
# utility functions
# September 2019
#
############################################################
import matplotlib as mpl
# if os.environ.get('DISPLAY', '') == '':
print('no display found. Using non-interactive A... |
<filename>src_py/solver_interfaces/solver_gurobi.py
import math
from gurobipy import *
from solver_interfaces.solver_abstract import AbstractSolver, AbstractCallback
setParam('OutputFlag', 0)
setParam('LazyConstraints', 1)
class SolverGurobi(AbstractSolver):
solver_name = 'Gurobi'
def __init__(self, name)... |
<filename>src/agent.py
import torch
from torch import nn
from collections import namedtuple
import random
import numpy as np
import cv2
from torch.optim.lr_scheduler import StepLR
import matplotlib.pyplot as plt
from collections import deque
import PIL.Image as Image
class Network(nn.Module):
def __init__(self, in_... |
import requests
import intralinks.utils.xml
import intralinks.utils.data
import intralinks.api.logger
class ApiClient:
def __init__(self, config=None, session=None, verify_ssl=True):
self.config = config
self.session = session
self.logger = intralinks.api.logger.ApiLogger1()
self.v... |
# -*- coding: utf-8 -*-
"""
flask.ext.cache
~~~~~~~~~~~~~~
Adds cache support to your application.
:copyright: (c) 2010 by <NAME>.
:license: BSD, see LICENSE for more details
"""
__version__ = '0.7.1'
__versionfull__ = __version__
import uuid
import hashlib
import inspect
import warnings
import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import re
import json
from datetime import datetime
from sample_weather_api_caller import SampleWeatherAPICaller, CityNotFoundError
from real_weather_api_caller import RealWeatherAPICaller
from urllib.parse import parse_qs
imp... |
<reponame>luxiaohan/openxal-csns-luxh<filename>core/src/xal/sim/slg/Dscript.py
#!/usr/bin/env jython
import sys
from java.lang import *
from java.util import *
from java.io import *
from org.xml.sax import *
from gov.sns.xal.smf import *
from gov.sns.xal.smf.impl import *
from gov.sns.xal.smf.impl.qualify import *
from... |
#!/usr/bin/env python2
from test_framework.authproxy import AuthServiceProxy, JSONRPCException
import os
import random
import sys
import time
import subprocess
import shutil
from decimal import Decimal
if len(sys.argv) < 2:
print("path to bitcoind must be included as argument")
sys.exit(0)
bitcoin_bin_path = ... |
<filename>tests/python/contrib/test_cmsisnn/test_extract_constants.py<gh_stars>1000+
# 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... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
<reponame>GodWriter/RL-Pytorch
import math
import time
import argparse
import numpy as np
import tkinter as tk
import torch
import torch.nn as nn
from tensorboardX import SummaryWriter
seed = 1
torch.manual_seed(seed)
UNIT = 40 # 像素单位长度
MAZE_H = 4 # 高度
MAZE_W = 4 # 宽度
class Maze(tk.Tk, object):
def __i... |
<reponame>tupui/rbc
import atexit
import pytest
from rbc.remotejit import RemoteJIT
import numpy as np
@pytest.fixture(scope="module")
def rjit(request):
rjit = RemoteJIT()
rjit.start_server(background=True)
request.addfinalizer(rjit.stop_server)
atexit.register(rjit.stop_server)
return rjit
def... |
import os
from PyQt5 import QtCore, QtWidgets
from .ui.MainWindow import Ui_MainWindow
from .ui.about import Ui_Form as Ui_aboutWindow
from .ui.input import Ui_Form as Ui_inputWindow
from .ui.help import Ui_Form as Ui_helpWindow
import pyqtgraph as pg
import pyqtgraph.exporters
import matplotlib.pyplot as plt
... |
#!/usr/bin/env python3
# 参考:
# https://github.com/ros2/examples/tree/master/rclpy/actions
from action_msgs.msg import GoalStatus
from hapthexa_msgs.action import MoveLeg
from hapthexa_msgs.msg import ForceSensor
from hapthexa_msgs.msg import Empty
from hapthexa_msgs.action import Gait
import math
import threading
... |
import numpy as np
from PIL import Image
import torch
from torch.utils.data import Dataset
from octopod.vision.config import cropped_transforms, full_img_transforms
from octopod.vision.helpers import center_crop_pil_image
class OctopodEnsembleDataset(Dataset):
"""
Load image and text data specifically for an... |
import json
import logging
import re
from pathlib import Path
from shutil import copy
from typing import AnyStr, List, Optional, Dict, Any
from src.python.review.common.file_system import new_temp_dir
from src.python.review.common.subprocess_runner import run_in_subprocess
from src.python.review.inspectors.base_inspec... |
<filename>tests/test_shape.py
import unittest
import numpy as np
from cosymlib import Cosymlib
from cosymlib.file_io import classic_inputs
from cosymlib import file_io
import cosymlib.shape as shape
import cosymlib.shape.maps as maps
import os
data_dir = os.path.join(os.path.dirname(__file__), 'data')
class TestSha... |
# coding: utf8
from copy import copy
import numpy as np
import pandas as pd
from os import path
def neighbour_session(session, session_list, neighbour):
if session not in session_list:
temp_list = session_list + [session]
temp_list.sort()
else:
temp_list = copy(session_list)
t... |
<filename>classifiers/nearest_neighbor.py
import os
from argparse import ArgumentParser
from random import choice, seed
from heapq import nlargest
from typing import Callable
from aenum import NamedTuple
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
from torch.nn import CosineSim... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import inspect
from functools import wraps
from ..components.individual import IndividualBase
from ..components.population import Population
from ..mpiutil import master_only
class AnalysisMeta(type):
''' Metaclass for analysis plugin class
'''
... |
<gh_stars>0
from dataclasses import dataclass
from datetime import datetime
import json
from requests import Session, Response
from typing import Any, Iterable, List, Tuple, Union, Dict
import re
import html
import jsonpath_ng as jsonpath
from .reese84 import FrenchBeeReese84
from .models import Location, PassengerInf... |
"""
MIT License
Copyright (c) 2020 <NAME> - dominik.kopczynski {at} isas.de
<NAME> - nils.hoffmann {at} isas.de
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 re... |
import filecmp
import pytest
import pandas as pd
import pandera
import crowsetta.formats
class TestRavenSchema:
COLUMNS_MAP = {
"Begin Time (s)": "begin_time_s",
"End Time (s)": "end_time_s",
"Low Freq (Hz)": "low_freq_hz",
"High Freq (Hz)": "high_freq_hz",
"Species": "a... |
from argparse import ArgumentParser
from collections import OrderedDict
from typing import Tuple
import torchvision
from pytorch_lightning import LightningModule
import torch
import torch.nn.functional as F
from gan.discriminators import Discriminator
from gan.generators import Generator
class Gan(LightningModule):... |
"""
Module ``_helpers``.
"""
import xml.dom.minidom as dom
import urllib
from ows_checker._helpers import xml2dict
DEFAULT_TIMEOUT = 100
class ResponseDict(dict):
"""
Die Klasse L{ResponseDict} formuliert ein C{dict}-Objekt mit vier festen
Parametern und vier festen Rückgabewerten.
B{Aufruf}:
... |
<gh_stars>1-10
from pathlib import Path
import logging
import configparser
import pylast
import tweepy
import os
from mastodon import Mastodon
logger = logging.getLogger()
logging.getLogger("pylast").setLevel(logging.WARNING)
def check_config(config_file): # pragma: no cover
config_file = os.path.expanduser(con... |
# -*- coding: utf-8 -*-
"""
Unit tests for the normal form detection.
Author: <NAME>
"""
import unittest
from clevercsv.dialect import SimpleDialect
from clevercsv.normal_form import (
is_form_1,
is_form_2,
is_form_3,
is_form_4,
is_form_5,
)
class NormalFormTestCase(unittest.TestCase):
de... |
<filename>z/management/commands/loadreports.py
import re
from datetime import datetime
from io import open
from os import walk
from os.path import isdir, isfile, join
import pytz
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from cyb_oko.settings import TIME... |
import time
from typing import Dict, Any
import urllib.parse
import pandas
import requests
from threading import Semaphore, Thread
from kedro.io import AbstractDataSet, DataSetError
class AirtableException(DataSetError):
pass
AIRTABLE_RECORD_ID_COLUMN = '__airtable_id'
AIRTABLE_CREATED_TIME_COLUMN = '__airtab... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# name: vhost.py
# author: <NAME>
# email: <EMAIL>
# created on: 11/03/2015
#
# pylint: disable=no-member
# TODO: add SSL capabilities
"""
ww.vhost
~~~~~~~~
A class to create Apache vhost configurations... |
#!/usr/local/bin/python
#==========================================================================
# Creates the combined "all_stations.all.input" file for all the stations
# associated with a particular data set type. That is, we will create
# this file of combined inputs for WNAM_Filter_DetrendNeuTimeSeries_jpl,
# W... |
# -*- coding: utf-8 -*-
# Copyright 2019 ICON 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
#
# Unless required by applicable law ... |
__author__ = "<NAME> :: New Mexico Mira Project, Albuquerque"
""" Module 'astrosupport.stats'.
Numerous statistics and regression classes and functions.
Fork of (extract of) photrix.util, begun 2020-10-23.
Intentions: (1) a separate, importable module for use by all EVD astro python projects.
... |
<reponame>TrevisanGMW/maya<gh_stars>10-100
"""
GT Color Manager - A script for managing the color of many objects at the same time (outliner and other overrides)
@<NAME> - <EMAIL> - 2020-11-13
https://github.com/TrevisanGMW
1.1 - 2020-11-16
Fixed an issue where the color containing rendering space data wou... |
<filename>lcd_digit_recognizer/web/app.py
import base64
import gc
import json
import os
import threading
import time
import traceback
from multiprocessing import freeze_support
from pympler import muppy, summary
import eventlet
eventlet.monkey_patch()
import numpy as np
import cv2
from flask import Flask, render_... |
import collections
from contextlib import contextmanager
from functools import wraps
import io
from itertools import cycle
import logging
import os
import pprint
import re
import shutil
import socket
import subprocess
from sys import version, stderr
import sys
import threading
import time
import uuid
f... |
<gh_stars>0
"""
Recording standarization
"""
import multiprocess
import os.path
from yass.batch import BatchProcessor
from yass.util import check_for_files, ExpandPath, LoadFile
import numpy as np
@check_for_files(filenames=[ExpandPath('output_filename'),
LoadFile('output_filename', 'yam... |
# Copyright 2018 Owkin, inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
# -*- coding: utf-8 -*-
# coding=utf-8
__author__ = 'ben'
import os
from os import walk
import boto.mturk.connection
from boto.s3.connection import S3Connection
from boto.mturk.qualification import LocaleRequirement, Qualifications, Requirement
import datetime
import csv
import yaml
import sys
import datetime
import p... |
<reponame>galvinw/fairmotdocker<gh_stars>0
import glob
import numpy as np
import torchvision
import torch
from PIL import Image, ImageFile
from openpifpaf.network import nets
from openpifpaf import decoder
from .process import image_transform
class ImageList(torch.utils.data.Dataset):
"""It defines transformat... |
# -*- coding: utf-8 -*-
"""
Http client for backup or other modules.
"""
import pickle
from datetime import datetime
from pathlib import Path
import requests
from src.utils_v1.flask_rangerequest import RangeRequest
from src.utils.file_manager import fm
from src.utils.http_exception import InvalidParameterException, ... |
"""Volume Views"""
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import \
PermissionRequiredMixin as DjangoPermissionRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.shortcuts import reverse
from d... |
<reponame>xuannanxan/maitul-manage
from flask_restful import Resource,reqparse,fields,marshal,abort
from app.apis.api_constant import *
from app.models import Role,RoleRule, Crud
from app.utils import object_to_json,mysql_to_json
from app.apis.admin.common import login_required,permission_required
from app.utils.api_d... |
<filename>mi/dataset/driver/moas/gl/parad/test/test_driver.py
"""
@package mi.dataset.driver.moas.gl.parad.test.test_driver
@file marine-integrations/mi/dataset/driver/moas/gl/parad/test/test_driver.py
@author <NAME>
@brief Test cases for glider parad data
USAGE:
Make tests verbose and provide stdout
* From the ID... |
<filename>vcfpy/parser.py
# -*- coding: utf-8 -*-
"""Parsing of VCF files from ``str``
"""
import ast
import functools
import math
import re
import warnings
from . import header
from . import record
from . import exceptions
from .exceptions import (
CannotConvertValue,
LeadingTrailingSpaceInKey,
UnknownFi... |
#!/usr/bin/python
# -*- coding: utf-8 -*
import re
import pandas as pd
import os
from data_preparation import *
from collections import Counter
import numpy as np
import pickle
from metrics import accuracy, build_confusion_matrices
def n_gram_train(filepath, grammage, folder, register_change, start_end_symbols, weigh... |
<reponame>masa-su/pixyz<filename>pixyz/models/gan.py<gh_stars>100-1000
from torch import optim
from ..models.model import Model
from ..losses import AdversarialJensenShannon
from ..distributions import EmpiricalDistribution
class GAN(Model):
r"""
Generative Adversarial Network
(Adversarial) Jensen-Shann... |
# -*- coding: utf-8 -*-
from abc import ABCMeta
from functools import wraps
from inspect import iscoroutinefunction
from typing import (
Any,
Callable,
ClassVar,
Coroutine,
Generic,
NoReturn,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import final
from returns.pr... |
import util
"""
Data sturctures we will use are stack, queue and priority queue.
Stack: first in last out
Queue: first in first out
collection.push(element): insert element
element = collection.pop() get and remove element from collection
Priority queue:
pq.update('eat', 2)
pq.update('study', 1)
... |
<gh_stars>0
#!/usr/bin/env python
import time
import os
import platform
def clearScreen():
"""#Method for clearing the screen"""
if platform.system() == 'Windows':
os.system('cls')
else:
os.system('clear')
clearScreen()
print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")... |
# A python wrapper for Fianium supercontinuum laser coupled with AOTF controller
# Original code by <NAME>
# Adapted by <NAME>
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPO... |
#!/usr/bin/env python3
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
impo... |
import os.path as osp
import mmcv
import numpy as np
from mmcv.parallel import DataContainer as DC
from torch.utils.data import Dataset
from .registry import DATASETS
from .transforms import (ImageTransform, PointTransform, Numpy2Tensor)
from .utils import to_tensor, random_scale
from .extra_aug import ExtraAugmentat... |
# Copyright 2014 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 os
import re
from buildbot.changes.filter import ChangeFilter
from buildbot.changes.gitpoller import GitPoller
from buildbot.process.properties impor... |
<reponame>henriktao/pulumi-azure
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequenc... |
from collections import defaultdict, Counter
import qcportal as ptl
## failures and incompletes
def get_optimizations(dataset, spec, client, dropna=False):
ds = dataset
while True:
try:
ds.status(spec)
except:
pass
else:
break
if dropna:
... |
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def open_contacts_page(self):
# open groups page
wd = self.app.wd
wd.find_element_by_link_text("home").click()
def create_contact(self, Contact):
wd = self.app... |
from multi_logreg import register_pytree_node_dataclass
import datasets
import numpy as np
import jax.numpy as jnp
import jax
from preprocess_logreg import PreProcessLogReg
from argparse import Namespace
from os import path
from typing import Dict, Any
from zipfile import ZipFile
from typing import Tuple
from datacl... |
# QLScrobbler: an Audioscrobbler client plugin for Quod Libet.
# version 0.11
# (C) 2005-2012 by <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# Licensed under GPLv2... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# 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... |
# Copyright (c) 2021 Dell Inc. or its subsidiaries.
# 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 requi... |
<filename>run.py
import asyncio
import base64
import json
import logging
import sys
from enum import Enum, auto
from typing import Dict, Optional, List
import prometheus_client
import requests
from prometheus_client import Gauge, Counter, start_http_server
from telethon.sync import TelegramClient
from telethon.tl.func... |
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# 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,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.