text stringlengths 1 927k |
|---|
#Pluginname="Xing (Android)"
#Filename="conversations.db"
#Type=App
import struct
def convertdata(db):
#ctx.gui_clearData()
waconn=ctx.sqlite_run_cmd(db,"SELECT _id, im_skype, company_name, bussiness_province, birthdate, display_name, page_name, bussiness_city, occupation_title from users.users_table;")
i... |
from HelmState import Main
import sys
def main():
"""Entry point for the application script"""
sys.stdout.write(Main.Main())
sys.exit(0)
if __name__ == "__main__":
main() |
#
# Copyright 2019 The FATE 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... |
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe.utils import flt,today
from frappe import _
import decimal
import json
from datetime import datetime, timedelta
@frappe.whitelist()
def get_delivery_note_data(doc):
data = frappe.db.sql("""select item_cod... |
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from django.views.generic import FormView
from .. import forms, mails
from ..tokens import password_reset_token_generator
class PasswordReset(FormView):
form_class = forms.PasswordResetForm
template_name = 'django_auth2/... |
from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from devol import DEvol, GenomeHandler
import numpy as np
# **Prepare dataset**
# This problem uses mnist, a handwritten digit classification problem used
# for many introductory deep learning examples. Here, we load the data and
# prep... |
# Copyright 2021 Google LLC
#
# 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
#
# https: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
from .action_dists import TorchGaussianMixtureDistribution
from .envs import cheetah_env_creator, ant_env_creator
from .custom_trainer import CustomKLUpdatePPOTrainer |
# Copyright 2020 The PyMC Developers
#
# 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 ag... |
"""
FLAC (audio) parser
Documentation:
* http://flac.sourceforge.net/format.html
Author: Esteban Loiseau <baal AT tuxfamily.org>
Creation date: 2008-04-09
"""
from hachoir_parser import Parser
from hachoir_core.field import FieldSet, String, Bit, Bits, UInt16, UInt24, RawBytes, Enum, NullBytes
from hachoir_core.st... |
__all__ = ['FACTORY_VIEW', 'FACTORIES_VIEW', 'FACTORY_INIT']
FACTORIES_VIEW = """import datetime
from drf_core import factories
from {{ app_name }}.models import ({% for model in models %}
{{ model.object_name }},{% endfor %}
)
{% for model in models %}
# =========================================================... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0010_show_remove_is_active'),
]
operations = [
migrations.RemoveField(
model_name='programslot',
... |
import os
from PyQt4 import QtGui, QtCore
from du.android.hdump.HeapDump import HeapDump
from du.android.hdump.HeapDumpDiff import HeapDumpDiff, DiffNode
from du.android.hdump.SymbolResolver import SymbolResolver
from du.android.hdump.renderer.qt.ui.diffWindow import Ui_MainWindow
class DiffViewer(QtGui.QMainWindow,... |
/usr/lib/python3.6/encodings/ptcp154.py |
from holidays.selectors import is_on_holiday
def get_overtime_pay(overtime_application) -> float:
# determine the overtime pay for the overtime application
if overtime_application.is_on_holiday or overtime_application.is_on_sunday:
overtime_amount = overtime_application.number_of_hours * 2 * overtime_... |
# IAM Permissions
# Requires
# - 'route53:ListResourceRecordSets'
# - 'route53:ChangeResourceRecordSets'
# - 'route53:GetChange'
# Optional
# - 'logs:CreateLogGroup'
# - 'logs:CreateLogStream'
# - 'logs:PutLogEvents'
import logging
import os
import time
import boto3
from crhelper import CfnResource
LOG... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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 Licens... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: logger
Description :
Author : Liangs
date: 2019/7/28
-------------------------------------------------
Change Activity:
2019/7/28:
-----------------------------------------------... |
"""TEST MODULE TEMPLATE"""
from advent_of_code.utils.parse import parse_star_vectors
from advent_of_code.y2018.d10 import solution_1
def test_solution_1():
example_input = """position=< 9, 1> velocity=< 0, 2>
position=< 7, 0> velocity=<-1, 0>
position=< 3, -2> velocity=<-1, 1>
position=< 6, 10> velocity=<-2,... |
import pickle
import sys
import time
from PyQt5.QtCore import Qt, QThread, QTimer, pyqtSignal
from PyQt5.QtGui import QIntValidator, QStandardItem, QStandardItemModel
from PyQt5.QtWidgets import (QAction, QApplication, QCheckBox, QComboBox,
QDialog, QGridLayout, QLabel, QLineEdit,
... |
"""
===================
hdf5.py
===================
The Hierarchical Data Format version 5 (HDF5) defines a
a file format for storing and organzing massive amounts of
hiearchical data.
This module attempts to encapsulate the rich features of HDF5
alongside your favorite python3.7+ constructs
(e.g dataclasses)
[1] - ... |
#author::devendra
import os
import shutil
l1="*" * 100
l2="-" * 100
print(l1)
print(l1)
print(l2)
print(l2)
print(" ###### ###### ##### ###### ##### ## # ")
print(" # # # # # # # # # ")
print(" ... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
"""Neural network modules for transformer models."""
import math
import lbann
from lbann.modules.base import Module, FullyConnectedModule
from lbann.util import make_iterable
class MultiheadAttention(Module):
"""Parallel instances of scaled dot-product attention.
See:
Ashish Vaswani, Noam Shazeer, Niki P... |
# -*- coding: utf-8 -*-
from helper import *
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ROOT_DIR = g.ROOT_DIR
raw_data_dir = g.raw_data_dir
processed_data_dir = g.processed_data_dir
print(f"ROOT DIR = {ROOT_DIR}")
data_directory = ROOT_DIR+"/data/raw/"
@click.command()
@click.option('--data_dir', default=ROOT_DIR+"/d... |
# 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 ... |
# RUN: python %s
import unittest
import sys
import os
import tempfile
from lnt.testing.profile.perf import LinuxPerfProfile
class CPerfTest(unittest.TestCase):
def setUp(self):
self.inputs = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'Inputs')
self... |
from .migrations import migrate_exchanges, migrate_datasets
def drop_unspecified_subcategories(db):
"""Drop subcategories if they are in the following:
* ``unspecified``
* ``(unspecified)``
* ``''`` (empty string)
* ``None``
"""
UNSPECIFIED = {"unspecified", "(unspecified)... |
from django.http import HttpResponse
from django.utils.translation import ugettext_noop
from corehq.apps.styleguide.examples.simple_crispy_form.views import \
BaseSimpleCrispyFormSectionView
def default(request):
return HttpResponse('woot')
class FormsSimpleCrispyFormExampleView(BaseSimpleCrispyFormSectionV... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DatabaseCreate.plan_name'
db.add_column(u'maintenance_dat... |
#!/usr/bin/env python
import json, copy, rospy, pdb, sys, signal
from artist_performer import Performer, NotePublisher
from sensor_msgs.msg import (
Image,
)
def main():
rospy.loginfo("Initializing node... ")
rospy.init_node("play_xylophone")
# performer = Performer()
# print("Performing!...")
... |
# -*- gyp -*-
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'validators',
'type': 'static... |
from mythril import ether
from mythril.laser.ethereum import svm
import copy
import logging
from .ops import get_variable, SStore, Call, VarType
from mythril.laser.ethereum.strategy.basic import DepthFirstSearchStrategy, BreadthFirstSearchStrategy
class SymExecWrapper:
'''
Wrapper class for the LASER Symboli... |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
#!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1dF4lI8j77VOLP6SiGzByvbgg-yQOqZRq5FWJniOcrBE'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS |
"""
Capture projection pattern and decode x-coorde.
"""
import cv2
import numpy as np
import structuredlight as sl
def imshowAndCapture(cap, img_pattern, delay=250):
cv2.imshow("", img_pattern)
cv2.waitKey(delay)
ret, img_frame = cap.read()
img_gray = cv2.cvtColor(img_frame, cv2.COLOR_BGR2GRAY)
ret... |
#
# Plasma
# Copyright (c) 2021 Yusuf Olokoba.
#
from torch import arange, exp, tensor, Tensor
from torch.nn.functional import conv2d, conv3d, pad
from typing import Tuple
def gaussian_kernel (kernel_size: int, sigma: float = -1.) -> Tensor:
"""
Normalized 1D Gaussian kernel.
This operation is NOT di... |
"""
_RunJobByStatus_
Monitoring DAO classes for Jobs in BossAir database.
It groups jobs in each sched_status and bossAir status and guarantee
all sched_status are always present in the output.
"""
from __future__ import print_function, division
from WMCore.Database.DBFormatter import DBFormatter
class RunJobByStat... |
# Hamiltonian cycle problem
class Graph():
def __init__(self, vertices):
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]
self.V = vertices
''' Check if this vertex is an adjacent vertex
of the previously added vertex and is not
included in the path earlier '''
def isSafe(... |
from torch import nn, cat
from .constants import NUM_CONVS_IN_DENSE_BLOCKS
def conv_block(in_channels, out_channels):
blk = nn.Sequential(
nn.BatchNorm2d(in_channels), nn.ReLU(),
nn.Conv2d(in_channels, out_channels,
kernel_size=3, padding=1)
)
return blk
class DenseBl... |
import pybullet_data
import glob
import pybullet
import pybullet_utils.bullet_client as bc
import time
import numpy as np
from gym.utils import seeding
import gym
import os
import inspect
from myGym.envs.camera import Camera
import pkg_resources
currentdir = pkg_resources.resource_filename("myGym", "envs")
repodir = pk... |
from typing import List
from pydantic import validate_arguments
from minisculus.wheel._wheel import Wheel
class WheelChain:
"""Processes indexes using a chain of wheels."""
_wheels: List[Wheel]
def __init__(self, wheels: List[Wheel]):
self._validate_wheels(wheels)
self._wheels = wheels... |
# generator class and iterators
class FirstHundredNumbers:
def __init__(self):
self.numbers = 0
def __next__(self):
if self.numbers < 100:
current = self.numbers
self.numbers += 1
return current
else:
raise StopIteration()
my_gen = Firs... |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.Tool import Tool
from UM.Event import Event, MouseEvent
from UM.Math.Vector import Vector
from UM.Operations.MirrorOperation import MirrorOperation
from UM.Operations.GroupedOperation import GroupedOperation
f... |
import cv2
import numpy as np
from src.Detector import Detector
# Tree detector class #
class TreeDetector(Detector):
def __init__(self, image_path=None):
self.__image_path = image_path
self.image = None
if image_path is not None:
self.read(self.__image_path)
# *** CON... |
import importlib
import logging
import os
import pkgutil
import sys
from collections import OrderedDict
from inspect import isfunction, getmembers, signature
import torch
import models.feature_arch as feature_arch
logger = logging.getLogger('base')
class RegisteredModelNameError(Exception):
def __init__(self, na... |
import os
import sys
import time
import random
import binascii
import subprocess
import requests
import _thread
from functools import wraps
from panda import Panda
from nose.tools import timed, assert_equal, assert_less, assert_greater
from parameterized import parameterized, param
SPEED_NORMAL = 500
SPEED_GMLAN = 33.... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import ast
import os
from pex.common import is_python_script
from pex.third_party.pkg_resources import Distribution
from pex.typing import TYPE_CHE... |
# Copyright 2014, 2015, 2016 IBM Corp.
#
# 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 r... |
# Copyright 2011 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors... |
import numpy as np, time
def mToE(m, e):
if e <= 0.5:
return mToE(m,e,10)
if e <= 0.9:
return mToE(m,e,25)
if e <= 0.95:
return mToE(m,e,50)
if e <= 0.99:
return mToE(m,e,128)
return mToE(m,e,256)
def mToE(m, eccentricity, N_it):
"""Solve Kepler's equation,... |
import random
# pass 关键字在Python里面没有意义,知识单纯的用来占位,保证豫剧的完整性
# 输入年,写代码判断输入的年是否是闰年,并且打印对应的结果。
# (是闰年的条件:能被4 整除但是不能被100整除或者能够被400整除的年)
year = int(input('请输入一个年份:'))
if (year % 4 == 0 and year % 100 != 0) or (year % 1400 == 0):
print("您输入的是闰年" + str(year))
pass
# ---------------猜拳游戏---------------------------
print... |
#!/usr/bin/env python
"""Tests for `compynent` package."""
from contextlib import AbstractContextManager, contextmanager
from compynent import System
class InitCounter(AbstractContextManager):
def __init__(self):
self.cnt = -1
def incr(self):
self.cnt += 1
return self.cnt
def ... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Backbone modules.
"""
from collections import OrderedDict
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from uti... |
"""Create csv with spectral data"""
from os import getcwd
from pathlib import Path
from astropy.io import fits
import pandas as pd
PROJECT_PATH = getcwd()
SPECTRA = {}
for spectrum_path in Path('%s/data/fits/' % PROJECT_PATH).glob('*fits'):
spectrum_fits = fits.open(spectrum_path)
spectrum = spectrum_fits[1].... |
###########################################################################
#
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/l... |
# Copyright 2019 Google LLC
#
# 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, ... |
from django.core.exceptions import PermissionDenied
from rules.rulesets import RuleSet
from .rules import has_site_access
site_permissions = RuleSet()
site_permissions.add_rule("site_perm", has_site_access)
class SitePermissionBackend(object):
"""Authentication backend that checks row-level permissions grante... |
# Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... |
# from code.transformer_vid.utils import convert_weights
# import rotary_embedding_torch
from torch.nn.modules.activation import GELU, ReLU
# from data.OneCombo3.trainer import TrainerConfig
import math
import numpy as np
import itertools
import logging
import torch
import torch.nn as nn
from torch.nn import functiona... |
###########################################################################
#
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/l... |
#!/usr/bin/python3 -i
#
# Copyright (c) 2015-2019 Valve Corporation
# Copyright (c) 2015-2019 LunarG, Inc.
# Copyright (c) 2015-2019 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 a... |
import os
from datetime import datetime
from django.conf import settings
from django.utils.timezone import make_aware
from django.test import RequestFactory
from guardian.shortcuts import assign_perm
from onadata.apps.api.viewsets.note_viewset import NoteViewSet
from onadata.apps.api.viewsets.xform_viewset import XFo... |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... |
from .util import six
from .config import Config
from .parser import ParserContext
from .util import debug
from .tasks import Call, Task
class Executor(object):
"""
An execution strategy for Task objects.
Subclasses may override various extension points to change, add or remove
behavior.
.. ver... |
from .backbones import (C3D, X3D, MobileNetV2, MobileNetV2TSM, ResNet,
ResNet2Plus1d, ResNet3d, ResNet3dCSN, ResNet3dLayer,
ResNet3dSlowFast, ResNet3dSlowOnly, ResNetAudio,
ResNetTIN, ResNetTSM, TANet)
from .builder import (DETECTORS, build_backbon... |
import rospy
from humanoid_league_msgs.msg import GameState, RobotControlState
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement
class CheckFallen(AbstractDecisionElement):
"""
Checks if robot is fallen
"""
def perform(self, reevaluate=False):
self.clear_debu... |
from datetime import datetime
from django import forms
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http... |
from __future__ import absolute_import, division, print_function
import skimage.transform
import numpy as np
def rectify_bboxes(bboxes, height, width):
bboxes = np.maximum(bboxes, 0)
bboxes[:, 2:4] = np.maximum(bboxes[:, 0:2], bboxes[:, 2:4])
bboxes[:, 0] = np.minimum(bboxes[:, 0], width-1)
bboxes[:, ... |
from . import *
class AWS_IAM_Role_Policy(CloudFormationProperty):
def write(self, w):
with w.block("policy"):
self.property(w, "PolicyDocument", "policy_document", JsonValueConverter())
self.property(w, "PolicyName", "policy_name", StringValueConverter())
class AWS_IAM_Group_Policy(CloudFormationP... |
from .cars import Cars
from .cub import CUBirds
from .SOP import SOP
from .hotels import Hotels
from .import utils
from .base import BaseDataset
_type = {
'cars': Cars,
'cub': CUBirds,
'SOP': SOP,
'hotels': Hotels
}
def load(name, root, mode, transform = None, project_dir=None):
return _type[name... |
from Qt import QtGui
import inspect
from Core.Settings import Colors
def clamp(val,min_value,max_value):
return max(min(val, max_value), min_value)
class editableStyleSheet():
def __init__(self):
self.MainColor = Colors.Orange
self.MainColor_Lighter = Colors.OrangeLighter
self.MainColo... |
tweepy_consumer_key = "cVjPt6UCDPHFxGCk5M8wKz9Bo"
tweepy_consumer_secret = "ImLY50oHMd2noPrchO2qXYXKJQxxjng4UK7Rp1kj74GUDTCfTF"
tweepy_access_token = "34813916-plJKktZVBPOqKPQ7zdV5uTEuRiiDWeX9weZNliYct"
tweepy_access_token_secret = "CWwzOqAkkxfKl6VDK6OUBoYFKPZD2JDfOQjOcPjQYz7pP"
# estimator_url = 'wss://passgraf.com:2... |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:15890")
... |
import asyncio
import datetime
import logging
import urllib.parse
from typing import MutableMapping, Optional, Tuple
import aiohttp.web
from kopf.reactor import activities, lifecycles, registries
from kopf.structs import callbacks, configuration, handlers, memos
logger = logging.getLogger(__name__)
LOCALHOST: str =... |
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import resolve, reverse
class PasswordChangeTests(TestCase):
def setUp(self):
username = 'john'
... |
import mc
samples_from_txt = mc.util.load_txt_samples("samples.txt", separator=";")
print(samples_from_txt)
# >> "['hello world', 'hello world of cutes', 'string with escaped ";"']"
samples_from_json = mc.util.load_json_samples("samples.json")
print(samples_from_json)
# >> ['hello world', 'hello world of cuties'] |
from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'tmodel.ckpt-100'
#checkpoint_path = "deeplab_resnet_init.ckpt"
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
print(r... |
import re
s = '@robot9! @robot4& I have a good feeling that the show isgoing to be amazing! @robot9$ @robot7%'
encontrados=re.findall(r"@robot\d\W",s)
print(encontrados) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Emits top.v's for various BUFHCE ... |
## @example convert_video_to_image_frames.py
# This example loads a video and converts to a stream of image frames and display the
# individual frames with matplotlib.
#
# Note that additional dependencies are required to stream videos in FAST:
# Linux: sudo apt install ubuntu-restricted-extras libgstreamer1.0-dev libg... |
import os
import sys
sys.path.append('../../')
from dependencies import *
from settings import *
from reproducibility import *
from models.TGS_salt.Unet34_scSE_hyper import Unet_scSE_hyper as Net
SIZE = 101
PAD = 27
Y0, Y1, X0, X1 = PAD,PAD+SIZE,PAD,PAD+SIZE,
def time_to_str(time, str):
#if str == 'min':
# ... |
from output.models.nist_data.list_pkg.float_pkg.schema_instance.nistschema_sv_iv_list_float_white_space_1_xsd.nistschema_sv_iv_list_float_white_space_1 import NistschemaSvIvListFloatWhiteSpace1
__all__ = [
"NistschemaSvIvListFloatWhiteSpace1",
] |
"""
WSGI config for webserver project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... |
from __future__ import print_function
from fragbuilder import Basilisk_DBN
from fragbuilder import set_seed
set_seed(12)
dbn = Basilisk_DBN()
chi, bb, ll = dbn.get_sample("K")
print("Chi angles: ", chi)
print("Phi/Psi angles: ", bb)
print("Log likelihood: ", ll) |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
"""
Created on 7/17/16 10:08 AM
@author: Numan Laanait, Suhas Somnath, Chris Smith
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
import psutil
import scipy
import h5py
import time as tm
from .guess_methods import GuessMethods
from .fit_methods import Fit_Met... |
#!/usr/bin/env seiscomp-python
############################################################################
# Copyright (C) by GFZ Potsdam #
# #
# You can redistribute and/or modify this program unde... |
import difflib
import json
def data_loader():
"""This opens the JSON obj for all the city names."""
with open('apps/data/spellcheck/spell_check_opject2.json', 'r') as myfile:
data = myfile.read()
obj = json.loads(data)
return(obj)
def check_spelling(data, words):
"""This function tak... |
import struct
from ..io_utils.types import *
from io import SEEK_CUR, BytesIO
from collections.abc import Iterable
from typing import Optional, Protocol
__reload_order_index__ = 1
# TODO: temp declaration for compatibility
class Self:
pass
###### M2 file versions ######
@singleton
class M2VersionsManager:
... |
# -*- coding: utf-8 -*-
"""\
Configuration manager
~~~~~~~~~~~~~~~~~~~~~
"""
import os
import abc
import inspect
import logging
from logging.config import dictConfig
from pathlib import Path
class ConfigManager(metaclass=abc.ABCMeta):
"""Base configuration manager utility"""
def __init__(self):
self... |
import functools
from spaceone.api.cost_analysis.v1 import budget_usage_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.core import utils
from spaceone.cost_analysis.model.budget_usage_model import BudgetUsage
__all__ = ['BudgetUsageInfo', 'BudgetUsagesInfo']
def BudgetUsageInfo(budget_usage_vo: Bu... |
import json
import tempfile
import numpy as np
import copy
import time
import torch
import torch._six
from pycocotools.cocoeval import COCOeval
from pycocotools.coco import COCO
import pycocotools.mask as mask_util
from collections import defaultdict
import helpers.utils as utils
class CocoEvaluator(object):
... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
MAIL_SERVER = 'mail.messagingengine.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNA... |
from anet.tasks.mnist.envs.mnist_env import MNISTEnv
class MNISTEnvSenary(MNISTEnv):
def __init__(self, procs=0, proc_id=-1, train=True):
MNISTEnv.__init__(self, 6, procs=procs, proc_id=proc_id, train=train) |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 29 23:34:18 2019
@author: Caio
"""
# Exemplo de Aritmética complexa
u = 2.5 + 3j #Criando um numero complexo
v = 2
w = u + v # Operação soma
print(w)
a = -2
b = 0.5
s = a + b*1j
s = complex(a,b)
s
s* w #Complex * Complex
s/w #Complex/Complex
#Partes ... |
# -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import types
import errno
from werkzeug.utils import import_string
from ._compat import string_ty... |
import configparser
import os
from enum import Enum
from hendjibi import PROJECT_NAME_SHORT
from hendjibi.tools.app_logger import get_logger
from hendjibi.tools.translator import translate as _
from hendjibi.model.entry import ProgressStatus, EntryType
logger = get_logger(__name__)
SLIDER_MIN = 50
SLIDER_MAX = 250
... |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
#
# 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... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.