text
string
size
int64
token_count
int64
# https://www.beecrowd.com.br/judge/en/problems/view/1017 car_efficiency = 12 # Km/L time = int(input()) average_speed = int(input()) liters = (time * average_speed) / car_efficiency print(f"{liters:.3f}")
214
100
filename = '../py/cards.py' f = open(filename) color_map = { 'W' : 'eWhite', 'U' : 'eBlue', 'G' : 'eGreen', 'R' : 'eRed', 'B' : 'eBlack', 'J' : 'eGold', } color_index_map = { 'W' : 0, 'U' : 1, 'G' : 2, 'R' : 3, 'B' : 4 } def convert(cost_str): cost_array = [0,0,0...
1,432
615
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt map = Basemap(projection='cyl') map.drawmapboundary(fill_color='aqua') map.fillcontinents(color='coral',lake_color='aqua') map.drawcoastlines() plt.show()
230
90
# ============================================================================== # KratosShapeOptimizationApplication # # License: BSD License # license: ShapeOptimizationApplication/license.txt # # Main authors: Baumgaertner Daniel, https://github.com/dbaumgaertner # ...
3,926
974
"""Tests for frontend's FAST detector class. Authors: Ayush Baid """ import unittest import tests.frontend.detector.test_detector_base as test_detector_base from gtsfm.frontend.detector.fast import Fast class TestFast(test_detector_base.TestDetectorBase): """Test class for FAST detector class in frontend. ...
529
170
""" Copyright (c) College of Mechatronics and Control Engineering, Shenzhen University. All rights reserved. Description : Author:Team Li """ """ 13. Roman to Integer Easy Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X ...
2,135
817
"""Unit tests for pynlpir's cli.py file.""" import os import shutil import stat import unittest try: from urllib.error import URLError from urllib.request import urlopen except ImportError: from urllib2 import URLError, urlopen from click.testing import CliRunner from pynlpir import cli TEST_DIR = os.pat...
2,173
675
from cft_namehandler import NameHandler, get_value_returned_type, get_local_name, get_abs_composed_name from parsemod.cft_name import is_name, is_kw, compose_name from parsemod.cft_syntaxtree_values import str_type from parsemod.cft_others import extract_tokens from cft_errors_handler import ErrorsHandler from compile....
13,746
4,018
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms from abc import abstractmethod from typing import Any, Dict class YChaosCLIError(Exception): exitcode = 1 def __init__(self, app, message, **kwargs): self.app = app ...
938
261
import logging import ibmsecurity.utilities.tools import time logger = logging.getLogger(__name__) requires_model = "Appliance" def get(isamAppliance, check_mode=False, force=False): """ Retrieving the current FIPS Mode configuration """ return isamAppliance.invoke_get("Retrieving the current FIPS M...
5,289
1,599
preference_list_of_user=[] def give(def_list): Def=def_list global preference_list_of_user preference_list_of_user=Def return Def def give_to_model(): return preference_list_of_user
187
70
# coding: utf-8 import numpy as np import keras.utils from pathlib import Path from typing import Tuple, Sequence, Union, Hashable, Iterable, Mapping, Any ### COMMON TYPES UNIVERSAL_PATH_TYPE = Union[Path, str] UNIVERSAL_SOURCE_TYPE = Union[UNIVERSAL_PATH_TYPE, Mapping] CHUNKED_DATA_TYPE = Tuple[Sequence[np.ndarray]...
953
395
#!/usr/bin/env python """ HIAS AI Model Data Augmentation Class. Provides data augmentation methods. MIT License Copyright (c) 2021 Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss Permission is hereby granted, free of charge, to any person obtaining a copy of this software and ass...
4,021
1,386
from ..utils import Object class RichTextPhoneNumber(Object): """ A rich text phone number Attributes: ID (:obj:`str`): ``RichTextPhoneNumber`` Args: text (:class:`telegram.api.types.RichText`): Text phone_number (:obj:`str`): Phone number Ret...
792
246
from .cne import CNE __version__ = "0.0.dev"
46
22
from pytest import raises from vedro._core._scenario_finder._file_filters import FileFilter def test_file_filter(): with raises(Exception) as exc_info: FileFilter() assert exc_info.type is TypeError assert "Can't instantiate abstract class FileFilter" in str(exc_info.value)
299
90
""" Parse PubMed Dump Ref: https://www.nlm.nih.gov/databases/download/pubmed_medline.html https://www.nlm.nih.gov/bsd/licensee/elements_alphabetical.html https://www.nlm.nih.gov/bsd/licensee/elements_descriptions.html#medlinecitation """ from collections import defaultdict from concurrent import futures import glob ...
31,894
10,081
import sys sys.path.append('dependencies/image-store-py-web-api-consumer') from Consumer import Consumer class Consumer_test: def __init__(self): self.c = Consumer() def get(self): print('\x1b[6;30;42m' + 'GET' + '\x1b[0m') print(self.c.get()) print('{}\n'.format(self.c...
1,523
596
"""Returns words from the given paragraph which has been repeated most, incase of more than one words, latest most common word is returned. """ import string def mostCommonWord(paragraph: str) -> str: # translate function maps every punctuation in given string to white space words = paragraph.translate(st...
864
248
from app import app, db from flask import render_template, flash, redirect, get_flashed_messages import forms import models import Character from flask.globals import request from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound def menugear() : return { 'pcs': models.Character.query.all() } @a...
7,597
3,154
from .bot import GuildConfig, ServiceConfig, get_logging_config, service_config __all__ = [ "ServiceConfig", "GuildConfig", "get_logging_config", "service_config", ]
183
60
from ciscoisesdk import IdentityServicesEngineAPI from ciscoisesdk.exceptions import ApiError from dotenv import load_dotenv import os from pprint import pprint as ppr load_dotenv() admin = os.getenv("ISE_ADMIN") pw = os.getenv("ISE_PW") base_url = os.getenv("ISE_URL") api = IdentityServicesEngineAPI( username=ad...
623
235
# Program 8_plot_data_perstation.py written by Sanne Cottaar (sc845@cam.ac.uk) file_name= '8_plot_data_perstation.py' # Uses receiver functions computed to produce a nice graph for every directory in DATARF import obspy from obspy import read from obspy.core import Stream from obspy.core import trace import matplotlib...
4,121
1,419
# -*- coding: utf-8 -*- ################################################################################ # _____ _ _____ _ # # / ____(_) / ____| | | # # | | _ ___ ___ ___ | (___ _ _ ___...
9,053
2,541
import sys import comtypes from comtypes.client import CreateObject try: # Connecting | coneccion xl = CreateObject("Excel.Application") except (OSError, comtypes.COMError): print("No tiene instalada el programa(Excel).") sys.exit(-1) xl.Visible = True print (xl)
283
98
from selenium import webdriver import time chromedriver = "C:/Users/deniz/chromedriver/chromedriver" driver = webdriver.Chrome(chromedriver) driver.get('http://127.0.0.1:8000/') dashboard = '//*[@id="accordionSidebar"]/li[1]/a' sectors_1 = '//*[@id="sectors"]' sectors_1_element = '//*[@id="sectors"]/option[4]' add_s...
984
409
import tensorflow as tf from netensorflow.ann.ANN import ANN from netensorflow.ann.macro_layer.MacroLayer import MacroLayer from netensorflow.ann.macro_layer.layer_structure.InputLayerStructure import InputLayerStructure from netensorflow.ann.macro_layer.layer_structure.LayerStructure import LayerStructure, LayerType ...
1,713
544
import json from flask import Flask, request, redirect, g, render_template import requests from urllib.parse import quote # Adapted from https://github.com/drshrey/spotify-flask-auth-example # Authentication Steps, paramaters, and responses are defined at https://developer.spotify.com/web-api/authorization-guide/ app...
3,449
1,245
import yaml import os ### Sample Contents of config.yaml: # 0002_info_leakage: # category: Sifu C/C++ # points: 100 # description: Leave no trace # vulnerability: CWE-14 * Information Leakage # directory: Challenges/C_CPP/0002_info_leakage # send_dir: true # file: func_000...
3,342
1,176
import logging class Logger(object): stream_handler = logging.StreamHandler() formatter = logging.Formatter("[%(levelname)s %(pathname)s:%(lineno)d] %(message)s") stream_handler.setFormatter(formatter) stream_handler.setLevel(logging.INFO) my_logger = logging.Logger("arachne.runtime.rpc") my_...
423
135
#pylint: disable = line-too-long import os import time import board import neopixel import keypad import usb_hid import pwmio import rainbowio from adafruit_hid.keyboard import Keyboard from pykey.keycode import KB_Keycode as KC from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS # Hardware definition: GPIO...
4,498
1,506
UNIVERSAL_POS_TAGS = { 'VERB': 'verbo', 'NOUN': 'nombre', 'PRON': 'pronombre', 'ADJ' : 'adjetivo', 'ADV' : 'adverbio', 'ADP' : 'aposición', 'CONJ': 'conjunción', 'DET' : 'determinante', 'NUM' : 'numeral', 'PRT' : 'partícula gramatical', 'X' : 'desconocido', '.' : 'si...
433
207
from pyramid_oereb.core.sources import BaseDatabaseSource from pyramid_oereb.core.sources.availability import AvailabilityBaseSource class DatabaseSource(BaseDatabaseSource, AvailabilityBaseSource): def read(self): """ The read method to access the standard database structure. It uses SQL-Alchem...
942
237
from pytest_factoryboy import register from tests.factories.specification import ( CallbackFactory, ComponentsFactory, ContactFactory, DiscriminatorFactory, EncodingFactory, ExampleFactory, ExternalDocumentationFactory, HeaderFactory, InfoFactory, LicenseFactory, LinkFactory...
1,624
434
import datetime as dt import numpy as np import pandas as pd import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func from flask import Flask, jsonify, render_template engine = create_engine('sqlite:///hawaii.sqlite') Base = automa...
3,856
1,355
#!/usr/bin/env python #! -*- coding: utf-8 -*- ''' Handler for login ''' import tornado.web from lib.db_controller import DBController from lib.CUSTOMIZED_SESSION.my_session import SessionFactory class LoginHandler(tornado.web.RequestHandler): def initialize(self): # 钩子函数 首先执行 class_ = SessionFact...
4,096
1,233
def is_leap(year): leap = False # Write your logic here # The year can be evenly divided by 4, is a leap year, unless: # The year can be evenly divided by 100, it is NOT a leap year, unless: # The year is also evenly divisible by 400. Then it is a leap year. leap = (year % 4 == 0 and (year ...
409
155
from django import forms from django.contrib.auth import models from django.db.models.base import Model from django.forms import ModelForm, fields from .models import Paint from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm c...
1,480
429
# Takes two years, and runs an aggressive search for dates in between those two years (inclusive). import njdate.gematria as gematria import njdate.ej_generic as ej_generic import string specpunc = string.punctuation.replace('"','').replace("'","") tr_table = str.maketrans("","",specpunc) def date_aggressor (...
3,398
1,132
import logging from os.path import expanduser, join from unittest import mock import pytest from click.testing import CliRunner from configparser import ConfigParser from apparate.configure import configure from apparate.cli_commands import upload, upload_and_update logging.basicConfig(level=logging.INFO) logger = ...
10,323
3,258
import torch import torch.nn.functional as F import torch.nn as nn import gym from gym import spaces import torch.optim as optim from torch.distributions import Categorical import random import numpy as np class Net(nn.Module): def __init__(self, input_space, output_space): super(Net, self).__init__() ...
4,632
1,566
from data_dissector import DataDissector def handler(event, _): switchpoint_trio = DataDissector.dissect_data(data=event['data']) return { "switchpoint": switchpoint_trio.switchpoint, "preSwitchAverage": switchpoint_trio.pre_switch_average, "postSwitchAverage": switchpoint_trio.po...
346
114
# Flight duration model: Just distance # In this exercise you'll build a regression model to predict flight duration (the duration column). # For the moment you'll keep the model simple, including only the distance of the flight (the km column) as a predictor. # The data are in flights. The first few records are disp...
1,220
311
from django.contrib import admin class ChildrenInline(admin.TabularInline): sortable_field_name = "order" class GipsyMenu(admin.ModelAdmin): inlines = [ChildrenInline] exclude = ('parent',) list_display = ['name', 'order'] ordering = ['order'] def get_queryset(self, request): """Ove...
486
148
import numpy, math from scipy import special """ The Sersic Profile Formulae for Sersic profile taken from Graham & Driver (2005) bibcode: 2005PASA...22..118G """ class Sersic: def __init__(self, size, x_c, y_c, mag, n, r_e, e=0., theta=0., osfactor=10, osradius=2): self.size = size ...
4,727
2,060
import sys import os import torch import numpy as np from TorchProteinLibrary.FullAtomModel.CoordsTransform import CoordsTranslate, getRandomTranslation, getBBox, CoordsRotate, getRandomRotation from TorchProteinLibrary.FullAtomModel import Angles2Coords, Coords2TypedCoords def test_translation(coords, num_atoms): tr...
1,138
487
# Set random number generator np.random.seed(2020) # Initialize step_end, n, t_range, v and i step_end = int(t_max / dt) n = 50 t_range = np.linspace(0, t_max, num=step_end) v_n = el * np.ones([n, step_end]) i = i_mean * (1 + 0.1 * (t_max / dt)**(0.5) * (2 * np.random.random([n, step_end]) - 1)) # Loop for step_end ...
671
321
# JSON engine 21 9 16 # database # eng.json # engine # eng.py import os import json path = os.getcwd() + '\\json_engine_database\\' path_string = '' def set_path(string): global path path = os.getcwd() + string def dictionary_kv(dictionary, key, value): dictionary[key] = value return ...
5,417
1,743
# python import sys import h5coro ############################################################################### # DATA ############################################################################### # set resource resource = "file:///data/ATLAS/ATL06_20200714160647_02950802_003_01.h5" # expected single read h_li_e...
2,292
989
""" Main Larch interpreter Safe(ish) evaluator of python expressions, using ast module. The emphasis here is on mathematical expressions, and so numpy functions are imported if available and used. """ from __future__ import division, print_function import os import sys import ast import math import numpy from . ...
30,165
8,781
""" DeepInsight Toolbox © Markus Frey https://github.com/CYHSM/DeepInsight Licensed under MIT License """ import numpy as np import pandas as pd import h5py from . import hdf5 from . import stats def read_open_ephys(fp_raw_file): """ Reads ST open ephys files Parameters ---------- fp_raw_file : ...
4,422
1,415
# Explicit API functions from api_functions import api_function1, api_function2 from package3 import api_function3 # API Packages import package1, package2 import package3 from package4 import api_class1 # Defined functions def defined_function_1(d_f_arg1, d_f_arg2): a = api_function1(d_f_arg1) b = (api_fun...
627
258
"""Tests for making datasets for contradictory-claims.""" # -*- coding: utf-8 -*- import os import unittest from contradictory_claims.data.make_dataset import load_drug_virus_lexicons, load_mancon_corpus_from_sent_pairs, \ load_med_nli, load_multi_nli from .constants import drug_lex_path, mancon_sent_pairs, med...
4,848
1,735
# import modules import numpy as np import argparse import cv2 # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-b", "--buffer", type=int, default=64, help="max buffer size") args = vars(ap.parse_args()) # define the lower and upper boundaries of ...
3,111
1,156
# Generated by Django 3.2 on 2021-10-21 19:26 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0002_alter_modelingprocess_modeling_type'), ] operations = [ migrations.AddField( model_name='topic', name='...
430
140
""" I Hate Time Tracking package. Get time tracking out of your way. """ from typing import List __all__: List[str] = [] # noqa: WPS410 (the only __variable__ we use)
171
62
import os import subprocess import unittest import uuid import warnings from tempfile import TemporaryDirectory, gettempdir from octue.cloud.emulators import GoogleCloudStorageEmulatorTestResultModifier from octue.mixins import MixinBase, Pathable from octue.resources import Datafile, Dataset, Manifest from tests impo...
2,831
820
from CHECLabPy.plotting.setup import Plotter from CHECLabPy.plotting.camera import CameraImage from CHECLabPy.utils.files import create_directory from CHECLabPy.utils.mapping import get_ctapipe_camera_geometry from sstcam_sandbox import get_plot, get_data from os.path import join from matplotlib import pyplot as plt fr...
6,457
2,348
# 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 writing, software # distrib...
15,797
4,143
""" Convert spherical panorama in equirectangular format into cubemap format """ from math import pi, log2 import numpy from libtiff import TIFF import png import glfw from OpenGL import GL from OpenGL.GL import shaders from OpenGL.GL.EXT.texture_filter_anisotropic import GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE...
10,586
3,886
from entities.serializable import Serializable class Storage: ''' Storage represents a file storage that stores and retrieves objects ''' def __init__(self): pass def save(self, filename: str, data: Serializable) -> bool: ''' Stores a serializable object. If the ob...
1,150
300
from __future__ import absolute_import, division, print_function __metaclass__ = type import os import sys import warnings import ansible.constants import ansible.errors import ansible.utils import pytest from pprint import pprint # The positive path test def test_zos_tso_command_listuser(ansible_adhoc): hosts ...
924
287
# ------------------------------ # 78. Subsets # # Description: # Given a set of distinct integers, nums, return all possible subsets (the power set). # Note: The solution set must not contain duplicate subsets. # # For example, # If nums = [1,2,3], a solution is: # [ # [3], # [1], # [2], # [1,2,3], # [1,3]...
1,859
615
#coding=utf8 import json from sqlalchemy import func, or_ from pprint import pprint from datetime import datetime, timedelta from random import randint from flask import Blueprint, g, request, jsonify from flask_login import LoginManager, login_user, logout_user, login_required, current_user from extensions.database ...
10,707
3,763
import torch from torch import nn import torch.nn.functional as F #locals from data.config import Config from utils.functions import make_net from utils.script_module_wrapper import ScriptModuleWrapper, script_method_wrapper class FastMaskIoUNet(ScriptModuleWrapper): def __init__(self, config:Config): su...
716
257
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author : Hongzhuo Liang # E-mail : liang@informatik.uni-hamburg.de # Description: # Date : 15/10/2019: 22:13 # File Name : network import argparse import numpy as np import torch def worker_init_fn(pid): np.random.seed(torch.initial_seed() % (2 ** 3...
3,366
1,190
''' Created on 12 janv. 2016 @author: phm ''' import FederatedSDN import FederatedSDNSecurity import FederatedSecurityAgent import VNFManager import CloudManager import ssl, socket inputMessage="Press enter to continue" federationCloudManagers=[] cloudFederationMembers=[ ["cloud_man_1","vnf_manager_1"...
4,312
1,367
import parsetools from benchDesc import benchsDesc import matplotlib.pyplot as plt import matplotlib import getopt, sys try: opts, args = getopt.getopt(sys.argv[1:], "h", ["arch="]) except getopt.GetoptError as err: print(err) sys.exit(2) file_postfix = "" for o,a in opts: if o == "--arch": if...
5,121
2,071
# Generated by Django 3.1.7 on 2021-05-13 02:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_core', '0023_auto_20210513_1004'), ] operations = [ migrations.AlterField( model_name='tb_course', name='pricing...
610
213
class CompressedFastq( CompressedArchive ): """ Class describing an compressed fastq file This class can be sublass'ed to implement archive filetypes that will not be unpacked by upload.py. """ file_ext = "fq.gz" def set_peek( self, dataset, is_multi_byte=False ): if not dataset...
800
245
# Copyright 2017 Google 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 applicable law or a...
1,697
460
# pytorch import torch import torch.nn as nn import torch.nn.functional as F # ********************************************** # rnn class # ********************************************** class BasicRNNCell(nn.Module): def __init__(self, inputs, hidden, outputs): super(BasicRNNCell, self).__init__() ...
1,322
496
import django_heroku from config.settings.base import * DEBUG = False SECRET_KEY = os.environ['SECRET_KEY'] EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '%(asc...
1,141
433
""" Assemblies List View. """ import logging from datetime import datetime from cornice.service import Service from fabrikApi.models.assembly import DBAssembly from fabrikApi.models.mixins import arrow # from fabrikApi.util.cors import CORS_LOCATION, CORS_MAX_AGE logger = logging.getLogger(__name__) # SERVICES as...
1,181
348
import tensorflow as tf from keras import backend as K from keras.engine.topology import Layer from keras.initializers import Ones, Zeros from layers import transformer class LayerNormalization(Layer): def __init__(self, eps=1e-6, **kwargs): super(LayerNormalization, self).__init__(**kwargs) self...
7,217
2,581
from unittest import TestCase from irlib.metrics import Metrics class TestMetrics(TestCase): def setUp(self): self.m = Metrics() def test_jaccard_same_len(self): with self.assertRaises(ValueError): self.m.jaccard_vectors( [0, 1], [0, 1, 2, 3] ...
1,514
585
# -*- coding: utf-8 -*- """ This module """ import attr import typing from ..core.model import ( Property, Resource, Tag, GetAtt, TypeHint, TypeCheck, ) from ..core.constant import AttrMeta #--- Property declaration --- @attr.s class AnomalyDetectorCsvFormatDescriptor(Property): """ AWS Object Type = "...
50,483
17,213
class PaginatorOptions: def __init__( self, page_number: int, page_size: int, sort_column: str = None, sort_descending: bool = None ): self.sort_column = sort_column self.sort_descending = sort_descending self.page_number = page_number self...
654
194
from pbxproj.pbxsections.PBXGenericBuildPhase import * class PBXResourcesBuildPhase(PBXGenericBuildPhase): def _get_comment(self): return 'Resources'
164
57
import sys from itertools import chain def fast_count_segments(starts, ends, points): cnt = [0] * len(points) start_points = zip(starts, ['l'] * len(starts), range(len(starts))) end_points = zip(ends, ['r'] * len(ends), range(len(ends))) point_points = zip(points, ['p'] * len(points), range(len(points)...
1,014
365
import argparse import numpy as np import os import random import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader from datasets import custom_collate_fn, load_data, WebDataset from models import WebObjExtractionNet from train import train_model, evaluate_model from utils...
6,822
2,763
# Copyright 2019 Open Source Robotics Foundation, 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 required by applicable law...
2,846
870
import numpy as np from typing import Union, Optional, List, Dict, Any from buffers.chunk_buffer import ChunkReplayBuffer class IntrospectiveChunkReplayBuffer(ChunkReplayBuffer): def __init__(self, buffer_size: int, *args, **kwargs): super().__init__(buffer_size, *args, **kwargs) self.sam...
1,170
385
# This file is executed on every boot (including wake-boot from deepsleep) import esp import gc import machine import network esp.osdebug(None) # machine.freq(160000000) def do_connect(wifi_name, wifi_pass): ssid = 'microsonar' password = 'microsonar' ap_if = network.WLAN(network.AP_IF) ap_if.activ...
999
371
from __future__ import print_function from orphics import maps,io,cosmology,stats from pixell import enmap import numpy as np import os,sys from tilec import utils as tutils region = 'deep56' #region = 'boss' solution = 'comptony' tdir = "/scratch/r/rbond/msyriac/data/depot/tilec/v1.2.0_20200324" dcomb = 'joint' dfil...
3,326
1,566
from typedpy import * class Person(Structure): first_name = String() last_name = String() age = Integer(minimum=1) _required = ['first_name', 'last_name'] class Groups(Structure): groups = Array(items=Person) _required = ['groups'] # ******************** class Example1(Structure): p...
509
168
# 02_blink_twice.py # From the code for the Electronics Starter Kit for the Raspberry Pi by MonkMakes.com import RPi.GPIO as GPIO import time def word_separation(pin): sleep_time = 7 GPIO.output(pin, False) # True means that LED turns on time.sleep(sleep_time) def pulse(pin, length = "dot"): ...
3,114
1,002
""" Identify low-level jets in wind profile data. Peter Kalverla December 2020 """ import numpy as np import xarray as xr def detect_llj(x, axis=None, falloff=0, output='strength', inverse=False): """ Identify maxima in wind profiles. args: - x : ndarray with wind profile data -...
5,641
1,807
property_setter = { "dt": "Property Setter", "filters": [ ["name", "in", [ 'Purchase Order-read_only_onload', 'Purchase Order-default_print_format', 'Purchase Invoice-naming_series-options', 'Purchase Invoice-naming_series-default', 'Delivery Note-naming_series-options', 'Delivery Note-naming_seri...
9,203
3,794
"""Sigv4 Signing Support""" # Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy # of the License is located at # # http://aws.amazon.com/apache2.0/ # # or i...
1,555
474
r""" >>> from django.conf import settings >>> from django.contrib.sessions.backends.db import SessionStore as DatabaseSession >>> from django.contrib.sessions.backends.cache import SessionStore as CacheSession >>> from django.contrib.sessions.backends.file import SessionStore as FileSession >>> from django.contrib.ses...
2,624
898
# encoding: utf-8 import urllib2 from proxy_helper import ProxyHelper proxyHelper = ProxyHelper() class WebHelper: def __init__(self): pass @classmethod def get_page_content_from_url(cls, page_url): """ get html content from web page with given url :param page_url: url ...
1,504
491
import textwrap from contextlib import ExitStack as does_not_raise # noqa: N813 import pytest from _pytask.mark import Mark from _pytask.outcomes import Skipped from _pytask.outcomes import SkippedAncestorFailed from _pytask.outcomes import SkippedUnchanged from _pytask.skipping import pytask_execute_task_setup from ...
8,187
2,864
from waitress import serve from conf.wsgi import application if __name__ == '__main__': serve(application, listen='0.0.0.0:8000', url_scheme='https')
156
56
from django.apps import AppConfig from django.core.checks import Tags, register from django_version_checks import checks class DjangoVersionChecksAppConfig(AppConfig): name = "django_version_checks" verbose_name = "django-version-checks" def ready(self) -> None: register(Tags.compatibility)(chec...
589
168
import os os.environ["OMP_NUM_THREADS"]= '1' os.environ["OMP_THREAD_LIMIT"] = '1' os.environ["MKL_NUM_THREADS"] = '1' os.environ["NUMEXPR_NUM_THREADS"] = '1' os.environ["OMP_NUM_THREADS"] = '1' os.environ["PAPERLESS_AVX2_AVAILABLE"]="false" os.environ["OCR_THREADS"] = '1' import poppler import pytesseract from pdf2im...
3,471
1,195
import time import sys import numpy as np from local_search import kmedian_local_search import feasibility from kmedkpm import k_median_k_partitions_LS import psutil from sklearn.datasets import make_blobs import generator import random test = False def lp_ls_complete(data, color_mat, rvec, k, logfile): #########...
3,889
1,260
import datetime import requests import json from dms.v2.config import DMS_URL class Meal(): @staticmethod def get(date: datetime.date or str=datetime.date.today()): if not isinstance(date, str): date = str(date) resp = requests.get(f"http://{DMS_URL}/v2/meal/{date}") mea...
415
139
from django.utils.translation import ugettext_lazy as _ from mayan.apps.permissions import PermissionNamespace namespace = PermissionNamespace(label=_('Dependencies'), name='dependencies') permission_dependencies_view = namespace.add_permission( label=_('View dependencies'), name='dependencies_view' )
319
90
from flask import Blueprint, render_template about_blueprint = Blueprint('about', __name__) @about_blueprint.route('/about') def about(): """Show the about page.""" return render_template('about.html')
213
64