text stringlengths 8.04k 46.5k |
|---|
import sys
import sqlite3
'''
Run with the command: python3 q9.py <name_of_db>.db <name_of_queryfile>.txt
The table we used to store RDF data is called 'statement'
# Assume that
# 1. The closing brace } will not be in the same line as the last statement.
# 2. All keywords in the provided query file should be in up... |
#
# Automated Dynamic Application Penetration Testing (ADAPT)
#
# Copyright (C) 2018 Applied Visions - http://securedecisions.com
#
# Written by <NAME> - http://www.siegetechnologies.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
"""
Copyright (c) 2021 <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, s... |
"""
Copy of main.py with some Telegram Payments handlers added
"""
import telebot
from telebot.types import LabeledPrice, ShippingOption
from configs import * # should've been configs2 here!
from texts import *
from markups import *
from random import choice
from string import ascii_letters, digits
from c... |
from functools import partial
from os.path import join, dirname
import pandas as pd
import talib
from Query import Query
from bokeh.io import curdoc
from bokeh.layouts import column, layout, row
from bokeh.models import Button, Select, TextInput, ColumnDataSource, DataTable, TableColumn, Div, Tabs, Panel, \
... |
import numpy as np
import pandas as pd
import collect as clct
import constants
import db_operations as dbop
def _check_int(arg):
if type(arg) != int:
raise ValueError("{} is not a int".format(arg))
def _check_iterable(arg):
if not hasattr(arg, "__iter__"):
raise ValueError("{} is not iterab... |
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Suite of tests for all estimators.
adapted from scikit-learn's estimator_checks
"""
__author__ = ["mloning", "fkiraly"]
import numbers
import pickle
import types
from copy import deepcopy
from inspect import signature
... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2016
# --------------------------------------------------------------------------
from six import iteritems
f... |
import os
import onnx
from shutil import copyfile
from hdfg import hdfgutils
from hdfg import load_store
from hdfg.passes.flatten import flatten_graph, is_literal
import codegen as c
from hdfg.hdfg_pb2 import Component, Program
from hdfg.visualize import *
from .serial.DataFlowGraph import *
from codegen.tabla import t... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 <NAME>
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or m... |
__author__ = '<NAME>'
import ctypes
import os
import time, queue
import numpy as np
import threading
libc = ctypes.cdll.msvcrt
libc.fopen.restype = ctypes.c_void_p
class PixelFly(object):
"""
PixelFly class loads the pf_cam.dll in order to interface
the basic functions of the pco.pixelfly... |
# coding: utf-8
"""Dirty Hack to cache simprod data for weighting for offline usage
Code is adopted from `from_simprod` function:
https://code.icecube.wisc.edu/projects/icecube/browser/IceCube/meta-projects/
combo/trunk/weighting/python/weighting.py#L823
Line 823 is where to get the database PW from.
"""
from __futur... |
# Training script with LazyLoader
#
# Instead of dumping all input into memory, we lazy load on the fly.
# This can create an IO bound where slow training down but helping to training large dataset such as MetaVideoLazy
import os
from tqdm.auto import tqdm
from opt import config_parser
import logging
import ruamel.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import fnmatch
import sys
import shutil
from jinja2 import Environment, FileSystemLoader
from jinja2 import Template
# #nombre cliente de la carpeta y tipo template
cliente = "3RTVpaket"
type_temp = "index-c.html"
# Capture our current directory
THIS_DIR = os.pa... |
# coding: utf-8
import argparse
import time
import math
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
import os
import data
import model as base_model
import bidir_lstm as bi_model
import cnn
parser = argparse.Arg... |
import discord, asyncio, os, watcher, utils, time, aiohttp
from requests.models import StreamConsumedError
from discord.ext.commands.help import HelpCommand
from PIL import Image
from io import BytesIO
from discord.ext import commands, tasks
from utils import log, logErr
from riotwatcher import LolWatcher, ApiError
fro... |
# Copyright (C) 2020 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... |
# -*- coding: utf-8 -*-
#
# Hooks module for py2exe.
# Inspired by cx_freeze's hooks.py, which is:
#
# Copyright © 2007-2013, <NAME>.
# Copyright © 2001-2006, Computronix (Canada) Ltd., Edmonton, Alberta, Canada.
# All rights reserved.
#
import os, sys
# Exclude modules that the standard library imports (cond... |
# -*- coding: utf-8 -*-
"""
url.py
Copyright 2006 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the h... |
#!/usr/bin/env python3
import sys
import os
import re
import xml.etree.ElementTree as ET
from collections import defaultdict
# Uncomment to do type checks. I have it commented out so it works below Python 3.5
#from typing import List, Dict, TextIO, Tuple, Iterable, Optional, DefaultDict
input_list = [] # type: List... |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class GetEHREmployeeListReq(object):
view: str = attr.ib(
default="", metadata={"r... |
import discord
import os
from discord.ext import commands
import json
from discord import Intents
import aiohttp
import dotenv
from dotenv import load_dotenv, find_dotenv
import io
import sys
import traceback
import re
import datetime
#importing random stuff lol
import asyncio
import random
import time
#==============... |
from enum import Enum
from math import cos, sin, pi, floor
from Data import get_uids
from Data.Areas import CompositeArea, EdgeLoopArea, AreaType, Edge
from Data.Edges import EdgeType
from Data.Events import ChangeEvent
from Data.Objects import IdObject, NamedObservableObject, MetaDataObject
from Data.Parameters impor... |
"""
Implementation of the FFTlog algorithm, very much inspired by mcfit (https://github.com/eelregit/mcfit) and implementation in
https://github.com/sfschen/velocileptors/blob/master/velocileptors/Utils/spherical_bessel_transform_fftw.py
"""
import os
import warnings
import numpy as np
class FFTlog(object):
r""... |
# -*- coding: utf-8 -*-
"""
Train a classifier to classify vertical slices of a word image as within a
a letter or between letters.
"""
# Copyright (c) 2018 <NAME>. All rights reserved.
from functools import partial
import sys
import attr
import cv2
import numpy as np
import sklearn
import torch
from handwriting ... |
from typing import List, Optional, Tuple
import os
import time
import torch
import numpy as np
import json
from transformers.models.rag.retrieval_rag import (
HFIndexBase,
RagRetriever,
LegacyIndex,
CustomHFIndex,
CanonicalHFIndex,
LEGACY_INDEX_PATH,
)
from transformers.models.rag.tokenization... |
import os
import sys
import time
import binascii
import hashlib
import unicodedata
import mapping
import json
import getpass
import getch
import tools
import messages_pb2 as proto
import types_pb2 as types
import protobuf_json
from keepkeylib.debuglink import DebugLink
from mnemonic import Mnemonic
# try:
# from... |
from PIL import Image, ImageDraw, ImageFont # Netzplan zeichnen und exportieren
import csv # für CVS-Import
import re
from openpyxl import load_workbook # für Excel-Import
from openpyxl.utils import get_column_letter # Spalten-Namen in Excel
# Netzplan berechnen und zeichnen
versi... |
# Copyright 2016 Canonical Ltd
#
# 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, s... |
# -*- coding: utf-8 -*-
"""
Quantarhei package (http://www.github.com/quantarhei)
abs module
This module contains classes to support calculation of linear absorption
spectra.
"""
import numpy
import scipy
import matplotlib.pyplot as plt
#from scipy.optimize import minimize, leastsq, curve_fit
... |
from collections import defaultdict
from sklearn import preprocessing
import pandas as pd
from math import *
import datetime
#from .pygradu import portcalls
from .gridify import *
import math
EARTH_RADIUS_KM = 6371.0
class Graph():
def __init__(self):
"""
self.edges is a dict of all possible next... |
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from threading import Lock
import numpy as np
import sys
import array
import math
import ctypes
import pyzed.sl as sl
M_PI = 3.1415926
SK_VERTEX_SHADER = """
# version 330 core
layout(location = 0) in vec3 in_Vertex;
layout(location = 1) in v... |
#----------------------------------------------------------------------------------------
# This provides a basic CBUS interface fpor communicating with the Pi-SPROG3 via the Raspberry Pi UART. It does not provide
# a fully-functional interface for All DCC command and control functions - just the minimum set needed to ... |
import numpy as np
import random
import time
from libdw import sm
#Defining the class Rod, which encompasses functions that all rods/fish catching equipment have
class Rod:
#n represents the number of fish caught a time by the type of rod, default value is 1
n = 1
#defines an attribute .chance, which is the proba... |
# Copyright (C) 2014 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTE... |
"""Main entry point."""
from typing import Tuple, Text
import json
import os
from absl import app
from absl import flags
from absl import logging
from datetime import datetime
import jax.numpy as np
from jax import random, value_and_grad, jit
import jax.experimental.optimizers as optim
from jax.ops import index_up... |
import pandas as pd
import codecs
import json
from collections import defaultdict, OrderedDict
import numpy as np
from tqdm import tqdm
import gensim
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
from sklearn.model_selection imp... |
"""
Routines for working with rotation matrices
"""
"""
comment
author : <NAME>
date : April-2018
"""
import numpy as np
import sympy
from collections import namedtuple
# The following construct is required since I want to run the module as a script
# inside the skinematics-directory
import os
import sys
file_d... |
from __future__ import absolute_import, division, print_function
import argparse
import importlib
import itertools
import time
from multiprocessing import Pool
import numpy as np
import os
import pdb
import pickle
import subprocess
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
import thr... |
# --------------------------------------------------------
# Pytorch FPN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, based on code from faster R-CNN
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from... |
import enum
import collections
# https://github.com/KhronosGroup/glTF/tree/master/specification/2.0
# Uniform Semantics:
# LOCAL, MODEL, VIEW, PROJECTION, ...
class Uniform(enum.Enum):
LOCAL = "LOCAL"
MODEL = "MODEL"
VIEW = "VIEW"
PROJECTION = "PROJECTION"
# Attribute Semantics:
# P... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# region Description
"""
wat.py: Cross platform WiFi attack tool (wat)
Author: <NAME>
License: MIT
Copyright 2020, Raw-packet Project
"""
# endregion
# region Import
from raw_packet.Utils.base import Base
from raw_packet.Utils.wifi import WiFi
from raw_packet.Utils.tm im... |
"""
MMMMMMMM MMMMMMMM tttt iiii
M:::::::M M:::::::M ttt:::t ... |
#!../venv/bin/python3
import boto3
import os
import json
import time
from PIL import Image
import piexif
from datetime import datetime
from time import sleep
import pyexifinfo as p
import argparse
import logging
import glob
import hashlib
import sqlite3
import subprocess
from pathlib import Path
from config ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import io
import os
import pickle
from enum import Enum, auto
from functools import reduce
from types impo... |
from __future__ import (
absolute_import,
unicode_literals,
)
import copy
import operator
from collections import OrderedDict
from datetime import date
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import (
F,
Model,
Q,
)
from functools import reduce
from pyparsing imp... |
#
# Utility functions for loading and creating and solving circuits defined by
# netlists
#
import numpy as np
import codecs
import pandas as pd
import liionpack as lp
import os
import pybamm
import scipy as sp
from lcapy import Circuit
def read_netlist(
filepath,
Ri=None,
Rc=None,
Rb=None,
Rt=N... |
'''
This file implements the Report class that interacts with the database to
construct report files
'''
from datetime import datetime
from itertools import chain
from pathlib import Path
from typing import List, Optional, Tuple
from case import COD, INCIDENT, ORGANIZATION
from db import (
cod,
cod_water_relat... |
import json
import os
import time
import re
import asyncio
import async_timeout
import aiohttp
import aiofiles
import aiodns
import aiobotocore
import sys
import logging
from time import mktime, strptime
from datetime import datetime, timedelta
ACCESS_LOG_NAME="edgex_access"
MAX_SINGLE_OBJ=5* 1024 * 1024 * 1024 #... |
import sys
import pickle
from datetime import datetime
import numpy as np
import json
import torch
import argparse
import glob
import os
import deepbiosphere.scripts.GEOCLEF_Utils as utils
from types import SimpleNamespace
paths = {
'DBS_DIR' : "/Carnegie/DPB/Data/Shared/Labs/Moi/Everyone/deepbiosphere/GeoCELF202... |
"""
Title:
anylogo.py
Creation Date:
2017-07-31
Author(s):
<NAME>
Purpose:
This file contains a variety of functions used to generate sequence logos.
License: MIT
Copyright (c) 2017 <NAME> group @ California Institute of Technology
Permission is hereby granted, free of charge, to any person ob... |
""" Module for synthetic and real datasets with available ground truth decision rule explanations. Also contains
methods and classes for decisionRule data manipulation.
All of the datasets must be instanced first. Then, when sliced, they all return the observations, labels and ground
truth explanations, respectively. ... |
import discord
import requests
import shutil
import urbandict
import os
import asyncio
import pytz
from datetime import datetime
from discord.ext import commands
from discord.ext.commands import command, cooldown, BucketType, has_permissions, bot_has_permissions
from utils import colors, checks
del_msg = {}
edit_ms... |
## @package pedaling
from __future__ import print_function
#roslaunch kindyn robot.launch robot_name:=rikshaw model_name:=rikshaw start_controllers:='joint_hip_right joint_knee_right joint_foot_right joint_hip_left joint_knee_left joint_foot_left joint_pedal'
#roslaunch kindyn robot.launch robot_name:=rikshaw start_... |
import json
import random
import imageio
import os
import argparse
import time
import numpy as np
import tensorflow as tf
from scipy import misc
import utils
from ops import *
import sys
from generate_gif import *
BOOL_LABEL=3
def load_dataset(dataset_file, min_group_size, max_jpgs=-1):
with open(dataset_file) as ... |
"""Creates various Sklearn models"""
import math
import pickle
import keras
from keras import backend as K
from keras.callbacks import EarlyStopping
from keras.callbacks import History
from keras.callbacks import ReduceLROnPlateau
from keras.engine.topology import Layer
from keras.layers import AveragePooling2D
from... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 16 11:42:57 2015
@author: jmilli
"""
import sys
from sympy import Symbol, nsolve
import math
import numpy as np
import matplotlib.pyplot as plt
#from scipy import ndimage
sys.path.append('/Users/jmilli/Dropbox/lib_py/image_utilities')
import rotation_images as rot
fro... |
from typing import List
import glob
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
from tkinter import font as tkfont
import bs4
import os
import re
import time
main_dir = os.path.expanduser('~/.local/share/keeper')
notes_dir = os.path.join(main_dir, 'notes')
main_background_color ... |
# pip install git+https://github.com/alberanid/imdbpy
# pip install imdbpy
from imdb import IMDb, IMDbDataAccessError
import pandas as pd
import time
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
import ast
from collections import defaultdict
import multiprocessing
dct_no_entries = defaultdict(int... |
"""Contains functions that are shared across Iguanas modules."""
from iguanas.utils.types import KoalasDataFrame, KoalasSeries, PandasDataFrame, \
PandasSeries
from iguanas.utils.typing import KoalasDataFrameType, KoalasSeriesType, \
PandasDataFrameType, PandasSeriesType, PySparkDataFrameType
import pandas as p... |
import os, sys
sys.path.append(os.getcwd())
import time
import numpy as np
import tensorflow as tf
import language_helpers
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv1d
import tflib.plot
BN_SCALE = False
def make_noise(shape):
return tf.random_normal(shape)
def l2norm(x, axis=[1,2]):
... |
# HitCounter
class HitCounter(object):
def __init__(self):
"""
Initialize your data structure here.
"""
from collections import deque
self.num_of_hits = 0
self.time_hits = deque()
def hit(self, timestamp):
"""
Record a hit.
... |
import pandas as pd
import numpy as np
from datetime import datetime
from .mappings import map_registryCode_inv, map_account_type_inv, map_unitType_inv, export_mappings
import os
import glob
# account information added by hand
NEW_ACC = [{"accountIDEutl": 111264,
"name": "EU Credit Exchange Account - Avi... |
#**************************************************************************#
# This file is part of pymsc which is released under MIT License. See file #
# LICENSE or go to https://github.com/jam1garner/pymsc/blob/master/LICENSE #
# for full license details. #
#***********... |
"""
Copyright 2016
Author: <NAME> <<EMAIL>>
This is a module intended to be used as client to Freesound's API
see http://www.freesound.org/docs/api/
Note: You need your own client secret to work with the API.
You can request one at http://www.freesound.org/apiv2.
The doctest will not work until you specify your own ... |
from Sequences.NiceErrorChecking import require_integers, require_geq, require_prime
from Sequences.Divisibility.Primes import primes, blum_primes
from Sequences.Simple import naturals, arithmetic
from Sequences.MathUtils import factors, prime_factorization, unique_prime_factors, \
nth_s... |
import copy
import math
from datetime import timedelta
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib.lines import Line2D
from scipy.stats import entropy
from utils.generic.enums.columns import compartments
from utils.generic.stats import get_param_stats, ... |
# Copyright 2017, The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
import itertools
import json
import operator
import pathlib
import pickle
import random
import shutil
from zplib import datafile
class _DataclassBase:
"""Basic methods for "data classes" that have a defined set of fields with
which to compare and hash class instances."""
_FIELDS = () # subclasses should p... |
# vim: set expandtab shiftwidth=4 tabstop=4:
#
# Copyright 2017 Red Hat, Inc.
#
# 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 ... |
# coding=utf-8
"""Multifuture inferencing."""
import argparse
import json
import os
#import cPickle as pickle
import pickle
import numpy as np
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# the following will still have colocation debug info
tf.compat.v1.logging.set_verbosity(tf.compat.v1.loggin... |
# Generic imports
import itertools
from abc import ABC, abstractmethod
from copy import deepcopy
import time
from collections import defaultdict
# torch and numpy
import numpy as np
import torch
import torch.nn.functional as F
# gym stuff
from spinup.utils.minigrid_utils import make_simple_env
from spinup.utils.run_u... |
# -*- coding: utf-8 -*-
'''
Created on : Thursday 18 Jun, 2020 : 00:47:36
Last Modified : Sunday 22 Aug, 2021 : 23:52:53
@author : Adapted by <NAME> from Original ASAP Pooling Code
Institute : Carnegie Mellon University
'''
import torch
import numpy as np
import torch.nn.functional as F
from torch.nn import... |
# -*- encoding: utf-8 -*-
from __future__ import print_function
import sys
from copy import deepcopy
from collections import defaultdict
from itertools import chain, izip
import jsparser
def pairs(iterable):
it = iter(iterable)
e1 = next(it)
for e2 in it:
yield e1, e2
e1 = e2
def ch... |
# -*- coding: utf-8 -*-
"""
Created on 19 Mar 2020 23:41:27
@author: jiahuei
tensorflow.contrib.layers.python.layers.layers
"""
import functools
import six
from common.mask_prune.masked_layer_v4 import generate_masks, MaskedDense
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.contr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Utility functions for the evaluation of trigger word detection models.
This module contains fuctions to evaluate the performances of models created
with modules model_single and model_multi.
Todo:
* Implement statistics about peak shift and predicted peak length i... |
#!/usr/bin/env python
import astropy.io.fits as pyfits
import os
import glob
import numpy as np
import math
import copy
from pkg_resources import resource_filename
#import barycenter
import onlyreadfilterbank as fr2
import filterbank as fr
import logging
logger = logging.getLogger(__name__)
import pdb;# pdb.set_trac... |
# coding=utf8
import os
import re
import tqdm
import collections
import TextUtils
import bs4
from collections import Counter
import jieba
import random
from bs4 import BeautifulSoup
import time
import multiprocessing as mp
import tableParser
import asyncio
from aiofile import AIOFile, Reader, Writer
import aiofiles
jie... |
from collections import defaultdict
import copy, os, math, pickle, random, time, xgboost, json, re
import networkx as nx
import numpy as np
from xgboost import XGBClassifier
from multiprocessing import Process, Queue
import multiprocessing
class Model_Sample(object):
def __init__(self):
self.in_f... |
from scipy.optimize import root
import numpy as np
import cantera as ct
import pandas as pd
from solventx import result_struct as rs
from solventx import utilities
from solventx import config
import operator
import os
class solventx:
coltypes = ['Extraction','Scrub','Strip']
ml2l ... |
from random import *
from math import *
deg_to_rad = 0.01745329252
rad_to_deg = 57.2957795131
def EquipLoadout(UI, loadout):
UI.EquipLoadout(loadout)
def AutoConfigurePlatform(UI, setupName):
UI.AutoConfigurePlatform(setupName)
def MovePlatform(UI, lon, lat):
UI.MovePlatform(lon,... |
from flask import g
from libs.extensions import Extension
import pandas as pd
from settings.gdxf.extensions.mylv.base_sql_map import get_base_sql_map
from utils.qh_processor import get_qh_level
DEBUG = False
def get_sql_map(flag):
if flag:
base_sql_map = {
"1-1-全": "1_2",
}
else... |
import glob
from shutil import copy2
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import pprint
import pandas as pd
import plotly.express as px
from plotly.subplots import make_subplots
prompt = lambda q : input("{} (y/n): ".format(q)).lower().strip()[:1] == "y"
def parse_log(filename, para... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# coding=utf-8
"""
All commands that call the Google API service.
"""
from __future__ import absolute_import
from __future__ import print_function
import re
import sys
from datetime import datetime, timedelta
import dateutil.parser
from googleapiclient.errors import HttpError
from ..connection import connect
from ..c... |
# Copyright 2021 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... |
# fmt: off
import h5py
import os
import shutil
import copy
import h5py_cache
import pickle as pkl
import numpy as np
import pandas as pd
import ipywidgets as ipyw
from nd2reader import ND2Reader
from tifffile import imsave, imread
from .utils import pandas_hdf5_handler,writedir
from parse import compile
class hdf5_fo... |
#!/usr/bin/python3
import sys
from sys import argv, exit, stderr
import os
import nbformat as nbf
import yaml
from collections import OrderedDict
import numpy as np
import re, ast
def represent_dictionary_order(self, dict_data):
return self.represent_mapping('tag:yaml.org,2002:map', dict_data.items())
def setup_y... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 11:03:06 2018
@author: anonymous
"""
from math import isclose
import itertools
import random
from vizdoom import DoomGame, ScreenResolution, GameVariable, Button, AutomapMode, Mode, doom_fixed_to_double
import numpy as np
from cv2 import resize
i... |
from manim_imports_ext import *
from _2018.lost_lecture import ShowWord
from _2019.clacks.solution2.mirror_scenes import ReflectWorldThroughMirrorNew
from _2019.clacks.question import Thumbnail
class WrapperScene(Scene):
CONFIG = {
"title": "Title",
"shade_of_grey": "#333333"
}
def constr... |
import tensorflow as tf
from mtg.ml import nn
from mtg.ml.layers import Embedding
import numpy as np
import pathlib
import os
import pickle
from mtg.ml.utils import CustomSchedule
class DraftBot(tf.Module):
"""
Custom Tensorflow Model for Magic: the Gathering Draft AI
This algorithm is a transformer that... |
import json
import logging
import re
import time
import os
from threading import Semaphore, Thread, current_thread
try:
from bs4 import BeautifulSoup
import requests
inited = 1
except ImportError:
inited = 0
try:
import vim
except ImportError:
vim = None
LC_BASE = os.environ['LEETCODE_BASE_U... |
# Copyright 2018 The TensorFlow Probability 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 o... |
#importing some useful packages
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
from moviepy.editor import VideoFileClip
import pickle
########################################
def show_image(img,bin_img,desc=''):
f, (ax1, ax2) = plt.subplots(1, 2,... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
import types
from enterprise.signals import parameter
from enterprise.signals import selections
from enterprise.signals import white_signals
from enterprise.signals im... |
"""
Visitor hierarchy to inspect and/or create IETs.
The main Visitor class is adapted from https://github.com/coneoproject/COFFEE.
"""
from collections import OrderedDict
from collections.abc import Iterable
import cgen as c
from devito.exceptions import VisitorException
from devito.ir.iet.nodes import Node, Itera... |
## Copyright 2017 Knossos authors, see NOTICE file
##
## 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... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""Queries the pytorch op registry and generates ODS and CC sourc... |
import csv
import json
import re
import sys
import pickle
import itertools
import logging
import path
from cxcircuits.parse_arborization import NeuronArborizationParser
import numpy as np
import numpy as np
from pyorient.ogm import Graph, Config
import neuroarch.models as models
import neuroarch.query as query
impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.