text
string
size
int64
token_count
int64
import ipyvuetify as v class Message(v.Container): def __init__(self, message): self.message = v.Alert( children=[f'{message}...'], class_='primary--text' ) super().__init__( children=[ v.Row( children=[ ...
905
211
import argparse import datetime def get_last_elapsed_tax_year() -> int: now = datetime.datetime.now() if now.date() >= datetime.date(now.year, 4, 6): return now.year - 1 else: return now.year - 2 def create_parser() -> argparse.ArgumentParser: # Schwab transactions # Montly GBP/U...
1,946
604
import pandas as pd from pydts.config import * DATASETS_DIR = os.path.join(os.path.dirname((os.path.dirname(__file__))), 'datasets') def load_LOS_simulated_data(): os.path.join(os.path.dirname(__file__)) return pd.read_csv(os.path.join(DATASETS_DIR, 'LOS_simulated_data.csv'))
286
110
# Generated by Django 3.1.1 on 2020-09-06 19:33 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('busker', '0012_auto_20200905_2042'), ] operations = [ migrations.AlterModelOptions( name='downl...
621
213
"""Submit a batch task to livy server.""" import argparse import datetime import importlib import json import logging import re import typing import livy import livy.cli.config import livy.cli.logging logger = logging.getLogger(__name__) class PreSubmitArguments(argparse.Namespace): """Typed :py:class:`~argpars...
12,799
4,030
"""Minimal setup file for learn project.""" import pathlib from setuptools import setup, find_packages # The directory containing this file HERE = pathlib.Path(__file__).parent # The text of the README file README = (HERE / "README.md").read_text() setup( name = 'premoji', version = '0.1.4', descriptio...
1,283
407
# Author: Keith Williams # Date: 21/09/2017 from time import strftime # This line prints the current date and time to the console in the format 01-10-2017 13:15:30. # strftime must be imported from the time package before being used. print(strftime("%d-%m-%Y %H:%M:%S"))
272
102
import os filepath = 'list.txt' with open(filepath) as fp: while line := fp.readline(): line = line.strip() os.system(f'git clone {line}')
160
58
import argparse import os import sys parser = argparse.ArgumentParser(description="Run commands") parser.add_argument('-w', '--num-workers', default=1, type=int, help="Number of workers") parser.add_argument('-r', '--remotes', default=None, help='The address of pre-existing VNC ...
2,453
898
""" Class that holds the results: used for evaluating model performance on activity cliff compounds Derek van Tilborg, Eindhoven University of Technology, March 2022 """ import os import numpy as np from MoleculeACE.benchmark.utils.const import Algorithms from .metrics import calc_rmse, calc_q2f3 class Results: ...
8,116
2,548
from checkout.orders.order_service import Order, AuthorisationRequest
70
16
from .hiisi import HiisiHDF from .odim import OdimPVOL, OdimCOMP __version__ = "0.0.6"
87
38
from pathlib import Path import weakref import warnings from typing import Union, Optional, List from .merger import select_merge_algorithm from .constants import DIR_HANGAR from .remotes import Remotes from .context import Environments from .diagnostics import ecosystem, integrity from .records import heads, parsing,...
34,527
8,567
''' Created on Apr 16, 2014 @author: jtaghiyar ''' import os import subprocess as sub from plumber import Plumber from job_manager import LocalJobManager from workflow_manager import WorkFlow from helpers import trim, make_dir, export_to_environ class ComponentAbstract(object): """ component template....
10,731
2,893
from pathlib import Path from re import sub from shutil import rmtree from unittest import TestCase from dotify import Dotify, models class BaseNameResolverMixin(object): @classmethod def get_download_basename(cls, obj): if isinstance(obj, models.Track): return cls.get_download_basename_t...
3,047
945
# imo.py - functions for handling IMO numbers # coding: utf-8 # # Copyright (C) 2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
2,724
822
"""yodl! yodl provides a class decorator to build django models from YAML configuration files """ from .decorators import yodl from .io import yodlify __author__ = "Bruno Lange" __email__ = "blangeram@gmail.com" __license__ = "MIT" __all__ = ["yodl", "yodlify"]
265
101
""" Usage: hermes install [-dsvV] <pkg>... hermes -h | --help hermes --version Options: -d, --depends Require dependency installation -h, --help Display usage and options -s, --check-sigs Verify package GPG signatures -v, --verify Verify package...
6,010
1,856
import random import requests from FIREX.utils import admin_cmd, edit_or_reply, sudo_cmd from userbot.cmdhelp import CmdHelp LOVESTR = [ "The best and most beautiful things in this world cannot be seen or even heard, but must be felt with the heart.", "You know you're in love when you can't fall asleep becau...
26,047
7,819
from . import cmdline
22
7
############ # Standard # ############ import math ############### # Third Party # ############### import ophyd import pytest ########## # Module # ########## from detrot import ConeJoint, AngledJoint, StandPoint, Point from conftest import PseudoMotor @pytest.fixture(scope='function') def pseudo_cone(): angled...
4,089
1,555
import numpy as np from urban_AD_env.utils import rotated_rectangles_intersect def test_rotated_rectangles_intersect(): assert rotated_rectangles_intersect(([12.86076812, 28.60182391], 5.0, 2.0, -0.4675779906495494), ([9.67753944, 28.90585412], 5.0, 2.0, -0.341701936447320...
656
346
"""Functions that test server functions.""" import pytest from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound from datetime import datetime from learning_journal.models import Entry def test_list_view_returns_list_of_entries_in_dict(dummy_request): """Test for the list_view function.""" from learn...
3,758
1,143
""" Hvad-specific exceptions Part of hvad public API. """ __all__ = ('WrongManager', ) class WrongManager(Exception): """ Raised when attempting to introspect translated fields from shared models without going through hvad. The most likely cause for this being accessing translated fields from ...
977
265
""" ==================================================================== Classification of P300 datasets from MOABB ==================================================================== It demonstrates the QuantumClassifierWithDefaultRiemannianPipeline(). This pipeline uses Riemannian Geometry, Tangent Space and a quan...
4,858
1,419
from array import * MyArray = [None] * 20 MyArray1 = [None] * 20 i = 0 while(i < 20): MyArray[i] = i + 1 i = i + 1 j = 0 i = 19 while(j < 20): MyArray1[j] = MyArray[i] j = j + 1 i = i - 1 i = 0 while(i < 20): print(MyArray1[i],end = " ") i = i + 1
281
154
from aiohttp import ClientSession, FormData from Findclone import __version__ from .models import Account, Profiles, Histories, get_builder from .utils import random_string, paint_boxes from .exceptions import a_error_handler, FindcloneError from io import BufferedReader, BytesIO class FindcloneAsync: """async f...
6,262
1,624
from channels.generic.websocket import JsonWebsocketConsumer from camps.models import Camp from .models import ( Event, EventInstance, Favorite, EventLocation, EventType, EventTrack, Speaker ) class ScheduleConsumer(JsonWebsocketConsumer): groups = ['schedule_users'] def receive(...
3,764
963
#!/usr/bin/env python3 # Standalone script which rebuilds the history of maintainership # # Copyright (C) 2015 Intel Corporation # Author: Anibal Limon <anibal.limon@linux.intel.com> # # Licensed under the MIT license, see COPYING.MIT for details import sys import os.path import optparse import logging sys.path.inse...
9,985
2,889
__author__ = "Johannes Köster" __copyright__ = "Copyright 2015-2019, Johannes Köster" __email__ = "koester@jimmy.harvard.edu" __license__ = "MIT" import os import shutil import signal import marshal import pickle import json import time from base64 import urlsafe_b64encode, b64encode from functools import lru_cache, p...
16,297
4,926
""" Author: Matt Hanson Created: 23/11/2020 11:06 AM """ import ksl_env # add basgra nz functions ksl_env.add_basgra_nz_path() from supporting_functions.plotting import plot_multiple_results from check_basgra_python.support_for_tests import establish_org_input, get_lincoln_broadfield, get_woodward_weather, _clean_h...
1,418
582
import urllib import urllib2 url = "http://ctfq.sweetduet.info:10080/~q6/" def main(): for i in range(1, 100): data = { "id": "admin' AND (SELECT LENGTH(pass) FROM user WHERE id = 'admin') = {counter} --".format(counter=i), "pass": "", } print (data) data1 =...
636
225
# created by Matt Weeden # 7/8/16 import classes as c def printIntro(): print 'Welcome to the\n' print '''__/\\\\\\\\\\\\\\\\\\\\\\\\_________________________________________________\ __________________________\n _\\/\\\\\\////////\\\\\\___________________________________\ __________________________________...
2,100
778
from __future__ import annotations from abc import ABCMeta, abstractmethod from typing import Dict, Any, List class IRecord(metaclass=ABCMeta): @abstractmethod def to_dict(self) -> Dict[Any, Any]: ... @abstractmethod def to_json(self) -> str: ... @abstractmethod def to_list...
352
112
from django.utils.http import urlquote from jingo import register import jinja2 from access import acl @register.function @jinja2.contextfunction def check_contrib_stats_perms(context, addon): request = context['request'] if addon.has_author(request.amo_user) or acl.action_allowed(request, 'RevenueS...
822
254
import telnetlib import time def send_command_telnetlib(ipaddress, username, password, enable_pass, command): t = telnetlib.Telnet("192.168.100.1") t.read_until(b"Username:") t.write(username.encode("ascii") + b"\n") t.read_until(b"Password:") t.write(password.encode("ascii") + b"\n") t.writ...
593
247
# Generated by Django 2.1.5 on 2019-01-27 22:45 from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('fullstack', '0003_auto_20190127_2223'), ] operations = [ migrations.CreateModel( na...
837
272
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import platform import numpy as np import time import os import torch import torch.backends.cudnn as cudnn import _init_paths from config import cfg from config import update_config from utils...
8,765
3,131
from social_tornado.models import TornadoStorage from skyportal.models import DBSession, ACL, Role, User, Token, Group from skyportal.enum_types import LISTENER_CLASSES, sqla_enum_types from baselayer.app.env import load_env all_acl_ids = [ 'Become user', 'Comment', 'Annotate', 'Manage users', 'Man...
4,323
1,427
from django.views.generic import TemplateView from ipware import get_client_ip from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth import update_session_auth_hash from django.conf import settings from .forms ...
7,909
2,535
""" Use this script to evaluate your model. It stores metrics in the file `scores.txt`. Input: predictions (str): filepath. Should be a file that matches the submission format; groundtruths (str): filepath. Should be an annotation file. Usage: evaluate_classification.py <groundtruths> <predictions> ...
1,568
545
class Solution: def generate(self, numRows: int) -> List[List[int]]: result = [[1]] for i in range(1, numRows): temp = [1] for j in range(1, i): temp.append(result[-1][j-1] + result[-1][j]) temp.append(1) result.append(temp...
353
107
# -*- coding: utf-8 -*- """A simple plugin that makes it possible to search your Obsidian vault. This extension makes it possible to search your Obsidian vault. For more information please visit https://github.com/j0rd1smit/obsidian-albert-plugin. Synopsis: ob <query>""" from albert import * import os from time imp...
3,777
1,334
class responder(): def resp_hello(): hello=[] hello.append('Hey there "{usr}"! how\'s it going?') hello.append('Hi "{usr}" :grinning:') hello.append('Hello "{usr}", whats up?') hello.append('Hey "{usr}" :wave:,\nHow are you doing?') hello.append('Hi "{usr}"!\nI\'m StrugBot, and I\'m super happy to be here!...
673
297
import numpy as np import binascii example = False hexval = "020D74FCE27E600A78020200DC298F1070401C8EF1F21A4D6394F9F48F4C1C00E3003500C74602F0080B1720298C400B7002540095003DC00F601B98806351003D004F66011148039450025C00B2007024717AFB5FBC11A7E73AF60F660094E5793A4E811C0123CECED79104ECED791380069D2522B96A53A81286B18263F75A3...
5,433
2,668
import expressions import abc import copy class Instruction(abc.ABC): @abc.abstractmethod def __init__(): ... @abc.abstractmethod def wykonaj(self, zmienne) -> dict[str, int]: '''Evaluate the instruction''' ... @abc.abstractmethod def __str__(self): ... class If(Instruction...
2,422
807
""" TODO """ from collections import Counter import simplejson import yaml import flask from sheepdog.errors import ( UserError, ) def oph_raise_for_duplicates(object_pairs): """ Given an list of ordered pairs, contstruct a dict as with the normal JSON ``object_pairs_hook``, but raise an exception ...
2,228
644
from pathlib import Path def get_rockets_frames(): """Init rocket animation frames.""" frames_files = ['rocket_frame_1.txt', 'rocket_frame_2.txt'] frames = [(Path(__file__).resolve().parent / frame_file_name).read_text() for frame_file_name in frames_files] return tuple(frames)
298
97
from JuHPLC.Views.NewChromatogram import * from JuHPLC.SerialCommunication.MicroControllerManager import MicroControllerManager # Create your views here. def index(request): chromatograms = Chromatogram.objects.all().order_by("-Datetime") for i in chromatograms: i.data = HplcData.objects.filter(Chrom...
1,128
304
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed un...
3,829
1,055
"""Django models for the example app.""" from django.db import models from wikidata.client import Client # type: ignore LANGS = ["fr", "en"] # ordered list of langages to check on wikidata class WikiDataModel(models.Model): """A django model to represent something available on wikidata.""" name = models...
910
291
#!/usr/bin/python3 import cv2 if __name__ == '__main__': cv2.SIFT_create()
79
36
import io import pytest import pytorch_pfn_extras as ppe from pytorch_pfn_extras.training.extensions import _ipython_module_available from pytorch_pfn_extras.training.extensions.log_report import _pandas_available @pytest.mark.skipif( not _ipython_module_available or not _pandas_available, reason="print rep...
1,096
352
#!/usr/bin/env python3 # Copyright 2017 The Imaging Source Europe GmbH # # 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 a...
2,012
582
from .linear_torch import TorchGradientDescentAutogradRegression import torch, math, random class stochasticGradientDescent(TorchGradientDescentAutogradRegression): def __init__(self, X, Y, alpha, **kwargs): super(stochasticGradientDescent, self).__init__(X, Y, alpha, **kwargs) try: h ...
2,260
720
import pytest import ast from pytest_mock import MockerFixture from pystratis.api.node import Node from pystratis.api.node.responsemodels import * from pystratis.api import FullNodeState, FeatureInitializationState, LogRule from pystratis.core.networks import StraxMain, CirrusMain @pytest.mark.parametrize('network', ...
11,798
3,975
import numpy as np def get_conf_thresholded(conf, thresh_log_conf, dtype_np): """Normalizes a confidence score to (0..1). Args: conf (float): Unnormalized confidence. dtype_np (type): Desired return type. Returns: confidence (np.float32): Norma...
1,719
648
from fastai.vision import * from fastai.metrics import error_rate # First model using pet images ########################### ####### Get dataset ####### ########################### # Batch size bs = 64 # help(untar_data) # print(URLs.PETS) # URLs.PETS = https://s3.amazonaws.com/fast-ai-imageclas/oxford-iiit-pet #...
3,028
1,075
""" Copyright (c) 2017 Jeffrey N. Magee https://github.com/jeffmer/micropython-ili9341 Jan 6, 2018 MIT License https://github.com/jeffmer/micropython-ili9341/blob/master/LICENSE """ # This is an adapted version of the ILI934X driver as below. # It works with multiple fonts and also works with the esp32 H/W SPI implem...
10,343
3,940
import subprocess import os import sys import datetime import random from configparser import ConfigParser from datetime import datetime import s03_heteroplasmy_likelihood, s04_sort_candidates, s05_select_sites, s06_location_conservation import multiprocessing def check_exist(cmd, thing): try: subprocess.c...
7,391
2,517
from datetime import datetime from typing import Any, List import json import tempfile from airflow.models.baseoperator import BaseOperator from airflow.providers.mongo.hooks.mongo import MongoHook import pandas from airflow.providers.siasg.dw.hooks.dw import DWSIASGHook class DWSIASGRelatorioParaMongoOperator(Base...
3,700
1,264
#!/usr/bin/env python3 from datetime import datetime import json import os import re import argparse import csv import copy import sys import gzip strptime = datetime.strptime class attriObject: """Class object for attribute parser.""" def __init__(self, string): self.value = re.split(":", string) ...
5,422
1,470
#!/usr/bin/python3 import sys import glob import os import re def main(): directory = sys.argv[1] builddir = sys.argv[2] extra_module = "" if(len(sys.argv) > 3): extra_module = sys.argv[3] projectModules = {} for filename in glob.glob(os.path.join(directory, '*.bsv')): m = re.m...
2,143
635
"""Beam search decoder. This module implements the beam search algorithm for autoregressive decoders. As any autoregressive decoder, this decoder works dynamically, which means it uses the ``tf.while_loop`` function conditioned on both maximum output length and list of finished hypotheses. The beam search decoder us...
23,756
6,617
from setuptools import setup, find_packages with open('README.md', "r") as f: readme = f.read() with open('LICENSE') as f: license_content = f.read() setup( name='cdeid', version='0.1.2', author='Leibo Liu', author_email='liuleibo@gmail.com', description='A Customized De-identification fr...
926
328
"""Ingest USGS Bird Banding Laboratory data.""" from pathlib import Path import pandas as pd from . import db, util DATASET_ID = 'bbl' RAW_DIR = Path('data') / 'raw' / DATASET_ID BANDING = RAW_DIR / 'Banding' ENCOUNTERS = RAW_DIR / 'Encounters' RECAPTURES = RAW_DIR / 'Recaptures' SPECIES = RAW_DIR / 'species.html' ...
5,821
2,315
""" Module utils.cmdline -------------------- Created on 2019.11.06 :author: Felix Soubelet (felix.soubelet@cern.ch) Utility script to help run commands and access the commandline. """ import errno import os import signal import subprocess from typing import Mapping, Optional, Tuple from loguru import logger from...
5,212
1,339
from random import randint margin = 5 def setup(): size(400, 600) this.surface.setTitle("Re-Enactment A. Michael Noll") noLoop() def draw(): background(235, 215, 182) strokeWeight(2) x1 = randint(margin, width - margin) y1 = randint(margin, height - margin) for _ in range(50): ...
498
200
# Generated by Django 2.1.10 on 2019-07-19 12:42 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('cms_content', '0003_auto_20190719_1232'), ] operations ...
992
317
# -*- coding: utf-8 -*- """ ============================================================================== created : 02/08/2021 Last update: 02/08/2021 Developer: Yishan Tsai Lite Version 1 @Yishan08032019 Filename: celeryconfig.py Description: about celery configuration ========================================...
3,174
1,153
from direct.directnotify import DirectNotifyGlobal from direct.fsm import ClassicFSM, State from direct.fsm import State from pandac.PandaModules import * from toontown.battle import BattlePlace from toontown.building import Elevator from toontown.coghq import CogHQExterior from toontown.dna.DNAParser import loadDNAFil...
1,652
527
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('convos', '0004_auto_20150511_0945'), ] operations = [ migrations.AddField( model_name='convothread', ...
457
151
#!/usr/bin/env python import sys from itertools import chain from common import open_example_serial_interface from coax import read_feature_ids, parse_features, Feature, LoadAddressCounterHi, LoadAddressCounterLo, WriteData, EABWriteAlternate, EABLoadMask def get_features(interface): commands = read_feature_ids...
3,704
2,125
# coding=utf-8 from Base.DevicesList import devicesList as dl from Base.Common import Common class DevicesConnect: def deviceConnect(self): commands = [] data = dl().get_Tv_IP() for IP in data: cmd = "adb connect %s" %(IP) commands.append(cmd) Common().loop...
404
125
import string from ...errors import SimValueError from . import MemoryMixin class HexDumperMixin(MemoryMixin): def hex_dump(self, start, size, word_size=4, words_per_row=4, endianness="Iend_BE", symbolic_char='?', unprintable_char='.', solve=False, extra_constraints=None, inspe...
3,692
949
# Copyright 2011 The scales Authors. # # 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 w...
4,782
1,637
"""Implement a weighted graph.""" class Graph(object): """Structure for values in a weighted graph.""" def __init__(self): """Create a graph with no values.""" self.graph = {} def nodes(self): """Get all nodes in the graph to display in list form.""" return list(self.grap...
5,911
1,659
class BaseCommand: def __init__(self, table_name): self.table_name = table_name self._can_add = True @staticmethod def _convert_values(values): converted = [SQLType.convert(v) for v in values] return converted def check_intersection(self, other): return self.w...
376
116
import click from ..cli import with_context @click.command('clean', short_help="Cleans a book' output directories") @with_context def clean_command(ctx=None): pass
170
52
#MenuTitle: Steal Kerning Groups from Font """Copy kerning groups from one font to another.""" from __future__ import print_function import vanilla class GroupsCopy(object): """GUI for copying kerning groups from one font to another""" def __init__(self): self.w = vanilla.FloatingWindow((400, 70), "Steal kerning ...
3,818
1,667
# extdiff.py - external diff program support for mercurial # # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to allow external programs to compare revisions The ex...
12,584
3,850
import idaapi from idaapi import * inifinite_loops = [ b"\x00\xbf\xfd\xe7", # loop: nop; b loop b"\xfe\xe7", # loop: b loop ] whitelist = [ "Reset_Handler", "main" ] def detect_noret_funcs(): exit_locs_name_pairs = [] for func_addr in Functions(): if get_func_flags(func_addr) & idaapi...
2,352
832
from collections import defaultdict from helpers import memoize from copy import deepcopy with open("../input/day11.txt", 'r') as inputFile: data = [x.rstrip() for x in inputFile.readlines()] #data = [int(x) for x in data] map = {} yMax = len(data) xMax = len(data[0]) for y in range(yMax): line = data[y] ...
3,619
1,289
# encoding: utf-8 import datetime import numpy as np import pandas as pd def get_next_period_day(current, period, n=1, extra_offset=0): """ Get the n'th day in next period from current day. Parameters ---------- current : int Current date in format "%Y%m%d". period : str Inter...
3,235
1,117
import flask from flask import request import flask_restful as restful from marshmallow import Schema, fields, validate from api.helpers import success, created from api.exceptions import NotFound from sensors.ds18b20 import lookup class DS18B20Query (restful.Resource): def __init__(self, *args, **kwargs): ...
485
145
"""Tornado handlers for the live notebook view. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed...
2,877
821
import deepchem as dc import numpy as np import tensorflow as tf import deepchem.models.tensorgraph.layers as layers from tensorflow.python.eager import context from tensorflow.python.framework import test_util class TestLayersEager(test_util.TensorFlowTestCase): """ Test that layers function in eager mode. """...
34,172
11,768
# Solution of; # Project Euler Problem 49: Prime permutations # https://projecteuler.net/problem=49 # # The arithmetic sequence, 1487, 4817, 8147, in which each of the terms # increases by 3330, is unusual in two ways: (i) each of the three terms are # prime, and, (ii) each of the 4-digit numbers are permutations of...
790
291
""" This reference script has been taken from rq-dashboard with some modifications """ import importlib import logging import os import sys from urllib.parse import quote as urlquote, urlunparse from redis.connection import (URL_QUERY_ARGUMENT_PARSERS, UnixDomainSocketConnection, ...
8,879
2,593
from .client import send_message, MessageInfo # noqa
54
16
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- from pathlib import Path import pandas as pd from numpy import around if __name__ == "__main__": # Harden's PPG is from 2018-19 season # Bryant's PPG is from 2005-06 season # Jordan's PPG is from 1986-87 season per_game_df = pd.read_csv(Path('../data/com...
4,376
1,809
from os.path import join import numpy as np import geopandas as gpd import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.colors import Normalize from matplotlib.colorbar import ColorbarBase from matplotlib.dates import YearLocator, DateFormatter from matplotlib.animation import FuncA...
5,939
2,028
import logging, sys logger = logging.getLogger(__name__) def measurement_for_skey(sensor_key, metadata): # logger.debug("sensor_key:{} metadata:{}".format(sensor_key, metadata)) return metadata['collector']['sensors'][sensor_key]['name']
248
80
# GENERATED BY KOMAND SDK - DO NOT EDIT from setuptools import setup, find_packages setup(name="easyvista-rapid7-plugin", version="1.0.0", description="EasyVista Service Manager platform supports even the most complex requirements, while bringing a new level of simplicity, agility, and mobility required t...
837
225
import difflib import time class TSV: """Helper to get pretty diffs between expected and actual tab-separated value files""" def __init__(self, contents): raw_lines = contents.readlines() if isinstance(contents, file) else contents.splitlines(True) self.lines = [l.strip() for l in raw_lines if...
1,579
505
class Acl(object): def __init__(self, read_acl): self.read_acl = read_acl @staticmethod def from_acl_response(acl_response): '''Takes JSON response from API and converts to ACL object''' if 'read' in acl_response: read_acl = AclType.from_acl_response(acl_response['read']...
1,637
558
# # name_extractor.py # ATOM # # Created by Karthik V. # Updated copyright on 16/1/19 5:54 PM. # # Copyright © 2019 Karthik Venkatesh. All rights reserved. # # Reference # Question link: https://stackoverflow.com/questions/20290870/improving-the-extraction-of-human-names-with-nltk # Answer link: https://stackover...
1,799
576
# Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
1,402
423
# stdlib from copy import deepcopy from functools import wraps import os import tempfile from time import time # 3p import mock # datadog from datadog import initialize, api, util from datadog.api import ( Distribution, Metric, ServiceCheck ) from datadog.api.exceptions import ApiError, ApiNotInitialized ...
20,283
6,137
""" Author: Jason Eisele Email: jeisele@shipt.com Date: August 1, 2020 """ import argparse import keras import tensorflow as tf import cloudpickle parser = argparse.ArgumentParser( description='Train a Keras feed-forward network for MNIST classification') parser.add_argument('--batch-size', '-b', type=int, default=1...
1,420
543