text stringlengths 957 885k |
|---|
<reponame>BlooAM/Day-ahead-prices
from datetime import datetime
import pandas as pd
from src.data_generator.day_ahead_extractors.pse.base_day_ahead_extractor import PseDataDayAheadExtractor
__all__ = ('RealUnitsOutagesDayAheadExtractor',)
class RealUnitsOutagesDayAheadExtractor(PseDataDayAheadExtractor):
def e... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__email__ = "<EMAIL>"
from prettytable import PrettyTable
from pycompss.api.api import compss_wait_on
from ddf_library.utils import _gen_uuid
from ddf_library.utils import delete_result, merge_info
import networkx as nx
class Status(object):
... |
import random
import pickle
from pathlib import Path
from itertools import chain, islice, tee
from collections import deque
from pipelib import parallel
from pipelib import iterators
class Dataset:
def __init__(self, dataset):
if isinstance(dataset, Dataset):
self._dataset = dataset._dataset
... |
# 导入包
import math
import time
from code_w.recommand.chapter4.database import Dataset
from code_w.recommand.chapter4.metric import Metric
# 定义装饰器,监控运行时间
def timmer(func):
def wrapper(*args, **kwargs):
start_time = time.time()
res = func(*args, **kwargs)
stop_time = time.time()
... |
import re
import json
from datetime import datetime
import urllib.request
import urllib.parse
import itertools
from functools import reduce
# story types
CHORE = "chore"
BUG = "bug"
FEATURE = "feature"
# story states
UNSCHEDULED = "unscheduled"
UNSTARTED = "unstarted"
STARTED = "started"
FINISHED = "finished"
DELIVER... |
import knocker
import vk_api
from bs4 import BeautifulSoup
import requests
import datetime
import time
import os
import Farseer
import json
class SheduleBot:
def __init__(self):
self.days = ['', '']
self.group = None
pass
def main(self, targetUrl: str):
if ta... |
<reponame>DanielMiao1/ChessGraphics
# -*- coding: utf-8 -*-
"""
board.py
Chess Board Graphics
"""
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from chess.functions import *
class Promotion(QLabel):
def __init__(self, parent, piece_symbol, piece, color):
super(Promotion, sel... |
<gh_stars>0
#!/usr/bin/env python3
import argparse
import os
import sys
import shutil
import subprocess
dir_path = os.path.dirname(os.path.realpath(__file__))
spack_version = 'v0.15.4'
spack_repo = 'https://github.com/spack/spack.git'
def main():
parser = argparse.ArgumentParser(
description=
'... |
<gh_stars>0
#!/usr/bin/env python
"""
udocker unit tests: OciLocalFileAPI
"""
from unittest import TestCase, main
from udocker.oci import OciLocalFileAPI
try:
from unittest.mock import patch, Mock
except ImportError:
from mock import patch, Mock
class OciLocalFileAPITestCase(TestCase):
"""Test OciLocalFi... |
from typing import (
List, Optional, Sequence, Dict, Tuple, Any,
Generator, ClassVar, Callable, Union,
)
from enum import Enum
import os
from dataclasses import dataclass
from html.parser import HTMLParser
from collections import defaultdict
import json
from abc import ABCMeta, abstractmethod
try:
import ... |
import numpy as np
from tqdm import trange
from mlutils.models._fm import _sgd_update
from sklearn.base import BaseEstimator, ClassifierMixin
class FactorizationMachineClassifier(BaseEstimator, ClassifierMixin):
"""
Factorization Machine [1]_ using Stochastic Gradient Descent.
For binary classification on... |
import logging
import sys
from collections import namedtuple
class KanjiIterator:
def __init__(self, kanji):
self._values = iter(vars(kanji).values())
def __iter__(self):
return self
def __next__(self):
v = next(self._values)
if type(v) == list:
return ", ".joi... |
<reponame>Jp29tkDg79/samplewebsite<gh_stars>0
from flask import Flask
from flask import render_template
from flask import request
from flask import url_for
import os
from database import person
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return ... |
<reponame>colour-science/trimesh
try:
from . import generic as g
except BaseException:
import generic as g
class RepairTests(g.unittest.TestCase):
def test_fill_holes(self):
for mesh_name in ['unit_cube.STL',
'machinist.XAML',
'round.stl',
... |
'''texplain
Create a clean output directory with only included files/citations.
Usage:
texplain [options] <input.tex> <output-directory>
Options:
--version Show version.
-h, --help Show help.
(c - MIT) <NAME> | <EMAIL> | www.geus.me | github.com/tdegeus/texplain
'''
__version__ = '0.3.4'
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 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-... |
import csv
import os
import shutil
import sys
from datetime import date, time, datetime
from django.core.management import BaseCommand
from urllib.request import urlopen
from zipfile import ZipFile
from django.db import transaction
from gtfs.models import Agency, Stop, Route, Transfer, Calendar, CalendarDate, Trip, ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC 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.or... |
<filename>azurelinuxagent/distro/default/extension.py
# Microsoft Azure Linux Agent
#
# Copyright 2014 Microsoft Corporation
#
# 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... |
#!/usr/bin/python3
# Scenario based on test : [2.5]-Vote-test
import os
import sys
import time
import datetime
currentdir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(os.path.dirname(currentdir)))
from beos_test_utils.beos_utils_pack import init, ActionResult, ResourceResult, VotersR... |
<reponame>CharlesDDNoble/broncode
from codeclient import CodeClient
import json
class Trial():
def from_json(self,json_string):
return json.loads(json_string)
def to_json(self):
return json.dumps(self.to_dict())
def to_dict(self):
return {"is_success" : self.is_success,
... |
<filename>tests/test_accounts.py
import pykazoo.accounts
import pykazoo.restrequest
from unittest import TestCase
from unittest.mock import create_autospec
mock_rest_request = create_autospec(pykazoo.restrequest.RestRequest)
class TestAccounts(TestCase):
def setUp(self):
self.mock_rest_request = mock_res... |
# coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
<filename>Codes/Inference_NetworkConfiguration.py
# Copyright 2019 DIVERSIS Software. 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/... |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module tests the `cros branch` command."""
from __future__ import print_function
import os
import sys
impor... |
<filename>src/app/beer_garden/api/http/base_handler.py<gh_stars>0
# -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import re
import socket
from typing import Union
from brewtils.errors import (
AuthorizationRequired,
ConflictError,
ModelError,
ModelValidationError,
NotFoundError,
... |
<gh_stars>100-1000
import logging
import base64
import datetime
import requests
from Crypto.Cipher import DES3
from zeep import Transport, Client
from azbankgateways.banks import BaseBank
from azbankgateways.exceptions import SettingDoesNotExist, BankGatewayConnectionError
from azbankgateways.exceptions.exceptions im... |
import pandas as pd
import numpy as np
import geopandas as gpd
import matplotlib.pyplot as plt
from collections import OrderedDict
from collections.abc import Iterable
import itertools
import matplotlib.pyplot as plt
from IPython.core.display import display, HTML
import seaborn as sns
import sys
sys.path.append('../')... |
#!/usr/bin/env python
# Copyright 2020 The PySCF Developers. 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... |
<reponame>SemanticsOS/smc.bibencodings
# -*- coding: utf-8 -*-
#=============================================================================
# Copyright : (c)2010-2012 semantics GmbH
# Rep./File : $URL$
# Date : $Date$
# Author : <NAME>
# License : BSD LICENSE
# Worker : $Author$
# Revision ... |
<filename>msl/qt/prompt.py<gh_stars>0
"""
Convenience functions to prompt the user.
The following functions create a dialog window to either notify the user of an
event that happened or to request information from the user.
"""
import traceback
from . import QtWidgets, QtCore, application
def critical(message, titl... |
"""This module contains the general information for StorageVirtualDrive ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class StorageVirtualDriveConsts:
ACCESS_POLICY_BLOCKED = "blocked"
ACCESS_POLICY_HIDDEN = "hidden"
... |
<filename>python.py
# _*_ coding=UTF-8 _*_
# 1.type and object
# 所有的类型都是object的子类,除了object
# 所有的类型都是type的实例,包括type
print(object) #int本身是一种class
print(type(object)) #object是type的实例
print(object.__class__) #object是type的实例
print(object.__bases__) #object没有父类
print(int) #int本身是一种class
print(type(int)) #int是type的实例
... |
<filename>Code/tg_plot_subg_hilobias.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 30 11:32:36 2019
@author: ott
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from tg_suboptimal_goal_choice import tg_suboptimal_goal_choice
def tg_plot_subg_hilobias(dat,pa... |
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompati... |
# Copyright (c) 2020-20201, <NAME>
# 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 copyright notice,
# this list of conditions and the ... |
<gh_stars>0
from ThesisAnalysis import get_data, ThesisHDF5Reader, get_plot
from ThesisAnalysis.plotting.setup import ThesisPlotter
from ThesisAnalysis.files import spe_files, CHECM
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from CHECLabPy.core.io import DL1Reader
from CHECLab... |
<gh_stars>1-10
#!/usr/bin/python3
# Copyright (c) 2014, whoever
# 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 copyright notice, thi... |
<filename>scalyr_agent/third_party_tls/tlslite/handshakesettings.py
# Authors:
# <NAME>
# <NAME> (Arcode Corporation) - cleanup handling of constants
# <NAME> (ported by <NAME>) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""Class for setting handshake parameters."""
fr... |
<reponame>caltechlibrary/bun
'''
cli.py: command-line interface class for Bun
Authors
-------
<NAME> <<EMAIL>> -- Caltech Library
Copyright
---------
Copyright (c) 2020-2021 by the California Institute of Technology. This code
is open-source software released under a 3-clause BSD license. Please see the
file "LIC... |
"""
About the Callhome Egyptian Arabic Corpus
The CALLHOME Egyptian Arabic corpus of telephone speech consists of 120 unscripted
telephone conversations between native speakers of Egyptian Colloquial Arabic (ECA),
the spoken variety of Arabic found in Egypt. The dialect of ECA that this
dictionary represents i... |
<reponame>leits/openprocurement.tender.openeu
from uuid import uuid4
from datetime import timedelta
from iso8601 import parse_date
from pyramid.security import Allow
from zope.interface import implementer
from schematics.types import StringType, MD5Type, BooleanType
from schematics.types.compound import ModelType
from ... |
<reponame>deejay1/selena<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.db import connection
CLASSIFICATION_ALL = 1
CLASSIFICATION_ONLY_CORE... |
import pickle
import copy
import pathlib
import dash
import math
import datetime as dt
import pandas as pd
import pydriller
pydriller.Commit
# Multi-dropdown options
from controls import COUNTIES, WELL_STATUSES, WELL_TYPES, WELL_COLORS
# Create controls
county_options = [
{"label": str(COUNTIES[county]), "value":... |
#!/usr/bin/python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import data
import time
import word2vec
import tensorflow as tf
import numpy as np
import random
from datetime import datetime
from Logger import Logger
tf.flags.DEFINE_integer("BATCH_SIZE", 50, "Training batch size")
tf.flags.DEFINE_integer("NUM_... |
'''
Bi-Isame-Allah
This script has following networks
0. Seed Net version 1 & 101
1. Seg_net & Seg_net_original (in these n_filters=32)
2. U_net
3. U_net WC
4. ES_net
5. FCN_8s
6. PSP_net (op = 1/8 x ip)
7. Deeplab_v3
8. GCN (ip = 512x512)
9. DAN (op = 1/8 x ip)
'''
import tensorflow as tf
from conv_bloc... |
<filename>App.py
from PyQt5 import QtWidgets, uic
from PyQt5.QtGui import QImage, QPixmap, QPalette, qRgb, qGray
import sys
import numpy as np
from typing import Callable
from numbers import Number
def process_image(
input_image: np.array,
kernel_size: int,
kernel_fn: Callable[[np.array], floa... |
# -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemSearchRequest(object):
"""Implementation of the 'ItemSearchRequest' model.
TODO: type model description here.
Attributes:
actor (string): TODO:... |
from student import *
"""
需求:
1.能够存储数据
数据文件(student.data),数据格式:list
2. 功能系统
增删改查,显示全部,保存数据
"""
class ManagerSystem(object):
"""
功能系统循环使用,用户输入不同序号执行不同功能。
"""
# 初始化
def __init__(self):
# 存储数据的列表
self.student_list = []
# 一、入口函数,启动程序后执行的函数
def run(self... |
# from itertools import chain, islice
import abc
from kipoiseq.extractors import CDSFetcher, UTRFetcher
from kipoiseq.dataclasses import Interval, Variant
from kipoiseq.transforms.functional import translate
from kipoiseq.extractors.multi_interval import (
GenericMultiIntervalSeqExtractor,
BaseMultiIntervalVC... |
import scapy
from scapy import config as scapy_conf
from scapy import arch as scapy_arch
from scapy.layers import l2, inet, dhcp
from scapy import sendrecv
import codecs
import concurrent.futures
import asyncio
import logging
import threading
from utils import waiter
# This conf is needed to make dhcp requests, so that... |
<filename>ironic_inspector/pxe_filter/iptables.py
# 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 agre... |
<gh_stars>1-10
########################################################
# Autogenerated by tutorial/utils/process_floorplan.py #
########################################################
from siliconcompiler.core import Chip
from siliconcompiler.floorplan import Floorplan
import math
GPIO = 'sky130_ef_io__gpiov2_pad_... |
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras import backend as K
import numpy as np
import pandas as pd
from sklearn.prepr... |
"""
Django settings for aquila project.
Generated by 'django-admin startproject' using Django 2.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
fr... |
<gh_stars>0
# Code generated by font_to_py.py.
# Font: NewYork.ttf
# Cmd: ../../../micropython-font-to-py/font_to_py.py -x /System/Library/Fonts/NewYork.ttf 30 newyork30.py
version = '0.33'
def height():
return 30
def baseline():
return 23
def max_width():
return 29
def hmap():
return True
def reve... |
##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Fre... |
<filename>plotly_visualization/vis.py
# python version 3.5x
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
G_FILENAME_ARR=[]
class VisFunctions :
def vistypeDetection(self, _htmlFileName, _d,_m, _vis, _dimIdxArr, _meaIdxArr, _arrColumn, _arrData, _pdDataset):
self.funcName = "_"+... |
<filename>Marquee/python/nyan_cat.py
#!/usr/bin/env python
"""A demo client for Open Pixel Control
http://github.com/zestyping/openpixelcontrol
Every few seconds, a sparkly rainbow washes across the LEDS.
To run:
First start the gl simulator using, for example, the included "wall" layout
make
bin/gl_server ... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import os
import cv2
import glob
import time
import pickle
import numpy as np
from .box import Box
#from .fit import predict
from .connected_componentes import *
from .pre_processing import *
from .commonfunctions import *
import skimage.io as io
from PI... |
<filename>tests/test_cast.py
import os
import tempfile
from clicast.cast import Cast, CastReader
CAST_URL = 'https://raw.githubusercontent.com/maxzheng/clicast/master/test/example.cast'
CAST_FILE = os.path.join(os.path.dirname(__file__), 'example.cast')
class TestCast(object):
def test_from_file(self):
cast ... |
<filename>source/ETB/util/MCU_AVR.py
#####
# @brief AVR MCU utilities
#
# Module containing AVR MCU utility functions.
#
# @file /etb/util/MCU_AVR.py
# @author $Author: <NAME> $
# @version $Revision: 1.0 $
# @date $Date: 2021/04/08 $
#
# @see https://docs.python.org/3/library/subprocess.html#module-su... |
<reponame>Fanto94/aiopika
# Copyright
# (c) 2009-2019, <NAME>, <NAME>, Pivotal Software, Inc and others.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# * Redistributions of source code must r... |
<filename>data2df.py
"""
This contains functions which take a pandas DataFrame, which must have a column
of HELCATS CME names called 'helcats_name', add data from various sources
corresponding to those CMEs, and return the df with extra data.
"""
from __future__ import division
import os
import sys
import numpy as np
... |
<filename>homework_working/hw7-backprop/code/test_utils.py
"""Computation graph test utilities
Below are functions that can assist in testing the implementation of backward
for individual nodes, as well as the gradient computation in a
ComputationGraphFunction. The approach is to use the secant approximation to
comput... |
"""
TLIO Stochastic Cloning Extended Kalman Filter
Input: IMU data
Measurement: window displacement estimates from networks
Filter states: position, velocity, rotation, IMU biases
"""
import argparse
import datetime
import json
import os
# silence NumbaPerformanceWarning
import warnings
from pprint import pprint
imp... |
# Copyright 2014 VMWare.
#
# 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 ... |
<filename>transliterate.py
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Author: <EMAIL>
#
# A comman line script to transliterate text
#
# ml transliterate aztranslate [<text>]
#
# https://github.com/MicrosoftTranslator/Text-Translat... |
<reponame>amar-enkhbat/AutoGCN
import os
import pickle
import json
import numpy as np
import pandas as pd
from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score
import seaborn as sns
import plotly.express as px
import matplotlib.pyplot as plt
def load_data(dataset_path):
"""
Load... |
"""
Data management
===============
The :class:`Directory` class provides an interface for creating hierarchical
filesystem directories and files within those directories using either an absolute
or relative path.
.. autosummary::
:nosignatures:
Directory
.. autoclass:: Directory
:members:
"""
import os... |
# You need an image testsuite to run this, for information see:
# kivy/tools/image-testsuite/README.md
import os
import re
import sys
import unittest
from collections import defaultdict
from kivy.core.image import ImageLoader
DEBUG = False
ASSETDIR = 'image-testsuite'
LOADERS = {x.__name__: x for x in ImageLoader.loa... |
__author__ = '<NAME>'
from colour import Color
def rawrgb2rgb(a,b,c):
return Color(rgb = (a/255,b/255,c/255))
blues = dict(
blue1 = rawrgb2rgb(113,199,236),
blue2 = rawrgb2rgb(30,187,215),
blue3 = rawrgb2rgb(24,154,211),
blue4 = rawrgb2rgb(16,125,172),
blue5 = rawrgb2rgb(0,80,115)
)
reds = d... |
<filename>get_plink_subsets.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 12 09:17:42 2020
Get PLINK subsets for clumping
@author: nbaya
"""
import hail as hl
import argparse
import hailtop.batch as hb
from ukbb_pan_ancestry.resources.genotypes import get_filtered_mt
from ukbb_pan_ancestry... |
<reponame>justant/justant-market-maker-master
from copy import deepcopy
import linecache
import sys
import threading
from time import sleep
import settings
from market_maker.utils.singleton import singleton_data
from market_maker.utils import log
logger = log.setup_custom_logger('root')
execept_logger = log.setup_cus... |
# Passing untrusted user input may have unintended consequences.
# Not designed to consume input from unknown sources (i.e.,
# the public internet).
import sys
import numpy as np
import cvxpy as cvx
from scipy import sparse
from .feature import _Feature
import pickle
class _CategoricalFeature(_Feature):
def __i... |
"""
Tests for the :mod:`fiftyone.utils.cvat` module.
You must run these tests interactively as follows::
python tests/intensive/cvat_tests.py
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
from bson import ObjectId
from collections import defaultdict
import numpy as np
import ... |
<reponame>honzamach/mydojo
"""New tables: users and groups
Revision ID: fe560e5dba27
Revises:
Create Date: 2019-02-08 13:38:38.469487
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'fe<PASSWORD>e5dba27'
down_revision ... |
<reponame>kruus/pymde
import numpy as np
import scipy.sparse as sp
import torch
from pymde import problem
from pymde.preprocess.graph import Graph
from pymde.preprocess.preprocess import sample_edges
from pymde import util
def distances(data, retain_fraction=1.0, verbose=False):
"""Compute distances, given data ... |
#!/usr/bin/env python
from __future__ import print_function
import textwrap
import argparse
import errno
import sys
from binho import binhoHostAdapter
from ..utils import binhoDFUManager
def print_core_info(device):
""" Prints the core information for a device. """
if device.inBootloaderMode:
prin... |
# -*- coding: utf-8 -*-
"""
dialoguss.core
==============
"""
import logging
import os
import os.path
import re
import sys
import yaml
import random
import requests
from abc import ABCMeta, abstractmethod
from argparse import ArgumentParser
SID_MIN = 1000000
SID_MAX = 10000000
LOGGER = logging.getLogger(__name__)
... |
"""
Main module.
Provides a class with utility methods for fetching data from the Global Health Observatory.
"""
import xmltodict
import pandas as pd
import requests
import io
from pprint import pprint
BASE_URL = 'http://apps.who.int/gho/athena/api/'
header = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_... |
#!/usr/bin/python
# Copyright (c) 2017 Alibaba Group Holding Limited. <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... |
<reponame>ryanbowen/django-datatables
"""
Column classes
"""
from django.urls import reverse
class Column(object):
# Tracks each time a Field instance is created. Used to retain order.
creation_counter = 0
def __init__(self, title=None, css_class=None, value=None, link=None, link_args=None):
se... |
import cv2
import os
import sys
import numpy as np
import scipy as sp
import pylab as pl
from datetime import datetime
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix, classification_report
from button_classifier import train_save_test
from matplotlib import pyplot as pl... |
import sublime
import sublime_plugin
import re
import os.path
def uniq(list):
seen = set()
return [value for value in list if value not in seen and not seen.add(value)]
def fuzzy_match(prefix, word):
query_i, word_i, next_i = 0, -1, -1
while query_i < len(prefix):
word_i = word.find(prefix[q... |
<reponame>matthew-brett/transforms3d<gh_stars>100-1000
''' Functions for working with zooms (scales)
Terms used in function names:
* *mat* : array shape (3, 3) (3D non-homogenous coordinates)
* *aff* : affine array shape (4, 4) (3D homogenous coordinates)
* *zfdir* : zooms encoded by factor scalar and direction vecto... |
from __future__ import annotations
import dataclasses
from typing import Dict, Tuple
import numpy as np
from coffee.client import BulletClient
from coffee.structs import JointInfo, JointType
@dataclasses.dataclass(frozen=True)
class Joints:
"""A convenience class for accessing the joint information of a PyBull... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.core import TeaCore
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_util.client import Client as UtilClient
fr... |
<gh_stars>10-100
import unittest
import numpy as np
import time
import argparse
from utils.ur_msg import create_ur_msg
from utils.test_utils import do_dashboard_command, wait_for_new_message, wait_for_dc_mode
from packages.pyalice import Application, Message, Composite
class ToolIoTest(unittest.TestCase):
@classm... |
#!/usr/bin/python
import os
import sys
import csv
import mysql.connector
import argparse
#Argparse ActionClass check extension
def CheckExt(choices):
class Act(argparse.Action):
def __call__(self,parser,namespace,fname,option_string=None):
ext = os.path.splitext(fname)[1][1:]
if ex... |
import numpy as np
from layers import *
class RNN(object):
def __init__(self, vocab_dim, idx_to_char, input_dim=30, hidden_dim=25, cell_type='lstm'):
"""Takes as arguments
vocab_dim: The number of unique characters/words in the dataset
idx_to_char: A dictionary converting integer representa... |
<gh_stars>10-100
"""
desisim.scripts.pixsim_nights
=============================
This is a module.
"""
from __future__ import absolute_import, division, print_function
import os,sys
import os.path
import shutil
import random
from time import asctime
import numpy as np
import desimodel.io
from desiutil.log import g... |
<filename>digit_caps.py
#
# Dynamic Routing Between Capsules
# https://arxiv.org/pdf/1710.09829.pdf
#
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
import torch.nn.functional as F
import math
from squash i... |
#!/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.
import logging
from typing import Union, Tuple, Optional, Any, List, Dict, cast
from to... |
<reponame>skeuomorf/cryptography
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import datetime
import o... |
<filename>security/ecdsa/publicKey.py
# -*- coding: utf-8 -*-
from .utils.compatibility import toBytes
from .utils.der import fromPem, removeSequence, removeObject, removeBitString, toPem, encodeSequence, encodeOid, encodeBitString
from .utils.binary import BinaryAscii
from .point import Point
from .curve import curve... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#Importing individual user data
user_1 = pd.read_csv('User_1.csv')
user_2 = pd.read_csv('User_2.csv')
user_3 = pd.read_csv('User_3.csv')
user_4 = pd.read_csv('User_4.csv')
user_5 = pd.read_csv('User_5.csv')
user_6 = pd.read_csv('User_6.csv')
user_7... |
import json
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from time import strftime as stime
import os
from sklearn.cluster.bicluster import SpectralCoclustering
RATINGS_FILE = "rating_cleaned.json"
ANIME_FILE = "anime_cleaned.csv"
DIR = "DATABASE"
DATA_FILE = "ratings_database.cs... |
<reponame>rsudheerk001/MIVisionX
# Copyright (c) 2018 - 2020 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 the Software without restriction, including... |
# this code is modified from the pytorch example code: https://github.com/pytorch/examples/blob/master/imagenet/main.py
# after the model is trained, you might use convert_model.py to remove the data parallel module to make the model as standalone weight.
#
# <NAME>
import argparse
import os
import shutil
import time
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.