text
string
size
int64
token_count
int64
import pytest from whylogs.app.session import get_or_create_session, get_session, get_logger, reset_default_session, session_from_config from whylogs.app.config import SessionConfig from whylogs.app.session import Session from pandas import util def test_get_global_session(): _session = None session = get_o...
2,623
781
import enum BASELINE = "baseline" ENERGY = "energy" MAX_PRICE = "max_price" START_PRICE = "starting_price" INCREMENT = "increment" MIN_PRICE = "min_price" MAX_LOT_SIZE = "max_lot_size_wh" NAMESERVER_AGENT_AMOUNT = 3 ATTRIBUTE_LIST_LENGTH = 50 NEXT_ENERGY_CONSUMPTION = "next_energy_consumption" NEXT_ENERGY_GENERATION ...
851
382
from django.contrib.auth.models import User from django.test import TestCase from django.test import Client from django.urls import reverse from target import models from django.utils import timezone # Create your tests here. class URLSWork(TestCase): @classmethod def setUpTestData(cls): target = mod...
1,553
468
""" Module for jenkinsapi views """ import six import logging from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.job import Job from jenkinsapi.custom_exceptions import NotFound log = logging.getLogger(__name__) class View(JenkinsBase): """ View class """ def __init__(self, url, name,...
4,998
1,534
""" Autonomous dataset collection of data for jetson nano John Marangola - marangol@bc.edu """ import datasets import json from datasets import Board, ChessPiece, PieceColor, PieceType #from realsense_utils import RealSenseCamera import preprocessing as pr import cv2 import pandas as pd import os from os.path import...
7,240
2,545
import os import numpy as np import pandas as pd from nilearn import datasets from sbfc.parser import seed_base_connectivity seed = os.path.dirname(__file__) + "/data/difumo64_pcc.nii.gz" def _make_data_single_run(confound=True): adhd_dataset = datasets.fetch_adhd(n_subjects=2) group_confounds = pd.DataFra...
3,475
1,193
import unittest from translator import english_to_french, french_to_english class TestenglishToFrench(unittest.TestCase): def test1(self): self.assertEqual(english_to_french(["Hello"]), "Bonjour") self.assertNotEqual(english_to_french(["Bonjour"]), "Hello") class TestfrenchToEnglish(unittest.TestC...
528
192
# Copyright 2019 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...
3,553
1,257
""" Copyright 2015 Rackspace 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 dist...
6,227
1,881
from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl import pytest from openpyxl.xml.functions import fromstring, tostring from openpyxl.tests.helper import compare_xml @pytest.fixture def GradientFillProperties(): from ..fill import GradientFillProperties return GradientFillProperties ...
1,446
436
# Copyright (c) 2014-2021, Dr Alex Meakins, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # ...
19,509
7,244
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
2,875
850
# -*- coding: utf-8 -*- """Tests go in this directory."""
58
24
__version__ = "{{cookiecutter._pkg_version}}"
46
17
# -*- coding: utf-8 -*- """ @author:XuMing(xuming624@qq.com) @description: """ import datetime import os import pathlib import random import sys from loguru import logger sys.path.append('../..') from similarities import BM25Similarity from similarities.utils import http_get from similarities.data_loader import Searc...
4,041
1,438
#!/usr/bin/env python """ Copyright (c) 2014-2018 Alex Forencich 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,...
14,531
5,827
import random import sys import subprocess def pip_install(module: str): subprocess.run([sys.executable, "-m", "pip", "-q", "--disable-pip-version-check", "install", module]) try: import requests except: print("'requests' module not found! Trying to install... ") pip_install("requests")...
4,315
1,523
import sys import itertools def readfile(f): result = {} for line in f: fields = line.rstrip().split(" ") p1 = fields[0] p2 = fields[10].replace(".", "") n = int(fields[3]) if fields[2] == "lose": n *= -1 result[(p1, p2)] = n return result def optimal(config): add_self(config) diners = set([k[0] f...
1,018
422
import socket import sys import traceback import struct import threading; from threading import Thread; import time; import datetime; import json #import buffered_message; import hashlib from Crypto.PublicKey import RSA from connection_state import ConnectionState # publickey = RSA.importKey(key_string) import tcp; im...
29,855
10,821
import os import unittest import json import types from http.client import BadStatusLine from io import BytesIO import pytest wptserve = pytest.importorskip("wptserve") from .base import TestUsingServer, TestUsingH2Server, doc_root def send_body_as_header(self): if self._response.add_required_headers: s...
11,842
3,555
# -*- coding: utf-8 -*- """ Copyright (c) 2017 beyond-blockchain.org. 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 l...
2,881
932
""" Usage: main.py [<project>] Options: <project> Path to the .uvprojx file (Keil® µVision5 Project File). The .uvoptx file (Keil® µVision5 Project Options file) will be located automatically as it shall be adjacent to the .uvprojx file, having the same filenam...
33,928
9,123
class base_converter(object): """ Properties: headers -- list of strings that name the header files needed by this object. include_dirs -- list of directories where the header files can be found. libraries -- list of libraries needed to link to when compiling ...
3,434
927
#!/usr/bin/env python3 from utils.model_config_helpers import run_model_test run_model_test()
96
36
from glob import glob import sys import os import numpy as np import random from mpunet.utils import create_folders import argparse def get_parser(): parser = argparse.ArgumentParser(description="Prepare a data folder for a" "CV experiment setup.") parser.add_a...
10,816
3,296
#!/usr/bin/python """ (C) Copyright 2018 Intel Corporation. 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 ...
1,964
709
import cPickle import argparse parser = argparse.ArgumentParser( "Computes the coverage of a shortlist in a corpus file") parser.add_argument("--vocab", required=True, help="Vocabulary to use (.pkl)") parser.add_argument("--text", required=True, help="Beam size, turn...
956
349
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProductType' db.create_table('inventory_producttype', ( ('id', self.gf('django...
13,952
4,425
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ArchivedDeployment.service' db.add_column('deployment_archiveddeployment', 'service', ...
48,733
15,324
import numpy as np import sys sys.path.append('/homes/rlreed/workspace/unotran/src') from coarseBounds import computeBounds, Grouping import pickle from makeDLPbasis import makeBasis as makeDLP from makeKLTbasis import makeBasis as makeKLT import sph import sph_dgm import pydgm def buildGEO(ass_map): fine_map = [...
2,059
925
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
9,280
2,595
from .gcore.queries import GetNetworkFee, GetBalance from .gcore.mutations import SendCoin from typing import List, Optional from .exc import SendLimitError, InvalidClientObject class Send: def __init__(self, address: str, cryptocurrency: str, amount: float): self.address = address self.cryptocurr...
1,770
489
# -*- coding: utf-8 -*- try: from urlparse import urlparse, urlunsplit except ImportError: from urllib.parse import urlparse, urlunsplit class URL(object): DEFAULT_SCHEME = ["http", "https"] def __init__(self, url, allowed_scheme=None): self._url = url self.url = urlparse(self._url) ...
2,190
695
from .base import Service from ..requests.dimension import CreateDimensionsRequest, DimensionsListRequest class DimensionService(Service): def create(self, data): request = CreateDimensionsRequest( self.client, params={'method': 'add'}, data=data ) retu...
550
134
from typing import List from typing import Union from pyspark.sql import DataFrame from pyspark.sql import functions as F from pyspark.sql.window import Window def filter_all_not_null(df: DataFrame, reference_columns: List[str]) -> DataFrame: """ Filter rows which have NULL values in all the specified column...
7,338
2,159
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import reframe.utility.sanity as sn import reframe as rfm @rfm.required_version('>=2.16-dev0') @rfm.simple_test c...
6,088
2,306
from sympy import ( limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S, ) # Numbers listed with the tests refer to problem numbers in the book # "Anti-demidovich, problemas resueltos, Ed. URSS" x = Symbol("x") def test_...
5,094
2,608
from notion.client import NotionClient from notion.settings import Settings class Context: def __init__(self): self.settings = Settings.from_file() self._client = None def get_client(self): if not self._client: self.settings.validate() self._client = NotionClie...
493
135
#!/usr/bin/env python import os try: from setuptools import setup except ImportError: from distutils.core import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() install_requires = [] # install_re...
1,552
517
from .base import * from .string import * from .categorical import * from .numerical import * __all__ = ["Converter", "converter_dict"]
138
44
def hello_world(): """打印Hello world""" message = 'hello world' print(message.title()) hello_world()
114
41
import unittest from Observers import Observer, ObserverMailServer, ObserverPbx from Subjects import Subject, SubjectEflow class UtVisitor(unittest.TestCase): def test_observer(self): # Create observers pbx = ObserverPbx() ms = ObserverMailServer() # Create subject ...
583
179
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return [ "WorldArea", "VoxelLight", "VoxelLightNode", "VoxelLevelGenerator", "VoxelLevelGeneratorFlat", "VoxelSurfaceMerger", "VoxelSurfaceSimple", ...
1,368
514
""" Day 04 """ from logger import logger def main() -> None: """ Import the puzzle input, process and display the results. """ puzzle_input = import_list() logger.debug(puzzle_input) final_score = play_bingo(puzzle_input) for result in final_score: logger.info(f"The final score i...
4,247
1,188
from durations import Duration from typing import Any, Dict, Optional from timeeval import Algorithm, TrainingType, InputDimensionality from timeeval.adapters import DockerAdapter from timeeval.params import ParameterConfig _eif_parameters: Dict[str, Dict[str, Any]] = { "extension_level": { "defaultValue": None, ...
1,982
624
""" Convenience classes for assembling graph models. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Han Altae-Tran and Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import tensorflow as tf f...
5,548
1,686
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: yandex/cloud/access/access.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf i...
20,082
7,708
from django.urls import path from .views import ( UserListView, UserUpdateView, UserProfileView, UserDeleteView, AcceptInvitationView, SpecialtyListView, SpecialtyCreateView, SpecialtyUpdateView, SpecialtyDeleteView ) app_name = 'users' urlpatterns = [ path('', UserListView.as_view(), name='list'), ...
992
308
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
8,197
2,238
#!/usr/bin/env python # encoding: utf-8 import sys import getopt import re import os import pylab as plt import numpy as np # Define the variables for which the residuals will be plotted variables = ["Ux", "Uy", "T", "p_rgh", "k", "epsilon"] # Get the arguments of the script def usage(): print("Usage: residuals....
2,380
770
# Generate the vitae.json file used to populate the Vitae section of the website. import pandas as pd import re from datetime import datetime from collections import defaultdict import json # Publications def create_publications(filepath): publications = pd.read_excel(filepath, sheet_name='publicati...
4,295
1,288
""" Cement generate extension module. """ import re import os import inspect import yaml import shutil from .. import Controller, minimal_logger, shell from ..utils.version import VERSION, get_version LOG = minimal_logger(__name__) class GenerateTemplateAbstractBase(Controller): class Meta: pass de...
7,509
2,055
from . import forms from . import views ADMIN_ROLE = "Administrator" MEMBER_ROLE = "Member" GUEST_ROLE = "Guest" DEFAULT_ROLES = [ADMIN_ROLE, MEMBER_ROLE, GUEST_ROLE]
169
75
from .gpxfile import get_hr_measurements from .utils import interpolate from operator import itemgetter def __calculate_moving_sums(points, window): """ Calculates hr moving sums of the window len """ time, hrs = zip(*points) moving_sum = sum(hrs[0:window]) sums = [(time[0], moving_sum)] for i, t ...
1,216
401
#! /usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import xml.etree.ElementTree as ET import os import sys import shutil import ate...
7,577
2,839
from discord.ext import commands import discord def setup(client): client.add_cog(KeyWordFilter(client)) class KeyWordFilter(commands.Cog): def __init__(self, client): self.client = client self.log_ch = self.client.get_channel(int(self.client.SETTINGS.LOG_CHANNEL)) @commands.Cog.listene...
1,026
332
from ml_model.model import KickModel import numpy as np import pandas as pd import eli5 import joblib import flask from flask import Flask, render_template, request, jsonify app = Flask(__name__) model_oh = joblib.load('ml_model/estimators/model_oh.sav') model_hel = joblib.load('ml_model/estimators/model_hel.sav') e...
1,975
688
from snowddl.blueprint import PrimaryKeyBlueprint from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType class PrimaryKeyResolver(AbstractSchemaObjectResolver): def get_object_type(self) -> ObjectType: return ObjectType.PRIMARY_KEY def get_exis...
2,810
827
import os import compas from compas.datastructures import Mesh from compas_rhino.artists import MeshArtist HERE = os.path.dirname(__file__) DATA = os.path.join(HERE, 'data') FILE = os.path.join(DATA, 'faces.obj') mesh = Mesh.from_obj(FILE) artist = MeshArtist(mesh, layer="Mesh") artist.draw_vertices( color={ke...
675
284
# The Pokemon class should receive a name (string) and health (int) upon initialization. # It should also have a method called pokemon_details that returns the information about the pokemon: # "{pokemon_name} with health {pokemon_health}" class Pokemon: def __init__(self, name: str, health: int) -> None: ...
461
136
"""Tests for the pandas helpers in the pd_helpers.py module.""" import pytest from pandas.testing import assert_frame_equal from tests.conftest import create_dataframe from ons_utils.pandas import * def test_nested_dict_to_df(): """Test for nested_dict_to_df.""" input_d = { 'bones': { 'f...
1,936
676
""":mod:`lsf_ibutils.ibsub` -- Interactive batch submission utility """
72
24
import os splited_path = os.path.realpath(__file__).split('\\')[:-1] fish_path = '\\'.join(splited_path) fish_json_name = "fish.json" fish_json_path = os.path.join(fish_path, fish_json_name)
193
80
# # Created by Soldoskikh Kirill. # Copyright 2018 Intuition. All rights reserved. # import os import platform from setuptools import setup from setuptools.command.build_ext import build_ext from distutils.extension import Extension from Cython.Build import cythonize from rbp_setup_tools.code_generation import gener...
5,620
1,663
from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME, get_user_model from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.views import PasswordResetView as BasePasswordResetView, SuccessURLAllowedHostsMixin from django.shortcuts impor...
8,296
2,430
from ..conversations.corpus import Conversation from ..conversations.emails import Email from collections import Counter import matplotlib import pandas as pd import json class JSONWriter: def __init__(self, kg): self.kg = kg self.entities = kg.entities() self.triples = kg.triples ...
7,320
2,112
import numpy as np from PIL import Image from keras.models import load_model img_gray = Image.open('1002.png') number = np.array(img_gray) print(number.shape) print('准备的图片的shape:',number.flatten().shape) print('原number:',number) number = number.astype('float32') number = number/255 #归一化 number = number.flatten() pri...
590
238
{ "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_ogr_mem_frmt", "type": "static_library", "sources": [ "../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp" ], "include...
378
221
from dataclasses import dataclass, field from typing import Mapping, List, Any from datetime import datetime import logging import pandas as pd import glob import numpy as np import logging import os from collections import OrderedDict import nrrd import vtk import vedo from vtk.util.numpy_support import numpy_to_vtk ...
72,121
21,108
# # For licensing see accompanying LICENSE file. # Copyright (C) 2021 Apple Inc. All Rights Reserved. # ''' Dataset file ''' import sys import time import json import copy from itertools import chain from tqdm import tqdm, trange import torch from torch.utils.data import DataLoader, RandomSampler SPECIAL_TOKENS = {...
12,670
4,974
# Copyright (c) 2013 Nicolas Dandrimont <nicolas.dandrimont@crans.org> # # 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,...
2,431
941
# Python provides a built-in method called random.shuffle that will shuffle the list data type. Do not use this. # For this assignment, you are to create your own shuffle algorithm that will take as input a sorted list and randomly shuffle the items before returning the list. Try to make your algorithm as efficient a...
1,319
394
# -*- coding: utf-8 -*- """Template Helpers used in workbox""" import logging import socket from datetime import datetime from markupsafe import Markup import psutil import tg log = logging.getLogger(__name__) def current_year(): """ Return current year. """ now = datetime.now() return now.strftime('%Y...
1,254
395
import csv import os from pathlib import Path from xml.etree import ElementTree as ET from tqdm import tqdm from scipy.spatial.transform import Rotation from skimage.io import imread import numpy as np from tadataka.camera import CameraModel, CameraParameters, FOV from tadataka.dataset.frame import Frame from tadatak...
5,647
1,886
from typing import Callable, TypeVar, Union, Tuple from krogon.infix import Infix A = TypeVar('A') B = TypeVar('B') E = TypeVar('E') Maybe = Union[Tuple['just', A], Tuple['nothing']] def just(value=None): return "just", value def nothing(): return "nothing", None def from_value(value) -> Maybe[B]: r...
2,015
695
# Desafio 009 # Faça um programa que leia um numero inteiro qualquer # e mostre na tela a sua tabuada. n = int(input('digite um numero. ')) r1 = n * 1 r2 = (n * 2) r3 = (n * 3) r4 = (n * 4) r5 = (n * 5) r6 = (n * 6) r7 = (n * 7) r8 = (n * 8) r9 = (n * 9) r10 = (n * 10) print('A Tabuada de {} é'.format(n)) print ('{} x...
1,224
622
from tools.TelloEdu import TelloEdu from tools.Controller import * from tools.SocketObject import SocketClient
110
29
# Copyright (c) 2015 Red Hat, 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 or ...
1,193
412
import json from .base_serializer import BaseSerializer class JsonSerializer(BaseSerializer): '''Json serializer.''' def _serialize(self, data: dict, **kwargs) -> str: return json.dumps(data) def _deserialize(self, data: str, **kwargs) -> dict: return json.loads(data)
302
93
import requests locations = ['Лондон', 'Шереметьево', 'Череповец'] payload = {'mnTq': '', 'lang': 'ru'} for location in locations: response = requests.get(f'http://wttr.in/{location}', params=payload) response.raise_for_status() print(response.text)
264
92
"""Added model for photo comments Revision ID: 576712576c48 Revises: 75bb906df167 Create Date: 2018-03-30 02:06:22.877079 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '576712576c48' down_revision = '75bb906df167' branch_labels = None depends_o...
1,192
445
import basic_http.session basic_http.session.LIB_VERSION = 'v0.0.4-beta' basic_http.session.DEFAULT_AGENT = 'basic-http version ' + basic_http.session.LIB_VERSION
164
60
from datetime import datetime import warnings import logging from django.db.models import Q, Case, Value, When from django.core.cache import caches, CacheKeyWarning import django.apps from usaspending_api.references.models import Agency, Location, RefCountryCode from usaspending_api.references.helpers import canonica...
12,364
3,506
from flask_marshmallow import Marshmallow{% if cookiecutter.use_celery == 'yes'%} from celery import Celery celery = Celery(){% endif %} ma = Marshmallow()
158
56
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 21 11:11:56 2020 This program is use to plot polarization map from vlbi fits image. You should specify the input fits images by -i or --infile, output file by -o or --output, contour levs by -l or --levs contour base by -c or --cmul polarization...
9,193
4,492
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
2,174
563
#!/usr/bin/env python import time import numpy as np import tomograpy import lo # object obj = tomograpy.centered_cubic_map(10, 64) obj[:] = tomograpy.phantom.shepp_logan(obj.shape) # data radius = 200 a = tomograpy.fov(obj, radius) data = tomograpy.centered_stack(a, 128, n_images=60, radius=radius, max_lon=np.pi) # m...
943
411
import logging from urllib import urlencode from urllib2 import urlopen import simplejson import xml from xml.parsers.expat import ExpatError from geopy.geocoders.base import Geocoder from geopy import Point, Location, util class Google(Geocoder): """Geocoder using the Google Maps API.""" def __init__(...
8,124
2,335
# source: https://www.youtube.com/watch?v=U0sVp1xLiyo from tkinter import * def paint(event): color = 'red' x1, y1 = (event.x-1), (event.y-1) x2, y2 = (event.x+1), (event.y+1) c.create_oval(x1,y1,x2,y2,fill=color,outline=color) master = Tk() c = Canvas(master, width=600, height=400, bg='white') c.pa...
395
189
""" insert default serverInfo """ from yoyo import step __depends__ = {'20220114_02_lHBKM-new-table-serverinfo'} steps = [ step("INSERT INTO `serverInfo` (`onlineMinute`) VALUES (0);") ]
194
78
# Copyright 2017 FUJITSU LIMITED # 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 req...
14,913
4,515
TINY_WAIT = 1 SMALL_WAIT = 3 MEDIUM_WAIT = 5 BIG_WAIT = 10 SECURITY_WAIT = 15 BATTLE_FINISH_DETECT = 12 BATTLE_NONE_DETECT_TIME = 90 BATTLE_END_SIGNAL_MAX_EXECUTE_TIME = 15 # 关键动作的偏移 FLAGS_START_BATTLE_BIAS = (50, 25) FLAGS_ENSURE_TEAM_INFO_BIAS = (25, 50) # 正方形偏移 FLAGS_CLICK_BIAS_TINY = (3, 3) FLAGS_CLICK_BIAS_SMAL...
551
392
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
3,229
887
#!/usr/bin/env python import os import requests import re import shutil from arvind import ArvindVideo, ArvindLanguage, YOUTUBE_CACHE_DIR from bs4 import BeautifulSoup from bs4.element import NavigableString from ricecooker.chefs import SushiChef from ricecooker.classes.files import YouTubeVideoFile from ricecooker...
13,620
4,196
from rest_framework.viewsets import ModelViewSet,GenericViewSet from rest_framework.response import Response from api.serializers.domain import * from api.pagination.page import MyPageNumberPagination from api.models import * class MDomainListViewSet(ModelViewSet): queryset = MasterDomainName.objects.all().order...
1,170
364
#!/usr/local/bin/python3.7 # -*- coding: utf-8 -*- from typing import List class Solution: def subsetsWithDup(self, nums: List[int]) -> List[List[int]]: """ 题解:https://leetcode-cn.com/problems/subsets/solution/c-zong-jie-liao-hui-su-wen-ti-lei-xing-dai-ni-gao-/ """ def backtrack(sta...
1,184
584
import json from .accuracy_tool import gen_micro_macro_result def null_output_function(data, config, *args, **params): return "" def basic_output_function(data, config, *args, **params): which = config.get("output", "output_value").replace(" ", "").split(",") temp = gen_micro_macro_result(da...
450
159
# Copyright 2017 AT&T Intellectual Property. All other 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...
27,100
7,669
# Copyright 2019 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "licens...
5,517
1,671
import sys from abc import ABCMeta, abstractmethod from collections import namedtuple from six import add_metaclass class SaveException(Exception): def __init__(self, other): self.traceback = sys.exc_info() super(SaveException, self).__init__(str(other)) class DeleteException(Exception): de...
4,739
1,322