text stringlengths 8.04k 46.5k |
|---|
"""Widgets to work with processes."""
# pylint: disable=no-self-use
# Built-in imports
import os
import warnings
from inspect import isclass, signature
from threading import Event, Lock, Thread
from time import sleep
# External imports
import ipywidgets as ipw
import pandas as pd
import traitlets
# AiiDA imports.
fro... |
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw, ImageFont
from matplotlib.gridspec import GridSpec
import gym
import numpy as np
import os
import io
import glob
import math
import time
from itertools import chain
from tqdm import tqdm
from gym import spaces
... |
"""Various functions to collect data to be used by the ``views`` of the
``jwql`` app.
This module contains several functions that assist in collecting and
producing various data to be rendered in ``views.py`` for use by the
``jwql`` app.
Authors
-------
- <NAME>
- <NAME>
Use
---
The functions within th... |
from __future__ import division, print_function, absolute_import
import os
import sys
import functools
from textwrap import TextWrapper
from collections import defaultdict
from plumbum.lib import six, getdoc
from .terminal import get_terminal_size
from .switches import (SwitchError, UnknownSwitch, MissingArgument, Wro... |
from rpython.jit.metainterp.compile import ResumeGuardDescr
from rpython.jit.metainterp.history import (ConstInt, INT, FLOAT)
from rpython.jit.backend.llsupport.descr import (ArrayDescr,
unpack_arraydescr)
from rpython.jit.metainterp.resoperation import VectorOp, rop
from rpython.rlib.objectmodel import we_are_tra... |
# Written by Dr <NAME>, Marda Science LLC
# for the USGS Coastal Change Hazards Program
#
# MIT License
#
# Copyright (c) 2020, Marda Science LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Soft... |
"""Integration test for pytype."""
import csv
import hashlib
import os
import shutil
import subprocess
import sys
import tempfile
import textwrap
from pytype import config
from pytype import single
from pytype import utils
from pytype.pyi import parser
from pytype.pytd import builtin_stubs
from pytype.pytd import pyt... |
r"""
User object (:mod:`qiita_db.user`)
==================================
.. currentmodule:: qiita_db.user
This modules provides the implementation of the User class. This is used for
handling creation, deletion, and login of users, as well as retrieval of all
studies and analyses that are owned by or shared with th... |
import pickle
import numpy as np
import os
import shutil
import warnings
from ml_utils.plot_utils import plot_roc_auc
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.layers import (
Input,
Dense,
Activation,
Dropout,
BatchNormalization,
LSTM,
AdditiveAttention,
Ad... |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2015 HP Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... |
from typing import Union, List
from collections import defaultdict
import pickle
import xml.etree.ElementTree as ElemTree
from xml.dom import minidom
from matplotlib import pyplot as plt
from matplotlib import cm, colors
from matplotlib.animation import FuncAnimation, PillowWriter, FFMpegWriter
from matplotlib.widget... |
import os
import json
import random
import math
import pdb
import logging
logger = logging.getLogger(__name__)
import faiss
import torch
def get_examples(data_dir, mode):
if 'NCBI' in data_dir:
entity_path = './data/NCBI_Disease/raw_data/entities.txt'
elif 'BC5CDR' in data_dir:
... |
# Carneades Argument Evaluation Structure
#
# Copyright (C) 2014 <NAME>
# Author: <NAME> <<EMAIL>>
# Based on: https://hackage.haskell.org/package/CarneadesDSL
#
# For license information, see LICENSE
"""
==========
Overview
==========
Propositions
============
First, let's create some propositions using the :class... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((6*9,3), np.float32)
objp[:,:2] = np.mgrid[0:9,0:6].T.reshape(-1,2)
# Arrays to store object points and image points from all the images.
objpoints = [] # 3d p... |
# coding:utf-8
# Produced by <NAME>
# 06_Aug_2019
# Inspired By Google, Appreciate for the wonderful work
#
# Copyright 2019 TCL Inc. All Rights Reserverd.
# 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 ... |
# Lint as: python3
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2011-2020, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
"""
Polar Grid Functions
^^^^^^^^^^^^^^^^^^^^
.. autosummary::
:nosignatures:
:toctree: generated/
{}
"""
__all__ = [
"spherical_to_xyz",
"... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
import tflearn
def network(frame1, frame2, frame3, is_training, reuse=False, scope='netflow'): # design for QP37,42
with tf.variable_scope(scope, reuse=reuse):
# Define multi-scale feature extraction network
c3_1_w = tf.get_variable(... |
"""
eye_diagram.py
This module imports time-domain waveform data from LTSpice, either from .raw
files or as tab-separated text.
A sub-interval of the DME waveform (usually 1 bit in, from both the start and
stop) is then fitted to identify zero crossings. The waveform is then folded
with a fixed 80 ns period to genera... |
import os
import sys
import json
import argparse
import subprocess
import shutil
import train, test
import yaml
from enum import Enum
# from sklearn.model_selection import train_test_split
from python_utils.common import general as cg, logger as cl
from python_utils.common import strings as cs
from python_utils.json im... |
r"""
mutation_class
This file contains helper functions for compute the mutation class of a cluster algebra or quiver.
For the compendium on the cluster algebra and quiver package see [MS2011]_
AUTHORS:
- <NAME>
- <NAME>
"""
# ****************************************************************************
# Copy... |
#!/usr/bin/python
# encoding: utf-8
"""
ligand.py
Basic parsing for the PDB ligand .cif and XML formats.
Created by <NAME> 2015
"""
import os
from io import BytesIO
import re
import copy
from klab.bio.rcsb import retrieve_ligand_cif, retrieve_pdb_ligand_info, retrieve_ligand_diagram
from klab.bio.basics import three... |
import inspect
import platform
import sqlite3
import textwrap
import traceback
from contextlib import redirect_stdout
from distutils.version import StrictVersion
import pkg_resources
from discord.ext import commands
# Exposing for /debug command
from nabbot import NabBot
from .utils import checks
from .utils.database... |
#
# YamahaControl App
# Control a Yamaha RX-V1500 receiver connected via RS232 using MQTT
#
import logging
#
# USER SETTINGS
#
MQTT_BROKER_HOST = 'mqtt-broker.local'
MQTT_BROKER_PORT = 1883
MQTT_TOPIC_PREFIX = "yamaha-rxv1500"
MQTT_CLIENT_ID = 'raspi'
MQTT_BROKER_USERNAME = 'mqtt-user'
MQTT_BROKER_PASSWORD = '*******... |
#!/usr/bin/env python
# Modified from https://github.com/agramian/custom-text-test-runner
# The MIT License (MIT)
#
# Copyright (c) 2015 <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 Soft... |
"""Wiring module."""
import asyncio
import functools
import inspect
import importlib
import importlib.machinery
import pkgutil
import sys
from types import ModuleType
from typing import (
Optional,
Iterable,
Iterator,
Callable,
Any,
Tuple,
Dict,
Generic,
TypeVar,
Type,
Union... |
"""Generate the WEPP prj files based on what our database has for us.
Here's a listing of project landuse codes used
No-till (1) (2-5)
B - Soy B1 B25 IniCropDef.Default
F - forest F1 F25 IniCropDef.Tre_2239
G - Sorghum
P - Pasture ... |
# testresources: extensions to python unittest to allow declaritive use
# of resources by test cases.
#
# Copyright (c) 2005-2010 Testresources Contributors
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# ... |
'''
Tetris Battle
originally Ccreated by <NAME>, <NAME>
modified by <NAME>
this is a similar version to the ever popular tetris battle
game with not many changes"
'''
#basic modules needed for game to run
import os
import pygame
import random
import math
import numpy as np
from .settings import *
from .tetris_co... |
# 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... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import pickle
import sys
import time
import networkx as nx
import ray
import ray.streaming.processor as processor
import ray.streaming.runtime.transfer as transfer
from ray.streaming.communicati... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# JASL: For more information see https://github.com/matepek/jasl
#
# Copyright (c) 2018 <NAME>
#
# This code is licensed under the MIT License (MIT).
import os
import sys
import subprocess
import argparse
import platform
import shutil
import re
import tempfile
import jso... |
from datetime import datetime
from couchdbkit import ResourceNotFound
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template.loader import render_to_string
from django.views.decorators.http import require_P... |
#
# Created on March 2022
#
# Copyright (c) 2022 <NAME>
#
import torch
import torch.nn as nn
import torch.nn.functional as F
class MLP_Classifier(nn.Module):
def __init__(self, hparams, codes_dim=320, k=None, weights_fc1=None, weights_fc2=None, bias_fc1=None, bias_fc2=None,):
super(MLP_Classifier, self).... |
import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
#METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py'
#METAOPTIMIZAT... |
import os
from collections import defaultdict
import re
from collections import OrderedDict
from warnings import warn
from nltk import Tree
def import_conll(filepath):
'''
This function imports a conll file into a list of dictionaries
:returns data: a list of lists of dictionaries, each with informati... |
# WRITE UP AND AUTHOR HERE:
#
#
#
# -*- coding: utf-8 -*-
import gym
from gym import wrappers
import tensorflow as tf
import numpy as np
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
from scipy import stats
import pickle
import datetime
# my files
# import os
# import importlib
# import DeepNetPI
#... |
"""Module providing an interface to manipulate the sources of a vocabulary,
and to ability to export it to models"""
import copy
import io
import keyword
import os
from datetime import datetime
from string import ascii_letters, digits
from typing import List, Optional, Dict, Tuple, Set
import pathlib
import requests
... |
'''
@file helprs.py
@package momentumopt
@author <NAME> (<EMAIL>)
@license License BSD-3-Clause
@copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft.
@date 2019-10-08
'''
import numpy as np
from scipy import signal
import yaml, math, matplotlib
import matplotlib.pyplot as plt
import matplotli... |
import datetime
from datetime import datetime as dt
from datetime import timedelta as td
import os
import re as reg
from math import sqrt
import matplotlib.pyplot as plt
import matplotlib.pylab as plb
import numpy as np
from sklearn.ensemble import VotingRegressor
from sklearn.ensemble import GradientBoosting... |
"""
This file compiles the code in Web Browser Engineering,
up to and including Chapter 12 (Scheduling and Threading),
without exercises.
"""
import ctypes
import dukpy
import io
import math
import sdl2
import skia
import socket
import ssl
import threading
import time
import urllib.parse
from lab4 import print_tree
fr... |
from itertools import cycle
import random
import sys
"""
Trabalho de Inteligência Artificial
Nome: <NAME>
Matrícula: 0015920
Para que o jogo funcione deve ser instalado os seguintes requisitos:
'pygame'
'numpy'
'skfuzzy' ou 'scikit-fuzzy'
'matplotlib'
(Ver arquivo 'Pipfile'. Se ne... |
#!/usr/bin/env python3
#
# Copyright (c) 2019-2020 <NAME>, see https://github.com/mikespub-org
# Licensed under the MIT license: https://opensource.org/licenses/mit-license.php
#
"""Basic support of Google Cloud Firestore as filesystem with PyFilesystem2
Example opening directly with FirestoreFS():
>>> from firest... |
from utils import *
import csv
import os
import os.path
from parse import Query
from index import *
def perform_query(Q, I):
"""PERFORM_QUERY
DESCRIPTION: This is where the query work starts. Take a parsed SQL query, apply it
to the selected tables, and return the final results.
INPUT: Q... |
"""
Sleep and major rest period detection
<NAME>, <NAME>
Copyright (c) 2021. Pfizer Inc. All rights reserved.
"""
from sys import gettrace
from collections.abc import Iterable
from warnings import warn
from datetime import datetime, timedelta
from pathlib import Path
from datetime import date as dt_date
from numpy im... |
#! /usr/bin/env python3
import sys
import os
import re
import json
BUILDINGS = {
12: {"internal_name": "BRKS", "Name": "Barracks"},
45: {"internal_name": "DOCK", "Name": "Dock"},
598: {"internal_name": "WCTWX", "Name": "Outpost"},
72: {"internal_name": "WALL", "Name": "Palisade Wall"},
789: {"inte... |
import os
from os.path import join
import time
import pandas as pd
import numpy as np
import pickle
import warnings
# from matplotlib import pyplot as plt
import argparse
import logging
import csv
import sys
import ujson as ujson
from bs4 import BeautifulSoup
import re
from nltk.corpus import stopwords
from nltk.stem.... |
"""
Author: <NAME> (<EMAIL>)
Date: Feb 12, 2022
"""
import random
import numpy as np
import time
import matplotlib.pyplot as plt
from datetime import datetime
def generate_random_N_paths(N, path_length):
'''
Randomize N paths where each path is like 00 01 00 01 01 01
'''
one_solution = []
while l... |
# -*- coding: utf-8 -*-.
"""
Created on Thu Apr 2 16:01:44 2020
@author: <NAME>
"""
# Import the necessary packages
from consolemenu import *
from consolemenu.format import *
from consolemenu.items import *
from consolemenu import SelectionMenu
import socket
import os
from os import path
import cv2
import speech... |
"""
Author: Benny
Date: Nov 2019
"""
import argparse
import os
from data_utils.S3DISDataLoader import S3DISDataset
import torch
import datetime
import logging
from pathlib import Path
import sys
import importlib
import shutil
from tqdm import tqdm
import provider
import numpy as np
import time
from pytorch3d import ops... |
#!/usr/bin/env python3
import argparse
import csv
import time
import logging
import sys
import os
from multiprocessing import Process
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
import requests
import kube_util as util
log = logging.getLogger(__name__)
FILE_DIR = Path(__file__).parent.... |
import tkinter as tk
import os
import sys
import time
import math
import pickle
import threading
import concurrent.futures
import cameraTrigger
import cameraCalibration as cc
import mocapSolver as solver
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
from firebase_admi... |
import os
import numpy as np
from sklearn.metrics import accuracy_score
import h5py
import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorflow.keras import optimizers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, Flatten, MaxPool2D, Dense
fr... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function, division, absolute_import
from copy import deepcopy
import numpy as np
import pytest
from .. import fetch
from .. import fetch_eng
from Chandra.Time import DateTime
print(fetch.__file__)
DATES_EXPECT1 = np.array(... |
# Copyright 2017,2018,2019,2020,2021 Sony Corporation.
#
# 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... |
import os
import re
from collections import namedtuple
import tensorflow as tf
import numpy as np
import ops.semantic_segmentation.imageops as imageops
Label = namedtuple('Label', [
# The identifier of this label, e.g. 'car', 'person', ... .
# We use them to uniquely name a class
'name',
# An integer ... |
"""
Commands that are available for administrators.
"""
import re, time
from discord_webhook import DiscordWebhook
from django.conf import settings
from evennia.commands.default.account import CmdQuell as DefaultQuell
#from evennia.commands.default.system import (
# why is this here?
# CmdAbout as DefaultAbout... |
from django.db.models import F
from celery.task import task
from celery import chain, group, chord
from celery.utils.log import get_task_logger
from datetime import datetime, timedelta
import shutil
import xarray as xr
import numpy as np
from xarray.ufuncs import logical_or as xr_or
from xarray.ufuncs import logical_an... |
"""
prefix: /api/_
In here live private API endpoints for use only by OONI services. You should
not rely on these as they are likely to change, break in unexpected ways. Also
there is no versioning on them.
"""
from datetime import date, datetime, timedelta
from urllib.parse import urljoin, urlencode
import logging
... |
#!/usr/bin/env python3
# pylint: disable=C0103,E0401
import os
import json
from random import randint
import math
import numpy as np
import dash
from dash.dependencies import Input, Output, State
import plotly.graph_objs as go
from dash import dcc
from dash import html
from dash import dash_table
import dash_dangerous... |
# coding=utf-8
# Copyright 2022 The Trajectory Transformers paper authors and The HuggingFace Inc. team. 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://ww... |
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import numpy as np
import pandas as pd
from typing import Tuple, Optional
from cmocean import cm
from .logging_utils import logger
plt.style.use('fivethirtyeight')
plt.rcParams['svg.fonttype'] = 'none'
def clean_axis(ax, ts=11, ga=0.4):
... |
import itertools
import logging
from enum import Enum
from typing import *
import h5py
import numpy as np
import ot
import scipy.ndimage
import scipy.stats
import skimage.metrics
import skimage.transform
# Do the annoying global config for Tensorflow before importing keras.
import tensorflow as tf
tfConfig = tf.Confi... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... |
"""
Copyright 2019 <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 agreed to in writing, software
distribute... |
import gym
import tensorflow as tf
import numpy as np
from stable_baselines import logger
from stable_baselines.ppo2 import PPO2
from stable_baselines.ppo2.ppo2 import swap_and_flatten
from stable_baselines.common.callbacks import BaseCallback
from stable_baselines.gasil.adversary import TransitionClassifier
# from s... |
#!/usr/bin/env python3
# coding: utf-8
#
# MIT License
#
# Copyright © 2019-2020 <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... |
import bmesh
import bpy
from mathutils import Vector
import numpy as np
import codecs
from mathutils.bvhtree import BVHTree
from mathutils import(Vector, Matrix, kdtree )
from mathutils.geometry import (intersect_line_line, intersect_line_line_2d, intersect_point_line,
intersect_line_pla... |
# -*- coding: utf-8 -*-
"""
Specifies utility functions.
@author: <NAME>, <EMAIL>
"""
import os
import pickle
import warnings
import numpy as np
import tensorflow as tf
import scipy.io as sio
import mne
def _onehot(y, n_classes=False):
if not n_classes:
"""Create one-hot encoded labels."""
n_clas... |
# HELPS GENERATE CROSS PLATFORM INSTALL SCRIPTS
# -*- coding: utf-8 -*-
"""
TODO:
needs a big cleanup.
Remove global variables, use functions instead.
Make an easy, versionable, and overrideable set of aliases.
CommandLine:
ib
python ./_scripts/util_cplat_packages.py
python ./_scripts/util_cpla... |
########################
###
### IMPORTS
###
########################
########################
### BUILTIN
########################
from itertools import chain
from functools import wraps
import codecs
import pprint
import sys
import re
import os
########################
### LOCAL
#####... |
"""
This file compares our method against NCF on the smaller datasets. This uses the datasets from the
original NCF paper, as well as their evaluation method. The evaluation is a bit different -- instead
of comparing the scores of ALL items, it samples one "seen" item and 99 "unseen" item, and measures the
frequency of... |
"""
Plotting projection uncertainty.
"""
import datetime
import logging
from math import ceil
from typing import List
import matplotlib.ticker as mtick
import pandas as pd
from matplotlib import pyplot
from numpy import mean
from autumn.core.plots.plotter import Plotter
from autumn.core.plots.utils import (
ALPHA... |
import fnmatch
import os
from collections import Counter
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import torch
from scipy.io import loadmat
from scipy.optimize import curve_fit
from data_loader.data_loaders import Bin_energy_data
project_path = Path(__file__).parent.parent
fig_path... |
from sympy.core.symbol import Symbol
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core.basic import Basic, S
from sympy.core.sympify import sympify
from sympy.core.numbers import Rational
from sympy.polys.polynomial import Poly, SymbolsError, \
PolynomialError, CoefficientError, Multiva... |
# encoding: utf-8
"""Tests for traitlets.config.loader"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import copy
import os
import pickle
from itertools import chain
from tempfile import mkstemp
from unittest import TestCase
import pytest
from traitlets.confi... |
import pickle
import sys
import numpy as np
import pandas as pd
from ann_training import train_network_denseonly1, train_network_batchnorm_etal, train_network_vgg16, \
prepare_dataset_spike, prepare_dataset_ann, train_network_base, train_network_lenet5, train_network_lenet5_maxpool, \
train_network_base_scale... |
#! /usr/bin/python3
import numpy as np
import sys
import matplotlib.pyplot as plt
from scipy import special as sc
from nuclide import *
from fg import solve
import optical
from fractions import Fraction
from sympy.physics.quantum.spin import *
#debug
import pdb
"""
This module calculates cross sections for neutral p... |
import json
import logging
import re
import traceback
import captions
import components.botproperties
import settings
import util
from components import botlistchat, help, favorites, admin, basic, botproperties, botlist, \
broadcasts, explore
from components import contributions
from components import eastereggs
f... |
#@+leo-ver=5-thin
#@+node:ekr.20100103093121.5339: * @file ../plugins/stickynotes_plus.py
#@+<< docstring >>
#@+node:ekr.20100103100944.5389: ** << docstring >>
''' Adds simple "sticky notes" feature (popout editors) for Qt gui.
alt-x stickynote to pop out current node as a note.
'''
#@-<< docstring >>
# Disable Qt w... |
# -*- coding: utf-8 -*-
"""
A command line tools
"""
import string
class Style(object):
RED = "\033[31m" # for error message
GREEN = "\033[32m" # for success message
CYAN = "\033[36m" # for information
RESET = "\033[39m" # reset to default
class Logger(object):
def info(self, msg):
... |
import os
import shutil
import os
import json
kek="""[
{"type": "raster-image", "extension": "bmp", "mime": "image/bmp", "offset": 0, "signature": ["42 4D"]},
{"type": "raster-image", "extension": "gif", "mime": "image/gif", "offset": 0, "signature": ["47 49 46 38"]},
{"type": "raster-image", "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Goal is to read xml and save as tsv
http://dtd.nlm.nih.gov/ncbi/pubmed/out/pubmed_190101.dtd
https://www.nlm.nih.gov/bsd/licensee/elements_descriptions.html
#TODO: I would be interested in seeing how performance compares
if instead of doing finds we just iterated elem... |
"""
Utility functions for RSMTool command-line tools.
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:organization: ETS
"""
import argparse
import logging
import os
import re
import sys
from collections import OrderedDict, namedtuple
from itertools import chain, product
from pathlib im... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Parser for Turbomole output files."""
from __future__ import print_function
import re
import numpy
f... |
from astropy.io import fits
from astropy import wcs
import radio_beam
import numpy as np
import astropy.units as u
from astropy import coordinates
from astropy.nddata.utils import Cutout2D, NoOverlapError
from astropy.table import Column, Table, vstack
from astrodendro import Dendrogram, pp_catalog
import regions
impor... |
'''
Should you modify this file, do it hand in hand with 'pdf_evasion.rb'.
This is the right place to add new test casess ('translate' function needs also to be updated
accordingly), new shellcodes, and new exploit modules.
author: <NAME> (<EMAIL>)
Summer 2017
'''
'''
adding a new test case has an implication:
1. addi... |
#!env python3
from collections import defaultdict
import glob
import json
import os
import re
import requests
import shlex
import shutil
import time
import zipfile
imgurl = "https://netrunnerdb.com/card_image/"
image_loc = "./images"
trace_re = re.compile(r"<trace>[Tt]race (.)</trace>")
cardline = re.compile(
r'... |
import numpy as np
from scipy.stats import qmc
from scipy.stats import special_ortho_group
from scipy.optimize import minimize
import warnings
class SSPSpace:
def __init__(self, domain_dim: int, ssp_dim: int, axis_matrix=None, phase_matrix=None,
domain_bounds=None, length_scale=1):
'''
... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
# 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 (t... |
import random
from typing import List, Tuple
import gym
import numpy as np
from gym import spaces
from framework.DataConstants import DEFAULT_PKM_N_MOVES, MAX_HIT_POINTS, STATE_DAMAGE, SPIKES_2, SPIKES_3, \
TYPE_CHART_MULTIPLIER, DEFAULT_MATCH_N_BATTLES, DEFAULT_N_ACTIONS
from framework.DataObjects import PkmTeam... |
"""Makes barcode-wheels"""
import array
import base64
import csv
import pathlib
import re
import shlex
import subprocess
import sys
from collections import OrderedDict, deque, namedtuple
from functools import lru_cache, partial, reduce
from io import StringIO
from itertools import chain, islice
from math import asin, c... |
import traceback
import time as ti
import enum
from .basegamestate import BaseGameState
from game.particle.battlerender import BattleRender
from game.combat.combatscene import CombatScene
from game.combat.agent.agentrand import AgentRand
from game.combat.agent.agentuser import AgentUser
from ..combat.action import ... |
from bioagents.tra import kappa_client
__all__ = ['TRA', 'get_ltl_from_pattern', 'apply_condition',
'get_create_observable', 'pysb_to_kappa', 'get_sim_result',
'get_all_patterns', 'TemporalPattern', 'TimeInterval',
'InvalidTemporalPatternError', 'InvalidTimeIntervalError',
'M... |
from abc import ABC, abstractmethod
from copy import deepcopy
import logging
import multiprocessing
from pretty import pretty
import katdal
from katdal import DataSet
from katdal.datasources import DataSourceNotFound
from katacomb import (KatdalAdapter, obit_context, AIPSPath,
task_factory,
... |
from .Env_new import RealExpEnv
from .get_atom_coordinate import get_all_atom_coordinate_nm, get_atom_coordinate_nm_with_anchor
from .rrt import RRT
from .data_visualization import plot_atoms_and_design
from scipy.spatial.distance import cdist as cdist
import numpy as np
from scipy.optimize import linear_sum_assignmen... |
"""All the forms on TheHaloMod"""
import logging
import hmf
import numpy as np
from crispy_forms.bootstrap import TabHolder
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, Div, HTML, Field
from django import forms
from django.utils.safestring import mark_safe
from hmf import... |
'''Module for generating and plotting networks.'''
from trafpy.generator.src import tools
import copy
import networkx as nx
import matplotlib.pyplot as plt
import json
def gen_arbitrary_network(num_eps,
ep_label=None,
ep_capacity=12500,
... |
"""A domain defines domain-specific processing."""
import os
import re
import subprocess
import sys
import tempfile
import atislexicon
class Domain(object):
"""A semantic parsing domain.
This parent class defines methods that can be overridden by subclasses to
induce domain-specific behavior.
By def... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.