text stringlengths 2 999k |
|---|
import os
from minifw import config_default
class Dict(dict):
def __init__(self, names=(), values=(), **kwargs):
super().__init__(**kwargs)
for k, v in zip(names, values):
self[k] = v
def __getattr__(self, key):
try:
return self[key]
except KeyError:
... |
import numpy as np
nomes = ['Wayne Whitley','Justine Alvarado','Darrel Sweet','Kitra Ewing',
'Felix Church','Deacon Larson','Kuame Cannon','Amela Michael',
'Melanie Michael','Odysseus Alford','Aubrey Beach','Tatyana Hardin',
'Chester Battle','Eric Jacobson','Cody Malone','Travis Delacruz',
... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import compas
import compas_rhino
from compas_rhino.geometry import RhinoGeometry
try:
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
from Rhino.Geometry import Point3... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 18-8-7 下午4:01
# @Author : Tom.Lee
# @File : __init__.py.py
# @Product : PyCharm
# @Docs :
# @Source :
from .consul_exporter import ConsulExporter
from .exporter import Exporter
from .memcached_exporter import... |
"""
Support for MQTT binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt, binary_sensor
from ho... |
"""
Copyright 2018-2019 CS Systèmes d'Information
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 wr... |
#!/usr/bin/env python
from __future__ import absolute_import
import copy
import jinja2
import optparse
import os
import shutil
import sys
import uuid
from . import TEMPLATE_DIR
from .autounattend import Woe2008Autounattend
from .py3compat import subprocess
BUILD_DIR = os.path.expanduser('~/.cache/vmbuilder/config-... |
#!/usr/bin/env python3
#!/usr/bin/python
import sys
import yaml
VT100_BOLD = "[0;1m"
VT100_RED = "[0;1;31m"
VT100_GREEN = "[0;1;32m"
VT100_STOP_MARKUP = "[0m"
def list1():
print("\n---------------------------------------------------------------------------------")
print("list1")
l1 = []
l1.append... |
from module.pipeline import Preprocessing as pre
from module.pipeline import FeatureExtraction as fea
from module.pipeline.FeatureSelection import FeaturesSelection, ChanelsSelection, SensorsSelection
from module.pipeline import Classification as cla
import logging
class Evaluation:
def __init__(self, cli, config... |
from .version import __version__
from .handlers import SyncHandler, UIHandler, LegacyInteractRedirectHandler, LegacyGitSyncRedirectHandler
from .pull import GitPuller
from notebook.utils import url_path_join
from tornado.web import StaticFileHandler
import os
def _jupyter_server_extension_paths():
return [{
... |
#!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
import _plotly_utils.basevalidators
class InsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="insidetextfont", parent_name="pie", **kwargs):
super(InsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... |
def is_phone_2(ph):
l = len(ph)
if (l != 10):
return False
if not (ph.isdigit()):
return False
p_first = ph[0]
p = int(p_first)
if (p == 7 or p == 8 or p == 9):
#print("the phone number is valid")
return True
#print("this is not a v... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The AardvarkCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with an equivalent malleability clone
#
from test_framework.test_framewo... |
EMOJIS_JSON = """
{
"status": {
"online": "<:status_online:596576749790429200>",
"dnd": "<:status_dnd:596576774364856321>",
"streaming": "<:status_streaming:596576747294818305>",
"idle": "<:status_idle:596576773488115722>",
"offline": "<:status_offline:596576752013279242>"
... |
# --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data.hist(column='Rating', bins=8)
data = data[data['Rating'] <= 5]
data.hist(column='Rating', bins=8)
#Code ends here
# --------------
# code starts here... |
class UndoEvent(object):
LABEL = ""
def __init__(self):
pass
def undo(self):
""" Undos this event.
"""
raise NotImplementedError
def redo(self):
""" Repeats this event.
"""
raise NotImplementedError
def combine(self, otherU... |
# Copyright 2022 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... |
from chatbot.common.chat_share_data import ShareData
from chatbot.common.chat_knowledge_mem_dict import ChatKnowledgeMemDict
class EntityRegex(ShareData):
def __init__(self, cb_id):
self.cb_id = cb_id
def parse(self, data):
pass |
"""
This module lets you practice MUTATION of lists.
In this module, you mutate by CHANGING elements of a list.
Authors: David Mutchler, Amanda Stouder, Chandan Rupakheti, Katie Dion,
Claude Anderson, Delvin Defoe, Curt Clifton, their colleagues,
and Hao Jiang.
""" # TODO: 1. PUT YOUR NAME IN TH... |
#!/usr/bin/env python3
from __future__ import print_function
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
import re
class UniversalSpectrumIdentifier(object):
# usi object takes usiStr an automatically parses it and stores attributes
# usi objects can still exist even i... |
"""Unit tests for the positional only argument syntax specified in PEP 570."""
import dis
import pickle
import unittest
from test.support import check_syntax_error, use_old_parser
def global_pos_only_f(a, b, /):
return a, b
def global_pos_only_and_normal(a, /, b):
return a, b
def global_pos_only_defaults(... |
"""
********************************************************************************
* Name: TimeSeriesModel
* Author: Nathan Swain
* Created On: Mar 18, 2013
* Copyright: (c) Brigham Young University 2013
* License: BSD 2-Clause
********************************************************************************
"""
__all... |
from django.db import models
from django.conf import settings
import os
from django.core.validators import FileExtensionValidator
User = settings.AUTH_USER_MODEL
def smarket_directory_path(instance, filename):
banner_pic_name="smarket/products/{0}/{1}".format(instance.name, filename)
full_path = os.path.join(... |
# Copyright 1999-2022 Alibaba Group Holding 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 a... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-08-08 10:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
"""Test the fogfreq script
"""
from unittest.mock import patch
@patch("argparse.ArgumentParser", autospec=True)
def test_get_parser(ap):
import fogtools.analysis.foghist2d
fogtools.analysis.foghist2d.get_parser()
assert ap.return_value.add_argument.call_count == 1
@patch("fogtools.analysis.foghist2d.ge... |
from .base_options import BaseOptions
class TrainOptions(BaseOptions):
"""This class includes training options.
It also includes shared options defined in BaseOptions.
"""
def initialize(self, parser):
parser = BaseOptions.initialize(self, parser)
# visdom and HTML visualization para... |
from base_files_edited.mim import model as Model, sortbyvalue
from operator import itemgetter
from Genetic import create_offspring, rank_models, mutate, create_random_model
from Gscore import get_g_score
import random
import math
class ModelManager:
models = []
symbol_sequence = ''
symbol_sequences = []
... |
import unittest
import mppysam.mp_helper as mpp
def add(a=0, b=0):
return (a + b, )
class TestApplyWithAdd(unittest.TestCase):
"""Test apply() with a simple add function."""
def test_returns_empty_list_if_empty_args(self):
args_list = []
self.assertEqual(mpp.apply(add, args_list, processe... |
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from date_util import *
from file_util import *
from gclient_util import *
from optparse import OptionParser
import os
import... |
def invertBinaryTree(tree):
invert(tree)
return tree
def invert(tree):
if (tree) is None:
return
if(tree) is not None:
tree.right, tree.left = tree.left, tree.right
invert(tree.left)
invert(tree.right)
def invertBinaryTree(tree):
treeStack = [tree]
while len(treeStack) ... |
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.contrib.messages.storage.fallback import FallbackStorage
from django.http import HttpResponse, HttpResponseRedirect
from django.test import TestCase, RequestFactory, override_settings, SimpleTestCase
from django.url... |
import os.path
import torch
import torch.nn.functional as F
import locations
import models
import structured
from util import checkpoint, log
from . import trainer
class Trainer(trainer.Trainer):
"""
Class which trains a model using an experienced teacher model.
"""
def __init__(self, dataset, model... |
from django import forms
from django.forms import ModelForm, TextInput
from polls.models import Choice, Question
class PollForm(forms.ModelForm):
question_text = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
class Meta:
model = Question
exclude = ['pub_date']
de... |
import time # imports time module
# ------------------------
# HEADING MESSAGE
# ------------------------
def message3():
print("\nWelcome to auto-calc3\n"
"author: Visnu Pritom Chowdhury\n"
"e-mail: pr3370m@gmail.com\n"
"\n"
">> BETA PHASE | USE WITH CAUTION <<\n")
message3... |
from django.apps import AppConfig
class TftConfig(AppConfig):
name = 'tft'
verbose_name = '阵列制造'
|
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
# coding:utf8
import six
from ply import lex
from fastweb.exception import ThriftParserError
__all__ = ['Lexer']
THRIFT_KEYWORDS = (
'namespace',
'include',
'void',
'bool',
'byte',
'i8',
'i16',
'i32',
'i64',
'double',
'string',
'binary',
'map',
'list',
... |
# coding: utf-8
import http.client
import re
import urllib.error
from urllib.parse import urlencode
from urllib.request import Request, urlopen
import sys
from bs4 import BeautifulSoup as Bs
__author__ = 'isac322'
def down_file(judge_id, cookie):
header = {
'Host': 'www.acmicpc.net',
'Connectio... |
import re
from flask import request
from flask_restx import Namespace, Resource
from sqlalchemy.exc import IntegrityError
from CTFd.models import db
from CTFd.utils.decorators import authed_only
from CTFd.utils.user import get_current_user
from ...models import SSHKeys
ssh_key_namespace = Namespace(
"keys", des... |
from abc import ABC, abstractmethod
from models.orders import OrderItem
from ourCloud.OurCloudHandler import OurCloudRequestHandler
from orchestra.OrchestraRequestHandler import OrchestraChangeHandler
from workflows.WorkflowContext import WorkflowContext
from oim_logging import get_oim_logger
from exceptions.WorkflowEx... |
###
#
# Lenovo Redfish Library - SystemClient Class
#
# Copyright Notice:
#
# Copyright 2020 Lenovo Corporation
#
# 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/... |
"""
Fabfile for boostrapping and deploying a
Django/Nginx/Apache/Postgres/Postfix stack
on Ubuntu 10.4 LTS.
Deploy a new version:
fab -i ~/aws/flybychat-west.pem -H seddit.com stage_production simple_deploy
"""
from __future__ import with_statement
from functools import partial
import os, os.path, time
import functoo... |
#!/usr/bin/python3
#
# A tool to compare firmware symbols and show differences.
# Shows size differences and section changes.
#
# Example:
# tools/mgos_fw_diff.py --objdump-binary=xtensa-lx106-elf-objdump \
# build.old/objs/*.elf build/objs/*.elf
#
import argparse
import collections
import itertools
import typ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# stk documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogen... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
'''
Copyright (C) 2018 Sebastian Bullinger
Created by Sebastian Bullinger
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... |
import json
import os
import pandas as pd
import sys
sys.path.append("..")
sys.path.append("../../column_matching")
import column_matching.column_match as cm
import data_build_scripts.helpers as hlp
def main():
local_path = os.path.dirname(os.path.abspath(__file__))
f = open(os.path.join(local_path, "draft_s... |
# Programs 18d: Counting white pixels in color picture of a raccoon.
# See Figure 18.2.
from scipy import misc
import matplotlib.pyplot as plt
import numpy as np
face = misc.face()
fig1 = plt.figure()
plt.imshow(face)
width, height, _ = face.shape
print('Image dimensions: {}x{}'.format(width, height))
white_pixels ... |
# To the extent possible under law, ALBERT Inc. has waived all copyright and
# related or neighboring rights to this work.
# For legal code, see ``CC0.txt`` distributed with this file or
# <https://creativecommons.org/publicdomain/zero/1.0/>_.
#
# We thank to the original author Sebastiano Vigna.
from collections impor... |
#!/usr/bin/python3
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Build platform specific wheel files for the iree.runtime package.
# Built artifa... |
import math
def encrypt(_plaintext, _key):
ctLength = float(len(_plaintext))
# Calculate how many columns and rows the matrix needs
col = len(_key)
row = int(math.ceil(ctLength / col))
# List of all the characters in the ciphertext
ctList = list(_plaintext)
# Add a filler character ($... |
"""
unittest.TestCase for dbtests.
"""
from __future__ import absolute_import
import os
import os.path
import shutil
from . import interface
from ... import config
from ... import core
from ... import utils
class DBTestCase(interface.TestCase):
"""
A dbtest to execute.
"""
REGISTERED_NAME = "db_te... |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import io
import zipfile
import notebook.bundler.tools as tools
def _jupyter_bundlerextension_paths():
"""Metadata for notebook bundlerextension"""
return [{
'name': 'notebook_zip_download... |
import tkinter as tk
from collections import deque
from tkinter.constants import BUTT, END, GROOVE, NW, RAISED, RIDGE, S, SUNKEN
import numpy as np
import cv2
from PIL import Image,ImageTk
import os
import face_recognition
import time
window =tk.Tk()
window.option_add("*Font","Helvetica 14")
window.geometr... |
from functools import partial
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from keras.callbacks import EarlyStopping
from experiments.models.topics_models import get_model_residual_concat_radam
from experiments.datasets.topics_ds import get... |
from custom_components.xiaomi_cloud_map_extractor.common.vacuum import XiaomiCloudVacuum
class XiaomiCloudVacuumV2(XiaomiCloudVacuum):
def __init__(self, connector, country, user_id, device_id, model):
super().__init__(connector, country, user_id, device_id, model)
def get_map_url(self, map_name):
... |
from ..c2 import C2, ListenerType, LauncherType, Options, OptionDesc, AgentType
from ..exceptions import ResourceExistsError, ResourceNotFoundError, InconsistencyError
from . import Covenant
from . import SilentTrinity
|
from django import forms
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.utils.translation import pgettext
import pytz
from rest_framework import fields, permissions, serializers
from rest_framework.authentication impor... |
import openbabel
import types
import re
import chemaxon
from thermodynamic_constants import default_T, default_pH
class OpenBabelError(Exception):
pass
class Molecule(object):
# for more rendering options visit:
# http://www.ggasoftware.com/opensource/indigo/api/options#rendering
_obElements = openba... |
import roman
from aiogram import types
from aiogram.dispatcher import FSMContext
from ..keyboards import QuestionKeyboardMarkupFactory
from ..states import QuestionnaireStates
from ...api import Question, QuestionsCategory
async def update_user_context(state: FSMContext,
category_index:... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table(u'player_category', (
(u'id', self.gf('django.db.model... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from django.contrib import admin
from .models import CarMake, CarModel
# CarModelInline class
class CarModelInline(admin.TabularInline):
model = CarModel
# CarModelAdmin class
class CarModelAdmin(admin.ModelAdmin):
model = CarModel
# CarMakeAdmin class with CarModelInline
class CarMakeAdmin(admin.ModelAdmin)... |
# To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = mpim_replies_response_from_dict(json.loads(json_string))
from dataclasses import dataclass
from typing import Optional, Any, List, TypeVar, Type, cast, Callable
T = TypeVar("T")
def from_str(x: An... |
# coding=utf-8
from ...rpc import corp_client
def subscribe_handler(request, message):
openid = message.source
entry = corp_client.corpenv(request.env)
info = entry.client.user.get(openid)
info['gender'] = int(info['gender'])
env = request.env()
rs = env['wx.corpuser'].sudo().search( [('userid... |
from selenium import webdriver
import math
import os
import shutil
import time
import config
class Crawler:
def getPages(self, search):
path = config.SAVE_DIR + search
if os.path.isdir(path):
shutil.rmtree(path)
os.mkdir(path)
## Disable firefox pdf viewer
fp = ... |
import numpy as np
import pandas as pd
import json
import pickle
import sklearn
import flask
import io
from collections import Counter
from datetime import datetime
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import SGDClassifier
from sklearn.externals import joblib
... |
import cv2
import numpy as np
img = cv2.imread("imagens/estrada.jpg")
cv2.imshow("imagem_original", img)
largura = img.shape[1]
altura = img.shape[0]
proporcao = float(altura/largura)
largura_nova = 230
altura_nova = int(largura_nova * proporcao)
tamanho_novo = (largura_nova, altura_nova)
img_redimensionada = cv2.r... |
##Records all the experiments I run
import street_params as sp
import street_exp as se
def smallnetv2_pool4_ptch_crp192_rawImSz256(isRun=False, isGray=False, numTrain=1e+7,
isPythonLayer=False, deviceId=[2], batchsize=256,
resumeIter=0, extraFc=None, lrAbove=None):
prms = sp.get_prms_ptch(geoFence='dc-v2',... |
# Copyright 2017 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 app... |
"""
A Keras Implementation of the GoogleNet (InceptionV1) from
https://gist.github.com/joelouismarino/a2ede9ab3928f999575423b9887abd14
"""
# pylint: skip-file
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow import keras
from tensorflow.keras.regularizers import l2
from tensorflow.keras... |
import os
import logging
from logging.handlers import RotatingFileHandler
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DOWNLOADS = os.path.join(PROJECT_ROOT, "crawler/downloads")
DOWNLOADS_STWITS = os.path.join(PROJECT_ROOT, "crawler/downloads/stwits")
DOWNLOADS_TWITTER = os.path.join(PROJECT_ROOT, "cra... |
import numpy as np
import sys
from numpy.lib.arraysetops import unique
import uuid
import hashlib
import timeit
import itertools
# import the PagePacking.py under algorithm folder
import os
from sys import path
sys.path.append('../algorithms/')
from PagePacking import *
# load the input file
input = np.load('../data/... |
from pylab import *
import sys
import pandas
def getTimes(fn):
p=pandas.read_csv(fn,sep="\s+")
nodes=unique(p.nodes)
tt=[]
imin=p['imin'].values[1]
imax=p['imax'].values[1]
NpixD=float(p['NpixD'].values[1])/1e6
NpixJ=float(p['NpixJ'].values[1])/1e3
Ndata=float(p['Ndata'].values[1])/1e6... |
"""Application module"""
#pylint: disable=too-few-public-methods
import json
import jsend
import requests
import falcon
from service.resources.base_application import BaseApplication
import service.resources.google_sheets as gsheets
from service.resources.error import generic_error_handler, http_error_handler, value_er... |
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of th... |
"""Auto-generated file, do not edit by hand. KZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KZ = PhoneMetadata(id='KZ', country_code=7, international_prefix='810',
general_desc=PhoneNumberDesc(national_number_pattern='(?:33\\d|7\\d{2}|80[09])\\d{7}', poss... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
# -*- coding: utf-8 -*-
# @Author: ioriiod0
# @Date: 2017-11-01 14:40:43
# @Last modified by: ioriiod0
# @Last modified time: 2017-12-05T16:30:19+08:00
import sys
from setuptools import setup, find_packages
__title__ = 'marathon'
__author__ = 'gao lei'
__email__ = 'ioriiod0@gmail.com'
__version__ = '0.0.1'
setu... |
# Made by Emperorc
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest
qn = "63_PathoftheWarder"
#NPCs
Sione = 32195
Gobie = 32198
Bathis = 30332
Tobias = 30297
#Mob... |
from ketisdk.vision.base.base_objects import BasObj
from .basic_classification_models import Net
import torchvision.transforms as transforms
import torch, torchvision
import torch.nn as nn
import torch.optim as optim
import os
import numpy as np
# from ..dataset.datasets import Dataset, get_mean_std
import random
from ... |
""" csv_converter -- utility for converting csv to sqlite """
""" Sirikata utility scripts
* csv_converter.py
*
* Copyright (c) 2009, Patrick Reiter Horn
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following c... |
# 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
# distrib... |
#!/usr/bin/env python
from distutils.core import setup
long_description = """
A Pure-Python library built as a PDF toolkit. It is capable of:
- extracting document information (title, author, ...),
- splitting documents page by page,
- merging documents page by page,
- cropping pages,
- merging multiple pages i... |
# -*- coding: utf-8 -*-
__author__ = 'Altan Mehmet Karacan'
import telepot
from telepot.loop import MessageLoop
from telebot.api_key import API_KEY
import json
import os
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
from telebot.user import User
import time
class PasswordManagerBot:
d... |
#! /usr/bin/env python
# coding=utf-8
# Copyright © 2016 Joachim Muth <joachim.h.muth@gmail.com>
#
# Distributed under terms of the MIT license.
import json
import pandas as pd
import numpy as np
import scipy.sparse as sp
import os.path
import sys
import itertools
from collections import defaultdict
def symmetrize(... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import range
from past.utils import old_div
from proteus import *
from proteus.default_p import *
from proteus.elastoplastic import ElastoPlastic
import os
"""
Soil mechanics model for problem 6.3 ... |
#!/usr/bin/env python
import sys
import string
import random
import hashlib
import re
alpha = string.ascii_lowercase + string.ascii_uppercase + string.digits
def rand_string(length):
return ''.join([random.choice(alpha) for _ in range(length)])
def solve(prefix):
while True:
attempt = rand_string(5)
... |
# $Id$
#
# Copyright (C) 2004-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
#
from rdkit import RDConfig
import os, sys, copy
import unittest
import math
from rdkit import Chem
from rdkit.Chem import rdMolAlign, rdMolTransforms, rdMolDescriptors, rdDistGeom, ChemicalForceFields
def lstFeq(l1, l2, ... |
import difflib
import xml.etree.ElementTree as ET
import math
import os
def is_number(s):
try:
int(s)
return True
except ValueError:
return False
def encode(str1, str2):
output = ""
s = [x.replace("\n", "`").replace("-", "^") for x in str1.split(" ")]
s2 = [x.replace("\n", "`").rep... |
import logging
import os
import time
import sqlite3
from twisted.internet import threads, defer
from twisted.python.failure import Failure
from twisted.enterprise import adbapi
from lbrynet.core.HashBlob import BlobFile, TempBlob, BlobFileCreator, TempBlobCreator
from lbrynet.core.server.DHTHashAnnouncer import DHTHash... |
from rest_framework import status
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from accounts import serializers
from rest_framework.serializers import ValidationError
# Create your views here.
from rest_framework.views import APIView
import logging
from accounts.models ... |
# 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, ... |
import unittest
from dodge.components import Position, Faction, Weapon, Destructible
from dodge.level import Level
from dodge.event import Event
from dodge.config import Config
from dodge.entity import Entity
from dodge.constants import EventType, EventParam, Factions, ComponentType
from unittests.utils import EventSta... |
import hypergan as hg
import tensorflow as tf
from hypergan.gan_component import ValidationException
from hypergan.inputs.image_loader import ImageLoader
import os
def fixture_path(subpath=""):
return os.path.dirname(os.path.realpath(__file__)) + '/fixtures/' + subpath
class TestImageLoader:
def test_construc... |
from functools import partial
import pytest
import torch
from sklearn.metrics import (
accuracy_score as sk_accuracy,
jaccard_score as sk_jaccard_score,
precision_score as sk_precision,
recall_score as sk_recall,
roc_auc_score as sk_roc_auc_score,
)
from pytorch_lightning import seed_everything
fr... |
# -*- coding: utf-8 -*-
""" A simple set of methods for interacting with the RightScale pricing API for
the purpose of manipulating markups"""
import json,logging,requests,os,pyjq
from requests import *
def getLogger():
""" Initializes and returns a logger. The log level is always DEBUG
Returns:
Logg... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import configparser
# 导入腾讯的pythonSDK GitHub:https://github.com/TencentCloud/tencentcloud-sdk-python
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.