text stringlengths 3.07k 12.6k |
|---|
# -*- coding: utf-8 -*-
try: #for working with both python 3 and 2.7 since libraries are different
import tkinter as tk # python 3
from tkinter import font as tkfont
except ImportError: # python 2
import Tkinter as tk
import tkFont as tkfont #so we can use fonts
class main(tk.Tk): #class for main windo... |
# coding: utf-8
from enum import Enum
import json
from allennlp.data.tokenizers import WordTokenizer
from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
from spacy.symbols import ORTH, LEMMA
from src.context.converter import SQLConverter
from src.context.db_context import SparcDBContext
from src.uti... |
import numpy as np
from sklearn import linear_model
import pandas as pd
import logging
from scipy import signal
reg = linear_model.LinearRegression(fit_intercept=True)
import numpy as np
from sklearn import linear_model
reg = linear_model.LinearRegression(fit_intercept=True)
import pandas as pd
from scipy import s... |
import os
import time
import numpy as np
from util import util, html
def save_image(webpage, i, visuals, image_path):
image_dir = webpage.get_image_dir()
webpage.add_header('test')
ims, txts, links = [], [], []
for label, im_data in visuals.items():
im_tensor,im_np = util.tensor2im(im_data)... |
import tensorflow as tf
from tensorflow.keras.layers import Flatten
import matplotlib.pyplot as plt
#%matplotlib inline
#define kernel forward movement, softmax, a model for convenience, cross entropy function, and train steps
def forward (x):
return tf.matmul(x,W) + b
def activate(x):
return tf.nn.softmax... |
# An implementation of Binary Search Tree
# https://en.wikipedia.org/wiki/Binary_search_tree
#
# Created by <NAME> on July 2019
# Tested in Python 3.7
#
#
# Methods implemented:
# 1- insertion
# 2- traversal (inorder, preorder, postorder)
# 3- calculate height of the tree
# 4- search ... |
import pytest
import datetime
from freezegun import freeze_time
from oauth2_provider.models import AccessToken
from essentials_kit_management.constants.enums \
import StatusEnum, TransactionTypeEnum, VerificationChoicesEnum
from essentials_kit_management.models \
import User, Form, Section, Brand, OrderItem, \
... |
from django.db import models
from django.db.models.deletion import SET_NULL, CASCADE, RESTRICT
from django.utils.translation import gettext_lazy as _
from users.models import Profile
# Create your models here.
class PricingTerms(models.Model):
"""收費條款"""
createdon = models.DateTimeField(_('建檔日期'), auto_now_... |
#!/usr/bin/python2.7
import argparse,contextlib,io,sys,os,json,time,pdb
import matplotlib.pyplot as plt
import wu_gather
baseurl_lonlat = 'http://api.wunderground.com/api/%s/geolookup/q/%s,%s.json'
make_url_lonlat = lambda u,x,y : baseurl_lonlat % (u,x,y)
# added this function cause it looks like Wunderground defies ... |
#!/usr/bin/env python
"""
Tests for Image2c64 <https://bitbucket.org/gryf/image2c64>
Author: Roman 'gryf' Dobosz <<EMAIL>>
Date: 2012-11-20
Version: 1.3
Licence: BSD
"""
from tempfile import mkstemp, mkdtemp
from unittest import TestCase, main
import argparse
import os
import shutil
from c64img import cmd_convert
fro... |
#! /user/bin/evn python
# -*- coding:utf8 -*-
import codecs
import numpy as np
import nltk
import time,datetime
# 获取每篇文档的topK个融合的关键术语
def get_topK_kp(all_merged_kp, k):
start_time = time.time()
topK_merged_kp = []
for i in range(len(all_merged_kp)):
sorted_list = sorted(all_merged_kp[i].items(), k... |
""" SqlAlchemy model properties: annotate, list """
import dis
import inspect
from functools import lru_cache
from collections import abc
from typing import Optional, TypeVar
import sqlalchemy as sa
import sqlalchemy.orm
import sqlalchemy.ext.hybrid
from jessiql import exc
from jessiql.sainfo.models import unaliased... |
import pytest
from epippy.generation.vres.legacy.manager import *
from epippy.geographics.shapes import get_shapes
def test_get_legacy_capacity_in_countries_wrong_tech():
with pytest.raises(AssertionError):
get_legacy_capacity_in_countries('wind', ['BE'])
def test_get_legacy_capacity_in_countries_wrong... |
# MIT License
# Copyright (c) 2019 Xilinx
# 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, merge, ... |
import IceRayCpp
def make(
P_light
,P_emission = IceRayCpp.GraphTypeColorRGB().fill( 0.1 )
,P_diffuse = IceRayCpp.GraphTypeColorRGB().fill( 0.6 )
,P_albedo = IceRayCpp.GraphTypeColorRGB().fill( 0.7 )
,P_specular = IceRayCpp.GraphTypeColorRGB().load( 1.0, 1.1, 1.2 )
,P_shininess = IceRayCpp.... |
"""File used to prepare the urls of the rivens, generating
combinations of the possible stats and weapons"""
from itertools import combinations
import time
import settings
from utils import get_weapon_type, check_variant
def create_generic_url(stats=[], weapon_type=0):
"""Creates the url of a search ... |
import random
from datetime import datetime
from django.db import connections
from collections import Counter
from django.shortcuts import render
# Create your views here.
from rest_framework import status, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models imp... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
#Hyperparameter
lr = 0.01
time_steps = 30#bigger value may give more imformation and more easier get convergence
batch_num = 20
row_data_start = 0
single_input_size = 1
cell_size = 20
output_size = 1
#Synthesize data
def getData(... |
import hashlib
import os
class VersionInfo:
codeVersion = "V-T3.8.8c"
# 代码文件列表
codeList = ("todayLoginService.py", "actions/autoSign.py", "actions/collection.py", "actions/sleepCheck.py", "actions/workLog.py",
"actions/sendMessage.py", "actions/teacherSign.py", "login/Utils.py", "login/cas... |
#!/usr/bin/python3
"""
main.py:
separates the senteces in a file.
"""
__author__ = "<NAME>, <NAME>"
import sys
import getopt
import loggingModule
import subprocess
import os
import configparser
config = configparser.ConfigParser()
config.read(os.path.abspath(os.path.dirname(__file__)) + '/path.cfg')
def main():... |
from django.shortcuts import render, redirect
from .forms import MCQForm, SimpleQuestionForm
from .models import Quiz, Question
from contests.models import Contest
from results.models import ContestResult, QuizResult
def index(request, messages=None):
if messages is not None:
messages = {'success': [], '... |
import shutil
import datetime
import logging
import os
import shutil
import sys
from functools import partial
from uuid import uuid1
import cloudpickle as pickle
import gin
from gin_tune import tune_gin
from path import Path
from ray import tune
from sacred.observers import MongoObserver
from causal_u... |
# -*- coding: utf-8 -*-
""" GPML Inference methods.
Approximate inference methods.
Created: Fri Jan 18 10:29:06 2013 by <NAME>, Philips Research Hamburg.
Modified: $Id: inference.py 1263 2013-12-13 13:36:13Z hn $
"""
__version__ = "$Id: inference.py 913 2013-08-15 12:54:33Z hn $"
import numpy as np
def ... |
"""Label encode and One-Hot encode dataframes."""
from sklearn.preprocessing import LabelEncoder
from pandas import get_dummies
from pandas import DataFrame
from pandas import Series
from pandas import concat
from pandas import merge
import numpy as np
# Auto encodes any dataframe column of type category or object.
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agr... |
# coding: utf-8
'''
This module provides a list of devices detected by the OS.
The module is designed to run in *nix environments.
'''
# pylint: disable=logging-fstring-interpolation
# pylint: disable=line-too-long
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-branches
import logging
import sub... |
# import nonebot
from datetime import datetime
from nonebot import Bot, on_regex, on_notice
from nonebot.adapters.cqhttp import Event, PokeNotifyEvent, MessageEvent
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.typing import T_State
from .config import conf
from .distributor import d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Update acled
------------
"""
from datetime import timedelta
import pandas as pd
import dateutil.relativedelta
from hdx.data.resource import Resource
from os.path import join
from hdx.location.country import Country
from src.helpers import OutputError, hxlate, drop_colu... |
from prisonersDilemma import PrisonersDilemma
from FSM import *
import random
import copy
import math
lower_num_games = 50
upper_num_games = 50
# number of rounds for each game for scoring for upcoming generation
num_rounds = random.randint(lower_num_games, upper_num_games)
game = PrisonersDilemma()
... |
# ----------------------------------------------------------------------------
# ppytty
# ----------------------------------------------------------------------------
# Copyright (c) <NAME>.
# See LICENSE for details.
# ----------------------------------------------------------------------------
import os
import textw... |
# -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 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
#
#... |
'''
Description: 自己动手写模式挖掘(一)——初步搭建 Apriori 频繁模式挖掘框架
Url: https://blog.csdn.net/qq_44009891/article/details/106423085
Author: stepondust
Date: 2020-05-31
'''
import numpy as np
import sys
def findFrequentOneItemsets(dataset, min_sup):
goods_list = [i for i in dataset.flatten() if i != '']
goods_set = set(good... |
"""elastic.py
Module with some convenience code for accessing an Elastic Search index.
Based on the module with the same name at ../../elastic.py, which is clearly not
so good.
"""
import re
import codecs
import json
from pprint import pprint
from collections import Counter
from operator import attrgetter
from el... |
#!/usr/bin/env python
import datetime
import json
import pathlib
import sys
from typing import Dict, List, Optional, OrderedDict, Tuple
import usaddress
from vaccine_feed_ingest_schema import location as schema
from vaccine_feed_ingest.utils.log import getLogger
logger = getLogger(__file__)
Site = Dict[str, str]
... |
"""
Created By <NAME>
Feb 2018
日志
for python 3, win/linux
使用方法:
from py3lib import dlog
dlog.init(folder) # 设定日志所在文件夹,日志文件名为 <folder>/YYYYMMDD.log。如果不设定,则只输出到屏幕
dlog.debug(msg) # 输出调试信息
dlog.info(msg)
dlog.warning(msg)
dlog.error(msg, True) # 第二个参数为True时会输出当前堆栈,默... |
# Copyright (c) 2021 - present / Neuralmagic, 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 b... |
# -*- coding: utf-8 -*-
import string
import pickle
import pandas as pd
from nltk import FreqDist
from nltk.stem import SnowballStemmer
from nltk.corpus import stopwords as StopWords
from nltk.tokenize import sent_tokenize, word_tokenize
import numpy as np
def normalize(words, language = 'english'):
# removes ... |
"""
Here we need to replace the default help command to be able to deal with
disambiguations while feeding same or similar information to HelpFormatters...
Possible solutions for accounting for disambiguation information:
- Injecting the cog name (lowercase probably) into the Context prefix.
Notes:
- Command signat... |
#!/usr/bin/env python3
import time
class RouteParam:
def __init__(self, name: str, type_name: str, doc: str, protocols=None, builder=None, generic_name=None,
is_builder=False, builded_variable_name=None):
self.is_builder = is_builder
self.name = name
self.type_name = type_... |
"""
Yay, someone found this easter egg. Gratz!
NOTE: there is no flag here,
but you can ask the organizer of this challenge
for a shot of vodka [if its still there!] ;)
.?77777777777777$.
777..777777777777$+
.77 7777777777$$$
.777 .7777777777$$$$
.77777777... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
#django
#python
import tkinter as tk
from tkinter import Label,Tk
from PIL import Image, ImageTk
import PIL.Image
import json
#gazepattern
from eyedetector.models import Image, ImageRectangle
class Application(object):
def __init__(self, image_path... |
# Copyright 2016 Intel 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
#!/usr/bin/env python3
import pysam
import sys
import argparse
from collections import Counter
import re
import multiprocessing
import itertools
from datetime import date
parser = argparse.ArgumentParser(description='VCF generation script from BAM file')
parser.add_argument('-b',
'--bam',
... |
"""Implements an enhanced Django TextField called EnhancedTextField that stores
the format of the object, e.g. HTML, Markdown, plain text etc.
It can also render the EnhancedTextField in the appropriate format or in HTML.
"""
from django.db import models
from django.utils.encoding import force_unicode
"""... |
import torch
import torch.nn as nn
import torch.nn.functional as F
"""
Paper: Decoupled Dynamic Spatial-Temporal Graph Neural Network for Traffic Forecasting
Official Code: https://github.com/zezhishao/D2STGNN
"""
from basicts.archs.D2STGNN_arch.SpatialBlock import SpaBlock
from basicts.archs.D2STGNN_arch.Temp... |
import os
import sys
import tempfile
import shutil
from bento.core.platforms.sysconfig \
import \
get_scheme
from bento.utils.utils \
import \
subst_vars
from bento.installed_package_description \
import \
BuildManifest, iter_files
from bento._config \
import \
BUILD_MAN... |
import json
import string
import numpy as np
import torch
from nltk import word_tokenize
from torchtext.data import Field, Dataset, Example, BucketIterator
import numpy as np
from pandas import pandas
from nltk.corpus import stopwords
import re
def preprocess(doc, method="nltk", dataset=True):
english_stopwords ... |
# -*- coding: utf-8 -*-
from typing import List, Union
import torch
from ...wrapper import Batch
from ...config import Config
from .base import DecoderMixinBase, SingleDecoderConfigBase, DecoderBase
from .sequence_tagging import SequenceTaggingDecoderConfig
from .span_classification import SpanClassificationDecoderCon... |
import argparse
from autogluon.tabular import TabularDataset, TabularPredictor
from autogluon.tabular.models import CatBoostModel, KNNModel, LGBModel, XGBoostModel, TabularNeuralNetModel, RFModel
import os
from numpy.core.fromnumeric import trace
import pandas as pd
import traceback
parser = argparse.ArgumentParser()
... |
from behave import given, when, then
import time
import os
from botocore.exceptions import ClientError
from sceptre.environment import Environment
from helpers import read_template_file, get_cloudformation_stack_name
from helpers import retry_boto_call
@given('stack "{stack_name}" does not exist') # noqa: F811
def s... |
'''Hello! This script contains functions that are resued by other pieces of code and scripts belonging to this
project as well.
Checkout the README.md for more details regarding the project itself.
<NAME>
12/09/2018'''
'''datetime is used while building the database logs'''
from datetime import datetime
'''Importing... |
from functools import wraps
from itertools import chain
from numpy import linspace, meshgrid, sort, unique, where, nan, zeros, ones, arange, fliplr
from numpy import min as npmin
from scipy.interpolate import griddata, interp1d
"""
Generic tools.
"""
def flatten(iterable):
"""
Flatten an iterable by one level.
""... |
# Author: <NAME>
# Copyright <NAME> 2019
#
#from instructor import intructor
from database import database
from instructor import instructors
from jacket import jacket
from jacket import jackets
from menu import Menu
from private import private
from private import privates
from shift import shifts
#from jacket import... |
import io
import csv
import json
import time
from datetime import datetime, timedelta, timezone
import boto3
import botocore.exceptions
import requests
from fastapi import APIRouter
from fastapi.responses import Response, StreamingResponse
router = APIRouter()
def player_rankings(position):
year = 2021
ur... |
import functools
import logging
import re
from bottle import HTTPResponse, response
PP_ALLOWLIST_REGEX = re.compile(r'^\((.*)\)$')
PP_ORIGIN_REGEX = re.compile(r'^"(.*)"$')
log = logging.getLogger(__name__)
def ensure_headers(r, headers):
"""Set headers on a response if not already set"""
r = r if isinsta... |
"""
Django views.
"""
import logging
from django.conf import settings
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect
import requests
from smsjwplatform import jwplatform as api
from . import redirect as legacyredirect
LOG = logging.getLogger(__name__)
#: Default sessio... |
import concurrent.futures
from girder import logger
from girder.models.item import Item
from girder.models.user import User
from girder_jobs.models.job import Job, JobStatus
from . import config
from .constants import TokenOnlyPrefix
from .process import get_image_text, refile_image
def start_ocr_item_job(job):
... |
from typing import Any, Tuple, Union
from record import Article
import mistune
import os
import textwrap
import yaml
import logging
import html
from urllib.parse import urlparse
log = logging.getLogger(__name__)
YAML_BOUNDARY = '---'
def parse(path: str) -> Tuple[dict, str]:
raw_yaml = ''
markdown = ''
... |
"""snip raw text observation records corresponding to selected fields,
operates on all plain text observation formats
Command line usage:
args: [datf] [{ field | - },...]
datf -- raw observation text records (stdin)
field -- keyword in named obs80 tuple objects selecting values to be output
"-" means pass through th... |
"""permalinks.py -- postprocessor to add permalinks to headings
Copyright 2015 by <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless req... |
import functools
import io
import sys
import threading
import time
from tqdm import tqdm, tqdm_notebook
from cogent3.util import parallel as PAR
__author__ = "<NAME>"
__copyright__ = "Copyright 2007-2019, The Cogent Project"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "BSD-3"
__version__ = "2019.12.6a"
__maint... |
"""
Copyright (c) 2019 <NAME>
All Rights Reserved.
"""
import json
import csv
import torch
import pdb, time
import torch.utils.data as data
import pickle
from .transforms import get_image_list_resized
import torch.nn.functional as F
import numpy as np
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = Tru... |
import logging
import threading
import time
from unittest.mock import Mock
import pytest
from ophyd.sim import make_fake_device
from ophyd.status import wait as status_wait
from pcdsdevices.attenuator import (AT1K4, AT2L0, MAX_FILTERS, AttBase,
Attenuator, _att_classes)
logger = l... |
# Python Version: 3.x
import datetime
import http.client
import http.cookiejar
import posixpath
import urllib.parse
from typing import *
import bs4
from onlinejudge.type import *
from onlinejudge.utils import * # re-export
html_parser = 'lxml'
def describe_status_code(status_code: int) -> str:
return '{} {}'.... |
# -*- coding: utf-8 -*-
import pytest
from dependencies.exceptions import DependencyError
django = pytest.importorskip("django")
generic_views = pytest.importorskip("django.views.generic")
contrib = pytest.importorskip("dependencies.contrib.django")
http_methods = set(generic_views.View.http_method_names)
http_meth... |
# Implement Two Functionalities, Replace Text & Replace Image
import fnmatch
import os
import zipfile
import shutil
from docx import Document
def ReplaceText(InputFilepath, OutputFilepath, ReplacementDictionary):
document = Document(InputFilepath)
for p in document.paragraphs:
inline = p.runs
f... |
import argparse
import mxnet as mx
from rcnn.logger import logger
from rcnn.config import config, default, generate_config
from rcnn.tools.train_rpn import train_rpn
from rcnn.tools.test_rpn import test_rpn
from rcnn.tools.train_rcnn import train_rcnn
from rcnn.utils.combine_model import combine_model
def alternate_... |
import re
from dennis.minisix import textclass
class _MockBlessedThing(textclass):
def __call__(self, s):
return s
class FauxTerminal(object):
def __getattr__(self, attr, default=None):
return _MockBlessedThing()
try:
from blessings import Terminal
except ImportError:
Terminal = F... |
# --------------------------------------------------------
# PoseCNN
# Copyright (c) 2018 NVIDIA
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
import torch
... |
#!/usr/bin/env python
"""
client initialization: part of expfactory package
Copyright (c) 2017-2021, <NAME>
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... |
from bs4 import BeautifulSoup
from datetime import datetime
import time
import requests
from init_database_postgre import load_db_credential_info
from real_time_web_scraper import update_insider_trades, write_to_csv
insider_trades = []
trading_activity = {'B': 'Buy', 'S': 'Sell', 'O': 'Options Excersise'}
def parse_... |
import csv
import os
import datasets
_CITATION = """\
@inproceedings{xu-etal-2020-matinf,
title = "{MATINF}: A Jointly Labeled Large-Scale Dataset for Classification, Question Answering and Summarization",
author = "<NAME> and
<NAME> and
<NAME> and
<NAME> and
<NAME>",
booktitl... |
# combo_app.py
# combo scatter & line for interactive viz
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
from app import app
df = pd.read_csv('https://plotly.github.io/datasets/country_indicators.csv')
available_indicators = ... |
from .renderable import Renderable
class BaseFormElement(Renderable):
def __init__(self, template_name=None, position=0):
self.position = position
super(BaseFormElement, self).__init__(template_name=template_name)
def resolve_help_text(self, context):
return None
@property
de... |
################################################################################
# Copyright (C) 2019 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... |
import sys
import random
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
H = 31
W = 31
# 0 -> 何もない
# 1 -> 人間
# 2 -> 動物
# 3 -> 障害物
field = [[0] * W for _ in range(H)]... |
from discord.ext import commands
from discord import DMChannel, errors as discordpy_error
from aiohttp import ClientError
from websockets import exceptions as websocket_error
from bot import bot_user_commands
from dbmanager import db_manager
from logging.handlers import TimedRotatingFileHandler
import asyncio
import lo... |
"""
sphinx.ext.autodoc.typehints
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generating content for autodoc using typehints
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from collections import OrderedDict
from typing import Any, Dict, Ite... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# This file (test_utilities_neurone.py) is part of neurone_loader -
# (https://www.github.com/heilerich/neurone_loader) -
# Copyright © 2019 <NAME>. ... |
from unittest import TestCase
from unittest.mock import (
ANY,
Mock,
patch,
)
from pypika import (
Field,
Column as PypikaColumn,
MySQLQuery,
)
from fireant.database import MySQLDatabase
from fireant.database.mysql import MySQLTypeEngine
from fireant.database.sql_types import VarChar
class T... |
from typing import Any, Dict
from postgrest import SyncFilterRequestBuilder, SyncPostgrestClient, SyncRequestBuilder
from .lib.auth_client import SupabaseAuthClient
from .lib.client_options import ClientOptions
from .lib.storage_client import SupabaseStorageClient
class Client:
"""Supabase client class."""
... |
#!/usr/bin/python3
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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 requir... |
""" Cisco_IOS_XR_ethernet_cfm_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ethernet\-cfm package configuration.
This YANG module augments the
Cisco\-IOS\-XR\-ifmgr\-cfg,
Cisco\-IOS\-XR\-l2\-eth\-infra\-cfg,
Cisco\-IOS\-XR\-snmp\-agent\-cfg,
Cisco\-IOS\-XR\-infra\-sla\-cfg
modul... |
"""Generate reStructuredText documentation from Protocol Buffers."""
import argparse
import subprocess
import sys
import tempfile
import textwrap
from google.protobuf import descriptor_pb2
INFINITY = 10000
# pylint: disable=no-member
LABEL_TO_STR = {value: name.lower()[6:] for name, value in
descrip... |
"""ResourceSync Resource Container object.
All documents in ResourceSync have the same types of information:
they have some top-level metadata and links, and then a list of
resources, each of which may also have metadata and links. This
class implements this model.
This is a base class for the ListBase class which is... |
"""
Module containing color escape sequences simplified by name.
Quick Tutorial:
style_sequence = Style.var_style
normal_color_sequence = Color.normal
dark_color_sequence = Color.dark
light_color_sequence = Color.light
normal_highlight_sequence = Color.h_normal
dark_highlight_sequence = Color.h_dark
normal_color = Co... |
"""
.. module:: simul
:platform: Python, Micropython
"""
#---------------------------------------------------------------------------
from base_import import *
from simsched import SimulScheduler as Scheduler
from simlayer2 import SimulLayer2
from cond_true import ConditionalTrue
import utime
import schc
from stat... |
'''
Created on Feb 6, 2017
@author: julien
'''
import copy
import logging
import traceback
import keras
from keras.engine.topology import Input
from keras.layers import Merge, merge, Embedding
from keras.engine.training import Model
from keras.layers.core import Dense, Lambda
from keras.regularizers import L1L2
fro... |
# MIT License
#
# Copyright (c) 2021 Playtika Ltd.
#
# 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, mer... |
#!/usr/bin/env python2
"""
grammar_gen.py - Use pgen2 to generate tables from Oil's grammar.
"""
from __future__ import print_function
import os
import sys
from _devbuild.gen.id_kind_asdl import Id, Kind
from _devbuild.gen.syntax_asdl import source
from core import alloc
from core import optview
from core.pyerror im... |
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import pandas as pd
import plotly
import time
import os
from datetime import date
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']),'Desktop','Agent_data_graph')
t_date = str(date.today())
test_path = desktop + '\\' + t_... |
# Copyright 2016 <NAME>, <NAME>, alexggmatthews
#
# 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 ... |
#
# 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 us... |
import typing
from collections import OrderedDict
import pytest
from flytekit.common.exceptions.user import FlyteValidationException, FlyteValueException
from flytekit.common.translator import get_serializable
from flytekit.core import context_manager
from flytekit.core.condition import conditional
from flytekit.core... |
import requests
import logging
import utils
import json
from typing import NewType
from slugify import slugify
# Alias used for type hinting
ShopeeJSON = NewType('ShopeeJSON', dict)
# ? it is absolutely disgusting to configure logging inside here,
# ? migrate logging conf settings to the main app instead of the modul... |
# -*- coding: utf-8 -*-
"""
@description: Jenkins daily report
@author: luxnlex
"""
import os
import sys
from datetime import datetime, timedelta
import time
import re
def params():
inFile = open('configs\\conf.ini', 'r')
params = []
for i in inFile.readlines():
params.append(i.strip())
inFile.clo... |
#!/usr/local/bin/python3
#
# Authors: [PLEASE PUT YOUR NAMES AND USER IDS HERE]
#
# Ice layer finder
# Based on skeleton code by <NAME>, November 2021
#
from PIL import Image
from numpy import *
from scipy.ndimage import filters
from scipy.stats import norm
import sys
import imageio
from utils import *
# calculate "E... |
def view_meta(link, viewdf, weight, method_name, method_type,
name, fullname, text='', groups=None):
# Get file meta info on link definition data types
x = link.x if not link.x == '@' else link.y
y = link.y if not link.y == '@' else link.x
filemeta = link.get_meta()
if x in filemeta['... |
from typing import Any, Dict, List, Union
import threading
from collections import OrderedDict
from ray.experimental.dag import (
DAGNode,
ClassNode,
ClassMethodNode,
PARENT_CLASS_NODE_KEY,
)
from ray.experimental.dag.function_node import FunctionNode
from ray.experimental.dag.input_node import InputNo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.