text
string
size
int64
token_count
int64
from . import uuid def task_crud(self, shotgun, trigger_poll=lambda: None): shot_name = uuid(8) shot = shotgun.create('Shot', {'code': shot_name}) name = uuid(8) task = shotgun.create('Task', {'content': name, 'entity': shot}) trigger_poll() x = self.cached.find_one('Task', [('id', 'is', ta...
1,573
578
from munch import Munch as M cores = 20 demosaic_params = M( # at most one of use_flat or use_lens_profile should be True # strongly recommended to have at least 1 be True use_flat = False, use_lens_profile = True, alg = 'DCB', #alternatively, use LMMSE camera = 'auto', # alternatively, speci...
3,098
1,084
import disnake import time from disnake.ext import commands from typing import Optional from odmantic import Model from src.utils import ExitButton, EmbedFactory, File, get_info class FileModel(Model): # noqa user_id: int name: str file_url: Optional[str] = None folder: Optional[str] = None cre...
10,809
3,135
from configs import cfg from src.utils.record_log import _logger import numpy as np import tensorflow as tf import scipy.stats as stats class Evaluator(object): def __init__(self, model): self.model = model self.global_step = model.global_step ## ---- summary---- self.build_summar...
6,098
1,936
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from fairse...
3,696
1,052
import theano.tensor as T import keras.backend as K from keras.layers.core import LambdaMerge from keras import initializations class MemN2N(LambdaMerge): def __init__(self, layers, output_dim, input_dim, input_length, memory_length, hops=3, bow_mode="bow", mode="adjacent", emb_i...
5,084
1,712
import cv2 from PIL import Image import os import numpy as np IMAGE_BE = os.environ.get('NYAN_IMAGE_BE', 'PIL') if IMAGE_BE == 'PIL': def IMREAD_FN(x): return np.array(Image.open(x).convert('RGB')).astype(np.uint8) elif IMAGE_BE == 'cv2': def IMREAD_FN(x): return cv2.imread(x).astype(np.uint...
419
170
import RPi.GPIO as GPIO import connexion if __name__ == '__main__': app = connexion.App('a-pi-api') app.add_api('v0/spec.yml') app.run(host='0.0.0.0', port=80)
164
82
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Sep 25 18:26:45 2018 @author: gotamist """ import sys sys.path.append("../tools/") from feature_format import featureFormat, targetFeatureSplit from sklearn.feature_selection import SelectKBest def KBestSelector(data_dict, features_list, k): ...
661
235
# -*- coding: utf-8 -*- """ Solution to Project Euler problem 179 - Consecutive positive divisors Author: Jaime Liew https://github.com/jaimeliew1/Project_Euler_Solutions """ def run(): N = int(1e7) n_factors = [1 for _ in range(N + 1)] # can start at 2 because 1 is a divisor for all numbers and wont c...
697
258
#!/usr/bin/env python3 import asyncio, entity, io, json, logging, queue, random, threading, time, websockets, whale from bot import bot from random import randrange logging.basicConfig() log = logging.getLogger('tweetx') log.setLevel(logging.DEBUG) class Event: def __init__(self): self.callbacks = [] ...
7,417
2,253
from swaty.simulation.swat_main import swat_main from swaty.swaty_read_model_configuration_file import swat_read_model_configuration_file from swaty.classes.pycase import swaty from swaty.postprocess.extract.swat_extract_stream_discharge import swat_extract_stream_discharge sFilename_configuration_in = '/global/homes/...
682
249
def is_reverse(i, j): """ Convert 2-digit numbers to strings and check if they are palindromic. If one of the numbers has less then 2 digits, fill with zeros. """ str_i = str(i) str_j = str(j) if len(str_i) < 2: str_i = str_i.zfill(2) if len(str_j) < 2: str_j = str_j.zfil...
861
323
#coding=utf-8 import matplotlib matplotlib.use("Agg") import tensorflow as tf import argparse import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv2D,MaxPooling2D,UpSampling2D,BatchNormalization,Reshape,Permute,Activation from tensorflow.keras.utils imp...
10,237
3,999
""" Problem: -------- Design a data structure that supports the following two operations: - `void addNum(int num)`: Add a integer number from the data stream to the data structure. - `double findMedian()`: Return the median of all elements so far. """ class MedianFinder: def __init__(self): """ ...
1,465
424
from . import utils import os import scanpy as sc import scprep import tempfile URL = "https://ndownloader.figshare.com/files/25555751" @utils.loader def load_human_blood_nestorowa2016(test=False): """Download Nesterova data from Figshare.""" if test: # load full data first, cached if available ...
1,089
378
#!/usr/bin/env python from .statement import Statement from . import _import class IfStmt(Statement): def __init__(self, kwargs={}): super(IfStmt, self).__init__(kwargs) locs = _import() # Expression condition; con = kwargs.get(u'condition', {}) self._condition = locs...
1,110
382
""" Page for the monitoring of query performance characteristics. """ import json # Plotly import plotly.graph_objs as go # Dash import dash_table as dt import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output # DashEngine from dashengine.dashapp import dasha...
8,501
2,516
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: trial_inputs.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _...
2,465
943
# Copyright 2015. 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 la...
22,348
6,865
class ScreenLogger: def __init__(self, loghandler=None, verbose = True): self.LogMessage = None self.LogHandler = loghandler self.Verbose = verbose return def Log(self, message): if self.LogMessage != message: self.LogMessage = message if self.LogH...
467
118
#!/usr/bin/env python2 import sys, zmq, cmd class LavfiCmd(cmd.Cmd): prompt = 'lavfi> ' def __init__(self, bind_address): context = zmq.Context() self.requester = context.socket(zmq.REQ) self.requester.connect(bind_address) cmd.Cmd.__init__(self) def onecmd(self, cmd): ...
725
248
from minidoc import svg from minidoc import tst from efdir import fs import shutil import os def creat_one_svg(k,v,i=None,**kwargs): if("dst_dir" in kwargs): dst_dir = kwargs['dst_dir'] else: dst_dir = "./images" screen_size = svg.get_screen_size(v,**kwargs) kwargs['screen_size'] = scre...
984
411
#!/usr/bin/env python # encoding=gbk """ Convert mask to geojson format """ import os import os.path import re import logging import logging.config from multiprocessing import Pool import skimage.io as sk import numpy as np import scipy.io as sio import setting from spaceNet import geoTools as gT import spaceNet.ima...
3,843
1,363
# Generated by Django 3.0.7 on 2020-07-19 03:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0007_auto_20200614_0254'), ] operations = [ migrations.AddField( model_name='touristspot', name='photo', ...
412
151
import pytest from models.user import RoleEnum from unittest.mock import patch from resources.email import Email @pytest.mark.usefixtures("client_class", "empty_test_db") class TestUserInvite: def setup(self): self.endpoint = "/api/user/invite" @patch.object(Email, "send_user_invite_msg") def tes...
712
221
import setuptools from decorators.__init__ import __version__ as v with open('README.md') as fp: long_description = fp.read() setuptools.setup( name='decorators-LOUIS-NAVARRO', version=v, author='Louis Navarro', description='Function decorators I made', long_description=long_description, l...
778
239
from grafo import Grafo, DiGrafo from no import No from aresta import Aresta import unittest class TestStringMethods(unittest.TestCase): def setUp(self): self.grafo = Grafo() def test_atingivel(self): self.grafo.insertNo(No(1)) self.grafo.insertNo(No(2)) self.grafo.insertNo(No(3)) self.grafo.insertNo(No(4...
7,386
3,638
import warnings from typing import Any, Callable, TYPE_CHECKING from . import ConfigStructure from .process import auto_process_typ from ..config import identical if TYPE_CHECKING: from ..config import BaseConfig class Option: _type: Callable[[Any], Any] _required: bool _nullable: bool _default:...
2,476
663
from PIL import Image import numpy as np import os import re import scipy.misc import random import sys import csv def is_feature_present(input_array): return (np.sum(input_array!=0)>10) # select the image with more than 50 pixel label def load_feature_data(dataroot, frame_dir, mask_dir, feature_type...
7,128
2,291
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some MITAB specific translation issues. # Author: Even Rouault, <even dot rouault at mines dash paris dot org> # #############################################...
5,010
2,109
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import json from ink.maintainer import make_pickle, DatabaseMaintainer from ink.sys.config import CONF from ink.sys.database.connector.mysql import MySQLConnector from ink.sys.database.connector.null import NullConnector def _get_db_connector(dry_run: bool = ...
2,194
821
import requests from dateutil import parser import json from datetime import datetime, timezone import time import sys import random import uuid import copy # -------------------------------------------------------------------- class RoundTripEncoder(json.JSONEncoder): DATE_FORMAT = "%Y-%m-%d" TIME_FORMAT ...
5,261
1,678
from minio import Minio import os minio_client = Minio( os.environ['MINIO_HOST'], access_key=os.environ['MINIO_ROOT_USER'], secret_key=os.environ['MINIO_ROOT_PASSWORD'], secure=False )
201
73
from data_process.census_process.census_data_creation_config import census_data_creation fg_feature_extractor_architecture_list = [[28, 56, 28, 14], [25, 50, 25, 12], [56, 86, 56, 18], [27, 54,...
2,642
1,109
import os from cron_helper import create JOB_COMMENT = 'BVC transmit grouped command reminder' HERE = os.path.dirname(os.path.abspath(__file__)) def create_job(cron): job = cron.new( command=os.path.join(HERE, 'manage.sh transmit_grouped_command_reminder'), comment=JOB_COMMENT, ) job.day...
444
171
import pickle import numpy as np import matplotlib.pyplot as plt i = 1 fig = plt.figure(figsize=(30,30)) for pickle_file in pickle_list: c_B = pickle.load(open(pickle_file, "rb")) #plot_c_B(c_B, f"bet_centrality_with_{pickle_file[19:-4]}.png") ax = fig.add_subplot(5,1,i) #label = figname[-6:-4].upper...
2,157
1,114
import sys from PyQt5.QtWidgets import QApplication import src_ui.setup_mainwindow as setupui if __name__ == "__main__": app = QApplication(sys.argv) w = setupui.MainScreen() w.showFullScreen() w.setFixedSize(800, 480) sys.exit(app.exec_())
276
108
# -*- coding: utf-8 -*- import math from typing import Tuple, Union import numpy as np from .cutting_plane import CUTStatus Arr = Union[np.ndarray] class ell_stable: """Ellipsoid Search Space ell_stable = {x | (x − xc)' Q^−1 (x − xc) ​≤ κ} Returns: [type] -- [description] """ ...
8,271
3,004
from flask_wtf import FlaskForm from wtforms import PasswordField, StringField, SubmitField from wtforms.validators import DataRequired # # Purpose: This from will be used to collect the information for the user logging # and logging out. # # Fields: # Password: The password to validate the user # Username...
855
224
import time from netmiko.base_connection import BaseConnection class F5TmshSSH(BaseConnection): def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel_read() self.set_base_prompt() self.tmsh_mode() self.set_bas...
1,365
405
import os import pandas as pd import sys import glob # 导入同级目录下其他文件夹下的文件 sys.path.append("./") db_dir_path = 'database' def db_save(db_name, df): # index 表示是否显示行名,default=True df = remove_repetition(df) if df.to_csv(os.path.join(db_dir_path, '{}.csv'.format(db_name)), index=False, sep=','): retur...
2,099
841
from .. import global_vars as g from ..window import Window import numpy as np from ..roi import makeROI class TestSettings(): def test_random_roi_color(self): initial = g.settings['roi_color'] g.settings['roi_color'] = 'random' w1 = Window(np.random.random([10, 10, 10])) roi1 = makeROI('rectangle', [[1, 1],...
1,331
543
""" Copyright 2018, Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE file in project root for terms. """ import re import unittest from mock import patch, MagicMock, Mock, PropertyMock from testfixtures import LogCapture from yahoo_panoptes.framework.plugins.panoptes_base_plugin import Panopt...
40,888
10,633
#!/usr/bin/env python # -*- coding: utf-8 -*- # # collect a set of trip_id s at all stops in a GTFS file over the selected week of the service period starting at serviceweekstartdate # filter stops near trainstations based on input txt file - stopsneartrainstop_post_edit # merge sets of trips at stops near each trainst...
940
323
from typing import Callable, Optional, Union import tensorflow as tf from merlin.initializers import Init from merlin.modules.keras import KerasAdapter from merlin.shape import Axis from merlin.spec import DynamicSpec, Spec class BatchNormalization(KerasAdapter, tf.keras.layers.BatchNormalization): class Confi...
5,252
1,418
""" NCL_bar_2.py =============== This script illustrates the following concepts: - Drawing bars instead of curves in an XY plot - Changing the aspect ratio of a bar plot - Drawing filled bars up or down based on a Y reference value - Setting the minimum/maximum value of the Y axis in a bar plot - Using n...
3,095
967
# # 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 # distributed under...
5,248
1,546
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
4,779
1,533
""" Revision ID: 7f447c94347a Revises: a78f4b5d7dee Create Date: 2017-11-17 14:59:36.177805 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "7f447c94347a" down_revision = "a78f4b5d7dee" def upgrade(): op.add_column( "projects", sa.Column("uploads_c...
434
204
""" Dichotomous (approval) preferences and preference profiles Voters are indexed by 0, ..., len(profile) Candidates are indexed by 0, ..., profile.num_cand """ from abcvoting.misc import str_candset from collections import OrderedDict class Profile(object): """ Preference profiles """ def __init__(...
5,308
1,555
import os import sys templ = """package kata; import static kata.Printer.*; import java.util.*; /** * Cracking the coding interview 6th ed. p.XX(TODO) */ public class %(classname)s { static int %(methodname)s(String str) { return 0; } public static void main(String args[]) { runSample("abcabcdd"); ...
1,035
371
import pytest from app.helpers import check_password, encrypt_password @pytest.mark.parametrize('sent', [ ('test'), ('changeme'), ('1234123'), ]) def test_if_check_password_and_encrypt_password_works_properly(sent): expected = encrypt_password(sent) assert check_password(sent, expected)
310
107
from __future__ import print_function import os import pytest import subprocess import sys import lena.core from lena.output import PDFToPNG def test_pdf_to_png(mocker): mocker.patch("subprocess.Popen.communicate", return_value=("stdout", "stderr")) mocker.patch("subprocess.Popen.returncode", return_value=T...
1,717
567
#!/pxrpythonsubst # # Copyright 2018 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
4,162
1,402
class SimulateMode: @staticmethod def start_simulation(device, guide=None): return
92
30
# -*- coding: utf-8 -*- # # Copyright Contributors to the Conu project. # SPDX-License-Identifier: MIT # """ Tests for Kubernetes backend """ import urllib3 import pytest from conu import DockerBackend, \ K8sBackend, K8sCleanupPolicy from conu.backend.k8s.pod import Pod, PodPhase from conu.backend.k...
10,062
2,802
#!/usr/bin/python #coding:utf-8 import requests import json headers ={"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1","Referer": "http://fanyi.baidu.com/translate?aldtype=16047&query=&keyfrom=baidu&smartresult=dic...
747
314
""" Support matrices generation. radmtx module contains two class objects: sender and receiver, representing the ray sender and receiver in the rfluxmtx operation. sender object is can be instantiated as a surface, a list of points, or a view, and these are typical forms of a sender. Similarly, a receiver object can b...
13,228
4,144
__all__ = ["NNResolverSettingWidget"] import pickle import numpy as np import torch from PySide2.QtCore import QSettings, Qt from PySide2.QtWidgets import (QCheckBox, QComboBox, QDialog, QDoubleSpinBox, QGridLayout, QLabel, QSpinBox) from QGrain.models.NNResolverSetting import (NNResol...
7,354
2,519
# Uses python3 n = int(input()) if n == 1: print(1) print(1) quit() W = n prizes = [] for i in range(1, n): if W>2*i: prizes.append(i) W -= i else: prizes.append(W) break print(len(prizes)) print(' '.join([str(i) for i in prizes]))
284
121
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('town', '0001...
1,158
332
""" Modified version of build_clib that handles fortran source files. """ import os import string import sys import re from glob import glob from types import * from distutils.command.build_clib import build_clib as old_build_clib from distutils.command.build_clib import show_compilers from scipy_distutils import log...
8,700
2,333
from django.db import migrations def operation_make_labels_unique(apps, schema_editor): WebLink = apps.get_model(app_label='web_links', model_name='WebLink') for web_link in WebLink.objects.using(schema_editor.connection.alias).all(): # Look for instances with the same label duplicate_queryse...
1,405
432
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Matt Martz <matt@sivel.net> # Copyright (C) 2016 Rackspace US, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
6,251
1,937
# Generated by Django 2.2 on 2019-10-13 19:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("events", "0002_auto_20191013_1712")] operations = [ migrations.AddField( model_name="invitation", name="detail", field=...
425
144
""" print scripts """ from termcolor import colored from pygitscrum.args import compute_args import colorama def print_resume_list(list_to_print, message): """ print list summary """ if len(list_to_print) > 0: print("") print( my_colored( message + " : ", ...
1,954
572
import torch from estimation import compute_m i = [[0, 1, 1, 2], [2, 0, 2, 1]] v_z = [3, 4, 5, 2] v_c = [0, 1, 1, 0] z = torch.sparse_coo_tensor(i, v_z, (3, 3)) c = torch.sparse_coo_tensor(i, v_c, (3, 3)) max_K = 10 m = compute_m(z, c, max_K) print(m)
261
160
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the SMSGateway project # # # # Distributed under the terms of the MIT license. # See LICENSE.txt for more info. """Contain the tests for the SMSGateway for PANIC.""" # Path import sys import os path = os.path.join(os.path.dirname(__file__), os.pard...
3,677
1,274
from abc import ABCMeta, abstractmethod from io import StringIO from typing import TextIO class Serializable(metaclass=ABCMeta): @abstractmethod def serialize(self, file: TextIO) -> None: """ Write the object to provided text file object as MSD. """ pass def __str__(s...
505
136
from time import strftime from flask_wtf import FlaskForm from wtforms import ( Form, validators, StringField, IntegerField, SubmitField, BooleanField, SelectField, TextAreaField, )
214
68
#!/home/allen/Documents/TamarawTechProjects/interedregistration/intered/bin/python3 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
190
59
import numpy as np import os path = 'preds' files = os.listdir(path) lst = [] for f in files: if f.find('_0_HASH') == -1: continue if f.find('CW') == -1: continue if f.find('low')==-1 and f.find('high')==-1 and f.find('mix')==-1: continue if f.endswith('show.npy'): lst.a...
746
348
import os.path import numpy as np import pickle from .common import Benchmark from refnx.analysis import CurveFitter, Objective, Parameter import refnx.reflect from refnx.reflect._creflect import abeles as c_abeles from refnx.reflect._reflect import abeles from refnx.reflect import SLD, Slab, Structure, ReflectModel,...
3,416
1,303
# app/__init__.py from flask import Flask from redis import Redis from rq_scheduler import Scheduler from flask_migrate import Migrate from flask_login import LoginManager from flask_bootstrap import Bootstrap from flask_sqlalchemy import SQLAlchemy """ This file shall contain configurations for the web app """ # cr...
1,257
407
import webbrowser website = ['site1', 'site2', 'site3', 'site4'] for i in range(len(website)): site = 'http://' + website[i] webbrowser.open(site)
148
57
import hedger from hedger import Result class Tournament: def __init__(self, entries): self._entries = entries self._brackets = self._get_brackets() self._brackets_info = self._get_brackets_info() @property def entries(self): return self._entries @property def bra...
1,865
591
"""Provide sql connection using sqlalchemy. This client is used for convinience when using different sql providers and unifying the client creation. We do not intent to rewriter sqlalchemy. """ import contextlib from typing import Container, Generator, Optional, Union import pandas as pd from sqlalchemy.engine import...
5,294
1,468
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from django.template import loader from .models import Question from django.http import Http404 def index(request): #last_questions_list = Question.objects.order_by('-pub_date')[:5] #template = loader.get_template("poll...
1,678
526
import os from abc import ABC, abstractmethod class File(ABC): """ Abstract class representing text files. """ @abstractmethod def __init__(self): pass @staticmethod def write_file(filename, text, overwrite_existing=True): """ Writes output text to a file. ...
2,343
605
# Question 8 # Print even numbers in a list, stop printing when the number is 237 numbers = [ 386, 462, 47, 418, 907, 344, 236, 375, 823, 566, 597, 978, 328, 615, 953, 345, 399, 162, 758, 219, 918, 237, 412, 566, 826, 248, 866, 950, 626, 949, 687, 217, 815, 67, 104, 58, 512, 24, 892, 894, 767, 553, 8...
582
395
# Author: Chinmai Managoli import sys as sys # Morse code dictionary char_to_dots = { 'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', 'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.', 'O': '---', 'P': '.--.', 'Q': '--.-', 'R': '.-.', 'S': '...
1,377
560
import tensorflow as tf import numpy as np from self_implement_learning_to_adapt.model import construct_fc_weights,construct_inputs,construct_loss,forward_fc from self_implement_learning_to_adapt.batch_sampler import ParrallelSampler from self_implement_learning_to_adapt.vectorized_sampler import VectorizedSampler from...
22,442
6,875
try: from DeepRTS import Engine except ImportError: import Engine try: from DeepRTS.Engine import Map, UnitManager, Constants, Player from DeepRTS.Engine import Constants except ImportError: from Engine import Map, UnitManager, Constants, Player, Constants
279
77
# -*- coding: utf-8 -*- from logging import getLogger from pkg_resources import get_distribution from openprocurement.auctions.core.plugins.contracting.base.utils import ( check_auction_status ) from openprocurement.auctions.core.utils import ( cleanup_bids_for_cancelled_lots, check_complaint_status, remov...
4,196
1,318
# -*- coding: utf-8 -*- # Python STL from time import time, sleep import asyncio from collections import deque # Third-party from bilibili_api import Credential, comment import nonebot from nonebot.log import logger from nonebot import on_command, require from nonebot.permission import SUPERUSER, USER from nonebot.adap...
12,989
5,255
import sys from collections import OrderedDict import numpy as np from gym import spaces from pyrep.const import RenderMode from pyrep.objects.dummy import Dummy from pyrep.objects.vision_sensor import VisionSensor from rlbench.environment import Environment from rlbench.action_modes import ArmActionMode, A...
6,593
2,082
import numpy as np from ConfigSpace import ConfigurationSpace from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \ UniformIntegerHyperparameter, UnParametrizedHyperparameter import argparse import pickle as pkl import os import sys sys.path.insert(0, '.') from scripts.utils import check_none, chec...
4,117
1,376
import sys from Training.observer_abilities import * from Training.cortex_3x3_caddy import * class Player(Observer): def __init__(self, marker_code): self.ui = None self.marker_code = marker_code def get_enemy_code(self): if self.marker_code == 10: return 1 return ...
2,362
756
requested_toppings = ['mushrooms', 'extra cheese'] if 'mushrooms' in requested_toppings: print("Adding mushrooms.") if 'pepperoni' in requested_toppings: print("Adding pepperoni.") if 'extra cheese' in requested_toppings: print("Adding extra cheese.") print("\nFinished making your first pizza!") if 'mush...
575
184
#!/usr/local/bin/python # coding=utf-8 from django.db import models from django.utils.translation import ugettext as _ from markdown import markdown from django.contrib.auth.models import User from uuslug import uuslug from django import forms from pagedown.widgets import PagedownWidget # from bootstrap3_datetime.widg...
4,000
1,298
#!/usr/bin/env python """ sw_edit.py Deidentifies SW_SUMMARY.csv and SW_MINUTE.csv in LABS 2 data; these files cannot be deidentified properly by date_eliminator.py. This script replaces dates with days since first day. This software is licensed under the MIT License. Copyright (c) 2016 Abhinav Nellore Permission...
4,788
1,418
from .genotype import GenotypingManager
39
12
from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from sklearn.metrics import confusion_matrix, f1_score, precision_score, recall_score from keras import backend as K fro...
6,191
2,450
# markdownv2 python-telegram-bot specific joined = '{} joined group `{}`' not_joined = '{} is already in group `{}`' left = '{} left group `{}`' not_left = '{} did not join group `{}` before' mention_failed = 'There are no users to mention' no_groups = 'There are no groups for this chat' # html python-telegram-bot spe...
1,332
441
# -*- coding: utf-8 -*- from hashlib import md5 import re import smtplib from django.conf import settings from django.http import HttpResponseBadRequest def remove_spaces(s): inline_tags = 'a|b|i|u|em|span|strong|sup|sub|tt|font|small|big' inlines_with_spaces = r'</(%s)>[\s\n\t]+<(%s)\b' % ( inline_t...
3,298
1,144
class A: def fazer_algo(self): print("Palmeiras") def outro(self): print("campeão") class B: def __init__(self): self.a = A() def fazer_algo(self): #delega para self.a return self.a.fazer_algo() def outro(self): #delegando novamente return sel...
382
150
import cv2 import numpy as np from numpy.linalg import norm import requests def _get_image_frame(camera) -> np.ndarray: _, frame = camera.read() return frame def _convert_frame_to_hsv(frame: np.ndarray) -> np.ndarray: return cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) def _post_to_michi() -> None: try: ...
777
294
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Dict, Optional, Union import gym import numpy as np from gym import spaces from habitat.core.s...
8,134
2,514
from flask import Flask, render_template, Response from topicsconsumer import TopicsConsumer import math import time import queue import threading import json app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def searchTopic(): return render_template('base.html') @app.route('/topics', methods=['GET'...
1,279
394