text stringlengths 957 885k |
|---|
<gh_stars>10-100
"""Collection of functions that get data from a device using Restconf"""
from json.decoder import JSONDecodeError
import requests
import json
import warnings
import ipaddress
import device_call_backup as InCaseRestDoesntWork
warnings.filterwarnings('ignore', message='Unverified HTTPS request')
header... |
<reponame>tethys-platform/tethys<gh_stars>1-10
# Copyright 2020 Konstruktor, 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/L... |
<reponame>Ahuge/sept_qt
import os
from Qt import QtGui, QtWidgets, QtCore
from sept import errors
from .input_widget import TemplateInputWidget
class FileTemplateInputWidget(TemplateInputWidget):
"""
FileTemplateInputWidget extends the TemplateInputWidget in allowing users
to interactively create `... |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <<EMAIL>>
# Date: October 20, 2011
"""
This is the scons_gen_rule module which inherits the SconsTarget
and generates related gen rule rules.
"""
import os
import blade
import build_rules
import console
from blade_util import var... |
<reponame>healthdesk-hackathon/backend<filename>patient/migrations/0001_initial.py
# Generated by Django 3.0.5 on 2020-04-12 13:01
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
class Migrat... |
<filename>myenv/lib/python2.7/site-packages/promise/promise.py<gh_stars>0
import functools
from threading import Event, RLock
from .compat import Future, iscoroutine, ensure_future, iterate_promise # type: ignore
from typing import Callable, Optional, Iterator, Any, Dict, Tuple, Union # flake8: noqa
class Countdow... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import importlib
import json
import requests
import re
import collections
import os
import copy
from django.db import models, router, connections
from django.conf import settings
from django.contrib.auth.models import User
from django.db.... |
# sklearnTrainer
import numpy as np
import copy
from toolkitJ import cell2dmatlab_jsp
import matplotlib as mpl
from matplotlib.font_manager import FontProperties
zhfont = FontProperties(fname="/usr/share/fonts/cjkuni-ukai/ukai.ttc") # 图片显示中文字体
mpl.use('Agg')
import sklearn.model_selection as skmdls
im... |
<gh_stars>0
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------... |
<filename>utils/statistics.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.tsa.stattools import adfuller
from statsmodels.regression.linear_model import OLS
from statsmodels.stats.diagnostic import ac... |
"""
Implements a fuzzy definition of synteny
"""
from itertools import chain
import rasmus
from rasmus import util
from rasmus.linked_list import LinkedList
from rasmus.sets import UnionFind
from compbio.regionlib import Region
from . import SyntenyBlock
def iter_windows(hits, radius):
"""Iterate through... |
<filename>category_upwork/real_estate_proforma_modelling/revenue_complex.py
import pandas as pd
import os
import re
# function to procure the absolute path of the file to be read
def get_file_path(filename):
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
filepath = os.pa... |
<filename>synapse/federation/transport/server/_base.py
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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/lic... |
<gh_stars>10-100
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
parse_age_limit,
traverse_obj,
unified_timestamp,
url_or_none
)
class TrueIDIE... |
#
#
# open() 函数常用形式是接收两个参数:文件名(file)和模式(mode)。
#
# open(file, mode='r')
# 完整的语法格式为:
#
# open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
# 参数说明:
#
# file: 必需,文件路径(相对或者绝对路径)。
# mode: 可选,文件打开模式
# buffering: 设置缓冲
# encoding: 一般使用utf8
# errors: 报错级别
# newline: 区分换行符
# ... |
<filename>kolibri/core/tasks/test/taskrunner/test_worker.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
import time
import pytest
from mock import patch
from kolibri.core.tasks.job import Job
from kolibri.core.tasks.job import State
from kolibri.core.tasks.test.base import connection
from kolibri.core.tasks.worker impo... |
<reponame>redhat-openstack/oslo.config<filename>oslo_config/tests/test_fixture.py
#
# Copyright 2013 Mirantis, Inc.
# Copyright 2013 OpenStack Foundation
# 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. Yo... |
import re
from basic import *
SPECIAL_CHARACTERS = '&|<>=:#'
class Lexer:
def __init__(self, text, context):
self.text = text
self.context = context
self.pos = -1
self.cur_char = None
self.advance()
def advance(self):
"""Advances the pointer one step"""
... |
<filename>Blending/comment_params.py
def lgbm_get_params():
params = []
params.append({"num_iterations": 503,
'num_leaves': 375,
'learning_rate': 0.03836392757670029,
'max_depth': 63,
'lambda_l1': 22.399701123004604,
... |
from collections import Counter, OrderedDict
import torch
import torch.utils.data as data_utils
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.clip_grad import clip_grad_norm_
from torch.utils.d... |
"""
Plots the Wasserstein-2 distance as a function of translational distance.
"""
import pysdot as ot
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
xbnds = [0.0,1.0] # minimum and maximum x values
circle_radius = 0.1
ybnds = [0.5-2*circle_radius,0.5+2*circle_radius] # minimum and maxim... |
import pandas as pd
from loguru import logger
import cv2
import numpy as np
from cv.image_processing import image2tiles, get_labels_tiles, predictions2image, tiles2images
from cv.tf_utils import train_model
from segmentation.pixel_tile_segmentation_model import get_model_definition
def get_params():
path = '/hom... |
from web3 import Web3
from alastria_identity.types import (
Transaction,
NetworkDid,
Entity)
from alastria_identity.services import IdentityConfigBuilder, ContractsService, IDENTITY_MANAGER_ADDRESS
class IdentityManagerService:
def __init__(self, endpoint: Web3):
self.endpoint = endpoint
... |
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import enum
from . import poptorch_core # type: ignore
class MeanReductionStrategy(enum.IntEnum):
"""Specify when to divide by a mean reduction factor when
``accumulationAndReplicationReductionType`` is set to
``ReductionType.Mean``.
- ``Runni... |
import torch
import torch.nn as nn
from Utility.TDL import insert_tdl
from Utility.DenseLayer import Dense
import math
class NARXCell(torch.nn.Module):
__constants__ = ['input_delay_size',
'output_delay_size',
'hidden_size',
'input_size',
... |
from __future__ import unicode_literals, division, absolute_import
from urlparse import urlparse
import logging
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
log = logging.getLogger('sickbeard')
class Sickbeard(object):
schema = ... |
<reponame>tomdoherty/salt<filename>tests/pytests/unit/beacons/test_telegram_bot_msg.py
# Python libs
import datetime
import logging
import time
import pytest
# Salt libs
from salt.beacons import telegram_bot_msg
# Salt testing libs
from tests.support.mock import MagicMock, patch
# Third-party libs
try:
import t... |
import numpy as np
import cv2
import os
#from data_process import get_frames_from_video
def rgb2gray(img):
r = img[...,0]*0.299
g = img[...,1]*0.587
b = img[...,2]*0.114
return r+g+b
def visualize(flow, name='flow', show=True):
h, w, c = flow.shape
hsv = np.zeros((h,w,3), dtype=np.uint8)
h... |
<filename>cogs/mute.py
import discord
from discord.ext import commands
import aiosqlite
import asyncio
from datetime import datetime, timedelta
from utils.ids import GuildNames, GuildIDs, TGRoleIDs, BGRoleIDs, AdminVars
from utils.time import convert_time
import utils.check
class Mute(commands.Cog):
""... |
import json
import re
import scrapy
from locations.items import GeojsonPointItem
class IHGHotels(scrapy.Spider):
name = "ihg_hotels"
item_attributes = { 'brand': "IHG Hotels" }
# allowed_domains = ["ihg.com"] # the Kimpton hotels each have their own domains
download_delay = 0.5
start_urls = (
... |
"""
↓ Инициализация данных ↓
"""
from PyQt5 import QtWidgets, QtCore, QtGui
from GUI.GUI_windows_source import Collection
from scripts.utils import get_collection_data, mod_name_wrap, get_info_from_stack, get_total_value, \
file_name_fix, open_file_for_resuming, find_last_file, get_co... |
<reponame>raccoongang/openprocurement.tender.competitivedialogue
from openprocurement.api.validation import (
validate_data, validate_json_data
)
from openprocurement.api.utils import (
apply_data_patch, update_logging_context, error_handler, raise_operation_error
)
from openprocurement.tender.competitivedialog... |
from mrcnn import visualize
import os
import sys
import time
import numpy as np
import imgaug # https://github.com/aleju/imgaug (pip3 install imgaug)
# Download and install the Python COCO tools from https://github.com/waleedka/coco
# That's a fork from the original https://github.com/pdollar/coco with a bug
# fix f... |
<reponame>Ajuajmal/art-fest-event-manager-sattva
from django.shortcuts import render, redirect, get_object_or_404
from django.http import JsonResponse
from django.template.loader import render_to_string
from django.contrib.auth import login as auth_login
from django.contrib.auth.decorators import login_required
from dj... |
"""GitHub Module"""
import json
import requests
from django.contrib.auth.models import User
#from readux import __version__
__version__ = "2.0.0"
class GithubApiException(Exception):
"""custom exception"""
pass
class GithubAccountNotFound(GithubApiException):
"""custom exception"""
pass
class Gith... |
import torch as th
from components.action_selectors import EpsilonGreedyAttackerActionSelector, EpsilonGreedyIdentifierActionSelector
from module.agents.rnn_agent import RNNIdentifierAgent, RNNAttackerAgent
class SeparateMAC:
def __init__(self, scheme, groups, args):
self.n_peers = args.n_peers
s... |
<filename>xlremed/finetune.py
import argparse
from .model import XLMForMTBFineTuning
from .dataset import EHealthKD
from .framework import Framework
from torch.optim import SGD, Adam
import torch
torch.manual_seed(0)
import numpy as np
np.random.seed(0)
import random
random.seed(0)
def parse():
parser = argparse.... |
"""
Copyright 2017-2018 lvaleriu (https://github.com/lvaleriu/)
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 applicabl... |
<filename>scripts/qgps_2d_j1_j2_10_by_10_32_continue.py
import numpy as np
import netket as nk
import sys
import shutil
from shutil import move
import mpi4py.MPI as mpi
import symmetries
import os
N = 32
L = 10
mode = 1
J2 = 0.0
rank = mpi.COMM_WORLD.Get_rank()
initial_folder = "/home/mmm0475/Scratch/J1_J2_2D_10_by... |
<filename>scripts/show_darknet_loss.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import argparse
class Batch:
def __init__(self, iteration, total_loss, avg_loss):
self.iteration = iteration
self.total_loss = total_loss
self.avg_loss = avg_loss
def __str__(self):
... |
<filename>appengine_utilities/rotmodel.py
"""
Copyright (c) 2008, appengine-utilities project
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 retain the above copyri... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# pyramco
# version 0.9.2
# a complete wrapper class for RAMCO API calls
# documentation on the RAMCO API at: https://api.ramcoams.com/api/v2/ramco_api_v2_doc.pdf
# set your RAMCO api key in a separate file 'config.py' as 'ramco_api_key'
# requires Python 3.6+ and the 'requests' module
# imports
import requests
impor... |
<gh_stars>10-100
#!/usr/bin/env python
# encoding: utf-8
"""
script to install all the necessary things
for working on a linux machine with nothing
Installing minimum dependencies
"""
import sys
import os
import logging
import subprocess
import xml.etree.ElementTree as ElementTree
import xml.dom.minidom as minidom
imp... |
<filename>elmo/api/client.py<gh_stars>0
from threading import Lock
from contextlib import contextmanager
from functools import lru_cache
from requests import Session
from requests.exceptions import HTTPError
from .router import Router
from .decorators import require_session, require_lock
from .exceptions import (
... |
from app import db
from models.issn import ISSNMetaData, ISSNToISSNL
from models.journal import Journal
from models.usage import DOICount, OpenAccess
class MergeIssn:
def __init__(self, issn_from, issn_to):
self.issn_from = issn_from
self.issn_to = issn_to
self.old_issns = []
self.... |
# -*- coding: utf-8 -*-
"""
Created on Feb 09, 2018
@author: Tyranic-Moron
"""
from twisted.plugin import IPlugin
from pymoronbot.moduleinterface import IModule
from pymoronbot.modules.commandinterface import BotCommand, admin
from zope.interface import implementer
import re
from collections import OrderedDict
from ... |
<gh_stars>0
# A request to get a total count on refdata for a search query
search_request1 = {
"id": "xyz",
"method": "KBaseSearchEngine.search_objects",
"version": "1.1",
"params": [{
"access_filter": {
"with_private": 0,
"with_public": 1
},
"match_filte... |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
from django.urls import reverse
from django.conf import settings
from django.db.models import Q
import json
from rest_framework import generics
from rest_framework.renderers import JSONRenderer
from .serialize... |
<gh_stars>0
import pandas as pd
import logging
from constants import INPUT_PATH, PARTIDO_MUNZONA, FORMAT_FILE, STATES, CANDIDATO_MUNZONA
from helpers import flat_lists
def factory_partido(
ano_eleicao,
descricao_ue,
sigla_uf,
nome_partido,
numero_partido,
sigla_partido,
nome_legenda,
c... |
<reponame>justin8/convert_videos
from dataclasses import dataclass
import os
import shutil
import tempfile
import logging
import traceback
from enum import Enum, auto
from stringcase import titlecase, lowercase
from video_utils import Video
from .ffmpeg_converter import FFmpegConverter
from .settings import AudioSett... |
from larlib import *
from meshpy.tet import MeshInfo, build, Options
# LAR model with non-contractible faces
# ------------------------------------------------------------------------------
V = [[0.25, 0.25, 0.0], [0.25, 0.75, 0.0], [0.75, 0.75, 0.0], [0.75, 0.25, 0.0], [1.0,
0.0, 0.0], [0.0, 0.0, 0.0], [1.0, 1.0, 0... |
import sys
import unittest
from pysgrs.tests.test_cipher import TestStreamCipher
from pysgrs import alphabets
from pysgrs import ciphers
class TestIdentityStreamCipher(TestStreamCipher, unittest.TestCase):
cipher = ciphers.RotationCipher(offset=0)
ciphertexts = TestStreamCipher.plaintexts
class TestRotati... |
import numpy as np
import tensorflow as tf
from scipy.stats import randint
from sklearn.model_selection import GridSearchCV
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Flatten
from tensorf... |
from datetime import datetime
from decimal import Decimal
from typing import Optional
from django.conf import settings
from authentication.models import Dealer
from cashback.models import Cashback
from .exceptions import (DealerDoesNotExist, OrderCodeAlreadyExists,
OrderDoesNotExist, StatusN... |
<filename>pyclustering/nnet/tests/som_templates.py
"""!
@brief Templates for tests of Self-Organization Map (SOM).
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
import pickle
import matplotlib
matplotlib.use('Agg')
from pyclustering.nnet.som import som, type_conn, som_parame... |
"""
1-lead ECG monitor FarosTM 180 from Bittium is a one channel ECG monitor with
sampling frequency up to 1000 Hz and a 3D acceleration sampling up to 100Hz.
"""
import json
import os
import random
import numpy as np
import pandas as pd
import pyedflib as edf
class FarosReader:
"""
Read, timeshift and writ... |
"""
Ingestor and egestor for VOC formats.
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/htmldoc/index.html
"""
import os
import xml.etree.ElementTree as ET
from pathlib import Path
from workers.lib.messenger import message
from .abstract import Ingestor
from .validation_schemas import get_blank_image_detection_sch... |
"""
A definition of a decorator that adds noise to input values.
"""
from .idata_decorator import IDataDecorator
from .funcs.noise import select_noise
def calc_var_indices(input_vars, affected_vars):
"""Calculate indices of `affected_vars` in `input_vars`"""
if affected_vars is None:
return None
... |
<reponame>slemasne/lusid-sdk-python-preview
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from ... |
<filename>cpg-core/src/main/python/CPGPython/__init__.py
#
# Copyright (c) 2021, Fraunhofer AISEC. 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.apa... |
from mlpractice.stats.stats_utils import _update_stats, print_stats
from mlpractice.utils import ExceptionInterception
try:
from mlpractice_solutions.mlpractice_solutions\
.linear_classifier_solution import linear_softmax
except ImportError:
linear_softmax = None
import torch
import numpy as np
def ... |
import torch
import torch.nn as nn
class STLocalizedConv(nn.Module):
def __init__(self, hidden_dim, pre_defined_graph=None, use_pre=None, dy_graph=None, sta_graph=None, **model_args):
super().__init__()
# gated temporal conv
self.k_s = model_args['k_s']
self.k_t = model_args['... |
<reponame>tuandnvn/ecat_learning
# from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import time
import datetime
import numpy as np
import tensorflow as tf
#from tf.nn import rnn, rnn_cell
import codecs
import collections
import random
from col... |
<reponame>openprocurement/market.prozorro.ua
from django_filters import rest_framework as filters
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import status, viewsets
from rest_framework.filters import OrderingFilter
from rest_framework.permissions import IsAuthenticated
from rest_f... |
<reponame>sissaschool/elementpath
#
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
... |
<filename>codes/SRN/utils/util.py
import os
import math
from datetime import datetime
import numpy as np
import cv2
from torchvision.utils import make_grid
import random
import torch
import logging
import torch.nn.parallel as P
import math
import torch.nn as nn
####################
# miscellaneous
####################
... |
import json
import logging
from django.conf import settings
from django.http import (
HttpResponseBadRequest,
HttpResponseNotFound, HttpResponseForbidden
)
from django.utils import timezone
from rest_framework import permissions, status
from rest_framework.response import Response
from rest_framework.request im... |
### FIFA world cup
team_dict = {'2018' : {'teams' : ["URUGUAY", "RUSSIA", "SAUDI ARABIA", "EGYPT",
"SPAIN", "PORTUGAL", "IRAN", "MOROCCO",
"FRANCE", "DENMARK", "PERU", "AUSTRALIA",
"CROATIA", "ARGENTINA", "NIGERIA", "... |
<reponame>hustwei/chromite
# Copyright 2015 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.
"""Stage a custom image on a Moblab device or in Google Storage."""
from __future__ import print_function
import os
import re... |
<filename>supporting_scripts/tacoxDNA/src/libs/cadnano_utils.py<gh_stars>0
'''
Created on Nov 11, 2018
@author: lorenzo
'''
import numpy as np
from tacoxDNA.src.libs import base
from tacoxDNA.src.libs import utils
import math
BP = "bp"
DEGREES = "degrees"
class StrandGenerator (object):
def generate(self, bp,... |
<reponame>lshtm-gis/WHO_PHSM_Cleaning
import pandas as pd
import re
import os
import logging
import uuid
import random
def generate_blank_record():
"""
Generate a blank record with the correct WHO PHSM keys.
Other objects requiring the same selection of keys descend from here.
Returns
-------
... |
<gh_stars>100-1000
#
# filename
# mldb.ai inc, 2015
# this file is part of mldb. copyright 2015 mldb.ai inc. all rights reserved.
#
# This test is for issues MLDB-779 AND MLDB-780
# We do the training pipelines twice and each cls has a different
# failure point
#
from mldb import mldb
import datetime, random
dataset_... |
<gh_stars>10-100
# Copyright 2014 OpenCore LLC
#
# 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>pcdshub/whatrecord
import dataclasses
import importlib
import inspect
import logging
import pkgutil
import re
import sys
import typing
from pathlib import Path
from types import ModuleType
from typing import Dict, List, Optional, Union
import apischema
import pytest
from .. import (access_security, asyn, au... |
<gh_stars>100-1000
# Ant-FS
#
# Copyright (c) 2012, <NAME> <<EMAIL>>
#
# 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, c... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\xf5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xca\x... |
<gh_stars>10-100
"""
HRF Functions
=============
Various Hemodynamic Response Functions (HRFs) implemented by NiPy
Copyright (c) 2006-2017, NIPY Developers
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
me... |
import json
from flask import url_for
from urllib.parse import urlparse
from datetime import datetime
from dateutil import parser, tz
from urllib.parse import urlencode
from dataservice.extensions import db
from dataservice.api.study.models import Study
from dataservice.api.participant.models import Participant
from ... |
""" Module with physical constants for use with ipython, profile
"physics".
Definition of Fundamental Physical Constants, CODATA Recommended Values
Source, <NAME> and <NAME>,
CODATA Recommended Values of the Fundamental
Physical Constants, 1998
Website: physics.nist.gov/constants
"""
# License: BSD-like
# Copyright:... |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from typing import Union
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import List
class Client(BaseClient):
def associate_kms_key(self, logGroupName: str, kmsKeyId: str):
pa... |
<filename>src/data/make_dataset.py
# -*- coding: utf-8 -*-
"""
DEPRECATED
"""
import os
import json
from glob import glob
import codecs
import click
import logging
from pathlib import Path
import pdftotext
import docx2txt
from striprtf.striprtf import rtf_to_text
from natasha import (
MorphVocab,
NewsEmb... |
<reponame>aasquier/AI_Tower_Defense
import pygame
from projectile.projectile import Projectile, DamageType
from animations.animation import Animation
from constants.animationConstants import *
from projectile.iceBeam import IceBeam
# from .igloo import Igloo
# Tower base class
class Tower:
def __init__(self, pos... |
<gh_stars>0
import logging
import os
import pandas as pd
import numpy as np
import itertools as it
import xgboost as xgb
class XGB(object):
def __init__(self, obj):
self.master = obj
for key, val in vars(obj).items():
setattr(self, key, val)
base_for = "ACGT"
... |
<filename>arelle/WatchRss.py
'''
Created on Oct 17, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, sys, traceback, re
from arelle import (ModelXbrl, XmlUtil, ModelVersReport, XbrlConst, ModelDocument,
ValidateXbrl, ValidateFiling, Val... |
<gh_stars>1-10
import json
import logging
import math
import socketserver
import struct
import threading
import lz4.frame
from landia.config import ServerConfig
from landia.common import StateDecoder, StateEncoder
from landia import gamectx
from .clock import clock
class UDPHandler(socketserver.BaseRequestHandler... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Imports
########################################
import sys, os
# Update this to point to the directory where you copied the SciAnalysis base code
#SciAnalysis_PATH='/home/kyager/current/code/SciAnalysis/main/'
SciAnalysis_PATH='/home/xf11bm/software/SciAnalysis/'
SciAnaly... |
import os
import numpy as np
import torch
from .cityscapes.data_loader import load_partition_data_cityscapes
from .coco.segmentation.data_loader import load_partition_data_coco_segmentation
from .pascal_voc_augmented.data_loader import load_partition_data_pascal_voc
import logging
def load(args):
return load_syn... |
from tkinter import *
from tkinter.messagebox import *
import os
import shutil
import sys
system = sys.platform
base_dir = sys.path[0]
if system.startswith('win'):
dir_char = '\\'
else:
dir_char = '/'
base_dir += dir_char
def remove(path):
if os.path.exists(path):
if os.path.isdir(path):
... |
#!/usr/bin/env python3
#
# Copyright (C) 2021 Intel Corporation.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common, board_cfg_lib
PRE_LAUNCHED_VMS_TYPE = ["SAFETY_VM", "PRE_RT_VM", "PRE_STD_VM"]
POST_LAU... |
<filename>src/data/arpa/arpa_quality_raw_funcs.py
import logging
import os
import pandas as pd
from sodapy import Socrata
from pathlib import Path
from dotenv import load_dotenv
from src.config import PROJECT_DIR, ARPA_DATA_DIR, ARPA_REG_DATA_ID, ARPA_MEASURES_DATA_ID, PROC_DATA_DIR, ARPA_STATIONS
class ArpaConnect:... |
<filename>config.py<gh_stars>1-10
import configparser
import asyncio
from os.path import exists
# configparser.ConfigParser config
config = None
# asyncio.Task save_task
save_task = None
# str file_name
file_name = ""
# params: str cfg_file_name
# return boolean
def setup_config(cfg_file_name):
global file_name
fil... |
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QMenuBar, QMainWindow, QMenu, QAction
from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtCore import QCoreApplication
from bin.ui_view.utils import load_animation
from bin.ui_view.utils.about import AboutUI
from lib import settings
from bin.ui_view.utils.skinc... |
########## 1.10.1 Classificação ##########
# DecisionTreeClassifier é uma classe capaz de realizar classificação multiclasse em um conjunto de dados.
# Tal como acontece com outros classificadores, DecisionTreeClassifier leva como entrada duas matrizes: uma matriz X, esparsa ou densa, de forma (n_samples, n_f... |
<reponame>LeoRya/py-orbit
import sys
import math
import orbit_mpi
from orbit_mpi import mpi_comm
from orbit_mpi import mpi_datatype
from orbit_mpi import mpi_op
from spacecharge import Grid2D
from orbit_utils import Function
from orbit_utils import SplineCH
from orbit_utils import GaussLegendreIntegrator
from orbit.... |
<filename>Resources/Programs/colorChart.py
# Imports #
import tkinter as tk
# Main #
def main():
tk_Root = tk.Tk()
tk_Root.title("Named Color Chart")
tk_Chart = c_ColorChart(tk_Root, l_Colors)
tk_Root.mainloop()
#-----------Basement------------
# Classes #
class c_ColorChart(tk... |
import time
def definir_prog():
print('\n'+8*'=--='+'\n')
programacao = []
exercicios = []
cond1 = True
while cond1 == True:
programaNome = str(input('Programa: '))
cond2 = True
while cond2 == True:
print(32*'-'+'\n')
exercicioNome = str(i... |
import turtle
import random
import time
# 画樱花的躯干
def tree(branch, t):
time.sleep(0.0008)
if branch > 3:
if 8 <= branch <= 12:
if random.randint(0, 2) == 0:
t.color('snow')
else:
t.color('lightcoral')
t.pensize(branch / 3)
elif... |
from datetime import datetime, timedelta
from unittest.mock import Mock
import pytest
import sqlalchemy as sa
from h_matchers import Any
from h.models.document import ConcurrentUpdateError, create_or_update_document_uri
from h.models.document._document import Document
from h.models.document._uri import DocumentURI
... |
<gh_stars>1-10
#-------------------------------------------------
# ras2raw.py
#
# Copyright (c) 2018, Data PlatForm Center, NIMS
#
# This software is released under the MIT License.
#-------------------------------------------------
# coding: utf-8
#__author__ = "nagao"
__package__ = "M-DaC_XRD/Rigaku_XRD_tools"
__ve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.