text stringlengths 3.07k 22.1k |
|---|
import numpy as np
import scipy
import scipy.special
import scipy.optimize
import scipy.ndimage
import scipy.fftpack as fftpack
import thimbles as tmb
from thimbles import speed_of_light
from functools import reduce
sqrt2pi = np.sqrt(2*np.pi)
sqrt2 = np.sqrt(2)
profile_functions = {}
def gauss(wvs, center, g_width):... |
""" API v0 views. """
import logging
import edx_api_doc_tools as apidocs
from django.contrib.auth import get_user_model
from edx_rest_framework_extensions import permissions
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.auth.session.authenticat... |
import os
import csv
import urllib
import json
import tempfile
import zipfile
import shutil
from StringIO import StringIO
from django.conf import settings
from django.views.generic.base import TemplateView, View
from django.views.generic import CreateView, DetailView
from django.shortcuts import render
from django.ht... |
from datetime import datetime, timedelta
from random import random, shuffle, randint
from math import ceil
import copy
from operator import itemgetter
from utils import (
load_json_from_file,
year_diff,
increment_year,
parse_iso_datetime,
random_item_from_iterable,
random_key,
random_n_up_t... |
"""Basic Cli commands to interact with the content of `.ci3` folder."""
import os
import re
import yaml
import logging
import jinja2
from ci3.error import Ci3Error
from .base import CliCommand
CI3_CLUSTER_NAME = 'CI3_CLUSTER_NAME'
logger = logging.getLogger(__name__)
class MissingDotCi3Folder(Ci3Error):
"""Rai... |
"""
Spaghetti <3
"""
from discord.ext import commands
import discord
import locale
from requests import get
from datetime import datetime
from cogs.utils import Defaults
locale.setlocale(locale.LC_ALL, '')
class Corona(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.bot_has_pe... |
import pytest
import numpy as np
from sklearn.neighbors import NearestNeighbors
from sklearn.base import BaseEstimator
from pyloras import LORAS
@pytest.fixture
def data():
X = np.array([[-1.713043, 1.811711, 0.496868, -1.891984, 1.877141],
[ 1.828116, 0.207981, -1.318674, -0.551289, 1.604... |
from flask import jsonify, Blueprint, request
from app.common.decorator import jwt_role
from app.models import *
from app.models.base import timestamp
from app.extensions import cron_manager
from app.common.helper import *
from app.common.helper import get_post_items
from app.common.helper import create_model
cron =... |
import functools
import importlib
import logging
import pkgutil
import sys
from .hooks import post_import, pre_import
from . import reflectutils
# This blacklist stinks. But there is a node inside sympy that causes the
# whole exploration to just hang unless you CTRL-C. This is pretty heavy
# handed...
# TODO(tarak):... |
import datetime
import io
import logging
import os, errno
import shutil
import time
import subprocess
import re
try:
unicode
except NameError:
unicode = str
from dokuforge.common import check_output, utc, epoch
from dokuforge.common import validateRcsRevision
from dokuforge.common import RcsUserInputError
fro... |
import tensorflow as tf
import cv2
import numpy as np
import sys
import os
import argparse
default_model_name = 'tf.keras_alexnet.h5'
default_model_dir = 'models'
def build_model(image_height=224, image_width=224, class_count=1000):
"""tf.keras implementation of the SuperVision NN designed by <NAME>. al.
NOTE... |
# -*- coding: utf-8 -*-
import json
import datetime
from flask.ext.babel import gettext
from flask import Blueprint, request, jsonify, redirect
from flask import url_for, g, abort, render_template
from fedora_college.core.models import Media, UserProfile
from fedora_college.core.models import Tags, TagsMap
from fedora_... |
# encoding = utf-8
import base64
import functools
import json
import os
import requests.exceptions
import sys
import time
VERIFY_CERTIFICATE = True
'''
IMPORTANT
Edit only the validate_input and collect_events functions.
Do not edit any other part in this file.
This file is generated only once when ... |
import logging
import math
import torch
import torch.nn as nn
# noinspection PyUnresolvedReferences
from torch2trt import torch2trt
import _init_paths
from models.networks.shufflenet.blocks import HS, Shufflenet, Shuffle_Xception
BN_MOMENTUM = 0.1
logger = logging.getLogger(__name__)
def fill_up_weights(up):
... |
"""QSAR modelling Data Sources
This module supports representation of functional bioactivies
- Directly from ChEMBL API
- From a list of Canonical SMILES, along with the measured activity
"""
import chembl_webresource_client
import numpy as np
import pandas as pd
from rdkit import Chem
from rdkit.Chem import AllC... |
import math
import numpy as np
def calcuate_7_5():
""" Calculates all such numbers which are divisible by 7 but are not a multiple of 5,
between lowervalue and uppervalue (both included). The numbers obtained will be printed
in a comma-separated sequence on a single line """
lowervalue = int(in... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn.functional as F
from fairseq import utils as fairseq_utils
from pytext.config import ConfigBase
from pytext.models.seq_models.base import PyTextSeq2S... |
# Copyright (c) 2018 <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, modify, merge, publish, distribute, ... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.contrib.auth.models import User
from model_utils.models import TimeStampedModel
from django.core.validators import MinLengthValidator, RegexValidator
from django.conf import settings
from dj... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import os
import sys
import glob
import fnmatch
import numpy as np
import json
from enum import Enum
from functools import wraps
from app.backend.api import app_flask
#################################################
class DBTypes(Enum):
texttable = '... |
from son import loads, dumps
# Serialization tests
def test_null_serialize():
assert dumps(None) == 'null'
def test_bool_serialize():
assert dumps(True) == 'true'
assert dumps(False) == 'false'
def test_number_serialize():
assert dumps(123) == '123'
assert dumps(-987) == '-987'
assert dum... |
#!/usr/bin/python
import numpy as np
import scipy
import time
def commutator(A,B):
commu = np.dot(A,B) - np.dot(B,A)
return commu
def cond_number(A):
s,u = np.linalg.eig(A)
s = abs(s)
cond = max(s)/min(s)
return cond
def matrix_power(S,a):
'''X == S^a'''
s,ket = np.linalg.eigh(S)
... |
"""
Provides a JSON API for the Part app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from django.conf import settings
from django.db.models import Sum
from rest_framework import status
from rest_framework.response import Response
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
# IMPORT DISCORD LIBRARIES
import discord
from discord.ext import commands
import discord_components
# IMPORT STANDARD LIBRARIES
import numpy as np
import os
import re as regex
import time
# GET EMAIL READER
import sys
sys.path.append('src/email_reader')
import emailreader
sys.path.append('src')
from settings_secret... |
#!/usr/bin/env python
#
# Copyright (c) 2021, Massachusetts Institute of Technology 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
"""
A collection is a (virtual) container for several objects having the same
vertex structure (vtype) and same uniforms type (utype). A collection allows to
manipulate objects individually but ... |
import json
def constant_vertex(vertex, vertex_list, scale):
# Checks which vertex it is, so it defines the new value,
# in order to keep the same opening area
if max(vertex_list) == min(vertex_list):
new_vertex = vertex*scale
elif vertex == min(vertex_list):
new_vertex = ... |
import os
import os.path
import subprocess
from enum import Enum
from sys import stderr
from typing import Optional
from utility import ensure, get_or_raise, GEP_FOLDER
class Job:
def __init__(self, *, uuid: str, script_file: str, memory: str, account: str, partition: str, max_run_time: str,
qos ... |
# Copyright 2018 <NAME> aka penguinolog.
# Copyright 2016 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... |
import torch
from network.ocrnet import HRNet_Mscale
from loss.utils import CrossEntropyLoss2d
import numpy as np
from torchvision import transforms
# from torchvision.datasets import Cityscapes
from datasets.cityscapes import CityScapes
from tqdm import tqdm
from torch.utils.tensorboard import SummaryWriter
import cv... |
import datetime
import graphene
import requests as req
import config as conf
from models.users.users import user_client
from models.economy.periods import get_dates_month_period
from db import coll_accounts, coll_trans
from models.ai.accountant import predict_accounts
dev_user = conf.get_setting("dev-user", None)
def... |
"""Training IGMC model on the MovieLens dataset."""
import os
import sys
import time
import glob
import random
import argparse
from shutil import copy
from pyinstrument import Profiler
import numpy as np
import torch as th
import torch.nn as nn
import torch.optim as optim
from model import IGMC
from data import Movi... |
import dataset
import trees
import tensorflow as tf
import numpy as np
import utils
from sklearn.externals import joblib
from sklearn.tree import DecisionTreeClassifier
import argparse
import time
import pandas as pd
import json
import re
tf.enable_eager_execution()
parser = argparse.ArgumentParser()
parser.add_argum... |
import logging
import unicodedata
from urllib.parse import urlparse
from suds import sudsobject
from suds.client import Client
from suds.plugin import MessagePlugin
from suds.transport.https import HttpAuthenticated
from suds.xsd import doctor
from dataactcore.config import CONFIG_BROKER
from dataactcore.models.fsrs ... |
import os
import shutil
import tempfile
import re
from StringIO import StringIO
# import zipfile
import custom_zip as zipfile
from xml.etree import ElementTree
try:
# Python 3
from urllib.parse import urlparse, urljoin
except ImportError:
# Python 2
from urlparse import urlparse, urljoin
import metadat... |
import os
import sys
import scipy.io
import scipy.misc
from nst_utils import *
import numpy as np
import cv2
import random
from tqdm import tqdm
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
model_global = None
sess_global = None
def set_config1(config):
global min_box_w, max_box_w, min_offset, ... |
#Importando Librerias Necesarias para utilizar Flask
from flask import Flask, render_template, json, request, flash, session
from flask import redirect, jsonify, make_response
#Importando Librerias para utilizar el API de Spotify
import spotipy.util as util
from spotipy import oauth2
import spotipy
#Importando Libreria... |
import pandas as pd
import matplotlib as mpl
# We will not be showing images because we don't haw UI
mpl.use('Agg')
import matplotlib.pyplot as plt
from report_builder import ReportBuilder
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.path.abspath(__file__)))))
from utils impor... |
from decimal import Decimal
from typing import List, Dict, Set
import pandas
from pandas import DataFrame
from service.i_scraping_service import IScrapingService
from service.ulitity import regex, extract_numbers, convert_columns
def cleansing(s: str):
"""文字列を正規化する"""
return s.strip()
def get_panasonic_le... |
"""
The idea of that model is to find local extrema,
then classify them as 0 (hold), 1 (sell), 2 (buy)
using a lstm neural network (keras)
"""
import numpy as np
import pandas as pd
from keras.models import Sequential, load_model
from keras.layers import LSTM, Dense, Flatten
from keras.utils.np_utils import to_catego... |
# -*- coding: utf-8 -*-
from zeep import Client
from zeep.cache import SqliteCache
from zeep.transports import Transport
from requests import Session
from requests.auth import HTTPBasicAuth
import urllib3
from urllib3.exceptions import InsecureRequestWarning
from cryptography.fernet import Fernet
from pathlib import P... |
import os
import yaml
import json
import copy
import pprint
import argparse
import subprocess
from collections import defaultdict
NAMESPACE = os.environ.get('KUBECTL_PLUGINS_CURRENT_NAMESPACE')
KUBECTL_PATH = os.environ.get('KUBECTL_PLUGINS_CALLER')
class RBAC(object):
def __init__(self, namespace, kubectl_path... |
import copy
import random
import time
from os import mkdir
import numpy as np
import torch.optim as optim
import wandb
from matplotlib import pyplot as plt
from sklearn.preprocessing import scale
from two_thinning.full_knowledge.RL.PolicyGradient.constants import *
def sample_action(actor_net, loads):
probs = a... |
import os
import sys
import json
import shutil
import random
import tempfile
import mock
from datetime import datetime, timedelta
from twisted.internet import reactor, task, defer
from twisted.trial import unittest
from ooni.utils import generate_filename, randomSTR, randomDate, LONG_DATE
from ooni.tests.bases impo... |
"""A simple and incomplete parser for the Standard Test Interface Language (STIL).
The main purpose of this parser is to load scan pattern sets from STIL files.
It supports only a very limited subset of STIL.
The functions :py:func:`load` and :py:func:`read` return an intermediate representation (:class:`StilFile` ob... |
"""
Complete game written in adventurelib
This program is designed to demonstrate the capabilities
of adventurelib. It will:
- Create a large world in which to wander
- Contain several inventory items
- Set contexts for moving from one area to another
- Require some puzzle-solving skills
"""
# Import the library cont... |
from distutils.command.upload import upload
from urllib.response import addbase
from dns import update
from hdx.data.dataset import Dataset
from hdx.facades.simple import facade
from hdx.utilities import is_valid_uuid
import pandas as pd
import argparse
import logging
from stat import S_ISDIR
import os
import tracebac... |
#!/usr/bin/env python3
"""
Test misc.
"""
import os, time
import numpy as np
from .. import api
import warnings
# If SD tests cannot run then in most cases treat this as a warning only.
# There is not much point in letting dozens of tests fail for the same
# reason. Once Seismic Store is fully supported, make one an... |
#/* vim: set ts=2: */
#/*jshint -W041 */
#/*jshint loopfunc:true, mocha:true, node:true */
#var SSF = require('../');
from ssf import SSF
import math
import random
import re
from datetime import timedelta, datetime
import gzip
ssf = SSF()
SKIP=500
START_SKIPPING_AT=50
#var fs = require('fs'), assert = require('assert')... |
import math
import pdb
import torch
# from torch.autograd import Variable
### batch-related stuff ###
def truncate_or_pad(tensor, dim, length, pad_index=0):
"""
truncate or pad the tensor on a given dimension to the given length.
:param tensor:
:param dim:
:param length:
:param pad_index:
"""
orig_l... |
#Python modules
import argparse
import logging
import json
import warnings
import os
#Pytorch modules
from torch.utils.data import DataLoader
import torch
from torch.autograd import Variable
from torchvision import transforms
import torch.optim as optim
import numpy as np
import utils as util
##DATASET MODULES
#... |
# Copyright (c) 2010 Google Inc. All rights reserved.
# Copyright (C) 2017 Apple Inc. 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... |
''' Database Transactions '''
import datetime
import logging
from cointracker.database import db, Price, CronJob
logger = logging.getLogger('transactions')
logger.setLevel(logging.DEBUG)
supported_symbols = [
"ltc_btc",
"eth_btc",
"etc_btc",
"bch_btc",
"btc_usdt",
"eth_usdt",
"ltc_usdt",
... |
import argparse
import atexit
import http.client
import json
import logging
import os
import sys
import time
import lxml.html
from lxml import etree
import msal
import requests
from jinja2 import Environment, FileSystemLoader
from libnmap.parser import NmapParser
import pyperclip
import io
def _me(auth):
graph_da... |
# Copyright 2020 The TensorFlow 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 applica... |
"""
Copyright (c) 2009 <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, modify, merge, publish, distribute, sublice... |
import math
import random
import sys
def usage():
print( sys.argv[0] + " maximum_brightness(Default 100, 10-254) maximum_number_of_spheres(Default 5, 1-10)")
# if you are turning a lot of them on at once, keep their brightness down please
max_brightness = 100
min_brightness = math.floor(max_brightness/2) #Min brig... |
from datetime import datetime
from bson.json_util import dumps
from flask import Flask, render_template, request, redirect, url_for, jsonify
from flask_login import LoginManager, login_user, login_required, logout_user, current_user
#from flask_socketio import SocketIO, join_room, leave_room
from pymongo.errors import... |
# Generic-DiscordBot
# author: github/adibarra
# imports
import re
import uuid
import time
import discord
import asgiref.sync
from DB_logger import Logger, Importance
from DB_database import DatabaseHandler
from DB_prefsloader import PreferenceLoader
class Command:
""" Class to define what a command is """
... |
############################################################################
#
# Copyright (c) Mamba Developers. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
############################################################################
import st... |
import pygame as pg
import game.demo.demo_sprites as d_sprite
from game.gameplay.state import checkQuitGame
from game.tools.asset_cache import playSound
import game.tools.constants as c
from game.tools.controls import controlsDicts
def animateDemo():
"""Play the demo animation until the user presses return to ca... |
import os
import glob
import scipy.interpolate as si
import numpy as np
import astropy.units as u
import astropy.constants as constants
import pysynphot as ps
import psisim
from psisim.instruments.template import Instrument
class PSI_Blue(Instrument):
'''
An implementation of Instrument for PSI-Blue
'''
... |
import torch
import argparse
import numpy as np
import random
import torchvision
import json
import os
import importlib
import torch.utils.data as data
import seaborn as sn
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from typing import Optional
from iirc.datasets_loader import get_lifelong_da... |
# -*- coding: utf-8 -*-
import logging
import os
import pprint
import traceback
import webbrowser
from . import packagers, scene_packager_config, utils
# Globals
LOG = utils.get_logger("scene_packager.api")
# Config python file name
SP_CONFIG_NAME = "scene_packager_config.py"
def _get_config_paths(search_path=None... |
from datetime import datetime
from random import randint
import os
import os.path
from os import path
import cv2
from matplotlib import pyplot as plt
from sklearn.decomposition import IncrementalPCA
import numpy as np
import pickle
import tkinter as tk
from tkinter import messagebox
import errno
def ge... |
"""
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
"""
import sys
import unittest
from unittest.mock import MagicMock, patch
import botocore
from datetime import datetime
import copy
import json
##############
# Parameters #
##############
# Define the default... |
'''
---------------------------
Licensing and Distribution
---------------------------
Program name: Pilgrim
Version : 2021.5
License : MIT/x11
Copyright (c) 2021, <NAME> (<EMAIL>) and
<NAME> (<EMAIL>)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associat... |
import pygame
import random
from viewer_ng.image_creator import create_tiles
from tca_ng import cells, models, example_maps, cars
from pygame import locals
#tca = models.Automaton()
#topo = example_maps.grid_2lane_map(width=2, height=2)
#tca.topology = topo
#topo.automaton = tca
#tca.update()
#car = topo.cars[0]
#lis... |
# Standard library
import os
from unittest import mock
from unittest.mock import MagicMock
# Third-party
import polib
from django.test import TestCase, override_settings
# First-party/Local
from i18n.utils import (
active_translation,
get_default_language_for_jurisdiction,
get_pofile_creation_date,
ge... |
import numpy as np
from scipy import signal
from matplotlib import pyplot as plt
from matplotlib.widgets import SpanSelector
class PlotUI:
def __init__(self, config):
self.config = config
self.measurements = Measurements(self.config.dibs)
self.fig, (self.ax1, self.ax2, self.ax3) = plt.sub... |
import copy
import cv2
import numpy as np
from scipy.interpolate import UnivariateSpline
def spread_lookup_table(x, y):
spline = UnivariateSpline(x, y)
return spline(range(256))
def create_loopup_tables():
increase_lookup_table = spread_lookup_table([0, 64, 128, 256], [0, 80, 160, 256])
decrease_lo... |
import os
from figures import profiles_viz
from competitors.VAE import VAE
from unused.sampling import Sampling
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow.python.keras import backend as K
from tensorflow.python.keras... |
# Assessment 3B Question 2
# <NAME>, <EMAIL>
from tkinter import *
from tkinter.messagebox import * # required a seperate import for some reason was working buggy on my machine
def get_demerit_points(driving_speed, speed_limit, light_trailer = False, school_zone = False, holiday_period = False):
'''
Function ... |
# pylint: disable=consider-using-ternary
# Copyright (C) 2018-2021 Seoul National University
#
# 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... |
#!/usr/bin/env python3
# -*- coding: latin_1 -*-
# pylama:ignore=D203,D204,D205,D209,D400,E501,D213
# Note that the file encoding we use is the same as the ASCII files -
# see nndb_recs below
"""nndb-import.py
These are the files that we support as documented in the file sr27_doc.pdf
as given in the SR27 distributi... |
from tkinter import *
from tkinter import ttk
from typing import Container
import docker
import psutil
import os
import sys
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF, renderPM
from PIL import Image, ImageTk
from functools import partial
# Function to print the process list of the s... |
from subprocess import call, check_output
from os.path import join, isdir, isfile
from os import error, getcwd, environ, pathsep
from time import sleep
import colorama
from colorama import Style, Fore
colorama.init(autoreset=True)
adb_dir_name = 'minimal_adb_and_fastboot'
recovery_name = 'recovery.img'
magisk_file_n... |
import os
import re
from backend.barista.utils.settings import applicationQSetting
from backend.barista.utils.logger import Log
class Singleton(type):
"""This metaclass is used to provide the singleton pattern in a generic way.
See http://stackoverflow.com/a/6798042 for source and further explanation.
T... |
import networkx as nx
import json
from networkx.classes.function import nodes
from pandas.core.indexes import base
get_attr = lambda line, attr : line.split("%s=\"" % attr, 1)[1].split('"', 1)[0]
id = 0
u = 0
def parse_switch(switch_dict, line):
"""Parses all the switch blocks.
Parameters
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
from absl import logging
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import variables
import os, sys
import time
s... |
import numpy as np
import pandas as pd
from scipy import interpolate
import warnings
import gala.integrate as gi
import gala.dynamics as gd
import gala.potential as gp
from gala.units import galactic
from astropy import coordinates as coord
from astropy.coordinates import SkyCoord
from astropy import units as u
from ... |
from panda import Panda
import binascii
import bitstring
import time
import datetime
import csv
import cantools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
from sklearn.cluster import AgglomerativeClustering
#Author: <NAME>
#Contact: <EMAIL>
def database(filename):
db = ... |
# Copy from google tutorials
"""
A test of mnist using the AlexNet logs
"""
import argparse
import sys
import time
from download import *
from tools import *
import numpy as np
import tensorflow as tf
# Download dataset
SOURCE_URL = "http://yann.lecun.com/exdb/mnist/"
WORK_DIRECTORY = './raw_data/mnist'
IMAGE_SIZ... |
# Copyright 2020 <NAME>, <NAME>, and <NAME>. 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... |
"""
Tracking ML dataset
"""
import os
import re
import glob
import numpy as np
import pandas as pd
from trackml.dataset import load_event
from heptrkx import utils_math
# predefined layer info
# in Tracking ML, layer is defined by (volumn id and layer id)
# now I just use a unique layer id
vlids = [(7,2), (7,4), (7... |
"""Serializers which initialize and serialize workflow models into formats needed for the IPTT React App/Excel export
Serializers:
IPTTQSProgramSerializer: Quickstart serializer, loads programs for populating IPTT Quickstart menus. Example:
IPTTQSProgramSerializer.load_for_user(user)
... |
import sys
import os
import random
import socket
import string
import time
import base64
mailboxes = ["INBOX", [
["INBOX.childone",
[ [ "INBOX.childone.mba", [] ],
[ "INBOX.childone.mbb", [] ],
[ "INBOX.childone.mbc", [] ] ] ],
["INBOX.... |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
import bert
from bert import optimization
from bert import tokenization
from bert import modeling
import numpy as np
import json
import tensorflow as tf
import itertools
import collections
import re
import random
import sentencepiece as spm
from unidecode import unid... |
import tkinter as tk
import tkinter.font as font
from tkinter import ttk
from thonny.codeview import CodeViewText
from thonny.shell import ShellText
from thonny import get_workbench, get_shell
from .base_postit import BaseWidget,BaseCode, BasePost, BasePopup
from .common import common_images
class EnclosedWidget(ttk... |
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors
# License: See license.txt
from __future__ import unicode_literals
import dataent, json, os
from dataent.utils import strip, cint
from dataent.translate import (set_default_language, get_dict, send_translations)
from dataent.geo.country_info import... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Surface extraction
++++++++++++++++++
Defines the workflows for extracting surfaces from segmentations
"""
import nipype.pipeline.engine as pe # pipeline engine
fr... |
"""
easy_import.py
by <NAME> 2021
Makes python modules and packages anywhere visible for easy import
# ==========================
# easy_import.py example Use
# ==========================
# I have no idea where on my computer the module 'data_tools.py 'is,
# nor where the package 'audio' is.
# Note: assumes 'au... |
import argparse
import dill as pickle
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.ticker import FormatStrFormatter
from nes.ensemble_selection.config import BUDGET, PLOT_EVERY
matplotlib.use("Agg")
import os
from pathlib import Path
import numpy as np
import pandas as pd
plt.rcParams['axes.grid... |
###################################################################################################
# MIT Licence (C) 2022 <EMAIL>@Github #
###################################################################################################
"""Module used for TOM... |
import os, random, pathlib, pygame, sys
from pygame.locals import *
from glob import glob
FPS = 30
REVEALSPEED = 8 # speed boxes' sliding reveals and covers
BOXSIZE = 48 # size of box height & width in pixels
GAPSIZE = 10 # size of gap between boxes in pixels
BOARDWIDTH = 6 # number of columns of icons
BOARDHEIGHT ... |
# Copyright 2016 The TensorFlow 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 applica... |
# merge.py -- Merge support in Dulwich
# Copyright (C) 2020 <NAME> <<EMAIL>>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
# modify it ... |
import configparser
import argparse
import sys
FILENAME_CONFIG = "daikin.conf"
FILENAME_COMMAND = "daikin.txt"
BIT_0 = "0x00,0x12,0x00,0x12,"
BIT_1 = "0x00,0x12,0x00,0x31,"
BIT_LEADER = "0x00,0x86,0x00,0x41,"
BIT_STOP1 = "0x00,0x12,0x03,0xc1,"
BIT_STOP2 = "0x00,0x13,0x05,0x22,"
BIT_STOP3 = "0x00,0x12,0x1e,0x0d"
BYT... |
#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
from optparse import OptionParser
from subprocess import Popen, PIPE
import xml.dom.minidom
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.