text stringlengths 1 927k |
|---|
"""IHC switch platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.ihc/
"""
import voluptuous as vol
from homeassistant.components.ihc import (
validate_name, IHC_DATA, IHC_CONTROLLER, IHC_INFO)
from homeassistant.components.ihc.ihcdevice... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2018-07-08
# @Filename: vacs.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: Brian Cherinka
# @Last modified time: 2018-07-09 17:27:59
import importlib
impor... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import requests
import json
import pymongo
import werobot
from requests import request
url = "http://jw.scut.edu.cn/zhinan/cms/article/v2/findInformNotice.do"
payload = 'category=0&tag=0&pageNum=1&pageSize=15&keyword='
headers = {
'Referer': 'http://jw.scut.edu.cn/zhinan/cms/toPosts.do',
'Content-Type': 'applicat... |
from datetime import datetime, timedelta
import jwt
key = "#KEY_TO_BE_REPLACED#"
def handler(event, context):
if event.get('Records') is not None:
return process_cf_request(event)
return generate_token(event)
def generate_token(event):
uri = event['uri']
if uri[0] is not '/':
uri =... |
from itertools import islice
from tqdm.auto import tqdm
import glow
def iter_fibs():
prev, cur = 0, 1
while True:
prev, cur = cur, prev + cur
yield cur
@glow.time_this
def fibs(n):
gen = islice(iter_fibs(), n)
gen = tqdm(gen)
return max(x.bit_length() for x in gen)
def test_f... |
# Copyright 2022 The KerasCV Authors
#
# 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 ... |
from functools import wraps
def uses_django_db(f):
"""Ensures Django discards any broken database connections
Django normally cleans up connections once a web request has
been processed. However, here we are not serving web requests
and are outside of Django's request handling logic. We therefore
... |
from django.contrib import admin
from profiles_api import models
admin.site.register(models.UserProfile)
# Register your models here. |
import twilltestlib
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from mechanize import BrowserStateError
def setup_module():
global url
url = twilltestlib.get_url()
def test_select_multiple():
namespaces.new_local_dict()
twill.commands.reset_browser(... |
import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from matplotlib.ticker import FuncFormatter
from replay.aggregate_plots import lightcolors, darkcolors, Y_LIM_SHAPED_REWARD, Y_LIM_SPARSE_REWARD, millions
from srl_zoo.utils import printGreen, printRed
# Init seaborn
s... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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 b... |
import pytest
from glob import glob
import pkgutil
import nbformat
# Global variables
TIMEOUT = 120
# Load notebooks
notebooks1 = glob("notebooks/book1/*/*.ipynb")
notebooks2 = glob("notebooks/book2/*/*.ipynb")
notebooks = notebooks1 + notebooks2
#get IGNORE_LIST of notebooks
IGNORE_LIST = []
with open("internal/cop... |
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> lst=["kavya","python programming",1,2,4]
>>> lst.append("lets upgrade")
>>> print(lst)
['kavya', 'python programming', 1, 2, 4, 'lets upgrade']
>>> ls... |
# coding: utf-8
"""
Developer Console Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
impo... |
from django.core.exceptions import ValidationError
import magic
class MimetypeValidator(object):
def __init__(self, mimetypes):
self.mimetypes = mimetypes
def __call__(self, value):
try:
mime = magic.from_buffer(value.read(1024), mime=True)
if not mime in self.mimetypes:
raise ValidationError('%s is... |
"""
Isa related classes.
These can be used to define an instruction set.
"""
from collections import namedtuple
from ..utils.tree import Tree, from_string
from .encoding import Relocation
Pattern = namedtuple(
"Pattern",
["non_term", "tree", "size", "cycles", "energy", "condition", "method"],
)
class Isa:
... |
"""Equipment command side-effect logic."""
from dataclasses import dataclass
from typing import Tuple
from opentrons_shared_data.labware.dev_types import LabwareDefinition
from opentrons_shared_data.pipette.dev_types import PipetteName
from opentrons.types import MountType
from opentrons.hardware_control.api import AP... |
import itertools as it
import random
from typing import Iterator, List, Tuple
from cell import Cell
from exceptions import BombDetonation, CellOutOfRange, NotEnoughFlags
def handle_out_of_range(func):
"""Обработка позиции клетки вне поля.
Обработка ситуации, когда клетки с введёнными игроком координатами
... |
class Emitter:
"""This class implements a simple event emitter.
Args:
emitterIsEnabled: enable callbacks execution?
Example usage::
callback = lambda message: print(message)
event = Emitter()
event.on('ready', callback)
event.emit('ready', 'Finished!')
"""
d... |
from flask.ext.mongoengine import MongoEngine
from flask import Flask
app = Flask('blog')
app.config["MONGODB_SETTINGS"] = {'DB': "PythonBlogg"}
app.debug = True
app.secret_key = 'abcd'
db = MongoEngine(app)
from blog import controllers
from blog.models import Post, Admin |
#!/usr/bin/env python3
"cli to inspect and fill pdf fillable forms"
import argparse
import sys
from . import pdfforms
def inspect_pdfs(args):
"entry point for inspect command"
for filepath in pdfforms.inspect_pdfs(
pdf_files=args.pdf_file,
field_defs_file=args.field_defs_file,
prefix=... |
"""
A few practical conventions common to all printers.
"""
from __future__ import print_function, division
import re
import collections
_name_with_digits_p = re.compile(r'^([a-zA-Z]+)([0-9]+)$')
def split_super_sub(text):
"""Split a symbol name into a name, superscripts and subscripts
The first part ... |
import time
t1 = time.time()
geneIdNetworkFile = open('PPI_Network.txt', 'r')
PpiNetworkPredictionsFile = open('PPI_Network_Prism_Predictions.txt', 'w')
prismPredictionsFile = open('PrismPredictions.txt', 'r')
prismPredictions = prismPredictionsFile.readlines();
prismPredictionsFile.close()
alternativeConformationsF... |
import json
import pandas as pd
import re, os, glob
import numpy as np
from collections import defaultdict
import nltk
import string
from gensim.models import Phrases
from gensim.utils import SaveLoad
from gensim.models.phrases import Phraser
from nltk.corpus import stopwords # Import the stop word list
#from sklearn.... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_torch_core.ipynb (unless otherwise specified).
__all__ = ['progress_bar', 'master_bar', 'subplots', 'show_image', 'show_titled_image', 'show_images', 'ArrayBase',
'ArrayImageBase', 'ArrayImage', 'ArrayImageBW', 'ArrayMask', 'tensor', 'set_seed', 'get_random... |
import psutil
import logging
from pathlib import Path
from typing import Union
logger = logging.getLogger(__name__)
class PIDFile:
def __init__(self, path: Union[str, Path]):
self.path = Path(path)
self._pid = None
@property
def pid(self):
return self._pid or self.load_pid()
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Teampro and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Designation(Document):
pass |
from __future__ import absolute_import
import numpy
from chainer import link
from chainer.functions.cnet import function_cnet_linear
import math
from chainer import initializers
from chainer import cuda
class CnetLinear(link.Link):
"""Binary Linear layer (a.k.a. binary fully-connected layer).
This is a lin... |
# -*- coding:utf8 -*-
# ==============================================================================
# Copyright 2017 Baidu.com, 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 th... |
from decimal import *
setcontext(Context(prec=1000))
d = Decimal(3) + Decimal(5).sqrt()
for case in xrange(input()):
n = Decimal(raw_input())
print 'Case #%d: %03d' % (case + 1, d**n) |
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
import numpy as np
import tensorflow as tf
from lib.core.config import cfg
from lib.utils.anchors_util import project_to_bev
from lib.utils.box_3d_utils import box_3d_to_anchor
import lib.dataset.maps_dict as maps_dict
class PostProcessor:
def __init__(self, stage, cls_num):
if stage == 0:
se... |
from django.db import models
from django.utils import simplejson as json
from django.utils.encoding import force_unicode
class Small(object):
"""
A simple class to show that non-trivial Python objects can be used as
attributes.
"""
def __init__(self, first, second):
self.first, self.second... |
import argparse
if __name__ == '__main__':
argument_Parser = argparse.ArgumentParser(description='Disc Filler')
argument_Parser.add_argument('num_files', help='num_files')
argument_Parser.add_argument('size_of_file', help='size_of_file')
args = argument_Parser.parse_args()
num_files = 0
size_of... |
# Copyright 2011 Nicholas Bray
#
# 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... |
"""Logging and Profiling
"""
import time as time_module
import datetime
#from anndata import logging
from . import settings
_VERBOSITY_LEVELS_FROM_STRINGS = {
'error': 0,
'warn': 1,
'info': 2,
'hint': 3,
}
def info(*args, **kwargs):
return msg(*args, v='info', **kwargs)
def error(*args, **kwa... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([30, 150, 50])
upper_red = np.array([255, 255, 180])
mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitwise_and(frame... |
from django.contrib import admin
from tips.models import Tips, Tags, Links
# Register your models here.
admin.site.register(Tips)
admin.site.register(Tags)
admin.site.register(Links) |
# -*- coding: utf-8 -*-
"""
indicator.py
Copyright (c) 2020 Nobuo Namura
This code is released under the MIT License.
"""
import numpy as np
from scipy.spatial import distance
#======================================================================
def rmse_history(x_rmse, problem, func, nfg=0):
rmse = 0.0
for... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... |
furl = None
try:
from furl import furl
except ImportError:
pass
import six
from sqlalchemy import types
from .scalar_coercible import ScalarCoercible
class URLType(types.TypeDecorator, ScalarCoercible):
"""
URLType stores furl_ objects into database.
.. _furl: https://github.com/gruns/furl
... |
#! /usr/bin/env python3
import cv2
from pytesseract import image_to_string
import numpy as np
from ocr_server import OCRDetect
print("hello world")
ocrDetect = OCRDetect()
# img = cv2.imread('/home/user/catkin_ws/src/competition2/models/map/one1.png', 1) #, cv2.IMREAD_GRAYSCALE)
detect_text = ocrDetect.read_sign('/... |
import numpy as np
from SC.build_data import check_feasibility
if __name__ == '__main__':
X = np.load('../results/SC/SC.npy')
X0 = X[:,:64]
X1 = X[:,64:]
for i in range(X.shape[0]):
is_feasibe = check_feasibility(X0[i], X1[i])
print('{}: {}'.format(i, is_feasibe))
if not i... |
import os
from bson.json_util import dumps
from flask_restful import Resource
from flask import Response
from utils.cache import cache
from utils.deepzoom import get_slide
class DeepZoom(Resource):
def __init__(self, config):
"""initialize DeepZoom resource
Args:
db: mongo db connection
config: application... |
#!/usr/bin/env 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 ... |
# Generated by Django 2.1.7 on 2019-03-14 17:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0058_auto_20190312_1716")]
operations = [
migrations.AlterField(
model_name="channel",
name="kind",
field=mode... |
"""Sensor platform for blueprint."""
from homeassistant.helpers.entity import Entity
from homeassistant import config_entries
from .const import ATTRIBUTION, DEFAULT_NAME, DOMAIN_DATA, ICON, DOMAIN, CONF_DEFAULT_LIST
import logging
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(
hass, config... |
import tensorflow as tf
import tensorlayer as tl
from tensorlayer import layers
from tensorlayer.models import Model
from tensorlayer.layers import BatchNorm2d, Conv2d, DepthwiseConv2d, LayerList, MaxPool2d
from ..utils import tf_repeat
from ..define import CocoPart,CocoLimb
initial_w=tl.initializers.random_normal(std... |
#==============================================================================
#
# This code was developed as part of the Astronomy Data and Computing Services
# (ADACS; https:#adacs.org.au) 2017B Software Support program.
#
# Written by: Dany Vohl, Lewis Lakerink, Shibli Saleheen
# Date: December 2017
#
# It is... |
__author__ = 'Jay Modi'
from django.conf import settings
from django.conf.urls import patterns, include, url
from .views import course_data
urlpatterns = [
url(
r'^courses-data/{}$'.format(
settings.COURSE_ID_PATTERN,
),
course_data,
name='edx_course_progress',
),
... |
import os
import subprocess
from multiprocessing import Pool
import mlflow
from pyutils.general import ensure_dir, logger
from pyutils.config import configs
root = "log/svhn/vgg8/ss"
script = 'train_learn.py'
config_file = 'config/svhn/vgg8/ss/learn.yml'
configs.load(config_file, recursive=True)
def task_launcher(a... |
"""
Test file for database methods written in db.py
All test methods must receive client as an argument,
otherwise the database variable won't be configured correctly
"""
from mflix.db import add_comment, update_comment, delete_comment, get_movie
from mflix.api.user import User
from pymongo.results import InsertOneRes... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
import numpy as np
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, TransmissionTyp... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import String, Bool
#from pishu_msgs.srv import talk
import os
from functools import partial
def chatter_callback(done_pub, data):
print data.data
cmd = "espeak ' " + data.data + " ' 2>/dev/null "
print cmd
os.system(cmd)
#global done_pub
d... |
import pandas as pd
import numpy as np
import os, pdb, sys
def netIncome():
df = pd.read_csv('usda_data/net_income.csv')
df = df[df['Year'] == 2017].reset_index().drop(['index'], axis = 1)
df = df[['Year', 'State', 'State ANSI', 'County', 'County ANSI', 'Zip Code', 'Value']]
df.columns = ['yr', 'st', ... |
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import SGDRegressor
import scipy.stats as ss
model = Pipeline(steps=[
('scl', StandardScaler()),
('lin', SGDRegressor(
# Logistic Regression
loss = 'squared_loss',
penalty = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pyeapi
from netests import log
from nornir.core.task import Result
from netests.constants import PING_DATA_HOST_KEY
from netests.converters.ping.ping_validator import _raise_exception_on_ping_cmd
def _arista_ping_api_exec(task):
c = pyeapi.connect(
tr... |
# VMware vCloud Director Python SDK
# Copyright (c) 2014-2018 VMware, 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-... |
#####################################################
#
# Base class for restricted Boltzmann machines
#
#
# Copyright (c) 2018 christianb93
# 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 Softwa... |
"""Configure py.test."""
import pytest
from pyvizio.const import DEVICE_CLASS_SPEAKER, MAX_VOLUME
from .const import (
ACCESS_TOKEN,
APP_LIST,
CH_TYPE,
CURRENT_APP_CONFIG,
CURRENT_EQ,
CURRENT_INPUT,
EQ_LIST,
INPUT_LIST,
INPUT_LIST_WITH_APPS,
MODEL,
RESPONSE_TOKEN,
UNIQUE... |
from flask import Flask
from app.models import SingletonModel
app = Flask(__name__)
def create_app():
from dotenv import load_dotenv
load_dotenv()
from app.router import bp
app.register_blueprint(bp)
SingletonModel.load_models()
return app |
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
import cv2
import glob
import moviepy.editor as mp
# Root directory of the project
ROOT_DIR = os.path.abspath("../")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local versi... |
# -*- coding: utf-8 -*-
import inspect
import logging
from infix import or_infix
LOG = logging.getLogger(__name__)
@or_infix
def flip_flop(condition_one, condition_two):
"""
A Flip Flip Operator, as seen in Ruby and Perl.
Returns a boolean that flips from false to true when condition_one is True and
... |
import re
from mako.util import FastEncodingBuffer
from exceptions import NemoException
from pyparsing import (Word, Keyword, Literal, OneOrMore, Optional, \
restOfLine, alphas, ParseException, Empty, \
Forward, ZeroOrMore, Group, CharsNotIn, White, delimitedList, quotedStri... |
# -----------------------------------------------------------------------------
# Copyright (C) Jupyter Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
# ------------------------------------------------------------... |
# Copyright (c) OpenMMLab. All rights reserved.
import logging
from mmcv.utils import collect_env as collect_base_env
from mmcv.utils import get_git_hash
import mmdeploy
def collect_env():
"""Collect the information of the running environments."""
env_info = collect_base_env()
env_info['MMDeployment'] =... |
#!/usr/bin/env python3
# DJI_drone_barometer_altitide_for_PhotoScan(input_directory, output_file_name, [-recursive])
# Grab barometer altitude from DJI jpegs and create
# a text file to use them with Agisoft PhotoScan.
# The GPS altitude on most DJI drones is so bad you
# can't use it with PhotoScan. Better to use ... |
# Generated by Django 2.2.5 on 2019-10-21 07:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sushi', '0022_sushi_cred... |
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
#!/usr/bin/env python
import os
import sys
from pathlib import Path
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some... |
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import numpy as np
import os
import sys
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import pickle
import copy
from mpl_toolkits.basemap import Basemap
import matplotlib.colors
import shutil
GBPS_lat_min = 48.0
... |
# Copyright 2018 The Oppia 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 ... |
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from the_millionaire.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class User... |
# Copyright (c) 2019 - now, Eggroll 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 ... |
"""
Module for reading data from 'q4x.csv' and 'q4y.csv'
"""
import numpy as np
def loadData (x_file="../ass1_data/q4x.dat", y_file="../ass1_data/q4y.dat"):
"""
Loads the X, Y matrices.
"""
X = np.genfromtxt(x_file, delimiter=' ', dtype=int)
labels = np.genfromtxt(y_file, dtype=str)
Y = []
... |
########################################
# written for Python 3 #
# by Doug Fabini (fabini@mrl.ucsb.edu) #
########################################
'''
This script requires the following files to be located in 'baseDir':
- IBZKPT (to extract number of k points) POSSIBLY NO LONGER NEEDED
- DOSCAR (t... |
"""
(C) 2014-2016 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import sys
def set_ie_mode():
"""
By default hosted IE control emulates IE7 regardless which version of IE is installed. To fix this, a proper value
must be set for the executable.
See ... |
from django.apps import AppConfig
class DatacoreConfig(AppConfig):
name = 'datacore' |
import sqlite3
import requests
from bs4 import BeautifulSoup
from datetime import datetime
conn = None
conn = sqlite3.connect("db/db_scrapper.db")
def showAll():
cur = conn.cursor()
cur.execute("SELECT * FROM LOG_TEST")
rows = cur.fetchall()
for row in rows:
print(row)
... |
# Generated by Django 3.1.7 on 2021-03-10 08:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Burst Detect Es6
# GNU Radio version: 3.7.13.4
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.star... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Bot to find all pages on the wiki with mixed latin and cyrilic alphabets."""
#
# (C) Pywikibot team, 2006-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import codecs
from itertools import chain,... |
from django import forms
from django.core import validators
from pontoon.base.forms import HtmlField
class NotificationsForm(forms.Form):
message = HtmlField()
selected_locales = forms.CharField(
validators=[validators.validate_comma_separated_integer_list]
) |
# Copyright 2013 Nebula 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... |
# Natural Language Toolkit: Corpus Reader Utility Functions
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
######################################################################
#{ Lazy Corpus Loader
#############... |
import mine232 as mn
import pandas as pd
import datetime # duration calculation
from os import path
import time # for the sleep at the end of the loop
import gc # garbage collection, freeing memory
# input parameters
gfrom = 18681
gto = 20001 # gfrom+2000
inc = 100
# variable initiation
fromto = str(gfrom)+'-'+st... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... |
from main.models import FiltroMovimientos
from fixtures_views import *
class TestFiltroAsientos():
@pytest.fixture
def create_filter(self):
# Create filter with default values (all blanks)
return FiltroMovimientos.objects.create()
@pytest.fixture
def create_and_populate_filter(self):... |
import os
import shutil
from montreal_forced_aligner.corpus import AlignableCorpus, TranscribeCorpus
from montreal_forced_aligner.dictionary import Dictionary
from montreal_forced_aligner.config.train_config import train_yaml_to_config
def test_basic(basic_dict_path, basic_corpus_dir, generated_dir, default_feature_... |
from pythonish_validator.common import Validator
DATA_SAMPLE = {
"hero": {
"name": "R2-D2",
"friends": [
{
"name": "Luke Skywalker",
"appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
"friends": [
{"name": "Han Solo"},
... |
# Generated by Django 3.0.1 on 2020-03-09 18:17
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travello', '0023_auto_20200310_0007'),
]
operations = [
migrations.AlterField(
model_name='team',
na... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""Data Test Suite."""
import pytest
from custom_components.hacs.base import HacsRepositories
from custom_components.hacs.enums import HacsGitHubRepo
from custom_components.hacs.utils.data import HacsData
from tests.async_mock import patch
@pytest.mark.asyncio
async def test_hacs_data_async_write1(hacs, repository)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.