text stringlengths 1 927k |
|---|
# Crear una funcion que permita ingresar al usuario
# Numero enteros... y strings...
# 1- print -> imprime la lista que su fue cargando hasta el momento...
# 2- append a -> siendo a numero entero
# 3- remove b -> siendo b numero entero
# 4- sort
# 5- reverse
# 6- insert c d -> siendo ambos numeros enteros c le indice y... |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
This checks if all command line args are documented.
Return value is 0 to indicate no error.
Author:... |
"""
Defines `Core`.
Instantiates the module-level logger with the appropriate naming
convention.
"""
import logging
from abc import ABC
from interface.interface import Interface
from astparser.astparser import AstParser
from record.record import Record
from exception.exception import NoFilesSpecifiedError
LOGGER = ... |
from lcu_driver import Connector
import json
connector = Connector()
@connector.ready
async def connect(connection):
print("LCU API is ready to be used.")
# check if the user is already logged into his account
summoner = await connection.request("get", "/lol-summoner/v1/current-summoner")
if summoner... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import math
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorchvideo.layers.utils import set_attributes
class MemoryBank(nn.Module):
"""
Performs Non-Parametric Instance Discrimina... |
import json
prefix = "http://slipo.eu/id/poi"
rdftype = "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"
poi = "<http://slipo.eu/def#POI>"
category = "<http://slipo.eu/def#category>"
termPrefix = "http://slipo.eu/id/term"
termValue = "<http://slipo.eu/def#termValue>"
rdf = ""
i = 0
hasGeometry = "<http://www.opengi... |
from typing import Final
from alpyro_msgs import RosMessage, string, uint8
class TF2Error(RosMessage):
__msg_typ__ = "tf2_msgs/TF2Error"
__msg_def__ = "dWludDggTk9fRVJST1I9MAp1aW50OCBMT09LVVBfRVJST1I9MQp1aW50OCBDT05ORUNUSVZJVFlfRVJST1I9Mgp1aW50OCBFWFRSQVBPTEFUSU9OX0VSUk9SPTMKdWludDggSU5WQUxJRF9BUkdVTUVOVF9FUlJPUj... |
# -*- coding: utf-8 -*-
#
# 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
#... |
from django.db import models
from login.models import User #add this
from django.dispatch import receiver #add this
from django.db.models.signals import post_save
from datetime import datetime
# SOURCE: https://www.ordinarycoders.com/django-custom-user-profile
class Profile(models.Model):
user = models.OneToOne... |
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import logging
import pytest
from datadog_checks.base import ConfigurationError
from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.snmp import SnmpCheck
from datadog_checks.snmp.util... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 20 09:49:40 2020
@author: Mehdi
"""
import numpy as np
a1=np.nanmean([table_11.loc['A'].accuracy,table_12.loc['A'].accuracy,table_13.loc['A'].accuracy,table_14.loc['A'].accuracy,
table_15.loc['A'].accuracy,table_16.loc['A'].accuracy,table_17.loc['A'].accuracy... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
class GpioData:
_count = 0
_modNum = 8
_specMap = {}
_freqMap = {}
_mapList = []
_modeMap = {}
_smtMap = {}
_map_table = {}
def __init__(self):
self.__defMode = 0
self.__eintMode = False
self.__modeVec = ['0', '0', ... |
import cocotb
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge, FallingEdge, ClockCycles
import random
async def reset(dut):
dut.RESET_N <= 0
await ClockCycles(dut.EXTERNAL_CLK, 20)
dut.RESET_N <= 1
await ClockCycles(dut.EXTERNAL_CLK, 1)
@cocotb.test()
async def spi_v... |
import sys
import logging
import json
logger = logging.Logger("mysql_generator")
from notest.lib.mysql_lib import MysqlClient
from notest.lib.utils import templated_var
from notest import generators
'''
- generators:
- task_id: {type: 'number_sequence', start: 10}
- task_name:
type: 'my... |
# -*- coding: utf-8 -*-
"""Exceptions used in this module"""
class CoincError(Exception):
"""Base Class used to declare other errors for Coinc
Extends:
Exception
"""
pass
class ConfigError(CoincError):
"""Raised when there are invalid value filled in Configuration Sheet
Extends:
... |
# Copyright 2018 IBM Corp.
#
# 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, sof... |
# 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 ... |
#!/usr/bin/env python
"""
This script creates WRF ready files using the little_r formatted files.
They are part of the input files needed for observation nudging.
Note that:
- You need to step1_run_time_series_converter.py first
- Here we convert to the format needed by WRF
- You do that by running:
$ perl RT_fd... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2020 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Version information for Invenio-I18N.
This file is imported by ``invenio_i18n.__i... |
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""A limited-functionality wallet, which may replace a real wallet in tests"""
from copy import deepcopy
... |
import sys
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, TextAreaField, SelectField, BooleanField, DecimalField, HiddenField, \
RadioField, FieldList
from wtforms.validators import InputRequired, NumberRange, Length, AnyOf
from wtforms.widgets.html5 import NumberInput
from modules... |
"""Import CLTK corpora.
TODO: Fix so ``import_corpora()`` can take relative path.
TODO: Add https://github.com/cltk/pos_latin
"""
from cltk.corpus.arabic.corpora import ARABIC_CORPORA
from cltk.corpus.chinese.corpora import CHINESE_CORPORA
from cltk.corpus.coptic.corpora import COPTIC_CORPORA
from cltk.corpus.greek.cor... |
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2019 fasiondog/hikyuu
#
# 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 limitat... |
def solution(number): # O(N)
"""
Write a function to compute the fibonacci sequence value to the requested iteration.
>>> solution(3)
2
>>> solution(10)
55
>>> solution(20)
6765
"""
m = {
0: 0,
1: 1
} ... |
/usr/lib/python3.4/_bootlocale.py |
import base64
import json
import os
import requests
import time
from flask import Flask, jsonify, abort, make_response, redirect, request, \
url_for
from flask_oauthlib.client import OAuth
from selenium import webdriver
from config import get_config
from log import Logger
access_token = ''
def init_api_client(... |
#!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests the includeconf argument
Verify that:
1. adding includeconf to the configuration file causes the inc... |
"""DuelingDQN agent script
This manages the training phase of the off-policy DuelingDQN.
"""
import random
from collections import deque
import yaml
import numpy as np
with open('config.yml', 'r') as ymlfile:
cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)
seed = cfg['setup']['seed']
ymlfile.close()
... |
# -*- coding: utf-8 -*-
try:
from PySide import QtWidgets
except:
from PyQt5 import QtWidgets
class Python:
def __init__(self):
print("Hi") |
from django.db.models.aggregates import StdDev
from django.db.utils import NotSupportedError, ProgrammingError
from django.utils.functional import cached_property
class BaseDatabaseFeatures:
gis_enabled = False
allows_group_by_pk = False
allows_group_by_selected_pks = False
empty_fetchmany_value = []
... |
import logging
import argparse
import sys
from slow.hitter import HitterService as Hitter
from slow.hitter import KnownHosts
from slow.etl import ETL, DEFAULT_NAMES, DEFAULT_PATTERNS, DEFAULT_CONFIG
from slow.mongo_backend import MongoConnection
parser = argparse.ArgumentParser(description='Start syslog-grok-mongo ... |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for gerrit_api.py"""
import copy
import json
import mock
import requests
import tempfile
import time
import unittest
from infra.libs import gerrit... |
s1 = ' abc '
print(f'String =\'{s1}\'')
print(f'After Removing Leading Whitespaces String =\'{s1.lstrip()}\'')
print(f'After Removing Trailing Whitespaces String =\'{s1.rstrip()}\'')
print(f'After Trimming Whitespaces String =\'{s1.strip()}\'')
# string with new line
s1 = ' X\n Y \nZ \t'
print(s1)
print(s1.... |
# Not Copyright (¬C) 2022 Greg S. Kurzepa
from floodsystem.geo import rivers_by_station_number
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 1E"""
station_list = build_station_list()
output = rivers_by_station_number(station_list, 9)
print(output)
if __na... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/2/5 0005 上午 8:56
# @Author : Trojx
# @File : __init__.py.py |
#!/usr/bin/env python3
# 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 parlai.core.teachers import DialogTeacher
from .build import build
import json
import os
class DefaultTeacher(Di... |
import ctypes
import os
import sys
from datetime import date, datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Type, Union
import numpy as np
from polars.datatypes import DataType, Date, Datetime
if sys.version_info >= (3, 10):
from t... |
# Copyright (c) OpenMMLab. All rights reserved.
from mmcv import Config
from mmpose.datasets.builder import build_dataset
def test_concat_dataset():
# build COCO-like dataset config
dataset_info = Config.fromfile(
'configs/_base_/datasets/coco.py').dataset_info
channel_cfg = dict(
num_ou... |
import os
for file in os.listdir("upload"):
if file.endswith(".jpg"):
print(file.rsplit('.', 1)[0])
os.system('PhotoAvatarLib.exe ' + file.rsplit('.', 1)[0])
fp = open(os.path.join('result', file.rsplit('.', 1)[0] + '.mtl'), "w")
fp.write('newmtl material_1\nmap_Kd %s_face.jpg' % f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pyevr.main`."""
import pytest
from click.testing import CliRunner
from pyevr.main import main
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
#... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
from boost_histogram.numpy import histogram, histogram2d, histogramdd
__all__ = ("histogram", "histogram2d", "histogramdd") |
#!/usr/bin/env https://github.com/Tandelajr/mr.tandela
# MIT License
#
# Copyright (C) 2020, Entynetproject. 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
# in the Software without re... |
# Copyright (c) Gary Strangman. All rights reserved
#
# Disclaimer
#
# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warranties
# of merchantability and fitness for a given application. In no event
# shall Gary Strangman be liable fo... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
WSGI config for award_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
import logging
from troposphere.events import Rule, Target
from buildlib.helpers.client_helper import ClientHelper
class EventsHelper(object):
def __init__(self, template, project, session=None):
self.client = ClientHelper.get_client('events', session)
self.project = project
self.templat... |
"""
Copyright (c) 2015
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 the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in ... |
#!/usr/bin/env python3
# RosViewer.py = node that listens to a ROS image message topic,
# and displays the image using OpenCV.
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class image_viewer: # "/camera/color/image_raw" or "/camera/color... |
from temboo.Library.OneLogin.Roles.ListAll import ListAll, ListAllInputSet, ListAllResultSet, ListAllChoreographyExecution
from temboo.Library.OneLogin.Roles.ShowRole import ShowRole, ShowRoleInputSet, ShowRoleResultSet, ShowRoleChoreographyExecution |
import random
#GLOBAL VARIABLE
ttt = [[1,2,3],[4,5,6],[7,8,9]]
#PRINTING THE BOARD FUNCTION
def printing():
print()
for i , j in enumerate(ttt):
if i > 0:
print('---------')
print(j[0],'|',j[1],'|',j[2])
print()
#RESET THE BOARD
## WITH THIS FUNCTION THE USER CAN RESET BOARD ... |
# pylint: disable=preferred-module # FIXME: remove once migrated per GH-725
import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.rules.ShellWithoutPipefail import ShellWithoutPipefail
from ansiblelint.testing import RunFromText
FAIL_TASKS = '''
---
- hosts: localhost
become: no
tasks:
... |
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020-2021 NV Access Limited, Leonard de Ruijter
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""Logic for NVDA + Google Chrome tests
"""
impor... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-04 16:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tags', '0001_initial'),
]
operations = [
mi... |
import discord
from discord.ext import commands
from discord.ext.commands import cog
import discord_slash
from discord_slash import cog_ext
class Slashes(commands.Cog):
def __init__(self, client) -> None:
self.client: commands.Bot = client
@commands.Cog.listener()
async def on_ready(self):
... |
from modules import index
import argparse
commands = ["cleanup", "re-index"]
parser = argparse.ArgumentParser(description='Manager for the Inverted Index.')
parser.add_argument('command', choices=commands, help='Command to perform on index.')
parser.add_argument('--in_s3', action='store_true', help='If passed, the in... |
import logging
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.user import User
from pajbot.modules import BaseModule
from pajbot.modules import ModuleSetting
from pajbot.utils import time_since
log = logging.getLogger(__name__)
class TopModule(BaseModule):
... |
from pympler.asizeof import asizeof
def get_size(obj):
"""get the size in units of Mb"""
return asizeof(obj) / 1000000
if __name__ == "__main__":
# prom.start_http_server(9001)
import os
import shutil
import sys
import logging
from pathlib import Path
# from multiprocessing_lo... |
# coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
VERSION = "0.11.0"
class VerifyVersionCommand(install):
"""
Custom command to verify that the git tag matches our version
See https://circleci.com/blog/continuously-deplo... |
__author__ = "Baishali Dutta"
__copyright__ = "Copyright (C) 2021 Baishali Dutta"
__license__ = "Apache License 2.0"
__version__ = "0.1"
# -------------------------------------------------------------------------
# Import Libraries
# -----------------------------------------------------------... |
import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.get import TemplateGetNode
from programy.parser.template.nodes.eval import TemplateEvalNode
from programytest.parser.temp... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org
# Copyright (c) 2016 Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
from django.conf.urls import url, include
# import cloudedbats_django.djangoapp_cloudedbats_species.views as species_vie... |
import pytest
from ddtrace.opentracer.span import Span
from tests.utils import DummyTracer
@pytest.fixture
def nop_tracer():
from ddtrace.opentracer import Tracer
tracer = Tracer(service_name="mysvc", config={})
# use the same test tracer used by the primary tests
tracer._tracer = DummyTracer()
... |
""""""
import copy
import logging
import multiprocessing
import sys
import urllib3
class Configuration(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
_default = None
... |
/home/runner/.cache/pip/pool/19/95/b4/79c323071b97ca9595e50046631f61416d54102a34467d3d73b54737d7 |
import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token="xoxb-435046985394-3004455722741-fpIQQHskeFNILHcT3hGoPIF7");
channel_id="wordle"
is_solved = True
guesses = []
with open("tmp", "r") as f:
for line in f:
line = line.strip()
if line == "IMPOSSIBLE":
... |
"""
ckwg +31
Copyright 2016-2017 by Kitware, Inc.
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 the above copyright notice,
this list of conditions and... |
import pytest
"""
This file include several configuration of answers to setup file.
Each configuration should be completed without errors to pass this tests.
"""
@pytest.mark.skip
def test_all_python_versions_deploy():
"""Test setup.py format correct for all Python versions support."""
pass
@pytest.mark.s... |
# qubit number=4
# total number=36
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... |
# coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... |
import unittest
import time
from vika import Vika
from . import TEST_TABLE, TEST_API_BASE, TEST_API_TOKEN
class TestCreateRecords(unittest.TestCase):
def setUp(self):
vika = Vika(TEST_API_TOKEN)
vika.set_api_base(TEST_API_BASE)
self.dst = vika.datasheet(TEST_TABLE)
def test_record_cre... |
import json
import os
import sqlite3
from datetime import datetime
from pathlib import Path
import asyncpg
from tabulate import tabulate
from typing import Dict
from openmaptiles.pgutils import get_postgis_version, get_vector_layers
from openmaptiles.sqlite_utils import query
from openmaptiles.sqltomvt import MvtGene... |
from onnx_chainer.functions.activation import convert_ClippedReLU # NOQA
from onnx_chainer.functions.activation import convert_ELU # NOQA
from onnx_chainer.functions.activation import convert_HardSigmoid # NOQA
from onnx_chainer.functions.activation import convert_LeakyReLU # NOQA
from onnx_chainer.functions.activa... |
#!/usr/bin/env python3
# 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.
__all__ = ["rng", "tensor_types", "util"] |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
#!/usr/bin/python
import sys
import os
import subprocess
filename = 'haha.txt'
try:
f = open(filename, 'rU')
text = f.read()
f.close()
except IOError:
## Control jumps directly to here if any of the above lines throws IOError.
sys.stderr.write('problem reading:' + filename)
## In any case, the code th... |
from fastapi import Depends, HTTPException
from fastapi import status, APIRouter
from jose import JWTError, jwt
from sqlalchemy.orm import Session
from app.core.dependecies import get_db, SECRET_KEY, ALGORITHM, TokenPurpose, get_current_active_user, get_current_user, \
verify_password
from app.core.internal import... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import numpy as np
import multiprocessing as mp
import pathlib as pl
import pandas as pd
import pickle
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC as SupportVectorClassifier
from sklearn.metrics import accuracy_score, f1_score
from sklearn.model_selection import train_test_split
fro... |
import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
import pycocotools
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-12-13 21:23
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0004_presenter_profile_image_thumb'),
]
... |
#!/usr/bin/env python
'''
Migrate old Galaxy tool shed to next gen Galaxy tool shed. Specifically, the tool archives stored as
files in the old tool shed will be migrated to mercurial repositories in the next gen tool shed. This
script can be run any number of times as it initially eliminates any current repositories... |
# Copyright 2018 Datawire. 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 agr... |
# imports
import numpy as np
import os, sys, pickle
file_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(file_dir)
# custom import
from theory import depth
from viz import get_colours
from numpy_simulation import *
from utils import load_experiment
from theory import critical_point
def perform_expe... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from threatexchange.extensions.text_tlsh.text_tlsh import TextTLSHSignal
try:
import tlsh
_DISABLED = False
except ImportError:
_DISABLED = True
@unittest.skipIf(_DISABLED, "tlsh not installed")
class TLSHHasherModul... |
###########################################################################
# This file holds the plotting routine for the KP solution from the Schmiesy
# Thesie. There is no timestepping, it plots only the initial condition.
############################################################################
import numpy as ... |
from rumergy_backend.rumergy.models import DataLogMeasures
from rest_framework import serializers
class DataLogMeasuresSerializer(serializers.ModelSerializer):
"""Serializer for data log measures model"""
class Meta:
model = DataLogMeasures
fields = ["id", "data_log", "data_point", "value", "... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
drivername = 'vertica+pyodbc'
username = 'your_name'
host = 'your_host_ip_or_hostname'
database = 'your_db_name'
# odbcinst.ini entry [vertica_deploy_test_db]
odbcpath = '/path/to/your/odbc.ini'
datasource = 'your_odbc.ini_section' |
# SPDX-FileCopyrightText: 2020 Splunk Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""
Copyright (C) 2005-2019 Splunk Inc. All Rights Reserved.
log utility for TA
"""
from builtins import object
import logging
import logging.handlers as handlers
import os.path as op
from splunktalib.splunk_platform import make_splun... |
import string
import random
from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer
from otp.chat import ChatGarbler
class ToonChatGarbler(ChatGarbler.ChatGarbler):
animalSounds = {'dog': TTLocalizer.ChatGarblerDog,
'cat': TTLocalizer.ChatGarblerCat,
'mouse': TTLocalizer.ChatGarble... |
# Python 2/3 compatibility
from __future__ import absolute_import, division, print_function
import xarray as xr
import numpy as np
import pandas as pd
import xscale.signal.fitting as xfit
def test_polyfit():
Nt, Nx, Ny = 100, 128, 128
rand = xr.DataArray(np.random.rand(Nt, Nx, Ny), dims=['time', 'x', 'y'])
slopes =... |
#
# 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... |
# -*- encoding: utf-8 -*-
'''
Created on 2012-3-23
@author: Neil
'''
from django.shortcuts import render_to_response
from grnglow.glow.views import people
from grnglow.glow.models.photo import Photo
def base(request):
return render_to_response('base.html')
def index(request):
if request.user.is_authenticat... |
# Lint as: python2, python3
# Copyright 2015 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 req... |
import os
from PIL import Image
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import mod... |
#from matplotlib.figure import Figure
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
from collections import OrderedDict
import numpy as np
import sys
def GET_COLOR(x):
if str(x)[:3].lower() == "rgb":
vals=x.split("rgb(")[-1].split(")")[0].split(",")
... |
from selenium import webdriver
import pandas as pd
import time
"""[注意事項]
robot.txtを必ず読んで、ルールに沿った形でクローリングするように気をつけてください。
あくまで自己責任でお願いできればと思います。
"""
"""[Initial Setting]
初期設定
"""
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.add_argument('--disable-gpu')
options.add_argument('--lang-ja... |
"""A modified image folder class
We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py)
so that this class can load images from both current directory and its subdirectories.
"""
import torch.utils.data as data
from PIL import Image
import os
import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.