filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_0_1187
# 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 ...
the-stack_0_1188
import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.activation import LeakyReLU from utils import initialize_weights_he # The MNIST datasets are hosted on yann.lecun.com that has moved under CloudFlare protection # Run this script to enable the datasets download # Reference: https://github.com/...
the-stack_0_1189
""" Parsed Config File Produces Expected Behaviors - fixed parameters """ import inspect import os import deeplenstronomy.deeplenstronomy as dl doc = """ \tRunning tests from test_expected_behaviors_fixed.py \tThe tests included in this module demonstrate that the values of fixed parameters \tin the main configu...
the-stack_0_1190
from argparse import ArgumentParser from mmdet.apis import inference_detector, init_detector, show_result_pyplot def main(): parser = ArgumentParser() parser.add_argument('img', help='Image file') parser.add_argument('config', help='Config file') parser.add_argument('checkpoint', help='Checkpoint file...
the-stack_0_1192
import datetime import json from itertools import chain from io import BytesIO from django.template.loader import get_template from xlsxwriter.workbook import Workbook from xhtml2pdf import pisa import xlrd import logging from django.db import transaction from django.contrib import messages from django.contrib.auth.dec...
the-stack_0_1193
from typing import Literal, List, Tuple, Union, Optional, Dict import numpy as np import scipy.linalg as la from scipy import stats Indices = Union[str, List[str]] def std_basis_vector(size: int, index: int, shape: Literal["row", "col", "flat"] = "col"): """Create a vector of {size} values ...
the-stack_0_1194
import sys if (sys.version_info[0] == 2 and sys.version_info[:2] >= (2,7)) or \ (sys.version_info[0] == 3 and sys.version_info[:2] >= (3,2)): import unittest else: import unittest2 as unittest import subprocess import shutil import time import os import signal from distutils.sysconfig import get_config...
the-stack_0_1195
# -*- coding: utf-8 -*- """ Created on Mon Aug 5 15:59:51 2019 @author: 939035 Classifiers """ # %% 1)Importing packages import seaborn as sns import pandas as pd import numpy as np # Handling SSL error when trying to connect from the office! import ssl ssl._create_default_https_context = ssl._create_unverified_cont...
the-stack_0_1197
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from collections import deque from typing import Dict, Iterable, Optional, Set, TypeVar import numpy as np from compiler_gym.datasets.benchma...
the-stack_0_1199
#!/usr/bin/env python # coding: utf-8 import argparse import os import ray from dotenv import load_dotenv from tqdm import tqdm from birdfsd_yolov5.label_studio_helpers.utils import get_all_projects_tasks from birdfsd_yolov5.model_utils.handlers import catch_keyboard_interrupt from birdfsd_yolov5.model_utils.utils i...
the-stack_0_1201
""" Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com 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, m...
the-stack_0_1202
from django.test import TestCase from django.utils.timezone import now, timedelta from polls.models import Choice, Question from django.contrib.auth.models import User from django.urls import reverse # Create your tests here. class QuestionModelTests(TestCase): def test_was_published_recently_with_future_questio...
the-stack_0_1204
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 jem@seethis.link # Licensed under the MIT license (http://opensource.org/licenses/MIT) from sexpr import sexp import pprint import copy import hexdump DEBUG = 0 def u8(x): return x & 0xff def i16(x): return x & 0xffff class LEDVMError(Excepti...
the-stack_0_1205
import torch.nn as nn import torch.nn.functional as F import torch class Classifier(nn.Module): def __init__(self, input_nc=3, ndf=64, norm_layer=nn.BatchNorm2d): super(Classifier, self).__init__() kw = 3 sequence = [ nn.Conv2d(input_nc, ndf, kernel_size=kw, stride=2), ...
the-stack_0_1206
from Common import * from save_to_mysql import Save_MySQL # file_date_time = "2019-10-17" # stif_time = "201910170900" # 生成个人表 def make_stan_person(num): """字段列表 "busi_reg_no":"客户号", "ctnm":"客户名称", "cten":"拼音/英文名称", "client_tp":"客户类别",1客户,2商户 "account_tp":"账户分类",1/2/3代表1、2、3类账号 "busi_type...
the-stack_0_1207
import platform import sys from helper import executable_exists PackageManager = { "macos": "brew install", "linux": { "readhat": "sudo yum", "arch": "sudo packman -S", "gentoo": "sudo emerge --ask --verbose", "suse": "sudo zypper install", "debian": "sudo apt-get inst...
the-stack_0_1208
import sdi_utils.gensolution as gs import sdi_utils.set_logging as slog import sdi_utils.textfield_parser as tfp import sdi_utils.tprogress as tp import pandas as pd EXAMPLE_ROWS = 5 try: api except NameError: class api: class Message: def __init__(self,body = None,attributes = ""): ...
the-stack_0_1209
import os import sys import time from circus.process import Process, RUNNING from circus.tests.support import TestCircus, skipIf, EasyTestSuite import circus.py3compat from circus.py3compat import StringIO, PY3 RLIMIT = """\ import resource, sys with open(sys.argv[1], 'w') as f: for limit in ('NOFILE', 'NPROC')...
the-stack_0_1210
""" # Mobius Software LTD # Copyright 2015-2018, Mobius Software LTD # # This is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later ve...
the-stack_0_1212
# Copyright 2017 QuantRocket - All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
the-stack_0_1213
__author__ = "Junhee Yoon" __version__ = "1.0.0" __maintainer__ = "Junhee Yoon" __email__ = "swiri021@gmail.com" """ Description: This is batch job for transforming data to DESeq input """ import pandas as pd import numpy as np import os import glob import argparse from libraries.botoClass import botoHandler from li...
the-stack_0_1214
from rest_framework.views import * from apps.core.exceptions import CustomAPIException from apps.utils.response import simple_response from apps.core import response_code ## # 重写异常handler, 满足现有response 格式, # 方便编码 ### def custom_exception_handler(exc, context): """ Returns the response that should be used for...
the-stack_0_1217
from collections import namedtuple import itertools import networkx as nx import numpy as np from pgmpy.factors.discrete import factor_product from pgmpy.inference import Inference from pgmpy.models import BayesianModel, MarkovChain, MarkovModel from pgmpy.utils.mathext import sample_discrete from pgmpy.extern.six.mo...
the-stack_0_1219
""" ============================================= :mod:`archivers` -- Solution archival methods ============================================= This module provides pre-defined archivers for evoluationary computations. All archiver functions have the following arguments: - *random* ...
the-stack_0_1220
import pandas as pd import numpy as np if __name__ == '__main__': df = pd.read_csv(snakemake.input[0], sep="\t", index_col=0) mc_df = pd.read_csv(snakemake.input[1], sep="\t", index_col=0) # sum the rows of the mutation count matrix to get the number of mutations per sample n_mutations = mc_df.sum(axis...
the-stack_0_1221
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A setuptools based setup module. See: https://packaging.python.org/tutorials/packaging-projects/ https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs...
the-stack_0_1222
""" batch 模块实现了 fastNLP 所需的 :class:`~fastNLP.core.batch.DataSetIter` 类。 """ __all__ = [ "BatchIter", "DataSetIter", "TorchLoaderIter", ] import atexit from numbers import Number import numpy as np import torch import torch.utils.data from ._logger import logger from .dataset import DataSet from .sampler...
the-stack_0_1224
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation fig = plt.figure() ax = fig.add_subplot(111) line, = ax.plot(np.random.rand(10)) ax.set_ylim(0, 1) def update(data): line.set_ydata(data) return line, def data_gen(): while True: yield np.random.rand(10) ani = an...
the-stack_0_1225
from .views import * from django.urls import path app_name = 'product' urlpatterns = [ # Category path('category/', CategoryList.as_view(), name='categoryList'), path('category/<int:pk>/', CategoryDetail.as_view(), name='categoryDetail'), # Subject path('subject/', SubjectList.as_view(), name='s...
the-stack_0_1228
import os from string import Template import psycopg2 import argparse parser = argparse.ArgumentParser() args_general = parser.add_argument_group(title="General Options") args_general.add_argument('-t', '--table_name', default='test', help='table to be copied. target table with have _copy as a suffix') args_general.a...
the-stack_0_1229
""" weasyprint.tests.test_presentational_hints ------------------------------------------ Test the HTML presentational hints. """ from weasyprint import CSS, HTML from .testing_utils import BASE_URL, assert_no_logs PH_TESTING_CSS = CSS(string=''' @page {margin: 0; size: 1000px 1000px} body {margin: 0} ...
the-stack_0_1230
import subprocess import sys import re import os import setup_util from os.path import expanduser home = expanduser("~") def start(args, logfile, errfile): setup_util.replace_text("sinatra/hello_world.rb", ":host => '.*'", ":host => '" + args.database_host + "'") try: subprocess.check_call("rvm ruby-2.0.0-p0...
the-stack_0_1231
# Copyright (c) 2020 Rocky Bernstein from uncompyle6.parsers.treenode import SyntaxTree def tryelsestmtl3(self, lhs, n, rule, ast, tokens, first, last): # Check the end of the except handler that there isn't a jump from # inside the except handler to the end. If that happens # then this is a "try" with n...
the-stack_0_1232
from __future__ import unicode_literals import time import hmac import hashlib import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, float_or_none, int_or_none, sanitized_Request, urlencode_postdata, xpath_text, ) class AtresPlayerI...
the-stack_0_1235
#!/usr/bin/env python3 import sys with open(sys.argv[1]) as input: lines = input.readlines() numbers = [int(line.strip()) for line in lines] # Part 1 print(sum(y > x for x, y in zip(numbers[:-1], numbers[1:]))) # Part 2 print(sum(y > x for x, y in zip(numbers[:-3], numbers[3:])))
the-stack_0_1236
def evalRPN(tokens): OPS = { "-" : lambda x,y : x-y, "+" : lambda x,y : x+y, "*" : lambda x,y : x*y, "/" : lambda x,y : int(x/y) } s= [] for item in tokens: if len(s)>=2 and item in OPS: y = s.pop() x = s.pop() s.append(OPS[it...
the-stack_0_1239
try: from cyordereddict import OrderedDict except: from collections import OrderedDict from . import util from .pprint import PrettyPrinter class AttrTree(object): """ An AttrTree offers convenient, multi-level attribute access for collections of objects. AttrTree objects may also be combined ...
the-stack_0_1240
# -*- coding: utf-8 -*- # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
the-stack_0_1244
""" Tests for AttMap. """ import itertools import os import pickle import numpy as np import pytest import yaml from attmap import AttMap, AttMapEcho __author__ = "Vince Reuter" __email__ = "vreuter@virginia.edu" # Provide some basic atomic-type data for models tests. _BASE_KEYS = ("epigenomics", "H3K", "ac", "EW...
the-stack_0_1245
# Copyright (c) 2020 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
the-stack_0_1247
# Tencent is pleased to support the open source community by making ncnn available. # # Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the...
the-stack_0_1248
from pydyn.operations.binary_tree import has_nested_add from pydyn.operations.geometry import Dot, Cross, Vee, Hat from pydyn.operations.addition import Add, VAdd, MAdd from pydyn.operations.multiplication import Mul, SMMul, SVMul, MVMul, VVMul, MMMul from pydyn.base.matrices import MatrixExpr from pydyn.base.scalars i...
the-stack_0_1249
import matplotlib.pyplot as plt import pprint from string import ascii_lowercase as letters def read_and_count_letters(to_read): # Open the file that is passed in as an argument to the function with open(to_read, encoding='utf-8') as f: text = f.read().lower() text_count = dict((l, text.count(...
the-stack_0_1250
""" The MIT License (MIT) Copyright (c) 2015-2021 Rapptz Copyright (c) 2021-present Pycord Development 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 limit...
the-stack_0_1251
import sys import xlrd import csv from main.model.model import db_save template = {'fecha_hora': '', 'vereda': '', 'PM2_5_CC_ICA': -9999.0, 'altitud': -9999.0, 'estado': '', 'online': '', 'longitude': -9999.0, 'barrio': '', 'ciudad': '', 'temperatura': -9999.0, 'humedad_relativa': -9999.0, 'latitude': -9999....
the-stack_0_1253
import os import numpy as np from simplegrid.abstractcreature import MAX_ENERGY, Action, AbstractCreature from simplegrid.dqn_agent import DQNAgent from simplegrid.map_feature import MapFeature HISTORY_FILE = 'deep_cow_history.jsonl' WEIGHTS_FILE = 'deep_cow_model_weights.h5' MODEL_FILE = 'deep_cow_model.json' clas...
the-stack_0_1254
"""Add meta field to Task table Revision ID: a4a031f74720 Revises: 860c6ff76ea8 Create Date: 2019-06-08 14:12:10.983247 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = 'a4a031f74720' down_revision = '860c6ff76ea8' branc...
the-stack_0_1257
# Copyright 2018 The Bazel 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 applicable la...
the-stack_0_1258
# -*- coding: UTF-8 -*- import olympe from olympe.messages.ardrone3.Piloting import TakeOff, moveBy, Landing drone = olympe.Drone("10.202.0.1") drone.connect() drone(TakeOff()).wait() drone(moveBy(10, 0, 0, 0)).wait() drone(Landing()).wait() drone.disconnect()
the-stack_0_1259
"""This package enables saving and loading of python objects to disk while also backing to S3 storage. """ import os import datetime import ntpath # to extract file name from path, OS-independent import traceback # for printing full stacktraces of errors import concurrent.futures # for asynchronous file uploads im...
the-stack_0_1260
"""Dependency injector base providers unit tests.""" import unittest2 as unittest from dependency_injector import ( containers, providers, errors, ) class ProviderTests(unittest.TestCase): def setUp(self): self.provider = providers.Provider() def test_is_provider(self): self.as...
the-stack_0_1261
import random import threading import time from statistics import mean from typing import Optional from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5...
the-stack_0_1264
""" Provides a `scantree` function which recurses a given directory, yielding (pathname, os.stat(pathname)) pairs. Attempts to use the more efficient `scandir` function if this is available, falling back to `os.listdir` otherwise. """ import os import stat try: from os import scandir except ImportError:...
the-stack_0_1265
# original implementation: https://github.com/odegeasslbc/FastGAN-pytorch/blob/main/models.py # # modified by Axel Sauer for "Projected GANs Converge Faster" # import torch.nn as nn from pg_modules.blocks import (InitLayer, UpBlockBig, UpBlockBigCond, UpBlockSmall, UpBlockSmallCond, SEBlock, conv2d) def normalize_sec...
the-stack_0_1266
import webbrowser from liquid import Liquid from pathlib import Path DATA_DIRECTORY = Path.home() / ".acm_dl_data" SEARCH_STRING = "https://dl.acm.org/action/doSearch?LimitedContentGroupKey={key}&pageSize=50&startPage={page_id}" def _ensure_data_directory_exists(sub_dir=None): """Makes sure the data directory ex...
the-stack_0_1268
""" pygments.formatters.img ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pixmap output. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import subprocess import sys from pygments.formatter import Formatter from pygments.util impor...
the-stack_0_1270
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
the-stack_0_1272
import asyncio import json import logging import os.path import random import click import sounddevice as sd import soundfile as sf from chmp.label import write_label, find_unlabeled from chmp.app.kwdetect.aio import detect as _async_detect from chmp.app.kwdetect.util import load_optional_model _logger = logging.get...
the-stack_0_1274
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: 334.py @time: 2019/6/10 19:14 @desc: ''' class Solution: def increasingTriplet(self, nums: List[int]) -> bool: if len(nums) < 3: return False #...
the-stack_0_1275
from gi.repository import Gtk import face_functions import face_recognizer import barcode import string import os.path class TableWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="FACE RECOGNIZER") self.set_size_request(500, 300) table = Gtk.Table(6, 3, True) ...
the-stack_0_1276
import numpy as np import tensorflow as tf import yolo.config as cfg import tensorflow.contrib.slim as slim #slim = tf.contrib.slim class YOLONet(object): def __init__(self, is_training=True): self.classes = cfg.CLASSES self.num_class = len(self.classes) self.image_size = cfg.IMAGE_SIZE ...
the-stack_0_1277
""" Functions that can are used to modify XBlock fragments for use in the LMS and Studio """ import datetime import hashlib import json import logging import re import uuid import markupsafe import webpack_loader.utils from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pyli...
the-stack_0_1278
import subprocess, os, re from mycroft import MycroftSkill, intent_handler class SystemControl(MycroftSkill): def __init__(self): MycroftSkill.__init__(self) self.log.info("System Control Skill loaded") @intent_handler('ShutDown.intent') def handle_shut_down_intent(self, message): ...
the-stack_0_1280
import pyxel class Hero: def __init__(self): self.x = 0 self.y = 52 self.walk_counter = 0 self.state = 'idle_right' self.models = { 'idle_right': [ [0, 0, 0, 16, 16, 0] ], 'idle_left': [ [0, 0, 0, -16, 16, ...
the-stack_0_1281
class ROBConfig(Config): """Configuration for training on the toy shapes dataset. Derives from the base Config class and overrides values specific to the toy shapes dataset. """ # Give the configuration a recognizable name NAME = "rob" # Train on 1 GPU and 8 images per GPU. We can put multi...
the-stack_0_1283
import time, datetime print("Importing OpenShift/Kubernetes packages ...") import kubernetes import ocp_resources import openshift from ocp_resources.node import Node from ocp_resources.machine import Machine from ocp_resources.node import Node from openshift.dynamic import DynamicClient try: client_k8s = Dynam...
the-stack_0_1288
from typing import List, Dict, Tuple from collections import Counter from datasets import translation class Node: def __init__(self, key: str, counter: int, parent_node) -> None: self.key = key self.counter = counter self.parent = parent_node self.childs: Dict[str, Node] = {} ...
the-stack_0_1289
import gzip import math import numpy as np import os from PIL import Image import random import torch import torch.utils.data as data def load_fixed_set(root, is_train): # Load the fixed dataset if is_train==False: filename = 'testA_100.npy' elif is_train==True: filename =...
the-stack_0_1290
#!/usr/bin/env python # # Electrum - lightweight Avian client # Copyright (C) 2015 Thomas Voegtlin # # 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 l...
the-stack_0_1292
import argparse import lbann import lbann.models import lbann.models.resnet import lbann.contrib.args import lbann.contrib.models.wide_resnet import lbann.contrib.launcher import data.imagenet # Command-line arguments desc = ('Construct and run ResNet on ImageNet-1K data. ' 'Running the experiment is only supp...
the-stack_0_1295
import argparse from configparser import ConfigParser import shlex parser = argparse.ArgumentParser(description='Short sample app') parser.add_argument('-a', action="store_true", default=False) parser.add_argument('-b', action="store", dest="b") parser.add_argument('-c', action="store", dest="c", type=int) config = ...
the-stack_0_1299
# 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. # -----------------------------------------------------...
the-stack_0_1300
"""Sensor platform for Brottsplatskartan information.""" from __future__ import annotations from collections import defaultdict from datetime import timedelta import logging import uuid import brottsplatskartan import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from ho...
the-stack_0_1301
import torch def images_to_levels(target, num_levels): """Convert targets by image to targets by feature level. [target_img0, target_img1] -> [target_level0, target_level1, ...] """ target = torch.stack(target, 0) level_targets = [] start = 0 for n in num_levels: end =...
the-stack_0_1302
import argparse import json import os import sys from datetime import datetime from pathlib import Path from shlex import quote import fuckit import mutagen import pandas as pd from joblib import Parallel, delayed from rich import inspect, print from tinytag import TinyTag from db import fetchall_dict, sqlite_con fro...
the-stack_0_1304
import math import csv import numpy as np from math import sin, cos from numpy.random.mtrand import seed import kalman import matplotlib.pyplot as plt import particle magic_coeff = 0.047 wheel_radius = 2.7 wheel_base_half = 7.5 sonar_zero_distance = 13.8 init_x = 0.0 init_y = 0.0 init_angle = 0.0 x_cam_noise = (0.0...
the-stack_0_1307
#! /usr/local/bin/python3 # Consume and display messages from a Kafka topic import argparse from kafka import KafkaConsumer def parse(): """Parse command line""" parser = argparse.ArgumentParser() parser.add_argument('-b', '--brokers', default='kafka:9092', help='Kafka bootstrap brokers') parser.a...
the-stack_0_1308
import json from sqlalchemy import Column, Integer, SmallInteger, String, ForeignKey, Text, JSON, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from ...policy import Policy, ALLOW_ACCESS, DENY_ACCESS, TYPE_STRING_BASED from ...rules.base import Rule from ...pa...
the-stack_0_1309
import collections import contextlib import inspect import json import jsonschema import numpy as np import pandas as pd # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for # larger specs, but leads to much more useful tracebac...
the-stack_0_1310
#!/usr/bin/python # -_- encoding: utf8 -_- import sys import time sys.path.append('./t') from http_utils import * VERBOSE = False BASE_URL = 'http://0.0.0.0:8081' # ============= # print('[+] Test status codes') http_codes = [ 200, 201, 202, # NO-Content !!! # 204, 206, # Moved !!! [[ # 300, # ...
the-stack_0_1311
import nltk from nltk.model import build_vocabulary, count_ngrams, LaplaceNgramModel, LidstoneNgramModel ''' lincoln_address_file = open('files/FirstInauguralAddress.txt') raw_lincoln_address = lincoln_address_file.read().lower() # lb_train_1 = raw_lincoln_address.lower().split() lb_train_1_sents = nltk.sent_tokenize(...
the-stack_0_1313
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
the-stack_0_1314
# Copyright The IETF Trust 2013-2020, All Rights Reserved # -*- coding: utf-8 -*- import io import os import debug # pyflakes:ignore from pyquery import PyQuery from io import StringIO from textwrap import wrap from django.conf import settings from django.urls import reverse as urlreverse from ietf.doc.factori...
the-stack_0_1317
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Author : Viacheslav Zamaraev # email : zamaraev@gmail.com # Script Name : 02_csv2xlsx.py # Created : 25th September 2019 # Last Modified : 25th September 2019 # Version : 1.0 # PIP : pip install pandas openpyxl ...
the-stack_0_1318
# %% [markdown] from tensorflow.keras.models import load_model from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint from tensorflow.keras.layers import Dense, GRU, Embedding from tensorflow.keras.models import Sequential from tensorflow.keras.preprocessing.sequence import pad_sequences import re import...
the-stack_0_1320
from pocketsphinx import * import pyaudio from time import sleep import requests import json from configobj import ConfigObj import os.path import wave #pyaudio needed to open a audio stream needed for pyAudio = pyaudio.PyAudio() headers = {'Content-Type':'application/json'} config = None commandAudioFil...
the-stack_0_1321
"""Reader is module to read the url list and return shards""" import pandas as pd import math import fsspec class Reader: """ The reader class reads an url list and returns shards It provides an iter method It provides attributes: - column_list: the list of columns to read - input_format: the...
the-stack_0_1323
""" Demonstrates the use of the ProgressMeter class. Author: Tucker Beck Last Tested: 3/2/2009 Verified with: Python 2.6, Tkinter 8.4 """ from __future__ import division from Tkinter import * from random import randint from time import sleep class ProgressMeter( Frame ): """ The ProgressMeter is-a Frame widg...
the-stack_0_1324
from bs4 import BeautifulSoup import requests def get_articles_from_page_data(page, depth = 1): base_url = page.url.replace("http://","").replace("www.","") print(base_url) soup = BeautifulSoup(page.content(), 'html.parser') url_strings = [link.get('href') for link in soup.find_all('a')] internal_u...
the-stack_0_1325
""" Test for management command generating exchange rates """ from unittest.mock import patch from django.test import TestCase from django.test.utils import override_settings from financialaid.constants import get_currency_exchange_rate_api_request_url from financialaid.management.commands import update_exchange_rate...
the-stack_0_1327
import os from setuptools import setup, find_packages from relationships import VERSION f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='django-relationships', version=".".join(map(str, VERSION)), description='descriptive relationships between auth....
the-stack_0_1328
# Copyright (c) 2014 The Bitcoin Core developers # Copyright (c) 2014-2015 The Dash developers # Copyright (c) 2015-2017 The PIVX developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression te...
the-stack_0_1331
import json from kubernetes import client from django.conf import settings from libs.paths.data_paths import get_data_paths from libs.paths.jobs import get_job_logs_path, get_job_outputs_path from libs.utils import get_list from polyaxon_k8s import constants as k8s_constants from polyaxon_schemas.exceptions import P...
the-stack_0_1333
# coding: utf-8 """ FlashBlade REST API A lightweight client for FlashBlade REST API 2.1, developed by Pure Storage, Inc. (http://www.purestorage.com/). OpenAPI spec version: 2.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re import six import typ...
the-stack_0_1335
""" This file offers the methods to automatically retrieve the graph Sodalis glossinidius. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protein a...
the-stack_0_1336
# (c) 2019-2020 Mikhail Paulyshka # SPDX-License-Identifier: MIT import logging import json import os import random import string import sys import pprint import threading from urllib.parse import parse_qs from typing import Dict, List import common.mglx_http from .gw2_constants import GW2AuthorizationResult class ...
the-stack_0_1341
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 29 09:56:48 2019 @author: adamreidsmith """ ''' Create datafiles of 1D solution to the Van der Pol equation: x'' - a*(1 - x^2)*x' + b*y = f(t). Datafiles include the computed solution, its fast Fourier transform, a histogram of x(t) vs t mod T whe...
the-stack_0_1342
from collections import deque import numpy as np import time import os import json from isaac.utilities import * # set the current working directory to the deployed package folder. This is required by isaac. os.chdir("/home/davis/deploy/davis/rm_isaac_bridge-pkg") from engine.pyalice import Codelet from engine.py...
the-stack_0_1344
# created April 2017 # by TEASER Development Team from teaser.logic.archetypebuildings.tabula.de.singlefamilyhouse import \ SingleFamilyHouse class ApartmentBlock(SingleFamilyHouse): """Archetype for TABULA Apartment Block Archetype according to TABULA building typology (http://webtool.building-typo...
the-stack_0_1347
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import os from numpy.testing import assert_allclose import pytest from jax import jit, random import jax.numpy as jnp import numpyro import numpyro.distributions as dist from numpyro.distributions.transforms import AffineTransform f...