content stringlengths 5 1.05M |
|---|
# Tensorflow Introduction
There are a number of really good Tensorflow tutorials.
[https://www.tensorflow.org/tutorials/](https://www.tensorflow.org/tutorials/)
1. [Tensors](https://www.tensorflow.org/tutorials/customization/basics)
2. [Titanic with Linear Models](https://www.tensorflow.org/tutorials/estimator/lin... |
import os
import numpy as np
import pandas as pd
if __name__ == "__main__":
sample_path = '/home/faizan/web_scraping/Cognitia/bas-scraping/BAS/Sample_Client.xlsx'
equippo_sel_path = '/home/faizan/web_scraping/Cognitia/equippo/equippo_data/equippo.xlsx'
equippo_scr_path = '/home/faizan/web_scraping/Cognitia... |
#!/usr/bin/env python
"""macOS afk time in seconds"""
import mac_afk
def cli():
print(mac_afk.seconds())
if __name__ == "__main__":
cli()
|
import numpy as np
import pandas as pd
import wellfare as wf
# Model functions for fitting to data
# -----------------------------------------------------------------------------------
def exponential_growth(t, y0, k):
od = y0*np.exp(k*t)
return(od)
def exponential_growth_rate(t, y0, k):
return(k)
def go... |
# -*- coding: utf-8 -*-
# Copyright 2016 Mircea Ulinic. All rights reserved.
#
# The contents of this file are 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/L... |
import math
n, x = map(int, input().split())
a = list(map(int, input().split()))
print('Yes' if x >= sum(a) - math.floor(len(a) / 2) else 'No')
|
class SummaryVariables:
def __init__(self):
self.INTAG = None
@classmethod
def drop_point(cls):
#appears to be present on points shared over gottena
cls.INTAG = None
return cls |
#!/usr/bin/python
"""
Write a random permutation of the input lines to standard output.
Copyright 2019 Junhong Wang
"""
import random, sys
from optparse import OptionParser
class Shuf:
def __init__(self):
version_msg = "%prog 2.0"
usage_msg = """%prog [OPTION]... FILE
or: %prog -i LO-HI [OPTI... |
from __future__ import absolute_import, print_function
import numpy as np
from .. import frameworks as F
from .base import Layer
|
from setuptools import setup
setup(
name='discoruns',
version='0.1.0',
url='https://github.com/korbster/discoruns',
author='Korbinian Karl',
description='Python library for windows persistence mechanism extraction',
long_description=open('README.md').read(),
long_description_content_type='t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb
import mysql.connector
'''
base de datos: diario_bot
tabla: usuarios
columnas:
usuario, clave Primaria varchar(100)
apellido varchar(50)
genero varchar(10)
password varchar(30
'''
DB_HOST = 'localhost'
DB_USER = 'root... |
import os
import sys
import numpy as np
import numba
import argparse
import pyteiser.MI as MI
def test_discret_eq_freq():
vect_to_discr_9 = np.array([0.5, 5.1, 5.2, 4.8, 9.9, 0.1, 9.7, 0.2, 10.3], dtype=np.float32)
discr_expected_9_result = np.array([0,1,1,1,2,0,2,0,2], dtype=np.uint16) # 3 bins
vect_t... |
# NOTE strings are IMMUTABLE
fruit = ["banana", "apple", "cherry"]
print("Initial fruits: ", fruit)
fruit[0] = "pear"
fruit[-1] = "cherry"
print("Mutated fruits: ", fruit)
alist = ['a', 'b', 'c', 'd', 'e', 'f']
print("Initial list: ", alist)
mut = ['x', 'y']
alist[1:3] = mut # for index 1 up to 3 (wi... |
import sys
oldno=-1
old_write=False
lineno=0
error=0
if(len(sys.argv)<3):
print "This test checks if the sequence numbers are correctly recorded."
print "USAGE: python SeqNumberTest.py <dependency trace file> <window size : if not changed give 128>"
exit(1);
for line in open(sys.argv[1]):
tokens = line.... |
def multiply(*args):
res=1
for k in args:
res*=k
return res |
from numpy import inf
from controller import Robot, Keyboard
import math
from libraries import side_check as sc
MAX_SPEED = 0 ### maximum velocity of the turtlebot motors ( set to motors max velocity in setup() )
TURN_MULT = 0.45 ### constant to slow down turn speed ( too high and turning will be inaccurate)
MOVE_MU... |
"""UI for kernel creation."""
from __future__ import division, absolute_import, print_function
__copyright__ = "Copyright (C) 2012 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to... |
from __future__ import absolute_import
try:
__VICE_SETUP__
except NameError:
__VICE_SETUP__ = False
if not __VICE_SETUP__:
__all__ = ["test"]
from .....testing import moduletest
from . import set_params
@moduletest
def test():
r"""
Run the unit tests on this module
"""
return ["vice.yie... |
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""uprev_lib tests."""
from __future__ import division
from __future__ import print_function
import os
import sys
import mock
... |
# Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
""" Filter `ephys_info.xlsx`
This module provides methods to apply inclusion/exclusion criteria to `ephys_info.xlsx`. The module is tailored to ABF file formats and how I document my own experim... |
"""
B{Project Name:} MakeHuman
B{Product Home Page:} U{http://www.makehuman.org/}
B{Code Home Page:} U{http://code.google.com/p/makehuman/}
B{Authors:} Marc Flerackers
B{Copyright(c):} MakeHuman Team 2001-2011
B{Licensing:} GPL3 (see also U{http://sites.google.com/site/mak... |
import numpy as np
import torch
from sbibm.metrics.ppc import median_distance
def test_median_distance():
predictive_samples_np = np.random.randn(100, 2)
predictive_samples = torch.from_numpy(predictive_samples_np)
observation_np = np.random.randn(1, 2)
observation = torch.from_numpy(observation_np)... |
import json
import os
import random
import gym_flowers
import gym
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.stats import ttest_ind, wilcoxon
from scipy.signal import savgol_filter
os.environ['LD_LIBRARY_PATH']+=':'+os.environ['HOME']+'/.mujoco/mjpro150/bin:'
import matplotlib
f... |
###################################################################
# DO NOT TOUCH THIS CODE -- BEGIN
###################################################################
import threading
def synchronized_method(method):
outer_lock = threading.Lock()
lock_name = "__"+method.__name__+"_lock"+"__"
def sync_... |
import pytest
from ..types.publication import find_best_date
pytestmark = [pytest.mark.setone, pytest.mark.working, pytest.mark.schema]
@pytest.fixture
def publication_PMID(testapp, lab, award):
item = {
'uuid': '8312fc0c-b241-4cb2-9b01-143891055000',
'award': award['@id'],
'lab': lab['... |
from __future__ import annotations
import torch
from torch import Tensor
from typing import Union
from utils.config import global_config
import copy
ACCESSIBLE_KEY = {'state', 'action', 'next_state', 'reward', 'done_flag'}
class Data(object):
"""This is the class for building the reinforcement learning data inlcu... |
import numpy as np
import cv2
import os, sys
from tqdm import tqdm
import warnings
warnings.filterwarnings("ignore")
sys.path.append("datasets/dota_devkit")
from tools.args_lib import test_tron_args
from tools.test_model import load_dotatron_model
def get_image_dir_list(im_dir):
return os.listdir(im_dir)
def s... |
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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... |
# This Python file uses the following encoding: utf-8
import StringIO
import json
import logging
import random
import urllib
import urllib2
import locale
import sys
import unicodedata
# standard app engine imports
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
import web... |
#!/usr/bin/python
"""
_DBCreator_
Base class for formatters that create tables.
"""
from WMCore.Database.DBFormatter import DBFormatter
from WMCore.WMException import WMException
from WMCore.WMExceptions import WMEXCEPTION
class DBCreator(DBFormatter):
"""
_DBCreator_
Generic class for creatin... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 15 16:49:56 2019
@author: BIG1KOR
"""
import os
import pandas as pd
def find_files(folder_location, keys, keep=False):
#Setting up folder location for cythonising package
file_loc = folder_location
os.chdir(file_loc)
#For keeping track for fil... |
""" tpa transifex repository.
"""
|
# Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
from threading import Lock
from .errors import report_cell_error, CycleError
class Node(object):
def __init__(self, location, children=None, parents=None):
self.location = location
self.children = children if childr... |
# -*- coding: utf-8 -*-
import os
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
from ..utils import save_json, load_json
import click
from ..logging import logger
from ..paths import model_path, model_output_path
from .predict import run_predictions
@click.command()
@click.argument('model_list... |
"""
Django settings for hgapp project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
i... |
import plotly.graph_objects as go
import plotly.io as pio
pio.templates["walkintheforest-dark"] = go.layout.Template(
layout = go.Layout(
font = {
"family" : "'Open Sans', verdana, arial, sans-serif",
"color" : "white"
},
showlegend = True,
paper_bgcolor = "... |
import codecs
import os
import re
from setuptools import find_packages
from setuptools import setup
###############################################################################
NAME = 'honcho'
AUTHOR = 'Nick Stenning'
AUTHOR_EMAIL = 'nick@whiteink.com'
DESCRIPTION = 'Honcho: a Python clone of Foreman. For managing... |
print(<warning descr="Python version 3.4, 3.5, 3.6, 3.7 do not support <>, use != instead.">a<caret> <> b</warning>) |
#!/usr/bin/env python
# encoding: utf-8
from intervaltree import IntervalTree,Interval
import json
import math
import re
import six
import struct
import pfp.errors as errors
import pfp.utils as utils
import pfp.bitwrap as bitwrap
import pfp.functions as functions
BIG_ENDIAN = ">"
LITTLE_ENDIAN = "<"
def true():
... |
#!/usr/bin/python3.4
# -*-coding:utf-8 -*
# coding: utf8
# Pillow n'existe pas en tant que tel
import PIL
from PIL import Image
import io
import os
from tempfile import NamedTemporaryFile
# img = Image.open('brick-house.png')
path_image = "/home/jean-louis_s/Documents/JL_Python/sandbox/sandbox/... |
import django_filters
from bootstrap_datepicker_plus import DatePickerInput
from django.forms import DateInput, widgets
from set_app.models import *
from django_filters import DateFilter, CharFilter
import django_filters as filters
import django_filters
from django import forms
from django_filters.fields import DateR... |
import insightconnect_plugin_runtime
from .schema import (
GetIncidentAttachmentInput,
GetIncidentAttachmentOutput,
Input,
Output,
Component,
)
# Custom imports below
from icon_servicenow.util.request_helper import RequestHelper
class GetIncidentAttachment(insightconnect_plugin_runtime.Action):
... |
# coding=utf-8
import importlib
class GSInterface:
""" The purpose of this class is for simply building up a filter
contained a set of method names, and keep a set cached
the matched GStruct objects. """
def __init__(self, interfaces=None):
if interfaces is None:
interfaces = set... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class DotAttn(nn.Module):
""" Dot-Attention """
def forward(self, inp, h):
score = self.softmax(inp, h)
return score.expand_as(inp).mul(inp).sum(1), score
def softmax(self, inp, h):
raw_score =... |
# Bucles For Each - Bucle "Para cada X"
#for x in xrange(1,10):
# pass
# la variable que se usa despues del for, tendrá el valor
for un_item in "En este conjunto de letras":
print(un_item)
amigos = ["Juan", "Caren", "Brayan"]
for nombre_amigo in amigos:
print(nombre_amigo)
print("fin lista \n")
# de 0 a 9, no ... |
from matplotlib.backend_tools import ToolBase, ToolToggleBase, Cursors
from PyQt5.QtCore import QObject, pyqtSignal
import logging
class ToolPickPoint(ToolToggleBase,QObject):
""" Marker selection tool. """
# Tool options for matplotlib.
description = 'Pick a point on the image'
image = 'pick.png'
cursor = Curso... |
from django.shortcuts import render, redirect, get_object_or_404
from admin import views
import random
from passlib.hash import pbkdf2_sha256
# Create your views here.
from django.http import HttpResponse, Http404, JsonResponse
from website.models import *
from django.db.models import Sum
from django.core.serializers... |
import os, sys; sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import numpy as np
import matplotlib.pyplot as plt
from dezero import Variable
import dezero.functions as F
np.random.seed(0)
x = np.random.rand(100, 1)
y = np.sin(2 * np.pi * x) + np.random.rand(100, 1)
x, y = Variable(x), Variable(y)
I,... |
import re
import json
from boolexp import Expression
from bdt.node import Node
from bdt.tree import BDT
def validate_bool_string(bool_string, variables):
if bool_string == 'None':
return
delimiters = [
'; ',
', ',
'and',
'or',
'==',
'<=',
'>='... |
from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.get_request import GetRequest
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.services.command.query.query_command import QueryCommand
cla... |
# -*- coding: utf-8 -*-
"""
@date: 2020/5/9 下午8:18
@file: swap_channels.py
@author: zj
@description:
"""
class SwapChannels(object):
"""Transforms a tensorized image by swapping the channels in the order
specified in the swap tuple.
Args:
swaps (int triple): final order of channels
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 30 14:58:39 2021
@author: mail
https://www.geeksforgeeks.org/camera-calibration-with-python-opencv/
"""
# Import required modules
import cv2
import numpy as np
import os
import glob
# Define the dimensions of checkerboard
CHECKERBOARD = (6, 9)
# stop the itera... |
import json
def load_config():
site_arr = []
path = "../docs/collections/list.json"
with open(path) as f:
df = json.load(f)
for key in df:
site_obj = dict()
site_arr.append(site_obj)
config = df[key]
item_set_id_arr = config["item_set_id"]
... |
# coding=UTF-8
from __future__ import print_function, absolute_import, division
import six
import os.path
import os
import io
import warnings
from tslfformat.writing.single_file import SingleFileWriter
logger = logging.getLogger(__name__)
class TSLFDirectory(object):
"""
Manage a bunch of TSLF files
Sho... |
#-*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
from scipy import interpolate
from matplotlib.font_manager import FontProperties
from pylab import *
mpl.rcParams['font.sans-serif'] = ['SimHei']
alpha=np.loadtxt('alpha.csv',delimiter=',')
b=np.loa... |
#!/usr/bin/env python3
# coding: utf-8
import sys
import random
import math
import numpy as np
from primitiv import Device, Graph, Model, Parameter, Optimizer
from primitiv import devices as D
from primitiv import functions as F
from primitiv import initializers as I
from primitiv import optimizers as O
from lstm ... |
# NLP written by GAMS Convert at 04/21/18 13:51:42
#
# Equation counts
# Total E G L N X C B
# 71 70 0 1 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... |
# 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 required by applicable law or ag... |
import os
import sys
import serial
import os
import numpy as np
import time
import requests
import datetime
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y)) # Build array of zeros to hold signals
filteredY = np.array(y) # Insert current points in another array
avgFilter = [0]... |
from neo.Core.Blockchain import Blockchain
from neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain import LevelDBBlockchain
import shutil
import time
from neo.Utils.NeoTestCase import NeoTestCase
class VerifiableTestCase(NeoTestCase):
LEVELDB_TESTPATH = './fixtures/test_chain'
_blockchain = None
... |
import random
import copy
from algs.regularized_evolution.genetic.population import ArchDarts
class Mutation(object):
def __init__(self, individual):
self.individual = individual
def do_mutation(self):
indi = self.individual
mut_type = random.random()
norm, reduc = indi.tuple
... |
# -*- coding: utf-8 -*-
from pollirio.reactors import expose
from pollirio import conf, choose_dest
import random
import cPickle
import string
markov_data = 'data/markov.pkl'
try:
markov_chains = cPickle.load(open(markov_data))
except IOError:
markov_chains = {}
markov_chains['all'] = {}
markov_chain... |
#faça um programa que leia um numero qualquer e mostre o seu fatorial. fazer com o While e o For.
#fatorial e o numero com a !.ex: 5!=5*4*3*2*1=120
from math import factorial
numero=int(input("Digite um numero para saber o seu fatorial: !"))
fatorial=factorial(numero)
print("O fatorial do numero {}! tem como resultado... |
# -*- coding: utf-8 -*-
"""
@author: krakowiakpawel9@gmail.com
@site: e-smartdata.org
"""
def generator():
yield 4
yield 5
# %%
gen = generator()
# %%
next(gen)
# %%
def generator_2(word):
letters = list(word)
for letter in letters:
yield letter
gen_2 = generator_2('python')... |
#! /usr/bin/env python
import os
import contextlib
import joblib
import random
import time
import copy
import numpy as np
from tqdm import tqdm
from collections import defaultdict, OrderedDict
import torch
import torch.optim as optim
from torch.utils.data.dataloader import DataLoader
from torch import autograd
impor... |
from django.contrib import admin
from django.urls import path
from .import views
urlpatterns = [
path("",views.index,name="ShopHome")
] |
from wagtailnews.models import NEWSINDEX_MODEL_CLASSES
def newsindex(cls):
NEWSINDEX_MODEL_CLASSES.append(cls)
return cls
|
import numpy as np
import cv2
import time
import math
import imutils
from imutils.video import FileVideoStream, VideoStream
import keyboard
from pynput.keyboard import Key, Controller
# keyboard=Controller()
size_height = 600
size_width = 600
last = 0 # last extreme of steer
chng = 3 # change in last, t... |
import numpy as np
from copy import deepcopy
from math import ceil
from typing import List, Callable
# region Number generation
class Generator:
@staticmethod
def __fibonacci_sequence(count: int = 1) -> List[int]:
assert count > 0
fibonacci_numbers: List[int] = list()
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('content', '0023_merge'),
]
operations = [
migrations.CreateModel(
name='FooterInfo',
... |
num = input("Enter a number: ")
print("Here are the factors of " + num + "\n")
try:
def factor(x):
for i in range(1, x + 1):
if x % i == 0:
print(i)
except:
print("Invalid Input")
factor(int(num))
|
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.core import serializers
from django.http import Http404
from django.shortcuts import get_object_or_404, render_to_response
import json
import sys
import models
def obj_create(request, mod_id=Non... |
# Copyright 2016 Red Hat Inc & Xena Networks.
#
# 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 ... |
app_access_token = {
'key': 'YOUR_KEY',
'secret': 'YOUR_SECRET',
'hash': 'SOME_RANDOM_HASH'
} |
# 572. Subtree of Another Tree
class Solution:
def isSubtree(self, s: TreeNode, t: TreeNode) -> bool:
if s: return self.isSubtree(s.left, t) or self.isSubtree(s.right, t) or self.dfs(s, t)
return False
def dfs(self, s, t):
if not s and not t: return True
if s and t and s... |
from NlpCtr import nlpCtr
from ModeCtr import modeCtr
paragraph = """
在美丽的旌湖旁,坐落着德阳市实验小学校。
一进校门,看到四周有几座高大的教学楼,分别是真全楼、真玉楼、真思楼、真问楼、真学楼。穿过真玉楼来到了我们篮球场和乒乓球场,又穿过乒乓球场就来到了红红的跑道上。跑道像一大片红领巾似的,向前走来到了升旗台。每到星期一的时候,全校同学在升旗台下一起唱国歌。这是一所非常美丽的学校!
春天,学校的树木和小草开始发芽了,到处鸟语花香,生机勃勃。漂亮的李花开了,白白的,像花仙子正在翩翩起舞似的。
夏天,学校树木的叶子长得又多又密,像撑开的大伞,给我们遮阳避暑。... |
## filter out confound xyz (and rotate) data and save in seperate directory
import os, csv
import numpy as np
import scipy as sp
# initalize data
work_dir = '/mindhive/saxelab3/anzellotti/forrest/derivatives/fmriprep/'
all_subjects = ['sub-01', 'sub-02', 'sub-03', 'sub-04', 'sub-05', 'sub-09', 'sub-10', 'sub-14', 'sub... |
import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.r... |
# -*- coding: utf-8 -*-
from flask import Blueprint, render_template, request
from datetime import datetime, timedelta
from sqlalchemy import and_
from apps.common.auth import signin_required
from apps.database.models import Showtime, Movie, TheaterTicket, Theater
app = Blueprint('showtimes', __name__, url_prefix='/... |
'''
MIT License Copyright(c) 2016 Balys Valentukevicius
Configuration for Twitter client and Haiku generator
'''
import os
class Config(object):
def __init__(self):
# Twitter
self.twitter_consumer_key="xxxxxxxx"
self.twitter_consumer_secret="xxxxxxxx"
self.twitter_access_token_key... |
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import json
import sys
from scipy.misc import imread
import constants
import utils
targetObject = sys.argv[1]
#load calibration JSON from standard
with open("calibration.json", 'r') as f:
calibration = json.load(f)
#load target minerals JSON
with open("t... |
# coding=utf-8
"""
Django settings for prj project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_D... |
#!/usr/bin/env python3
# Package imports
from dotenv import load_dotenv
from enum import Enum
import os
# Local imports
from models.TCPPacket import TCPPacket
from models.AuxProcessing import AuxProcessing
# Loads .env file
load_dotenv()
class SenderWindow(Enum):
SENT = 1
USABLE = 2
ACK = 3
class GoB... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test suite for the waveform solver input file generator.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
from wfs_input_generator import InputFil... |
from allkindsoffunctions import *
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# a=np.random.normal(0,0.1,1000)
# # b=np.arange(0,1000,1)
# #
# # plt.plot(b,a)
# # plt.show()
# # a=np.arange(0,1000,1)
# # print(a)
# i=1
# print(len(a[:5]))
# print(len(a[i:5+i]))
# print(correlationselffuncti... |
# Problem: https://www.hackerrank.com/challenges/crush/problem
# Score: 60
n, queries = map(int, input().split())
arr = [0 for i in range(n+2)]
for i in range(queries):
start, finish, k = map(int, input().split())
arr[start - 1] += k
arr[finish] -= k
ans = 0
current = 0
for i in arr:
current += i
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('measure_mate', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='attribute',
old... |
class AddressInfoSocketType(basestring):
"""
Denotes the type of socket for which address will be used.
For example: stream socket/datagram socket.
Possible values are: { sock_stream | sock_dgram | sock_raw | sock_rdm
| sock_seqpacket | sock_stream_nonblk }
"sock_stream" - stream socket.
"so... |
import battlescribe_parser.bsdata.file
from battlescribe_parser.catalogue.element import CatalogueElement
class CatalogueFile(battlescribe_parser.bsdata.file.File):
def scrape_profile_type(self, profile_type):
profile_elements = self.get_elements_by_attribute(
'profileTypeName', profile_type)... |
'''This script exposes necessary function calls to get the data.
'''
'''
Copyright (c) 2017, WinQuant Information and Technology Co. Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistribu... |
"""Scan_scheduled flag
Revision ID: 3919491ac655
Revises: 7b11c2291b8f
Create Date: 2019-10-15 16:02:23.801381
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3919491ac655"
down_revision = "7b11c2291b8f"
branch_labels = None
depends_on = None
def upgrade():
... |
# Generated by Django 2.0.13 on 2019-08-30 07:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('lepidoptera', '0022_auto_20190823_1509'),
]
operations = [
migrations.AlterUniqueTogether(
name='publication',
unique_toget... |
import copy
import numpy
import pytest
import pvfit.common.utils
@pytest.fixture(params=[
{ # Test empty dictionary.
'dictionary': {},
'dictionary_expected': {}
},
{ # Test mixed Python dictionary types.
'dictionary': {'a': 0, 'b': 0., 'c': 'blah', 'd': ... |
# 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... |
import random
import time
def unique_n2(A):
for i in range(0,len(A)):
for j in range(i+1,len(A)):
if A[i]==A[j]:
print("NO")
return
print("YES")
def unique_nlogn(A):
C=sorted(A)
for i in range(0,n-1):
... |
from datetime import datetime, timedelta
from typing import Optional
from passlib.context import CryptContext
from jose import JWTError, jwt
SECRET_KEY = "ec0226e1618d2af58a43e11ca012bd9858158d5df6c103047bb8879983944c89"
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 90
pwd_context = CryptContext(schemes=["bcrypt... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from flask ... |
from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(name='cloudgenix_serial_report',
version='1.0.2',
description='Utility to dump all CloudGenix network serial information to an .XLSX file.',
long_description=long_description,
long_description_conte... |
import logging
from pacman.model.constraints.abstract_constraints.\
abstract_partitioner_constraint import \
AbstractPartitionerConstraint
from pacman.model.constraints.partitioner_constraints.\
partitioner_same_size_as_vertex_constraint \
import PartitionerSameSizeAsVertexConstraint
from pacman.model.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.