text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Tools and utilities for the sims module. """
from __future__ import print_function, division
import re
import os
import io
import json
import warnings
import datetime
import numpy as np
import pandas as pd
from skimage.feature import register_translation
from scipy.ndim... |
#
# Copyright (c) 2020-2021, Hyve Design Solutions Corporation.
# 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
# notic... |
import csv
import json
import os
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from glob import glob
from itertools import repeat
from zipfile import ZipFile
from smart_open import open
import googlemaps
import requests
import typer
import pandas as pd
from bs4 import BeautifulSoup
from pa... |
import argparse
import copy
import ctypes
import os
import os.path
import pickle
import psutil
from queue import PriorityQueue
import random
import sys
from threading import Thread
import time
import traceback
import multiprocessing as mp
from multiprocessing.managers import SyncManager
from multiprocessing import Pro... |
from django.shortcuts import render
from django.shortcuts import render_to_response
import django.http # to raise 404's
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.template import Context, Template, loader
from django.views.decorators.cache import cache_control
from dja... |
#!/usr/bin/env python3
# rdbtool
# swiss army knife for rdb disk images or devices
import sys
import argparse
import os.path
from amitools.util.CommandQueue import CommandQueue
from amitools.fs.FSError import FSError
from amitools.fs.FSString import FSString
from amitools.fs.rdb.RDisk import RDisk
from amitools.fs.b... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Functions in this script produce figures in various manuscripts.
"""
import os.path as op
import sys
import numpy as np
from jcvi.graphics.base import plt, Polygon, savefig
from jcvi.graphics.glyph import GeneGlyph, RoundRect, TextCircle, DoubleSquare, plot_cap
from... |
#!/usr/bin/python
"""
This code generates the excel report for Kafka metrics for various Topics.
"""
__author__ = "<NAME>"
__copyright__ = "(c) Copyright IBM 2019"
__credits__ = ["BAT DMS IBM Team"]
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
# Library for delegating tasks to OS (Operat... |
#! /usr/bin/python
import serial
import struct
import time
import config
def hex2str(hex):
#return (format(hex, '04b'))
return (format(hex, '04b')).replace("0"," "*config.LOGO_SIZE_X).replace("1","@"*config.LOGO_SIZE_X)
def display_logo(cart_logo):
print("")
for i_y_block in range(2):
for i_y_... |
# https://developers.google.com/youtube/v3/docs
from googleapiclient.discovery import build
from datetime import datetime, timedelta
import sqlite3, time
from bs4 import BeautifulSoup
import argparse
import sys
import os
global api_key, youtube, props, existing_videos
query_limit = 50
def db_connector... |
import os, yaml, inspect, airflow
from airflow import DAG
from gusty.parsing import parse, default_parsers
from gusty.parsing.loaders import GustyYAMLLoader
from gusty.importing import airflow_version, get_operator
###########################
## Version Compatability ##
###########################
if airflow_version ... |
""" Builds a bipartite network of the SureChEMBL database
Reads in cpd & patent data (ids & dates) from SureChEMBL data
in Data\SureChemBLMAP directory. Builds a bipartite network of cpds & patents,
dates associated, with cpds connected to patents if a cpd appears in a patent.
The earliest date of entry (both cpd & pa... |
import struct
from binascii import hexlify
from binary_io import *
from .enums import *
from .datatypes import *
class StringTable(object):
def __init__(self):
self.strings = []
@classmethod
def from_file(cls, f):
stringtable = cls()
start = f.tell()
... |
# Create your views here.
import docx
import json
import gensim
import numpy as np
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
from docx.shared import RGBColor, Inches, Pt
from nltk.tokenize import sent_tokenize, word_tokenize
from django.utils.translation i... |
"""
Author: <NAME>
"""
from itertools import product
import json
import pathlib
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pandas as pd
import pytest
import scipy.stats
from statsmodels.tsa.exponential_smoothing.ets import ETSModel
from statsmodels.tsa.holtwinters import ... |
# Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import matplotlib.pyplot as plt
import numpy
import pandas
import pickle
import sympy
import sklearn.metrics as metrics
import xgboost
import json
import os
import sys
import zipfile
# Define the an... |
## Standard Library Imports
## Library Imports
import numpy as np
import scipy
from scipy import signal
from IPython.core import debugger
breakpoint = debugger.set_trace
## Local Imports
from .np_utils import vectorize_tensor, unvectorize_tensor, to_nparray, get_extended_domain, extend_tensor_circularly
from .shared_... |
#!/usr/bin/env python
#
# Copyright (C) 2011-2018 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# no... |
import sys
import pyglet
import math
import time
from gaussy import *
class World:
g = -9.8 * 1.0
timeScale = 1.0
timeStep = 1.0/60.0
# timeStep = 1.0/160.0
lastTime = -1.0
perfTime = -1.0
frame = -1
dt = 0.0
statics = None
particles = None
staticParticles = None
pendulums = None
forces = None
clientUpda... |
# -*- coding: utf-8 -*-
"""
The pout functions like pout.v() use the interfaces that are defined in this module
to print an object out
"""
from __future__ import unicode_literals, division, print_function, absolute_import
import os
import sys
import math
import unicodedata
try:
import resource
except ImportError:
... |
#!/usr/bin/env python3
try:
from bs4 import BeautifulSoup
except ImportError as e:
print('[-] Missing dependency BeautifulSoup. Install with python -m pip3 install bs4')
exit(1)
from optparse import OptionParser
from urllib.parse import urlparse, unquote
import base64
import json
import re
from types import... |
#
# This file is part of the erlotinib repository
# (https://github.com/DavAug/erlotinib/) which is released under the
# BSD 3-clause license. See accompanying LICENSE.md for copyright notice and
# full license details.
#
import copy
import numpy as np
import pints
import erlotinib as erlo
class HierarchicalLogLik... |
"""Low-memory json-based databse for MicroPython.
Data is stored in a folder structure in json for easy inspection.
Indexing multiple columns is supported, and RAM usage is optimized for embedded systems.
Database examples:
db_object = Database.create("mydb")
db_object = Database.open("mydb")
Table examples:
db_table =... |
#!/usr/bin/env python
def choose_gene_names(MATRIX):
# Return tuple of (header for gene_id, header for gene_names).
# Either of the headers can be None.
from genomicode import arrayplatformlib as apl
if not MATRIX.row_names():
return None, None
if len(MATRIX.row_names()) == 1:
ret... |
# -*- coding: UTF-8 -*-
import os
import collections
import random
import numpy as np
import six
import pickle
import multiprocessing
import time
import argparse
from collections import Counter, defaultdict
def data_partition(fname):
usernum = 0
itemnum = 0
User = defaultdict(list)
user_train = {}
... |
import wx
from ogreyEntity import *
from FoldPanelBar import *
import ogre.renderer.OGRE as ogre
class ogreyOptionsPanel(wx.Panel):
def __init__(self, parent, resourceInformation):
wx.Panel.__init__(self, parent, -1, style = wx.FULL_REPAINT_ON_RESIZE, size = (242,parent.GetSizeTuple()[1]))
... |
import pytest
import numpy as np
import pandapower as pp
import pandapower.networks
import pandapower.grid_equivalents
try:
from misc.groups import Group
group_imported = True
except ImportError:
group_imported = False
def create_test_net():
net = pp.create_empty_network()
# buses
pp.create_... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
#VIEW
import streamlit as st
#GRAPH
import plotly.graph_objects as go
import plotly.express as px
from raceplotly.plots import barplot
from wordcloud import WordCloud
import matplotlib.pyplot as plt
#DATAFRAME
import pandas as pd
import feather
import model
from random ... |
# -*- coding: utf-8 -*-
"""
GUI Kwargs Dicts Options
========================
Provides a custom :class:`~PyQt5.QtWidgets.QDialog` subclass that allows for
the projection keyword argument dicts to be modified properly in the Projection
GUI preferences.
"""
# %% IMPORTS
# Package imports
import e13tools as e13
from m... |
try:
from typing import Dict, List, Optional, Tuple
from integral_timber_joints.process import RFLPathPlanner, RobotClampAssemblyProcess
except:
pass
import itertools
from copy import deepcopy
import compas
import compas_fab
from compas.geometry import Frame
from integral_timber_joints.assembly import As... |
import os
import csv
from typing import Dict, List, Any, Tuple, Set
from pymongo.errors import BulkWriteError
from pymongo.database import Database
from bson.objectid import ObjectId # type: ignore
from enum import Enum
from csv import DictReader, DictWriter
import shutil
import logging, pathlib
import re
from crawler... |
from __future__ import absolute_import
import inspect
import os
import os.path
import string
import subprocess
import time
from datetime import datetime
import asyncio
import lxml.etree
import pkg_resources
import vanir
import vanir.exc
import vanir.utils
STORAGE_ENTRY_POINT = 'vanir.storage'
... |
import os
import datetime
import gc
import random
import tempfile
import threading
import time
import sys
import duktape
import pytest
import pytz
# todo: unicode tests everywhere and strings with nulls (i.e. I'm relying on null termination)
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
def test_create():
... |
# -*- coding: utf-8 -*-
import json
import base64
import datetime
import io
import os
import glob
import pandas as pd
import numpy as np
import dash_table
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from app import app, indicator
from core ... |
from __future__ import division, print_function
import os
import sys
import numpy as np
from PIL import Image
import keras
from keras.models import Sequential, load_model
from keras.layers import (Conv2D, MaxPooling2D, Cropping2D, Flatten,
Dense, Dropout)
from keras.layers.advanced_activations... |
import itertools
from time import time
from types import FunctionType
from warnings import warn
import numpy as np
import pandas as pd
from gplearn.fitness import _Fitness, weighted_pearson, weighted_spearman, mean_square_error, root_mean_square_error, \
log_loss, mean_absolute_error
from gplearn.functions import ... |
## Copyright (c) <NAME>, <NAME>. All rights reserved.
## See LICENSE file for details.
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notices for more information.
from ... |
"""
This is an UNUSED OLD VERSION
of the jkin calculation
"""
def _debug():
fit_run_arg = orr_run_args[1]
def Jkin_calc_multi(fit_run_arg, **ORR_kwargs):
try:
# fit_run_arg = orr_run_args[1]
Jkin_calculations(fit_run_arg, **ORR_kwargs)
# fit_export_EV_all.ap... |
# This module contains models that are acutally used in the current state
# of the application
# It still represents a "transitional" state needed to cooperate with
# the old application; hence do not grin at missing ForeignKeys and similar
# "rooms for improvement" that can be done once the original application
# is s... |
# -*- coding: utf-8 -*-
"""
Author: Lorenzo
Email : <EMAIL>
"""
import queue
import threading
import multiprocessing as mp
from copy import deepcopy
# from zlib import crc32
import config as cf
from log import lg
from db_conn_pool import ConnPool
class Worker(threading.Thread):
def __init__(self, tb_... |
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
import gc
import numpy as np
from matplotlib import pyplot as plt
import cartopy.crs as ccrs
import pyart
from pyart.core.transforms import cartesian_to_geographic
import warnings
from matplotlib import rcParams
import xarray as xr
import pandas as pd
import copy
from tint.grid_utils import get_grid_alt, parse_grid_da... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LecoS
A QGIS plugin
Contains analytical functions for landscape analysis
-------------------
begin : 2012-09-06
copyrigh... |
# © 2020 <NAME> <<EMAIL>>
import contextlib
import datetime as dt
import io
import itertools
import random
import struct
from dataclasses import dataclass, field
from typing import List, Dict, Type, ClassVar, Tuple, Optional, DefaultDict
import wand.image
import wand.color
import msgpack
from .. import utils
from .f... |
from collections import defaultdict
from typing import Dict, List, Any
import numpy as np
import pandas as pd
from dataclasses import dataclass
from ira.series.Indicators import ATR
from ira.simulator.SignalTester import Tracker
from ira.strategies.exec_core_api import Quote
class TakeStopTracker(Tracker):
"""
... |
"""
Classses representing GLSL objects (functions, variables, etc) that may be
composed together to create complete shaders.
See the docstring of Function for details.
Details
-------
A complete GLSL program is composed of ShaderObjects, each of which may be used
inline as an expression, and some of which include a ... |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: <NAME> <<EMAIL>>
# Class to process a debian source package and generate an SPDX file out of its
# debian/control file
#
# It is based on DEP5 specs and SPDX specs:
# https://www.debian.org/doc/debian-policy/ch-controlfields.html
# https://www.debian.org/... |
# coding: utf-8
# # Vehicle Detection and Tracking Project
import os.path
import glob
import pickle
import time
from collections import deque
import numpy as np
import matplotlib.image as mpimg
from scipy.ndimage.measurements import label
import cv2
from skimage.feature import hog
from sklearn.preprocessing import Sta... |
# Copyright 2022 Google 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, ... |
# Import Packages
from IPython.display import clear_output
import pandas as pd
import requests
from requests.utils import requote_uri
from fake_useragent import UserAgent
from lxml import html
from bs4 import BeautifulSoup
from tqdm import tqdm
import time
from textblob import TextBlob
from langdetect import detect
imp... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from datetime import date
import itertools
import json
import logging
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from roger import config, external, models, push_service
from roger_common import convert, events, identifi... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
RasterIsochrones
A QGIS plugin
Create isochrones from elevation or other raster map data
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
... |
"""
[summary]
Returns
-------
[type]
[description]
TODO Track retries and total actions, log actions per second. subclass Queue?
"""
import asyncio
import copy
import csv
import json
import logging
import random
from abc import ABC, abstractmethod
from pathlib import Path
from string import Template
from tim... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
"""Describes the Flow of an experiment
"""
from __future__ import absolute_import, print_function
... |
import calendar
from decimal import ROUND_HALF_UP, Decimal
from fractions import Fraction
from auditlog.registry import auditlog
from django.db import models, transaction
from django.db.models import Sum
from django.utils import timezone
from django.utils.translation import pgettext_lazy
from django.utils.translation ... |
# SPADE
# Copyright (c) 2021-present NAVER Corp.
# Apache License v2.0
import collections
from copy import deepcopy
from pprint import pprint
import numpy as np
import torch
import torch.nn.functional as F
import spade.utils.general_utils as gu
def pred_label(task, score, method, n_fields, l_units, return_tensor=F... |
#!/usr/bin/python3.7
#Fetch data from RSbuddy and OSRS GE database for a defined list of items and present following data in a structured fashion:
#Main (runs periodically):
#Check if GE updated
#If GE updated: add data from osrs API to database, add timestamp of detected update to geupdate table. Launch enrichme... |
from __future__ import absolute_import
from sailthru.sailthru_client import SailthruClient
from .errors import SailthruApiError, SailthruUserEmailError
# We need the SailthruClientError to be able to handle retries in api_get
from sailthru.sailthru_error import SailthruClientError
# other libraries
import datetime
impo... |
import os
import nibabel
from ..externals.nipype.caching import Memory
from ..externals.nipype.interfaces import afni, fsl
from ..externals.nipype.utils.filemanip import fname_presuffix
from .utils import fix_obliquity
def _delete_orientation(in_file, write_dir=None, min_zoom=.1, caching=False,
... |
from typing import Dict, Tuple, List, Optional, Union, Type, Callable
import time
from lxml import etree
from plumbum import local
from plumbum.cmd import xmds2
import h5py
import matplotlib.pyplot as plt
import numpy as np
from .nodes import *
from .blocks import *
from .variables import *
from .NeuralNetwork import... |
'''
Created on Sep 18, 2019
@author: Anik
'''
from matplotlib import style
from numpy import ones, vstack
from numpy.linalg import lstsq, norm
from os import listdir
from os.path import isfile, join
from PIL import Image, ImageEnhance
from skimage.color import rgb2gray
from sklearn.cluster import KMeans
from skimage.... |
# coding=utf-8
# Copyright 2022 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... |
# -----------------------------------------------------------------------------------------------------
# CONDOR
# Simulator for diffractive single-particle imaging experiments with X-ray lasers
# http://xfel.icm.uu.se/condor/
# -------------------------------------------------------------------------------------------... |
import sys
import re
from shapely.wkt import loads as load_wkt
from shapely import affinity
from matplotlib.patches import PathPatch
from matplotlib.path import Path
import matplotlib.pyplot as plt
import numpy as np
import time,math
#from progressbar import ProgressBar
from sklearn.preprocessing import LabelEncoder, O... |
#!/usr/bin/env python
__author__ = ('<NAME> (<EMAIL>), '
'<NAME> (<EMAIL>), '
'<NAME> (<EMAIL>),'
'<NAME> (<EMAIL>), '
'<NAME> (<EMAIL>)')
__version__ = '3.0.19'
__date__ = '3 November 2020'
import os
import sys
import stat
import time
import argparse as ap
im... |
#
# Copyright and User License
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright <EMAIL> for the
# European Organization for Nuclear Research (CERN)
#
# Please consult the flair documentation for the license
#
# DISCLAIMER
# ~~~~~~~~~~
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, IN... |
#!/usr/bin/env python3
# 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 ... |
#!/usr/bin/env python
"""
A language-agnostic configuration parser.
Currently supports YAML, JSON, INI and TOML serialization formats.
"""
import collections
import contextlib
import functools
import inspect
import json
import logging
import multiprocessing
import os
import re
import sys
import threading
import warni... |
import random
import pytest
import redis
from tests.helpers import fresh_redis
ZSET_MAX_ZIPLIST_ENTRIES = 128 # redis uses a ziplist for zsets of 128 or fewer entries
ZSET_MIN_HASHTABLE_ENTRIES = ZSET_MAX_ZIPLIST_ENTRIES + 100
def test_zset_zadd_and_zcard():
r = fresh_redis()
assert r.zcard('myzset') == 0... |
"""
@Overview:
Implement Training ResNet 10 for Speaker Verification!
Enrollment set files will be in the 'Data/enroll_set.npy' and the classes-to-index file is 'Data/enroll_classes.npy'
Test set files are in the 'Data/test_set.npy' and the utterances-to-index file is 'Data/test_classes.npy'.
Training the ... |
#!/usr/bin/env python
#This is different from AIY Kit's actions
#Copying and Pasting AIY Kit's actions commands will not work
from kodijson import Kodi, PLAYER_VIDEO, JSONRPC
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from gmusicapi import Mobileclient
from googletrans im... |
"""
Dictionary and Dictionary handling functions
"""
import __future__
import copy
import rdkit
from rdkit import Chem
# Disable the unnecessary RDKit warnings
rdkit.RDLogger.DisableLog("rdApp.*")
import smilesmerge.operators.crossover.smiles_merge.merge_functions.mapping_class as mapping_class
def handle_dicts_a... |
from bpy.props import (BoolProperty,
FloatProperty,
StringProperty,
EnumProperty,
)
from bpy_extras.io_utils import (ImportHelper,
ExportHelper,
unpack_list,
... |
#!/bin/env python3
import sys
import os
import os.path
import glob
import copy
import traceback
import re
import csv
import tempfile
import urllib.request, urllib.parse, urllib.error
import shutil
import atexit
import subprocess
import time
import math
from collections import defaultdict, Counter
from os.path import jo... |
from lexicosql import tokens
#_______________________________________________________________________________________________________________________________
# PARSER
#_____________________________________________________________________________________________... |
#!/usr/bin/env python
import os
import sys
import pandas as pd
import numpy as np
import time
from sqlalchemy import create_engine
from itertools import repeat
import multiprocessing
import tqdm
import genes
import eqtls
def find_snps(
inter_df,
gene_info_df,
tissues,
output_dir,
... |
from utils_yolo import *
from cfg_yolo import parse_cfg
from region_loss import RegionLoss
from darknet import Darknet
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
import torch.optim as optim
from torch.autograd import Function
import math
from torchvision... |
# -*- coding: utf-8 -*-
# Owner(s): ["module: unknown"]
import logging
import random
import torch
from torch.nn.utils.parametrize import is_parametrized
from torch.testing._internal.common_utils import TestCase
from torch.ao.sparsity import BaseDataSparsifier, DataNormSparsifier
from typing import Tuple
from torch imp... |
from importlib import import_module
from itertools import chain
import logging
import traceback
from functools import partial
import builtins
from tx.functional.either import Left, Right, Either
from tx.functional.maybe import Just, Nothing
from .dependentqueue import DependentQueue, ResultType, ReturnType
from .utils ... |
import logging
import math
import string
from collections import Counter, defaultdict
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Dict, Tuple
import numpy
class LeontisWesthof(Enum):
cWW = 'cWW'
cWH = 'cWH'
cWS = 'cWS'
cHW = 'cHW'
cHH = 'cHH'
cHS... |
import numpy as np
import pandas as pd
import glob
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.callbacks import Callback
import cv2
import PIL
from operator import itemgetter
import keras.backend as K
import tensorflow as tf
import os
import errno
import ran... |
from io import BytesIO
from unittest.mock import MagicMock, Mock
import pytest
from django.contrib.auth.models import Permission
from django.contrib.sites.models import Site
from django.core.files import File
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import ModelForm
from django.t... |
# coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or... |
# -*- coding: utf-8 -*-
#MIT License
#Copyright (c) 2017 <NAME>
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, mod... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
#!python
from bases import decode, encode, convert, encodeTwosComplement
import unittest
class BasesDecodeTest(unittest.TestCase):
def test_decode_binary(self):
assert decode('0', 2) == 0
assert decode('1', 2) == 1
assert decode('10', 2) == 2
assert decode('11', 2) == 3
a... |
import json
import os
from typing import cast
from typing import Dict, List, Tuple, Any, Set, Optional, Text, Union # noqa
from attr import asdict
from chalice.config import Config # noqa
from chalice import app
from chalice.constants import LAMBDA_TRUST_POLICY
from chalice.deploy import models
from chalice.utils i... |
# coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import datetime
import logging as l
import random
import sys
from time import time, sleep
from shapely.geometry import box
from asfault import crossovers
from asfault import mutations
from asfault.config import *
from asfault.beamer import TestRunner, RESULT_SUCCESS, REASON_OFF_TRACK, REASON_TIMED_OUT, R... |
# firebird.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009 <NAME> <EMAIL>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Firebird backend
================
This module implements the Firebird backend, thru the kinterbasdb_
DBAPI mod... |
'''Utility file.'''
import re
import ast
import copy
import platform
import six
from six import iteritems
import numpy as np
import pandas as pd
from lxml import objectify
from lxml.builder import ElementMaker
from pptx.util import Inches
from pptx.dml.color import RGBColor
from pptx.enum.base import EnumValue
from ppt... |
import os
import glob
import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
from moviepy.editor import VideoFileClip
# Parameters for calibration
mtx = []
dist = []
calibration_file = "calibration_pickle.p"
# Parameters for gradient threshold
ksize = 7
gradx_thresh = (50, 255)
grady_thresh = (50... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
# Copyright (c) 2021 Pavel '<NAME>
# Copyright (c) 2012 <NAME>
# This file is part of pynetdicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pynetdicom.googlecode.com
#
"""
Implementation of the OSI Upper Layer Services
DICOM, Part... |
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributio... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... |
import numpy as np
import tensorflow as tf
import tensorflow_estimator as tfe
import tensorflow_hub as hub
from tensorflow.compat.v1 import get_variable
from tensorflow.compat.v1 import logging
from tensorflow.compat.v1 import variable_scope
from tensorflow.compat.v1.nn.rnn_cell import LSTMCell
from tensorflow.contrib... |
# Copyright 2010-2016 by <NAME> et al. All rights reserved.
#
# This code is part of the goatools distribution and goverend by its
# license. Please see the LICENSE file included with goatools.
"""Read and store Gene Ontology's obo file."""
# -*- coding: UTF-8 -*-
from __future__ import print_function
from collection... |
# Copyright (c) 2013-2021 khal contributors
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publi... |
"""
Build database model definitions
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from datetime import datetime
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.urls import r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.