text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
"""
Module to interact with the Oxford Triton controller pc.
Uses TCP/IP sockets to communicate with the GPIB device.
Version 3.0 (2021-10-05)
<NAME> - PhD at ICE/QTM
University of Twente
<EMAIL>
----------------------------------------------------------------------------
The latest version (3... |
# The MIT License (MIT)
#
# Copyright (c) 2015 University of East Anglia, Norwich, UK
#
# 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 r... |
"""Support for the Fronius Inverter."""
import logging
from datetime import timedelta
import requests
import voluptuous as vol
import json
import aiohttp
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor i... |
from random import randint
import random
from Levenshtein import distance
from os import listdir
import json
from threading import Thread
from time import sleep
import time
from datetime import datetime
import re
# Import interface for basic convo file
from .utils import convo_reader
from .utils import story_reader
fro... |
##
## 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 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it w... |
# Copyright 2018 <NAME>, University of Amsterdam, <EMAIL>
#
# Beloning to the DeepNCM repository
# DeepNCM is proposed in
# <NAME>, <NAME>, and <NAME>
# DeepNCM: Deep Nearest Class Mean Classifiers
# ICLR Workshop 2018
# https://openreview.net/forum?id=rkPLZ4JPM
#
# This file (resnet_deepncm_run_loop) is ba... |
#!/usr/bin/env python
"""A serializer that encodes EE object trees as JSON DAGs."""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
# pylint: disable=g-bad-import-order
import collections
import datetime
import hashlib
import json
import math
import numbers
import six
... |
"""
Cadastre - Export method class
This plugins helps users to import the french land registry ('cadastre')
into a database. It is meant to ease the use of the data in QGIs
by providing search tools and appropriate layer symbology.
begin : 2013-06-11
copyright : (C) 2013, 2019 by 3liz
email : <EMAIL>
This pr... |
# Imports
import torch
from labml_nn.transformers.switch import SwitchTransformer, SwitchTransformerLayer, SwitchFeedForward
from labml_nn.transformers import MultiHeadAttention
from labml_nn.transformers.feed_forward import FeedForward
import numpy as np
from transformers import AutoConfig, AutoModel
import torch.nn a... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import unittest
from packaging import version
import numpy as np
import transformers
from transformers import AutoTokenizer
import datasets
from datasets import DatasetDict, load_dataset
try:
from transformers.testing_ut... |
# Copyright (c) 2010-2011 Lazy 8 Studios, LLC.
# All rights reserved.
from front.lib import utils
from front.models import progress, mission
from front.models import message as message_module
from front.models import rover as rover_module
from front.models import target as target_module
from front.models import achiev... |
import logging
import os
import re
import sys
import traceback
from typing import Any, List
import cyvcf2
from django.conf import settings
from django.db.models.query_utils import Q
from django.urls.base import reverse
from django.utils import timezone
from django_messages.models import Message
from library.guardian_... |
import ctypes
import os
import matplotlib.pyplot as plt
import nlopt
import numpy as np
from numba import njit
from numba import vectorize
from numba.extending import get_cython_function_address
from scipy import special
from tables import ComplexCol
from tables import Float64Col
from tables import IsDescription
from ... |
# Copyright (c) Open-MMLab. All rights reserved.
import os
import os.path as osp
import time
import signal
import logging
import pkgutil
import warnings
from collections import OrderedDict
from importlib import import_module
from typing import Callable, Dict, Optional, Tuple, Union
import numpy as np
import torchvisio... |
import os
from argparse import ArgumentParser, Namespace
import json
from collections import defaultdict
from tqdm import tqdm
import numpy as np
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.utils.tensorboard import SummaryWriter
from grok.data import (
DEFAULT_DATA_DIR,
A... |
import time
from .settings import *
# Selecionando o algoritmo para exibir na tela
def draw_lines(grid, algorithm, posX1, posY1, posX2, posY2, color, rows, pixel_size, line):
# Como posições são sempre floats, arredondarei para int
posX1, posX2, posY1, posY2 = int(posX1), int(posX2), int(posY1), int(posY2)
# Não... |
import os
import obspy
import pickle
import numpy as np
import scipy.integrate as ig
import matplotlib.pyplot as plt
from matplotlib.ticker import StrMethodFormatter, NullFormatter
from mtspec import mtspec
from . import utils as ut
from . import config as cfg
# VARIABLES READ FROM CONFIG
SUPPORTED_SAVE_METHODS = ['p... |
# Copyright 2017 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:16:36 2020
@author: Raj
"""
import numpy as np
import h5py
from scipy.optimize import minimize
import os
import pyUSID as usid
from sidpy import Dimension
from ffta.load.load_hdf import load_folder
from ffta.load import gl_ibw
from ffta.pixel_utils import badpixe... |
#!/usr/bin/python
#
# ec2_api.py - an EC2 plugin for Vcycle
#
# <NAME>, University of Manchester.
# Copyright (c) 2013-7. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# o Redistribut... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Description: run job
# Derived from topcons2_workflow_run_job.py on 2015-05-27
# how to create md5
# import hashlib
# md5_key = hashlib.md5(string).hexdigest()
# subfolder = md5_key[:2]
import os
import sys
import time
from libpredweb import myfunc
from libpredweb impor... |
# Copyright: 2006-2011 <NAME> <<EMAIL>>
# License: GPL2/BSD
"""
package class for buildable ebuilds
"""
__all__ = (
"Maintainer", "MetadataXml", "LocalMetadataXml",
"SharedPkgData", "Licenses", "OverlayedLicenses"
)
from itertools import chain
from snakeoil import compatibility, klass, mappings
from snakeoi... |
import logging
import os
import tempfile
from datetime import date
import json
import numpy as np
import pandas as pd
from flask import render_template, flash, redirect, url_for, request, send_file
from flask_login import current_user, login_user, logout_user, login_required
from scipy.spatial.distance import cdist
fr... |
# SPDX-License-Identifier: Apache-2.0
"""
subarulink - A Python Package for interacting with Subaru Starlink Remote Services API.
controller.py - provides managed connection to Subaru API
For more details about this api, please refer to the documentation at
https://github.com/G-Two/subarulink
"""
import asyncio
from... |
import numpy as np
from skimage.draw import line
from scipy.interpolate import splprep, splev
from skimage.morphology import skeletonize
from scipy import ndimage
from scipy.ndimage import map_coordinates
import random
def extractHRFrontsGen(filename, classes, lonOff, latOff):
fronts = [[] for _ in range(len(class... |
#!/usr/bin/env python
# coding: utf-8
# ## Calculate median replicate reproducibility in Cell Painting with same sample size as L1000
#
# Code modified from @adeboyeML
# In[1]:
import os
import pathlib
import pandas as pd
import numpy as np
from collections import defaultdict
import matplotlib.pyplot as plt
get_ip... |
import os
import numpy as np
import pandas as pd
import six
import csv
from .core import pop_na, STReader, STBuffer
from .core import SortOrder
from .core import csv_headers
from bmtk.utils.io import bmtk_world_comm
"""
class DiskBuffer(object):
def __init__(self, cache_dir, **kwargs):
self.cache_dir = c... |
import json
import logging
import inspect
import time
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.template import RequestContext
from django.shortcuts import render
from django.core.cache import cache
from api.ehb_service_client import ServiceClient
from api.utilities import Su... |
#https://nbviewer.org/github/amanchadha/coursera-deep-learning-specialization/blob/master/C5%20-%20Sequence%20Models/Week%201/Building%20a%20Recurrent%20Neural%20Network%20-%20Step%20by%20Step/Building_a_Recurrent_Neural_Network_Step_by_Step.ipynb
###########################################
# exercise 3 - lstm_cell_f... |
#!/usr/bin/env python3
"""Logging index verification tool
This script is meant to help verify ElasticSearch indices after generating logs with logtest clusterloader.
It also has a lot of general helper functions for working with ElasticSearch.
To use this script, you should set up a route to ElasticSearch as describ... |
#
# Mini-project # 4: "Pong".
#
# Author: <NAME>
# Email: <EMAIL>
# Mini-project # 4: An Introduction to Interactive Programming in Python
# @ https://www.coursera.org/course/interactivepython
# Date: 19 Oct 2014
# Version: 11.0
#
# Implementation of the classic arcade game "Pong".
#
#------------------------... |
# Copyright (C) 2021 Intel 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 or agreed to in wri... |
#!/usr/bin/env python3
#
import os
import sys
import re
import datetime
def readline(f):
x = f.readline()
while x[0]=='#':
x = f.readline()
return x
def readmigline(f):
x = readline(f).strip()
while x[0]=='#':
x = readline(f).strip()
#print(x)
return x
def oldstyle(line):
... |
# Construct a compliant h5 data file that looks like the desired dataset.
import geodata as gd
import h5py as h5
from netCDF4 import Dataset
import numpy as np
import pystare as ps
import json
from sortedcontainers import SortedDict, SortedList
from time import process_time as timer
import matplotlib as mpl
import ... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
"""
A class for the OKR graph structure
Author: <NAME> and <NAME>
"""
import os
import copy
import logging
import itertools
import xml.etree.ElementTree as ET
import re
import stop_words
from collections import defaultdict
NULL_VALUE = 0
STOP_WORDS = stop_words.get_stop_words('en')
class MentionType... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
### TODO: document setup
# TODO: ./sync.sh with https://raw.githubusercontent.com/bazelbuild/bazel/master/tools/build_defs/repo/http.bzl
load(
"@bazel_tools//tools/build_defs/repo:utils.bzl",
"patch",
"read_netrc",
"update_attrs",
"use_netrc",
"workspace_and_buildfile",
)
_AUTH_PATTERN_DOC = "... |
#!/usr/bin/env python
import os
import sys
import logging
import importlib
import tempfile
import asyncio
import zmq
import zmq.asyncio
import subprocess
import ami.multiproc as mp
import pyqtgraph as pg
from ami import LogConfig
from ami.client import flowchart_messages as fcMsgs
from ami.comm import ZMQ_TOPIC_DELIM
... |
#!/usr/bin/python3
#
# Copyright (c) 2012 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... |
#!/usr/bin/env python3
# Copyright 2018 <NAME> <<EMAIL>>
# Copyright 2018 <NAME> <<EMAIL>>
#
# 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
#
... |
from distutils.util import strtobool
from random import shuffle, randint
from math import floor
from enum import Enum
from time import time
DEBUG = False
class Card:
"""A class containing the value and suit for each card"""
def __init__(self, value, suit):
self.value = value
self.suit = suit
... |
"""
Reinforcement Learning.
A3C with continuous action space.
"""
#tensorboard --logdir="./log" --port6006
import math
import multiprocessing
import threading
import tensorflow as tf
import numpy as np
from Env_Plant import Plant
import os
import shutil
import matplotlib.pyplot as plt
LoadWeithsAndTest = False
OUTPUT... |
import time
import os
import argparse
import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, transforms, utils
from tensorboardX import SummaryWriter
from utils import *
from model import *
from P... |
# -*- coding: utf-8 -*-
"""
documentation
"""
from __future__ import division, unicode_literals, print_function
import sys
import warnings
import numpy as np
from ..debugging import DebugPlot
from ..generic.signal import find_phase, find_extrema_and_prominence, spectrum_fourier, spectrum_bins_by_length,\
hires_p... |
import numpy as np
import torch
import torch.nn as nn
from models.modules import build_mlp, SoftAttention, PositionalEncoding, create_mask, proj_masking
class Regretful(nn.Module):
"""
The model for the regretful agent (CVPR 2019)
The Regretful Agent: Heuristic-Aided Navigation through Progress Estimat... |
'''
Created on Jan 4, 2017
@author: bardya
'''
import scipy as sp
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import csv
import random
import re
#Starting from a Matrix with 1/0 indicating presence/absence of a taxon in a orthologous group
#With OMA the thresholds for... |
import cv2
import time
import argparse
import os
import torch
import json
import sys
from scipy import spatial
import numpy as np
import operator
import posenet
import posenet.utils as pu
# parser = argparse.ArgumentParser()
# parser.add_argument('--model', type=int, default=101)
# parser.add_argument('--scale_facto... |
#!/usr/bin/env python
"""JIP ships with a **small and simple** local queueing system.
"""
import multiprocessing
import os
import subprocess
import signal
import sys
import logging
import jip.cluster
from jip.logger import getLogger
from jip.six import iteritems
class LocalCluster(jip.cluster.Cluster):
def __in... |
# Python Machine Learning Module
# A project made for the purpose practising Machine Learning Concepts
# Built in reference to techniques shown in Andrew Ng's Deep Learning Course
# Inspired by <NAME>'s JS library
# Project by: <NAME>
import numpy as np
import matplotlib.pyplot as plt
class Network:
def __init__... |
# 先把API com元件初始化
import os
# 第一種讓群益API元件可導入讓Python code使用的方法
#import win32com.client
#from ctypes import WinDLL,byref
#from ctypes.wintypes import MSG
#SKCenterLib = win32com.client.Dispatch("{AC30BAB5-194A-4515-A8D3-6260749F8577}")
#SKQuoteLib = win32com.client.Dispatch("{E7BCB8BB-E1F0-4F6F-A944-2679195E5807... |
################################################################
# Computer vision final project
# Medical Lung Detection Program
# Authors:
# <NAME>
# <NAME>
#
################################################################
import cv2
import numpy as np
from matplotlib import pyplot as plt
... |
from roomEditor import RoomEditor, Object, ObjectWarp, ObjectHorizontal
from assembler import ASM
import entityData
BOSS_ROOMS = [
(0x106, 0x10b),
(0x12b, 0x12d),
(0x15a, 0x15b),
(0x166, 0x16c),
(0x185, 0x18b),
(0x1bc, 0x1c4),
(0x223, ),
(0x234, 0x23a),
(0x300, 0x304)... |
##@Copyright 2020. <NAME>, <NAME>
##@Organization - aviationdatascience.org non-profit through release from Penn State
##@License - This work is licensed under MIT license - https://opensource.org/licenses/MIT
## This permissive license lets you do basically whatever you want.
## Per the details of the MIT license,... |
# -*- coding: utf-8 -*-
from scipy.integrate import quad
from numpy import *
import mab.gd.gdfast
import scipy.integrate
class Jeans(object):
def __init__(self, stellar_potential, potentials):
self.potentials = potentials
self.stellar_potential = stellar_potential
def sigmar(self, radii, smart=True):
po... |
import datetime, yippi, urllib.request, yippi.helper
class Submission(object):
"""
A representation of e621 submission post object
:Parameters:
object : [:class:`dict`]
A JSON or dict of the submission given from e621 API, this should be a valid JSON or everything will broke
:Functions:
... |
#!/usr/bin/env python2
import click
import sys
from operator import attrgetter
from common import PrassError, zip, map
from subs import AssScript
from tools import Timecodes, parse_keyframes
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
def parse_fps_string(fps_string):
if '/' in fps_string:
... |
"""Views for users application."""
import json
import logging
from random import Random
from django.db import transaction
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils import timezone
from django.contrib.auth import get_user_model
from django.contrib.a... |
################################################################################
################################################################################
import sys
import os
from datetime import datetime as dt
from datetime import timedelta
from dateutil.relativedelta import relativedelta
import numpy as np
im... |
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
#!/usr/bin/env python
# encoding: utf-8
"""
This module of native functions is implemented for
compatability with 010 editor functions. Some of these functions
are nops, some are fully implemented.
"""
import six
import sys
from pfp.native import native
import pfp.fields
import pfp.errors as errors
import pfp.bitwra... |
#! /usr/bin/env python3
"""
Title: Hoomaluo - Cool
Project: Alternative Cooling Controller
Author: <NAME>
Version: 1.0
Date: 08-27-2018
Overview:
* Communicate with a server over MQTT:
- report temperature and energy
* store locally if disconnected
* report local data once back online
- recei... |
# Copyright 2021 MosaicML. All Rights Reserved.
"""Utilities for working with training checkpoints."""
from __future__ import annotations
import contextlib
import logging
import os
import pathlib
import shutil
import tarfile
import tempfile
import textwrap
from typing import TYPE_CHECKING, Any, Dict, List, Optional,... |
# Copyright (c) 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""
PrimordialOoze is a genetic algorithm (GA) library for those who want something
very simple and don't want to spend time figuring out the more complicated libraries
that are out there.
See the README or the docstrings in this file for the documentation.
"""
import math
import multiprocessing
import numpy as np
cl... |
#
# Jasy - Web Tooling Framework
# Copyright 2013-2014 <NAME>
#
import re
import copy
import jasy.core.Console as Console
import jasy.script.api.Comment as Comment
# Operator and punctuator mapping from token to tree node type name.
# NB: because the lexer doesn't backtrack, all token prefixes must themselves
# be ... |
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import argparse, os, random
from parser.data import Vocab, DataLoader, SRLDataLoader, DUM, END, CLS, NIL, DynamicDataLoader
from parser.parser import Parser
from parser.work import show_progress
from parser.extract import LexicalMap
from ... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
#!/usr/bin/env python
#
#The MIT CorrelX Correlator
#
#https://github.com/MITHaystack/CorrelX
#Contact: <EMAIL>
#Project leads: <NAME>, <NAME> Project developer: <NAME>
#
#Copyright 2017 MIT Haystack Observatory
#
#Permission is hereby granted, free of c... |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
import json
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for
from flask_moment... |
#!/usr/bin/env python
import numpy as np, os, sys, joblib
from scipy.io import loadmat
from get_12ECG_features import get_12ECG_features
import pandas as pd
import os,time
from tqdm import tqdm
from sklearn.model_selection import train_test_split
import random
import torch
from torch import nn, optim
from torch.utils... |
"""Contains plot functions."""
from platform import system
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from matplotlib.lines import Line2D
from matplotlib.patches import Polygon
from . import utils as ut
from . import salt_utils as salt_ut
from . import nb_fun as nbf
def plt_ma... |
import bob.ip.base
import numpy
import logging
from .Base import Base
from sklearn.base import TransformerMixin, BaseEstimator
logger = logging.getLogger("bob.bio.face")
from bob.bio.base import load_resource
from .Scale import scale
class FaceCrop(Base):
"""Crops the face according to the given annotations.
... |
import warnings
import numpy as np
import phi.app.app as base_app
import six
import tensorflow as tf
from phi import math
from phi.app.app import EditableFloat, EditableInt, EditableValue
from phi.data.dataset import Dataset
from phi.data.reader import BatchReader
from phi.data.source import SceneSource
from phi.phys... |
import unittest
from flow.core.params import SumoParams, EnvParams, InitialConfig, \
NetParams, SumoCarFollowingParams, SumoLaneChangeParams
from flow.core.params import VehicleParams
from flow.controllers.routing_controllers import ContinuousRouter
from flow.controllers.car_following_models import IDMController
... |
import plotly.graph_objs as go
from _plotly_utils.basevalidators import ColorscaleValidator
from ._core import apply_default_cascade, init_figure, configure_animation_controls
from .imshow_utils import rescale_intensity, _integer_ranges, _integer_types
import pandas as pd
import numpy as np
import itertools
from plotly... |
# import os
# from userjourney import UserJourney
# from dynamic_data import ConstantDDI, DateDDI, DelimitedFileDDI, ListDDI, VariableDDI, RelatedDDI, ResponseDDI, AutoCorrelatedDDI, AutoIncrementDDI
from PyQt5.QtCore import Qt
# from PyQt5.QtWidgets import (QApplication, QCheckBox, QGridLayout, QGroupBox,
# Q... |
import os
import re
import cv2
import torch
import numpy as np
import Polygon as plg
from PIL import Image
from collections import OrderedDict
from matplotlib import patches
from matplotlib import font_manager as fm
from matplotlib import pyplot as plt
def read_txt(txt_path):
txt_contents = []
f = open(txt_p... |
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
import requests
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookParser
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models ... |
import ctypes
import ctypes.util
import os
import platform
_jsl = None
_extension = ''
_system = platform.system()
if _system == 'Windows':
_extension = '.dll'
elif _system == 'Linux':
_extension = '.so'
elif _system == 'Darwin':
_extension = '.dylib'
else:
raise Exception('Your system is not known')
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 <EMAIL>
#
# 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 limitat... |
# -*- coding: utf-8 -*-
"""Support to extract sentences from a text.
This module provides functions to extract sentences from a text. Any string of
characters that ends with a terminating punctuation mark such as a period,
exclamation or question mark followed by a whitespace character is
considered to be a sentence, ... |
#!/usr/local/bin/python3
#
# EAI feature tests
from bottle import request, route, get, post, run, hook, app, template, view, \
static_file, redirect, HTTPResponse, BaseRequest
from beaker.middleware import SessionMiddleware
from eaidb import EAIdb
import re, sys
import base64
debug = False
# allow large zones
Ba... |
# SPDX-FileCopyrightText: 2021 CmdKit Developers
# SPDX-License-Identifier: Apache-2.0
"""Unit tests for `cmdkit.config` behavior and interfaces."""
# standard libs
import os
from io import StringIO
from string import ascii_letters
# external libs
import pytest
# internal libs
from cmdkit.config import Namespace, ... |
#! /usr/bin/env python
"""This module implements the Atom 1.0 specification defined in RFC 4287
References:
IRIs [RFC3987]; cf URI [RFC3986]
(1) when an IRI that is not also a URI is given for dereferencing,
it MUST be mapped to a URI using the steps in Section 3.1 of [RFC3987]
(2) when an IRI is serving as an atom:i... |
# Check dependencies
import Tkinter as tk
import PIL, PIL.Image, PIL.ImageTk
import aggdraw
import affine
# Define some globals
import sys, os
OSSYSTEM = {"win32":"windows",
"darwin":"apple",
"linux":"linux",
"linux2":"linux"}[sys.platform]
SYSFONTFOLDERS = dict([("windows","C... |
"""
Author: <NAME>
Build a classifier for precomputed features.
"""
import os,sys
thispath = os.path.dirname(os.path.abspath(__file__))
import time, gc
import numpy as np
import numpy.random as npr
import cv2
import cPickle
import tables
from utils import *
import matplotlib.pyplot as plt
import sklearn
from sklearn.... |
import abc
import os
import yaml
import json
import pprint
import shutil
import tarfile
import tempfile
import requests
from pathlib import Path
from typing import Dict, Sequence, Union, TYPE_CHECKING
from dotenv import load_dotenv
from agentos.identifiers import (
ComponentIdentifier,
RunIdentifier,
RepoId... |
# type: ignore
# -*- coding: utf-8 -*-
#
# ramstk.analyses.milhdk217f.models.inductor.py is part of the RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Inductor MIL-HDBK-217F Constants and Calculations Module."""
# Standard Libra... |
"""feature_extraction.py
Create the requested datasets.
Author: <NAME> <<EMAIL>>
"""
from __future__ import division
import logging
import cPickle as pickle
import numpy as np
import math
from scipy import sparse
from sklearn import preprocessing
from external import greedy, ben
from data import save_dataset
from... |
from elma.constants import END_OF_DATA_MARKER
from elma.constants import END_OF_FILE_MARKER
from elma.constants import END_OF_REPLAY_FILE_MARKER
from elma.constants import TOP10_MULTIPLAYER
from elma.constants import TOP10_SINGLEPLAYER
from elma.models import Frame
from elma.models import GroundTouchAEvent
from elma.mo... |
import numpy as np
import matplotlib.pyplot as plt
import torch
from torch.utils.data import Dataset
import torch.utils.data
import os
from os import listdir
from torchvision import transforms
from numpy import clip
from skimage import io
from skimage.color import rgb2gray
from skimage.util import img_as_float, img_as_... |
# (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import ipaddress
import re
from collections import defaultdict
from typing import Any, DefaultDict, Dict, Iterator, List, Optional, Pattern, Set, Tuple, Union
from datadog_checks.base import ConfigurationError,... |
# @file dec_parser_test.py
# Contains unit test routines for the dec parser class.
#
#
# Copyright (c) Microsoft Corporation
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import unittest
import uuid
import io
from edk2toollib.uefi.edk2.parsers.dec_parser import LibraryClassDeclarationEntry
from edk2toollib.uefi.... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import get_objec... |
import math
import random
import pyglet
from pyglet import gl
WIDTH = 1024
HEIGHT = 768
ROTATION_SPEED = 200
ACCELERATION = 300
SPACESHIP_RADIUS = 40
START_LIVES = 3
SHOOT_DELAY = 0.3
LASER_SPEED = 500
LASER_RADIUS = 5
UFO_RADIUS = 45
UFO_SPEED = 50
UFO_ROTATION_SPEED = 4000
COLLISION_SPEED_FACTOR = 0.2
ASTEROID_SPEE... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
import re
import prompt_toolkit
from prompt_toolkit.filters import is_searching, vi_insert_mode, emacs_insert_mode, is_read_only
from prompt_toolkit.filters.utils import is_true
from prompt_toolkit.document import Document
shiftwidth = 2
indent_let = 4
indent_if = 3
indent_after_bare_where = 2
indent_before_where = 2
... |
"""
Utility methods to deal with "names" of relations.
To be safe, we always delimit names in queries but would prefer not to during logging.
See TableName.
There are additional methods and classes here to support the feature of choosing relations
by a pattern from the command line.
"""
import fnmatch
import re
impo... |
# -*- coding: utf-8 -*-
import sys
import urwid
import subprocess
import threading
from pyhn.popup import Popup
from pyhn.poller import Poller
from pyhn.config import Config, FALSE_WORDS, TRUE_WORDS
from pyhn import __version__
PY3 = False
if sys.version_info.major == 3:
PY3 = True
if PY3:
from urllib.parse ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.