text stringlengths 6.04k 39.5k |
|---|
from functools import partial, reduce
from itertools import product
from Algs.Exceptions import AlgMetaoperation
def num_to_set(x):
powers = []
i = 1
cnt = 0
while i <= x:
if i & x:
powers.append(cnt)
cnt += 1
i <<= 1
return tuple(powers)
# Unary
def unary... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, veena and contributors
# For license information, please see license.txt
# from __future__ import unicode_literals
# import frappe
# from frappe.model.document import Document
# class RequestCustomerInformation(Document):
# pass
from __future__ import unicode_literals
i... |
"""
Basic atmosphere functions
This dark flight model predicts the landing sight of a meteoroid by
propagating the position and velocity through the atmosphere using a
5th-order adaptive step size integrator (ODE45).
Created on Mon Oct 17 10:59:00 2016
@author: <NAME>
"""
import numpy as np
from scipy.interpolate impo... |
import json
from programs.lib.dbengine import DBEngine
import re
import numpy as np
#from nltk.tokenize import StanfordTokenizer
def load_data(sql_paths, table_paths, use_small=False):
if not isinstance(sql_paths, list):
sql_paths = (sql_paths, )
if not isinstance(table_paths, list):
table_path... |
"""
Week 4: Pong
Author: <NAME>
Website: http://vu-tran.com/
A simple Pong game made in Python.
BONUS: I've added a simple mode to play against an AI. Hope you enjoy it!
"""
import simplegui, random
# Configurations
FRAME_WIDTH = 600
FRAME_HEIGHT = 400
PAD_WIDTH = 8
PAD_HEIGHT = 80
BALL_RADIUS = 20
class PongGame... |
""""""
from __future__ import print_function, division
import os
import torch
import torch.nn as nn
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import utils
import sys
from pathlib import Path... |
import warnings
from abc import ABC, abstractmethod
from copy import deepcopy
from typing import Optional, Tuple, Union, List, Dict
from torchtyping import TensorType, patch_typeguard
from typeguard import typechecked
import logging
import numpy as np
import scipy.sparse as sp
import torch
from torch.nn import functio... |
from __future__ import division, print_function
import os
import numpy as np
from scipy import einsum
from scipy.sparse import csr_matrix
import scipy.signal as dsp
import utils
melody_dir = ''
chroma_dir = ''
def compute_and_write(data_dir, track_list=None, features=None):
"""Compute frame-based features fo... |
'''
Class Model: model for the deep clustering speech seperation
'''
import numpy as np
import tensorflow as tf
import math
from constant import *
def round_filters(filters, multiplier):
depth_divisor = 8
min_depth = None
min_depth = min_depth or depth_divisor
filters = filters * multiplier
new_f... |
import os
import json
import math
from SimpleITK.SimpleITK import GetArrayFromImage
from matplotlib.pyplot import axes
from numpy.core.fromnumeric import reshape, shape
import scipy
import nilearn.masking
from scipy.ndimage.measurements import standard_deviation
import torchio
import skimage
import skimage.morphology
i... |
# -*- coding: utf-8 -*-
import os
import fourchan_json
import random
import string
import re
import reddit
import time
import requests
class tcol:
NORMAL = "\u000f"
BOLD = "\u0002"
UNDERLINE = "\u001f"
REVERSE = "\u0016"
WHITE = "\u00030"
BLACK = "\u00031"
DARK_... |
""" Data objects in group "Zone HVAC Equipment Connections"
"""
from collections import OrderedDict
import logging
from pyidf.helper import DataObject
logger = logging.getLogger("pyidf")
logger.addHandler(logging.NullHandler())
class ZoneHvacEquipmentList(DataObject):
""" Corresponds to IDD object `ZoneHVAC:E... |
import os
from decimal import Decimal
from itertools import chain
from django import forms
from django.core.exceptions import ValidationError
from django.db.models import Count, Prefetch, Q
from django.utils.encoding import force_text
from django.utils.formats import number_format
from django.utils.timezone import now... |
import math
import numpy as np
from PyCommon.modules.Motion import ysMotion as ym
from PyCommon.modules.Math import mmMath as mm
# from PyCommon.modules.VirtualPhysics.LieGroup import *
from PyCommon.modules.Motion import ysMotion as ym
from PyCommon.modules.Resource import ysMotionLoader as yf
from PyCommon.modules... |
#! /usr/bin/env python3
# -----------------------------------------------------------------------------
# github-submodule-versions.py
#
# Work with GitHub.
#
# References:
# - GitHub
# - https://github.com/PyGithub/PyGithub
# - https://pygithub.readthedocs.io/
# - https://pygithub.readthedocs.io/en/latest/githu... |
import traceback
from datetime import datetime
import logging
from pathlib import Path
from typing import Optional
import aiogram.utils.markdown as md
from aiogram.dispatcher.filters import Text
from aiogram.dispatcher.webhook import DEFAULT_ROUTE_NAME
from aiogram.utils.deep_linking import get_start_link
from aiogra... |
'''
View class hierarchy is based here.
These classes are the root of a massive class hierarchy that gives things like
breadcrumbs on every page, properly working tabs, implied permission checks,
etc.
The view class hierarchy mirrors the model class hierarchy. Main objects in
Open Lab (Project, Team, and eventually S... |
# coding=utf-8
""" Google Earth Engine Task Manager """
from .widgets import CheckAccordion, ConfirmationWidget
from datetime import timedelta, datetime
from collections import namedtuple
from dateutil import tz
from ipygee import utils
from ipywidgets import *
from .threading import Thread
import time
import ee
impor... |
import tensorflow as tf
import numpy as np
import os
import copy
import random
from inout import dennerlein, projtable, png
from algo import ct
from util import types as t
from tensorflow.python.client import timeline
import re
import math
import argparse
# CONFIG
#-----------------------------------------------------... |
# test on absorption module
import pytest
import numpy as np
import astropy.units as u
from astropy.constants import m_e, c, M_sun, sigma_T, k_B
from astropy.coordinates import Distance
from pathlib import Path
from agnpy.emission_regions import Blob
from agnpy.targets import PointSourceBehindJet, SSDisk, SphericalShel... |
import argparse
from collections import defaultdict
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from torch import Tensor
from torchvision import transforms
from firewood.common.backend import set_runtime_build
from ... |
import numpy as np
import util
class POCM:
def __init__(self, pi, A, B, C):
self.pi = pi
self.A = A
self.B = B
self.C = C
self.nGroups, self.nStates, self.nLevels = self.B.shape
self.nActions = self.A.shape[1]
def update1(self, Observations, Actions, Xi, Gamma... |
import csv
import json
import random
import sys
import warnings
from precise_nlp.myio import fill_template
from precise_nlp.preprocess.cspy_ocr import fix_ocr_problems
try:
import pandas as pd
PANDAS = True
except ModuleNotFoundError:
PANDAS = False
import os
try:
import yaml
YAML = True
except... |
#!/usr/bin/env python
import math
import os.path
import numpy as np
from lxml import etree as et
import h5py
from floripy.file_formats import yamlio
from floripy.mathutils import xform as tr
from floripy.mathutils import geometry as geom
from floripy.mathutils.linalg import unitized
class MiuraSheet(object):
de... |
"""
Utilities of MobileNet training
"""
import os
import sys
import time
import math
import shutil
import tabulate
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import s... |
import speech_recognition as sr
import pyttsx3
import os
import datetime
import webbrowser
from bs4 import BeautifulSoup as soup
from urllib.request import urlopen as url
import wikipedia
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def acceptCommand()... |
import pytest
import subprocess
import time
from pathlib import Path
from shepherd import ShepherdDebug, CalibrationData, VirtualSourceData
from shepherd.virtual_source import VirtualSource
@pytest.fixture
def vs_config(request):
marker = request.node.get_closest_marker("vs_name")
if marker is None:
... |
"""
Skeletonizer: Python Cell Morphology Analysis and Construction Toolkit
KAUST, BESE, Neuro-Inspired Computing Project
(c) 2014-2015. All rights reserved.
"""
"""
Skeletonize morphology module.
"""
import os
import re
import sys
import math
import getopt
import copy
import json
import logging
import... |
# Copyright 2012 <NAME>
# Copyright 2013 Cloudbase Solutions Srl
# 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/LIC... |
# encoding: utf-8
'''Unit tests for ckan/logic/validators.py.
'''
import copy
import decimal
import fractions
import warnings
import ckan.lib.navl.dictization_functions as df
import ckan.logic.validators as validators
import ckan.model as model
import ckan.tests.factories as factories
import ckan.tests.helpers as he... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 mus... |
import sys
import csv
from RFEM.enums import ObjectTypes, ModelType
# Import SUDS module
try:
sys.version_info[0] == 3
except:
print('Must be using Python 3!')
input('Press Enter to exit...')
sys.exit()
try:
from suds.client import Client
except:
print('SUDS library is not installed in your Py... |
#!/usr/bin/python
#
# tester.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project 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 ob... |
import sys
sys.path.append("../")
sys.path.append("AIF360/")
import numpy as np
from tqdm import tqdm
import pandas as pd
from fairness_metrics.tot_metrics import TPR,TNR,get_BCR,DIbinary
import random
from aif360.datasets import BinaryLabelDataset
from aif360.datasets import AdultDataset, GermanDataset, CompasDataset... |
import logging
from typing import Tuple, List, Optional
from blspy import G1Element
from clvm.casts import int_from_bytes, int_to_bytes
from skynet.clvm.singleton import SINGLETON_LAUNCHER
from skynet.consensus.block_rewards import calculate_pool_reward
from skynet.consensus.coinbase import pool_parent_id
from skynet.... |
import unittest
from nose import SkipTest
from numpy import array
from openmdao.examples.mdao.sellar_MDF import SellarMDF
from openmdao.examples.mdao.sellar_MDF_solver import SellarMDF as SellarMDF_no_deriv
from openmdao.examples.mdao.sellar_IDF import SellarIDF
from openmdao.examples.mdao.sellar_CO import SellarCO
f... |
""" manage PyTables query interface via Expressions """
import ast
from functools import partial
import numpy as np
from pandas._libs.tslibs import Timedelta, Timestamp
from pandas.compat.chainmap import DeepChainMap
from pandas.core.dtypes.common import is_list_like
import pandas as pd
from pandas.core.base impor... |
import tkinter as tk
from tkinter import messagebox
from tkinter import filedialog
from tkinter import simpledialog
import tkinter.scrolledtext as tkst
import subprocess
color1 = ["var", "print", "set", "debug", "plot"]
color2 = ["string", "eval", "times", "action", "attribute",
"bool"]
color3 = ["=", "<", "... |
import inspect
import threading
import _thread
import colorlog
import datetime
import re
import sys
import os
import locale
import collections.abc
import io
import time
import json
def block_print():
sys.stdout = open(os.devnull, 'w')
def enable_print():
sys.stdout = sys.__stdout__
def timestamp_to_microseco... |
# 「3Dビュー」エリア → ポーズモード → Ctrl+A (ポーズ → 適用)
import bpy
import mathutils
from . import common
from . import compat
# メニュー等に項目追加
def menu_func(self, context):
self.layout.separator()
self.layout.operator('pose.apply_prime_field', icon_value=common.kiss_icon())
self.layout.operator('pose.copy_prime_field' , ic... |
import numpy as np
import scipy.stats
import os
import scipy.io
import tensorflow as tf
import glob
import h5py
import open3d as o3d
class Eval_Tools:
@staticmethod
def get_scene_list(res_blocks):
scene_list_dic = {}
for b in res_blocks:
scene_name = b.split('/')[-1][0:-len('_0000'... |
#!/usr/bin/env python
#
# data_validation.py - Helper libraries to validate data sanity
#
# September 2013, <NAME>
# Copyright (c) 2013-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#... |
# Natural Language Toolkit: Ngram Association Measures
#
# Copyright (C) 2001-2021 NLTK Project
# Author: <NAME> <<EMAIL>>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Provides scoring functions for a number of association measures through a
generic, abstract implementation in ``NgramA... |
# -*- coding: utf-8 -*-
# File: config.py
import numpy as np
import os
import pprint
import six
from tensorpack.utils import logger
from tensorpack.utils.gpu import get_num_gpu
__all__ = ['config', 'finalize_configs']
class AttrDict():
_freezed = False
""" Avoid accidental creation of new hierarchies. """... |
from __future__ import print_function
from __future__ import absolute_import
import numpy as nm
import six
from six.moves import range
class geometry(object):
"""The geometry is given by a sets of points (d0), lines (d1), surfaces
(d2) and volumes (d3). A lines are constructed from 2 points, a surface from
... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/LI... |
from django.conf import settings
from django.contrib import messages
from django.core.mail import EmailMultiAlternatives
from django.db import transaction
from django.forms.models import modelformset_factory
from django.http import HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from djang... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
import networkx as nx
import numpy as np
from flatland.envs.step_utils import env_utils
from flatland.envs.rail_env_action import RailEnvActions
from typing import List, Tuple
import graphviz as gv
class MotionCheck(object):
""" Class to find chains of agents which are "colliding" with a stopped agent.
T... |
"""
Functions useful across modules.
"""
import datetime as dt
from typing import Optional, Dict, List, Union, Callable
import copy
from bisect import bisect_left, bisect_right
from functools import cmp_to_key
import math
import pandas as pd
import numpy as np
import shapely.geometry as sg
from shapely.ops import tran... |
# Utility methods for dealing with Dataset objects
from __future__ import division
import decimal
from six import string_types, integer_types
from scipy import stats
import pandas as pd
import numpy as np
import warnings
import sys
import copy
import datetime
from functools import wraps
def parse_result_format(r... |
import logging
from collections import defaultdict
from typing import Tuple
import claripy
import angr # type annotations; pylint: disable=unused-import
from ...errors import SimMemoryMissingError
from ...storage.memory_mixins.paged_memory.pages.multi_values import MultiValues
from ... import BP, BP_AFTER
from ...sim... |
"""keywordtable - an SQLite database of keywords
Keywords can be loaded from resource files, test suite files,
and libdoc-formatted xml, or from python libraries. These
are referred to as "collections".
"""
import ast
import json
import logging
import os
import re
import sys
import robot.libraries
from robot.libdoc... |
from krpc_utils import TelemetryStreams
import time
import math
import numpy as np
import json
from krpc_utils import quaternion_rotation
class BeforePhaseTimespanError(Exception):
pass
class AfterPhaseTimespanError(Exception):
pass
class Autopilot:
def __init__(self, connection, ut_stream):
sel... |
#
# 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... |
# Copyright 2013 Red Hat, 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 by... |
import sys
from .ReadData import *
from .Model import *
import sklearn.metrics as metrics
from .Interpret import *
import itertools
class ModelDriverInterpret():
def __init__(self, params):
self.params = params
self.data = None
self.train_mean = None
self.train_std = None
self.interpretObj = None
def load... |
import datetime
import glob
import logging
import shutil
import threading
import time
from enum import Enum
import os
from flask import json
from flask_restful import fields
from flask_restful import marshal
from core.interface import EnumField, DATETIME_FORMAT
MEASUREMENT_TIMES_CLASH = "Measurement times clash"
ta... |
import json
import torch
import warnings
import traceback
from typing import List
from collections import Counter
import pandas as pd
import numpy as np
from pb_bss_eval import InputMetrics, OutputMetrics
import torch.nn as nn
from .utils import average_arrays_in_dic
ALL_METRICS = ["si_sdr", "sdr", "sir", "sar", "sto... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
'''
Color Picker
============
.. versionadded:: 1.7.0
.. warning::
This widget is experimental. Its use and API can change at any time until
this warning is removed.
.. image:: images/colorpicker.png
:align: right
The ColorPicker widget allows a user to select a color from a chromatic
wheel where pinch... |
import random
import numpy as np
import math
def inv_sigmoid(x):
return np.log(x / np.longdouble((1 - x)))
def sigmoid(x):
return 1.0 / np.longdouble((1.0 + np.exp(-x)))
class IterativeClassification:
'''Collective Inference Method: Iterative Classification'''
# Default values
max_iterations ... |
import pandas as pd
import numpy as np
from time import time
import random
def initialization(Npop, themes):
pop = []
for i in range(Npop):
p = list(np.random.permutation(len(themes)))
while p in pop:
p = list(np.random.permutation(len(themes)))
pop.append(p)
retur... |
# -*- coding: utf-8 -*-
##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the ... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright 2016, 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
"""Data module."""
import json
import warnings
from datetime import datetime as dt
from functools import lru_cache
from typing import Any, List
from bdc_catalog.models import Band, Collection, CompositeFunction, GridRefSys, Item, Tile, Timeline
from flask import abort
from flask_sqlalchemy import Pagination, SQLAlchem... |
#!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. 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
#
# U... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... |
"Utility functions to help deal with tensors"
from .imports.torch import *
from .core import *
from collections import OrderedDict
from torch.nn.parallel import DistributedDataParallel
AffineMatrix = Tensor
BoolOrTensor = Union[bool,Tensor]
FloatOrTensor = Union[float,Tensor]
IntOrTensor = Union[int,Tensor]
ItemsList ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import namedtuple
import coreapi
from django.utils.decorators import method_decorator
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import viewsets, status, mixins
from rest_framework.dec... |
import importlib
import inspect
import logging
import pickle
from typing import Any, Callable, Dict, List, Optional, Sequence, Type, Union
from django.core.cache import caches
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Model
from django.http import HttpRequest
from django.view... |
from array import array
import itertools
import math
from typing import Callable, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple, Union
from ..cache.accesses import SimpleAccessReader
from ..workload import Access, BytesSize, FileID, PartInd, PartSpec
class ReuseTimer(object):
def __init__(self, accesses... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 11:10:12 2018
Modified on 11/27/2018 to clean up comments
Modified on 02/22/2019 for version 0.1.0
@author: <NAME>
-------------------------------------------------------------------------------
Name: PVSite.py
Purpose: Provides fo... |
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.http import HttpResponse
from . import db_views
import json
import time
def login_view(request):
... |
# SPDX-FileCopyrightText: 2019 ladyada for Adafruit Industries
# SPDX-FileCopyrightText: 2020 Scott Shawcroft for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_requests`
================================================================================
A requests-like library for web interfacing
... |
# -*- coding: utf-8 -*-
# ==============================================================================
# SBEMimage, ver. 2.0
# Acquisition control software for serial block-face electron microscopy
# (c) 2018-2019 <NAME> Institute for Biomedical Research, Basel.
# This software is licensed under the terms of... |
import sys
import numpy as np
import pytest
import vtk
import pyvista
from pyvista import examples
GRID = pyvista.UnstructuredGrid(examples.hexbeamfile)
py2 = sys.version_info.major == 2
def test_point_arrays():
key = 'test_array_points'
grid = GRID.copy()
grid[key] = np.arange(grid.n_points)
asse... |
import pytest
from unittest import mock
import opentrons.protocol_api as papi
from opentrons.hardware_control import API
from opentrons.types import Mount, Point, Location
from opentrons.protocol_api import paired_instrument_context as pc
from opentrons.hardware_control.pipette import Pipette
@pytest.fixture
def set... |
import warnings
from collections import OrderedDict
from .. import functions as fn
from ..debug import *
from ..graphicsItems.GraphicsObject import GraphicsObject
from ..Qt import QtCore, QtGui, QtWidgets
from .Terminal import *
translate = QtCore.QCoreApplication.translate
def strDict(d):
return dict([(str(k), ... |
from functions import addToScheduler
from functions import getFreeKey
from copy import deepcopy
import time
#from gossip import gsocket
'''
Command function template:
def commandname(params, mud, playersDB, players, rooms, npcsDB, npcs, itemsDB, items, envDB, env, eventDB, eventSchedule, id, fights, corpses):
print... |
#!/usr/bin/env python3
import json
class ParseError (Exception):
pass
magic_prefix = "vl_api_"
magic_suffix = "_t"
def remove_magic(what):
if what.startswith(magic_prefix) and what.endswith(magic_suffix):
return what[len(magic_prefix): - len(magic_suffix)]
return what
class Field(object):
... |
"""
A simple Python script to deploy compiled contracts.
"""
import functools
import json
import logging
import click
from logging import getLogger
from typing import Dict, Optional
from eth_utils import denoms, encode_hex, is_address, to_checksum_address
from web3 import HTTPProvider, Web3
from web3.middleware impor... |
"""
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
"""
Test case ID : C4976202
Test Case Title : Verify that if the object is moving with Kinetic energy less than... |
"""
Copyright (c) 2017 <NAME>
See the file LICENSE.txt for copying permission.
"""
import sys
import os
import shutil
import string
import re
import json
import requests
import dateutil.parser
from subprocess import PIPE, Popen
from datetime import datetime
from dateutil import tz
from queue import Queue, Empty
from ... |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as tran... |
"""
Created on 04 Apr 2021
@author: <NAME>
22 Apr 2021: Started adding integrity checks, added .strip() to prevent whitespaces.
Added .lower() -> then .upper()/.title() before checks/inserts
"""
import tkinter as tk
from tkinter import scrolledtext, StringVar, ttk, messagebox
class BookingManagementGUI:
... |
"""Deep freeze
The script is executed by _bootstrap_python interpreter. Shared library
extension modules are not available.
"""
import argparse
import ast
import builtins
import collections
import contextlib
import os
import re
import time
import types
from typing import Dict, FrozenSet, TextIO, Tuple
import umarshal... |
# Copyright 2020 Google LLC. 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 a... |
__author__ = "<NAME>, Albuquerque"
""" This module: manages INI files for other modules. """
# Python core:
import os
import configparser
from collections import OrderedDict
# External packages:
# Author's packages:
import astropak.ini
THIS_PACKAGE_ROOT_DIRECTORY = os.path.dirname(os.path.dirname(os.path.abspath(... |
#####################################################################
#
# 텍스트의 구성 요소 정보
#
#####################################################################
import re
import time
import csv
import pycor.korutils as korutils
def sortParticle(particle):
return particle.text
########################
# 어절 ... |
import os
from PyPSASP.utils.utils_PSASP import copyfiles_st, copyfiles_lf, copyfiles_lfs
from PyPSASP.utils.utils_gadgets import generate_new_files_save_yield, gen_token, formulate_list_of_dicts
from PyPSASP.utils.utils_sqlite import insert_from_list_to_db
from PyPSASP.constants import const
from PyPSASP.PSASPClasses.... |
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
## \file dc_stn.py
# \brief An implementation of an STNU with dynamic controllability checking
# \note Read the Morris 2003 paper on dynamic controllability for more info on
# the algorithm used
# (https://pdfs.semanticscholar.org/6fb1/b64231b23924bd9e2a1c49f3b282a99e2f15.pdf).
# This file consists almost entirel... |
# Copyright 2013 Openstack Foundation
# 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 requ... |
"""
Copyright 2019-2020, the e-prop team:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
from the Institute for theoretical computer science, TU Graz, Austria.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redi... |
# -*- coding: utf-8 -*-
"""
Helper module that helps expand parameters for grid search
TODO: move into custom pipe_cfg and annot_cfg modules
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import utool as ut
import sys
import six
import itertools
from ibeis.expt import experiment_... |
"""
"""
import matplotlib
matplotlib.rc('text', usetex=True)
matplotlib.rcParams['font.size'] = 17
matplotlib.rc('xtick', labelsize=14)
matplotlib.rc('axes', linewidth=1.1)
matplotlib.rcParams['legend.fontsize'] = 11
matplotlib.rcParams['legend.handlelength'] = 3
matplotlib.rcParams['xtick.major.size'] = 5
matplotlib.... |
from __future__ import print_function
import os
import sys
import subprocess as sp
import re
import pprint
import tempfile
import shutil
import argparse
import codecs
from .popenwrapper import Popen
from .compilers import llvmCompilerPathEnv
from .compilers import elfSectionName
from .compilers import darwinSegmentN... |
# coding: utf-8
# In[1]:
import numpy as np
import os
import pandas as pd
import scipy.optimize
import random as rd
import matplotlib.pyplot as plt
import cvxopt
os.chdir('H:/')
# ### define functions
# In[2]:
#etl
def prepare(grand):
global D
D={}
for i in grand['Year'].unique():
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.