content stringlengths 5 1.05M |
|---|
# -*- coding:utf-8 -*-
import sqlite3
import json
import datetime
class Windows_Timeline_Information:
par_id = ''
case_id = ''
evd_id = ''
program_name = ''
display_name = ''
content = ''
activity_type = ''
focus_seconds = ''
start_time = ''
end_time = ''
activity_id = ''
... |
import numpy as np
import sys
from nn import NeuralNetwork
import warnings
if __name__ == '__main__':
warnings.filterwarnings("ignore")
NNX = np.loadtxt('data/wheat-seeds.csv',delimiter=',')
NNY = NNX[:,-1:]
NNX = NNX[:, :-1]
model1 = NeuralNetwork(10,3,activate='r',iter=100000,rate=0.1)
print... |
#!/usr/bin/python3
import os
import csv
import re
# Garrett Maury, 11/30/2021
# Clear Terminal
clear = 'clear'
os.system(clear)
with open('linux_users.csv', 'r') as file:
# read each row into a dictionary
reader = csv.DictReader(file)
data = {}
for row in reader:
for header, value in row.item... |
#############################################################################
#
# Copyright (c) 2018 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... |
import cv2
import os
import configuration
import queue
import random
import string
import tensorflow as tf
from real_time_detection.GUI import FaceFeatureReader
# class FaceReader
class FaceReader:
'''
This class is used to return the face data in real time.
Attribute:
cap: the capture stream
... |
HYBRIK_29_KEYPOINTS = [
'pelvis',
'left_hip',
'right_hip', # 2
'spine_1',
'left_knee',
'right_knee', # 5
'spine_2',
'left_ankle',
'right_ankle', # 8
'spine_3',
'left_foot',
'right_foot', # 11
'neck',
'left_collar',
'right_collar', # 14
'jaw', # 15
... |
import requests, bs4, os, youtube_dl
# Returns List of Tracks Joined By "+"
def tracks(url):
res = requests.get(url)
soup = bs4.BeautifulSoup(res.text.encode('utf-8').decode('ascii', 'ignore'), 'html.parser')
searchTracks = soup.select('.update_song_info a')
prettyTracks = soup.select('.update_song_inf... |
import logging.config
from .video import Video
log_config = {
'version': 1,
'formatters': {
'detailed': {
'class': 'logging.Formatter',
'format': '%(asctime)s %(name)-15s %(levelname)-8s %(processName)-10s %(message)s'
}
},
'handlers': {
'console': {
... |
#!/usr/bin/env python3
# Copyright mcendu 2019.
#
# 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 ... |
import sys
from pathlib import Path
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt, QSettings, QDir
from PyQt5.QtWidgets import (QApplication, QDialog, QGridLayout, QFormLayout, QLabel, QLayout, QLineEdit,
QPushButton, QFileDialog, QWidget, QGroupBox, QVBoxLayout, QHBoxLayo... |
import requests
try:
requisicao = requests.get('https://api.github.com/users/adrielcavalcante')
print(requisicao)
except Exception as err:
print('Erro: ',err)
|
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'', views.HomePageView.as_view(), name='home'),
]
|
import os
import re
import subprocess
import nltk
import pyspark.sql as psql
import pyspark.sql.functions as sfuncs
import pyspark.ml as sparkml
import sparknlp
from seldonite import base, collect
class NLP(base.BaseStage):
def __init__(self, input):
super().__init__(input)
self._do_tfidf = Fal... |
"""List of forward-compatible entry points for OpenGL 3.1
Taken from the list at:
http://www.devklog.net/2008/08/23/forward-compatible-opengl-3-entry-points/
"""
records = """glActiveTexture
glAttachShader
glBeginConditionalRender
glBeginQuery
glBeginTransformFeedback
glBindAttribLocation
glBindBuffer... |
from discord.ext import commands
async def is_mees(ctx):
return ctx.author.id == 298890523454734336
class Devs(commands.Cog):
def __init__(self, bot):
self.bot = bot
# # Misc commands
# geef dev team role
@commands.command()
@commands.check(is_mees)
async def restore(self, ctx):... |
##########################################################################
## Summary
##########################################################################
'''
Creates flat table of decisions from our Postgres database and runs the prediction pipeline.
Starting point for running our models.
'''
################... |
def get_adj(index,W,H):
a=[]
if(index!=0):
a.append(index-W)
if(index%W!=0):
a.append(index-1)
if(index%W!=W-1):
a.append(index+1)
if(index<H*W-W):
a.append(index+W)
return a
H,W=map(int,input().split())
M=[j for i in range(H) for j in list(input())]
start=M.index... |
import tensorflow as tf
from tensorflow import data
import os
import pandas as pd
from ml4ir.base.model.relevance_model import RelevanceModel
from ml4ir.base.io import file_io
from ml4ir.base.model.scoring.prediction_helper import get_predict_fn
from ml4ir.base.model.relevance_model import RelevanceModelConstants
from... |
import unittest
from classroom import Classroom
class ClassroomTest(unittest.TestCase):
def __init__(self):
self._subject = "Math" |
import os, struct
from secrets import token_bytes
from enum import Enum
from time import time, sleep
from collections import deque
from pymavlink import mavutil
from pymavlink.mavutil import mavlogfile, mavlink
from pymavlink.mavwp import MAVWPLoader
from PyQt5.QtCore import (QMutex, Qt, QThread, QTimer, QVaria... |
DEBUG = True
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'app.db')
DATABASE_CONNECT_OPTIONS = {}
THREADS_PER_PAGE = 2
CSRF_ENABLED = True
CSRF_SESSION_KEY = 'secret'
SECRET_KEY = 'secret'
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo.tools import float_round
class TestPacking(TransactionCase):
def setUp(self):
super(TestPacking, self).setUp()
self.stock_location = self.env... |
from collections import deque
class Node:
def __init__(self, x, y, bypasses, grid):
self.x = x
self.y = y
self.bypasses = bypasses
self.grid = grid
def __eq__(self, comp):
return self.x == comp.x and self.y == comp.y and self.bypasses == comp.bypasses
def __hash__... |
'''
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
Example 1:
Input:
matrix = [
[1, 3, 5, 7],
[10, 11, 1... |
from __future__ import division
from . import der, ecdsa
from .util import orderlen
# orderlen was defined in this module previously, so keep it in __all__,
# will need to mark it as deprecated later
__all__ = ["UnknownCurveError", "orderlen", "Curve", "NIST192p",
"NIST224p", "NIST256p", "NIST384p", "NIST... |
"""
Afterglow Core: photometric calibration job schemas
"""
from typing import List as TList
from marshmallow.fields import Integer, List, Nested
from ..job import JobSchema, JobResultSchema
from ..field_cal import FieldCalSchema, FieldCalResultSchema
from ..photometry import PhotSettingsSchema
from .source_extracti... |
#
# PySNMP MIB module XYLAN-CSM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XYLAN-CSM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:38:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... |
#author diwakar
import psutil
from datetime import date
import calendar
import datetime
try:
f=open("set.csv",'w')
f.write("Day,"+"Hour,"+"Cores"+"," +"Total"+","+"CPU1"+","+"CPU2"+","+"CPU3"+","+"CPU4"+","+"Actual Required"+'\n')
n=4
def actual_calculator(a):
t=sum(a)/4
if(t<30):
... |
#!/usr/bin/env python
#
# Copyright 2019 International Business Machines
#
# 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... |
# ! /usr/bin/env python
import numpy as np
import itertools
"""ramp effect model
2 means two types of traps
original author: Daniel Apai
Version 0.3 fixing trapping parameters
Version 0.2.1 introduce two types of traps, slow traps and fast traps
Version 0.2: add extra keyword parameter to indicate sca... |
Num outliers: 600
Num inliers: 600
################################################################
# Test started at: 2018-12-02 14:41:49.073441
#AUROC D()-score: 0.28877
#AUPRC D()-score: 0.39428
Num outliers: 600
Num inliers: 600
################################################################
# Test started at: 201... |
import unittest
from app.models import Articles
class test_articles(unittest.TestCase):
'''
Test Class to test the behaviour of the Articles class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_article= Articles("2021-08-18T17:00:00Z",' ""https://i.kinja-img... |
"""SQLAlchemy de notre base de données Globale."""
from app.database import Base
from sqlalchemy import (
Boolean,
Column,
DateTime,
Float,
ForeignKey,
Integer,
String,
UniqueConstraint,
)
from sqlalchemy.orm import relationship
# import datetime
# 'tim': int ((self.tim - datetime.datet... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Author: Pauli Virtanen, 2016
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import math
from .step_detect import solve_potts_approx
def compute_stats(samples):
... |
#! /usr/bin/env python3
import logging
from pyboi import Pyboi
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(name='run')
# just basic functionality testing
def main():
log.debug('creating a pyboi class instance')
gameboy = Pyboi()
log.debug('loading file "tetris.gb"')
gameboy.load_r... |
def write_paramdict_file(params, filename):
with open(filename, 'w') as f:
print(params, file=f)
def read_paramdict_file(filename):
with open(filename, 'r') as f:
content = f.read()
return eval(content)
|
"""added state and storage tables
Revision ID: ef91a56cb621
Revises: 4722e540ad36
Create Date: 2018-06-15 14:55:03.248439
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ef91a56cb621'
down_revision = '4722e540ad36'
branch_labels = None
depends_on = None
def ... |
# 정수 3개 입력받아 합과 평균 출력하기
a, b, c = map(int, input().split())
print(str(a+b+c), format((a+b+c)/3, ".2f")) |
"""Add avatar column
Revision ID: a040f705ffc4
Revises: 825074598082
Create Date: 2020-08-18 06:45:24.708617
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a040f705ffc4'
down_revision = '825074598082'
branch_labels = None
depends_on = None
def upgrade():
... |
import cv2
import os
from glob import glob
frame_rate = 20
image_size = (576, 160)
img_seq_dir = './raw_img_sequences/'
image_paths = glob(os.path.join(img_seq_dir, '*.png'))
image_paths.sort()
writer = cv2.VideoWriter('./videos/kitty_street.avi', cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), frame_rate, image_size)
f... |
# import matplotlib.pyplot as plt
from matplotlib import pyplot as plt
import numpy as np
# file_data = np.loadtxt('2_Record2308.dat')
# plt.plot(file_data)
# plt.ylabel("y label")
# plt.xlabel("x label")
# plt.show()
_,axis = plt.subplots()
axis.plot([10,15,5,7,0,40])
axis.set(title="yVals")
plt.show()
# file_data1... |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... |
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import logging
from django_filters.rest_framework import DjangoFilterBackend
from django.utils.decorators import method_decorator
from rest_framew... |
import sys
from notifier.util import *
from notifier.providers import PrintNotify
def init(**providers):
if 'print' not in providers:
providers['print'] = PrintNotify()
provider = sys.argv[1] if len(sys.argv) > 1 else 'print'
if provider not in providers:
exit('Unknown provider. Known ... |
import json
import csv
import sys
import os
import datetime
import xlrd
def list_add(a, b):
c = []
for i in range(len(a)):
c.append(a[i] + b[i])
return c
def list_sub(a, b):
c = []
for i in range(len(a)):
c.append(a[i] - b[i])
return c
def excel_read(name):
file = xlrd.ope... |
# 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 unittest import mock
import moolib.broker
class TestBrokerScript:
def test_has_main(self):
assert hasattr(moolib.broker, "... |
"""
The manager class for the FAQ models
"""
from django.conf import settings
from fluent_faq import appsettings
from parler.managers import TranslatableManager, TranslatableQuerySet
__all__ = (
'FaqQuestionManager',
'FaqQuestionQuerySet',
)
class FaqBaseModelQuerySet(TranslatableQuerySet):
"""
The Q... |
# -*- coding: utf-8 -*-
"""
PARAMETER POOL FOR SIMULATIONS
All the parameters are stocked in _DPARAM.
None is the default value if the key has no meaning for the parameter
Each parameter is a dictionary, with the following keys :
'NAME': { # KEY THE CODE WILL USE TO CALL IT
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-10-15 17:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("archive", "0006_digitizedwork_add_record_id"),
("archive", "0005_add_notes_fields"),
]
... |
class Solution:
def countBits(self, num: int) -> List[int]:
ans = [0]
offset = 1
for i in range(1, num + 1):
if offset * 2 == i:
offset = i
ans.append(ans[i - offset] + 1)
return ans
|
#!/usr/bin/env python
import os
import os.path
from pyraf import iraf
"""
To get familiar with Ellipse:
1. Check the help file for Ellipse, controlpar, samplepar, magpar, geompar
> ecl
> stsdas.analysis.isophote
> help ellipse
> help controlpar
2. See the examples on this page:
http://www.ast.uct.ac.za/~sarblyth/Tu... |
import time
import random
import os.path
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import json
import nltk.data
from Simon import Simon
from Simon.Encoder import Encoder
from Simon.DataGenerator import DataGenerator
from Simon.LengthStandardizer import *
# extract the first N samples... |
__all__ = [
'RTreeLookup',
'RTreePerilLookup',
'RTreeVulnerabilityLookup',
'generate_index_entries',
'get_peril_areas',
'get_peril_areas_index',
'get_rtree_index',
'PerilArea',
'PerilAreasIndex',
]
# 'OasisLookup' -> 'RTreeLookup'
# 'OasisPerilLookup' -> RTreePerilLookup
# 'OasisVul... |
def formating(list_load,n1,n2):
list_format = []
for i in range(n1,n2):
list_format.append(list_load[n1]/2)
|
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.test import Client, TestCase
from django.urls import reverse
from myauth.forms import (
MyAuthenticationForm,
MyPasswordChangeForm,
MyUserCreationForm,
MyUserDeleteForm,
)
from myauth.views import ... |
import pathlib
__author__ = "Austin Hodges"
__copyright__ = "Austin Hodges"
__license__ = "mit"
REQUIRED_PYTHON_VERSION = (3, 6, 0)
REQUIRED_PYTHON_STRING = '>={}.{}.{}'.format(REQUIRED_PYTHON_VERSION[0],
REQUIRED_PYTHON_VERSION[1],
... |
import pandas as pd
import ssl
from kafka import KafkaProducer
from kafka import KafkaConsumer
from time import sleep
from json import dumps
from kafka import KafkaProducer
# ssl._create_default_https_context = ssl._create_unverified_context
# url = 'https://dados.anvisa.gov.br/dados/TA_PRECO_MEDICAMENTO.csv' #dado... |
DEBUG = False
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
b = [ -1 for i in range(n) ]
if len(a) == 1:
if DEBUG: print(0, 0)
if a[0] > 0:
print(0, 0)
else:
print(1, 0)
continue
def solve(i, j):
if DEBUG: print(a[i:j+1], i,j)
if i > j:
return (-1, 0, ... |
import numpy as np
import pandas as pd
import skimage.morphology
import warnings
from itertools import count
import os
import PIL.Image
import PIL.ImageFont
from ops.constants import *
import ops.filenames
import ops
import ops.io
# load font
def load_truetype(truetype='visitor1.ttf',size=10):
"... |
import os
import sys
import time
import datetime
import slackclient as slck
CH_NAME = 0
CH_ID = 1
MSG_CONTENT = 0
MSG_CH = 1
MSG_CREATOR = 2
MSG_REACTS = 3
MSG_LINK = 3
class OnThisDay:
def __init__(self):
self.now = datetime.datetime.now()
# print(self.now)
self.client = slck.SlackCli... |
import math
import itertools
import sys
from pathlib import Path
import itertools
import math
import sys
from pathlib import Path
sys.path.append(str(Path("../../")))
from roadscene2vec.scene_graph.nodes import Node
#from roadscene2vec.scene_graph.nodes import ObjectNode
#This class extracts relations for every pair... |
# -*- coding: utf-8 -*-
"""
This file is originally from the csvsort project:
https://bitbucket.org/richardpenman/csvsort
MongoDB Modifications:
1. add the quoting=quoting argument to csv.reader()
"""
import csv
import heapq
import os
import sys
import tempfile
from optparse import OptionParser
csv.field_size_limit... |
from typing import Callable, Optional, Tuple
import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.grating_coupler_elliptical_trenches import grating_coupler_te
from gdsfactory.components.straight import straight
from gdsfa... |
#CONFIGURATION PARAMETERS
#------------------------------
#Mustafa et al (2014) - Structured Mathematical Modeling, Bifurcation, and Simulation for the Bioethanol Fermentation Process Using Zymomonas mobilis. doi:10.1021/ie402361b
##### General parameters #####
#Use SCIPY (True) or Scikit.Odes (False) for IVP solv... |
from __future__ import division, print_function, unicode_literals
path = []
def reindex(*args,**kwargs):
pass
|
from typing import Optional
import discord
import asyncpg
from discord.ext import commands
from .utils.pagination import create_paginated_embed
class Tags(commands.Cog):
"""Productivity's tag system."""
def __init__(self, bot:commands.Bot) -> None:
self.bot = bot
self.emoji = "🏷️ "
asy... |
import numpy as np
import os
import pickle
class DataLoader(object):
def __init__(self, dataset='bookcorpus', doc_num=16000, save_gap=200, batch_size = 1024):
self.data_names = ['input_ids','token_type_ids','attention_mask','masked_lm_labels','next_sentence_label']
self.data = {'input_ids':[],
... |
from my.core import warnings
warnings.medium('my.reading.polar is deprecated! Use my.polar instead!')
from ..polar import *
|
# © 2015-2018, ETH Zurich, Institut für Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
import sys
import fsc.export
# This should never appear in any serious code ;)
# To out-manoeuver pickle's caching, and force re-loading phasemap
def test_all_doc():
old_name = "phasemap"
new_name = "hoopy_... |
import numpy as np
import tensorflow as tf
import time
import os
import matplotlib.pyplot as plt
import matplotlib as mpt
import colorsys as cls
import statistics as stat
from sklearn.model_selection import train_test_split
import csv
import pickle
from mmd import rbf_mmd2, median_pairwise_distance, mix_rbf_... |
import datetime
from receptor.serde import dumps, loads
def test_date_serde():
o = {"now": datetime.datetime.utcnow()}
serialized = dumps(o)
deserialized = loads(serialized)
assert deserialized == o
|
# -*- coding: utf-8 -*-
from cryptography.fernet import Fernet
from pathlib import Path
REGION = 'EO'
PLATFORM = 'CUCM'
ROLE = 'rwx'
PATH = Path('C:\shared\API\credentials')
server = PATH / REGION / PLATFORM / ('fqdn' + '.txt')
def file(role):
username = PATH / REGION / PLATFORM / ('user_' + role + '.txt')
... |
class PcPointer(object):
NEXT_ADDR = 0
STOP = -1
JUMP = 1
JUMPI = 2
def __init__(self, status, addr=None, cond=None):
self.status = status
self.addr = addr
self.condition = cond
|
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill, intent_handler, FallbackSkill
from mycroft.util.log import LOG
from mycroft.audio import wait_while_speaking
import feedparser
import hashlib
import datetime
__author__ = 'BreziCode'
MONTHS = {
'Jan': "01",
'Feb': "02",
'... |
#############################################################################
# RADIA Python Example #1: Magnetic field created by rectangular parallelepiped with constant magnetization over volume
# v 0.02
#############################################################################
from __future__ import print_func... |
#
# Copyright (c) 2018 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... |
def isEven(number):
#generate list of even numbers
evenNumbers=[]
for i in range((number)):
evenNumbers.append(i*2)
if number in evenNumbers:
return True
else:
return False
print(isEven(100)) |
# ORTHOGONAL COLLOCATION METHOD
# -------------------------------
# import package/module
import numpy as np
class OrCoClass:
# class vars
# constants
# Approximate Solution
# ---------------------
# y = d1 + d2*x^2 + d3*x^4 + d4*x^6 + ... + d[N+1]*x^2N
# Define Collocation Points
# ---... |
from litex.build.generic_platform import Subsignal, Pins, IOStandard, Misc
class QMTechDaughterboard:
"""
the QMTech daughterboard contains standard peripherals
and can be used with a number of different FPGA core boards
source: https://www.aliexpress.com/item/1005001829520314.html
"""
... |
"""
Segment imports
"""
from .segmentation import Segmentation
from .tabular import Tabular
from .textractor import Textractor
from .tokenizer import Tokenizer
|
'''
registry
'''
import urllib
import urllib2
import json
import base64
def get_catalog_token():
scope = "registry:catalog:*"
return get_token(scope)
def get_repository_token(repository_fullname):
scope = "repository:%s:*" % repository_fullname
return get_token(scope)
def get_token(scope):
url="... |
class ModelNotFittedError(Exception):
"""
It is raised when a method or attribute is requested that requires the model
to be trained (such as .predict() or .score())
"""
pass
|
M = float(input("Digite o valor de uma área em metros quadrados: "))
A = M * 0.000247
print("Este mesmo valor em Acres é {} Acres".format(A)) |
import argparse
from pathlib import Path
from lib.model import SuperResolutionModel
import utils
def main(args: argparse.Namespace):
data_root = Path(args.dataset)
source_size = (args.source_size, args.source_size)
target_size = (args.target_size, args.target_size)
train_generator = utils.data.Data... |
# ! are the imports needed if they are defined in main?
import arcpy
import os
import shutil
from helpers import *
# ! are we using tni at all? EHHHH NOT REALLY
# Compute Transit Need Index (TNI) based on the 2003 service standards for each census blockgroup.
# Use the minority, income, age and car ownership data co... |
import ConfigParser
class Config(object):
def load(self, filename):
config = ConfigParser.SafeConfigParser()
config.read(filename)
self.mafen_host = config.get('mafen', 'host')
self.mafen_port = config.getint('mafen', 'port')
self.verbose = config.getboolean('mafen', 'verb... |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import paho.mqtt.client as mqtt
import time, threading, random
# client, user and device details
serverUrl = "mqtt.cumulocity.com"
clientId = "my_mqtt_python_client"
device_name = "My Python MQTT device"
tenant = "<<tenant_ID>>"
username = "<<username>>"
passw... |
# coding: utf-8
import tools
from dropdownlist import DropDownList
class ThemeRoller(DropDownList):
""" based one http://jsfiddle.net/gyoshev/Gxpfy/"""
data_text_field = "name"
data_value_field = "value"
height = 500
data_source = tools.name_value_pairs([
[ "Black" , "blac... |
from __init__ import *
from mc2pdf import MCprocessing
from datamanage import DataIO
from montecarlo import MonteCarlo
from analytical_solutions import AnalyticalSolution, gaussian
from mc2pdf import MCprocessing
from pdfsolver import PdfGrid
from visualization import Visualize
from Learning import PDElearn
import pdb
... |
import abc
import functools
import itertools
import os
import signal
import sys
import warnings
import psutil
from py import std
class XProcessInfo:
def __init__(self, path, name):
self.name = name
self.controldir = path.ensure(name, dir=1)
self.logpath = self.controldir.join("xprocess.lo... |
from sklearn.svm import SVC
from ml_config import MachineLearningConfig
from ml_validation import AccuracyValidation
config = MachineLearningConfig()
image_data, target_data = config.read_training_data(config.training_data[0])
# kernel can be linear, rbf e.t.c
svc_model = SVC(kernel='linear', probability=True)
svc_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('weather', '0004_auto_20171023_1719'),
]
operations = [
migrations.AlterField(
model_name='departmentwarnings',
... |
# -*- coding: utf-8 -*-
import os
from keras.callbacks import *
from config import ModelConfig
from callbacks import SWA
class BaseModel(object):
def __init__(self, config: ModelConfig):
self.config = config
self.callbacks = []
self.model = self.build()
def add_model_checkpoint(self... |
#
# Version: 31-jan-2018
#
# In this version we use plot= to denote te plotfile name. in the "au" tools the "figfile="
# keyword is used. In imview() they use the "out=". Go figure for standardization, but we
# should probably assume something standard.
#
# Also: plot=None could be used to not show a plot?
#... |
import random
from itertools import izip
from stdnet.test import TestCase
from examples.models import SimpleModel
class TestManager(TestCase):
def setUp(self):
self.orm.register(SimpleModel)
def unregister(self):
self.orm.unregister(SimpleModel)
def testG... |
#!/usr/bin/env python3
"""
Script to copy the model files to deployment directory
Author: Megan McGee
Date: October 7, 2021
"""
from flask import Flask, session, jsonify, request
import pandas as pd
import numpy as np
import pickle
import os
from sklearn import metrics
from sklearn.model_selection import train_test_... |
import os
site_env = os.getenv('SITE_TYPE', 'local')
if site_env == 'staging':
from .staging import *
else:
from .production import *
|
# coding=ascii
from __future__ import absolute_import, division, print_function
import os
import copy
import json
import csv
import re
import unittest
import tempfile
import shutil
from ..conform import (
GEOM_FIELDNAME, X_FIELDNAME, Y_FIELDNAME,
csv_source_to_csv, find_source_path, row_transform_and_conver... |
# Junta nome e sobrenome
# Faça uma função que recebe duas listas, uma de nomes e outra com os respectivos sobrenomes, e devolve uma nova lista com os nomes e sobrenomes em uma única string. Coloque exatamente um espaço entre o nome e o sobrenome.
# O nome da sua função deve ser junta_nome_sobrenome.
def junta_nome_so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.