text stringlengths 3.07k 22.1k |
|---|
from IPython import embed as shell
import itertools
import numpy as np
import random
import core.util_classes.hsr_constants as const
# SEED = 1234
NUM_PROBS = 1
NUM_OBJS = 1
NUM_SYMBOLS = NUM_OBJS
# filename = "hsr_probs/hsr.prob"
GOAL = "(HSRRobotAt hsr robot_end_pose)"
HSR_INIT_POSE = [0, 0, 0]
HSR_INIT_ARM = [0,... |
from Reload import reloadable
import State
import Config
import socket, select, random, time
def encode(value):
if isinstance(value, str):
return bytes(value, "utf_8")
else:
return value
@reloadable
class Source:
def __init__(self, nick = None, user = None, host = None):
self.nick... |
import os
import random
import string
import sqlite3
#from pwn import *
def gen_int2hex_map():
conn.execute("CREATE TABLE hex_map (int INTEGER, val BLOB);")
for i in range(256):
conn.execute("INSERT INTO hex_map VALUES ({}, x'{}');".format(i, ''.join('%02x' % i)))
def math_with_const(output_view, ta... |
import os
import sys
import numpy as np
sys.path.append('../mots_tools')
import pycocotools.mask as rletools
from detectron2.utils.colormap import random_color
class TrackingInfo(object):
def __init__(self, x, y, z=None, mask=None, color=None, track_id=None, survival=2): # destroyed after 2 frame
if z ... |
import numpy as np
def find_similar_points(arr, elem, tols, input_dim=None):
if input_dim is None:
input_dim = arr.shape[1]
arr = arr[:, :input_dim]
elem = elem.reshape(-1)
bls = np.zeros(len(arr), dtype=bool)
for i in range(arr.shape[1]):
bls = np.logical_or(bls, (abs(arr[:, i] - e... |
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import codecs
import enum
import logging
import re
import time
import serial
# Timeout for the unresponding serial console.
SERIAL_CONSOLE_TIMEOUT = 1
#... |
# Copyright 2020 Google LLC
# Copyright 2020 EPAM Systems
#
# 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 appl... |
from sqlalchemy.orm import Session
from sqlalchemy import desc
from typing import List, Dict, Union, Any, Tuple
from datetime import datetime, timedelta
from fastapi import Form, Header
import uuid
import os
import enum
import jwt
from app.database import models, schemas
from app.database.base import get_db
from app ... |
# 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 u... |
#-----------------------------------------------------------------------------------------------------------
# from _testing import C
# from _testing import debug
# from _testing import urge
# from _testing import help
# from typing import NamedTuple
from typing import Union
from typing import Tuple
from typing impor... |
from fastai import *
from fastai.tabular import *
from fastai.tabular.all import *
import torch
import torch.nn.utils.prune
import random
def _LT_find_linear(layers):
# find linear in layer
linear = None
for l in layers:
if isinstance(l, torch.nn.Linear):
return l
... |
import sys
import os
import re
import argparse
from sox import file_info
import json
import Levenshtein
import subprocess
import time
import signal
# poor-man's norm
def norm(txtin):
# remove things in parentheses
txtout = re.sub(r'\([^\)]+\)','',txtin)
# remove tags
txtout = re.sub(r'FILLEDPAUSE\_','', txt... |
__all__ = [
'Event',
'EventLog'
]
import itertools
import time
from collections import deque
from copy import deepcopy
from datetime import datetime
from typing import Optional, List, Iterable, Union, Sequence
from .common import DocValue
from .enum import VerifyMode, PassageDirection, EVENT_TYPES
from .sdk im... |
import re
import pytest
from pyquery import PyQuery
from scripts.helpers import serialize_xml, parse_xml
from scripts.generate_case_html import generate_html, tag_map
from scripts.merge_alto_style import generate_styled_case_xml
from scripts.compare_alto_case import validate
from capdb.models import CaseXML, CaseMetad... |
# howtographql-graphene-tutorial-fixed -- links/schema.py
#
# Copyright © 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 th... |
import re
import json
import os
import urllib.request
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from tika import parser
# "Borrowed" from https://www.peterbe.com/plog/best-practice-with-retries-with-requests
def requests_retry_session(
retrie... |
import math
import numpy as np
import torch
from torch.utils.data import Sampler
from torch.optim.lr_scheduler import LambdaLR
from typing import Optional
class SortishSampler(Sampler):
"Go through the text data by order of src length with a bit of randomness. From fastai repo."
def __init__(self, data, batc... |
"""
Module A_star.py
============
This module contains Pathfinding A-STAR ALGORITHM FOR AI
"""
__version__ = '1.0'
__author__ = '<NAME>'
class Node():
"""
Class Method :
A node class for A* Pathfinding
"""
def __init__(self, parent=None, position=None):
"""
Initialize self
... |
"""
Provides an interface to CUDA for running the parallel IBDTW and
partial IBDTW algorithms
"""
import pycuda.autoinit
import pycuda.driver as drv
import pycuda.gpuarray as gpuarray
import pycuda.cumath
import numpy as np
import matplotlib.pyplot as plt
import time
import scipy.io as sio
import pkg_resources
import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2008 <NAME> <<EMAIL>>
#
# This file is part of the Bobcat program.
#
# Bobcat is free software; you can use it, redistribute it and/or modify it
# under the terms of the MIT license.
#
# You should have received a copy of the MIT license with ... |
import sublime
import sublime_plugin
import subprocess
import os
import sys
import json
import webbrowser
import urllib
from threading import Timer
STATUS_BAR_KEY = '(.0.travis-ci-status'
SYMBOLS = {
'passed': u'passed ✔︎',
'created': u'created',
'starting': u'starting...',
'started': u'in progress...',
'fa... |
import os
# Dữ liệu nằm ở E:\VLSP\VLSP-2021\Statistic\annotation
# Trong đó bao gồm các folder là tên file gốc (....conll)
def process_case_3(data):
# print("trước khi")
seg = "<ENAMEX TYPE=\"" + data[0][4][:data[0][4].find('[')] + "\">"
for i in range(len(data)):
if '|' in data[i][3]:
... |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... |
""" Junk code from developing the method which might come in handy later.
"""
################################################################################
# Old version of run from analysis.py #
################################################################################
import os
import numpy ... |
#!/usr/bin/env python3
import fitsio
import matplotlib
matplotlib.use('Agg')
import pylab as plt
import numpy as np
from glob import glob
from collections import Counter
from astrometry.util.util import Sip, Tan
import os
import json
from astrometry.util.fits import fits_table
from astrometry.util.starutil_numpy impor... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from pathlib import Path
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from copy import copy
from collections import Counter
from sklearn.model_selection import train_test_split
from sklearn.model_selection import Stratified... |
# ------------------------------------------------------------------------
# Hourglass network
# Written accoring to Bearpaw Pytorch Pose
# Written by Lin (NJUST)
# ------------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __fut... |
from datetime import datetime
import pandas as pd
from more_itertools import flatten
from utils import format_generalization
def gen_dict(anonymization, dom_values_enum):
def f(x):
for idx in range(len(anonymization) - 1):
if anonymization[idx] <= x < anonymization[idx + 1]:
... |
from turtle import *
import random
colorpallet = ["red" ,"green","blue" ,"yellow","orange","lightblue" ,"magenta","violet"
,"brown","cyan" ,"pink" ,"white" ,"maroon","lightgreen","gold" ,"silver"
,"black" ]
w = Screen()
w.bgcolor("black")
w.tracer(0)
w.setup(1200,700)
Player... |
'''Coq views.'''
from collections import namedtuple
import logging
from threading import Lock
logger = logging.getLogger(__name__) # pylint: disable=C0103
_MatchArg = namedtuple('_MatchArg', 'start stop type')
class _Task:
'''A cancellable task.'''
def __init__(self, func, args, kwargs):
... |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
from dataclasses import dataclass
from typing import TYPE_CHECKING, Iterable, Iterator
from pants.backend.python.pip_requirement import ... |
#!/usr/bin/env python3
"""
Convert md.md and rst.rst into useful output and comparisons.
"""
import re
import textwrap
import docutils.core
import markdown2
from docutils.writers.html4css1 import Writer, HTMLTranslator
class Buffer:
def __init__(self):
self.buffer = []
def append(self, text):
... |
#!"C:\Users\Satan\Informatica\Python\sci-env\Scripts\python.exe"
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 17 19:30:17 2018
@author: Stan
This module defines and models the network. It contains a list of nodes and can
graphically represent those.
Requirements:
- Energy consumption: star network?... |
#!/usr/bin/env python
# coding: utf-8
import os
import ee
import datetime
import tqdm
import json
import pandas as pd
import geopandas as gp
import numpy as np
import rsfuncs as rs
import multiprocessing as mp
import scipy.interpolate as interp
import matplotlib.pyplot as plt
from tqdm import tqdm
from tqdm.contrib... |
"""**********************************************************************************************
* Home Assistant Bridge (Current Version: 20180512)
* *************************************************
* Created by <NAME>
* GitHub: https://github.com/TomerFi
* YouTube: https://www.youtube.com/channel/UCH9z4dabjTo-... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... |
from __future__ import print_function
import os
import re
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_cm
import matplotlib.colors as colors
from matplotlib import ticker
from collections import namedtuple
from typing import List
from scipy.signal import s... |
import warnings
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sqlalchemy import create_engine
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer, TfidfVectorizer
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords, w... |
from turtle import *
import tkinter.messagebox
import tkinter
import random
import math
import datetime
import time
import sys
screenMin = 0
screenMax = 300
Human = -1
Computer = 1
class Board:
def __init__(self, board=None, screen=None):
self.screen = screen
if screen == None:
if... |
# Copyright (c) 2014 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
"""
Code Written by ~KK~
To Automate the boring process of renaming files for your TV Shows library
Useful for organising bulk media files or frequent updation of
your XBMC library (Like Kodi, Plex and OSMC)
"""
import os
import re
import msvcrt
import shutil
import getopt
import sys
from imdb import IMDb
from ... |
#! /usr/bin/env python
# Copyright (c) 2000 <NAME>
# See the file COPYING for more information
import sys
from time import localtime, time, mktime
import weakref
from SQLRelay import CSQLRelay
apilevel='2.0'
threadsafety=1
paramstyle='named'
class Error(Exception):
pass
class Warning(Exception):
pass
cl... |
# -*- coding: utf-8 -*-
"""
A 2.5D network combining 3D convolutions with 2D convolutions according to the following paper:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>:
Automatic Segmentation of Vestibular Schwannoma from T2-Weighted MRI by Deep Spatial Attention
... |
"""
Something to store UGC information!
"""
# stdlib
import re
import datetime
from collections import OrderedDict
# third party
import pandas as pd
from pandas.io.sql import read_sql
# local
from pyiem.util import utc, get_dbconn
from pyiem.exceptions import UGCParseException
UGC_RE = re.compile(
r"^(([A-Z]?[A... |
#!/usr/bin/env python3
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
try:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
except:
# Invalid device or cannot modify virtual devices once initialized.
pass
import numpy as np
import os, time, csv, copy
i... |
"""
Possible candidates to replace this method:
cython, have tests, poor pep8
use cystatsd
https://github.com/scivey/aiostatsd
probably dont work https://github.com/scivey/aiostatsd/issues/1
another poor example
https://gist.github.com/baverman/fc0eee788ca204d8e34ee6ff3d0be2e5
not async
https://github.com/qntln/fast... |
import numpy as np
import os
import shutil
def prepare_xs(constants):
'''
This function prepares the cross-sections and outputs a dictionary
with all the information required by Cerberus.
Parameters:
----------
constants: [dictionary]
cross-section data
primary keys: name of t... |
from datetime import date
from json import loads
from unittest.mock import patch
from django.core.cache import cache
from django.shortcuts import resolve_url
from django.test import TestCase
from jarbas.core.models import Reimbursement
from jarbas.core.tests import sample_reimbursement_data, suspicions
class TestLi... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'homeway'
__copyright__ = 'Copyright © 2022/04/12, homeway'
import os
import os.path as osp
import sys
import inspect
import copy
import numpy as np
import torch
from tqdm import tqdm
from multiprocessing import Process
currentdir = os.path.dirname(os.path.a... |
import io
import os
import re
import tarfile
import traceback
from contextlib import asynccontextmanager
from typing import AsyncGenerator, AsyncIterator
import aiodocker
from aiodocker import DockerError
from aiodocker.stream import Stream
from cuwais.config import config_file
from runner.config import ... |
import json
import os
from typing import Dict, Optional
import pandas as pd
from fastapi import FastAPI, status, Request, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, HTMLResponse
from app.data import MongoDB
from app.graphs import tech_stack_by_role
fro... |
from controller import Robot
from controller import LED
robot = Robot()
timestep = int(robot.getBasicTimeStep())
motor_list = ["front_right_motor", "front_left_motor", "rear_right_motor", "rear_left_motor"]
sensor_list = ["st_right","st_left","rod_center_ir", "rod_right_ir", "rod_left_ir",
"rod_ext_... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 11 06:29:13 2021
#TODO: Add Description
@author: <NAME>
"""
import random
from math import ceil
import networkx as nx
from matplotlib import pyplot as plt
from multipledispatch import dispatch
from collections.abc import Iterable
# TODO: find alternative to this quick ha... |
"""Utilities for the management of webserver directories."""
import os
import re
import shutil
from collections import defaultdict
from hashlib import sha256
from shutil import rmtree, copyfile
import csv
import datetime
from influxdb import InfluxDBClient
from gen_configs import read_addr
from scoring.score_run impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 23 17:30:26 2018
@author: <NAME>
"""
from ..core_types import *
import os
import numpy as np
__all__ = [
'read_pdb', 'write_pdb'
]
def read_pdb(filename, pbc=False):
'''
Routine for reading .pdb files.
Specifically works for ato... |
"""
For an explanation of the algorithm see
http://dalkescientific.com/writings/diary/archive/2011/01/10/subgraph_enumeration.html
"""
from itertools import chain, product
#######
class Subgraph(object):
def __init__(self, atoms, bonds):
self.atoms = atoms
self.bonds = bonds
def get_nbr(ia, b)... |
#!/usr/bin/python
# vim: noai:ts=4:sw=4:expandtab
import asyncio
import base64
import collections
from enum import Enum
import json
import quotefeedprovider_pb2
import requests
import ssl
import sys
import signal
import time
from typing import Tuple
import websockets
try:
import unicornhat as unicorn
print("U... |
#!/usr/bin/python
# _*_ coding: utf-8 _*_
"""
根据筛选的段落,计算 start,end 下标
@author: <NAME>, <EMAIL>
@github: https://github.com/sunnymarkLiu
@time : 2019/9/6 16:39
"""
import sys
sys.path.append('../')
import re
import json
import numpy as np
from utils.rouge import RougeL
ans_pattern = re.compile(r'@content\d@')
def... |
# -*- coding: utf-8 -*-
"""
obspy.core.event.magnitude - The Magnitude class definition
===========================================================
This module provides a class hierarchy to consistently handle event metadata.
This class hierarchy is closely modelled after the de-facto standard format
`QuakeML <https://... |
'''
Created on 25 jul. 2018
@author: isanlui
'''
import json
import os
from pttapi.apimanager.authptt import authptt
from pttapi.utils.files import ensure_dir
from pttapi.utils.log import mylogging
import requests
def makeRequestException(description,requestreturn):
if requestreturn is not None:
... |
from flask import Flask
from flask import request
from flask import jsonify
import joblib
import csv
import requests
import json
import pickle
from Models.crop_class import *
from Models.production_class import *
import numpy as np
app = Flask(__name__)
scale_val = 0.1
month_dict = {
'JAN': 0,
'FEB': 1,
'... |
# Copyright (c) 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import heapq
import numpy as np
import tensorflow as tf
class Word2VecModel(object):
"""Word2VecModel.
"""
def __init__(self, arch, algm, embed_size, batch_size, negatives, power,
alpha, min_alpha, add_bias, random_seed):
"""Constructor.
Args:
arch: string scal... |
# -*- coding: utf-8 -*-
"""This module contains all the constants used in the PathwayForte repo."""
import logging
import os
import time
from bio2bel import get_data_dir
logger = logging.getLogger(__name__)
dir_path = os.path.dirname(os.path.realpath(__file__))
SOURCE = os.path.join(os.path.abspath(os.path.join(di... |
from keras.models import Model
from keras.layers import Input, merge
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.layers.core import Dropout
from keras.regularizers import l2
from layers.ourlayers import CropLayer2D, NdSoftmax
from layers.deconv import Deconvolution2D
fro... |
"""
Modified from https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_envs/bullet/cartpole_bullet.py
URDF: https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_data/cartpole.urdf
"""
from src import *
import logging
import time
from PIL import Image
impor... |
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal
from MyAIGuide.utilities.dataFrameUtilities import (
subset_period,
insert_data_to_tracker_mean_steps,
adjust_var_and_place_in_data,
insert_rolling_mean_columns,
insert_relative_values_columns
)
def create_test_da... |
"""
Copyright (c) 2018, Salesforce.com, 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 copyright notice, this list of conditions and the foll... |
from collections import defaultdict
from functools import reduce
import numpy as np
import pandas as pd
from nltk import word_tokenize
from fuzzywuzzy import fuzz
import hybrid_search_engine
from hybrid_search_engine.utils import text_processing as processing
from hybrid_search_engine.utils.exceptions import SearchEn... |
import re
import ctypes
from typing import Tuple, Optional
import torch
import numpy as np
from dqc.hamilton.intor.lcintwrap import LibcintWrapper
from dqc.hamilton.intor.utils import np2ctypes, int2ctypes, NDIM, CGTO
from dqc.hamilton.intor.pbcintor import _get_default_kpts, _get_default_options, PBCIntOption
from dqc... |
#!/usr/bin/python2.7
# Copyright 2012 Room77, Inc.
# Author: <NAME>
import os
import sys
import re
import argparse
import datetime
import json
import string
class Pager:
"""
Cronable pager script for alerts. Monitors emails send to specified address.
For each email with a subject that matches the criteria, mo... |
#!/usr/bin/python
import csv
import xml.etree.ElementTree as elementTree
import os
import sys
import shutil
import subprocess
import pdfpagetojpg
# ##########################################
# Build the xml file using the MODS classes
# ##########################################
def build_page_xml(row, template, ou... |
# https://deeplearningcourses.com/c/deep-reinforcement-learning-in-python
# https://www.udemy.com/deep-reinforcement-learning-in-python
from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U future
import copy
import gym
im... |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.encoding import force_unicode
from ffclub.base import admin
from django.contrib.admin import ModelAdmin, StackedInline, TabularInline
from django.contrib.admin.uti... |
"""
Implementation of PointNet++.
See https://github.com/yanx27/Pointnet_Pointnet2_pytorch.
CODE NEEDS TO BE CLEARED!
"""
import torch.nn as nn
import torch.nn.functional as F
import torch
import ipdb
st = ipdb.set_trace
def square_distance(src, dst):
"""
Calculate Euclidean distance between each two points.... |
#!/usr/bin/env python
# coding: utf-8
#
# <a href="https://colab.research.google.com/github/aviadr1/learn-advanced-python/blob/master/content/01_refresher/notebooks/refresher.ipynb" target="_blank">
# <img src="https://colab.research.google.com/assets/colab-badge.svg"
# title="Open this file in Google Colab" al... |
import argparse
from typing import Any, Dict, List
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.ops import roi_align
from torchvision.transforms.functional import (InterpolationMode, center_crop,
resized_crop)
from torchvision.transf... |
"""Dashborad views."""
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from wallet.models import Transaction
from scheduler.models import BookingRecord, Session
from account.mode... |
"""View functions for RandoPony site register app.
"""
# Standard library:
from datetime import datetime
from datetime import timedelta
# Django:
from django.conf import settings
from django.http import Http404
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.shortcuts imp... |
bl_info = {
"name": "Import RBDOOM-3-BFG JSON map format (.json)",
"author": "<NAME>",
"version": (2, 7),
"blender": (2, 65, 4),
"location": "File > Import > Doom 3 Map (.json)",
"description": "Imports a Doom 3 map that uses the RBDOOM-3-BFG .json format",
"warning": "",
"wiki_url": "",... |
# 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... |
import json
import os
import requests
from bs4 import BeautifulSoup
import Globals
class CustomJSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ComicStripInfo):
return o.__dict__
super().default(self, o)
def decode_object(o):
data = ComicStripInfo()
da... |
import datetime
import hashlib
import json
import os
import shutil
import numpy as np
from os import listdir
import calendar
from flask import safe_join
import app.controller.MySqlUtil as DBUtil
import app.controller.FileUtil as FileUtil
import app.controller.Utils as Utils
import config
from app.controller import Co... |
from __future__ import annotations
import argparse
import colorama
from dataclasses import dataclass
from datetime import datetime
from dotenv import load_dotenv
import os
import sys
from typing import Any, Callable
from api import get_cookiejar
from api.api import LeaderboardYear, LeaderboardYearMember
from api.pret... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from copy import deepcopy
import numpy as np
from astropy.table import groups, QTable, Table
from astropy.time import Time, TimeDelta
from astropy import units as u
from astropy.units import Quantity
from .core import TimeSeries
from .... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 13 18:41:38 2021
@author: divyoj
"""
## importing libraries:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.animation import FuncAnimation
import os
# # note that this must be executed before 'import numba'
# os... |
import numpy as np
import scipy
import scipy.stats
from threadpoolctl import threadpool_limits
import ctypes
import collections
import irec.offline_experiments.metrics.utils as metrics
from tqdm import tqdm
from irec.utils.utils import run_parallel
from irec.recommendation.matrix_factorization.MF import MF
from numba ... |
# Author : <NAME>
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import argparse
import optparse
import subprocess
import random
import numpy as np
from time import sleep
from generate_network import generate_route, generate_detectors, generate_cfg, initial_netfile
fr... |
#!/usr/bin/env python
import logging
import os
import re
import shlex
import sys
import time
from htsworkflow.util import mount
from htsworkflow.automation.solexa import is_runfolder, get_top_dir
# this uses pyinotify
import pyinotify
from pyinotify import EventsCodes
IN_CREATE = EventsCodes.ALL_FLAGS['IN_CREATE']
IN... |
from __future__ import print_function, absolute_import
import functools
from . import instructions, types, values
_CMP_MAP = {
'>': 'gt',
'<': 'lt',
'==': 'eq',
'!=': 'ne',
'>=': 'ge',
'<=': 'le',
}
def _binop(opname, cls=instructions.Instruction):
def wrap(fn):
@functools.wraps(... |
from .packer import Packer
import time, threading
from .DLError import DLUrlError
from .DLThreadPool import ThreadPool
import queue
from . import DLCommon as cv
from .DLProgress import TimeStatus
class Manager(Packer, object):
def __init__(self, daemon=False, max_task=2):
self.threads = ThreadPool(daem... |
from johnstarich.weather.parse import raw_weather_info
from johnstarich.interval import Interval
from johnstarich.segment import segment, segment_default
weather_status_icons = {
'clear': '☀️',
'clear night': '🌙',
'few clouds': '⛅️',
'few clouds night': '☁️',
'clouds': '☁️',
'rain': '🌧',
... |
"""copy attributes
Revision ID: 35e6ddccd22a
Revises: <PASSWORD>3f2de9<PASSWORD>
Create Date: 2021-09-23 20:35:53.480108
"""
from alembic import op
from sqlalchemy.orm.session import Session
from sqlalchemy import MetaData
from flask_sqlalchemy import SQLAlchemy
# revision identifiers, used by Alembic.
revision = ... |
""" some utilities that didn't fit elsewhere
"""
import ast
import logging
import importlib.util
import html
import os
import stat
import sys
import sysconfig
from distutils.spawn import find_executable
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing im... |
import math
from collections import defaultdict
from itertools import product
from types import FunctionType
from parsing.rule import is_lexical, is_binary, is_unary, is_cat, is_optional, contains_optionals, Rule
from parsing.parse import apply_semantics, Parse
MAX_CELL_CAPACITY = 10000000 # upper bound on number of... |
import argparse
import json
import os
import random
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn
from torch.utils.data import DataLoader
from detection import models, utils, datasets
from detection import trainingtools
from detection.datasets import FathomNetDataset
import logg... |
from __future__ import annotations
import logging
from collections import defaultdict
from dataclasses import dataclass
from abc import ABC, abstractclassmethod, abstractmethod
from typing import (
Any,
Callable,
Generator,
Dict,
Tuple,
List,
Generic,
Iterable,
Optional,
Protoco... |
"""
Test SBlock events and event filters.
"""
# pylint: disable=missing-docstring, no-self-use, protected-access
# pylint: disable=invalid-name, redefined-outer-name, unused-argument, unused-variable
# pylint: disable=wildcard-import, unused-wildcard-import
import pytest
import edzed
from .utils import *
def test... |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... |
import os
import pandas as pd
import numpy as np
import logging
import wget
import time
import pickle
from src.features import preset
from src.features import featurizer
from src.data.utils import LOG
from matminer.data_retrieval.retrieve_MP import MPDataRetrieval
from tqdm import tqdm
from pathlib import Path
from s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.