text stringlengths 2 999k |
|---|
import os
from bs4 import BeautifulSoup
import base64
import shutil
# path of collected images
path_image = './collected_data_raw_top_200_Naver/'
for file_folder in os.listdir(path_image):
# process html file
if (os.path.isfile(os.path.join(path_image, file_folder))):
f_html = file_folder
pri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.6.0-bd605d07 on 2018-12-20.
# 2018, SMART Health IT.
import os
import io
import unittest
import json
from . import auditevent
from .fhirdate import FHIRDate
class AuditEventTests(unittest.TestCase):
def instantiate_from(self, filename):
... |
from setuptools import setup
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='linkedin-jobs-scraper',
version='1.2.4',
author='Ludovico Fabbri',
author_email='ludovico.fabbri@gmail.com',
description='Scrape public available jobs on Linkedin using headless browser',
... |
from collections import defaultdict
import logging
from typing import Dict, List, Tuple, Set, Optional, Iterable, Union, Type, TYPE_CHECKING
import networkx
import ailment
from ...knowledge_base import KnowledgeBase
from ...codenode import BlockNode
from ...utils import timethis
from ...calling_conventions import Si... |
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
from einops import rearrange, repeat
from mesh_transformer.util import f_psum, g_psum
class ReplicatedLayerNorm(hk.Module):
def __init__(self, offset=True):
super().__init__()
self.offset = offset
def __call__(self, inp... |
class LazyLoadProxy(object):
# Taken from http://code.activestate.com/recipes/496741-object-proxying/
__slots__ = ["_obj_fn", "__weakref__", "__proxy_storage"]
def __init__(self, fn, storage=None):
object.__setattr__(self, "_obj_fn", fn)
object.__setattr__(self, "__proxy_storage", storage)
... |
__author__ = "Christopher Tomkins-Tinch"
__copyright__ = "Copyright 2022, Christopher Tomkins-Tinch"
__email__ = "tomkinsc@broadinstitute.org"
__license__ = "MIT"
# built-ins
import time
import os
import re
import json
import logging
import xml.etree.ElementTree as ET
# module-specific
from snakemake.remote import Ab... |
# coding=utf-8
# Copyright 2020 The Trax 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python3
import sys
import os
import platform
import setuptools
from setuptools.command.build_ext import build_ext as _build_ext
if 'Windows' == platform.system():
if 'AMD64' == platform.machine():
vixpath = os.path.join(os.getenv('PROGRAMFILES(x86)'), 'VMware\\VMware VIX')
libs = [... |
# Copyright 2021 Huawei Technologies Co., Ltd.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 ap... |
import glob
import random
import itertools
import numpy as np
from collections import Counter
import xml.etree.ElementTree as ET
from matplotlib import pyplot as plt
def get_path(dataset:str='Restaurant', language: str='English', mode: str='Train'):
file_type = {'Test': 'B',
'Train':'xml'}
... |
#!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./train --dataset <file|directory|glob>
import os
import sys
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src')]
import argparse
import json
import numpy as np
import tensorflow as tf
import time
import tqdm
from tensorflow.core.protobuf impor... |
import dolfin
import numpy
from matplotlib import pyplot
# define an exact stream function
#psi_exact_str = 'x[1]<=pi ? epsilon*cos(x[0])-(1.0/(cosh((x[1]-0.5*pi)/delta)*cosh((x[1]-0.5*pi)/delta)))/delta : epsilon*cos(x[0]) + (1.0/(cosh((1.5*pi-x[1])/delta)*cosh((1.5*pi-x[1])/delta)))/delta'
psi_exact_str = '1'
eps... |
f = open('files_trans.5.2.18', 'r')
m = open('files.5.2.18', 'w')
for l in f:
# print ('line: ' + l)
arr = l.strip().split()
if len(arr) == 2:
m.write(arr[1].split('.')[0] + '\t' + arr[0]+'\n')
elif len(arr) == 3:
m.write(arr[1].split('.')[0] + '\t' + arr[0]+'\n')
m.write(arr[2].... |
# we need the os modules for working with the paths
from os.path import join, isdir
import torch
NUM_CHANNELS = 3
NUM_CLASSES = 1
NUM_LEVELS = 3
INIT_LR = 0.001
NUM_EPOCHS = 4
BATCH_SIZE = 128
TEST_SPLIT = 0.15
INPUT_IMAGE_WIDTH = 256
INPUT_IMAGE_HEIGHT = 256
THRESHOLD = 0.5
BASE_OUTPUT = "output"
MODEL_PATH = j... |
import math
import sys
import numpy as np
import pygame
import freqshow
import ui
# Spectrogram renkleri.
def lerp(x, x0, x1, y0, y1):
return y0 + (y1 - y0)*((x - x0)/(x1 - x0))
def rgb_lerp(x, x0, x1, c0, c1):
return (math.floor(lerp(x, x0, x1, float(c0[0]), float(c1[0]))),
math.floor(lerp(x, x0, x1, fl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'modern-slavery-statements-resear... |
# Mathias Punkenhofer
# code.mpunkenhofer@gmail.com
#
from abc import ABC, abstractmethod
class Variant(ABC):
@abstractmethod
def __init__(self, board=None):
self.board = board
@abstractmethod
def is_draw(self):
"""
Returns true if the game is drawn
:return boolean
... |
class Transaction(object):
"""Filesystem transaction write context
Gathers files for deferred commit or discard, so that several write
operations can be finalized semi-atomically. This works by having this
instance as the ``.transaction`` attribute of the given filesystem
"""
def __init__(self... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import bz2
from contextlib import contextmanager
from datetime import datetime
import fnmatch
from glob import glob
from conda._vendor.toolz.itertoolz import groupby
from conda.gateways.disk.permissions import m... |
#pylint: disable=global-at-module-level
import os
import firebase_admin
from firebase_admin import credentials
from firebase_admin import storage
from configs.config import CREDENTIALS_FILE
global admin
admin = firebase_admin.initialize_app(
credentials.Certificate(CREDENTIALS_FILE),
name='object-is',
op... |
from __future__ import division, print_function, absolute_import
import numpy as np
from stingray.pulse.pulsar import fold_events, get_TOA
from stingray.pulse.pulsar import stat, z_n, pulse_phase, phase_exposure
from stingray.pulse.pulsar import fold_detection_level, z2_n_detection_level
from stingray.pulse.pulsar imp... |
from django.urls import path
from django.conf.urls import url
from profiles_api import views
urlpatterns = [
path('hello_view/', views.HelloApiView.as_view()),
]
|
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from ..serializers import PortfolioSerializer, Portfolio
class PortfolioViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Portfolio.objects.all()
serializer_class = PortfolioSeriali... |
""" Entry point for 802.1X speaker. """
import random
from eventlet import sleep, GreenPool
from eventlet.queue import Queue
from chewie import timer_scheduler
from chewie.activity_socket import ActivitySocket
from chewie.eap import Eap
from chewie.eap_socket import EapSocket
from chewie.ethernet_packet import Etherne... |
#!/usr/bin/env python3
"""Test runner for typeshed.
Depends on mypy being installed.
Approach:
1. Parse sys.argv
2. Compute appropriate arguments for mypy
3. Pass those arguments to mypy.api.run()
"""
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
import sys
i... |
from .parser import DTDParser as Parser
from .structure import DTDStructure as Structure
from .serializer import DTDSerializer as Serializer
class DTDFormatParser():
name = 'dtd'
desc = 'DTD reader/writer'
extensions = ['dtd']
encoding = 'utf_8' # allowed encoding
fallback = ['utf_8_sig']
... |
import csv
import os
import json
from .constants import FieldTypes as FT
class CSVModel:
"""CSV file storage"""
fields = {
"Date": {'req': True, 'type': FT.iso_date_string},
"Time": {'req': True, 'type': FT.string_list,
'values': ['8:00', '12:00', '16:00', '20:00']},
"... |
# -*- coding: utf-8 -*-
import pyautogui
import time
import thread
posicoes = []
def grava():
pos = input("Quantas posiçoes deseja salvar?")
sec = input("Delay")
for i in range(pos):
print("Gravando %dª posiçao" % (i))
posicoes.append(pyautogui.position())
time.sleep(sec)
# f... |
import requests
import json
import os
def write_to_file(url, fname):
with open(fname, "a") as f:
f.write(url+"\n")
def main():
# Not sure why, but the banner messes up if i put into one print function
print(" .\"\"\"-.")
print(" ... |
from mycroft import MycroftSkill, intent_file_handler
import subprocess
class SolderingStationLampOff(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
@intent_file_handler('off.lamp.station.soldering.intent')
def handle_off_lamp_station_soldering(self, message):
cmd = "curl -... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 11 22:10:22 2020
@author: sahebsingh
"""
from util import *
from math import ceil, log2
import numpy as np
import random
class GSWKeys:
def __init__(self, k, q, t, e, A, B, datatype):
self.n = k
self.q = q
... |
import socket
import sys
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_adress = ('raspberrypi.lan', 10000)
print('Connecting to %s on port %s' % server_adress)
sock.connect(server_adress)
try:
message = sys.argv[1]
print('Sending: ', message)
sock.sendall(message.encode('utf-8'))
finally:
prin... |
"""
MIT License
Copyright (c) 2018 Simon Olofsson
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... |
#!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: oneview_fcoe_networ... |
#!/usr/bin/env python
from __future__ import division
from sklearn.cluster import KMeans
import numpy as np
from scipy.io import loadmat
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import scipy.signal
plt.rc('text', usetex=True)
plt.rc('font', **{'family': ... |
# MINLP written by GAMS Convert at 05/15/20 00:51:13
#
# Equation counts
# Total E G L N X C B
# 762 619 34 109 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... |
import email
import imaplib
import sys
import string
import os
import json
import uuid
from datetime import datetime
from smtplib import SMTP
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
###############################... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import sys
from colour.utilities.deprecation import ModuleAPI, build_API_changes
from colour.utilities.documentation import is_documentation_building
from colour.hints import Any
from .cameras import RGB_CameraSensitivities
from .displays import RGB_DisplayPrimaries
from .datasets import * # noqa
from . import data... |
import pytest
import packerlicious.builder as builder
class TestNullBuilder(object):
def test_no_required_fields(self):
b = builder.Null()
b.to_dict()
|
# Generated by Django 1.9.4 on 2016-03-25 11:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lippukala', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='code',
name='prefix',
f... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-08-03 08:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('giscube', '0005_auto_20180529_1051'),
]
operations = [
migrations.CreateModel(
name='Server',
... |
#!/usr/bin/env python
import argparse
import distutils.core
import fileinput
import os
import re
import shutil
import subprocess
import sys
from urllib import request as url_request
import pyratemp
def required_environment_directory(environment_variable, description_for_error):
directory = os.environ.get(enviro... |
proxy_ip = "172.217.24.14"
proxy_port = 80
socks5_no_auth_resp = [b'\x05\x00',b'\x05\x00\x00', b'\x01',b'\x00\x00\x00\x00', b'\x06\xb5']
socks5_auth_resp = [b'\x05\x02',b'\x01\x00', b'\x05\x00\x00', b'\x01', b'\x00\x00\x00\x00', b'\x06\xb5']
socks5_auth_fail_resp = [b'\x05\x02',b'\x01\x01', b'\x05\x00\x00', b'\x01', b'... |
from subprocess import PIPE, Popen
import pytest
class TestEntryPoints:
def _popen(self, cmd):
process = Popen([cmd], stdout=PIPE, stderr=PIPE)
process.communicate()
return process.stdout or process.stderr
def test_cci_entry_point(self):
assert self._popen("cci")
def tes... |
from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSCustomImageRep (TestCase):
def testMethods(self):
self.assertArgIsSEL(NSCustomImageRep.initWithDrawSelector_delegate_, 0,
b'v@:@')
@min_os_level('10.8')
def testMethods10_8(self):
self.assertArgIsBOOL(
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2018-2021 mundialis GmbH & Co. KG
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
Unl... |
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.contrib.auth import login, authenticate
from .forms import SignUpForm
def register(request):
if request.method == 'POST':
query_dict = request.POST.copy()
query_dict['username'] = ... |
## SETUP ##
## dependencies
import pandas as pd
## logging
sys.stdout = open(snakemake.log[0], 'w')
sys.stderr = open(snakemake.log[0], 'w')
## input files
input_dict = {
'kreport' : snakemake.input['kreport'],
'kronataxlist' : snakemake.input['kronataxlist']
}
## output files
output_dict = {
'counttaxl... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 20 04:12:40 2020
@author: USER
"""
# In[import]:
import tensorflow as tf
import os
import sys
import scipy.io
import time
import datetime
from IPython.display import Audio, display
import numpy as np
import librosa
import matplotlib.pyplot as plt
from b... |
import pytest
from app import create_app
@pytest.fixture(name="app")
def fixture_app():
return create_app(
{
"TESTING": True,
}
)
@pytest.fixture(name="client")
def fixture_client(app):
return app.test_client()
@pytest.fixture(name="runner")
def fixture_runner(app):
re... |
#!/usr/bin/env python2
"""Build the SeqAn Releases Website."""
import operator
import optparse
import os
import os.path
import re
import sys
import time
import xml.sax.saxutils
from distutils.version import StrictVersion
import pyratemp
# Patterns matching seqan srcs, apps and library.
SRC_PATTERN = (r'seqan-src-([0... |
class Solution:
def XXX(self, head: ListNode) -> ListNode:
def delete(node: ListNode):
if node and node.next:
if node.val == node.next.val:
node.next = node.next.next
delete(node)
else:
delete(node.next)... |
#!/usr/bin/python
# Copyright (c) 2017, 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... |
import json
from django import forms
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.core.files import File
from django.db import transaction
from django.db.models import Count, ProtectedError
from django.forms import inlineformset_fa... |
from sys_simulator.a2c.agent import A2CAgent
from sys_simulator.a2c.framework import A2CDiscreteFramework
import torch
import gym
ALGO_NAME = 'a2c'
NUM_ENVS = 8
ENV_NAME = 'CartPole-v1'
HIDDEN_SIZE = 256
NUM_HIDDEN_LAYERS = 1
LEARNING_RATE = 3E-4
MAX_STEPS = 200000
STEPS_PER_EPISODE = 300
THRESHOLD_REWARD = 450
BETA =... |
from ... import ir
from ...binutils.assembler import BaseAssembler
from ..arch import Architecture
from ..arch_info import ArchInfo, TypeInfo
from .registers import A, X, Y
from . import registers
from .instructions import stm8_isa
class Stm8Arch(Architecture):
""" STM8 architecture description. """
name = "... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# http://www.nltk.org/api/nltk.parse.html
|
import sys
sys.path.append('../../soa_generator')
import soa_generator as soa
header_extra = '#include "math.h"\n\nclass Material;\n'
add_parameters = 'Vec3 center, float radius, Material *material'
properties = [['float', 'center_x', ' = center.getX();'],
['float', 'center_y', ' = center.getY();'... |
class AsyncUplinkSettings:
def __init__(self, session):
super().__init__()
self._session = session
async def getNetworkUplinkSettings(self, networkId: str):
"""
**Returns the uplink settings for your MX network.**
https://developer.cisco.com/meraki/api/#!get-network-... |
from __future__ import print_function
# ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files... |
import numpy as np
def orthoTrans(params, trans, etc):
"""
This function uses principal component analysis to modify parameter values.
Parameters
----------
params: Array of params to be modified, length is npars for 1D
If 2D, shape is npars x nsteps
invtrans: Inverse tr... |
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
"{{last_name}} {{company_suffix}}",
"{{first_name}} {{last_name}} s.p.",
)
company_suffixes = (
"d.o.o.",
"d.d.",
)
|
def ready_jobs_dict_to_key(ready_jobs_list_dict):
ready_jobs_list_key = (
"ready_jobs"
+ "_cpu_credits_"
+ str(ready_jobs_list_dict["cpu_credits"])
+ "_gpu_credits_"
+ str(ready_jobs_list_dict["gpu_credits"])
)
return ready_jobs_list_key
|
import os
from socrata.authorization import Authorization
authorization = Authorization(
'chris.test-socrata.com',
os.environ['SOCRATA_USERNAME'],
os.environ['SOCRATA_PASSWORD']
)
|
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
from web_app.app import app
import pandas as pd
from web_app.apps.helpers.helper_functions import get_tweets, get_polarity
df = pd.read_csv("/mnt/data/Events/CODE19/smart-disease-prediction-... |
name = "iotnode"
|
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
The default configuration values to write to config.yaml.
"""
import sys, os, multiprocessing
from meerschaum.connectors import attributes as connector_attributes
default_meerschaum_config = {
'instance' : 'sql:main',
'api_instance' : 'MRSM... |
from datetime import datetime
from functools import wraps
import json
import logging
from dateutil.tz.tz import tzlocal
from flask import request
from flask_restful import reqparse
import requests
from sqlalchemy.exc import IntegrityError
from datagateway_api.src.common.date_handler import DateHandler
from datagatewa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# parameters.py
# ----------------------------------------------
# import from standard lib
import logging
from pprint import pformat
from urllib.parse import urlparse
# import from other lib
import yaml
# import from my project
import icp2edd.setupcfg as setupcfg
# --... |
import django
from django import template
from django.conf import settings
settings.configure()
django.setup()
def renderTemplate(t, ctx):
t = template.Template(t)
c = template.Context(ctx)
return t.render(c)
|
# Copyright 1999-2019 Alibaba Group Holding 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 a... |
from functools import wraps
from flask_admin import Admin, AdminIndexView # type: ignore
from flask_admin.contrib.peewee import ModelView # type: ignore
from flask_login import current_user # type: ignore
from lms.lmsdb.models import Comment, CommentText, Solution
from lms.lmsweb import webapp
from lms.models.erro... |
# 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 ... |
import sopel.module
import random
@sopel.module.event('KICK')
@sopel.module.rule('.*')
def rekt(bot, trigger):
rektlist = ['rektangle', 'tyranosaurus rekt', 'the good, the rekt, and the ugly', 'south by southrekt', 'brektfast', 'rektum', 'erektile issues', 'star trekt', 'rektified', 'wrong rektitude', 'bad direkt... |
#!/usr/bin/env python
import sys
import os
import codecs
try:
from skbuild import setup
except ImportError:
print(
"Please update pip, you need pip 10 or greater,\n"
" or you need to install the PEP 518 requirements in pyproject.toml yourself",
file=sys.stderr,
)
raise
def rea... |
import os
import sys
import json
import torch
import tqdm
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from transformers import AutoTokenizer, AutoModelForQuestionAnswering
from src.data.dataset_readers.utils.elasticsearch_utils import (
get_elasticsearch_paragraph,
get_elasticsearch_results,
concate... |
from PyInquirer import prompt
from examples import custom_style_2
import random
import argparse
from questions import yes_no, how_masked
from data import get_words, add_word, delete_word
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--length', help='Lenght of the word.')
parser.add_argument('--add', he... |
#!/usr/bin/env python
""" pygame.examples.sprite_texture
Experimental! Uses APIs which may disapear in the next release (_sdl2 is private).
Hardware accelerated Image objects with pygame.sprite.
_sdl2.video.Image is a backwards compatible way with to use Texture with
pygame.sprite groups.
"""
import os
import pygam... |
import numpy as np
from headerfile import *
class Mando:
'''Define the mando
'''
def __init__(self, dirn, fly):
self.__x = PLACEWIDTH # x coordinate of the torso
self.__y = HEIGHT-GROUND-2 # y coordinate of the torso
self.__dirn = dirn # -1 means left, 0 means stop, 1 means rig... |
from openpyxl import load_workbook
import re
filename = 'aalh_iit_celebrations_001.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 15
maximumcol = 15
minimumrow = 7
maximumrow = 206
iterationrow = 7
targetcol = 15
isostandardcol = 16
for row in ws.iter_rows(min_row=minim... |
# -*- coding: utf-8 -*-
"""File generated according to PMagnet13/gen_list.json
WARNING! All changes made in this file will be lost!
"""
from pyleecan.GUI.Dialog.DMachineSetup.SMagnet.PMagnet13.Ui_PMagnet13 import (
Ui_PMagnet13,
)
class Gen_PMagnet13(Ui_PMagnet13):
def setupUi(self, PMagnet13):
"""Ab... |
#!/usr/bin/env python
import boto3
import psycopg2
import pymysql
import csv
import time
import sys
import os
import datetime
from sqlalchemy import create_engine
import pandas as pd
from datetime import date
datetime_object = datetime.datetime.now()
print ("Data Pipeline: Aurora MySQL -> EC2 -> Redshift")
print ("I... |
#-- Audio -> small chunks -> text -> srt -> files
import speech_recognition as sr
from pydub import AudioSegment
from pydub.utils import make_chunks
myaudio = AudioSegment.from_file("/content/drive/My Drive/Hackathon_2020_Enigma/Video-Text/audio.wav" , "wav")
chunk_length_ms = 5000 # pydub calculates in millisec
c... |
import shapefile
names = []
sf = shapefile.Reader("shapes/Gas_Site")
for record in sf.records():
names.append(record[2].lower())
sf = shapefile.Reader("shapes/OHL")
for record in sf.records():
print(record)
names.append(record[4].lower())
print(names)
|
import sys
sys.path.append('../Grupo1/Instrucciones')
sys.path.append('../Grupo1/Utils')
sys.path.append('../Grupo1/Librerias/storageManager')
from jsonMode import *
from c3dGen import *
from instruccion import *
from Lista import *
from TablaSimbolos import *
from Error import *
class Create(Instruccion):
def... |
import numpy as np
import glm
from OpenGL.GL import *
from scripts import mesh
class Rectangle(object):
verts = np.array((-1, -1, 0,
1, -1, 0,
1, 1, 0,
-1, 1, 0), dtype=np.float32)
tex_coords = np.array((0, 0,
1, 0,... |
# -*- coding: utf-8 -*-
"""
Created on May 20, 2014
@author: Tyranic-Moron
"""
import re
from CommandInterface import CommandInterface
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from Utils import StringUtils, WebUtils
class Find(CommandInterface):
triggers = ['find', 'g... |
from import_export import resources
from qualiCar_API.models import Part
class PartResource (resources.ModelResource):
class Meta:
model = Part
|
"""
Copyright Astronomer, 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, software
di... |
"""Test the LinearBlockJac class."""
from __future__ import division, print_function
import unittest
import numpy as np
from openmdao.api import Group, IndepVarComp, Problem, LinearBlockJac, \
ExecComp, NonlinearBlockGS
from openmdao.utils.assert_utils import assert_rel_error
from openmdao.test_suite.components... |
# Copyright 2019 The Vitess 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
# -*- coding: utf-8 -*-
'''
Manage information about regular files, directories,
and special files on the minion, set/read user,
group, mode, and data
'''
# TODO: We should add the capability to do u+r type operations here
# some time in the future
from __future__ import print_function
# Import python libs
import co... |
################################################################################
# Copyright 2021-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# 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 t... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 5 03:34:26 2021
@author: Carlos Trujillo
"""
from setuptools import setup, find_packages
import codecs
import os
VERSION = '0.0.5'
DESCRIPTION = 'Simplificación de la conection a el API REST de Adquality en Python.'
with open('english_readme.md', encoding='utf-8') as ... |
# Scrapy settings for ted project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.htm... |
import tensorflow as tf
from tensorflow.python.training import moving_averages
from tensorflow.python.ops import tensor_array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import functional_ops
from tensorflow.python.ops import ctc_ops as ctc
from tensorflow.python.ops import variabl... |
"""
Worker Thread
"""
import shutil
import asyncio
from molior.model.database import Session
from molior.model.build import Build
from molior.model.sourcerepository import SourceRepository
from molior.molior.buildlogger import write_log, write_log_title
from .logger import get_logger
from ..ops import GitClone, get_... |
import zerorpc
import time
class ResultRPC(object):
def get_result(self, data):
# time.sleep(1)
zerorpc.gevent.sleep(1)
if not data:
return dict(data='', code=400)
u_id = data.get('u_id')
return dict(data=u_id, code=200)
s = zerorpc.Server(ResultRPC())
s.bind("t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.