content stringlengths 5 1.05M |
|---|
from statsmodels.regression.linear_model import OLS
import numpy as np
def _calc_nodewise_row(exog, idx, alpha):
"""calculates the nodewise_row values for the idxth variable, used to
estimate approx_inv_cov.
Parameters
----------
exog : array_like
The weighted design matrix for the curren... |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... |
from setuptools import setup
setup(name='abberivator_flow',
version='0.0.1',
description='nan',
url='#',
author='dinhanhx',
author_email='dinhanhx@gmail.com',
license='The Unlicensed',
packages=['abberivator_flow'],
zip_safe=False)
|
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
from enum import Enum, unique
from math import ... |
from .abstract import Serializable
class Conflict(Serializable):
def __init__(self, **kwargs):
self.name = kwargs.get('name', '')
self.date = kwargs.get('date', None)
self.start_date = kwargs.get('start_date', None)
self.id = kwargs.get('id', '')
self.source = kwargs.get('s... |
#!/usr/bin/python
from tkinter import *
from PIL import Image,ImageTk
import os,re,threading,pyfiglet
import validate, dengine
#beta version and will be added soon
class GifLabel(Label): #only gif player
global GifLabel
def __init__(self, master, filename,frame):
gif_image = Image.op... |
from .base_estimator import BaseEstimator
from .base_module import BaseModule
from .base_learning_rate import BaseLearningRate
__all__ = ["BaseEstimator", "BaseModule", "BaseLearningRate"]
|
# Generated by Django 2.1.5 on 2019-01-23 11:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('articles', '0014_auto_20190122_1817'),
('articles', '0016_merge_20190123_0814'),
]
operations = [
]
|
#!/usr/bin/env python3
"""
tensorflow
"""
import tensorflow as tf
def create_Adam_op(loss, alpha, beta1, beta2, epsilon):
"""
adam
"""
return tf.train.AdamOptimizer(alpha, beta1, beta2, epsilon).minimize(loss)
|
import os
import sys
import tempfile
from datetime import datetime
from pprint import pprint
import ray
from ray import tune
from ray.rllib.agents import Trainer
from ray.tune.logger import UnifiedLogger
from ray.tune.result import DEFAULT_RESULTS_DIR
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from command_line_tools... |
# ch3/example5.py
import queue
import threading
import time
class MyThread(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
def run(self):
print('Starting thread %s.' % self.name)
process_queue()
print('Exiting thread %s.' ... |
'''
@Author: WANG Maonan, Yanhui Wu
@Date: 2020-12-26 13:23:34
@Description: 对 session 中所有 packet 的匿名化处理
@LastEditTime: 2021-02-05 21:20:14
'''
import os
from scapy.all import sniff, wrpcap
from TrafficFlowClassification.TrafficLog.setLog import logger
def customAction(pcap):
"""对一个 session 中的每一个 packet 进行匿名化的处理
... |
pratic = {
'praticagem': [{
"Navio": 'COSCO SHIPPING THAMES',
'Tipo': 'Container Ship',
'MMSI': 477333900,
},
{
"Navio": 'EVER LOADING',
'Tipo': 'Container Ship',
'MMSI': 235102681,
},
{
"Navio": 'SAN ANTONIO EXPRESS',
'Tipo': 'Containe... |
from json import loads
from crawler import Crawler
import urllib.request as req
from time import perf_counter, sleep
from strformat import StrFormat
class NativeCrawler(Crawler):
def __init__(self, runtime: dict) -> None:
super().__init__(runtime)
self.illust_url_base = self.config["format"]["mirro... |
#!/usr/bin/env python3
import os
import random
import time
import json
import requests
from .configuration import logger
from requests import Timeout
from .helpers import format_address
from kubernetesClient.kubernetesClient import KubernetesClient
from message.message import Message
from partialView.partialView impor... |
BASE_URL = "https://video.ethz.ch/lectures/"
|
"""
TechMiner.datasets
===============================================================================
Overview
-------------------------------------------------------------------------------
The functions in this module allows the user to load bibliographical datasets.
Functions in this module
--------------------... |
import glob
import os
import random
import pickle
import shutil
import numpy as np
def split_data(X_train,y_train,X_test,y_test, word_index, MAX_NB_WORDS, MAX_SENTS, MAX_SENT_LENGTH,
singlefn, BATCH_TRAIN_SIZE=20, BATCH_TEST_SIZE=20):
dir, fname = os.path.split(singlefn)
newdir=dir+'/'+fname.... |
import os
from collections import defaultdict
from src.guesser.ZaliznyakGuesser import *
from src.DependencyDerivation import *
class Results:
def __init__(self, words_a: Set[str] = {}, rule_id: str = None):
self.data = defaultdict(set)
self.derived = set()
if rule_id is not None:
... |
"""View for retrieving a subscription"""
from ..serializers.SubscriptionSerializer import SubscriptionSerializer
from ...models.Subscription import Subscription
from rest_framework import generics, permissions
class SubscriptionRetrieveView(generics.RetrieveAPIView):
"""Returns instance of Subscription, if user... |
import warnings
import Box2D as box_2d
import numpy as np
from .physical_world import PhysicalObject, PhysicalWorld, GymEnvironment
class Missile(PhysicalObject):
"""Missile."""
def __init__(self, *args, **kwargs):
super(Missile, self).__init__("missile.png", *args, **kwargs)
def create_physic... |
from setuptools import find_packages, setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy as np
def readme():
with open('README.md') as f:
content = f.read()
return content
def find_version():
version_file = 'torchreid/__init__.py'
with open(versio... |
from django.db import models
class BaseAbstractModel(models.Model):
'''
This model defines base models that implements common fields like:
created_at
updated_at
is_deleted
'''
created_at = models.DateTimeField(auto_now_add = True)
updated_at = models.DateTimeField(auto_now = True)
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sock.connect(('192.168.1.7', 9000))
sock.settimeout(5)
# cancel previous xmodem download
sock.send(chr(0x18)*20)
sock.send('\r')
# wait prompt
s = ''
while 1:
data = sock.recv(1024)
s = s + d... |
#!/usr/bin/env pnpython3
#
# KefEdit
#
# Credit: Lan Dam
#
# Updated Feb 2018
import sys
import logging
import os
import time
import numpy
import os.path as path
from tempfile import mkdtemp
from copy import deepcopy
from operator import itemgetter
from ph5.core import kefutility
LOGGER = logging.getLogger(__name__)
tr... |
# -*- coding: utf-8 -*-
"""
userconfig
==========
Module handling configuration files based on ConfigParser
userconfig License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permission is hereby granted, free of charge, to any person
obtaining a copy of this so... |
from flask import Flask, redirect, url_for, render_template, request, jsonify, g, session, flash
from flask_restful import Api
import requests
from discord import Webhook, RequestsWebhookAdapter
import sqlite3
import time
from multiprocessing import Process
from flask import Flask
import json
app = Flask(__name__)
ap... |
# list all targets
res = client.get_targets()
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list first three targets using default sort
res = client.get_targets(limit=3)
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list fir... |
from setuptools import setup
setup(
name='pyffsem',
version='0.1',
packages=['pyffsem'],
url='',
license='MIT',
author='Boris Klyus',
author_email='klyusba@gmail.com',
description='Pure Python realisation of FFSEM',
install_requires=[
'PyCryptodome',
]
)
|
import cv2
import torch
import torch.nn.functional as F
import re
from struct import unpack
import numpy as np
def warp(x, disp):
bs, ch, h, w = x.size()
bg, hg, wg = torch.meshgrid(torch.arange(0,bs) , torch.arange(0,h), torch.arange(0,w))
grid_b, grid_h, grid_w = bg.cuda(), hg.cuda(), wg.cud... |
#Project Euler Question 58
#Spiral primes
import math
def prime_check(x):
if x > 2:
if x % 2 == 0:
return False
else:
for factor in range(3, int(math.sqrt(x) + 1), 2):
if (x % factor) == 0:
return False
else:
re... |
import os
import coverage
import unittest
def run_all_tests(test_modules):
suite = unittest.TestSuite()
for t in test_modules:
try:
# If the module defines a suite() function, call it to get the suite.
mod = __import__(t, globals(), locals(), ['suite'])
suite_fn = g... |
keyboard.send_keys("<ctrl>+<alt>+<delete>") |
import os
from config import config
from hyperopt import fmin, tpe, hp, STATUS_OK, Trials, space_eval
from hyperopt.mongoexp import MongoTrials
from keras.callbacks import ModelCheckpoint
def info(title):
""" Prints out some threads stats. """
print title
print 'module name: ' + __name__
print 'parent... |
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
class ProductPage:
def __init__(self, driver):
self.driver = driver
# self.wait = WebDriverWait(driver, 10)
def add_one_product(app):
# 1) otwórz stronę jakiegoś towaru,
... |
"""
This script will test to ensure Python 2.7 and Python 3.6+ are supported.
"""
import sys
import os
PATH_HERE = os.path.abspath(os.path.dirname(__file__))
PATH_DATA = os.path.abspath(PATH_HERE+"../../../data/abfs/")
PATH_SRC = os.path.abspath(PATH_HERE+"../../../src/")
sys.path.insert(0, PATH_SRC)
print("PYTHON %d... |
import unittest
from pyowm.commons.databoxes import ImageType, Satellite
class TestImageType(unittest.TestCase):
def test_repr(self):
instance = ImageType('PDF', 'application/pdf')
repr(instance)
class TestSatellite(unittest.TestCase):
def test_repr(self):
instance = Satellite('Ter... |
import asyncio
import logging
import uuid
from base64 import b64decode
from datetime import datetime
from importlib import import_module
import marshmallow as ma
from app.objects.c_ability import Ability, AbilitySchema
from app.objects.secondclass.c_executor import Executor, ExecutorSchema
from app.objects.secondclas... |
import logging
from athena import cluster
def make_cluster(cluster_settings, processes):
cluster_classes = {
"IPCluster": cluster.IPCluster,
"local": cluster.LocalCluster,
"multiprocessing": cluster.MultiprocessingCluster,
}
return cluster_classes[cluster_settings.cluster_type](
processes, ... |
from selenium import webdriver
driver = webdriver.Chrome(executable_path='chromedriver.exe')
driver.get('https://quotes.toscrape.com/page/9/')
while True:
for div in driver.find_elements_by_css_selector('.quote'):
print(div.find_element_by_css_selector('.text').text)
print(div.find_element_by_css_... |
# modify from sklearn (0.22.1)
import numpy as np
from .utils.multiclass import type_of_target
from .utils.validation import check_consistent_length, column_or_1d, assert_all_finite
from .utils.extmath import stable_cumsum
def precision_recall_curve(y_true, probas_pred, pos_label=None,
sam... |
from pyrep.robots.mobiles.nonholonomic_base import NonHolonomicBase
class Pioneer_p3dx(NonHolonomicBase):
def __init__(self, count: int = 0):
super().__init__(count, 2, 'Pioneer_p3dx')
|
"""GitLab collector base classes."""
from abc import ABC
from collections.abc import Sequence
from dateutil.parser import parse
from base_collectors import SourceCollector
from collector_utilities.functions import match_string_or_regular_expression
from collector_utilities.type import URL, Job
from model import Enti... |
# 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
# distributed under th... |
import Adafruit_DHT
import time
import json
class DHT_Read():
""" Read Temperature and Humidity """
def __init__(self,pin=17):
self.humidity = None
self.temp = None
self.sensor = Adafruit_DHT.DHT11
self.pin=pin
def read(self):
try:
self.humidity, self.temp = Adafruit_DHT.read_retry(self.sensor,s... |
import logging
import os
from unittest.mock import Mock, patch
import pytest
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.utils import temp_dir
from pip._internal.utils.logging import BrokenStdoutLoggingError
from pip._internal.utils.temp_dir... |
import click
from globus_search_cli.config import get_search_client
from globus_search_cli.parsing import globus_cmd, index_argument
from globus_search_cli.printing import format_output
@globus_cmd("delete", help="Delete a role (requires admin or owner)")
@index_argument
@click.argument("ROLE_ID")
def delete_cmd(ind... |
from .utils import upload_file, delete_file, get_cloudinary_resource_info
from .permissions import PostUserRateThrottle, SustainedRateThrottle
from .decorators import authentication_required
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, th... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
#
# PySNMP MIB module Nortel-MsCarrier-MscPassport-DisdnNISMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-MsCarrier-MscPassport-DisdnNISMIB
# Produced by pysmi-0.3.4 at Wed May 1 14:29:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davw... |
import features
import transition
import conll
featSet = 3
classifier = features.getClassifier(str(featSet))
feature_names = features.featNames(featSet)
vec, (y, dict_classes, inv_dict_classes) = features.getStuff(featSet)
test_file = './swedish_talbanken05_test.conll'
column_names_2006 = ['id', 'form', 'lemma', '... |
from baconian.test.tests.set_up.setup import TestWithAll
from baconian.algo.dynamics.reward_func.reward_func import CostFunc
from baconian.envs.gym_env import make
import numpy as np
from baconian.core.core import EnvSpec
from baconian.algo.dynamics.dynamics_model import GlobalDynamicsModel
from baconian.algo.policy.il... |
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, "REST_JWT_SSO", None)
DEFAULTS = {
"SIGN_SALT": None,
"SALT_METHOD": "rest_framework_jwt_sso.edjwt.algorithm.DefaultSalt",
"AUTH_TOKEN_PREFIX":... |
from selenium import webdriver
from datetime import date
from openpyxl import load_workbook
data_atual1 = date.today()
# definir navegador e abrir o chrome
navegador = webdriver.Chrome("C:/Users/TEMP/Desktop/DolarPTAX/chromedriver.exe")
# entrar no site do banco central
navegador.get("https://www.bcb.gov.br/")
# ac... |
# -*- coding: utf-8 -*-
#
# Objects for sequence management.
#
# ------------------------------------
# imports
# -------
from cached_property import cached_property as cached
from . import metrics
from . import distance
from . import utils
from . import conversion
# classes
# -------
class Sequence(object):
""... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ..sparse import SparseArray
from .._sparse import merge_sparse_arrays
test_params = [
(8... |
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import time as timer
import os
import KratosMultiphysics as Kratos
from Kratos import Logger
import KratosMultiphysics.DEMApplication as Dem
Logger.Print("Running under OpenMP........"... |
# Generated by Django 3.0.2 on 2020-02-27 22:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('playbooks_parser', '0002_auto_20200225_1713'),
]
operations = [
migrations.AddField(
model_name='playbook',
name='pl... |
"""
grib_bbox.py
Copyright (C) 2020-2021 Andreas Motl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-26 12:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import speeches.models
class Migration(migrations.Migration):
initial ... |
# Copyright 2017 Google 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-2.0
#
# Unless required by applicable law or a... |
import glob
import os
import numpy as np
from astropy.io import fits
from tqdm import tqdm
from lcc.db_tier.base_query import LightCurvesDb
from lcc.entities.exceptions import InvalidFilesPath, InvalidFile
from lcc.entities.light_curve import LightCurve
from lcc.entities.star import Star
from lcc.utils.output_process... |
"""
This package is dedicated to AXI Load/Store Units (LSU) a others like.
Other LSU implementations:
* https://github.com/riscv-boom/riscv-boom - has RISC-V LSU in chisel3, read kill, MSHRs
* https://github.com/rsd-devel/rsd - has N issue RISC-V LSU
* https://github.com/bluespec/Toooba - has RISC-V LSU in BlueSpecVe... |
# Copyright 2015 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... |
from typing import Any, Callable, Generic, List, TypeVar
from mlprogram import logging
logger = logging.Logger(__name__)
V = TypeVar("V")
class Identity(Generic[V]):
def __call__(self, value: V) -> V:
return value
class Flatten(Generic[V]):
def __call__(self, values: List[List[V]]) -> List[V]:
... |
from .score import Score
from .partlist import PartList
from .scorepart import ScorePart
from .part import Part
from .measure import Measure
from .note import Note
from .rest import Rest
from .chord import Chord
from .harmony import Harmony
from .rehearsal import Rehearsal
from .barline import Barline
|
__author__ = 'mosquito'
|
"""Initial Migration
Revision ID: 7ebae7278158
Revises: c984bd5ccad2
Create Date: 2019-02-28 12:40:21.734374
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7ebae7278158'
down_revision = 'c984bd5ccad2'
branch_labels = None
depends_on = None
def upgrade():
... |
import pytest
import numpy as np
from os import path
from astropy.io import fits
from astropy import wcs
from astropy.coordinates import SkyCoord
import astropy.units as u
from .utils_for_test import create_test_ffis
from ..make_cube import CubeFactory
from ..cube_cut import CutoutFactory
from ..exceptions import Inv... |
import sys, pygame, math
from Ball import Ball
class PlayerBall(Ball):
def __init__(self, images, maxSpeed, pos = [0,0]):
Ball.__init__(self, images, [0,0], pos)
self.maxSpeedx = maxSpeed[0]
self.maxSpeedy = maxSpeed[1]
def collideScreen(self, size):
width = size[0]
... |
# Copyright 2021 The Distla 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 ... |
import pandas as pd
import os
from IPython import display
def get_status(eid, assignment):
stages = ['submitted', 'autograded', 'feedback']
for status in reversed(stages):
if os.path.isdir(f'../nbgrader/{status}/{eid}/{assignment}'):
return status
else:
return ''
def get_link(... |
from ray.rllib.agents.ars.ars import (ARSAgent, DEFAULT_CONFIG)
__all__ = ["ARSAgent", "DEFAULT_CONFIG"]
|
import torch
import pickle
import os
class ProcessedDataset(torch.utils.data.Dataset):
def __init__(self, data_path, class_index):
with open(data_path, "rb") as fh:
self.dataset = torch.tensor(pickle.load(fh)).float()
self.class_index = torch.tensor(class_index).float()
def get... |
# Generated by Django 3.0.6 on 2020-07-14 02:47
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import thenewboston.utils.validators
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('blocks', '0001_initial'),... |
myval = 3
def mymultiply(num1,num2):
''' The above function will take 2 numbers,
multiply them and return the result '''
return num1 * num2
class multiply1:
pass
|
#!/usr/bin/env python
from codetalker import pgm
from codetalker.pgm.tokens import STRING, ID, NUMBER, WHITE, NEWLINE, ReToken, re, CharToken, StringToken
from codetalker.pgm.special import star, plus, _or, binop
from codetalker.pgm.grammar import ParseError
## TOKENS
class OP(ReToken):
rx = re.compile('\\*\\*|[... |
from factorization import Factorization
from sequence import Sequence, seq
from unique_representation import UniqueRepresentation
from sage_object import SageObject
from element import (\
is_AdditiveGroupElement,
is_AlgebraElement,
is_CommutativeAlgebraElement,
is_CommutativeRingElement,
... |
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
basicSum = nums[0]
maxVal = nums[0]
# [-2,1,-3,4,-1,2,1,-5,4]
# Output: 6
#[1, 2, 3, 4]
for i in range(1, len(nums)):
basicSum = nums[i] + basicSum
if basicSum < nums[i... |
# Copyright 2019 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... |
# -*- coding: utf-8-*-
import re
import requests
from bs4 import BeautifulSoup
from openpyxl import Workbook
LOGINURL = 'https://expert.nadzor-info.ru/login'
USERNAME = ''
PASSWORD = ''
URL = ''
SAVE_FILE = 'exp1.xls'
session = requests.Session()
CSRF = re.search(
'(?<=csrftoken=)\w+',
session.... |
from hypothesis import given
from tests.integration_tests.hints import BoundPortedVerticesPair
from tests.utils import equivalence
from . import strategies
@given(strategies.vertices_pairs)
def test_basic(pair: BoundPortedVerticesPair) -> None:
bound, ported = pair
assert equivalence(bound.is_degenerate, po... |
import wx
import wx.grid
import wx.lib.gizmos as gizmos
import CustomGridRenderer as cgr
import wx.propgrid as wxpg
import wx.lib.scrolledpanel as scrolled
import sqlite3
import time
import os
import typing
from typing import List
from typing import Union
from typing import Tuple
from typing import Dict
from typing imp... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import os
import os.path
import shutil
import collections
import logging
from .base import BaseProvider
from ..util import log
from ..command import run_command
class CompileProvider(BaseProvider):
'''
Runs a command, su... |
"""
purplescript.lexer
~~~~~~~~~~~~
:copyright: (c) 2011 by Martin Rusev.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.1'
from ply import lex
from helper import merge_lists
class Lexer(object):
reserved_words = {
'if' : 'IF',
'elseif': 'ELSEIF',
'else' : 'ELSE',
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def hc_choice_california(path):
"""Heating and Cooling System Choice in N... |
""" bmap: static beatmap info (thumbnails, previews, etc.) """
from fastapi import APIRouter
from fastapi import status
from fastapi.requests import Request
from fastapi.responses import RedirectResponse
router = APIRouter(prefix="/map", tags=["Beatmaps"])
# for now, just send everything to osu!
# eventually if we d... |
import rospy
import numpy as np
from tf.transformations import *
from geometry_msgs.msg import Twist
from gym import spaces
class ActionCollector:
def __init__(self):
self.v_max_ = 0.8
self.w_max_ = 1.2
self.action_library = {
0: {"linear": 0.0, "angular": -self.w_max_},
... |
from pyjamas.ui.Composite import Composite
from pyjamas import DeferredCommand
from SchoolCalendarService import SchoolCalendarService
from DynaTableWidget import DynaTableWidget
from Person import Person
from Student import Student
from Professor import Professor
class CalendarProvider:
def __init__(self, owner)... |
def solution(nums):
'''
type nums == list()
'''
|
# -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... |
# Copyright 2015 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... |
from __future__ import absolute_import, unicode_literals
from datetime import datetime
import pytest
from case import patch
from kombu.utils.json import dumps
from celery.bin.call import call
from celery.five import WhateverIO
class test_call:
def setup(self):
@self.app.task(shared=False)
def... |
import os
import random
import time
from copy import deepcopy
import numpy as np
import torch
import yaml
from tensorboardX import SummaryWriter
from tqdm import tqdm
from src.data.data_iterator import DataIterator
from src.data.dataset import TextLineDataset, ZipDataset
from src.data.vocabulary import Vocabulary
fro... |
# Day 08 - Part 2
import sys
sys.setrecursionlimit(10000)
print "Day 08 - Part 2"
with open("./day08-input.txt") as f:
instructions = f.read().splitlines()
def parse_instruction(instruction):
command, value_as_string = instruction.split()
return command, int(value_as_string)
class ProgramLoop(Exception):
pas... |
import os
import tempfile
from contextlib import contextmanager, nullcontext
from functools import partial, update_wrapper
import cyvcf2
import hypothesis as ht
import pytest
from api.tests.util import FlaskClientProxy
from vardb.datamodel import allele, annotation
from vardb.deposit.annotationconverters import Annot... |
'''
File: bluestone_config.py
Project: bluestone
Author: daniel dong
Email: dongzhenguo@lantsang.cn
Copyright 2021 - 2021 bluestone tech
'''
import uos
import log
import ujson
import _thread
from usr import bluestone_common
log.basicConfig(level = log.INFO)
_config_log = log.getLogger("CONFIG")
class Blueston... |
# python2, 3 compatibility
from __future__ import absolute_import, division, print_function
import six
import os
import sys
import inspect
from builtins import str, open, range, dict
import pickle
import numpy as np
import pandas as pd
import pybedtools
from pybedtools import BedTool
from sklearn.preprocessing import... |
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def Output():
return render_template('index.html'), 200
app.run(debug=True, host="0.0.0.0", port=9000) |
import importlib
import inspect
import os
def create_event_list(chat_id):
event_classes = [str(x.split('.')[0]) for x in os.listdir(os.path.join(os.getcwd(), '..', 'events'))]
events = {}
for e in event_classes:
module = importlib.import_module('events.{}'.format(e))
if hasattr(module, e) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.