content stringlengths 5 1.05M |
|---|
# Copyright 2016 Autodesk 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... |
import socket
addr = socket.gethostbyname("www.linkedin.com")
print(addr) |
from .__init__ import *
from ..__init__ import Generator
def intersectionOfTwoLinesFunc(minM=-10,
maxM=10,
minB=-10,
maxB=10,
minDenominator=1,
maxDenominator=6):
... |
import psycopg2
import yaml
# Get database connection information from YML file
with open("database.yml", 'r') as stream:
config = yaml.load(stream)
# Parse connection data
pghost = config[':host']
pgport = config[':port']
pgdb = config[':dbname']
pguser = config[':user']
pgpassw = config[':password'... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:synopsis: module that contains server classes.
"""
import logging
import sys
import traceback
from abc import abstractmethod
from collections import OrderedDict
from os import path
from typing import (
Union,
Tuple,
List
)
import to... |
'''
MIT License
Copyright (c) 2019 GeunHyeok LEE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... |
"""
The analysis module contains analysis related gui components.
"""
from actions import * |
# Copyright 2021 Huawei Technologies Co., Ltd
# 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 wr... |
from typing import List
from PyQt5.QtCore import QObject
class BasePlugin(QObject):
registry = []
def __init_subclass__(cls, **kwargs):
super().__init_subclass__(**kwargs)
cls.registry.append(cls)
def __init__(self, api, gui):
super().__init__()
self.api = api
s... |
import logging
from .. import components
from ..ecs import System
from ..ecs.run_state import RunState
from ..utils import perf
log = logging.getLogger(__name__)
class QuitSystem(System):
INCLUDE_STATES = {
RunState.WAIT_FOR_INPUT,
RunState.TAKE_ACTIONS,
RunState.PERFOM_ACTIONS,
}... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
"""Main module."""
import re
from collections import OrderedDict, MutableMapping
from io import StringIO
from antlr4 import (InputStream, CommonTokenStream, Pars... |
# Generated by Django 2.0.3 on 2018-03-17 19:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twits', '0002_twit_twit'),
]
operations = [
migrations.RemoveField(
model_name='twit',
name='location',
),
... |
# Packages to be imported
__all__ = ["flipkart", "amazon", "oyo", "uber"]
|
"""Config flow for sentry integration."""
from __future__ import annotations
import logging
from typing import Any
from sentry_sdk.utils import BadDsn, Dsn
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
f... |
import inspect
import sys
try:
from SimpleXMLRPCServer import SimpleXMLRPCServer
except ImportError:
from xmlrpc.server import SimpleXMLRPCServer
class RemoteServer(SimpleXMLRPCServer):
def __init__(self, library, port=8270, port_file=None):
SimpleXMLRPCServer.__init__(self, ('127.0.0.1', int(por... |
import json
from django.core.files.uploadedfile import SimpleUploadedFile
from rest_framework import status
from tests.mixins import APITestCase
class BaseTestCase(APITestCase):
def test_json_batch(self):
batch = [
{
"method": "GET",
"relative_url": "/tests/t... |
from setuptools import setup
from os import path
PROJECT_URLS = {
'Source Code': 'https://github.com/electronsz/' \
'advanced-principle-component-analysis',
'Documentation': 'https://pypi.org/project/advanced-pca/#description'
}
long_description = "Researchers use Principle Component Analy... |
#Dependencies/Modules
import os
import csv
#path to budget to open csv file
budget_data_csv = os.path.join("Resources", "budget_data.csv")
#opens budget_data csv to manipulate data for report
with open(budget_data_csv, newline='') as budget:
budget_reader = csv.reader(budget, delimiter=',')
budget_header = n... |
import urllib2
import json
from django.shortcuts import render
from myblog.models import Article
from django.core.paginator import Paginator
from django.core.paginator import PageNotAnInteger
from django.core.paginator import EmptyPage
# Create your views here.
def index(request):
results = Article.objects.all()
pa... |
# Copyright 2022 Quantapix 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 l... |
import jax
from jax import vmap, jit, random, config
import jax.numpy as jnp
import flax
from .networks import conv, lstm
from .optim import step_init
from .wavefunction import log_amplitude
from functools import partial
def initialize_model_1d(
hamiltonian,
width,
filter_size,
seed,
num_spins,... |
lots_of_numbers = range(-1000, 1000)
the_same_numbers = range(-1000, 1000)
same_numbers = (
i
for i, j in zip(lots_of_numbers, the_same_numbers)
if i is j
)
print(*same_numbers, sep=", ")
|
from .exporter import Exporter, ExportResult
from .exporter_pool import ExporterPool
from ..exceptions import MissingModuleError
__all__ = ["ExportResult", "Exporter", "ExporterPool"]
_addons = ["FileExporter", "MongoDBExporter", "ElasticSearchExporter",
"PostgreSQLExporter"]
for a in _addons:
try:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r"""
Let us start with the very simple inverse problem of fitting a polynomial curve
of degree :math:`P`
.. math::
f(x) = p_0 + p_1 x + \ldots + p_P x^P = \sum\limits_{i=0}^{P} p_i x^i
to some existing data :math:`y`.
The unknown model is the coefficient vector :mat... |
import copy
from yggdrasil.languages.Python import test_YggInterface
title_replace = ['TestYggInput', 'TestYggInputMatlab',
'TestYggRpcClient', 'TestYggRpcClientMatlab',
'TestYggAsciiFileInput', 'TestYggAsciiTableInput',
'TestYggAsciiTableOutputMatlab',
... |
from django.conf.urls import url
from .views import PaymentView, RequestPaymentSlipView, PaymentSlipRequestRecievedView
urlpatterns = [
url(r'^$', PaymentView.as_view(), name='zipfelchappe_cod_payment'),
url(r'^request-payment-slip/$', RequestPaymentSlipView.as_view(),
name='zipfelchappe_cod_payment_s... |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Redistrib... |
from datetime import datetime
from mindee.documents import Document
from mindee.fields import Field
from mindee.fields.date import Date
from mindee.http import make_api_request, make_predict_url
class Passport(Document):
def __init__(
self,
api_prediction=None,
input_file=None,
cou... |
import pytest # noqa
from actions.mediaurl_action import MediaUrlAction
def test_mediaurl_action_random(card, actions, mocker, monkeypatch):
monkeypatch.setattr("actions.mediaurl_action.random.randrange", lambda *args: 1)
card["uri"] = "random:title1 title2 title3"
action = actions["Test Action"]
ch... |
__author__ = 'las3wh'
def greeting(msg):
print(msg)
#adding a comment to make a change |
import subprocess
import os
import requests
from bs4 import BeautifulSoup
from web_assistant_win import Fetcher
class Commander:
def __init__(self):
self.confirm = ["yes", "ok", "go on", "sure", "do it", "yeah", "yaa", "Imm", "confirm", "of course"]
self.cancel = ["nope", "no", "noo", "not yet", "... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('comment', '0002_auto_20150703_1252'),
]
operations = [
migrations.RenameField(
model_name='comment',
... |
n = int(input())
for i in range(2,n//2 + 1):
print(i, end = ' ')
print(1,end = ' ')
for i in range(n//2 + 2,n + 1):
print(i, end = ' ')
print(n//2 + 1)
print(n,end = ' ')
for i in range(1,n):
print(i, end = ' ')
|
from shortify.abc import ShortifyBase
from shortify.exceptions import ShorteningError
class Shortener(ShortifyBase):
"""CleanURI.com shortener.
This class inherits from `shortify.base.ShortifyBase`.
"""
def shorten(self, url: str) -> str:
response = self.post(
"https://cleanuri.c... |
import contextlib
import datetime
import time
import os
#import six
import sys
import time
import unicodedata
import dropbox
from .models import DropboxAccount, DropboxUser
from core.channel import (Channel, NotSupportedTrigger, NotSupportedAction,
ConditionNotMet, ChannelStateForUser)
from ... |
from .one_d import rebin_1d_single_bin_weights
from .one_d import rebin_1d
|
"""
A module to combine pytorch functionality to
the pymanopt class, so that I can use pytorch
end to end
"""
import torch
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
from utils import to_numpy
from pymanopt.manifolds import Product, Stiefel, PositiveDefinite
class OrthoManifold(objec... |
"""
Combat Sim
----------
Inspired by Ben Arnold's: Making Games with Ben Series
Cowboys vs Aliens
Requirements:
* Cowboys and aliens attack each other to the death
* Cowboys and aliens attack each other simultaneously
* Each cowboy and alien have a chance to hit < 100%
* Human or player can input the number of cowb... |
keyconfig_data = \
[("3D View",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items":
[("view3d.cursor3d", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
("transform.translate",
{"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True},
{"properties":
[("cursor_t... |
#!/usr/bin/env python
#
# Copy all built artifacts from build/lib.*/* to mlpack/.
import sys
import sysconfig
import shutil
import os
directory = 'build/lib.' + \
sysconfig.get_platform() + \
'-' + \
str(sys.version_info[0]) + \
'.' + \
str(sys.version_info[1... |
from chainer.links import BatchNormalization, GroupNormalization
from chainermn.links import MultiNodeBatchNormalization
from chainer.functions import softmax_cross_entropy
from chainer.optimizers import Adam
from chainer.iterators import MultiprocessIterator, SerialIterator
from chainer.optimizer import WeightDecay
fr... |
#!/usr/bin/env python
# encoding: utf-8
"""
@description: 拦截器
@version: 1.0
@author: BaoQiang
@license: Apache Licence
@contact: mailbaoqiang@gmail.com
@site: http://www.github.com/githubao
@software: PyCharm
@file: midware.py
@time: 2016/10/3 18:00
"""
import asyncio
import json
import logging
import time
from da... |
from tests.warehouse_profile import WarehouseProfile
def test_ultimate_live_profile():
profile = WarehouseProfile()
assert profile.profile_root == "warehouse"
assert profile._const_name is None
assert profile._const_parent_name is None
assert profile.profile_is_live is True
assert not profil... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Brad Newbold (wudan07 [at] gmail.com)
# See LICENSE for details.
# common.py
#
"""wIcon library:
Common functions
"""
import math
import random
#import time
from PIL import Image, PngImagePlugin, JpegImagePlugin
#from selection import selection_get
#from selection import S... |
from imports import *
from utils import to_cpu
from sklearn.svm import SVC
from itertools import product
from parameters import par, update_parameters
from stimulus import Stimulus
from model import Model
savefn = 'saving_500neuron_120delay_v0_data_iter001900'
data = pickle.load(open('./savedir/archive/{}.pkl'.format... |
# -*- coding: utf-8 -*-
import luigi
import subprocess
import json
import gzip
import os
from pathos.multiprocessing import ProcessingPool as Pool
'''
adapter:type of adapter
quality:quality
qb:quality base (phred)
minlen:min len of contig to be valid
flist:file list to be proceed
odir:output ... |
from torch.utils.data import Dataset
from commons.process_mols import get_geometry_graph, get_lig_graph_revised, get_rdkit_coords
from dgl import batch
from rdkit.Chem import SDMolSupplier, SanitizeMol, SanitizeFlags, PropertyMol, SmilesMolSupplier, AddHs
class Ligands(Dataset):
def __init__(self, ligpath, rec_gr... |
# Copyright 2018 Tensorforce Team. 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... |
default_app_config = "core.threaded_comment.apps.ThreadedCommentConfig"
|
"""
test_improve_jobcode_description.py -- Given an HR abbreviation for a job title,
resolve the various HR abbreviations to full text words.
Version 0.1 MC 2013-12-27
-- Initial version.
Version 0.2 MC 2014-09-21
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2014, University of Fl... |
""""use integers to make sure that any computer will give the same results"""
import math
from .log import warning
PRECISION = 1000
# tables used to make sure that every computer gives the same results
_COS_TABLE = (
1000,
999,
999,
998,
997,
996,
994,
992,
990,
987,
984,... |
import os
import sys
import unittest
from locale_strings import *
# import locale_strings --> see below
class TestLocaleStrings(unittest.TestCase):
def test_narrow_match(self):
self.assertEqual(narrow_match('ANY', {'ANY'}), 'ANY')
def test_get_locale(self):
self.assertEqual(get_locale("na... |
from concurrent.futures import TimeoutError
import pytest
from brewtils.errors import TimeoutExceededError
try:
from helper import setup_system_client, wait_for_response, RequestGenerator
except:
from ...helper import setup_system_client, wait_for_response, RequestGenerator
@pytest.mark.usefixtures("easy_cl... |
import re
number_of_lines = int(input())
robots_cain = []
robots_line = []
flag = 0
flag_manager = 0
manager = ''
regex = re.compile(r"([\d]+[A-Z][a-z]+([A-Z]|\d)(\2)+)")
for i in range(number_of_lines):
line = input()
matches = regex.finditer(line)
for match in matches:
robots_line.append(match.gr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
uncertainunetv1
holds model definition for UncertainUnet
Author: Jacob Reinhold (jacob.reinhold@jhu.edu)
Created on: December 31, 2019
"""
__all__ = ['UncertainUnetv1']
from torch import nn
import torch.nn.functional as F
from .uncertainty_tools import *
from .une... |
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import json
import unittest
fro... |
"""Encryption logic of Bosch thermostat."""
from bosch_thermostat_client.const.nefit import MAGIC_NEFIT
from .base import BaseEncryption
class NefitEncryption(BaseEncryption):
"""Encryption class."""
magic = MAGIC_NEFIT
|
from .resample2d import Resample2dFunction, Resample2d
__all__ = ['Resample2dFunction', 'Resample2d']
|
from .ser import getPortList, myserial |
import os
class Config:
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = 'qwerty'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get("MAIL_USERNAME")
MAIL_PASSWORD = os.environ.get("MAIL_PASSWORD")
UPLOADED_PHOTOS_DEST ='app/static/... |
from enum import IntEnum
class InputSourceType(IntEnum):
SCOPUS_CSV = 1
IEEE_CSV = 2
SCIENCE_DIRECT_RIS = 3
SPRINGER_CSV = 4
WILLEY_RIS = 5
WILLEY_BIB = 6
ACM_BIB = 7
|
"""
Experiment for XGBoost + RI
Aim: To find the best m and ntree(num_round)
m: [100, 120, 140, 160]
ntree: [140, 160, 180, 200, 220, 240, 260]
Averaging 20 models
Summary
loss ntree
m
100 0.450670 240
120 0.450491 220
140 0.449575 220
160 0.449249 220 *
T... |
from colorsys import hsv_to_rgb, rgb_to_hsv
class RGBLight:
@property
def color(self):
'''Get current color as RGB values
Returns:
Tuple of RGB values in range of 0-255
'''
raise NotImplementedError('This method should be overridden')
@color.setter
... |
# coding=UTF-8
from django import forms
from django.shortcuts import redirect
from trybar.core import render, slugify
from trybar.account import must_be_logged
from trybar.bar.models import Bar, BAR_OPEN_HOURS_FROM
from trybar.barevent.models import Event, EventMeta, EventArtist
from trybar.core.fixtures import VOIVO... |
import collections
import math
import time
import telegram
import db
extract_uid = lambda update: update.message.from_user["id"]
extract_chatid = lambda update: update.message.chat_id
poista_skandit = lambda s: s.replace("ä", "a").replace("Ä", "A").replace("ö", "o").replace("Ö", "O")
class Kilometri:
Laji = col... |
from datasets.CLS.dataset import ImageClassificationDataset_MemoryMapped
from miscellanies.viewer.qt5_viewer import Qt5Viewer
from PyQt5.QtGui import QPixmap
class CLSDatasetQt5Viewer:
def __init__(self, dataset: ImageClassificationDataset_MemoryMapped):
self.dataset = dataset
self.viewer = Qt5Vie... |
# Generated by Django 3.1.7 on 2021-03-24 20:56
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('roza', '0007_home'),
]
operations = [
migrations.CreateModel(
name='Contacts',
fields=[... |
# Remon Hasan // UAP
n=int(input())
for i in range(n) :
N,M,K=map(int,input().split())
ignoredFiles=list(map(int,input().split(' ',M-1)))
trackedFiles=list(map(int,input().split(' ',K-1)))
notigonred=[]
nottracked=[]
for i in range(1,N+1):
if i not in ignoredFiles :
notigonred.append(i)
if i not in tr... |
# https://www.youtube.com/watch?v=8oOhXcdXbZk
# Output must be [ -, -, -, ..., +, +, + ]
class Solution(object):
def asteroidCollision(self, asteroids):
stack = []
for i in range(len(asteroids)):
curr = asteroids[i]
if curr > 0:
stack.append(curr)
... |
# Copyright 2013-2019 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 Xphelloworld(AutotoolsPackage):
"""Xprint sample applications."""
homepage = "http://... |
DATABASE_PATH = None
def init(database_path:str):
if not database_path:
return
if not isinstance(database_path, str):
raise TypeError("<database_path> needs to be a string")
global DATABASE_PATH
DATABASE_PATH = database_path
from aiosqliteWrapper.database import database |
#!/usr/bin/env python3
from setuptools import setup, find_packages
description = """Taskotron checks regarding Python versions"""
with open('README.rst') as readme:
long_description = readme.read()
setup(
name='taskotron-python-versions',
version='0.1.dev3',
description=description,
long_descri... |
#!/usr/bin/python3
import os
import sys
def cartddg_filter(ddgout):
for line in ddgout:
lst = line.split(":")
if lst[2] == " WT":
refdg = float(lst[3].split()[0])
else:
mutdg = float(lst[3].split()[0])
ddg = mutdg - refdg
mutname = lst[2].rep... |
import requests
import hashlib
import os
import time
# get parsers functions
from parseHtml import proccessHome, proccessSchedule, proccessBedsheet, proccessScores
# GOBAL CONSTANT
SITE_ROOT = 'http://admisiones.unimagdalena.edu.co/mEstudiantes/'
URL_LOGIN = SITE_ROOT+'/ajaxPages/validarLoginEst.jsp'
URL_PHOTO = 'http... |
""" 负责数据采集、清洗、转换和持久化的任务器
由于需要下载的数据巨大且会每日更新,服务器网站限流,。
"""
from src import tushare_data as dft
if __name__ == "__main__":
dft.get_process_tushare_list() |
from sklearn.neighbors import KNeighborsClassifier
from utils.util_import import *
def evaluate_voting(X_tr, Y_tr, X_ts, Y_ts, T_ts, n_estimators=100):
w0 = len([v for v in Y_tr if v == 0])/len(list(Y_tr))
w1 = len([v for v in Y_tr if v == 1])/len(list(Y_tr))
clf1 = LogisticRegression(random_state=1)
... |
# 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, ... |
# -*- coding: utf-8 -*-
import scrapy
import json
import re
from datetime import date
from locations.items import GeojsonPointItem
class GapSpider(scrapy.Spider):
name = "gap"
allowed_domains = ["www.gap.com"]
gap_url = 'http://www.gap.com/products/store-locations.jsp'
store_url = 'http://www.gap.co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append("../..")
from facerec.feature import Fisherfaces
from facerec.distance import *
from facerec.classifier import NearestNeighbor
from facerec.model import PredictableModel
from facerec.visual import subplot
from facerec.util import minm... |
"""Geometry functions for manipulating aerofoil sections and annulus lines.
This module """
import numpy as np
from scipy.special import binom
from numpy.linalg import lstsq
from scipy.optimize import newton
nx = 201
def fillet(x, r, dx):
"""Fillet over a join at |x|<dx."""
# Get indices for the points at ... |
import argparse
import dash
import dash_cytoscape as cyto
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
from datatc.data_directory import SelfAwareDataDirectory, DataFile, DataDirectory
from typing import Dict, List, Tuple
external_stylesheets... |
#!/usr/bin/env python
"""Defines some other flags."""
import gflags
gflags.DEFINE_string('bar_gfs_path', '/gfs/path',
'Path to the GFS files for libbar.')
gflags.DEFINE_string('email_for_bar_errors', 'bar-team@google.com',
'Email address for bug reports about module libbar.')
g... |
import re
import transaction
from collections import namedtuple, defaultdict
from onegov.core.security import Public, Private, Secret
from onegov.core.utils import render_file
from onegov.directory import Directory
from onegov.directory import DirectoryCollection
from onegov.directory import DirectoryEntry
from onegov... |
# Copyright (c) 2018 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... |
from gym_jsbsim.task import Task
from gym_jsbsim.catalogs.catalog import Catalog as c
import math
import random
import numpy as np
"""
A draft task to perform approach.
"""
class ApproachControlTask(Task):
state_var = [c.delta_altitude, c.delta_heading, c.velocities_v_down_fps, c.velocities_vc_fps]
act... |
def main():
lebre = 0
minutos = 0
tartaruga_metros = tartaruga = float(input('Digite quantos metros a tartarugas sairá à frente da lebre: '))
while True:
if lebre < tartaruga:
tartaruga += 1
lebre += 10
minutos += 1
else:
print(f'A lebre levará {minutos:.0f} minutos para alcaçar ... |
import base64, json, ntpath
try:
#For Python 3.0 and later
from urllib import request as urllib2
from urllib import parse as urllib
basestring = str
except ImportError:
#For Python 2's urllib2
import urllib2, urllib
from MultiPartForm import MultiPartForm
class ZiggeoConnect:
def __init_... |
import numpy as np
import torch
import multiprocessing.dummy as mp
from json import load
from random import choice, randint, sample, shuffle
from copy import deepcopy
from skimage.segmentation import felzenszwalb
from skimage.color import rgb2hsv
from skimage.measure import label
from sklearn.decomposition import PCA
f... |
# main.py
import os
# 通過 torch.cuda.is_available() 的回傳值進行判斷是否有使用 GPU 的環境,如果有的話 device 就設為 "cuda",沒有的話就設為 "cpu"
from Hw.H4_RNN.data import TwitterDataset
from Hw.H4_RNN.model import LSTM_Net
from Hw.H4_RNN.preprocess import Preprocess
from Hw.H4_RNN.train import training
from Hw.H4_RNN.utils import *
import torch.utils... |
#!/usr/bin/env python3
from adventlib import readchunks
from itertools import islice
from pathlib import Path
fields = None
def main():
def badvals():
with Path('input', '16').open() as f:
for chunk in readchunks(f):
if 'your ticket:' == chunk[0]:
pass
... |
#!/usr/bin/python
#
# Proof-of-concept HSRP Active router Flooder triggering outbound gateway Denial of Service. Not fully tested, not working stabily at the moment.
#
# Python requirements:
# - scapy
#
#
import sys
import struct
import string
import random
import argparse
import multiprocessing
import socket
impo... |
# imports
from .mfsimulation import MFSimulation
from .mfnam import ModflowNam
from .mftdis import ModflowTdis
from .mfgwfgwf import ModflowGwfgwf
from .mfims import ModflowIms
from .mfmvr import ModflowMvr
from .mfgnc import ModflowGnc
from .mfutlobs import ModflowUtlobs
from .mfutlts import ModflowUtlts
from .mfutlta... |
from models.notification import Notification
def publish_benchmark_results_on_pull_requests():
notifications = (
Notification.query()
.filter(Notification.finished_at.is_(None), Notification.type == "pull_comment")
.all()
)
for notification in notifications:
if not notific... |
# coding=utf-8
from email.utils import format_datetime
from ultros_site.utils import format_date_frontend
__author__ = "Gareth Coles"
class BaseRoute:
route = "/"
def __init__(self, manager):
self.manager = manager
@property
def db(self):
return self.manager.database
def get_ar... |
MYSQL_PROD = {
'NAME' : 'wikum',
'USER' : 'myUSer',
'PASSWORD' : 'myPassword',
'HOST' : 'localhost',
}
SECRET_KEY = ''
DISQUS_API_KEY = ''
PRAW_CLIENT_SECRET = ''
PRAW_CLIENT_ID = ''
PRAW_USERNAME = ''
PRAW_PASSWORD = ''
|
r"""
.. _logparabola-spectral-model:
Log parabola spectral model
===========================
This model parametrises a log parabola spectrum.
It is defined by the following equation:
.. math::
\phi(E) = \phi_0 \left( \frac{E}{E_0} \right) ^ {
- \alpha - \beta \log{ \left( \frac{E}{E_0} \right) }
... |
cor = ['\033[m', '\033[31m', '\033[32m', '\033[34m']
def leiaInt(pergunta):
ok = False
valor = 0
while True:
try:
n = int(input(pergunta))
except (ValueError, TypeError):
print('\033[31mERRO! Digite um valor inteiro válido!\033[m')
continue
else:... |
import uuid
import unittest
import pickle
import datetime
from .. import connector
from .. import queue
from .. import encoder
class QueueTestCase:
@classmethod
def setUpClass(
cls,
):
cls.test_queue_name = 'test_queue_name'
cls.enqueued_value_first = {
'str': 'string1... |
import matplotlib.pyplot as plt
import numpy as np
def polyfit(dates, levels, p):
return np.poly1d(np.polyfit(np.array(dates)-min(dates), levels,p)),min(dates)
|
#!/usr/bin/env python2
import rospy
from sensor_msgs.msg import JointState
import geometry_msgs
rospy.init_node('ntp_verifier')
last_msg = None
def ntplog(msg):
global last_msg
last_msg = msg
def print_msg(msg):
if msg is not None:
diff = msg.header.stamp - rospy.Time.now()
print('time difference: {} secs'.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.