text
string
size
int64
token_count
int64
import pytest from jina.enums import RemoteAccessType from jina.flow import Flow from jina.parser import set_pea_parser, set_pod_parser from jina.peapods.pods import BasePod from jina.peapods.runtimes.remote.ssh import SSHRuntime from jina.proto import jina_pb2 @pytest.mark.skip('works locally, but until I findout h...
1,469
552
from dataclasses import dataclass @dataclass class PayloadSender: phone: int name: str @dataclass class PayloadBaseModel: sender: PayloadSender payload_id: str
181
58
def main(expr): openingParams = '({[' closingParams = ')}]' stack = [] for c in expr: if c in openingParams: stack.append(c) elif c in closingParams: topOfStack = stack.pop() openingIndex = openingParams.find(topOfStack) closingIndex = clos...
531
151
import os import sys from copy import deepcopy import traceback import functools from collections import defaultdict import yaml from argparse import ArgumentParser,\ RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter from sgains.configuration.parser import SgainsValidator, Config from sgains.configurat...
10,845
3,276
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
3,135
1,404
#!/usr/env/bin python # -*- coding: utf-8 -*- import io import os import sys from shutil import rmtree from setuptools import setup, find_packages, Command about = {} here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom ...
2,913
942
# -*- coding: utf-8 -*- """ Created on Thu Sep 17 21:33:24 2015 @author: Tillsten """ import matplotlib import matplotlib.pyplot as plt import numpy as np tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14), (255, 187, 120), (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 15...
2,670
1,337
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
3,634
1,059
from __future__ import absolute_import import pytest import os # is_code def test_is_code_interface(fixture_code): from aiida_fleur.tools.common_fleur_wf import is_code assert is_code('random_string') is None assert is_code('fleur.inpGUT') is None assert is_code(99999) is None code = fixture_cod...
12,133
4,307
""" Random Variables. This module implements random variables. Random variables are the main in- and outputs of probabilistic numerical methods. """ from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union import numpy as np from probnum import utils as _utils from probnum.type import ( ...
36,957
10,363
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
8,026
2,353
# Generated by Django 3.1.5 on 2021-02-05 00:00 import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vote', '0004_auto_20210131_1621'), ] operations = [ migrations.AlterField( model_name='com...
804
268
#!/usr/bin/env python # Copyright 2018 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Utility tools that extracts DWARF informatio...
11,847
4,130
# # PySNMP MIB module ENTERASYS-NAC-APPLIANCE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-NAC-APPLIANCE-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:04:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python versio...
12,540
4,752
import os import cv2 import argparse from utils import * from tqdm import tqdm from glob import glob from pathlib import Path def _extract_frames(video_path, parent, start=0, sampling_f=1): vidcap = cv2.VideoCapture(video_path) success, image = success, image = vidcap.read() count = -1 saved = 0 p...
3,300
1,013
# modified "example traffic redirector" # https://raw.githubusercontent.com/PortSwigger/example-traffic-redirector/master/python/TrafficRedirector.py # Idea: https://github.com/pajswigger/filter-options/blob/master/src/filter-options.kt # Usage: Put both files in a directory and add filter-options.py to Burp. Nees ...
2,923
876
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
11,128
3,677
# # 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...
7,060
2,248
from collections import defaultdict from functools import wraps from itertools import chain from sympy.core import sympify from .precedence import precedence from .codeprinter import CodePrinter _kw_py2and3 = { 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finall...
14,856
5,170
import argparse, os class ArgumentManager: def __init__(self, model_list): self.model_list = model_list self.args = self.get_input_arguments() self.validate_arguments() def get_input_arguments(self): parser = argparse.ArgumentParser(description='Process some integers.') ...
1,471
406
# -*- coding: utf-8 -*- """ Created on Thu Nov 28 12:10:11 2019 @author: Omer """ ## File handler ## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf ## The values from the above pdf were copied manually to a txt file, and ...
11,039
3,803
import logging import pytest from streamsets.testframework.markers import aws, sdc_min_version from streamsets.testframework.utils import get_random_string logger = logging.getLogger(__name__) S3_SANDBOX_PREFIX = 'sandbox' LOG_FIELD_MAPPING = [{'fieldPath': '/date', 'group': 1}, {'fieldPath': '/...
12,133
4,531
""" Copyright 2019 Marco Lattuada Copyright 2019 Danilo Ardagna 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...
3,493
914
""" Created on 12 May 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ from scs_host.sys.host_gpio import HostGPIO # -------------------------------------------------------------------------------------------------------------------- # noinspection PyUnusedLocal,PyAbstractClass class HostGPI(Hos...
1,000
235
class Unsubclassable: def __init_subclass__(cls, **kwargs): raise TypeError('Unacceptable base type') def prevent_subclassing(): raise TypeError('Unacceptable base type') def final_class(cls): setattr(cls, '__init_subclass__', prevent_subclassing) return cls class UnsubclassableType(type)...
492
163
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals # Command line : # python -m benchmark.VAR.GG.TP import os import logging from config import SEED from config import _ERROR from co...
4,472
1,453
import unittest from ..adl import ADL import six if six.PY3: from unittest.mock import Mock, MagicMock else: from mock import Mock, MagicMock class ADLTest(unittest.TestCase): """ Tests for `ADL` """ def setUp(self): self.ls = Mock(return_value=["foo", "bar", "baz"]) self.fak...
1,883
669
from django.views.generic import CreateView from django.urls import reverse_lazy from .forms import CustomUserCreationForm class SignUpView(CreateView): form_class = CustomUserCreationForm success_url = reverse_lazy('login') template_name = 'signup.html'
259
77
try: from typing import * # noqa: F401, F403 except ImportError: from .typing_stubs import * # type: ignore # noqa: F401, F403
137
58
import torch import torch.nn as nn class WordDropout(nn.Module): """ A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer). Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state. Note that this layer assumes the last dimensio...
2,858
888
""" 读取PDF文件 Version: 0.1 Author: BDFD Date: 2018-03-26 """ from PyPDF2 import PdfFileReader with open('./res/Python课程大纲.pdf', 'rb') as f: reader = PdfFileReader(f, strict=False) print(reader.numPages) if reader.isEncrypted: reader.decrypt('') current_page = reader.getPage(5) print(current...
365
152
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5 import QtWidgets as qtw from PyQt5.QtTest import QTest import time import requests from bs4 import BeautifulSoup from console import get_inherited_children, ROOT_URL class MainWindow(qtw.QMainWindow): def __init__(self): ...
2,335
785
#!/usr/bin/env python3 # encoding=utf8 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/common/OpTestASM.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache ...
6,540
2,010
#!/usr/bin/python3.4 __author__ = "Jeremy Rabasco" import sys import os sys.path.append("..") import unittest from modules import storage from modules.service import Service from modules.database import Database class TestStorage(unittest.TestCase): def setUp(self): self.service = Service() self...
1,824
548
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2012-17, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup...
4,676
1,271
from setuptools import setup, find_packages from os.path import join, dirname setup( name="fant_sizer", version="0.7", author="Rypiuk Oleksandr", author_email="ripiuk96@gmail.com", description="fant_sizer command-line file-information", url="https://github.com/ripiuk/fan...
1,096
305
def solve(): # Read input R, C, H, V = map(int, input().split()) choco = [] for _ in range(R): choco.append([0] * C) choco_row, choco_col = [0]*R, [0]*C num_choco = 0 for i in range(R): row = input() for j in range(C): if row[j] == '@': cho...
1,957
684
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
9,798
3,221
import torch.nn as nn import torch.optim as optim import torch.utils.data from Training import functions from Training.imresize import imresize import matplotlib.pyplot as plt from Models.pix2pixHD_base import GANLoss, VGGLoss from Models.pix2pixHD2 import mask2onehot class Losses(): def __init__(self, opt): ...
12,721
4,562
# 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...
2,074
753
import requests from sense_hat import SenseHat import smbus import time while True: try: pressure=0 sense = SenseHat() pressure = sense.get_pressure() data = {'pressure':pressure} print(pressure) #send http request to sense serverless function with pressure #data r=req...
491
173
#!/usr/bin/env python3 # Space Invadersishkebab. from trabant import * # ASCII geometries. shipascii = r''' /\ /XXXXXXXX\ v v ''' invader = r''' /XXXXXX\ /XXXXXXXX\ XXXXXXXXXX XX XX XX \XXXXXXXX/ /XX XX\ /X/ \/ \X\ X/ \X ''' cam(distance=250) gravity((0,0,0)) ship = create_ascii_object(...
1,528
630
import math import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d def fixed_padding(inputs, kernel_size, dilation): kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1) ...
11,550
4,297
from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail, Substitution API_KEY = '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' API_KEY_ID = 'egd1yywWRbeVF2gcGhTH2Q' ENCODING = "utf-8" DEFAULT_MAIL="irinam.bejan@gmail.com" def link(urlsafe): return "https://develop-...
1,430
580
# -*- coding: utf-8 -*- # yellowbrick.features.pca # Decomposition based feature visualization with PCA. # # Author: Carlo Morales # Author: Raúl Peralta Lozada # Author: Benjamin Bengfort # Created: Tue May 23 18:34:27 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LIC...
22,696
6,061
# Copyright (c) 2020 Xiaomi Corporation (author: Haowen Qiu) # See ../../../LICENSE for clarification regarding multiple authors import torch from torch.utils.dlpack import to_dlpack from .fsa import Fsa from _k2host import _is_valid from _k2host import _is_top_sorted from _k2host import _is_arc_sorted from _k2hos...
1,229
496
from .base import TelegramStructure, Field class PollOption(TelegramStructure): text = Field() voter_count = Field() def __init__(self, text: str, voter_count: int ): self.text = \ Field(text, [str]) self.voter_count = \ ...
355
108
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RViridislite(RPackage): """viridisLite: Default Color Maps from 'matplotlib' (Lite Version...
787
386
from re import S import select import socket import queue import threading import sys import pickle import base64 import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers.aead import AESGCM from cryptography.hazmat.primitives.serialization import load_ssh_public_key...
28,086
7,762
""" """ # Created on 2015.08.19 # # Author: Giovanni Cannata # # Copyright 2015 - 2018 Giovanni Cannata # # This file is part of ldap3. # # ldap3 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 Founda...
9,304
3,264
import copy from contextlib import contextmanager from functools import wraps from collections import defaultdict import tensorflow as tf _ArgScopeStack = [] @contextmanager def arg_scope(layers, **kwargs): """ Args: layers (list or layer): layer or list of layers to apply the arguments. Returns...
2,351
705
import textfsm import subprocess import random res = subprocess.run('ifconfig',stdout=subprocess.PIPE) intstatus = res.stdout.decode('ascii') with open("datafile","w+") as a: a.write(intstatus) a.close() template_file= "ifconfig-template.template" template = open(template_file) with open("datafile") as ...
754
284
import pygame class Player(pygame.sprite.Sprite): death = [pygame.image.load('Images/death1.png'), pygame.image.load('Images/death2.png'), pygame.image.load('Images/death3.png'), pygame.image.load('Images/death4.png'), pygame.image.load('Images/death5.png'), pygame.im...
31,951
10,378
"""A file containing representations of install configurations. The core Data representation for installSynApps. An InstallConfiguration object is parsed from a configuration, and is then used throughout the build process. InjectorFile objects are used for representing text that need to be injected into configuration...
18,151
5,645
# Create your views here. # -*- coding: utf-8 -*- from apps.core.helpers import render_to, ajax_response, get_object_or_None from apps.core.decorators import lock, login_required_json from apps.accounts.models import Invite from apps.accounts.decorators import check_invite from apps.accounts.forms import ( LoginFor...
3,587
1,076
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
12,193
3,286
from django.apps import AppConfig class ServerStatsConfig(AppConfig): name = "server_stats"
98
29
from __future__ import absolute_import, unicode_literals import os from django import VERSION as DJANGO_VERSION from django.utils.translation import ugettext_lazy as _ SECRET_KEY = '%29hnw7d-dy4n)!@1yi#ov#^@x0b=o*2o8^31oe!+(xw!!oc9a' ###################### # CARTRIDGE SETTINGS # ###################### # The follow...
14,435
4,501
from wordgen import consts import numpy as np from sklearn import preprocessing def fill_matrix(dataset): assert type(dataset) == str assert len(dataset) > 0, print("Dataset must be > 0") matrix = [] for i in consts.rang: matrix.append([]) for o in consts.rang: matrix[i]...
959
318
from ctypes import c_int, c_char_p, cast, c_float from collections import deque import logging import weakref from typing import Any, Dict, List, Tuple, Union, Sequence, Set import pyglet from pyglet.window import Window from pyglet import gl from .buffer import Buffer from .program import Program from .vertex_array ...
30,725
10,041
'''Copyright 2018 Province of British Columbia 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,...
2,141
725
class Solution(object): def maximumWealth(self, accounts): """ :type accounts: List[List[int]] :rtype: int """ # Runtime: 36 ms # Memory: 13.5 MB return max(map(sum, accounts))
237
74
# -*- encoding: utf-8 -*- from datetime import datetime from functools import partial from django import get_version from datatableview import helpers import six from .testcase import DatatableViewTestCase from .test_app.models import ExampleModel, RelatedM2MModel if get_version().split('.') < ['1', '7']: tes...
9,350
2,708
import traceback from os import getenv import discord from discord import Message from discord.ext import commands from discord.ext.commands import Context from asyncio import sleep import asyncio client = discord.Client() # botの接頭辞を!にする bot = commands.Bot(command_prefix='!') # ギラティナのチャンネルのID GIRATINA_CHANNEL_ID = 9...
3,518
1,610
#!/usr/bin/env python2.7 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
6,831
2,244
# -*- coding: utf-8 -*- """ Showcases *ICTCP* *colour encoding* computations. """ import numpy as np import colour from colour.utilities import message_box message_box('"ICTCP" Colour Encoding Computations') RGB = np.array([0.45620519, 0.03081071, 0.04091952]) message_box(('Converting from "ITU-R BT.2020" colourspa...
726
325
import os import uuid from django.conf import settings # this is how we can retrive variables # for the settings file from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager, PermissionsMixin) from django.core.validators import MaxValueValidator, MinValueVali...
1,536
443
""" This is a demonstration script for using the Transect class in the COAsT package. This object has strict data formatting requirements, which are outlined in tranect.py. Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them. --- In ...
3,732
1,315
""" Boolean algebra module for Diofant. """ from collections import defaultdict from itertools import combinations, product from ..core import Atom, cacheit from ..core.expr import Expr from ..core.function import Application from ..core.numbers import Number from ..core.operations import LatticeOp from ..core.single...
44,917
14,308
import pandas as pd import requests from lxml import etree import re, time, random, datetime from queue import Queue import threading class Review: headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \ (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36" ...
5,585
1,907
import pytest import numpy as np from pathlib import Path def extract_param(data, n_states): keys = ("initial_state_prob", "transition_prob", "means", "st_devs") param = {"n_states": n_states} for key in keys: param[key] = data[f"{key}_{n_states}"] return param @pytest.fixture(scope="session...
1,032
374
#!/usr/bin/env python """ Artesanal example Pipe without Pipe class. """ __author__ = "Rafael García Cuéllar" __email__ = "r.gc@hotmail.es" __copyright__ = "Copyright (c) 2018 Rafael García Cuéllar" __license__ = "MIT" from concurrent.futures import ProcessPoolExecutor import time import random def worker(arg):...
1,332
444
""" Main application entry point. python -m digibujogens ... """ def main(): """ Execute the application. """ raise NotImplementedError # Make the script executable. if __name__ == "__main__": raise SystemExit(main())
245
78
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2018, ARM Limited and contributors. # # 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 # # ...
42,279
11,483
import filters as f from iota import TransactionHash, Address from iota.commands import FilterCommand, RequestFilter, ResponseFilter from iota.filters import Trytes __all__ = [ 'GetNodeInfoCommand', ] class GetNodeInfoCommand(FilterCommand): """ Executes `getNodeInfo` command. See :py:meth:`iota.ap...
1,289
363
from Negocio import controller import forms, functions from flask import Flask, render_template, request, redirect, url_for, flash def register(mysql, request): registerForm= forms.RegisterForm(request.form) if request.method == 'POST' and registerForm.validate(): return controller.registraUsuario(mysql...
4,925
1,488
from evalme.matcher import Matcher def test_old_format_agreement_matrix(): m = Matcher(new_format=False) m.load(r"./tests/test_data/test_old_format.json") matrix = m.get_annotations_agreement() assert matrix is not None assert matrix > 0 def test_old_format_load(): m = Matcher(new_format=Fa...
644
235
# -*- coding: UTF-8 -*- """ This module provides Runner class to run behave feature files (or model elements). """ from __future__ import absolute_import, print_function, with_statement import contextlib import os.path import sys import warnings import weakref import six from behave._types import ExceptionUtil from...
30,942
8,525
add_library('pdf') import random from datetime import datetime tileCount = 20 def setup(): global savePDF, actStrokeCap, actRandomSeed, colorLeft, colorRight, alphaLeft, alphaRight savePDF = False actStrokeCap = ROUND actRandomSeed = 0 colorLeft = color(197, 0, 123) colorRight = color(87, 35,...
2,645
911
import enum from dataclasses import dataclass, field from itertools import chain, islice from mashumaro import DataClassMessagePackMixin from multiprocessing.synchronize import Lock from typing import ( Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple, TypeVar, Callable, Iterable, Generic, ...
41,499
12,022
""" 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...
11,665
3,970
# File: infrastructure_service.py # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # from .ds_base_service import DSBaseService from .ds_find_service import DSFindService from ..model.infrastructure import Infrastructure class InfrastructureService(DSFindService): def __init__(se...
2,342
634
import argparse from collections import defaultdict import csv from dataclasses import dataclass, field from enum import Enum, unique, auto import os import sys import tempfile import yaml import zipfile import gffutils from google.protobuf import json_format from ncbi.datasets.v1alpha1 import dataset_catalog_pb2 from...
5,562
1,817
from django.db import models from multigtfs.models import ( Block, Fare, FareRule, Feed, Frequency, Route, Service, ServiceDate, Shape, ShapePoint, Stop, StopTime, Trip, Agency) class Path(models.Model): trip = models.ForeignKey(Trip) stop = models.ForeignKey(Stop) path = models.CharField(max_len...
811
266
try: from public_config import * except ImportError: pass PORT = 9028 SERVICE_NAME = 'interface'
106
38
from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_page from rest_framework.generics import ( ListAPIView, RetrieveAPIView, CreateAPIView, UpdateAPIView, DestroyAPIView ) from .models import Pokemon from .serializers import PokemonSerializer from .fi...
1,307
394
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.errors import AnsibleOptionsError from ansible.module_utils.six import iteritems, string_types from ansible_collections.smabot.base.plugins.module_utils.plugins.config_normalizing.base import ConfigNormalizerBaseMer...
9,546
2,961
""" Tools de integração com o Dynamodb """ import boto3 import botocore import logging import datetime import json import copy import time import os class DyConnect: def __init__(self, table, region): self.table = table self.region = region def connect(self): try: dydb = b...
1,416
421
# -*- coding: utf-8 -*- from scrapy import Request from scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider class GlidedSky001Spider(DdiyBaseSpider): name = 'glided_sky_001' description = 'GlidedSky 爬虫-基础1' start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1' custom_settings = { ...
853
330
# # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
5,125
1,658
import os import datetime, time import imageio from pygifsicle import optimize from torch.utils.tensorboard import SummaryWriter class LogManager: def __init__(self, env, id, experiment=None): self.id = id now = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f") self.path = ( ...
1,303
426
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: ASRDriverParts/UNIInterface.py ''' Parts Module for ASR driver UNI interface configuraton ''' import GlobalModule from EmCommonLog import decorater_log from ASRDriverParts.InterfaceBase im...
2,676
866
""" Copyright (c) 2019 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 writing,...
6,003
1,552
"""\ Dialog to show details of internal errors. @copyright: 2014-2016 Carsten Grohmann @copyright: 2017 Dietmar Schwertberger @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import bugdialog_ui import config import log import logging import sys import wx class BugReport(bugdialog_ui.UIBug...
4,511
1,398
from django.shortcuts import render, redirect from django.conf import settings from django.core.files.storage import FileSystemStorage,default_storage from django.core.mail import send_mail, EmailMessage from core.models import Document from core.forms import DocumentForm from django.contrib import messages import os...
8,237
2,619
__version__ = '0.0.58.2'
25
16
''' Made by - Aditya mangal Purpose - Python mini project Date - 18 october 2020 ''' from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer form termcolor import cprint import time chatbot = ChatBot('Bot') trainer = ChatterBotCorpusTrainer(chatbot) trainer.train('chatterbot.corpus.eng...
594
223
""" --- Day 14: Docking Data --- As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory. After a brief inspe...
9,330
3,453
from PyQt5 import QtWidgets, uic from Factory import Factory from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget import Constant as c class RegularPolygonDialog(QtWidgets.QDialog): def __init__(self, scene...
2,524
787
import unittest from networks.QoS import QoS from networks.connections.mathematical_connections import FunctionalDegradation from networks.slicing import SliceConceptualGraph from utils.location import Location class TestBaseStationLinear(unittest.TestCase): def setUp(self): self.name = "network" ...
8,858
3,203