text stringlengths 6.04k 39.5k |
|---|
import os
import time
import argparse
from PIL import Image
import numpy as np
import numpy.ma as ma
import scipy.io as scio
import torch
import torch.nn.parallel
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
from lib.network import PoseNet
from lib.ransac_votin... |
import sys
import os
import os.path
from os import path
import requests
import json
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from typing import List
import re
from typing import Optional
import win32console # needs pywin32
import time
## TODO
# Don't crash when the file is already... |
#!/usr/bin/env python
# coding: utf-8
# Import modules
import numpy as np
import random
import numba
def proba_edges(L, theta_edges, delta):
'''
Function that converts theta_ij into probabilities
Uses theta_edges, delta (fixed parameters)
'''
proba_edges = []
for k in range(0,L):
theta... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
classes and functions for image processing
data2Image: generate image from data file, hdf5, asc, dat
Author: <NAME>
Created: Sep. 28, 2015
"""
from __future__ import print_function
from PIL import Image
import matplotlib.pyplot as plt
import h5py
import os
import w... |
import logging
import os
import sys
import pandas as pd
import numpy as np
def bp(billing_period, period, pf="", sf=""):
return "%s%s%.2d%s" % (pf, billing_period, period, sf)
def avg_bp(billing_period, period):
return bp(billing_period, period, sf="_mean")
def rate(billing_period, period):
return bp(... |
#Copyright (c) Microchip. All rights reserved.
#Import needed python packages
import sys
import time #For delays and getting current time
import smbus
from array import array #For handling samples
import statistics #For signal filtrat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
from collections import namedtuple
from ctypes import c_char_p, c_int, c_uint, c_ulong, c_void_p, byref, cdll, create_string_buffer
from enum import IntEnum
from textwrap import indent
log = logging.getLogger(__name__)
class LibAsoundError(Exc... |
# Encoding: utf-8
# Author: <NAME>
import configparser
import datetime
import pickle
import numpy as np
import pandas as pd
from pandasql import sqldf
from pyhive import hive
from sklearn.cluster import KMeans
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
fro... |
import sqlite3 as sql
from typing import Dict, List, Any, Tuple, Iterable
import json
class InvalidRecordError(Exception):
""" Indicates that a record object does not belong to a given Table """
pass
class TableNotFoundError(Exception):
""" Indicates that there is no table in the db that matches a give... |
import asyncio
import os
import random
from collections import deque
from datetime import datetime
import discord
import jwt
from discord.ext import commands
from loguru import logger
from .utils.SecretSanta import SecretSantaModel
from .utils.EventType import EventTypeModel
from .utils.SecretSantaSettings import Sec... |
#!/usr/bin/env python
# coding: utf-8
# # Generate training data
import os
import json
import jieba
import re
from pprint import pprint
from collections import defaultdict
from copy import copy
import random
import zipfile
import functools
def read_json(filename):
with open(filename, 'r') as f:
return j... |
import numpy as np
import math
from rtree import index
from pyneval.model import euclidean_point as euc_p
from pyneval.metric.utils import config_utils
from pyneval.model import swc_node
def get_match_edges(gold_swc_tree=None, test_swc_tree=None,
radius_threshold=-1.0, length_threshold=0.2,
... |
"""
This package is used to generate the values of the
1) derivative of function
2) Taylor series
3) Fourier series
4) Legendre approximation
5) Larange approximation
6) Series converenge viewing
7) Limit of a given sequence
"""
import numpy as np
import seaborn as sn... |
from __future__ import annotations
import logging
from pydoc import locate
from typing import Dict, List, Union, Optional, Any
from datetime import datetime, timedelta
import pytz
from celery.schedules import crontab
import util
from celery.utils.time import humanize_seconds
from api.models import * # noqa
from api... |
# -*- coding: utf-8 -*
# !/usr/bin/env python3
import sys
sys.path.append('../')
import os
import datetime as dt
import pandas as pd
import numpy as np
import statsmodels.tsa.stattools as st
from itertools import combinations
import statsmodels.api as sm
from sqlalchemy import and_
from flask import Flask
from sy... |
import numpy as np
from cereal import car
from common.kalman.simple_kalman import KF1D
from selfdrive.config import Conversions as CV
from selfdrive.can.parser import CANParser, CANDefine
from selfdrive.car.vw.values import DBC, CAR
# TODO: additional signals
# * ACC following distance setpoint
# * ACC distance to c... |
import pickle
from os import rename, remove
from os.path import join, dirname, realpath, isfile
import keras.backend as K
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.callbacks import ModelCheckpoint
from keras.layers import BatchNormalization, Dropout
from ... |
# Copyright 2019 Zrna Research 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 applicable law or agreed to in writing... |
import os
import sys
import notedown
import nbformat
import logging
import shutil
import datetime
import argparse
import re
import regex
import subprocess
import hashlib
from d2lbook.utils import * # TODO(mli), don't report *
from d2lbook.sphinx import prepare_sphinx_env
from d2lbook.config import Config
from d2lbook ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`decision_stump`
==================
.. module:: decision_stump
:platform: Unix, Windows
:synopsis:
.. moduleauthor:: hbldh <<EMAIL>>
Created on 2014-08-31, 01:52
"""
from __future__ import division
from __future__ import print_function
from __future__ im... |
from copy import copy
from copy import deepcopy
import numpy as np
import numpy.linalg as la
import simtk.unit as unit
import mdtraj as mdj
from geomm.recentering import recenter_pair
from geomm.rmsd import calc_rmsd
from wepy.resampling.distances.distance import Distance
class OpenMMDistance(Distance):
""" ... |
import ptypes
from ptypes import *
from . import sdkddkver, ketypes, umtypes
from .datatypes import *
class TL(pstruct.type):
_fields_ = [
(P(lambda self: TL), 'next'),
(PVOID, 'pobj'),
(PVOID, 'pfnFree'),
]
class PTL(P(TL)): pass
class W32THREAD(pstruct.type, versioned):
def __in... |
# (c) 2019-2021, <NAME> @ ETH Zurich
# Computer-assisted Applications in Medicine (CAiM) Group, Prof. <NAME>
import numpy as np
import tensorflow as tf
import os
import logging
import re
import matplotlib.pyplot as plt
import io
import time
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WA... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <<EMAIL>> <https://hanxiao.github.io>
import sys, json, threading, time, uuid, warnings
from collections import namedtuple
from functools import wraps
import zmq
from zmq.utils import jsonapi
__all__ = ['__version__', 'MedTypeClient']
# in the future client ver... |
import base64
import binascii
from datetime import datetime, timedelta, timezone
from http import HTTPStatus
import logging
import marshal
import os
from random import randint
from sqlite3 import IntegrityError, OperationalError
import struct
from typing import Callable, Coroutine, Optional, Tuple
from aiohttp import ... |
# coding: utf-8
# In[1]:
import os
import math
import numpy as np
import tensorflow as tf
import cv2
import re
slim = tf.contrib.slim
# In[2]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.cm as mpcm
import cv2
from nets import ssd_vgg_300
from nets import np_methods
from ... |
#!/usr/bin/env python3
import click
from click_aliases import ClickAliasedGroup
from json import dumps
import os
import re
import shutil
import subprocess
import sys
import time
from . import usbinfos
conf = {
# command line to connect to the REPL (screen, tio)
"SERIALTOOL" : "screen {port} 115200",
# command line... |
import argparse
import importlib
import logging
import os
import pprint
import re
import shutil
import sys
import yaml
from collections import ChainMap
from datetime import datetime
from inspect import getmembers, getfullargspec, isfunction
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
fro... |
import os
import tensorflow as tf
import numpy as np
import argparse
import pandas as pd
import model
import time
import losses as lossx
from model import train_op
from model import loss_CE
from tensorflow.python.framework import graph_util
parser = argparse.ArgumentParser()
#you can optionly change the model_d... |
import os
import json
from numpy import genfromtxt
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
# there is a bug in log files, some of them have __ instead of _
EPISODE_LOG_NAME = "episode_logfile__average.csv"
EPISODE_LOG_NAME_2 = "episode_logfile_average.csv"
METADATA_FILE... |
import math
import torch
from torch import nn
import torch.nn.functional as F
import logging
import pdb
import dreamplace.ops.adjust_node_area.adjust_node_area_cpp as adjust_node_area_cpp
import dreamplace.ops.adjust_node_area.update_pin_offset_cpp as update_pin_offset_cpp
try:
import dreamplace.ops.adjust_node_a... |
# -*- coding: utf-8 -*-
"""
LLVM code generation.
"""
from __future__ import print_function, division, absolute_import
from functools import partial
from pykit import error, types
from pykit import ir
from pykit.ir import vvisit, ArgLoader, verify_lowlevel
from pykit.ir import defs, opgrouper
from pykit.types impor... |
import os
import sys
import re
keywords = [
'Function:',
'Class:',
'Enum:',
'Values:',
'Description:',
'Parameters:',
'Returns:',
'Example:'
]
classFunctionSeparator = '.'
functionKeyword = keywords[0]
classKeyword = keywords[1]
enumKeyword = keywords[2]
enumValuesKeyword = keywords[3]
descriptionKeyword = k... |
"""
library functions for the CIJOE test runner, `cij_runner`.
"""
from __future__ import print_function
from subprocess import Popen, STDOUT
from xml.dom import minidom
import shutil
import copy
import time
import os
import yaml
import cij.test
import cij
HOOK_PATTERNS = {
"enter": [
"%s.sh",
... |
import os
import sys
import time
import random
from collections import OrderedDict
import boto3
import pandas as pd
import numpy as np
from six import raise_from
from PIL import Image, ImageFile, ImageDraw
from botocore.exceptions import ClientError
from keras_retinanet.preprocessing.csv_generator import Generator
fro... |
from collections import defaultdict
import time
import ctypes
from nltk.tokenize import RegexpTokenizer
from nltk import bigrams
from qanta import logging
from qanta.util.build_whoosh import text_iterator
from qanta.util.environment import QB_QUESTION_DB, QB_WIKI_LOCATION
from qanta.util.constants import CLM_PATH, QB... |
""" Implementation of `5.4 <http://shex.io/shex-semantics/#node-constraints>`_"""
import numbers
from typing import Union
from ShExJSG import ShExJ
from pyjsg.jsglib import isinstance_
from rdflib import URIRef, BNode, Literal, XSD, RDF
from jsonasobj import as_json
from pyshex.shape_expressions_language.p5_context ... |
import torch
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
from .utils import Sequential
from .utils import weights_init_kaiming, weights_init_classifier
__all__ = ['ResNet', 'resnet18', 'resnet3... |
#!/usr/bin/env python3
"""
BSD 2-Clause License
Copyright (c) 2020, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_lo... |
"""
PubChem querying API.
"""
from __future__ import annotations
import io
import time
from datetime import datetime, timezone
from typing import Any, List, Mapping, NamedTuple, Optional, Sequence, Union
from urllib.error import HTTPError
import orjson
import pandas as pd
import regex
from pocketutils.core.dot_dict i... |
from __future__ import division
from warnings import warn
import numpy as np
from dipy.reconst.cache import Cache
from dipy.reconst.multi_voxel import multi_voxel_fit
from dipy.reconst.csdeconv import csdeconv
from dipy.reconst.shm import real_sph_harm
from scipy.special import gamma, hyp1f1
from dipy.core.geometry im... |
#!/usr/bin/env python
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
import struct
from typing import cast, Any, BinaryIO, Dict, List, Optional, Tuple, Union
from .exif_log import get_logger
from .utils import Ratio, s2n, FILE_TYPE_JPEG
from .tags import DEFAULT_STOP_TAG, FIELD_TYPES, SUBIFD_TAGS, IFD_TAG_MAP, makernote
logger = get_logger()
class IfdTag:
"""
Eases dealing wi... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 23 19:00:56 2020
@author: <NAME>
This file serves to provide the structure, design and functionality of RUSKLAINER web application
"""
##########################################################################################################################... |
import pandas as pd
import numpy as np
from scipy import signal
import networkx as nx
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib
import scipy.interpolate
def read_sig(path, n_channels, header=None, sep='\t', rem_len=5):
"""
Read signal in tabular ... |
import os
import sys
import json
import functools
from traceback import format_exc
import mimetypes
import time
import itertools
from urllib.parse import urljoin
from .helpers import (
cached_property, WSGIFileWrapper, parse_range_header,
parse_date, html_escape, tob
)
from .radirouter import RadiRouter
from .... |
import datetime
import hashlib
import os
import random
import re
from collections import defaultdict
from multiprocessing.pool import ThreadPool
from typing import Any, Callable, Iterable, List, Tuple
import requests
from bson import ObjectId
from flask import Response, jsonify, request
from PyMongoWrapper i... |
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
import argparse
import sys
import time
import random
import math
import re
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
# Root directory of the project
... |
import functools
import os
import random
import threading
import time
from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum
from typing import Dict, Iterator, Optional
from uuid import UUID, uuid4
import requests
from fastapi import FastAPI, HTTPException
from fastapi.excepti... |
import re
import os
import decimal
import argparse
import numpy as np
from sympy import Symbol
from scipy import interpolate
from sympy.stats import sample, Uniform, Exponential
def main():
""" Add interactivity for LHE analysis """
from argparse import ArgumentParser
parser = ArgumentParser()
parser... |
# Copyright 2020 Mycroft AI 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 writin... |
import numpy as np
from hs_udata import set_token, stock_list, fund_list, stock_quote_daily, fund_profile
from pdcool.finance import get_fund_name
from pdcool.utils.dataframe import *
from pdcool.utils.list import *
from pdcool.utils.param import *
token = get_param("pdcool", "finance", "hs_udata_token")
set_token(tok... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Image utility functions"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from astropy.units import Quantity
from astropy.coordinates import Angle
from astropy.io import fits
from ast... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, 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 applicab... |
"""
The code that should be run locally
"""
import json
import uuid
import base64
import subprocess
import re
import urllib
import datetime
import time
import webbrowser
import requests
from cryptography.fernet import Fernet
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat... |
# coding: utf-8
# # Object Detection Demo
# Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/mas... |
# Copyright 2018 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acco... |
from collections import defaultdict
import numpy as np
from itertools import chain
import json
import os
import re
from itertools import permutations
def longest_common_sequence(sequence1, sequence2):
dp = [[0] * (len(sequence2) + 1) for _ in range(len(sequence1) + 1)]
for i in range(1, len(sequence1) + 1):
... |
import time
from datetime import datetime
import os
import logging
import platform
import csv
import statistics
from polyglotdb import CorpusContext
from polyglotdb.config import CorpusConfig
from polyglotdb.io import (inspect_buckeye, inspect_textgrid, inspect_timit,
inspect_labbcat, inspect_... |
import os
from typing import Tuple
import numpy as np
from astropy.coordinates import SkyCoord
import astropy.units as u
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
import itertools
import warnings
import bilby
from sigfig import round
import corner
from astropy.visualization import quantity_support
from... |
"""Easy and efficient time evolutions.
Contains an evolution class, Evolution to easily and efficiently manage time
evolution of quantum states according to the Schrodinger equation,
and related functions.
"""
import functools
import numpy as np
from scipy.integrate import complex_ode
from .core import (qarray, iso... |
"""
Parallax fitting and computation of distances
"""
import os
import warnings
import collections
from bisect import bisect_left
import h5py
import numpy as np
import scipy.stats
from scipy.interpolate import interp1d
from astropy.coordinates import SkyCoord
from healpy import ang2pix
from dustmaps.sfd import SFDQuer... |
import argparse
import torch
from models import model_factory
from models.configs.detault import CONFIGS as config
from datasets.dataset_reader import create_dataloader
from solver.Solver import Solver
from preprocess.data_preprocess import TrainAugmentation, TestTransform
from models.rtm3d_loss import RTM3DLoss
from u... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 14 18:45:40 2022
@author: dylan
"""
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import keyword
__all__ = ['Sequence', 'Time_Multitrace', 'MT_Phasor', 'MT_Phase',
'Frequency_Multitrace', 'Frequency_Sequence']
class Sequence:
... |
from eflow.utils.image_processing_utils import create_plt_png
from eflow.utils.string_utils import correct_directory_path
from eflow.utils.sys_utils import write_object_text_to_file, create_dir_structure, pickle_object_to_file
from eflow._hidden.custom_exceptions import UnsatisfiedRequirments
from eflow.utils.math_util... |
''' Defines functions to automate construction of complex neural graph networks.
'''
from __future__ import division, print_function, absolute_import
from keras import models
from keras.layers import Input, merge, Dense, Dropout, BatchNormalization
# from keras.regularizers import l1_l2 # keras 1.2
from keras.regular... |
import os
import gzip
from xml.etree import cElementTree as ElementTree
import pandas as pd
from docx import Document # from python-docx package
class XmlDictConfig(dict):
"""
Note: need to add a root into if no exising
Example usage:
>>> tree = ElementTree.parse('your_file.xml')
>>> root = tree.... |
from aetherling.helpers.nameCleanup import cleanName
from magma import *
from mantle import DefineCoreirConst
from mantle.common.countermod import SizedCounterModM
from aetherling.modules.map_fully_parallel_sequential import DefineMapParallel, DefineNativeMapParallel
from aetherling.modules.sipo_any_type import SIPOAny... |
#!/usr/bin/env pythonw
# -*- coding: utf-8 -*-
import wx
import sys
import os
import scipy
from scipy import *
# need to set matplotlib backend to WXAgg or else the program just hangs
import matplotlib
matplotlib.use('WXAgg')
from pmagpy import pmag
from pmagpy import convert_2_magic as convert
from pmagpy import contr... |
from __future__ import absolute_import
import logging
import six
import weakref
from six.moves import queue
from threading import Event
from redis.exceptions import TimeoutError
from time import time
from msgpack import loads
from treestream.exceptions import TreeReaderError
from treestream.tree import Tree
from tree... |
import datetime as dt
import operator
import random
import arrow
import blazeutils.strings
import pytz
import six
import sqlalchemy as sa
import wrapt
from blazeutils import tolist
from keg.db import db
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy_utils import ArrowType, EmailType
import keg_elem... |
from typing import Union, Dict, Iterable, Coroutine, Callable
import inspect
import traceback
import datetime
import discord
from .objects.commandSet import CommandSet, BaseHelp, DevCommands
from .objects.commands import Command, CommandAdmin, CommandSuperAdmin
from .objects.listeners import Listener
from . import e... |
#!/usr/bin/env python3
# vim: ft=python:nospell:sta:et:sw=2:ts=2:sts=2
"""
## Breaking bad
"I am the one who knocks."
.-------.
| |
-=_________=-
___ ___
|___)=(___|
|
###
#####
# = #
###
- Divide data into regions of bad and better.
-... |
from constants import BLACK, WHITE
class Board:
""" Checkers Board class which is 8x8(64 fields) board to play checkers created...
It is played on an 8×8 chequered board with 12 pieces per side.
- self.board store a field code as a string, for example: '1A'
- self.field store a field stat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
file: LaguerreGauss3d.py
brief: Python configuration input file for the FDTD solver Meep simulating the
scattering of a polarised Laguerre-Gaussian beam at a planar dielectric
interface (3d)
author: <NAME>
version: 1.4.2
release date: 27.02.2020... |
import math
import random
import PIL, PIL.ImageOps, PIL.ImageEnhance, PIL.ImageDraw
import torch
import torchvision
import numpy as np
from torchvision.datasets.folder import default_loader
from PIL import Image
def level2val(level, value_range, val_type='float'):
v = value_range[0] + level * float(value_range[1]... |
"""
Utils functions to:
- Updated database table `hosts`.
- Generate random IP addresses for testing.
- Dictionary-related operations.
"""
import configparser
import csv
import itertools
import logging
import os
import random
import re
from datetime import datetime
import psycopg2
config = configparser.Co... |
"""
This module implements weight matrix sharing for linear layer: full sharing and sharing with adapters
"""
import math
from itertools import zip_longest
from typing import Optional, Tuple, List, Sequence
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda.amp import custom_bwd, custom... |
# -*- coding: utf-8 -*-
"""
PyPlot
======
Provides a collection of functions useful in various plotting routines.
"""
# %% IMPORTS
# Package imports
try:
import astropy.units as apu
import_astropy = 1
except ImportError: # pragma: no cover
import_astropy = 0
import matplotlib as mpl
import matplotlib.p... |
'''
This file contains the classes, functions and globals used for visualizing
Deadlock Avoidance algorithms
'''
# Kivy libraries
from kivy.properties import ObjectProperty
from kivy.uix.scrollview import ScrollView
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label... |
import re
from typing import List, Optional, Any, Dict, Tuple
from abstract.tree import ClassDef
import cil.nodes as nodes
from abstract.semantics import Attribute, VariableInfo, Context, Type, Method
from cil.nodes import (
AbortNode, AllocateIntNode,
AllocateStringNode,
ConcatString,
CopyNode,
Get... |
# ----------------------------------
# CCF1d.py (SPARTA UNICOR class)
# ----------------------------------
# This file defines the "CCF1d" class. An object of this class stores
# a Spectrum object, saved in the self.spec field and a Template object
# stored in th... |
import sys
import os
import subprocess
from shutil import copyfile
from shutil import rmtree
from shutil import move
from os import scandir
from os import remove
from os import path
from ownStyle import GREEN,BLUE,BOLD,GREEN,RED,RESET,CYAN
from ProjectSignin import SignIn
from gradle_management import manageSigninAn... |
from __future__ import division, print_function, absolute_import
import numpy as np
from .B_monomer import B, dB_dxhi00, d2B_dxhi00, d3B_dxhi00
from .a1s_monomer import a1s, da1s_dxhi00, d2a1s_dxhi00, d3a1s_dxhi00
def a1sB(xhi00, xhix, xhix_vec, xm, Ikl, Jkl, cictes, a1vdw, a1vdw_cte):
a1 = a1s(xhi00, xhix_vec, x... |
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
import json, requests, urllib3
from flask import Flask, request, jsonify
from datetime import datetime
import time
import traceback
import os
import redis
import cPickle as pickle
from multiprocessing import Process
def avi_request(avi_api,tenant,api_version='17.2.1'):
cookies=dict()
if 'avi-sessionid' in l... |
import matplotlib.pyplot as plt
import numpy as np
import random
from multiprocessing import Pool
debug_mig = False
debug_mutate = False
debug_select = False
debug_elite = False
#global storage for plot labeling
plot_num = 0
#min dist
min_dist = 5
#fitness share range (proximety to other fitness +- the value)
share_r... |
# -*- coding: UTF-8 -*-
''' Baseline system using CRFtagger and SVM to perform NLU and SAP, respectively.
Training Process: training two models separately.
Test Process: raw text --> CRFtagger with lexical features --> user tag sequence
--> reshape into binary vecor --> OneVsRestClassifier(Li... |
#!/usr/bin/env
# -*- coding: utf-8 -*-
"""
This program is used to schmooze formats from firefox and add new ones
"""
import os
import subprocess
import json
def getFirefoxProfilePath(osUser=None,profileId=None):
"""
get the path to a firefox profile
:property osUser: user on the os to find (default=curre... |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
AWS provisioner.
"""
import logging
from itertools import izip_longest, repeat
from pyrsistent import PClass, field
from twisted.internet.defer import DeferredList, fail, maybeDeferred
from zope.interface import implementer
from boto.ec2 import connec... |
import json
import math as m
from abc import ABC, abstractmethod
try:
from webots.controller import Robot
except Exception:
Robot = object
TIME_STEP = 32
MAX_WHEEL_SPEED = 15.0
WHEEL_SPEED = {
'max': MAX_WHEEL_SPEED,
'half': MAX_WHEEL_SPEED / 2.0,
'quarter': MAX_WHEEL_SPEED / 4.0,
'eigth': MAX_... |
import datetime, inspect, random, msgpack, os, sys, math, time, torch, pdb
import numpy as np
from pprint import pprint
from scipy.sparse.csgraph import floyd_warshall
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, pa... |
# coding: utf-8
# ## Heatmap with change-cell-size feature
#
# ### Motivation
# Heatmap is a great chart to catch information in matrix.
# However, I sometimes want to add more information in cases like this:
# * matrix is like [product A-F] x [area a-f]
# * want to see [profitability] and [sales volume] of each ... |
# Copyright 2016 AC Technologies LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
import jsonMode as func
import tablaDGA as TS
#VARIABLES GLOBALES
resultadotxt = ""
tabla = TS.Tabla()
cont = 0
contambito = 0
NombreDB = ""
def Textoresultado():
global tabla
global resultadotxt
print(resultadotxt)
for simbolo in tabla.simbolos:
print("ID: " + str(tabla.simbolos[simbolo].id) ... |
# Copyright (C) 2018-2021 <NAME>, <NAME>, <NAME>
#
# 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 later version.
#
# This program is d... |
import requests
import json
import argparse
import time
import logging
import sys
import copy
import ast
HDRS = {
"Accept": "application/json",
"Content-Type": "application/json"
}
LOG = logging.getLogger("setup_aion")
def request(url, data=None, method=None, headers=HDRS, params={}, allow_redirects=True,
... |
import os
import time
from datetime import datetime
import logging
from flask import Flask
from flask import jsonify
import asyncio
import sys
from flask import request
from multiprocessing import Process
sys.path.append('../')
sys.path.append('../../')
sys.path.append('../strategy/')
from dquant.markets._binance_sp... |
from inspect import isfunction, isclass
import warnings
import pytest
try: # python 3.5+
from typing import Set, Any, List, Iterable
except ImportError:
pass
from _pytest.mark import MarkDecorator
from .pytest_compat import itermarkers, apply_mark_to, PytestUnknownMarkWarning
info_mode = False
debug_mode ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.