content stringlengths 0 894k | type stringclasses 2
values |
|---|---|
'''
siehe Bilder in diesem Ordner
F: Forget Gate -> welche vorherigen Informationen werden verworfen
I: Input Gate -> welche neuen Informationen sind wichtig
O: Output Gate -> welche Informationen werden intern im Cell State gespeichert
C: Candidate State -> welche Informationen werden intern dem Cell State (c) hinzuge... | python |
# stdlib
import os
import zipfile
from typing import Type, Union
# 3rd party
import handy_archives
import pytest
import remotezip
from apeye import URL
from coincidence.params import param
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from domdf_python_tools.paths imp... | python |
class Postprocessor:
pass
| python |
from .test_task import TestEnv
# Robot Import
from .agents.stretch import Stretch
from .agents.pr2 import PR2
# Human Import
from .agents.human import Human
from .agents import human
# Robot Configuration
robot_arm = 'left'
# Human Configuration
# human_controllable_joint_indices = human.right_arm_joints
class Tes... | python |
from typing_extensions import Protocol
class HasStr(Protocol):
def __str__(self) -> str:
... | python |
# This entry point is intended to be used to start the backend at a terminal for debugging purposes.
from backend import app
app.main() | python |
"""
ASDF tags for geometry related models.
"""
from asdf_astropy.converters.transform.core import TransformConverterBase
__all__ = ['DirectionCosinesConverter', 'SphericalCartesianConverter']
class DirectionCosinesConverter(TransformConverterBase):
tags = ["tag:stsci.edu:gwcs/direction_cosines-*"]
types = ... | python |
import asyncio
import base64
import json
import os
from dataclasses import dataclass
from datetime import datetime, timezone
from email.message import EmailMessage
from enum import Enum
from io import BytesIO
from typing import List, Optional
from uuid import uuid4
import pytest
from aiohttp import ClientSession, Clie... | python |
from .alias import *
from .bookmark import *
__all__ = [ 'ALIAS_KIND_FILE', 'ALIAS_KIND_FOLDER',
'ALIAS_HFS_VOLUME_SIGNATURE',
'ALIAS_FIXED_DISK', 'ALIAS_NETWORK_DISK', 'ALIAS_400KB_FLOPPY_DISK',
'ALIAS_800KB_FLOPPY_DISK', 'ALIAS_1_44MB_FLOPPY_DISK',
'ALIAS_EJECTABLE_DIS... | python |
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand
from django.utils import translation
User = get_user_model()
user_deletion_config = apps.get_app_config('user_del... | python |
# -*- coding: utf-8 -*-
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class OnTaskConfig(AppConfig):
name = 'ontask'
verbose_name = _('OnTask')
def ready(self):
# Needed so that the signal registration is done
from ontask import signals # noqa... | python |
from app import db
class Entity(db.Model):
__tablename__ = 'entities'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), index=True)
description = db.Column(db.Text, index=True)
def __repr__(self):
return "<Entity '{}'>".format(self.name)
class WikipediaSuggest(d... | python |
from wx import wx
from wx.lib.pubsub import Publisher
import select
import socket
import sys
import Queue
import os
from thread import *
from collections import defaultdict
uploadInfos = defaultdict(dict) # For seeders
downloadInfos = defaultdict(dict) # For leechers
pieceRequestQueue = defaultdict(dict) # For lee... | python |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2021 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.
"""Community access system field."""
from invenio_rdm_records.records.systemfields.access... | python |
from datetime import datetime
from typing import List
from fastapi import APIRouter
from utils.database import database
from .models import replies
from .schema import ReplyIn, Reply, LikeIn, Like
replies_router = APIRouter()
@replies_router.get("/list-for-post/{post_id}/", response_model=List[Reply])
async def li... | python |
# Generated by Django 3.0.6 on 2020-05-20 10:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("resources", "0003_auto_20200520_0825"),
]
operations = [
migrations.RemoveField(model_name="land", name="images",),
]
| python |
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-2013, all entities within the AUTHORS file
# :license: 3-clause BS... | python |
#-*- coding: utf-8 -*-
'''
Copyright (c) 2016 NSR (National Security Research Institute)
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 t... | python |
# Copyright 2021 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 ... | python |
import curve25519
import time
# from urandom import randint
d = b'\x70\x1f\xb4\x30\x86\x55\xb4\x76\xb6\x78\x9b\x73\x25\xf9\xea\x8c\xdd\xd1\x6a\x58\x53\x3f\xf6\xd9\xe6\x00\x09\x46\x4a\x5f\x9d\x54\x00\x00\x00\x00'
u = b'\x09' + bytes(31)
v = b'\xd9\xd3\xce~\xa2\xc5\xe9)\xb2a|m~M=\x92L\xd1Hw,\xdd\x1e\xe0\xb4\x86\xa0\xb8\... | python |
import torch
import pytest
def test_nll(device):
from speechbrain.nnet.losses import nll_loss
predictions = torch.zeros(4, 10, 8, device=device)
targets = torch.zeros(4, 10, device=device)
lengths = torch.ones(4, device=device)
out_cost = nll_loss(predictions, targets, lengths)
assert torch.a... | python |
amount = int(input("Inserire il reddito imponibile: "))
married = input("Sei coniugato? [y/N]: ") == "y"
if married:
if amount > 64000:
tax = 8800 + (amount - 64000) * .25
elif amount > 16000:
tax = 1600 + (amount - 16000) * .15
else:
tax = amount * .10
else:
if amount > 32000:
... | python |
# Source Generated with Decompyle++
# File: device_parameter_component.pyc (Python 2.5)
from __future__ import absolute_import
from ableton.v2.control_surface.control import ControlList
from pushbase.device_parameter_component import DeviceParameterComponentBase
from mapped_control import MappedControl
class DevicePa... | python |
import codecs
from luadata.serializer.unserialize import unserialize
def read(path, encoding="utf-8", multival=False):
"""Read luadata from file
Args:
path (str): file path
encoding (str, optional): file encoding. Defaults to "utf-8".
Returns:
tuple([*]): unserialized data from l... | python |
# This is to test the conditions in python
# Demo for if and elsif
number = int(input("Please enter a number to check\n"))
if number <100:
print("the number is less that 100")
elif number == 100:
print("the number is equal to 100")
else:
print("number is more than 100\n")
# this part
city = ['Tokyo', 'Ne... | python |
#!/usr/bin/env python
# Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io>
import multiprocessing
import os
import random
import sys
import threading
import time
from collections import defaultdict
from datetime import datetime
from itertools import chain
from multiprocessing import Process
from multiprocessing... | python |
#!/usr/bin/env python
"""Application controller for FastTree
designed for FastTree v1.1.0 . Also functions with v2.0.1, v2.1.0, and v2.1.3
though only with basic functionality"""
from cogent.app.parameters import ValuedParameter, FlagParameter, \
MixedParameter
from cogent.app.util import CommandLineApplicati... | python |
from service_runner.service_runner.answeb.ansible_api import AnsibleApi
from service_runner.service_runner.asset.models import Host
from django.conf import settings
DEFAULT_PLAYBOOKS_PATH = settings.BASE_DIR + '/service_runner/answeb/playbooks/'
def format_uptime_result(host, result):
callback = {
'messa... | python |
# 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 writing,... | python |
import random
import sys
def main():
amount = 1000000
min = 0
max = sys.maxsize #To get some big integer
#Fixed Length from 2 to 6
for i in range(2,7):
result = 0
#Generate N amount of array with fixed length above
for a in range(amount):
array = ... | python |
# some changes
| python |
from scapy.all import *
interface = 'mon0'
ap_list = []
def info(fm):
if fm.haslayer(Dot11):
if ((fm.type == 0) & (fm.subtype==8)):
if fm.addr2 not in ap_list:
ap_list.append(fm.addr2)
print "SSID--> ",fm.info,"-- BSSID --> ",fm.addr2
sniff(iface=interface,prn=info)
| python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/4/17 13:48
# @File : db.py
# @Role : ORM
from datetime import datetime
from sqlalchemy import Column, String, Integer, DateTime, UniqueConstraint, DECIMAL
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import class_mapp... | python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | python |
import os
import unittest
from django.test import TestCase
from utils import description_for_objective, ellipsis, objectives_for_course
valid_course = 'MG4'
valid_objective = 'MG4-FACTMULT'
class BasicTests(TestCase):
def test_ellipsis(self):
long_str = 'yadayadayada'
self.assertEquals(ellipsis... | python |
# (c) 2016 James Turner <turnerjsm@gmail.com>
# (c) 2017 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: aws_service_ip_ranges
author:
- Jam... | python |
from deque import Deque
def isPalindrome(string: str)->bool:
d = Deque()
for character in string:
d.addRear(character)
isPalindromeFlag: bool = True
while d.size() > 1 and isPalindromeFlag:
if d.removeFront() != d.removeRear():
isPalindromeFlag = False
return ... | python |
from django.contrib.auth import views as auth_views
from django.urls import path
from accounts import views
from accounts.views import (
dealerSignupView, adminSignupView,
customerSignupView)
app_name = "accounts"
urlpatterns = [
path('login/', auth_views.LoginView.as_view(
template_name="accounts... | python |
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from knox.auth import TokenAuthentication
class RootView(APIView):
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated,)
def get(... | python |
import sys
from collections import deque
from gym_snake.envs import *
from gym_snake.base.pos import Pos
from gym_snake.base.direc import Direc
class _HamiltonTableCell:
def __init__(self):
self.idx = None
self.direc = Direc.NONE
self.reset()
def __str__(self):
return "{ idx... | python |
#==================================================================================
# PROGRAM: "boat_sat.py"
# LOCATION: beluga>examples>Mansell
# Author: Justin Mansell (2016)
#
# Description: simple path optimization for a boat with bounded control used
# to demonstrate graph search continuation. Uses sa... | python |
import namespace_override as override
def _(methods, address, class_name):
ret = []
post = []
if 'using.cs' in methods:
add_to = [ret]
for line in methods['using.cs']:
if '---;' not in line:
add_to[0] += [line]
else:
add_to = [post]
... | python |
from abc import abstractmethod
from typing import Union, Optional, Any, List, Coroutine
import inspect
from .typings import TProtocol
from .interact import InteractiveObject, IOManager
from .component import MetadataComponent
from .behavior import BaseBehavior
from .utilles import IOStatus
class MonoMetaComponent(Me... | python |
try:
from . import generic as g
except BaseException:
import generic as g
class SectionTest(g.unittest.TestCase):
def test_section(self):
mesh = g.get_mesh('featuretype.STL')
# this hits many edge cases
step = .125
z_levels = g.np.arange(start=mesh.bounds[0][2],
... | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-27 10:58
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aggregator', '0039_merge_20190316_2108'),
]
operations = [
mi... | python |
from django.test import TestCase
from rodan.models.job import Job
# from model_mommy import mommy
from rodan.test.helpers import RodanTestTearDownMixin, RodanTestSetUpMixin
class JobTestCase(RodanTestTearDownMixin, TestCase, RodanTestSetUpMixin):
def setUp(self):
self.setUp_rodan()
def test_save(self... | python |
import sys
import base64
import logging
import marshal
import importlib.util
from os import sep as path_sep
from paker.exceptions import PakerImportError
# use _memimporter if is available
_MEMIMPORTER = False
try:
import _memimporter
_MEMIMPORTER = True
except ImportError:
from paker.importers import _te... | python |
from dataclasses import dataclass
from typing import Optional, List
@dataclass
class Attack:
name: str
cost: List[str]
convertedEnergyCost: int
damage: Optional[str]
text: Optional[str]
| python |
from django import template
from django.utils import timezone
from schedules.services import get_times_from_day
from schedules.models import TimeOfDay
register = template.Library()
@register.inclusion_tag('templatetags/calendar_month.html')
def calendar_month():
variable = None
print(">>>>>>")
return {'... | python |
from mock import patch
from nerve_tools.envoy import get_envoy_ingress_listeners
def test_get_envoy_ingress_listeners_success():
expected_envoy_listeners = {
('test_service.main', 1234): 54321,
}
mock_envoy_admin_listeners_return_value = {
'listener_statuses': [
{
... | python |
import datetime
def convert_timestamp(ts: str) -> str:
"""Helper function that converts timestamp to %m-%d-%Y format"""
datetime_obj = datetime.datetime.fromtimestamp(ts)
date = datetime.datetime.strftime(datetime_obj,"%m-%d-%Y")
return date
def extract_attributes_from_subreddit(subreddit) -> dict:
... | python |
# Exercise 76 - Date and Time Generator
from datetime import datetime
print(datetime.now().strftime('Today is %A, %B %d, %Y')) | python |
from django.apps import AppConfig
class EvaluationConfig(AppConfig):
name = "grandchallenge.evaluation"
def ready(self):
# noinspection PyUnresolvedReferences
import grandchallenge.evaluation.signals
| python |
# -*- coding: utf-8 -*-
from Startup import db
from sqlalchemy import Column, Integer, DateTime, Text
class History_Data(db.Model):
__tablename__ = 'history_data'
ID = Column(Integer, primary_key=True, autoincrement=True , comment='編號')
msg = Column(Text(), nullable=False, comment='歷史訊息')
InertDat... | python |
# Copyright 2021 MONAI Consortium
# 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, s... | python |
#!/usr/bin/env python
import os
import argparse
import logging
from log_collectors.training_data_service_client import match_log_file
from log_collectors.training_data_service_client import push_log_line
from log_collectors.training_data_service_client import scan_log_dirs
def main():
logging.basicConfig(format=... | python |
import os
import pickle
import multiprocessing as mp
from collections import defaultdict
from nltk import pos_tag, sent_tokenize, wordpunct_tokenize
class Preprocessor(object):
def __init__(self, corpus, target=None,**kwargs):
self.corpus = corpus
self.target = target
results = ... | python |
import doctest
import io
from contextlib import redirect_stderr, redirect_stdout
from textwrap import dedent
from scoraptor.result import TestResult
class SingleDocTest:
"""
A single DocTest based test.
Instances of this class are callable. When called, it takes
a global_environment dict, and return... | python |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 9 11:06:16 2018
Test for the function of the chi2 script of the omnitool package.
@author: misiak
"""
import sys
from os import path
import numpy as np
import matplotlib.pyplot as plt
import mcmc_red as mcr
plt.close('all')
fs = 1e3
t_range = ... | python |
from crudbuilder.abstract import BaseCrudBuilder
from .models import Person
from crudbuilder.abstract import BaseCrudBuilder
from crudbuilder.formset import BaseInlineFormset
class PersonCrud(BaseCrudBuilder):
model = Person
search_fields = ['name']
tables2_fields = ('name', 'email')
t... | python |
class Pos:
def __init__(self, x = 0, y = 0, z = 0):
self.x = x
self.y = y
self.z = z
self.dx = 0
self.dy = 0
self.dz = 0
def move(self):
self.x += self.dx
self.y += self.dy
self.z += self.dz
| python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import authentication.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | python |
from tracardi.domain.import_config import ImportConfig, ImportConfigRecord
from tracardi.domain.storage_result import StorageResult
from tracardi.service.storage.factory import storage_manager
from typing import Optional
async def load(id: str) -> Optional[ImportConfig]:
import_configuration = await storage_manag... | python |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ApiVersionResp:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is ... | python |
import time
import re
from collections import Counter
import operator
start_time = time.time()
def getManhattanDistance(src, dest):
return abs(src[0] - dest[0]) + abs(src[1] - dest[1])
with open("input") as f:
coords = f.readlines()
coords = [list(map(int,re.findall(r"\d+",x.strip()))) for x in coords]
# ==... | python |
#!/usr/bin/env python3
import calendar
from datetime import *
import fileinput
import html
import importlib
import math
import os
from os import path
import pkgutil
import re
import subprocess
import sys
import textwrap
from jinja2 import Environment, FileSystemLoader, select_autoescape
import diags
# START configura... | python |
# -*- coding: utf-8 -*-
# @Author: Konstantin Schuckmann
# @Date: 2021-10-28 14:36:06
# @Last Modified by: Konstantin Schuckmann
# @Last Modified time: 2021-10-29 09:30:48
import pandas as pd
import numpy as np
# Needed for generating data from an existing dataset
from sklearn.neighbors import KernelDensity
from ... | python |
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'quartiles' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts INTEGER_ARRAY arr as parameter.
#
def quartiles(arr):
# Write your code here
arr = sorted(arr)
length_Of_Ar... | python |
from model.client import Client
import string
import random
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:],"n:f:", ["number of clients", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n=5
f= "data/clients.json"
for o, a in op... | python |
"""
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | python |
import uuid
from django.db import models
from django.urls import reverse
class Masternode(models.Model):
# every masternode is bound to one transaction that shows the
# spend 1 500 001 bbp
txid = models.CharField(max_length=100, primary_key=True, editable=False)
# the address related to t... | python |
'''
FastAPI Demo
SQLAlchemy ORM Models
'''
# Standard Imports
# PyPi Imports
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
# Local Imports
from database.setup import Base
###############################################################################
class User(Base):
'''ORM Models - users'''
_... | python |
"""
Classe for reading/writing SpikeTrains in a text file.
It is the simple case where different spiketrains are written line by line.
Supported : Read/Write
Author: sgarcia
"""
import os
import numpy as np
import quantities as pq
from neo.io.baseio import BaseIO
from neo.core import Segment, SpikeTrain
class A... | python |
import unittest
from main import Min_Heap
class MinHeapTestCase(unittest.TestCase):
def test_min_heap_returns_None_if_peek_is_called_with_no_items(self):
heap = Min_Heap()
self.assertEqual(heap.peek_min(), None)
def test_min_heap_returns_None_if_extract_is_called_with_no_items(self):
... | python |
from typing import Tuple, Callable
from thinc.api import Model, to_numpy
from thinc.types import Ragged, Ints1d
from ..util import registry
@registry.layers("spacy.extract_spans.v1")
def extract_spans() -> Model[Tuple[Ragged, Ragged], Ragged]:
"""Extract spans from a sequence of source arrays, as specified by an... | python |
"""Initial revision
Revision ID: df419851a830
Revises:
Create Date: 2020-11-11 18:00:45.523670
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'df419851a830'
down_revision = None
branch_labels = None
depends_on = None
... | python |
# Copyright (C) 2021-2022 Modin authors
#
# SPDX-License-Identifier: Apache-2.0
"""``DaskRunner`` class functionality."""
import os
import warnings
from unidist.cli.base.runner import BackendRunner
from unidist.cli.base.utils import Defaults, validate_num_cpus
from unidist.core.base.common import BackendName
class... | python |
import argparse
import codecs
from typing import Dict, Union
import os
import yaml
import optuna
from .model.constant import *
from .train import main as train
DB_URL = 'mysql+pymysql://pmod:pmod@{host}:13306/optuna_pmod?charset=utf8'
RESULT_DIR = os.path.join(DIR_OPTUNA, DIR_RESULTS)
def parse_args() -> Dict[str, st... | python |
'''
Prints data about general statistics by region
'''
def runStat(dashes):
regions = {}
for dash in dashes.dashes:
if dash.region in regions:
regions[dash.region]["pay"] += dash.total
regions[dash.region]["num"] += 1
delta = dash.end - dash.start
regions[... | python |
#!/usr/bin/env python3
import funct
import sql
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('metrics.html')
print('Content-type: text/html\n')
funct.check_login()
try:
user, user_id, role, token, servers = funct... | python |
import sys
lista = [
('chave1', 'valor1'),
('chave2', 'valor2'),
('chave1', 'valor1'),
('chave2', 'valor2'),
('chave1', 'valor1'),
]
#d1 = {x.upper(): y.upper() for x, y in lista} # deixa tudo em maiusculo
#d1 = {x for x in range(5)}
d1 = {f'chave_{x}': 'a' for x in range(5)}
print(d1)
print(sys.ge... | python |
from githubpy import *
def main():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--token")
parser.add_argument("-o", "--owner")
parser.add_argument("-r", "--repo")
parser.add_argument("-w", "--workflow", action='append', default=[])
parser.add_ar... | python |
#!/usr/bin/env python3
from PyQt5.QtWidgets import *
import sys
class Window(QWidget):
def __init__(self):
QWidget.__init__(self)
layout = QGridLayout()
self.setLayout(layout)
toolbox = QToolBox()
layout.addWidget(toolbox, 0, 0)
label = QLabel()
toolbox.a... | python |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# mkv.py - Matroska Streaming Video Files
# -----------------------------------------------------------------------------
# $Id$
#
# -----------------------------------------------------------------------------
... | python |
#Author:D4Vinci
def ip2long(ip):
ip = ip.split("/")[0].split(":")[0]
p = ip.split(".")
return str( ( ( ( ( int(p[0]) * 256 + int(p[1]) ) * 256 ) + int(p[2]) ) * 256 ) + int(p[3]))
#p[0] + "." + str( ( ( ( int( p[1] ) * 256 + int( p[2] ) ) * 256 ) + int( p[3] ) ) * 256 ),
... | python |
import os.path
activate_this = os.path.join(os.path.dirname(os.path.realpath(__file__)), '.pyvenv/bin/activate_this.py')
exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this))
import syslog
from dotenv import dotenv_values
from keycloak import KeycloakOpenID
from keycloak.except... | python |
from dagster import execute_pipeline
from docs_snippets.concepts.configuration.config_mapping import example_pipeline
def test_config_mapping():
res = execute_pipeline(example_pipeline)
assert res.success
assert res.result_for_solid("hello_external").output_value() == "Hello, Sam!"
res = execute_pipe... | python |
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
__author__ = 'but0n'
from multiprocessing import Pool, Manager
from bs4 import BeautifulSoup
import time, random, requests, sqlite3, os
server = Manager()
host = 'http://www.80s.tw'
screen = server.dict({'label' : 'NONE', 'url' : 'http://baidu.com', 'title':'none... | python |
import os
from setuptools import setup, find_packages
DESCRIPTION = (
"Graphical interface to manage Flatpak, Snap, AppImage and AUR packages"
)
AUTHOR = "Vinicius Moreira"
AUTHOR_EMAIL = "vinicius_fmoreira@hotmail.com"
NAME = 'bauh'
URL = "https://github.com/vinifmor/" + NAME
file_dir = os.path.dirname(os.path... | python |
import pygame as pg
class Snake(object):
def __init__(self, speed, tiles, path, length, message=None):
self.tiles = tiles
self.speed = speed
self.length = length
self.message = message
self.body_color = pg.Color("red")
self.head_color = pg.Color("blue")
se... | python |
#-----------------------------------------------------------
# Baixar vídeos do youtube
#
# Programa copiado para teste, visto no Instagram: @pycodebr
#-----------------------------------------------------------
import os
from termcolor import colored
from pytube import YouTube
# Limpa tela ao iniciar // Clean screen ... | python |
import convert
keypointSimilarity = .80
passwordSimilarity = .50
correctness = None
'Carries out the comparison between the stored password and the attempted password'
def compare_data(password, attempt):
global correctness
pass_array = stripOutZeros(password)
attempt_array = stripOutZeros(attempt)
pa... | python |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Pocket PiAP
# ......................................................................
# Copyright (c) 2017-2020, Kendrick Walls
# ......................................................................
# Licensed under MIT (the "License");
# you may not use this file exce... | python |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
import tki... | python |
import collections
import importlib
import glob
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader, ConcatDataset
from unet3d.utils import get_logger
logger = get_logger('HDF5Dataset')
class HDF5Dataset(Dataset):
def __init__(self, file_path, phase):
... | python |
from .aggregate_representation import AggregateRepresentationTransformation
from .aggregate_representation_softmax import AggregateRepresentationTransformationSoftmax
from .edge_state_update import EdgeStateUpdateTransformation
from .input_sequence_direct import InputSequenceDirectTransformation
from .new_nodes_vote im... | python |
import appuifw as ui
import globalui
from pytriloquist import Const
from pytriloquist.btclient import BluetoothError
from pytriloquist.gui import Dialog
from pytriloquist.gui.settings import SettingsDialog
from pytriloquist.gui.app import ApplicationsDialog
from pytriloquist.gui.input import InputDialog
cla... | python |
import tensorflow as tf
def nalu(input_layer, num_outputs, epsilon=1e-6):
""" Calculate the Neural Arithmetic Logic Unit (NALU).
Arguments:
input_layer - the input vector we want to the NALU of.
num_outputs - dimension of the output vector.
epsilon - small shift to prevent log(0)
Re... | python |
from unifuncnet.fetchers.compound_fetchers.compound_fetcher import *
from unifuncnet.utils.rhea_sqlite_connector import RheaSqliteConnector
class CompoundFetcherRhea(CompoundFetcher, RheaSqliteConnector):
def __init__(self, compound_id, memory_storage=None):
CompoundFetcher.__init__(self, compound_id=comp... | python |
import json
from unittest import TestCase
from django.test.client import Client
from mock import patch
from regcore_write.views.notice import *
class ViewsNoticeTest(TestCase):
def test_add_not_json(self):
url = '/notice/docdoc'
response = Client().put(url, content_type='application/json',
... | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.