content stringlengths 5 1.05M |
|---|
#!/usr/bin/env python
import sys;print(sys.argv);print(__file__)
|
import torch
from neural_clbf.systems import ControlAffineSystem
def normalize(
dynamics_model: ControlAffineSystem, x: torch.Tensor, k: float = 1.0
) -> torch.Tensor:
"""Normalize the state input to [-k, k]
args:
dynamics_model: the dynamics model matching the provided states
x: bs x se... |
from enum import Enum
import datetime
import dbaccess
class Action(Enum):
PAUSE, FINISH, ARCHIVE, WORK, CREATE, DELETE = range(6)
class Log(object):
def __init__(self, action, problem_id, name, category_id, dt=None):
self.action = action
self.problem_id = problem_id
self.name = name... |
import argparse
import collections
import torch
import numpy as np
import data_loader.data_loaders as module_data
import model.loss as module_loss
import model.metric as module_metric
import model.model as module_arch
from parse_config import ConfigParser
from trainer import Trainer
from utils import prepare_device
"... |
from django.conf.urls import include, url
from categories import views
class SingleCategoryPatterns():
urlpatterns = [
url(r'^$', views.category, name='category'),
url(r'^new/$', views.new_category, name='new_category'),
url(r'^delete/$', views.delete_category, name='delete_category'),
... |
#!/usr/bin/env python
print("SUB_TASK, Hello, Am sub_task");
import os;
import hashlib;
import time;
import multiprocessing;
def __getMd5(localFile):
md5Value = "";
md5tool = hashlib.md5();
print("__CheckFile, localFile:" + localFile);
try:
if (os.path.exists(localFile) == False):
... |
def primeFactors(n):
facts, by_two = {}, 0
start = n
while n % 2 == 0:
n //= 2
by_two += 1
for t in range(by_two):
facts[2] = by_two
for i in range(3, int(n**0.5)+1, 2):
while n % i == 0:
n = n / i
if i in facts:
facts[i] += 1... |
# Project: hardInfo
# Author: George Keith Watson
# Date Started: March 18, 2022
# Copyright: (c) Copyright 2022 George Keith Watson
# Module: model/LsCpu.py
# Date Started: March 20, 2022
# Purpose: Run Linux commands and collect output into usable Python objects.
#... |
import json
from .AccessControlEntry import AccessControlEntry
class AccessControlList(object):
"""OCS access control list definition"""
def __init__(self, role_trustee_access_control_entries: list[AccessControlEntry] = None):
self.RoleTrusteeAccessControlEntries = role_trustee_access_control_entrie... |
"""Tests for zaim_row.py."""
from datetime import datetime
from typing import Type
import pytest
from tests.testlibraries.instance_resource import InstanceResource
from tests.testlibraries.row_data import ZaimRowData
from zaimcsvconverter import CONFIG
from zaimcsvconverter.inputcsvformats import InputRow, InputRowDa... |
"""
Script with modules to connect with the database to prepare sources
"""
import logging
import os
import uuid
import pandas as pd
import utils.data_connection.constant_variables_db as cons
from utils.data_connection.source_manager import Connector
from pypika import Query, Tables, Table, JoinType
logger = logging... |
#!/share/pyenv/bin/python3
'''
###########################################################
# Code name: VASP Electronic Structure Tool(VEST) #
# #
########### script to extract data from PROCAR ############
# Input file : PROCAR, ... |
class MultiSigDeprecationWitness:
def __init__(self, next_state_state_update, signatures, inclusion_witness):
self.next_state_state_update = next_state_state_update
self.signatures = signatures
self.inclusion_witness = inclusion_witness
class MultiSigPredicate:
dispute_duration = 10
... |
import json
import os
import logging
import random
from collections import OrderedDict, defaultdict
import numpy as np
import torch
from coref_bucket_batch_sampler import BucketBatchSampler
from metrics import CorefEvaluator, MentionEvaluator
from utils.utils import extract_clusters, extract_mentions_to_predicted_clust... |
#!/usr/bin/python3
"""
kimcsv2fasttext.py: convert kim's balanced data format to fasttext format
usage: ./kimcsv2fasttext.py < BalancedDataSet.csv
20180504 erikt(at)xs4all.nl
"""
import csv
import html
import nltk
import re
import sys
import time
from io import BytesIO
from urllib.request import urlopen
... |
# This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2009 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... |
# MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
#
# 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... |
from enum import Enum, unique
from Tables import door_pair_offset_table
def create_rooms(world, player):
world.rooms += [
Room(player, 0x01, 0x51168).door(Position.WestN2, DoorKind.Warp).door(Position.EastN2, DoorKind.Warp),
Room(player, 0x02, 0x50b97).door(Position.South2, DoorKind.TrapTriggerabl... |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / info@conceptive.be
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... |
#!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, March 2017
import pylab
from datasets.nir_tecator impor... |
# Copyright (c) 2019-2022 ThatRedKite and contributors
from turtle import right
import discord
from discord.ext import commands
import time
import re
from datetime import datetime
from operator import itemgetter
import aioredis
import discord
from discord.ext import commands
async def update_count(redis: aioredi... |
from pysit.Tomo.tomo import *
|
import pandas as pd
def rail_station():
data = pd.read_csv('data/GTFS_stations.txt',sep = ',', header = None)
data = data.rename(columns = {0:'ID',2:'Name'})
use_col = ['ID','Name']
data = data.loc[:,use_col]
link_info = pd.read_csv('data/link_info.csv')
station1 = link_info.loc[:,['link_start... |
# coding=utf-8
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
class SiameseLSTMw2v(object):
"""
A LSTM based deep Siamese network for text similarity.
Uses an word embedding layer (looks up in pre-trained w2v), followed by a biLSTM and Energy Loss layer.
"""
def... |
from keras.applications import VGG16
from keras import models
from keras import layers
from keras import optimizers
from keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
import os
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
image_width = 768
image_heig... |
Import("env")
import os
dataFolder = 'data'
if not dataFolder in os.listdir(os.getcwd()):
os.mkdir(dataFolder)
print("Empty \"data\" folder for empty filesystem creation ready")
print("Replace MKSPIFFSTOOL with mklittlefs.exe")
env.Replace (MKSPIFFSTOOL = "mklittlefs.exe") |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libproxy(CMakePackage):
"""libproxy is a library that provides automatic proxy configurati... |
import torch
import torch.nn as nn
import numpy as np
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp (nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList()
... |
import pytest
from django.contrib.auth import get_user_model
from django.test import Client
def test_user_guest():
c = Client()
resp = c.get("/require-user")
assert resp.status_code == 403
assert resp.json() == {"message": "You have to log in"}
def test_async_user_guest():
c = Client()
resp ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from mock import patch
from sentry.tasks.fetch_source import (
UrlResult, expand_javascript_source, discover_sourcemap,
fetch_sourcemap, fetch_url, generate_module, BAD_SOURCE, trim_line)
from sentry.utils.sourcemaps import (SourceMap, SourceMapI... |
import numpy as np
import pandas as pd
import thermalstd
import dataclima
import solarpower
db_cable = 'DB_cables.xlsx'
csvfile = r'D:\Analise_Dados_Solares\UFV Rio do Peixe\Séries de longo prazo (Helio-Clim3)\SAO_JOAO_DO_RIO_DO_PEIXE_HC3-METEO_hour_lat-6.725_lon-38.454_2004-02-01_2019-01-30_hz1.csv'
# dictstudy_AC... |
# Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above c... |
from django.db import models
from django.contrib.auth.models import User
class Customer(models.Model):
user = models.OneToOneField(User, null=True, blank=True, on_delete= models.CASCADE)
name = models.CharField(max_length=200, null=True)
email = models.CharField(max_length=200, null=True)
def __str__... |
#!/usr/bin/env python
import glob
import json
import logging
import math
import mimetypes
import os
import platform
import re
import shutil
import socket
import subprocess
import sys
import tempfile
from multiprocessing import Process
from random import uniform
from socket import gaierror
from time import sleep
from im... |
import os
import sys
import getpass
import logging
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import SessionNotCreatedException
import colorama
from .databa... |
from armstrong.core.arm_sections import utils
from armstrong.core.arm_sections.models import Section
from ._utils import ArmSectionsTestCase, override_settings
from .support.models import SimpleCommon
def rel_field_names(rels):
return [rel.field.name for rel in rels]
class get_configured_item_modelTestCase(Arm... |
import boto3, ipaddress, os, socket, time
from codeguru_profiler_agent import with_lambda_profiler
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from aws_lambda_powertools import Logger, Tracer
# AWS Lambda Powertools
logger = Logge... |
from aicademeCV.skinCV import skinseperator
|
import os
from get_data import read_params, get_data
import argparse
def load_and_save(config_path):
config = read_params(config_path)
df = get_data(config_path)
df['fixed acidity'].fillna(int(df['fixed acidity'].median()), inplace=True)
df['volatile acidity'].fillna(int(df['volatile acidity'].mean())... |
# 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 unittest
from exactitude import countries
class CountriesTest(unittest.TestCase):
def test_country_codes(self):
self.assertEqual(countries.clean('DE'), 'de')
self.assertTrue(countries.validate('DE'))
self.assertFalse(countries.validate('DEU'))
self.assertFalse(countries.va... |
import numpy as np
import pandas as pd
from gaitcalibrate.extract.walk import extract_step
from gaitcalibrate.util.adjust_acceleration import tilt_adjustment
def estimate_walk_speed(
acc,
model,
g2acc=True,
n_skip_edge_step=3,
thd_n_step_each_walk=10,
apply_tilt_adjust=True
):
"""Estima... |
#!/usr/bin/env python
"""User API for controlling Map job execution."""
from google.appengine.ext import db
from mapreduce import util
# pylint: disable=g-bad-name
# pylint: disable=protected-access
def start(job_config=None,
in_xg_transaction=False):
"""Start a new map job.
Args:
job_config: an... |
from sklearn.ensemble import RandomForestClassifier
from sklearn import datasets
from sklearn.model_selection import train_test_split
from IPython.display import display
import eli5
from eli5.sklearn import PermutationImportance
RANDOM_STATE = 0
# Get Iris data
iris = datasets.load_iris()
X = iris.data
y = iris.targ... |
from mock import patch
import pytest
from s3parq import publish_redshift
from s3parq.testing_helper import setup_custom_redshift_columns_and_dataframe
class MockScopeObj():
def execute(self, schema_string: str):
pass
def scope_execute_mock(mock_session_helper):
pass
class Test():
# Make sur... |
import argparse
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils import data
from torchvision import datasets, transforms
import torchvision.utils as vutils
from classes import Generator, Discriminator
import conf
import utils as ut
# Command line arguments
parser = argparse.Ar... |
# -*- coding:utf-8 -*-
import xml.etree.ElementTree as ET
class Parser:
"""
this class parse style xml files.
xml -> dict in list
* all arguments and text is string. not int. you need to convert it yourself.
like this xml
<?xml version="1.0"?>
<style>
<width>635</widt... |
from .bases import EndpointBase
from aioconsul.api import consul, extract_meta
from aioconsul.exceptions import NotFound
from aioconsul.util import extract_attr
class SessionEndpoint(EndpointBase):
"""Create, destroy, and query sessions
.. note:: All of the read session endpoints support blocking queries and... |
import os
import json
from common.models import Contact, ContactType
from facilities.models import (
Facility, FacilityContact, Officer, OfficerContact
)
from users.models import MflUser
from django.core.management import BaseCommand
from django.conf import settings
system_user = MflUser.objects.get(email='syste... |
# -*- coding: utf-8 -*-
import nnabla as nn
import numpy as np
import common.rawdata as rdat
from tex_util import Texture
""" from nnc_proj.($$project_name_of_nnc) import network """
from nnc_proj.model import network
nn.clear_parameters()
nn.parameter.load_parameters('./nnc_proj/model.nnp')
ratios = rdat.ratios
mve... |
# Copyright 2021 Sean Robertson
#
# 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... |
"""
def main():
print('main')
TestCase1:
a = [1, 2, 3, 4]
b = [5, 6, 7]
# c = [1, 8, 0, 1]
TEst case2:
a = [1, 2, 3, 4]
b = [5, 6, 7,9]
#c =[6,9,1,3]
Test case3:
a = [2, 3, 4]
b = [5, 6, 7,9]
#c = [5,9,1,3]
"""
a = [2, 3, 4]
b = [5, 6, 7, 9]
sum = new_su... |
#!/bin/env python
import os
import json
import subprocess
import sys
import shutil
class Debug:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def info(self, msg):
p... |
''' Class to construct circular parts of the eyepiece
'''
from kivy.uix.widget import Widget
from kivy.lang import Builder
from kivy.properties import NumericProperty
Builder.load_string('''
<Ring>:
canvas:
Color:
rgba: self.color
rgba: self.grey, self.grey, self.grey, 1 - app.tra... |
import mock
import pytest
@pytest.fixture
def contentful():
with mock.patch(
'contentful_proxy.handlers.items.DetailProxyHandler.contentful',
new_callable=mock.PropertyMock
) as mock_types:
yield mock_types
def test_get_item_by_id(app, contentful):
contentful.return_value... |
# Practice python script for remote jobs
import time
import os
print('starting')
time.sleep(30)
if os.path.exists('62979.pdf'):
os.remove('62979.pdf')
else:
print('The file does not exist')
print('done') |
from django.db import models
from django.utils.translation import gettext_lazy as _
from itertools import chain
from operator import attrgetter
# A model which represents a projects to be displayed on the projects page of the website.
class Project(models.Model):
# Define the possible statuses of a project, each ... |
import asyncio
import asyncpg
from aiohttp import web
loop = asyncio.get_event_loop()
loop.create_server(["127.0.0.1", "localhost"], port=1234)
async def handle(request):
"""Handle incoming requests."""
pool = request.app["pool"]
power = int(request.match_info.get("power", 10))
# Take a connection ... |
"""Utilities for converting notebooks to and from different formats."""
from .exporters import *
from . import filters
from . import transformers
from . import post_processors
from . import writers
|
import unittest
import suite_all_tests_chrome
import suite_all_tests_firefox
if __name__ == '__main__':
runner = unittest.TextTestRunner(verbosity=2)
suite = unittest.TestSuite()
suite_chrome = suite_all_tests_chrome.suite()
suite_firefox= suite_all_tests_firefox.suite()
suite.addTests(suite_chrome... |
# -*- coding: utf-8 -*-
''' pyrad_proc.py - Process and pipeline management for Python Radiance scripts
2016 - Georg Mischler
Use as:
from pyradlib.pyrad_proc import PIPE, Error, ProcMixin
For a single-file installation, include the contents of this file
at the same place (minus the __future__ import below).
'''
fro... |
import requests
import pandas as pd
import json
rply = []
regions = [172]
for region in regions:
url = "https://api.bilibili.com/x/web-interface/ranking/region?rid=" + str(region) + "&day=7&original=0&jsonp=jsonp"
response = requests.get(url=url)
text = response.text
ob = json.loads(text)
... |
# Agent.py
from Tools import *
from agTools import *
import commonVar as common
class Agent(SuperAgent):
def __init__(self, number, myWorldState,
xPos, yPos, lX=0, rX=0, bY=0, tY=0, agType=""):
# 0 definitions to be replaced (useful only if the
# dimensions are o... |
# -*- coding: iso-8859-15 -*-
#
# Copyright 2017 Mycroft AI 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 appli... |
#!/usr/bin/env python
import Pyro.naming
import Pyro.core
import connvalidator
class testobject(Pyro.core.ObjBase):
def __init__(self):
Pyro.core.ObjBase.__init__(self)
def method(self,arg):
caller = self.getLocalStorage().caller # TCPConnection of the caller
login = caller.authenticated # set by the co... |
from ThirdParty.CookiesPool.cookiespool.scheduler import Scheduler
def main():
s = Scheduler()
s.run()
if __name__ == '__main__':
main() |
from typing import List, Sequence, Optional, Union
import pandas as pd
import pyexlatex as pl
from datacode.sem.constants import STANDARD_SCALE_MESSAGE, ROBUST_SCALE_MESSAGE
def summary_latex_table(fit_df: pd.DataFrame, structural_dfs: Sequence[pd.DataFrame],
latent_dfs: Sequence[pd.DataFram... |
from devito.ir.ietxdsl.operations import * # noqa
from devito.ir.ietxdsl.cgeneration import * # noqa
|
def find_ocurrences(collection, item):
result = []
for i, word in enumerate(collection):
if word == item:
result.append(i + 1)
return result
words_count, lookup_count = map(int, raw_input().split())
collection_items = []
for i in enumerate(xrange(words_count)):
current_item = raw... |
# 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... |
ll = eval(open("day_17_2.out", "r").readline())
def lookup(sl, i, j):
for (l, v) in sl:
if l == (i, j):
return v
for sl in ll:
for j in range(-3, 4):
for i in range(-3, 4):
print(lookup(sl, i, j), end='')
print()
print()
|
import sqlite3
from string import Template
# import threading #MultiThreading
# 1: successful
# 2: in_progress
# 3: failed
class SQL_Lite_Logger:
def __init__(self, filename):
self.connection = sqlite3.connect(filename)
self.connection.row_factory = lambda c, r: dict([(col[0], r[idx]) for idx, col in enumerate... |
# Link: https://leetcode.com/problems/validate-stack-sequences/
# Time: O(N)
# Space: O(N)
# def validate_stack_sequences(pushed, popped):
# stack, i = [], 0
# while stack or popped:
# if i < len(pushed):
# stack.append(pushed[i])
# elif stack[-1] != popped[0]:
# return... |
# A singular message for an error. An error is made up of multiple error messages
# A error message defines the formatting of an error.
class _ErrorMessage:
def __init__(self, message:str = None,
content:str = None,
object = None,
tokens:[] = None... |
from pyqum import create_app
app = create_app()
app.run(host='127.0.0.1', port=5777, debug=True)
|
import smart_imports
smart_imports.all()
class SettingAdmin(django_admin.ModelAdmin):
list_display = ('key', 'value', 'updated_at')
def save_model(self, request, obj, form, change):
from . import settings
settings[obj.key] = obj.value
def delete_model(self, request, obj):
from .... |
from __future__ import division
import pandas as pd
import numpy as np
from sklearn.neighbors import NearestNeighbors
import sys
import pickle
__author__ = 'sladesal'
__time__ = '20171110'
"""
Parameters
----------
data : 原始数据
tag_index : 因变量所在的列数,以0开始
max_amount : 少类别类想要达到的数据量
std_rate : 多类:少类... |
from django.contrib.auth.models import User
from django.shortcuts import render
from ..date_checker import update_all
from ..forms import UserForm, UserProfileForm
from ..models import UserProfile
from random import randint
def register(request):
"""Registration Page View
Displays registration form for user ... |
import numpy as np
import pickle
import tensorflow as tf
import os
import sys
sys.path.append("../../..")
sys.path.append("../..")
sys.path.append("..")
import utils
import random
import math
from mimic3models.multitask import utils as mt_utils
from waveform.WaveformLoader import WaveformDataset
from mimic3models.prepr... |
import math
def get_client_ip(request) -> str:
"""Get real client IP address."""
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
def get_pretty_file_size(size_in... |
"""
mmic
A short description of the project.
"""
# Add imports here
from . import components
# Handle versioneer
from ._version import get_versions
versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
|
#!/usr/bin/env python
from __tools__ import MyParser
from __tools__ import XmlParser
#import matplotlib.pyplot as plt
import lxml.etree as lxml
import subprocess as sp
import numpy as np
parser=MyParser(description="Tool to create histogramm for iexcitoncl from jobfile")
parser.add_argument("--format",type=str,defau... |
#!/usr/bin/env python3
import sys
import os
import logging
import numpy as np
import PIL.Image as Image
import vboard as vb
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
kl = vb.detect_key_lines()
for filename in sys.argv[1:]:
name = os.path.basename(filename)
try:
... |
import argparse
import os
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Script to process podcasts trascripts to json file')
parser.add_argument('--input_file', type=str, required=True)
parser.add_argument('--output... |
#!/usr/bin/env python
# encoding: utf-8
"""
File: thin_mrbayes_runs.py
Author: Brant Faircloth
Created by Brant Faircloth on 29 March 2012 09:03 PDT (-0700)
Copyright (c) 2012 Brant C. Faircloth. All rights reserved.
Description:
"""
import os
import sys
import glob
import shutil
import argparse
from phyluce.helpe... |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Panda(CMakePackage):
"""PANDA: Parallel AdjaceNcy Decomposition Algorithm"""
homepage... |
import argparse
import json
import pickle
from bz2 import BZ2File
from pprint import pprint
# with open("wiki_data/properties.pkl", "rb") as props:
# properties_mapper = pickle.load(props)
properties_mapper = {}
properties_mapper.update(
{
"Q6581097": "male",
"Q6581072": "female",
}
)
d... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
from rest_framework.test import APITestCase
from rest_framework import status
from rest_framework.reverse import reverse as api_reverse
from survivor.models import Survivor, FlagAsInfected, Reports
class ReportsAPITestCase(APITestCase):
def setUp(self):
Survivor.objects.create(
name='New Name... |
import pathlib
from setuptools import setup
current_location = pathlib.Path(__file__).parent
README = (current_location / "README.md").read_text()
setup(
name="wiktionary-parser-ru",
version="0.0.1",
packages=["wiktionaryparserru", "tests"],
url="https://github.com/ShatteredMind/wiktionaryparserru",
... |
def convert(s):
s_split = s.split(' ')
return s_split
def niceprint(s):
for i, elm in enumerate(s):
print('Element #', i + 1, ' = ', elm, sep='')
return None
c1 = 10
c2 = 's'
|
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
LightGBM/Python training script
"""
import os
import sys
import argparse
import logging
import traceback
import json
from distutils.util import strtobool
import lightgbm
from collections import namedtuple
# Add the right path to PYTHONPATH
#... |
"""
Lark parser and AST definition for Domain Relational Calculus.
"""
from typing import Dict, NamedTuple, Set, Tuple
from lark import Lark, Token, Tree
from relcal import config
from relcal.helpers.primitives import Singleton
####################
# Type definitions #
####################
Fields = Tuple[Token, ...... |
import logging
import logging.config
import os
import signal
import sys
import click
import gevent
import gevent.pool
from eth_keys.datatypes import PrivateKey
from eth_utils import to_checksum_address
from gevent.queue import Queue
from marshmallow.exceptions import ValidationError
from toml.decoder import TomlDecode... |
# -*- coding: utf-8 -*-
"""
Test cases related to direct loading of external libxml2 documents
"""
from __future__ import absolute_import
import sys
import unittest
from .common_imports import HelperTestCase, etree
DOC_NAME = b"libxml2:xmlDoc"
DESTRUCTOR_NAME = b"destructor:xmlFreeDoc"
class ExternalDocumentTestC... |
import math
from tkinter import Tk, Canvas, W, E, NW
from tkinter.filedialog import askopenfilename
from tkinter import messagebox
from scipy.interpolate import interp1d
import time
import numpy as np
# Definición recursiva, requiere numpy
# def B(t,P):
# if len(P)==1:
# return np.array(P[0])
# else:
# ... |
from gensim.models.keyedvectors import KeyedVectors
import numpy as np
import pandas as pd
__author__ = "Sreejith Sreekumar"
__email__ = "sreekumar.s@husky.neu.edu"
__version__ = "0.0.1"
model = KeyedVectors.load_word2vec_format('/media/sree/venus/pre-trained-models/GoogleNews-vectors-negative300.bin', binary=True... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Filename: results_to_latex.py
import os, argparse, json, math
import logging
TEMPLATE_CE_RESULTS = r"""\begin{table}[tb]
\scriptsize
\centering
\caption{Chaos Engineering Experiment Results on %s}\label{tab:ce-experiment-results-%s}
\begin{tabularx}{\columnwidth}{lrrrXXXX}
... |
import yfinance as yf
import pandas as pd
import numpy as np
import quandl
API_KEY = '8ohVvwCgmzgRpFeza8FD'
quandl.ApiConfig.api_key = API_KEY
# Download APPL Stock price
df = yf.download('AAPL', start='1999-12-31', end='2010-12-31', progress=False)
df.rename(columns = {'Adj Close': 'adj_close'},inplace=True)
df = d... |
#!/usr/bin/env python
#############################################################################
##
## This file is part of Taurus, a Tango User Interface Library
##
## http://www.tango-controls.org/static/taurus/latest/doc/html/index.html
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Tau... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.