text
stringlengths
957
885k
import datetime import json import numpy as np import pandas as pd import requests import xarray as xr from utils import divide_chunks, get_indices_not_done, \ get_site_codes, append_to_csv_column_wise, load_s3_zarr_store,\ convert_df_to_dataset def get_all_streamflow_data(output_file, sites_file, huc2=None...
import weakref from . import species, rxdmath, rxd, node, initializer import numpy import copy from .generalizedReaction import GeneralizedReaction, ref_list_with_mult, get_scheme_rate1_rate2_regions_custom_dynamics_mass_action from .rxdException import RxDException class Reaction(GeneralizedReaction): def __init_...
<gh_stars>10-100 #! /usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2016 <NAME> <<EMAIL>> # If you like this library, consider donating to: https://bit.ly/armstrap-opensource-dev # Anything helps. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softwar...
import numpy as np from scipy.spatial.distance import cdist from plaster.tools.image import imops from plaster.tools.image.coord import YX, HW from plaster.tools.schema import check from plaster.tools.utils.stats import half_nanstd from plaster.tools.zlog.zlog import spy def pixel_peak_find_one_im(im, approx_psf): ...
#!/usr/bin/env python3 # @lc app=leetcode.cn id=706 lang=python3 # # [706] Design HashMap # # https://leetcode-cn.com/problems/design-hashmap/description/ # # algorithms # Easy (58.76%) # Total Accepted: 35.5K # Total Submissions: 56.1K # Testcase Example: '["MyHashMap","put","put","get","get","put","get","remove",...
<filename>tests/tasks/test_empathetic_dialogues.py #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from parlai.core.opt import Opt from parlai.tasks.em...
from sympy import * init_printing(pretty_print=true) x = Symbol('x') def f(x): return exp(x) def aplicando_h(a, b, h): lista = [a] elemento = 0 while True: if elemento < b: elemento = lista[-1] + h lista.append(elemento) else: break return lista...
"""Tests for the Ecosystem class.""" import unittest import axelrod class TestEcosystem(unittest.TestCase): @classmethod def setUpClass(cls): cooperators = axelrod.Tournament( players=[ axelrod.Cooperator(), axelrod.Cooperator(), axelrod.Co...
# -*- coding: utf-8 -*- """ Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is he...
# pylint: disable=invalid-name # pylint: disable=line-too-long import sys from optparse import OptionParser from . import flashimage from . import jffs2 from . import uboot def main() : parser = OptionParser() parser.add_option("-c", dest = "command", default = "information", help = "Command (i[nformation], r...
<reponame>aliyun/dingtalk-sdk # -*- 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 ...
<reponame>Kozoro/ipyida # -*- encoding: utf8 -*- # # This module allows an IPython to be embeded inside IDA. # You need the IPython module to be accessible from IDA for this to work. # See README.adoc for more details. # # Copyright (c) 2015-2018 ESET # Author: <NAME> <<EMAIL>> # See LICENSE file for redistribution. f...
<gh_stars>1-10 '''This plots the mixing sweep results ''' from os import mkdir from os.path import isdir from pickle import load from numpy import arange, array, atleast_2d, hstack, sum, where, zeros from matplotlib.pyplot import axes, close, colorbar, imshow, set_cmap, subplots from mpl_toolkits.axes_grid1 import make...
<reponame>PolicyStat/distributed-nose<gh_stars>1-10 import logging from hashring import HashRing from nose.plugins.base import Plugin from nose.util import test_address logger = logging.getLogger('nose.plugins.distributed_nose') class DistributedNose(Plugin): """ Distribute a test run, shared-nothing styl...
<reponame>pinax/pinax-types import datetime from django.core.exceptions import ValidationError from django.test import TestCase from django.utils import timezone from pinax.types.periods import ( PERIOD_TYPES, get_period, parse, period_display, period_for_date, period_range, period_start_e...
from ..loaders import load_data from ..utils import load_json_config from deoxys_image.patch_sliding import get_patch_indice from deoxys_vis import read_csv import numpy as np import h5py import pandas as pd import os from time import time import shutil import matplotlib.pyplot as plt import warnings class H5Metri...
<gh_stars>0 # -*- coding: utf-8 -*- """ Module containing utilities to create/manipulate grids. """ import logging import math from typing import Optional, Tuple, Union import geopandas as gpd import pyproj import shapely.ops as sh_ops import shapely.geometry as sh_geom ##############################################...
<reponame>febsn/aldryn_newsblog_extra_plugins # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext, ugettext_lazy as _ from aldryn_categories.fields import CategoryForeig...
""" Problem of assembling the original chromosome (sequence) from its multiple fragments (reads) is represented with a graph, where vertices are individual reads and edges are overlaps between reads. The assembly of the original sequence is equivalent to finding such a path through the graph that each read is only used...
<reponame>benedictquartey/Chiromancer import numpy as np #numpy library for matrix math import cv2 import imutils # basic image processing import pandas as pd import os from datetime import datetime import time import cv_functions data_class=[] data_images= [] dataSet = {'images':data_ima...
#!/usr/bin/env python # # Copyright the CoLL team. # # 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 ...
<filename>plugin.audio.booksshouldbefree/cache.py # Copyright (C) 2013 # <NAME> (<EMAIL>) # # 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 Free Software Foundation; either version 2, or (at your option) ...
import re, os import config class room_task: def __init__(self, thm_session, room_name, skip_answers=False) -> None: self.room_tasks = None self.thm_session = thm_session self.room_name = room_name self.skip_answers = skip_answers def get_attr(self, task: dict=None, question: dict=None) -...
<filename>matrices.py from numbers import Number import random as rd import time import numpy as np class Matrice: # constructeur def __init__(self, l, c=None, fill=0.0): self.lignes = l # matrice carree ? if c is None: self.colonnes = l else: self.col...
#!/usr/bin/env python """ This example calculates the Ricci tensor from the metric and does this on the example of Schwarzschild solution. If you want to derive this by hand, follow the wiki page here: https://en.wikipedia.org/wiki/Deriving_the_Schwarzschild_solution Also read the above wiki and follow the referenc...
<reponame>ArnaudGallardo/boss<gh_stars>10-100 # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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...
from __future__ import print_function, division, absolute_import ''' Modified by <NAME>: 2012-11-30: The timestamping has been converted to more precise, floating-point representation, instead of integer representation. (See Lines 600-601 and 630-633 for modification.) ''' # y_serial Python module Version ...
#!/usr/bin/env python """ Code to plot a contour from an MCMC chain Author: <NAME> (2013) Modified: <NAME> (12 August 2013) """ import sys,os import numpy import pylab from scipy import interpolate #from lumfunc import * import line_profiler from utils import * #from settings import * import matplotlib from matplotl...
<reponame>ndrogness/RogyGarden<filename>rogysensor.py #!/usr/bin/env python3 import time from collections import namedtuple try: from smbus2 import SMBus except ImportError: from smbus import SMBus class RogySensor: SensorData = namedtuple('SensorData', ['name', 'val', 'units']) def __init__(self, ...
<reponame>GSByeon/openhgsenti # -*- coding: utf8 -*- #from __future__ import unicode_literals from elasticsearch import Elasticsearch import numpy as np from collections import Counter from django.shortcuts import render,get_object_or_404 from django.contrib.auth import logout from django.http import HttpResponseRedir...
<reponame>Harlen520/NCPQA<gh_stars>10-100 import pandas as pd import numpy as np import collections from prepare.data_preprocess import data_preprocess from torch.utils.data.distributed import DistributedSampler from sklearn.model_selection import KFold from torch.utils.data import TensorDataset, DataLoader, RandomSamp...
<filename>Trakttv.bundle/Contents/Libraries/Shared/plugin/modules/migrations/account.py from plugin.core.environment import Environment from plugin.models import ( Account, ClientRule, UserRule, PlexAccount, PlexBasicCredential, TraktAccount, TraktBasicCredential, TraktOAuthCredential ) from plugin.modules....
# ***************************************************************************** # Copyright (c) 2019, Intel Corporation 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 sou...
# Copyright 2016 VMware, 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...
import data_mod.utils.jsonutils as sut import unittest class TestJsonUtils(unittest.TestCase): test_case_01 = { "input": """{ "Root": { "Level_1": { "Level_2": { "Level_3a": "+00:00", "Level_3b": ...
<gh_stars>1-10 # -*- coding: utf-8 -*- import numpy import sympy.mpmath as sm sm.mp = 1024 def polynomial(x, list_a): return sum(a*x**k for k,a in enumerate(list_a)) def d_polynomial(x, list_a): return sum(a*k*x**(k-1) for k,a in enumerate(list_a) if k >= 1) def dd_polynomial(x, list_a): return sum(a*k*...
<filename>rank_correlation_comparison.py import matplotlib.pyplot as plt import numpy as np from scipy import stats import pickle from zero_cost_estimators import zero_cost_estimator # specify some setup hyperparameters for comparison sum_window_E = 1 dataset_list = ['cifar10-valid','cifar100', 'ImageNet16-120'] data...
<reponame>jasonfan1997/threeML from dataclasses import dataclass, field from enum import Enum, Flag from typing import Any, Dict, List, Optional import numpy as np import matplotlib.pyplot as plt from omegaconf import II, MISSING, SI, OmegaConf from .plotting_structure import CornerStyle, MPLCmap class Sampler(Enum...
<reponame>ETCCooperative/brownie #!/usr/bin/python3 import hashlib import itertools import json import re import tempfile from pathlib import Path from typing import Dict, List, Optional, Set, Tuple from urllib.parse import urlparse from ethpm._utils.ipfs import generate_file_hash from ethpm.backends.ipfs import Infu...
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
import re import pandas as pd import sys from google.cloud import bigquery, storage class BqPivot(): """ Class to generate a SQL query which creates pivoted tables in BigQuery. Example ------- The following example uses the kaggle's titanic data. It can be found here - `https://www.kaggle.com/...
from dataclasses import dataclass from typing import Collection, Dict, List, Optional, Set from zerver.lib.mention import MentionData from zerver.models import NotificationTriggers @dataclass class UserMessageNotificationsData: user_id: int online_push_enabled: bool pm_email_notify: bool pm_push_noti...
# Copyright 2016-2021 The <NAME> at the California Institute of # Technology (Caltech), with support from the Paul Allen Family Foundation, # Google, & National Institutes of Health (NIH) under Grant U24CA224309-01. # All rights reserved. # # Licensed under a modified Apache License, Version 2.0 (the "License"); # you ...
import logging import uuid from datetime import timedelta from behave import * from django.db.models import Sum from api.tests.factories import ( UserFactory, InstanceFactory, IdentityFactory, InstanceStatusFactory, ProviderFactory, ProviderMachineFactory, InstanceHistoryFactory) from core.models import * fro...
<filename>src/generator.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri May 26 16:40:21 2017 @author: lenkakt """ import os, sys, getopt import gravi import numpy as np strMainHelp = 'Usage: \n ' + \ 'get_data.py -o <OutputFolder> -s <DataSize> -x <XLength> -y <YLength> -a <XStep> -b <YStep>...
# -*- coding: utf-8 -*- """ Created on Thu Mar 16 17:46:57 2017 @author: kcarnold """ from megacomplete import data import numpy as np import scipy.sparse #%% sents = data.yelp_sents() #%% sent_lens = np.array([len(sent) for doc in sents for sent in doc]) min_sent_len, max_sent_len = np.percentile(sent_lens, [25, 75]...
""" ========================================== From raw data to dSPM on SPM Faces dataset ========================================== Runs a full pipeline using MNE-Python: - artifact removal - averaging Epochs - forward model computation - source reconstruction using dSPM on the contrast : "faces - scrambled" """ pri...
import json import uuid import requests from invoke.watchers import Responder from invoke import task class DeploymentError(Exception): def __init__(self, message): super(DeploymentError, self).__init__("Deployment error: ".format(message)) def _create_resources(c, project_name, verbose=False): com...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ import os import sys sys.path.insert(1, '/home/labs/ahissarlab/arivkind/imagewalker') sys.path.insert(1, '/home/labs/ahissarlab/orra/imagewalker') sys.path.insert(1, '/home/orram/Documents/GitHub/imagewalker') import random import numpy as np import tensorflow a...
<reponame>lfoppiano/grobid-superconductors-tools from grobid_superconductors.commons.grobid_evaluation_analysis import append_tokens_before, append_tokens_after, \ extract_error_cases def test_append_tokens_before(): error_case = [] input_data = { 'data': [ ['a', '<other>', '<other>']...
<reponame>MatthieuDartiailh/vispy # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ------------------------------------------------------------...
<reponame>achoi007/CloudComputing import unittest from collections import defaultdict from itertools import combinations, product, ifilter class SerialEquivalence: ''' 2 txns are serially equivalent iff all pairs of conflicting ops (pair containing 1 op from each txn) are executed in same order (txn order)...
from argparse import ArgumentParser import torch import torch.nn as nn import pytorch_lightning as pl from pytorch_lightning.metrics import Accuracy from torch.nn import functional as F from torch.utils.data import DataLoader, random_split from torchvision.datasets.mnist import MNIST from torchvision import transform...
class Realtime(): def __init__(self, device): self.device = device self.interface_name = "com.attocube.ids.realtime" def AafIsEnabled(self): """ Checks if the anti-aliasing filter is enabled. Parameters ---------- Returns -----...
<reponame>kassemal/diffTesting<gh_stars>0 """ Methods that read 'Internet Usage' dataset and the related generalization trees. """ #!/usr/bin/env python # coding=utf-8 import utils.utility as ul import pickle from pulp import * #Some remarkable attributes numbers: #2 Age (index = 1): Not-Say, 41, 28, 25, 17, 55, 53...
<gh_stars>1-10 #!/usr/bin/env python import os import unittest import numpy as np from slowgrad.tensor import Tensor from slowgrad.utils import fetch import slowgrad.optim as optim from tqdm import trange from models import * # mnist loader def fetch_mnist(): import gzip parse = lambda dat: np.frombuffer(gz...
<reponame>zhenwendai/MXFusion import warnings import numpy as np import mxnet as mx from mxnet import initializer from mxnet import ndarray from mxnet.gluon import ParameterDict from ..components.variables import VariableType, Variable from ..components import ModelComponent from ..util.inference import realize_shape f...
import json from django.conf import settings from django.core import validators from django.db import models from django.utils.translation import ugettext_lazy as _ from rest_framework.renderers import JSONRenderer from taggit.managers import TaggableManager from taggit.models import CommonGenericTaggedItemBase, Tagge...
<gh_stars>0 import numbers import os from unittest.mock import MagicMock import numpy as np import pytest import torch from pytest import approx, raises from sklearn.metrics import confusion_matrix, f1_score, precision_score, recall_score import ignite.distributed as idist from ignite.engine import Engine, Events, St...
import sys import os import struct import io def requires(moduleName): """Marks a function as requiring an optional module dependency.""" def decorate_function(fn): def wrapper(*args, **kwargs): if moduleName in sys.modules: result = fn(*args, **kwargs) retur...
<reponame>hassanakbar4/ietfdb # Copyright The IETF Trust 2016-2019, All Rights Reserved import sys import time from textwrap import dedent import debug # pyflakes:ignore from django.conf import settings from django.core.management.base import BaseCommand from django.core.exceptions import ...
<filename>DailyCodingProblem/112_Twitter_Find_Lowest_Common_Ancestor_of_Two_Nodes_In_A_Tree.py """ This problem was asked by Twitter. Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. Assume that each node in the tree also has a pointer to its parent. According to the definiti...
# -*- coding: utf-8 -*- # Copyright 2018 <NAME> # 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...
<reponame>tacaswell/pyFAI<filename>pyFAI/benchmark/__init__.py #!/usr/bin/env python # coding: utf-8 # # Copyright (C) 2016-2018 European Synchrotron Radiation Facility, Grenoble, France # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation f...
<filename>gwas/src/spark.py import sklearn as sk from sklearn import decomposition import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import gzip as gz import scipy from scipy import stats import math import random from scipy.optimize import minimize from scipy.special impor...
<gh_stars>10-100 # PyMoBu - Python enhancement for Autodesk's MotionBuilder # Copyright (C) 2010 <NAME> # <EMAIL> # # 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 Free Software Foundation, either version 3 of the...
<reponame>RamParameswaran/openfisca-djangoapi import numpy as np import pandas as pd import plotly.graph_objects as go from plotly.io import to_html import networkx as nx import plotly.express as px from variables.models import Variable from django.db.models import Count colorScheme = { "background_color": 'rgba...
from flask import Flask, jsonify, request from .history import history as hist from .api_funcs import * from .comments import * from uszipcode import SearchEngine def create_app(): app = Flask(__name__) source_message = 'Please select either USGS or EMSC as source' @app.route('/') def home(): ...
<reponame>kclemens/epoet<gh_stars>0 import math import logging import random import json import gzip class Box(object): def __init__(self, min_lon=-180.0, min_lat=-90.0, max_lon=180.0, max_lat=90.0): self.max_lon = max_lon self.max_lat = max_lat self.min_lon = min_lon self.min_lat ...
<gh_stars>0 """This module contains the general information for SysdebugDiagnosticLog ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class SysdebugDiagnosticLogConsts: OPER_STATE_ALLOCATED = "allocated" OPER_STATE_CREA...
''' Created on 2016/1/8 :author: hubo ''' from vlcp.config.config import Configurable, config from vlcp.event.connection import Client from vlcp.protocol.redis import Redis, RedisConnectionStateEvent, RedisSubscribeMessageEvent,\ RedisReplyException from contextlib import contextmanager def _str(b, encoding = 'as...
<filename>tensorf/network.py<gh_stars>0 import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import time ################## sh function ################## C0 = 0.28209479177387814 C1 = 0.4886025119029199 C2 = [ 1.0925484305920792, -1.0925484305920792, 0.31539156525252005, ...
#!/usr/bin/python3 from pyvips import Image, Introspect, GValue, Error, \ ffi, values_for_enum, vips_lib, gobject_lib, \ type_map, type_name, type_from_name, nickname_find # This file generates the phpdoc comments for the magic methods and properties. # It's in Python, since we use the whole of FFI, not just ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
<filename>to_srt.py<gh_stars>0 import argparse import codecs import math import os import re SUPPORTED_EXTENSIONS = [".xml", ".vtt", "dfxp"] def leading_zeros(value, digits=2): value = "000000" + str(value) return value[-digits:] def convert_time(raw_time, extension): if int(raw_time) ...
from unittest import mock import pytest from django.contrib.auth import get_user_model from email_auth import authentication, models @pytest.fixture def mock_email_address_qs(): mock_qs = mock.Mock(spec=models.EmailAddress.objects) mock_qs.all.return_value = mock_qs with mock.patch("email_auth.models.E...
<filename>config_files/create_config_files.py import argparse import yaml import os if __name__ == "__main__": datasets = ["yago43k"] train_types = ["1vsAll", "KvsAll", "negative_sampling"] template_filename = "templates_iclr2020.yaml" # parse args parser = argparse.ArgumentParser() parser.ad...
#!/usr/bin/env python3 # author: @netmanchris # This section imports required libraries import requests import json from pyhpeimc.auth import IMCAuth HEADERS = {'Accept': 'application/json', 'Content-Type': 'application/json', 'Accept-encoding': 'application/json'} #auth = IMCAuth('http://','10.101.0.201','808...
# coding: utf-8 from __future__ import unicode_literals import itertools import random import re from .common import InfoExtractor from ..utils import ( determine_ext, dict_get, ExtractorError, int_or_none, js_to_json, orderedSet, str_or_none, try_get, ) class TVPIE(InfoExtractor): ...
<gh_stars>0 # -*- coding: utf-8 -*- # Scrapy settings for crawler project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # https://doc.scrapy.org/en/latest/topics/settings.html # https://doc.scrapy.org/en/...
#lims from SBaaS_LIMS.lims_experiment_postgresql_models import * from SBaaS_LIMS.lims_sample_postgresql_models import * from .stage01_quantification_replicatesMI_postgresql_models import * from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update from SBaaS_base.sbaas_base_query_drop import sbaas_base_qu...
<filename>examples/metrica.py # -*- coding: utf-8 -*- """ * Find packing for real-time metrica data * Owner: <NAME> * Version: V1.0 * Last Updated: May-14-2020 """ import os import sys import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.spatial import distance from collections import de...
#!/usr/bin/env python """ Copyright (c) 2020 <NAME> 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, publi...
from hazelcast.exception import HazelcastSerializationError from hazelcast.util import enum from hazelcast import six FieldType = enum( PORTABLE=0, BYTE=1, BOOLEAN=2, CHAR=3, SHORT=4, INT=5, LONG=6, FLOAT=7, DOUBLE=8, UTF=9, PORTAB...
<gh_stars>1-10 from bs4 import BeautifulSoup # 크롤링을 위해 bs4 라이브러리 사용 from urllib.request import urlopen today_menu_list = [[[], [], [], [], [], [], []]] all_menu_list = [] menuTime = [] day_list = ['월','화','수','목','금','토','일'] tday = "" for i in range(7): # 첫번째 인덱스를 요일, 두번째 인덱스를 메뉴 시간, 세번째 인덱스를 메뉴 시간별 세부 메뉴를 가진 3차원 ...
from typing import List from itertools import combinations from collections import defaultdict from clustering import Clustering class CustomMeasure(object): def __init__(self, clusterings: List[Clustering]): self.nclusterings = len(clusterings) self.clusterings = clusterings self.cluster...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright 2016-2017 VMware Inc. # This file is part of ETSI OSM # 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 L...
'''Extracting Text from PDF''' import enum from pathlib import Path import fitz from graeScript import outfile_path class FileMode(enum): """ PDF output text modes that work with sending to file. From Fitz/pymupdf: https://pymupdf.readthedocs.io/en/latest/page.html?highlight=get_text#Page.get_tex...
<filename>src/ppo/agent.py import random import logging import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import load_model from typing import Tuple, List, Any from src.base import Agent ...
<filename>wagtail_review/models.py<gh_stars>0 from django.conf import settings from django.db import models from django.db.models import Case, Q, Value, When from django.db.models.constraints import CheckConstraint, UniqueConstraint from django.template.loader import render_to_string from django.urls import reverse fro...
<filename>bot_ava.py from selenium import webdriver from time import sleep from icalendar import Calendar, Event, vDatetime from datetime import datetime from pytz import UTC import os import time import secret import platform import json DATA_PATH = r'C:\Users\lacft\Documents\moddle_calendar_bot\data' data = {} cl...
<gh_stars>1-10 # ============================================================================== # ARSC (A Relatively Simple Computer) License # ============================================================================== # # ARSC is distributed under the following BSD-style license: # # Copyright (c) 2016-2017 <NAM...
<filename>api/views.py<gh_stars>0 import re from rest_framework.permissions import IsAuthenticated from rest_framework.views import APIView from api.serializers import ( UserSerializer, UserInCourseSerializer, LoginSerializer, CourseSerializer, RegistrationInCourseReadSerializer, RegistrationInC...
from os.path import join import numpy as np import pickle from grammar.grammar import Grammar from components.dataset import Example from grammar.python3.python3_transition_system import * from datasets.utils import build_dataset_vocab import sys sys.path.append('.') # from grammar.hypothesis import Hypothesis, Apply...
<filename>integration/test/short_region/plot_margin_sweep.py #!/usr/bin/env python3 # # Copyright (c) 2015 - 2021, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of so...
# -*- coding: utf-8 -*- """ Reference implementation of RiWalk. Author: <NAME> For more details, refer to the paper: RiWalk: Fast Structural Node Embedding via Role Identification ICDM, 2019 """ import argparse import json import time import RiWalkGraph from gensim.models import Word2Vec from gensim.mode...
<reponame>861934367/cgat ########################################################################## # # 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 # ...
from rest_framework import serializers from django.contrib.auth import get_user_model, authenticate # authenticate function which comes with Django and it's a Django helper command for working with the Django authentication system. So you simply pass in the username and password and you can authenticate a request from...
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Component: DESCRIPTION = "Get alerts by domain" class Input: DOMAIN = "domain" class Output: RESULTS = "results" class GetAlertForDomainInput(komand.Input): schema = json.loads(""" { "type": "object", ...
import sys import numpy as np from PIL import Image import torchvision from torch.utils.data.dataset import Subset from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances import torch import torch.nn.functional as F import random import os import json from numpy.testing import assert_...