text
string
size
int64
token_count
int64
#!/usr/bin/env python3 # file://mkpy3_finder_chart_survey_fits_image_get_v1.py # Kenneth Mighell # SETI Institute # ============================================================================= def mkpy3_finder_chart_survey_fits_image_get_v1( ra_deg=None, dec_deg=None, radius_arcmin=None, survey=No...
4,910
1,775
""" marathontcp.py Author: Steven Gantz Date: 11/22/2016 These two classes are used as custom TCP Servers and its accompanying handler that defines each request. These class are what forward the data from the preset /metrics endpoints in the scaled marathon instances directly to the TCP servers running from this appli...
1,737
505
import pytest import io import random from copy import deepcopy from horcrux import io as hio from horcrux.hrcx_pb2 import StreamBlock from horcrux.sss import Share, Point @pytest.fixture() def hx(): return hio.Horcrux(io.BytesIO()) @pytest.fixture() def share(): return Share(b'0123456789abcdef', 2, Point...
4,600
2,214
#!/usr/bin/env python3 """ A Pandoc filter to create non-code diffs. `add` and `rm` are the classes that can be added to a `Div` or a `Span`. `add` colors the text green, and `rm` colors the text red. For HTML, `add` also underlines the text, and `rm` also strikes out the text. # Example ## `Div` Unchanged portion...
1,817
608
from __future__ import absolute_import, unicode_literals class PaxfulError(Exception): """Base (catch-all) client exception.""" class RequestError(PaxfulError): """Raised when an API request to fails. :ivar message: Error message. :vartype message: str | unicode :ivar url: API endpoint. ...
1,304
390
""" Displays anatomical data from the mesoscope """ from skimage.io import imread from napari import Viewer, gui_qt stack = imread('data/mesoscope/anatomical/volume_zoomed.tif') with gui_qt(): # create an empty viewer viewer = Viewer() # add the image layer = viewer.add_image(stack, name='stack', c...
382
150
from .. import utils from ..config import table class Paper(): def __init__(self): self.collection = table.paper self.conn = utils.mongo.db.get_collection(self.collection) def list(self): pass paper = Paper()
246
78
import discord from discord.ext import commands from utils.database import sqlite, create_tables class Events(commands.Cog): def __init__(self, bot): self.bot = bot self.db = sqlite.Database() def logs(self, guild_id): data = self.db.fetchrow("SELECT * FROM Logging WHERE guild_id=?", (guild_id,))...
1,459
510
# coding: utf-8 # In[2]: import pandas as pd import numpy as np import h5py # In[24]: input_step_size = 50 output_size = 30 sliding_window = False file_name= 'bitcoin2012_2017_50_30_prediction.h5' # In[19]: df = pd.read_csv('data/bitstampUSD_1-min_data_2012-01-01_to_2017-05-31.csv').dropna().tail(1000000) ...
1,679
675
import requests def wip(): print() def apiToDictionary(url, *args): request_string = url response = (requests.get(request_string)) json = response.json() response.close() return dict(json) def main(): # docDict = {"text":"592da8d73b39d3e1f54304fedf7456b1", "markdown":"6a4cccf1c66c780e72...
776
303
# Generated by Django 3.1.12 on 2021-09-18 12:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('elibrary', '0010_auto_20210918_1434'), ] operations = [ migrations.RemoveField( model_name='book', name='tag', ), ...
325
125
#!/usr/bin/python import requests import json import random from sets import Set # # Creates client-side connectivity json # def tapi_client_input(sip_uuids): create_input = { "tapi-connectivity:input": { "end-point" : [ { "local-id": sip_uuids[...
15,933
5,048
""" The outfile structure is the following: diameter density birth lifetime is_captured stuck_to_geometry theta (blank line) Re Ur (blank line) n_trajectory x1 y1 up1 vp1 Uf1 Vf1 gradpx1 gradpy1 ap_x1 ap_y1 af_x1 af_y1 x2 y2 up2 vp2 Uf2 Vf2 gradpx2 gradpy2 ap_x2 ap_y2 af_x2 af_y2 ... xNt yNt upNt vpNt UfNt VfNt gradpx...
4,151
1,578
########## 1.2.3. Formulação matemática de redução de dimensionalidade LDA ########## # Primeiro note que K significa que \mu_k são vetores em \mathcal{R}^d, e eles estão em um subespaço afim H de dimensão no máximo K - 1 (2 pontos estão em uma linha, 3 pontos estão em um plano, etc.) ). # Como mencionado ac...
1,610
501
"""A collection of cards.""" import random from csrv.model import cards from csrv.model.cards import card_info # This import is just to pull in all the card definitions import csrv.model.cards.corp import csrv.model.cards.runner class Deck(object): def __init__(self, identity_name, card_names): self.identity...
3,195
1,069
ans = True while ans: print(""" 1.Add a Student 2.Delete a Student 3.Look Up Student Record 4.Exit/Quit """) ans = input("What would you like to do? ") if ans == "1": print("\nStudent Added") elif ans == "2": print("\n Student Deleted") elif ans == "3": pr...
476
149
from __future__ import print_function, division import sys sys.dont_write_bytecode = True from lib import * @ok def _rseed(): rseed(1) one = list('abcdefghijklm') assert shuffle(one) == ['m', 'h', 'j', 'f', 'a', 'g', 'l', 'd', 'e', 'c', 'i', 'k', 'b'] @ok def _defDict(): d = DefaultDict(lambda: []...
525
236
from setuptools import setup import pyhap.const as pyhap_const PROJECT_NAME = 'HAP-python' URL = 'https://github.com/ikalchev/{}'.format(PROJECT_NAME) PROJECT_URLS = { 'Bug Reports': '{}/issues'.format(URL), 'Documentation': 'http://hap-python.readthedocs.io/en/latest/', 'Source': '{}/tree/master'.format...
734
294
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Scrape the MMWR morbidity tables at http://wonder.cdc.gov/mmwr/mmwrmorb.asp. No processing is done; we simply save the files for potential offline processing. """ # Copyright (c) Los Alamos National Security, LLC and others. from __future__ import print_function, d...
1,291
529
import json import logging import os import traceback from boto3.dynamodb.conditions import Attr, Key import storage from util import lambda_result logger = logging.getLogger('cluster_status') if os.environ.get('DEBUG'): logger.setLevel(logging.DEBUG) def set_cluster_status(event, context): """Set the sta...
6,970
1,905
""" This module implements utilities for labels """ # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # from typing import List, Optional from ote_sdk.entities.label import LabelEntity from ote_sdk.entities.label_schema import LabelSchemaEntity from ote_sdk.entities.scored_label impor...
1,366
433
import unittest from typing import List from dsa.lib.math.nums.three_sum import ThreeSum class ThreeSumTest(unittest.TestCase): def test_case1(self): self.assertEqual([[0, 0, 0]], self.three_sum([0, 0, 0, 0])) self.assertEqual([[-2, 0, 2]], self.three_sum([-2, 0, 0, 2, 2])) self.assertEqu...
614
271
""" Contains functions for plot spectrum action """ import mne import numpy as np import matplotlib.pyplot as plt from meggie.utilities.plotting import color_cycle from meggie.utilities.plotting import create_channel_average_plot from meggie.utilities.channels import average_to_channel_groups from meggie.utilities.c...
4,329
1,382
from .base_runner import BaseRunner from .gym_runner import GymRunner
70
21
""" DataGenerator for CyclesPS Dataset This file use substantial portion of code from the original CNN-PS repository https://github.com/satoshi-ikehata/CNN-PS/ """ import numpy as np import cv2 import os import gc from data.datagenerator import DataGenerator from data.utils import rotate_images from misc.projections ...
7,733
2,546
import os class ExistsError(Exception): pass class KeyInvalidError(Exception): pass def new_func(path, prev): """ 去path路径的文件中,找到前缀为prev的一行数据,获取数据并返回给调用者。 1000,成功 1001,文件不存在 1002,关键字为空 1003,未知错误 ... :return: """ response = {'code': 1000, 'data': None...
2,105
880
import re for _ in range(0, int(input())): matches = re.findall(r'(#(?:[\da-f]{3}){1,2})(?!\w)(?=.*;)', input(), re.IGNORECASE) if matches: print(*matches, sep='\n')
183
78
from talon import Context, Module from .user_settings import get_list_from_csv mod = Module() ctx = Context() mod.list("vocabulary", desc="additional vocabulary words") # Default words that will need to be capitalized (particularly under w2l). # NB. These defaults and those later in this file are ONLY used when # a...
4,429
1,580
import json from bson import ObjectId from datetime import datetime, date class JSONEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, ObjectId): return str(o) if isinstance(o, (datetime, date)): return o.isoformat() return json.JSONEncoder.default(se...
451
146
# Reraising last exception with raise w/o args def f(): try: raise ValueError("val", 3) print("FAIL") raise SystemExit except: raise try: f() print("FAIL") raise SystemExit except ValueError as e: pass # Can reraise only in except block try: raise prin...
390
124
import re def test_version(host): version = host.check_output('git-credential-manager-core --version') pattern = r'[0-9\.]+(\.[0-9\.]+){2}' assert re.search(pattern, version) def test_git_config(host): config = host.check_output('git config --system credential.helper') assert config == '/usr/loc...
494
160
# coding=utf-8 from datetime import datetime, timedelta import dateutil.parser import pytz import urllib TZ = pytz.timezone('Europe/Kiev') def adapt_data(data): data['data']['procuringEntity']['name'] = 'testuser_tender_owner' for x in data['data']['items']: x['unit']['name'] = get_unit_name(x['...
9,605
3,432
#!/usr/bin/env python3 """ Show split layout indicator Usage: ./tiling-indicator.py Suppoused to be used inside waybar or polybar. Config example: Waybar: "custom/ws": { "exec": "python -u $HOME/.config/sway/scripts/tiling-indicator-2.py 2> /dev/null } Polybar: [module/layout] type = custom/script exec...
1,638
671
from typing import Optional import discord import asyncpg from discord.ext import commands from .utils.pagination import create_paginated_embed class Tags(commands.Cog): """Productivity's tag system.""" def __init__(self, bot:commands.Bot) -> None: self.bot = bot self.emoji = "🏷️ " asy...
5,822
1,654
import sys import mapping.organization as org import mapping.contact as contact import mapping.worship as worship import mapping.central as central import mapping.national as national import mapping.codelist as codelist import mapping.vocabulary as vocab import mapping.location as location import mapping.local_admin_...
1,078
380
import numpy as np import os import matplotlib.pyplot as plt from print_values import * from plot_data_all_phonemes import * from plot_data import * # File that contains the data data_npy_file = 'data/PB_data.npy' # Loading data from .npy file data = np.load(data_npy_file, allow_pickle=True) data = np.ndarray.tolist(...
2,815
968
# Generated by Django 2.2.6 on 2020-04-03 20:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('students', '0005_subject'), ] operations = [ migrations.RemoveField( model_name='subject', name='papers', ), ...
459
146
import curses from contextlib import contextmanager from time import sleep from typing import List, Tuple, TYPE_CHECKING from .actions import Action from .properties import Property if TYPE_CHECKING: from .object import Object class World: class __World: def __init__(self, fps: int, render: bool = T...
4,027
1,116
import factory from projects.tests.factories.project import ProjectFactory class DeckFactory(factory.DjangoModelFactory): class Meta: model = "projects.Deck" project = factory.SubFactory(ProjectFactory)
223
61
DATASET_LIST = [ { "name": "tree_equity_score", "module_dir": "tree_equity_score", "class_name": "TreeEquityScoreETL", }, { "name": "census_acs", "module_dir": "census_acs", "class_name": "CensusACSETL", }, { "name": "ejscreen", "module...
1,012
389
from .group import Group from .star import (STAR_PARAMETERS_NAMES, GalacticDiskType, Star)
129
38
# Generated by Django 3.0.8 on 2020-10-24 01:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cfc_app', '0004_auto_20201024_0133'), ] operations = [ migrations.AlterField( model_name='hash', name='fob_method', ...
1,064
331
from e2e import DockerTest class TestGet(DockerTest): def test_get_current_prints_currently_set_committers(self): self.guet_init() self.git_init() self.guet_add('initials1', 'name1', 'email1') self.guet_add('initials2', 'name2', 'email2') self.guet_start() self.guet...
1,955
677
import numpy as np import pandas as pd import h5py # docker run -it kagglegym # python # >>> import kagglegym # >>> kagglegym.test() train = pd.read_hdf("../data/train.h5")
175
67
# 50. Write a Python program to print without newline or space. # Question: # Input: # Output: # Solution: https://www.w3resource.com/python-exercises/python-basic-exercise-50.php # Ideas: """ 1. Badly phrased qquestion. Question should be using for loop to generate 10 off "*" and print them in one line. """ # St...
442
178
from django.db import models import django_filters from django_filters.rest_framework import FilterSet REGISTERED_SERVICES = ['PACS'] class Service(models.Model): identifier = models.CharField(max_length=20, unique=True) def __str__(self): return self.identifier class ServiceFile(models.Model): ...
1,559
463
#!/usr/bin/env python """ """ from xml.etree.ElementTree import Element import xml.etree.ElementTree as etree import xml.dom.minidom import re import sys import getopt import os from time import gmtime, strftime from nipype import config, logging from nighres.lesion_tool.lesion_pipeline import Lesion_extractor d...
1,813
599
# ********************************************************************** # Copyright (C) 2020 Johns Hopkins University Applied Physics Laboratory # # All Rights Reserved. # For any other permission, please contact the Legal Office at JHU/APL. # # Licensed under the Apache License, Version 2.0 (the "License"); # y...
2,208
648
# Constants DEFAULT_TITLE = 'Khan Academy' HOME_DOMAIN = 'www.khanacademy.org'
80
35
# ------------------------------------------------------------------------------ # Copyright (c) Abdurasul Rakhimov 24.2.2021. # ------------------------------------------------------------------------------ import numpy as np from overrides import overrides class Dataset: def __init__(self, name, dataset_path)...
1,950
584
# Generated by configen, do not edit. # See https://github.com/facebookresearch/hydra/tree/master/tools/configen # fmt: off # isort:skip_file # flake8: noqa from dataclasses import dataclass from typing import * from omegaconf import MISSING @dataclass class UserConf: _target_: str = "configen.samples.user.User...
369
132
import time import numpy as np from freenect import sync_get_depth as get_depth, sync_get_video as get_video class Kinect(object): """Offers access to rgb and depth from the real Kinect""" def __init__(self): pass def get_frame(self, record=False): # Get a fresh frame (d...
733
240
#!/usr/bin/env python import flask import requests import lxml.html import logging app = flask.Flask(__name__) LOGGER = logging.getLogger(__name__) HN_BASE_URL = 'https://news.ycombinator.com/' def has_virus(url): if not url.startswith('http://') and not url.startswith('https://'): return True s = re...
1,262
441
# Functions for project: NormativeNeuroDev_Longitudinal # Linden Parkes, 2019 # lindenmp@seas.upenn.edu from IPython.display import clear_output import numpy as np import scipy as sp from scipy import stats import pandas as pd from statsmodels.stats import multitest def get_cmap(which_type = 'qual1', num_classes = 8...
7,134
2,977
from sympy.functions import sqrt, sign, root from sympy.core import S, Wild, sympify, Mul, Add, Expr from sympy.core.function import expand_multinomial, expand_mul from sympy.core.symbol import Dummy from sympy.polys import Poly, PolynomialError from sympy.core.function import count_ops def _mexpand(expr): return ...
15,808
5,730
import datetime import os import shutil from django.conf import settings from django.contrib.auth import get_user_model from django.core.cache import cache from django.db import transaction, IntegrityError from django.db.models import Q, F from django.http import FileResponse from django.utils.encoding import escape_u...
17,074
5,597
#!/bin/env python3 import sys import argparse import configparser import docx from docx import Document from docx.shared import Pt, Inches from docx.enum.dml import MSO_THEME_COLOR_INDEX from docx.enum.section import WD_ORIENT, WD_SECTION from datetime import datetime from mediumroast.api.high_level import Auth as au...
21,175
6,874
import pprint import logging import datetime from selenium import webdriver import hubcheck.conf # block websites that make linkcheck slow # these are usually blocked by the workspace firewall # mozillalabs comes from using a nightly version of firefox browser # many of the others are from login authentication site...
17,388
4,725
from topdown import * from caty.jsontools import stdjson from caty.jsontools import xjson from caty.jsontools.selector import stm as default_factory from caty.core.spectypes import UNDEFINED from caty.core.language import name_token class JSONPathSelectorParser(Parser): def __init__(self, empty_when_error=False, ...
4,278
1,320
# -*- coding: utf8 -*- import datetime import mock import os import unittest import webapp2 from google.appengine.ext import testbed, deferred from google.appengine.api import queueinfo from . import models from .handler import application from .wrapper import defer TESTCONFIG_DIR = os.path.join( os.path.dirnam...
7,057
2,349
from django.db import models class Category(models.Model): """Category model.""" name = models.CharField(max_length=100, unique=True) class Meta: ordering = ('name',) def __str__(self): return self.name
240
75
"""MIT License Copyright (c) 2018 rongjiewang 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, publish, di...
4,023
1,251
""" This module provides the interactive Python console. """ import sys import traceback from browser import window class Console: """ A class providing a console widget. The constructor accepts a domnode which should be a textarea and it takes it over and turns it into a python inter...
10,820
3,013
""" Test setting a breakpoint on an overloaded function by name. """ import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestBreakpointOnOverload(TestBase): mydir = TestBase.compute_mydir(__file__) def check_breakpoin...
1,333
405
from tkinter import * # ---------------------------- CONSTANTS ------------------------------- # PINK = "#e2979c" RED = "#e7305b" GREEN = "#9bdeac" YELLOW = "#f7f5dd" FONT_NAME = "Courier" WORK_MIN = 25 SHORT_BREAK_MIN = 5 LONG_BREAK_MIN = 20 is_counting = False reps = 0 timer = None # ---------------------------- ...
2,611
998
# tests for narps code # - currently these are all just smoke tests import pytest import os import pandas from narps import Narps from AnalyzeMaps import mk_overlap_maps,\ mk_range_maps, mk_std_maps,\ mk_correlation_maps_unthresh, analyze_clusters,\ plot_distance_from_mean, get_thresh_similarity from MetaA...
1,983
705
""" Convenience functions for plotting DTCWT-related objects. """ from __future__ import absolute_import import numpy as np from matplotlib.pyplot import * __all__ = ( 'overlay_quiver', ) def overlay_quiver(image, vectorField, level, offset): """Overlays nicely coloured quiver plot of complex coefficients ...
2,529
892
import grokcore.component as grok from grokcore.component.interfaces import IContext import grokcore.view as view from zope.interface import Interface from grokcore.registries.tests.registries.interfaces import IExample class MyExample(grok.GlobalUtility): grok.name('global') grok.implements(IExample) class...
428
138
from graphdata.shared.shared1D import AuxPlotLabelLL1D from graphdata.shared.shared1D import ProcessData1D from graphdata.shared.shared1D import LoadData1D from graphdata.shared.figsizes import LogLogSize from graphdata.shared.shared import ExtendDictionary from graphdata.shared.shared import ProcessComplex from gr...
2,481
794
import datetime import json import requests import pytest import random from tests.suites.test_payment import TestPayment from tests.utilities.settings import get_settings, get_test_data, setup_access_data @pytest.mark.incremental @pytest.mark.parametrize('login_session', setup_access_data('PREMIUM', ['BCSC']), indi...
5,387
1,529
# -*- 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 from alibabacloud_d...
3,960
1,211
from __future__ import annotations import argparse import pickle import numpy as np import json import logging import math import glob import random import os import sys import datetime import time from functools import partial from pathlib import Path from collections import defaultdict from shutil import copyfile f...
16,677
5,342
prim = int(input('primeiro termo: ')) raz = int(input('razao: ')) dec = prim + (10 - 1) * raz for c in range(prim, dec + raz, raz): print(' {}'.format(c,), end=' ->') print('acabou')
190
81
""" A script that partitions the dataset for transferability scenarios """ # basics import numpy as np from PIL import Image # torch... import torch # custom libs import utils # ------------------------------------------------------------------------------ # Misc. functions # ---------------------------------...
8,215
2,653
# -*- coding: utf-8 -*- """ Created on Mon Aug 10 17:49:07 2020 @author: Amir """ import email import imaplib from email.header import decode_header import re def gmail_ckeck(email_address, password): mail = imaplib.IMAP4_SSL('imap.gmail.com') (retcode, capabilities) = mail.login(email_addres...
2,878
771
# coding=utf-8 import numpy as np import imageio from gym import spaces import tkinter as tk from PIL import Image, ImageTk import matplotlib.pyplot as plt import time CELL, BLOCK, AGENT_GOAL, OPPONENT_GOAL, AGENT, OPPONENT = range(6) WIN, LOSE = 5, -5 UP, RIGHT, DOWN, LEFT, HOLD = range(5) UNIT = 40 class Soccer...
6,637
2,625
# Originated from https://github.com/amdegroot/ssd.pytorch from .augmentations import SSDAugmentation
103
35
""" Basic moderation utilities for Birb. """ from .staff import CheckMods from .actions import ModActions def setup(bot): bot.add_cog(CheckMods()) bot.add_cog(ModActions())
184
66
import os API_KEY = os.getenv('API_KEY') API_SECRET = os.getenv('API_SECRET') ACCESS_TOKEN = os.getenv('ACCESS_TOKEN') ACCESS_TOKEN_SECRET = os.getenv('ACCESS_TOKEN_SECRET') POSTGRES_PASSWORD = os.getenv('POSTGRES_PASSWORD')
227
106
class FrontEnd(object): def __init__(self): self.theme = "slate" self.logo = "" # path from static/ self.app_name = "Open Prose Metrics" self.report_title = "Results" self.theme_cdn = self.bootswatch_url(self.theme) def bootswatch_url(self, label): if labe...
605
199
# -*- coding: utf-8 -*- """ test_jid ---------------------------------- Tests for `vexmpp.xmpp.jid` module. """ import unittest from vexmpp.jid import Jid, _parse, _prep, InvalidJidError, internJid class TestJidParsing(unittest.TestCase): def setUp(self): pass def test_basic(self): self.as...
7,140
2,174
# -*- coding: utf-8 -*- """ .. module:: dbu - context :platform: Unix, Windows :synopsis: Contexto Principal por defecto .. moduleauthor:: Diego Gonzalez <dgonzalez.jim@gmail.com> """ from . import configuration from . import models def load_context(request): """ Load Context Description ...
745
256
from tests.trainer.generic import std_trainer_input_1 from knodle.trainer.multi_trainer import MultiTrainer def test_auto_train(std_trainer_input_1): ( model, model_input_x, rule_matches_z, mapping_rules_labels_t, y_labels ) = std_trainer_input_1 trainers = ["majority", "snorkel"...
689
246
from django.db import models from django.contrib.auth.models import User class City(models.Model): user = models.ManyToManyField(User, default=None,) name = models.CharField(max_length=255, verbose_name="Nome da cidade") def __str__(self): return self.name class Meta: verbose_name = "...
368
115
import numpy as np from numba import jit @jit def cholesky(in_arr, out_arr, n): np.copyto(out_arr, np.linalg.cholesky(in_arr))
133
60
# -*- coding: utf-8 -*- """ doxieapi ~~~~~~~~ A Python library for the developer API of the Doxie Go Wi-Fi document scanner. """ from .api import DoxieScanner __all__ = ['DoxieScanner']
191
75
from pathlib import Path from django.core.management.base import BaseCommand from wagtail.core.models import Page, Site, Locale from django.core.files.images import ImageFile from wagtail.images.models import Image from wagtail_localize.models import Translation from wagtail_localize.views.submit_translations import Tr...
18,447
5,552
import numpy as np import libs.contact_inhibition_lib as lib #library for simulation routines import libs.data as data import libs.plot as vplt #plotting library from structure.global_constants import * import structure.initialisation as init from structure.cell import Tissue, BasicSpringForceNoGrowth import matplotlib...
2,968
1,176
from django.contrib import admin from .models import Invoice # Register your models here. admin.site.register(Invoice)
120
33
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server.models.name_and_value import NameAndValue # noqa: F401,E501 from tapi_server.models.operational_state...
17,920
5,314
from urllib.parse import urljoin from appdirs import user_data_dir from notebook.notebookapp import NotebookApp from idom.config import IDOM_WED_MODULES_DIR from tornado.web import StaticFileHandler from tornado.web import Application IDOM_WED_MODULES_DIR.current = user_data_dir("idom-jupyter", "idom-team") def _l...
901
297
## common class for only dobot with cam import gym from gym import utils from glob import glob from dobot_gym.utils.dobot_controller import DobotController from gym.spaces import MultiDiscrete class DobotRealEnv(gym.Env, utils.EzPickle): def __init__(self): super().__init__() # Find the port on ...
1,033
331
######################### #Author: Sam Higginbotham ######################## from WMCore.Configuration import Configuration config = Configuration() #name='Pt11to30' config.section_("General") config.General.requestName = 'PCC_Run2017E_Corrections' config.General.workArea = 'RawPCCZeroBias2017' config.section_("JobT...
1,609
734
import cv2 import os import glob import numpy as np from operator import itemgetter # import matplotlib.pyplot as plt import math import scipy.stats as stats def main(): video_dir = './UCF-101' #./testdata result_dir = './UCF101-OF' #test-image loaddata(video_dir = video_dir, depth = 24, dest_forder=result_dir) de...
6,819
2,898
"""Metrics to assess performance on ite prediction task.""" from typing import Optional import numpy as np import pandas as pd def expected_response(y: np.ndarray, w: np.ndarray, policy: np.ndarray, mu: Optional[np.ndarray]=None, ps: Optional[np.ndarray]=None) -> float: """Estimate expected...
5,547
1,816
from random import randint class Dataset: def get_mock_scattered_dataset(self, numberOf, x_upper_bound, y_upper_bound): """ Mock 2D dataset with scattered data points. """ points = [] for i in range(numberOf): point = [randint(0,x_upper_bound), randint(0,y_upper_bound), 'blac...
1,133
350
from openpyxl import load_workbook def import_msmt_college_registry_xlsx(path, sheet_name): """ Import XLSX from https://regvssp.msmt.cz/registrvssp/cvslist.aspx (list of colleges and faculties). Parameters: path -- path to XLSX file sheet_name -- "ExportVS" or "ExportFakulty" """...
623
220
import unittest import numpy as np from mtrack.graphs import G1 from mtrack.evaluation.matching_graph import MatchingGraph from mtrack.evaluation.voxel_skeleton import VoxelSkeleton from comatch import match_components import json test_data_dir = "./data" class ParallelLinesSetUp(unittest.TestCase): def setUp(se...
16,358
5,473
""" Functions specifically for working with QC/DQRs from the Atmospheric Radiation Measurement Program (ARM). """ import datetime as dt import numpy as np import requests from act.config import DEFAULT_DATASTREAM_NAME def add_dqr_to_qc( obj, variable=None, assessment='incorrect,suspect', exclude=No...
5,706
1,677
import allure from common.constans import PrintedDress, PrintedSummerDress, Colors @allure.step('Product Card') def test_open_product_card(app, login): """ 1. Open page 2. Choose product 3. Open product card 4. Check product info """ app.page.select_woman_catego...
1,458
481