text stringlengths 3.07k 22.1k |
|---|
import traceback
from eventlet import event
from eventlet import greenthread
from eventlet import queue
from eventlet import semaphore
from eventlet.support import greenlets as greenlet
from eventlet.support import six
__all__ = ['GreenPool', 'GreenPile']
DEBUG = True
class GreenPool(object):
"""The GreenPool ... |
#!/usr/bin/env python
"""
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 t... |
import click
from ..login import cluster_call, login_options
from ..utils import ident_filter
from ..format import format_options
@click.group(short_help='create, delete, info, list, patch, pause, run, runs, unpause',
epilog='Type "ae5 job <command> --help" for help on a specific command.')
@format_opti... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn import preprocessing
from sklearn import neighbors
from sklearn.impute import KNNImputer
##
## META DATA ##
##
data_path = "/home/clairegayral/Documents/openclassroom/data/P5/"
res_path = "/home/c... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""crompersistency.py: Contains the transformation algorithm described in the paper."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2019"
__license__ = "MIT"
__version__ = "1.0.0"
import sys
sys.path.append('../')
from crom import *
class PersistenceAnnotation:
... |
import logging
from datetime import datetime, timezone
from typing import Optional
from pystac import Collection, Item, Link, MediaType
from pystac.extensions.eo import Band, EOExtension
from pystac.extensions.item_assets import ItemAssetsExtension
from pystac.extensions.projection import ProjectionExtension
from pyst... |
# Copyright (c) 2016, the GPyOpt Authors
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from pylab import grid
import matplotlib.pyplot as plt
from pylab import savefig
import pylab
import math
def plot_acquisition(bounds, input_dim, model, Xdata, Ydata, acquisition_function, suggeste... |
#!/usr/bin/python
#
import sys
from math import log10
from matplotlib.path import Path
import wx
from wx.lib.agw import floatspin as fspin
def fix_filename(s):
"""fix string to be a 'good' filename.
This may be a more restrictive than the OS, but
avoids nasty cases."""
badchars = ' <>:"\'\\\t\r\n/|... |
from django.template.defaultfilters import slugify
from django.contrib import messages
from django.shortcuts import redirect
from django.utils.html import format_html
from django.utils import timezone
from datetime import date, datetime
from dateutil.relativedelta import relativedelta, MO
import re
def set_message(... |
import logging
from typing import List
import datetime
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from django.db import transaction
from django_q.tasks import async_task
from rest_framework.decorators import api_vie... |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~~~
General utilities.
:copyright: (c) 2013 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from datetime import datetime
from functools import partial
fro... |
#!python
"""
script which installs all modules,
works on Linux and Windows if the module is
included the list of modules handled by this module
"""
from __future__ import print_function
import sys
import os
import argparse
def get_parser():
"""
defines the way to parse the script ``pymy_install``
"""
... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
import os
import re
import glob
import logging
import urllib.error
from esrally import exceptions
from esrally.utils import git, console, io, process, net, versions, convert
from esrally.exceptions import BuildError, SystemSetupError
logger = logging.getLogger("rally.supplier")
CLEAN_TASK = "clean"
ASSEMBLE_TASK = "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 30 13:43:12 2021
@author: @hk_nien
"""
from multiprocessing import Pool, cpu_count
import random
import pandas as pd
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
import numpy as np
from nl_regions import get_holiday_regions... |
# Copyright 2019 The dm_control 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 or agreed to i... |
from core import *
def glorot_normal(input_size, output_size, fun=None, shape=None):
base = {
'tanh': 6.,
'sigmoid': 6.,
'leaky_relu': 2.,
'relu': 2.,
'prelu': 2.,
'softplus': 2.,
None: 6.
}
stddev = np.sqrt(base[fun] / (input_size + output_size))
... |
import numpy as np
import scipy.signal
'''
Generate a 10 by 10 grid with values between 0 and 1 at each index
Values represent probability of obstacle
'''
def gen_grid(type="curvy"): # TODO remember to change this to three-block for future use
# just for testing, need to come up with many such environments (perha... |
#-*- coding:utf-8 -*-
#
# 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, softwar... |
"""
Generator for C/C++.
"""
# <NAME>: The licensing terms are not set in the source package, but
# pypi[1] says the software is under the MIT license, so I reproduce it here
# [1] http://pypi.python.org/pypi/cgen
#
# Copyright (C) 2008 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a... |
import sys
import pygame
import math
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
YELLOW = (222, 178, 0)
PINK = (225, 96, 253)
BLUE = (0, 0, 255)
LIGHTORANGE = (255, 176, 56)
INTERMEDIARYORANGE = (255, 154, 0)
LIGHTBLUE = (60, 170, 255)
DARKBLUE = (0, 101, 178)
BEIGE = (178, 168, 15... |
import torch
from torch import nn
from lib.nn import ResidualBlock, ResidualGatedBlock
from lib.stochastic import NormalStochasticBlock2d
class TopDownLayer(nn.Module):
"""
Top-down layer, including stochastic sampling, KL computation, and small
deterministic ResNet with upsampling.
The architecture... |
#!/usr/bin/env python3
import sys
import logging
import re
from typing import Tuple
from github import Github
from commit_status_helper import get_commit, post_labels, remove_labels
from env_helper import GITHUB_RUN_URL, GITHUB_REPOSITORY, GITHUB_SERVER_URL
from get_robot_token import get_best_robot_token
from pr_inf... |
'''
Plots for my first-year (and beyond) figurative violence in the media project.
Author: <NAME> <<EMAIL>>
Date: April 01, 2017
'''
import matplotlib.pyplot as plt
import matplotlib.dates as pltdates
import pandas as pd
import seaborn as sns
from datetime import date, datetime, timedelta
from .analysis import rela... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
import discord
import ast
import math
from discord.ext import commands
import platform
import psutil
from EZPaginator import Paginator
from bot.utils.misc import footer
from bot import LOGGER, OWNERS, color_code, BOT_NAME_TAG_VER, EXTENSIONS
def insert_returns(body):
if isinstance(body[-1], ast.Expr... |
import os
import re
import time
import math
import warnings
import numpy as np
import pandas as pd
import json
import geojson
from shapely.geometry import shape
from shapely.geometry import MultiPolygon, Polygon
from shapely.affinity import scale
from shapely.wkt import dumps
from skimage.draw import polygon
from ... |
import sys
import logging
import copy
from datetime import datetime
from dateutil import parser
from croniter import croniter
from reconcile import queries
from reconcile.utils.ocm import OCMMap
from reconcile.utils.state import State
from reconcile.utils.data_structures import get_or_init
from reconcile.utils.semve... |
# Module for querying Aranet sensor data from the Aranet Cloud
# Currently only tested with Aranet CO2 sensors
# Reference: https://www.zabbix.com/la/integrations/aranet
import configparser
import json
import logging
import os
import pandas
import ssl
import time
from typing import Any, Dict, Optional
import urllib.e... |
"""
Utilities for computing per-image evaluations on a FiftyOne dataset using the
Tensorflow Object Detection API.
**Note** importing this module requires an environment variable
`TF_MODELS_RESEARCH` that specifies the path to the
tensorflow [models/research directory](https://github.com/tensorflow/models/tree/master/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ......................................................
# ___
# ____ _ _______/ | ____ ____
# / __ \ | /| / / ___/ /| | / __ \/ __ \
# / /_/ / |/ |/ / / / ___ |/ /_/ / /_/ /
# / .___/|__/|__/_/ /_/ |_/ .___/ .__... |
from mayavi import mlab
from matplotlib import rcParams
from mpl_toolkits.axes_grid1 import make_axes_locatable
import warnings # in order to suppress divide_by_zero warnings...
from sympy import symbols, I, latex, pi, diff
from sympy.functions import Abs, sqrt, exp, cos, sin
from sympy import init_printing
from IPyth... |
# noqa: D100
import logging
import random
from typing import Any, Counter, List, Optional, Tuple, Union
import hail as hl
import pandas as pd
from gnomad.utils.filtering import filter_to_autosomes
logging.basicConfig(format="%(levelname)s (%(name)s %(lineno)s): %(message)s")
logger = logging.getLogger(__name__)
logg... |
import os
import mmap
import urllib.request
import xml.etree.ElementTree as ET
from other.binreader import read_int8
RESULT_DIR = "result"
# CONTENT_URL = "https://fifa21.content.easports.com/fifa/fltOnlineAssets/21D4F1AC-91A3-458D-A64E-895AA6D871D1/2021/"
CONTENT_URL = "https://fifa22.content.easports.com/fifa/fltO... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import keras as k
from keras.layers import Dense, Dropout, Activation, Concatenate
from keras.optimizers import SGD
import os
import argparse
import shutil
import math
... |
__package__ = 'archivebox.core'
import uuid
import json
from pathlib import Path
from typing import Optional, List
from django.db import models
from django.utils.functional import cached_property
from django.utils.text import slugify
from django.core.cache import cache
from django.urls import reverse
from django.db... |
"""
.. currentmodule:: neet
.. testsetup:: network
from neet.boolean import ECA
from neet.boolean.examples import s_pombe
The :mod:`neet` module provides the following abstract network classes from
which all concrete Neet networks inherit:
.. autosummary::
:nosignatures:
Network
UniformNetwork
... |
#!/usr/bin/env python
#
# sync_modules.py
# content-scripts
#
# For details and documentation:
# http://github.com/inkling/content-scripts
#
# Copyright 2015 Inkling Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... |
import os
from ipywidgets import widgets, Layout, IntSlider
import shutil
from helpers import *
# ------------------------------------------------
# Helper functions
# ------------------------------------------------
def listSplit(list1D, n, method):
if method.lower() == 'fillFirst'.lower():
list2D = [list... |
# coding: utf-8
"""
MIT License
Copyright (c) 2018 <NAME> (https://q37.info/s/rmnmqd49)
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... |
#-----------------------------------------------------------------------------
# Copyright (c) 2008 by <NAME>. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
IEEE 64-bit EUI (Extended Uniqu... |
from fractions import Fraction
from pyzx.rules import apply_rule, lcomp, pivot
from .heuristics import get_phase_type, lcomp_heuristic, pivot_heuristic, lcomp_heuristic_boundary, pivot_heuristic_boundary
from pyzx.graph.base import BaseGraph, VT, ET
from typing import Tuple, List
from pyzx.utils import VertexType, Edge... |
#!/usr/bin/env python
import MEArec as mr
from pprint import pprint
from pathlib import Path
from copy import deepcopy
import shutil
import os
import numpy as np
import mlprocessors as mlpr
import multiprocessing
from mountaintools import client as mt
import mtlogging
import random
import spikeextractors as se
@mtlo... |
import numpy as np
from radiobear.constituents import parameters
mbars_to_bars = 0.001
inv_km_to_dB = 4.342945
convert_to_km = 1e-4
To = 300.0
NA = 6.0221415e23 # molecules/mol
M_amu = 8.314472 / 0.46151805 # g/mol
isotope_partition = 0.997317
M_amu_he = 4.0026
M_amu_h2 = 2.01594
data = None
def readI... |
#
# 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, software
# ... |
import random
# roll dice
# decide what to keep
DEBUG=False
def roll_dice(num):
temp = []
for i in range(num):
temp.append(random.randint(1,6))
return temp
def is_qualified(dice):
return 4 in dice and 1 in dice
def total_points(dice):
if not is_qualified(dice)... |
#%%
import numpy as np
import pandas as pd
import tensorflow as tf
import scipy.io
import random
import xgboost as xgb
import seaborn as sns
from tensorflow import keras
from tensorflow.keras import layers
from sklearn.model_selection import train_test_split
from sklearn import metrics, decomposition
import plotly.gra... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 11:51:04 2018
Federate/ephemeris match known confirmed planets hosted
at NExScI with the TCEs. Must be online for the search to
work. Also queries MAST for TIC's that may be near.
@author: <NAME>
"""
import pickle
import numpy as np
import toi... |
import torch
import torch.nn as nn
from torch.distributions import Categorical
import numpy as np
import gym
import lolgym.envs
from pylol.lib import actions, features, point
from pylol.lib import point
from absl import flags
FLAGS = flags.FLAGS
_NO_OP = [actions.FUNCTIONS.no_op.id]
_MOVE = [actions.FU... |
# File :DoPP.py
# Author :WJ
# Function :
# Time :2021/03/13
# Version :
# Amend :
class DoPP:
DATA = []
DATA2 = []
DATA3 = []
MAX = []
MIN = []
max = []
min = []
C = 1
T = 20
W = 0
H = 0
GRID = []
Z = 0
def __init__(sel... |
from __future__ import division
import obspython as obs
import requests, json
from selenium import webdriver
from urllib.parse import urlsplit
import time
import asyncio
import datetime
import random
import websockets
from websocket import create_connection
import re
import sys
from google.cloud import speech
from ... |
# -*- coding: utf-8;-*-
#
# @file storagelocation.py
# @brief coll-gate storage location rest handler
# @author <NAME> (INRA UMR1095)
# @date 2018-03-29
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
from django.db.models import Q, Prefetch
from django.utils import translation
... |
import sys
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
import torchvision
""" Code for the components of the U-Net model is taken from:
https://github.com/milesial/Pytorch-UNet/blob/master/unet/unet_parts.py"""
class DoubleConv(nn.Modul... |
import numpy as np
import cv2
from astropy.io import fits
import pandas as pd
import io
import requests
from bs4 import BeautifulSoup
import warnings
# The aia image size is fixed by the size of the detector. For AIA raw data, this has no reason to change.
aia_image_size = 4096
def scale_rotate(image, angle=0, scal... |
#!/bin/env python
import csv
import numpy
import glob, os
#Numpy can be installed here http://sourceforge.net/projects/numpy/files/NumPy/
names_f = []
names_l = []
Software = []
SensorFusion = []
Perception = []
Prediction = []
Local = []
Path = []
Simulation = []
User = []
Embedded = []
Signals = []
Vehicle = []
... |
#-------------------------------------------------
# csv2graph.py
#
# Copyright (c) 2018, Data PlatForm Center, NIMS
#
# This software is released under the MIT License.
#-------------------------------------------------
# coding: utf-8
#__author__ = "nagao"
__package__ = "M-DaC_XRD/Rigaku_XRD_tools"
__version__ = "1.... |
import numpy as np
import time
import copy
from multiprocessing.pool import ThreadPool
from operator import itemgetter
from scipy.spatial.distance import cdist
from torch.nn.functional import normalize
from torch import Tensor
import torch
import torch.nn.functional as F
from lib.config import cfg
from sampler import... |
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. <NAME> (<EMAIL>),
# Prof. <NAME> (<EMAIL>) and the RMG Team (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of... |
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import sys
import os
import time
import requests
from lxml import etree
from selenium import webdriver
# from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import ElementNotInteractableException
import pymongo
impor... |
# -*- coding: utf-8 -*-
import logging
import time
import requests
from scrapy import signals
from scrapy.exceptions import NotConfigured
from scrapy_redis import connection
from twisted.internet import reactor, task
logger = logging.getLogger(__name__)
class AutoClose(object):
"""
This extensions can stop ... |
import copy
import json
from oic.exception import MessageException
from oic.extension.signed_http_req import SignedHttpRequest, ValidationError
from oic.oic import PREFERENCE2PROVIDER
from oic.oic.provider import Provider
from oic.utils.http_util import Response, Created
from . import OIDCFederationEntity, OIDCFedera... |
#! /usr/bin/env python
import re
import time
import serial
import serial.tools.list_ports
import colorama
from colorama import Fore
colorama.init(autoreset=True)
class Connection:
TIMEOUT = 1
BAUDRATES = [
9600,
38400,
19200,
57600,
115200,
921600
]
... |
from doctest import master
from flask import Flask, render_template,request, redirect, url_for
import time, os, shutil
from picamera import PiCamera
from datetime import datetime, timedelta
from threading import Thread
from pymavlink import mavutil
import csv
import sys
app = Flask(__name__)
app.config['SEND_FILE_MAX... |
# Copyright 2017 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import torch
import numpy as np
from deepflow.mrst_coupling import PytorchMRSTCoupler, load_production_data, load_gradients
from deepflow.storage import create_dataset
from deepflow.utils import set_seed, load_generator, print_header
from deepflow.utils import slerp, get_latent_vector
from deepflow.losses import comp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.interpolate import interp1d, CubicSpline
import copy
import pandas as pd
import datetime
import matplotlib.pyplot as plt
from dcf import dcf_generator, day_range
from derivative import ZeroCouponBond
### Register datetime convert... |
import os
from os.path import join
import torch
from torch import Tensor
import torch.nn as nn
from torch.utils import model_zoo
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet50', 'resnet101']
model_urls = {
'resnet50': 'https://download.pytorch.org/models/resnet50-... |
'''
Created on Oct 14, 2009
@author: bartmosley
'''
from math import exp, log
import bgpy.__QuantLib as ql
from bgpy.QL.bgdate import toDate
from bgpy.QL.tenor import Tenor
FixedPayer = ql.VanillaSwap.Payer
FixedReceiver = ql.VanillaSwap.Receiver
def forwardSpreadDepo(spread_):
'''
Convert ins... |
""" Takes cube objects and formats them for rendering """
import math
import lab_utils as lu
from cube import SquareColor
SPACING = 0.05
FRONT_TRANS = lambda row, col: lu.make_translation(SPACING + col, SPACING + (2 - row), -SPACING)
TOP_TRANS = lambda row, col: lu.make_translation(SPACING + col, 3 - SPACING, -SPACING... |
import os
import datetime
from dateutil.tz import tzlocal
import h5py as h5
import numpy as np
from warp import getselfe, getphi, getb, geta
class FieldDiagnostic(object):
"""
Common functionality for field diagnostic classes
Parameters:
solver: A solver object containing fields to b... |
from __future__ import print_function
import sys, os
import argparse
import json
from random import random
from conrob_pybullet.ss_pybullet.pybullet_tools.utils import connect, disconnect, wait_for_user, LockRenderer, \
has_gui, remove_body, set_camera_pose, get_movable_joints, set_joint_positions, \
wait_for_... |
import os
import time
import torch
import logging
import contextlib
import numpy as np
import torch.nn as nn
import detectron2.utils.comm as comm
from module import FENs
from utils import LossEvalHook, save_config
from data.mapper import generate_mapper_using_cfg
from collections import OrderedDict
from detectron2.en... |
# This dataloader returns images from UCF101 and VISPR for the reconstrunction training for UNet, which will be used as a initialization of any minimax training.
import os
import torch
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import torchvision
from torchvisio... |
# -*- coding: utf-8 -*-
"""
Created on 13/07/2020
@author: <EMAIL>
"""
# Import the required packages
import sabs_pkpd
import matplotlib.pyplot as plt
import numpy as np
import os
# Select the folder in which this repo is downloaded in the line below
os.chdir('The/location/of/the/root/folder/of/this/repo')
# In[Lo... |
"""Module that provides the lowest level data structure: QRegistry.
Data Structures:
QRegistry: Quantum Registry, base of all quantum related operations
Functions:
superposition: join two registries into one by calculating tensor product.
"""
import numpy as np
from qsimov.structures.funmatrix import Funmatr... |
from . import decisions, check
from .decisions import Outcomes
from .decisions.attack_strength import AttackStrength
class Order:
def __init__(self, _id, nation, source):
self.id = _id
self.nation = nation
self.source = source
self.piece = None
self.hold_support_orders = s... |
# -*- coding: utf-8 -*-
"""
Code for markdown/pygments
Code-styling based on code from www.IgnoredByDinosaurs.com
"""
#
# Imports
#
import re
from django import template
import mistune
from mistune_contrib import math
from pygments import highlight
from pygments.util import ClassNotFound
from pygments.lexers i... |
# get all restaurants using Google API and recursive grid to subdivide
# basic imports
import geopy
import geopy.distance
import glob
import json
import math
import os
import sys
import time
import uuid
from custom_wrapper import GooglePlaces, lang # needed to avoid certiain bugs
from extensions import db
from geopy.d... |
import datasets
import pandas as pd
import nltk
import fasttext
import os
from collections import Counter
from multiprocessing import Pool
#!python -m spacy download en_core_web_sm
import en_core_web_sm
import logging
import pathlib
from spacy import displacy
from argparse import ArgumentParser
DOWNLOADS_DIR = os.pat... |
import zlib
import time
import struct
import asyncio
import zipfile
import binascii
from aquavalet.streams.base import BaseStream, MultiStream, StringStream, EmptyStream
from aquavalet.utils import lreplace
# for some reason python3.5 has this as (1 << 31) - 1, which is 0x7fffffff
ZIP64_LIMIT = 0xFFFFFFFF - 1
# Bas... |
# Python imports
from collections import defaultdict, OrderedDict
import datetime
import logging
# 3rd party imports
from django.conf import settings
from django.db import connection
from django.db.models import Count
# Project imports
from libya_elections.utils import ConnectionInTZ
from polling_reports.models impor... |
import itertools
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.models import Model
from keras.layers import Input, Lambda
from . import train
from . import costs
from .layer import stack_layers
from .util import LearningHandler, make_layer_list, train_gen, get_scale
from applica... |
import random
import argparse
import json
from common import EMPTY, AllKeyValueFactory, IntKeyValueFactory
from dictinfo import dump_py_dict
from dict_reimplementation import PyDictReimplementation32, dump_reimpl_dict
from js_reimplementation_interface import Dict32JsImpl, AlmostPythonDictRecyclingJsImpl, AlmostPython... |
# -*- coding:utf8 -*-
""" SAI - Simple Assembly Interpreter """
from string import hexdigits
from .token_type import PUSH, PUSHQ, POP, POPQ, SUB_OP, MOV, MOVL, XOR_OP, AND_OP, CALLQ
from .token_type import SHL_OP, SHR_OP
from .token_type import NOT_OP, NEG_OP
from .token_type import DEC_OP, INC_OP
from .token_type impo... |
import matplotlib.pyplot as plt
import numpy as np
import hsluv
import matplotlib.colors as col
##
class imshow_multiple():
def __init__(self,figsize = (7,7),cmap = 'hot', **kwargs):
'''
Initialize the imshow multiple class which allows to display quantitative figures while keeping the same scale b... |
from dal import autocomplete
from django.db.models import F, Q
from django.http import Http404, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.html import strip_tags
from django.views.generic import DetailView, ListView
from django.views.ge... |
import subprocess
import os.path
import json
import argparse
import pathlib
import logging
import errno
import getpass
import datetime
import time
class LoopDevice:
__lo_name: str = ""
__offset: int = 0
__target: str = ""
__has_setup: bool = False
def __init__(self, target: str, offset: int):
... |
# Copyright (c) 2013 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.
"""Generate minidump symbols for use by the Crash server.
Note: This should be run inside the chroot.
This produces files in the breakpad format req... |
import os
from flask import Flask, request, jsonify
from flask_cors import CORS
from jwt import encode, decode
from jose.exceptions import JWTError
from copy import copy
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String
import json
from test_data.data_generator import surveys, organ... |
import contextlib
import copy
import io
import itertools
import json
import logging
import numpy as np
import os
import pickle
from collections import OrderedDict
import pycocotools.mask as mask_util
import torch
from fvcore.common.file_io import PathManager
from pycocotools.coco import COCO
from tabulate import tabula... |
from graia.broadcast import Broadcast
from graia.application import GraiaMiraiApplication, Session
from graia.application.message.chain import MessageChain
import asyncio
from TiebaApi import *
from tieba_scout import *
from graia.application.message.elements.internal import *
from graia.application.friend import Fri... |
#!/usr/bin/env -S python -u
"""
Test harness creating a test suite, and running it.
@author: <NAME>
@note Initial working model: 1/15/2015
"""
#--- Native python libraries
import os
import re
import sys
import importlib
import traceback
import unittest
from optparse import OptionParser, SUPPRESS_HELP, OptionValueErro... |
"""
One-dimensional relativistic hydro solver supporting homologous mesh motion.
"""
from logging import getLogger
from sailfish.kernel.library import Library
from sailfish.kernel.system import get_array_module, execution_context, num_devices
from sailfish.subdivide import subdivide, concat_on_host
from sailfish.mesh ... |
from typing import Dict, List
import itertools
from mypy.errors import Errors
from mypy.errorcodes import ErrorCode
from mypy.options import Options
from mypy.plugin import FunctionContext, Plugin, CheckerPluginInterface
from mypy.types import Instance, Type, CallableType, TypeVarType
from mypy.nodes import Expression,... |
## parsing.py
# RFC1459 parsing and construction.
import collections
import pydle.protocol
from . import protocol
class RFC1459Message(pydle.protocol.Message):
def __init__(self, command, params, source=None, _raw=None, _valid=True, **kw):
self._kw = kw
self._kw['command'] = command
self._k... |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
import os.path, sys, os, time, csv, random
from os import path
from .forms import DataForm
# Create your views here.
def index(request):
return render(request, 'main.html',{'form': form})
def opt1(request):
if re... |
import torch
import numpy as np
import numpy as np
from scipy.spatial.transform.rotation import Rotation as R, Slerp
from scipy.interpolate.interpolate import interp1d
from slam.common.utils import assert_debug, check_tensor
from slam.common.rotation import torch_euler_to_mat, torch_mat_to_euler, torch_pose_matrix_jac... |
# -*- coding: utf-8 -*-
import pandas
import math
import sys
import os
import re
import numpy as np
import scipy.stats as st
import matplotlib
import matplotlib.pyplot as plt
class turma:
'''
Cria um relatório de notas com base numa planilha eletrônica (e.g., excel)
Argumentos:
* planilh... |
import datetime
import hashlib
import os
import pickle
from enum import Enum
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from openpyxl import load_workbook
from openpyxl.cell import Cell
from openpyxl.utils import... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=no-self-use
# pylint: disable=protected-access
#############################################################
# Copyright (c) 2020-2020 <NAME> #
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.