content stringlengths 5 1.05M |
|---|
# _ _ _ _____ _ ______ ___ ______ _____
# | | | | | ||_ _| | | ___ \ / _ \ | ___ \_ _|
# | |_| | __ _ ___| | _| | | |__ ___| |_/ / _____ __ / /_\ \| |_/ / | |
# | _ |/ _` |/ __| |/ / | | '_ \ / _ \ ___ \/ _ \ \/ / | _ || __/ | |
# | | | ... |
import tweepy
import json
import os
import csv
import pandas as pd
import credentials
ACTORS = ['@lemondefr','@courrierinter','@leJDD','@humanite_fr',
'@LEXPRESS','@libe','@LesEchos','@lobs','@MarianneleMag',
'@Le_Figaro','@AlterEco_','@_pole... |
# # FROM STEPHANIE BACK IN THE DAY...
# 1. Calculate the saturated vapor pressure (ew) as ew = 6.112* exp(17.62*T/(243.12+T) with T in [°C] and ew in [hPa] from CRU temperature at 0.5 x 0.5 degree resolution*
# 2. Calculate %RH at 0.5 x 0.5 degree resolution as e/ew where e is vapor pressure in hPa from CRU
# 3. Re... |
#!/usr/bin/env python
import boto3
import os
from datacoco_cloud import UNIT_TEST_KEY
import logging
class S3toS3Interaction(object):
"""
Class to simplify S3 to S3 Interactions using boto3
"""
def __init__(
self,
source_aws_key: str,
source_aws_secret: str,
target_aws... |
import sys, os
import scipy
from pylab import *
from matplotlib import *
from scipy.stats import *
from numpy import *
from scipy import *
import kepfit
import kepmsg
"""
This code is based on the PyKE routine kepsff
found at keplerscience.arc.nasa.gov
The kepsff code is based on Vanderberg and Johnson 2014.
If you ... |
def theme_alberta():
"""
Applies a University of Alberta theme to all subsequential altair plot objects so they are displayed with the U of A visual identity.
See the visual identity at https://www.ualberta.ca/toolkit/visual-identity/our-colours.
Four palettes based on the U of A visual identity guide... |
"""Setuptools configuration for Grd2Shp_Xagg."""
from os import path
from setuptools import find_packages
from setuptools import setup
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
here = path.abspath(path.dirname(... |
"""Library of aospy.Proj objects that I use."""
from .aero_3agcm import aero_3agcm
# from .burls import burls
# from .cmip5 import cmip5
from .gcm_input import gcm_input
# from .obs import obs
|
from flask_jwt import jwt_required
from flask_restful import Resource, reqparse
from ..models import JobModel, MeasurementModel, MetricModel
class Measurement(Resource):
parser = reqparse.RequestParser()
parser.add_argument(
"value",
type=float,
required=True,
help="This field... |
_root.createTextField("mytext",1,100,100,300,100);
|
from wand.image import Image
import io
import os
import tempfile
import math
from PyPDF2 import PdfFileWriter, PdfFileReader
from mmdet.apis import init_detector, inference_detector, show_result_pyplot
class ExtractTable(object):
"""
Utilizes CascadeTabNet (https://github.com/DevashishPrasad/CascadeTabNet) t... |
"""
Light-weighted Simulation Engine
"""
from collections import deque
import heapq
import copy
import time
import datetime
from evsim.definition import *
from evsim.default_message_catcher import *
from evsim.behavior_model import *
from evsim.system_object import *
class SysExecutor(SysObject,... |
from keras.preprocessing import image
import numpy as np
from keras.models import model_from_json
arquivo = open('classificador_gato_cachorro.json','r')
estrutura_rede = arquivo.read()
arquivo.close()
classificador = model_from_json(estrutura_rede)
classificador.load_weights('classificador_gato_cachorro.h5')
#GATO ... |
import os
import sys
import argparse
import csv
import datetime
from pathlib import Path
import shutil
import logging
import requests
import xml.etree.ElementTree as ET
import urllib3
from healthcloud_user_csvjinja import HealthcloudUserCSVJinja
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# ... |
import pytest
import servo
import servo.connectors.scripts
import tests.helpers
@pytest.fixture
def configuration() -> servo.connectors.scripts.ScriptsConfiguration:
return servo.connectors.scripts.ScriptsConfiguration(
before={
'measure': ['echo 123']
},
after={
'me... |
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.forms import modelformset_factory
from django.http import JsonResponse
from django.shortcuts import render, redirect, get_object_or_404
from ... |
from django.shortcuts import render
from django.utils import timezone
from mainbillboard.models import Messages
import json
from django.http import HttpResponse
from .forms import PostForm
# Create your views here.
def get_data(request):
my_result = Messages.objects.order_by('-pub_date')
for post in my_result... |
import tensorflow as tf
from tensorflow.keras import layers, initializers
class View_Angle_Classfier(tf.keras.Model):
def __init__(self, view_dim):
super(View_Angle_Classfier, self).__init__()
self.f1 = layers.Dense(units = 128, name = "VAC_F1")
self.leakyReLU1 = layers.LeakyReLU(name ... |
from dataclasses import dataclass
import io
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import xarray as xr
BLUE = "#4F6DB8"
RED = "#A01914"
ANTHRACITE = "#424242"
SYSTEM_SCALE_COLOR = "k"
AUTARKY_EXTENT_COLOR = "k"
PALETTE = sns.light_palette(BLUE)
HIGHLIGHT_COLOR = ... |
"""
.. class:: MultiDark
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
The class MultiDark is a wrapper to handle Multidark simulations results / outputs.
"""
import cPickle
import fileinput
import astropy.cosmology as co
import astropy.units as u
c2 = co.Planck13
from scipy.interpolate import in... |
#!/usr/bin/env python3
#
# Copyright (c) 2020 Fondazione Bruno Kessler
# Author(s): Cristina Costa (ccosta@fbk.eu)
#
# 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... |
from time import time
import numpy as np
import biorbd_casadi as biorbd
from bioptim import (
PlotType,
InitialGuess,
InterpolationType,
PenaltyNode,
Node,
OptimalControlProgram,
ConstraintList,
ConstraintFcn,
ObjectiveFcn,
ObjectiveList,
DynamicsList,
DynamicsFcn,
B... |
# Copyright 2021 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... |
import pickle
import tensorflow as tf
from tensorflow.keras import backend
class OptimizerState:
def __init__(self, optimizer):
self.config = optimizer.get_config()
self.weights = optimizer.get_weights()
# self.iterations = states.iterations
self.lr = backend.get_value(opti... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from odahuflow.sdk.models.base_model_ import Model
from odahuflow.sdk.models import util
class RemoteModelSource(Model):
"""NOTE: This class is auto generated by ... |
# coding: utf8
"""
Tests of High Jump / Pole Vault competition logic
"""
from unittest import TestCase, main
from decimal import Decimal
from athlib.highjump import HighJumpCompetition, _012
from athlib.exceptions import RuleViolation
ESAA_2015_HJ = [
# English Schools Senior Boys 2015 - epic jumpoff ending in a... |
# Copyright (c) 2015 EMC Corporation.
# 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 requ... |
import status
import authstate
class WelcomeState():
def __init__(self, handler):
self.handler = handler
def run(self):
self.handler.send_response(status.OK, "POP3", "I'm a teapot")
return authstate.AuthorizationState(self.handler) |
import featuretools as ft
import pandas as pd
from unittest.mock import patch
import pytest
import autonormalize as an
def test_ft_mock_customer():
df = ft.demo.load_mock_customer(n_customers=80, n_products=50, n_sessions=200,
n_transactions=10000, return_single_table=True)
... |
#!/usr/bin/env python
# coding:utf-8
"""
Name : check_db_connection.py
Author : Dmitry Kruchinin
Date : 7/1/2021
Desc:
"""
from fixture.orm import ORMFixture
from model.group import Group
db = ORMFixture(host="localhost", database="addressbook", user="root", password="")
try:
groups = db.get_groups_lis... |
"""Main module for tests."""
import os
import pandas as pd
import en_core_web_sm
from narcy.nlp.utils import Relation, document_factory
from narcy.processors import reduce_relations
from narcy.processors import doc_to_relations_df, doc_to_svos_df
from narcy.processors import doc_to_tokens_df
_dirpath = os.path.join(os... |
# SISO program yes.py
# Returns 'yes' for all inputs.
import utils
from utils import rf
def yes(inString):
return "yes"
def testYes():
testVals = [
("", "yes"),
("x", "yes"),
("asdf", "yes"),
("GAGAGAGAGAGA", "yes"),
]
for (inString, solution) in testVals:
va... |
# Returns a valid response when a request has appropriate credentials.
def main(request, response):
cookie = request.cookies.first("cookieName", None)
expected_value = request.GET.first("value", None)
source_origin = request.headers.get("origin", None)
response_headers = [("Content-Type", "text/javascr... |
# Copyright 2020 MIT Probabilistic Computing Project.
# See LICENSE.txt
import os
import re
from setuptools import setup
# Specify the requirements.
requirements = {
'src' : [
'astunparse==1.6.3',
'numpy==1.19',
'scipy==1.7.3',
'sympy==1.6',
],
'magics' : [
'graphv... |
#code to get images from open cv into python
#webcam_cnn_pipeline is a local module so export path first
#!export PYTHONPATH="$PYTHONPATH:/Users/alexpapiu/Documents/Conv/OpenCV_CNN"
from webcam_cnn_pipeline import *
LR = 0.0003
#setting up camera:
cp = cv2.VideoCapture(0)
cp.set(3, 256)
cp.set(4, 144)
os.chdir("/Use... |
def swap(coords, matrix):
x_1, y_1, x_2, y_2 = map(int, coords)
if 0 <= x_1 < rows_count and 0 <= y_1 < cols_count and 0 <= x_2 < rows_count and 0 <= y_2 < cols_count:
matrix[x_1][y_1], matrix[x_2][y_2] = matrix[x_2][y_2], matrix[x_1][y_1]
[print(" ".join(map(str, x))) for x in matrix]
else:... |
# coding: utf-8
# flake8: noqa
"""
Jordskredvarsel API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import abs... |
from __future__ import print_function
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.tests.helper import assert_quantity_allclose
from ...core import PixCoord
from ...tests.helpers import make_simple_wcs
from ..annulus import CircleAnnulusPixelRegion, CircleAn... |
# Search the Dice Jobs API
# lame docs: http://www.dice.com/common/content/util/apidoc/jobsearch.html
# author: nxkennedy
'''
Example response:
{"detailUrl":"http://www.dice.com/job/result/10347349a/749028?src\u003d19","jobTitle":"Front-End Web Developer","company":"The Doyle Group","location":"Denver, CO","date":"... |
__author__ = 'fractus.io'
import api.items |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import pre_save
from django.utils.text import slugify
from django.utils import timezone
class PostManager(models.Manager):
def active(self, *args, **kwargs):
return sup... |
from flask import Flask
app = Flask('aone_app')
import aone_app.main
|
import itertools
from typing import List
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
res = []
def dfs(begin,path):
res.append(path[:])
if begin==len(nums):
return
for i in range(begin,len(nums)):
path.ap... |
import xmlrpc.client
import xmlrpc
import os
import argparse
import random
def handle(s, btFile, secret):
print('handle bittorrent file: ', str(btFile))
ret=s.aria2.addTorrent('token:'+secret, xmlrpc.client.Binary(open(btFile, mode='rb').read()),[],{'pause':'true'})
print("add bt: ",str(ret))
waiting =... |
import warnings
from typing import Union, Tuple, Dict
import pygame
from pygame_gui.core import ObjectID
from pygame_gui.core.interfaces import IContainerLikeInterface, IUIManagerInterface
from pygame_gui.core import ColourGradient, UIElement
from pygame_gui.core.utility import render_white_text_alpha_black_bg, apply... |
# -*- coding:utf8 -*-
import time
import math
import random
from lib.control.Control import Control
from lib.unit.Player import Player
from lib.struct.Point import Point
from lib.base.Base import Base
# 导航基类
class NvBase(Base):
def __init__(self):
Base.__init__(self)
self.hander = open("tmp/logs/"... |
import os
import sys
import time
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from mrinet.unet_wavelet import UNetWavelet
from data.metrics import MetricEval
class DeGibbs(object):
"""A U-Net model for Gibbs artifact correction.
This initializes a wavelet U-Net model in... |
# -*- coding: utf-8 -*-
"""
This code is auto generated from troposphere_mate.code_generator.__init__.py scripts.
"""
import sys
if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover
from typing import Union, List, Any
import troposphere.transfer
from troposphere.transfer import (
... |
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from string import punctuation, ascii_uppercase, ascii_lowercase, digits
from random import sample, shuffle, randint
import pyperclip
Builder.load_file("Password.kv")
class MyLayout(Box... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import numpy as np
import tensorflow as tf
from scipy.stats import truncnorm
from GraphicsDL.modules_v2.reader import BaseReaderV2, DefaultTFReader, RandomReader
class RoomSizeReader(BaseReaderV2):
def __init__(self, da... |
from src.buttons.call_button import CallButton
from src.buttons.close_doors_button import CloseDoorsButton
from src.buttons.combo_button import ComboButton
from src.buttons.down_button import DownButton
from src.buttons.floor_number_button import FloorNumberButton
from src.buttons.open_doors_button import OpenDoorsButt... |
#!/usr/bin/env python3
import argparse
import sys
ID_TAG = "0_id"
SEL_TAG = "example (encoder) selection"
def main(args):
results = []
scores = []
headcount = []
epoch = {}
with open(args.logfile, "r") as fh:
for line in fh:
line = [x.strip() for x in line.split("|")]
... |
import json
import requests
import pandas as pd
from iex.utils import (parse_date,
validate_date_format,
validate_range_set,
validate_output_format,
timestamp_to_datetime,
timestamp_to_isoformat)
from iex... |
import random
import string
from pymongo import MongoClient
import certifi
import validators
# Mongo DB connection, ask me for the password! :)
# TODO: Store password in credstash
user = "unitedmasters"
password = ""
cluster = MongoClient(f"mongodb+srv://{user}:{password}@shortdata.yyg2l.mongodb.net/test?retryWrites=... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
import sys
import socket
from contextlib import closing
from unisim import BaseClient
class Client(BaseClient):
def interpreter(self):
pass
def event_handler(self, info):
... |
"""This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import sys
import thinkstats2
import thinkplot
def ReadFile(filename):
"""Reads a list of numbers from a file.
f... |
"""Cache for storing and retrieving data specific to collections.
Supports caching the collection and caching documents within those collections.
"""
import os
import threading
from grow.collections import collection
class CollectionCache(object):
def __init__(self):
self.reset()
self._lock = t... |
import pptree
from mcts import parameters as p
from mcts.smiles import SMILES
class Node:
"""
Representation of a node in the MCTS tree
Each node own its SMILES, number of visits and score
"""
def __init__(self, smiles=SMILES(), parent=None):
"""
Initialisation of a new node
... |
from collections import OrderedDict
from typing import Union, Callable, List, Dict, Any, Optional, Tuple
from pathlib import Path
from movado.controller import Controller, is_call_exact
from movado.estimator import Estimator
from movado.mab_handler import MabHandler
import numpy as np
import itertools
import random
im... |
# STEP 4: use trained FQG model to generate new QG data using augmented sentences
import os
import argparse
import logging
from polyaxon_client.tracking import get_outputs_path
# Set up the logger
logging.basicConfig(format='%(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
if __name__ == "__mai... |
from setuptools import setup
setup(
name='django-extra-views',
version='0.2.4',
url='https://github.com/AndrewIngram/django-extra-views',
description="Extra class-based views for Django",
long_description=open('README.rst', 'r').read(),
license="MIT",
author="Andrew Ingram",
author_emai... |
import uuid
from typing import Any
import pydantic
from aiohttp import web
import xjsonrpc.server.specs.extractors.docstring
import xjsonrpc.server.specs.extractors.pydantic
from xjsonrpc.server.integration import aiohttp as integration
from xjsonrpc.server.validators import pydantic as validators
from xjsonrpc.serve... |
"""
python-aws-dataclasses
"""
__version__="0.4.5"
from aws_dataclasses.sns_event import SnsEvent
from aws_dataclasses.alexa_skill_event import AlexaSkillEvent
from aws_dataclasses.s3_event import S3Event
from aws_dataclasses.cf_event import CloudFrontEvent
from aws_dataclasses.http_proxy_event import ApiGwProxyEvent... |
""" Generate some fragments. """
from typing import TextIO, List
from pathlib import Path
import random
def read_sequence(input_io: TextIO) -> str:
""" Read sequence data. """
return "".join([s.strip() for s in input_io.readlines()])
def genfrags(sequence: str, number: int, size: int) -> List[str]:
"""... |
import requests
from bs4 import BeautifulSoup as bs
from get_info_box import scrape_info_box
def scrape_disney_films():
movie_info_list = []
base_path = 'https://en.wikipedia.org'
r = requests.get('https://en.wikipedia.org/wiki/List_of_Walt_Disney_Pictures_films')
soup = bs(r.content, features='html.... |
import httpx
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from settings import Config
class WeatherSelenium:
def __init__(self):
chrome_options = Options()
chrome_options.headless = True
self.driver = webdriver.Chrome(options=chrome_options)
... |
from typing import OrderedDict
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from modeling import BertForSequenceClassification, BertConfig
from transformers import AutoTokenizer
import datasets
from tqdm import tqdm
from time import time
from quantize import quantize
from quantiz... |
# Licensed to the White Turing under one or more
# contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except ... |
# coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import ListView, RedirectView
from haystack.forms import HighlightedSearchForm
from haystack.views import SearchView
from .models import Document, ParlerDocument
class Search... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.decorators.csrf import csrf_exempt
from django_todo.apps.core.views import CurrentTaskView, CompleteTaskView
urlpatterns = patterns(
'',
url(r'^$', CurrentTaskView.as_view(), name='home'),
url(r'create/$... |
import os
import subprocess
import menupy
DataDir = '/home/alles/.MyTelegram' # Where accounts will be located
Binary = '/usr/bin/telegram-desktop' # Where is Telegram binary
def CheckPatches():
if os.path.exists(DataDir) == False:
try:
os.mkdir(DataDir)
except OSError:
exit("Can't create %s" % path)
els... |
"""A sqlite2 store"""
import sqlite3
from typing import Any, List, Mapping, MutableMapping, Tuple
import aiosqlite
from ..types import Session, Store
CREATE_SEQNUM_TABLE_SQL = """
CREATE TABLE IF NOT EXISTS initiator_seqnums
(
sender_comp_id VARCHAR(64) NOT NULL,
target_comp_id VARCHAR(64) NOT NULL,
out... |
import sys
from ctypes import *
from ctypes.util import find_library
libc = cdll.LoadLibrary(find_library("c"))
def sysctl(mib_t, c_type=None):
mib = (c_int * len(mib_t))()
for i, v in enumerate(mib_t):
mib[i] = c_int(v)
if c_type == None:
size = c_size_t(0)
libc.sysctl(mib, len(mi... |
import numpy as np
import srl
from srl.base.define import RenderType
from srl.base.env.base import EnvRun
from srl.runner import sequence
from srl.runner.callbacks import PrintProgress
class TestEnv:
def play_test(
self,
env_name: str,
check_render: bool = True,
check_restore: bool... |
from os import stat
import numpy as np
import cv2 # OpenCV
import math
from numpy.linalg.linalg import qr
class Rotations:
def __init__(self):
return
@staticmethod
def rot_mat_2_quat(R):
"""
Convert a rotation from rotation matrix to quaternion representation. Assumes that the co... |
#Author: Diego Ramírez Barba
#Version: 1.0.0
#License: MIT
import random
from math import radians, sqrt, asin, sin, cos
#Create Data type
class Location:
def __init__(self, latitude, longitude) : #constructor
self.latitude = latitude # 90N and 90S 0 -> Ecuador
self.longitude = longitude # 180E and... |
"""Client interface to the MarkerServer to send markers"""
import pylsl
import socket
import json
from logging import getLogger
from sys import platform
log = getLogger()
def sanitize_string(marker: str) -> str:
"""sanitize a string
removes whitespace, transforms to lower case and replaces umlaute and
s... |
#!/usr/bin/env python
# coding=utf-8
#
# Copyright © 2015-2016 VMware, Inc. All Rights Reserved.
#
# Licensed under the X11 (MIT) (the “License”) set forth below;
#
# you may not use this file except in compliance with the License. Unless required by applicable law or agreed to in
# writing, software distributed under ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 Lucas Heitzmann Gabrielli.
# This file is part of gdstk, distributed under the terms of the
# Boost Software License - Version 1.0. See the accompanying
# LICENSE file or <http://www.boost.org/LICENSE_1_0.txt>
import pathlib
import numpy
import gdstk
fro... |
from django.middleware.csrf import rotate_token # _compare_salted_tokens,
from rest_framework.permissions import BasePermission
class HasCsrfTokenValid(BasePermission):
def has_permission(self, request, view):
token_valid = False
try:
csrf_token = request.headers.get("api-csrftoken")
... |
from typing import Tuple
import torch
from torch import Tensor
import gym3
from gym3.types import Discrete, TensorType
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
class GridWorld(gym3.Env):
"""Gridworld with no reward and no episode termination. Following gym3 interface"""
def __init__(self, n_env: int, n: int, devi... |
import pytest
from datetime import datetime, timedelta
from time import sleep
from tpgnow.cache import Cache
from tpgnow.model import Stop
TIME_DELAY = 5
class TestCache(object):
@pytest.fixture
def cache(self):
return Cache()
@pytest.fixture
def key(self):
return "key"
@pytest.... |
from optable.synthesis import manipulation_candidate
from optable.dataset import feature_types
from optable.manipulations.aggregations import aggregation
class MeanManipulation(aggregation.AggregationManipulation):
def __init__(self, path, dataset, col):
super(MeanManipulation, self).__init__(
... |
# use virtual env from nb-requirements.txt
import kfp
from kfp import dsl
from kubernetes.client.models import V1EnvVar
from kfp.onprem import use_k8s_secret
from components.preprocess import preprocess
from components.train import train
import os
from pathlib import Path
OUTPUT_DIRECTORY = 'generated'
PROJECT_ROOT =... |
from dataclasses import dataclass, field
from typing import Dict, List
from raytkUtil import ROPInfo, RaytkContext, Version, showMessageDialog
# noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
class Updater:
def __init__(self, ownerComp: 'COMP'):
self.ownerComp... |
from plark_game.classes.pantherAgent import Panther_Agent
class Panther_Agent_Move_North(Panther_Agent):
def __init__(self):
pass
def getAction(self, state):
return self.action_lookup(0)
|
import pandas as pd
import math
from reportlab.lib.colors import black, white, Color, yellow
from reportlab.lib.styles import ParagraphStyle
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.units import inch, cm
from reportlab.pdfbase.ttfonts import TTFont
from re... |
"""Liquid template definition."""
from __future__ import annotations
from collections import abc
from io import StringIO
from pathlib import Path
from typing import Awaitable
from typing import Dict
from typing import Any
from typing import Iterator
from typing import Mapping
from typing import Optional
from typing ... |
from muwgs.application.crosswords import crosswords
from sys import path
path.append('..')
print(crosswords('b*eed'))
|
#!/usr/bin/python
##########
#
# Generate HTML table
#
##########
import lib_result_report as librr
import csv
import glob
import math
import numpy as np
import os.path
import shutil
import sys
from collections import namedtuple
from PIL import Image
from enum import Enum
input_path_postfix = '/output/'
output_pat... |
from datetime import datetime
from app import db
from sqlalchemy.schema import Sequence
# id_seq is required for auto id generation(cx_Oracle)
id_seq = Sequence('id_seq')
ingredientList = db.Table('Ingredient_List',
db.Column('Ingredient_name', db.String(255), db.ForeignKey('INGREDIENT.name... |
import numpy as np
import os
try:
import pymatgen as pm
from pymatgen.io.cif import CifParser
from pymatgen.io.vasp.inputs import Kpoints
has_pm = True
except:
has_pm = False
def get_kpts(screener,cif_file,level):
"""
Obtain the number of kpoints
Args:
screener (class): pymofscreen.screener class
cif_file... |
import pandas as pd
import requests
from tqdm import tqdm
import os
from os import listdir
from os.path import isfile, join
from datetime import datetime
from functools import cache
"""
Test welke van de leden+descendants in een refset er in de VT (totaal en lijst gyn) zitten.
146481000146103 |simpele referentieset me... |
from abc import abstractmethod
from collections import Counter
import numpy as np
from probability2 import Key
from probability2 import Distribution
class EmpiricalDistribution(Distribution):
def __init__(self, samples):
"""Construct an abstract distribution and count the number of
occurenc of ite... |
import numpy as np
import subprocess
from rich.console import Console
c = Console()
## ------------- FUNCTIONS ----------------
def create_temp_ini(pos:tuple,sampling:str,runs:int,blocklength:int):
content = f"""[DEFAULT]
[simulation]
runs = {runs}
blocks = {blocklength}
x0 = {pos[0]}
y0 = {pos[1]}
z0 = {pos[2]}
... |
# 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... |
# Generated by Django 2.2.5 on 2019-10-09 12:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(... |
from __future__ import absolute_import, print_function
try:
from pathlib import Path
Path().expanduser()
except (ImportError,AttributeError):
from pathlib2 import Path
try:
import tempfile
tempfile.TemporaryDirectory
except (ImportError,AttributeError):
from backports import tempfile
try:
... |
from selenium import webdriver
from selenium.webdriver.support.ui import Select
import time
import autoit
# Between the quotes, enter your credentials. Make sure there are no extra spaces.
username = ""
password = ""
# Between the quotes, enter the time you come in and the time you leave. Don't forget AM and... |
import os
from exps.basketball.basketball_yolox_l import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super().__init__()
self.num_classes = 2
self.exp_name = "boxing_glove"
self.basketball_detection_dir = "2022"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.