text stringlengths 957 885k |
|---|
# -*- coding: utf-8 -*-
"""model_training.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1zAyiq6cN_OEIjv9yaG6xJXbop2lcREhP
"""
#%%
# Import libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as c... |
import sys, os, re, json, pprint, traceback
from pathlib import Path
from aiohttp import web
routes = web.RouteTableDef()
async def app():
from web_chains_202105 import directories
app = web.Application(middlewares=[exception_middleware])
app.add_routes(routes)
app.router.add_static("/js/", path="js",... |
import sys
import json, flask
import os
import psycopg2
from sqlalchemy import create_engine
from app import app
from app import get_scanned
class Query:
def __init__(self):
with open('db_config.json', 'r') as db_file:
db_info = json.load(db_file)
self.db_name = db_info["database"]["d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*
"""
Copyright (c) 2017 <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 u... |
"""
Django settings for example_project project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
impo... |
# -*- coding: utf-8 -*-
import pytest
import torch
from eznlp.dataset import Dataset
from eznlp.model import EncoderConfig, BertLikeConfig, BoundarySelectionDecoderConfig, ExtractorConfig
from eznlp.model.decoder.boundary_selection import _spans_from_upper_triangular
from eznlp.training import Trainer
class TestMode... |
<reponame>diegojromerolopez/pystats-trello
# -*- coding: utf-8 -*-
import settings
# Abstraction of a Trello Board with all the fields needed for the stats initialized
class TrelloBoard(object):
# Constructor based on credentials and a board name of the board it will compute the stats
def __init__(s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# DSA key recovery from nonce
#
# Step 1: Relocate so that you are out of easy travel distance of us.
# Step 2: Implement DSA, up to signing and verifying, including parameter
# generation.
#
# Hah-hah you're too far away to come punch us.
#
# Just kidding you ca... |
#!/usr/bin/python
# coding: utf8
import unittest
import logging
import os
from pytsdb.models import Item, BucketType
from pytsdb.storage import MemoryStorage, RedisStorage, CassandraStorage, SQLiteStorage
from pytsdb.errors import NotFoundError
class StorageTest(unittest.TestCase):
def setUp(self):
Ite... |
<filename>app/table_handler.py
from datetime import datetime
import pandas as pd
from utils import exchange_into_rub, PostgreSQLStarter, get_exchange_rates
from app import COUNTRIES_LIST, CURRENCIES_LIST
def drop_table(table_name):
"""
Delete the entire table from the database
:param table_name: name of t... |
<filename>tests/test_cmd_stat.py
"""
Тесты для команды "стата"
"""
from socket import timeout
from datetime import datetime, timedelta
from time import sleep
from discord.ext.test import message, get_embed
from mcstatus import MinecraftServer
from pytest import fixture, mark
from discord import Color
from mcstatus.ping... |
<filename>plugwise/stick.py
"""
Use of this source code is governed by the MIT license found in the LICENSE file.
Main stick object to control associated plugwise plugs
"""
import logging
import time
import serial
import sys
import threading
from datetime import datetime, timedelta
from plugwise.constants import (
... |
import pyodbc
from platform import system
from Constants import *
def sql_exec(
p_server: str,
p_database: str,
p_user: str,
p_password: str,
p_port: int,
p_sql: str,
p_result: int =1
):
"""
Выполняет запросы на MSSQL
:param p_server: сервер
:para... |
<gh_stars>1-10
import numpy as np
from scipy.interpolate import interpolate as interp
import astropy.units as u
from gwemlightcurves.KNModels.io.Me2017 import calc_lc_UV
class KN_lc(object):
"""
Calculate some KNe lightcurves
Parameters
----------
file_list : list of str (None)
List of f... |
# import BaseDatos
class ListaBaseDatos:
def __init__(self):
self.lista_bases_datos=[]
def Buscar(self, database):
for base_datos in self.lista_bases_datos:
if base_datos.Name==database:
return base_datos
else: return False
def creat... |
import random
class BaseCompose:
def __init__(self, transforms, p: float = 1.0, shuffle: bool = False):
self.transforms = transforms
self.p = p
self.shuffle = shuffle
self.are_parameters_frozen = False
name_list = []
for transform in self.transforms:
na... |
<gh_stars>0
import collections
import glob
import os
from typing import Dict, Set
import matplotlib.pyplot as plt
import networkx as nx
import torch
from pyvis.network import Network
from sklearn.manifold import TSNE
from torch_geometric.data import Data
from tqdm import tqdm
import igraph
from dataset_v1 import Phis... |
"""Create AnVIL workspaces, set up with auth domain, add workspace READER access to auth domain, and OWNER access to AnVIL admins.
Usage:
> python3 set_up_anvil_workspace.py -t TSV_FILE [-p BILLING-PROJECT] """
import argparse
import json
import pandas as pd
import requests
from utils import add_user_to_authoriz... |
#!/usr/bin/env python2
"""Display letters regularly to the subject. Subj must respond to a target letter
only if it's different from the previous target letter.
Based on (Garavan, 1999 PNAS) doi:10.1073/pnas.96.14.8301"""
# SerialLetterTask_d1.py
# Created 10/06/17 by DJ based on GoNoGoTask_d1.py
from psychopy impor... |
<reponame>tlvu/raven<filename>raven/processes/wps_generic_zonal_stats.py<gh_stars>0
import logging
import json
import tempfile
from pywps import LiteralInput, ComplexInput
from pywps import ComplexOutput
from pywps import Process, FORMATS
from pywps.app.Common import Metadata
from rasterstats import zonal_stats
from r... |
#!/usr/bin/env python
#coding:utf8
#++++++++++++description++++++++++++#
"""
@author:ying
@contact:<EMAIL>
@site:
@software: PyCharm
@time: 2019/5/14 上午7:52
@该文件没什么用,仅供参考
"""
#+++++++++++++++++++++++++++++++++++#
import yaml,nmap,os,time,json,paramiko,hmac
os.environ['DJANGO_SETTINGS_MODULE'] = 'YingOps.settings'
imp... |
from izi_pygame import *
import os
from math import cos
from math import sin
from random import randint
from random import seed
FILL = 2
window = Window(wtitle="MCD", wwidth=1400, wheight=800)
entity_font = Fontstring(size=20, bold=1, window=window.get_canva())
property_font = Fontstring(size=20, window=window.get_c... |
<filename>pydpiper/itk/tools.py
import copy
import os
from typing import Optional, Sequence
from configargparse import Namespace
from pydpiper.minc.conversion import generic_converter
from pydpiper.minc.files import ToMinc
from pydpiper.minc.nlin import Algorithms
from pydpiper.core.stages import Result, CmdStage, Sta... |
from __future__ import annotations
import email.message
import pprint
import smtplib
import workflows.recipe
from workflows.services.common_service import CommonService
import zocalo.configuration
class _SafeDict(dict):
"""A dictionary that returns undefined keys as {keyname}.
This can be used to selective... |
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import base64
import hashlib
import json
import logging
from typing import TYPE_CHECKING, Any, Dict
from Crypto.Cipher import AES
from feishu.dt_callback import (EventAppOpen, EventApproval, EventAppTicket, EventConta... |
import numpy as np
import trimesh
import os
import glob
import scipy.io as sio
import torch
import torch.utils.data as data
import vgtk.pc as pctk
import vgtk.point3d as p3dtk
import vgtk.so3conv.functional as L
from vgtk.functional import rotation_distance_np, label_relative_rotation_np
from scipy.spatial.transform im... |
<reponame>TokisakiKurumi2001/transformer-based
import random
# Hàm này dùng để cắt 1 câu thành các câu con, mặc định là tách thành các câu đơn.
# Các câu được cách nhau bởi dấu chấm "."
def splitSentences(num_sentences_split=1):
inputsDir = 'corpus'
output_dir = 'corpus_out'
txtVi = "data_vi_sentences.txt... |
<reponame>yoagauthier/deep_learning_course
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import matplotlib.pyplot as plt
# Loading the MNIST dataset
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read... |
<gh_stars>0
# Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
<reponame>Crossroadsman/python-notes<filename>libraries/pillow/pillow_tut.py
# imports for Pillow still use PIL as the import name
from PIL import Image
# Pillow lazy-loads the file so this operation is fast
image_file = Image.open("img/IMG_1.jpg")
# These details can be obtained just by looking at the file header s... |
<gh_stars>0
"""Fill docstrings to avoid redundant docstrings in multiple files.
Inspired from mne: https://mne.tools/stable/index.html
Inspired from mne.utils.docs.py by <NAME> <<EMAIL>>
"""
import sys
from typing import Callable, List
# ------------------------- Documentation dictionary -------------------------
do... |
<reponame>frzfrsfra4/phylanx
# Copyright (c) 2018 <NAME>
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# significant re-working of the algorithm implementation found on this site:
#
# https://machinelearningm... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
... |
__author__ = 'leif'
from django.db import models
from django.contrib.auth.models import User
from django.forms import ModelForm
from django import forms
from django.forms.widgets import RadioSelect, Textarea
from import_export import resources
from survey.forms import clean_to_zero
SEX_CHOICES = \
(
('N... |
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
import util
from errors import ValidationError
from view.widgets.field import Field
BLUE = (.2, .2, 1, 1)
GRAY = (.5, .5, .5, 1)
RED = (.5, 0, 0, 1)
WHITE = (1, 1, 1, 1)
class Board(BoxLayout):
def __... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from django.conf import settings
from django.shortcuts import get_object_or_404
from ratelimit.decorators import ratelimi... |
<gh_stars>0
import os
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import constants
import plots
from processing.ranking import rank_results_pandas
def scores_baselines():
dataset_name = 'path_set_100_no_singles'
modular_results = rank_results_pandas(dataset_n... |
"""scrapli_netconf.response"""
import logging
import re
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple, Union
from lxml import etree
from lxml.etree import Element
from scrapli.response import Response
from scrapli_netconf.constants import NetconfVersion
from scrapli_netconf.helper ... |
"""Command line interface to mr.bob"""
import pkg_resources
import sys
import os
import shutil
import six
import argparse
from .configurator import Configurator
from .configurator import maybe_bool
from .bobexceptions import ConfigurationError
from .bobexceptions import TemplateConfigurationError
from .parsing impor... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Olympe sphinx-doc extension configuration file
from sphinx.ext.autodoc import FunctionDocumenter, ModuleLevelDocumenter
from sphinx.ext.autodoc import ClassDocumenter
from sphinx.domains.python import PyFunction, PyClasslike
from sphinx.util.logging import getLogger
from doc... |
<reponame>deavid/pineboo
"""options module."""
from optparse import OptionParser
from optparse import Values
from typing import Optional, List
def parse_options(custom_argv: Optional[List] = None) -> Values:
"""Load and parse options."""
parser = OptionParser()
parser.add_option(
"-l",
"... |
from torch_geometric.nn import MessagePassing
from torch_geometric.nn.inits import glorot, uniform
import torch
from torch.nn import Linear, ReLU, Sequential, LayerNorm
from torch.nn import Parameter
import numpy as np
from codes.abstract.abstract_gnn import AbstractGNN
class RGCNLayer(MessagePassing):
"""
... |
<reponame>valmikkpatel/whotracks.me
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import concurrent.futures
from pathlib import Path
from whotracksme.data.loader import DataSource
from whotracksme.website.build.home import build_home, build_privacy_policy
from whotracksme.website.build.blog import (
build_blog... |
import codecs
import csv
import datetime
import os
import pathlib
import re
import sqlite3
import sys
import simplekml
import magic
import shutil
from pathlib import Path
from bs4 import BeautifulSoup
class OutputParameters:
'''Defines the parameters that are common for '''
# static parameters
nl = '\n'
... |
import json
import os.path
import requests
import socket
import sys
from base64 import b64decode
from bs4 import BeautifulSoup as bs
from httpobs.conf import (SCANNER_ALLOW_LOCALHOST,
SCANNER_PINNED_DOMAINS)
from requests.structures import CaseInsensitiveDict
HSTS_URL = ('https://chromium.g... |
<gh_stars>0
import torch
from torch import nn
from base import BaseGanCriterion
# Adapted from https://github.com/meyerscetbon/LinearSinkhorn/blob/01943c72b03ea4b56df12ca5a9d0c1da2516d1ae/EXP_GAN/torch_lin_sinkhorn.py
class Lin_Sinkhorn_AD(torch.autograd.Function):
@staticmethod
def forward(ctx, x_emb, y_emb... |
<gh_stars>1-10
# Copyright 2019 Shin. 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 ap... |
from os import stat
import time
import os
import atexit
from datetime import datetime
from rpi_ws281x import *
from prices import getPrices
from config import LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_BRIGHTNESS, LED_INVERT
from config import testing, nightmode, beginSleep, stopSleep, static, staticColor, interval... |
<reponame>kwinkunks/modelr_app<gh_stars>0
"""
Handler classes that deal with data, and not webpages. These
functions can be called as web apis
"""
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext import blobstore
from google.appengine.ext import webapp as webapp2
from google.appen... |
import pylab
import nest
import math as math
'''
Create objects to run experiment with
Method of connecting populations:
http://www.nest-simulator.org/introduction-to-pynest/part-2-populations-of-neurons/
'''
multimeter = nest.Create("multimeter",10)
nest.SetStatus(multimeter, {"withtime":True, "record_from":["V_m"]}... |
""" This module is the high-level wrapper for running a test on a list of input
datasets in order to collect statistics on alignment of each dataset to an
astrometric catalog."""
import datetime
import os
import shutil
import numpy as np
from astropy.table import Table
import pytest
from drizzlepac import alig... |
#!/usr/bin/env python3
import asyncio, contextvars, functools, json, re, shutil, sys, urllib.request
from bs4 import BeautifulSoup
PREAMBLE = r"""# Unofficial “odd-jobbed rankings”
This “rankings” is almost certainly riddled with errors, inaccuracies, and
missing information, and should be treated as such. This is j... |
# Copyright 2017 Google
#
# 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, softwa... |
<gh_stars>1-10
"""
raspi_camera.py: Provide a PEPI-compatible Camera backed by a connected Raspberry Pi Camera Module.
"""
import threading
import time
import atexit
import logging
from picamera import *
from picamera.array import PiRGBArray
from server import AbstractCamera
__author__ = '<NAME>'
__copyright__ = 'C... |
<reponame>code-review-doctor/project-application
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse
from django.views.generic import TemplateView, UpdateView, FormView
from project_core.forms.call_question import CallQuestionForm, CallQuestionFromTemplateQuestionForm
from pro... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 Google AI, Google Brain 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
#
# ... |
# encoding=utf-8
import unittest
from lightcycle.arena import LightCycleArena
from lightcycle.basebot import LightCycleBaseBot, LightCycleRandomBot
from lightcycle.player import Player
from lightcycle.security import blacklisted_modules
class TestArena(unittest.TestCase):
def setUp(self):
self.player1 =... |
<filename>coherence/log.py
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2013, <NAME> <<EMAIL>>
# Copyright 2018, <NAME> <<EMAIL>>
import io
import logging
import os
import sys
import traceback
# If you want to debug cohen,
# set the below vari... |
<gh_stars>0
# Python Profiler v3
# Copyright (c) 2015-2017 <NAME>
# TODO:
# [x] Record only functions in StackLines
# [ ] Handle per-line hotspots as separate structure (not nested) - ?
# [ ] Handle timeline as separate structure
# [x] Use unique stack IDs to dedupe stack tuples
# [ ] Merge profile data meth... |
<gh_stars>0
from django.test import TestCase
from mock import MagicMock, patch
from django.db import IntegrityError
import time
from hud_api_replace.geocode import (
GoogleGeocode, _geocode_compute_key, _extract_zip_code, _geocode_cached_data, _convert_data, geocode_get_data)
from hud_api_replace.models import Ca... |
# -*- coding: utf-8 -*-
"""
CoCart API Class
"""
__title__ = "cocart-api"
__version__ = "1.0.0"
__author__ = "<NAME> @ CoCart"
__license__ = "MIT"
from requests import request
from json import dumps as jsonencode
from time import time
from cocart.oauth import CoCartOAuth
from requests.auth import HTTPBasicAuth
try:... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2018 <NAME>. All rights reserved.
#
# The contents of this file are 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/... |
import pytest
import numpy as np
from qcodes.dataset.param_spec import ParamSpec
from qcodes.dataset.measurements import Measurement
from qcodes.tests.instrument_mocks import ArraySetPointParam, Multi2DSetPointParam
from qcodes.instrument.parameter import Parameter
# pylint: disable=unused-import
from qcodes.tests.da... |
# Copyright 2019-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 agre... |
<gh_stars>1-10
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db import IntegrityError
from django.shortcuts import render, get_object_or_404, redirect
from math import ceil
from .forms import TextForm, CasefileForm, UploadCase, AddCasesForm
f... |
# coding: utf-8
import os, time, pickle, random, sys, math
from datetime import datetime
import numpy as np
from time import localtime, strftime
import logging, scipy
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
import matplotlib.pyplot as plt
import hickle as hkl
from skimage.measu... |
# Copyright 2019 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
<gh_stars>0
#!/usr/bin/env python
"""
models.py
"""
from __future__ import division
from __future__ import print_function
from functools import partial
import torch
from torch import nn
from torch.nn import functional as F
from lr import LRSchedule
# --
# Model
class GSSupervised(nn.Module):
def __init__... |
<filename>ocd_backend/transformers/gedeputeerdestaten.py<gh_stars>10-100
from datetime import datetime
from urllib.parse import urljoin
import requests
from ocd_backend import settings
from ocd_backend.app import celery_app
from ocd_backend.log import get_source_logger
from ocd_backend.models import *
from ocd_backen... |
<reponame>MatthewGerber/rl
import logging
from typing import Dict, Optional
from rlai.actions import Action
from rlai.agents.mdp import MdpAgent
from rlai.environments.mdp import ModelBasedMdpEnvironment
from rlai.gpi.dynamic_programming.evaluation import evaluate_v_pi, evaluate_q_pi
from rlai.gpi.dynamic_programming.... |
import random
import requests
try:
import simplejson as json
except ImportError:
import json
import urllib3
import logging
from urllib.parse import urljoin
from pin_py.utils.settings import HEADERS_DEFAULT, PROXIES_LIST
log = logging.getLogger('HTTP')
def get_instance_for_request():
"""Added a method... |
# -*- coding: utf-8 -*-
# Module for loading .nxs files from SIXS beamline @ SOLEIL
# To be used together with the dictionnary 'alias_dict.txt'
# Code from <NAME> @ Soleil Synchrotron
# Modified 02052019 by <NAME> @ CNRS IM2NP: PEP8 + removed unused functions
"""
nxsReady.
This module contains Classes and functions to... |
from pyrates.utility.visualization import plot_timeseries, create_cmap
from pyrates.ir import CircuitIR
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
import matplotlib as mpl
plt.style.reload_library()
plt.style.use('ggplot')
mpl.rcParams['lines.linewidth'] = 2
m... |
# -*- coding: utf-8 -*-
"""
File: fantasypremierleagueapi.py
Path: fantasypremierleague/
Author: <NAME>
"""
# Python Imports
from functools import wraps
from pprint import pprint
# Third Party Imports
import requests
# Local Imports
BASE_URL = 'https://fantasy.premierleague.com/drf'
DATA_ENDPOINT = 'bootstrap-static... |
"""
Module for camera and video recording:
Depends on :
- opencv2 (conda install --channel conda-forge opencv)
- hdf5, pyqtgraph, progressbar2 (normal conda channel)
"""
import sys
import signal
import os
import gzip
import numpy as np
try:
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, Qt... |
<reponame>vivekparasharr/Challenges-and-Competitions
import pandas as pd
import numpy as np
sephora = pd.read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-03-30/sephora.csv')
ulta = pd.read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/... |
<reponame>Tanevski3/python-caa-algorithm<filename>index.py
import matplotlib.pyplot as plt
import networkx as nx
from graph import Graph
print("Welcome to CAA!- You are a lion trying to escape the jungle maze...")
def convert_to_networkx_graph(graph):
"""
:rtype: object
"""
G = nx.Graph(name = "CAA i... |
<reponame>HA1907/MSc-Dissertation
import json, pickle, os
# cd drive/MyDrive/'Colab Notebooks'/Thesis/PeerRead/code/accept_classify/
# Train Data and Target
p_train_path = "../../data/iclr_2017/train/parsed_pdfs/"
p_train_file = lambda f: p_train_path+f
p_train_file_names = os.listdir(p_train_path)
r_train_path = "... |
<reponame>RRBuilder/RRBot
import requests
from functools import lru_cache, wraps
from datetime import datetime, timedelta
def timed_lru_cache(seconds: int, maxsize: int = 128):
def wrapper_cache(func):
func = lru_cache(maxsize=maxsize)(func)
func.lifetime = timedelta(seconds=seconds)
func... |
import os
import numpy as np
import pandas as pd
from tensorflow.keras.callbacks import EarlyStopping
from kerastuner.tuners import Hyperband
from modules.models import LanguageModel
from modules.utils.data_utils import DataGenerator
def run_model_fitting(PROJECT_NAME):
"""
"""
SENTENCE_DECODER = pd.r... |
<gh_stars>0
"""
"""
from fusion_review.itrace import IntensityTrace
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
class IntensityTraceFigurePanel:
def __init__(self, num_traces, num_rows, num_columns, intensity_database):
#GET RID OF NUM_TRACES AND JUST USE ID.NUM_TRACES
... |
<gh_stars>0
################################################################################
# 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 l... |
import board
import busio
from time import sleep, time
from math import atan, atan2, cos, pi, sin
from digitalio import DigitalInOut, Direction, Pull
DEBUG = True
PIN_ONBOARD_LED = board.D13
PIN_PACKET_RECEIVED_LED = board.D6
PIN_PACKET_SENT_LED = board.D9
SEND_PACKET_INTERVAL_MIN = 0.6
SPI_SCK = board.SCK
SPI_MISO... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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... |
<gh_stars>0
# Copyright Amazon.com, Inc. or its affiliates. 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.... |
<filename>main.py
from __future__ import print_function
from flask import Flask
import numpy as np
import pandas as pd
from flask import render_template
from flask import request
from flask import abort, redirect, url_for
from flask import send_from_directory
from CoverModel.project import *
from werkzeug.utils import ... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Various positional encodings for the transformer.
"""
import math
import torch
from torch import nn
from detr.util.misc import NestedTensor
class PositionalEncoding(nn.Module):
"""Regular positional encoding module that returns the encodin... |
<filename>src/spider/spider/core.py<gh_stars>0
#!/usr/bin/env python3
import json
import importlib
import socket
from geojson import Feature, Point, FeatureCollection
from geopy.exc import GeocoderTimedOut
from geopy.geocoders import Nominatim
import cobwebs
from cobwebs.config import get_config, import_plugin
# data... |
<reponame>alan-turing-institute/QUIPP-workflow
"""
Code to calculate disclosure risk metric.
"""
import argparse
import json
import os
import pickle
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from glob import glob
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.p... |
<reponame>sbussmann/Bussmann2015
"""
2014 November 13
<NAME>
Overlay ALMA contours on IRAC 3.6um, 4.5um, 8.0um 3-color image.
"""
from astropy.table import Table
#import aplpy
#from PIL import Image
import numpy
from astropy.io import fits
from astropy import wcs
from pylab import savefig
import img_scale
import y... |
<gh_stars>1-10
#
# DeepR<NAME>
#
# Version 3.0 onwards
#
# Copyright (c) 2021 dmh23
#
from src.tracks.track import Track
import src.personalize.configuration.personal_track_annotations as config
class Baadal2020Track(Track):
def __init__(self):
super().__init__()
self._ui_name = "Baadal Track"
... |
<filename>tests/manage/pv_services/pvc_resize/test_node_restart_during_pvc_expansion.py<gh_stars>0
import logging
import pytest
from concurrent.futures import ThreadPoolExecutor
from ocs_ci.ocs import constants, node
from ocs_ci.utility.utils import ceph_health_check
from tests.helpers import wait_for_resource_state
f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data
# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP
# (c) 07/2019-present : DESY PHOTON SCIENCE
# authors:
# <NAME>, <EMAIL>
import matplotlib
import matplotlib.pyplot as plt
f... |
import sys, codecs, json
from argparse import ArgumentParser
from copy import deepcopy
from pymongo import MongoClient
#=====================================
sys.stdin = codecs.getreader('utf8')(sys.stdin.detach())
sys.stderr = codecs.getwriter('utf8')(sys.stderr.detach())
sys.stdout = codecs.getwriter('utf8')(sys.st... |
<reponame>uta-smile/CD-MVGNN<gh_stars>1-10
#!/usr/bin/env python
from __future__ import print_function
from collections import defaultdict
import numpy as np
from dglt.contrib.moses.moses.model.sd_vae.config import get_parser
from dglt.contrib.moses.moses.model.sd_vae.utils.mol_tree import Node
cmd_args, _ = get_... |
<filename>collection_manager/collection_manager/services/history_manager/SolrIngestionHistory.py
import hashlib
import logging
import pysolr
import requests
from collection_manager.services.history_manager.IngestionHistory import (IngestionHistory, IngestionHistoryBuilder)
from common.async_utils.AsyncUtils import run... |
<gh_stars>1-10
# Monkey-patch because I trained with a newer version.
# This can be removed once PyTorch 0.4.x is out.
# See https://discuss.pytorch.org/t/question-about-rebuild-tensor-v2/14560
import torch._utils
try:
torch._utils._rebuild_tensor_v2
except AttributeError:
def _rebuild_tensor_v2(storage, storag... |
"""
<NAME>
<NAME>
<NAME>
<NAME>
CISC 204
Modelling project
Wed december 9th 2020
Professor Muise
"""
#Import
from nnf import Var
from nnf import Or
import nnf
from lib204 import Encoding
from csvReader import readCSV
'''
Customer class
Used to create a class containing the various restrictions a
person might have ... |
<reponame>RemcoTaal/IDP<filename>Gui.py<gh_stars>0
"""
Interdisciplinair Project
University of Applied Sciences Utrecht
TICT-V1IDP-15 Project
"""
import csv
import datetime
import json
import random
import socket
import time
import tkinter as tk
import tkinter.font
import uuid
import requests
from _thread... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import celery
from celery.bin import worker as celery_worker
from datetime import datetime
from subprocess import Popen
from flask_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.