code stringlengths 10 805k | def_use_chains listlengths 0 667 |
|---|---|
# NOTE: A place for helper utilities and decorators.
from wtoolzexceptions import exceptions
import flask
import marshmallow
def parse(schema, location):
if location == "args":
p = flask.request.args
elif location == "json":
p = flask.request.json
elif location == "view_args":
p ... | [
[
[
84,
94
],
[
510,
520
]
],
[
[
102,
107
],
[
197,
202
],
[
257,
262
],
[
322,
327
]
],
[
[
115,
126
],
[
473,
484
]
],
[
[
133,
... |
#!/usr/bin/python
# Victor del Pino
import sys
import re
linea = 0
ignorar = ""
contador = 100
impreso=0
"""
f1 = open('../ext/movies/movies.csv', 'r')
for line in f1:
if linea == 0:
re.sub(r'^\W+|\W+$', '', ignorar)
linea = linea + 1
else:
line = re.sub(r'^\W+|\W+$', '', line) # pa... | [
[
[
44,
47
]
],
[
[
55,
57
],
[
995,
997
],
[
1080,
1082
],
[
1299,
1301
],
[
1411,
1413
]
],
[
[
59,
64
],
[
975,
980
],
[
1045,
10... |
"""
Functions for calculating LOFAR hardware specific properties.
"""
import tkp.telescope.lofar.antennaarrays
import tkp.telescope.lofar.beam
import tkp.telescope.lofar.noise
import tkp.telescope.lofar.quality
| [
[
[
77,
110
]
],
[
[
118,
142
]
],
[
[
150,
175
]
],
[
[
183,
210
]
]
] |
from collections import namedtuple
Item = namedtuple('Item', ['item', 'at'])
ObsItem = namedtuple('ObsItem', ['at'])
Link = namedtuple('Link', ['from_x', 'from_y', 'to_x', 'to_y'])
class Observable(object):
def __init__(self, start, is_child=False):
self.label = None
self.start = start
se... | [
[
[
24,
34
],
[
43,
53
],
[
88,
98
],
[
125,
135
]
],
[
[
36,
40
],
[
571,
575
]
],
[
[
78,
85
],
[
650,
657
],
[
2586,
2593
]
... |
# RUN WITH /usr/bin/python3 minet.py (python 3.6)
import sys
import numpy as np
from sklearn.metrics import roc_curve, auc
import pandas as pd
def compute_aggregated_matrix(matrixfiles_num, matrixfiles, savematrixfile, saveresultfile, coeffs=[1, 1, 1, 1]):
# matrixfiles_num = int(sys.argv[1])
# matrixfiles =... | [
[
[
58,
61
]
],
[
[
69,
80
],
[
2505,
2507
],
[
3033,
3035
],
[
3126,
3128
],
[
838,
840
],
[
884,
886
],
[
965,
967
]
],
[
[
109,
1... |
from django.core.exceptions import ObjectDoesNotExist
from django.http import JsonResponse
from rest_framework import status, permissions
from rest_framework.decorators import api_view, permission_classes
from task.models import TaskModel, Status
from worker import WORKER_LIST
from worker.settings import NEW_TASK_EVEN... | [
[
[
35,
53
],
[
1039,
1057
]
],
[
[
78,
90
],
[
583,
595
],
[
763,
775
],
[
1074,
1086
],
[
1348,
1360
],
[
1439,
1451
],
[
1687,
1699
... |
import logging
import json
from typing import List, Type, Union
from keras.models import Model
from keras.layers.merge import Concatenate
from keras.layers import (
Dense, LSTM, Bidirectional, Embedding, Input, Dropout,
TimeDistributed
)
import delft.sequenceLabelling.wrapper
from delft.utilities.layers impor... | [
[
[
7,
14
],
[
561,
568
]
],
[
[
22,
26
],
[
10730,
10734
]
],
[
[
46,
50
],
[
11350,
11354
]
],
[
[
52,
56
],
[
9908,
9912
],
[
10325... |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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 ... | [
[
[
626,
630
],
[
758,
762
],
[
775,
779
],
[
810,
814
],
[
827,
831
],
[
1005,
1009
],
[
1021,
1025
],
[
1056,
1060
],
[
1074,
1078
],
... |
from django.apps import AppConfig
from django.db import connections as djcs
from django.core.exceptions import ImproperlyConfigured
class ExplorerAppConfig(AppConfig):
name = 'explorer'
def ready(self):
from explorer.schema import build_async_schemas
_validate_connections()
build_asy... | [
[
[
24,
33
],
[
158,
167
]
],
[
[
56,
75
],
[
988,
992
]
],
[
[
111,
131
],
[
726,
746
],
[
1012,
1032
]
],
[
[
140,
157
]
],
[
[
... |
# #beautifulsoup does not work with dynamically created sites
# import requests
# from bs4 import BeautifulSoup
# # The url to scrape added in tasks.py
# # URL = "https://www.opendatani.gov.uk/dataset?q=defib|AED|defibrilator"
#
#
# def scrape(url):
# # set the page and use the requests page on the url
# page =... | [
[
[
607,
616
],
[
869,
878
],
[
950,
959
]
],
[
[
659,
672
],
[
1081,
1094
]
],
[
[
712,
737
],
[
1132,
1134
]
],
[
[
777,
793
],
[
12... |
import dateparser
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class MgContagemSpider(BaseGazetteSpider):
TERRITORY_ID = "3118601"
name = "mg_contagem"
allowed_domains = ["contagem.mg.gov.br"]
start_urls = ["http://www.contagem.mg.gov.br/?se=doc"]
def parse... | [
[
[
7,
17
],
[
928,
938
]
],
[
[
44,
51
],
[
1124,
1131
]
],
[
[
85,
102
],
[
128,
145
]
],
[
[
111,
127
]
]
] |
"""Source code for distributed attentional actor architecture (DA3) model.
Author: Yoshinari Motokawa <yoshinari.moto@fuji.waseda.jp>
"""
from typing import List
import torch
from core.utils.logging import initialize_logging
from omegaconf import DictConfig
from torch import nn
from ..hard_shrink_attention import Ha... | [
[
[
158,
162
],
[
489,
493
]
],
[
[
171,
176
],
[
962,
967
],
[
1056,
1061
],
[
1927,
1932
],
[
2366,
2371
]
],
[
[
208,
226
],
[
380,
... |
import logging
import shelve
from ftplib import FTP
import requests
import requests_cache
from io import BytesIO
_cache_file_path = None
def set_cache_http(cache_file_path):
requests_cache.install_cache(cache_file_path)
def open_url(url):
return requests.get(url).text
def set_cache_ftp(cache_file_path):... | [
[
[
7,
14
],
[
436,
443
]
],
[
[
22,
28
],
[
951,
957
]
],
[
[
48,
51
],
[
513,
516
]
],
[
[
60,
68
],
[
260,
268
]
],
[
[
76,
... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import os
import torch.nn as nn
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.depth = 0.33
self.width = 0.25
... | [
[
[
107,
109
],
[
444,
446
],
[
458,
460
]
],
[
[
120,
134
],
[
681,
683
]
],
[
[
160,
172
],
[
188,
193
]
],
[
[
184,
187
],
[
236,
... |
import dsz
MENU_TEXT = 'Run shares commands'
def main():
dsz.ui.Echo('Running shares -list and shares -query...', dsz.GOOD)
dsz.control.echo.Off()
dsz.cmd.Run('background log shares -list', dsz.RUN_FLAG_RECORD)
dsz.cmd.Run('background log shares -query', dsz.RUN_FLAG_RECORD)
dsz.control.e... | [
[
[
9,
12
],
[
68,
71
],
[
125,
128
],
[
140,
143
],
[
168,
171
],
[
211,
214
],
[
237,
240
],
[
281,
284
],
[
307,
310
]
],
[
[... |
from leapp.actors import Actor
from leapp.libraries.actor.library import remove_boot_files
from leapp.models import BootContent
from leapp.tags import IPUWorkflowTag, PreparationPhaseTag
class RemoveBootFiles(Actor):
"""
Remove Leapp provided initramfs from boot partition.
Since Leapp provided initramfs ... | [
[
[
25,
30
],
[
211,
216
]
],
[
[
73,
90
],
[
628,
645
]
],
[
[
116,
127
],
[
515,
526
]
],
[
[
151,
165
],
[
559,
573
]
],
[
[
16... |
# Generated by Django 2.2.6 on 2019-10-13 23:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | [
[
[
73,
81
],
[
291,
299
],
[
1280,
1288
]
],
[
[
104,
114
],
[
186,
196
],
[
259,
269
],
[
352,
362
],
[
1496,
1506
]
],
[
[
116,
1... |
"""Defines basic light string data and functions."""
import os
import sys
import atexit
import inspect
import time
import logging
from typing import Any, Optional, Sequence, Union, overload
from nptyping import NDArray
import numpy as np
from LightBerries.LightBerryExceptions import LightStringException
from LightBerri... | [
[
[
60,
62
],
[
1411,
1413
]
],
[
[
70,
73
],
[
1379,
1382
]
],
[
[
81,
87
],
[
4395,
4401
]
],
[
[
95,
102
],
[
2692,
2699
],
[
3054,... |
# Generated by Django 2.0.5 on 2018-07-05 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aventuras', '0012_auto_20180705_1244'),
]
operations = [
migrations.AddField(
model_name='evento',
name='ourEvent',
... | [
[
[
71,
81
],
[
108,
118
],
[
237,
247
]
],
[
[
83,
89
],
[
338,
344
]
],
[
[
98,
107
]
]
] |
# -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
@file
@brief Runtime operator.
"""
from scipy.linalg import solve
from ._op import OpRunBinaryNum
from ._new_ops import OperatorSchema
class Solve(OpRunBinaryNum):
atts = {'lower': False,
'transposed': False}
def __init__(self, on... | [
[
[
126,
131
],
[
871,
876
],
[
992,
997
]
],
[
[
149,
163
],
[
215,
229
],
[
360,
374
]
],
[
[
186,
200
],
[
1435,
1449
],
[
1608,
... |
from os.path import join,exists,realpath,dirname,basename
from os import makedirs,listdir, system
import numpy as np, _pickle as cPickle, editdistance, seaborn as sns
import matplotlib.pyplot as plt, pandas as pd, itertools, glob, h5py
from scipy.stats import entropy
from matplotlib.font_manager import FontProperties
f... | [
[
[
20,
24
],
[
1468,
1472
],
[
849,
853
]
],
[
[
25,
31
],
[
915,
921
]
],
[
[
32,
40
]
],
[
[
41,
48
]
],
[
[
49,
57
]
],
[
[
... |
from geco.mips.loading.miplib import *
| [
[
[
37,
38
]
]
] |
#
# 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 un... | [
[
[
641,
652
]
],
[
[
669,
675
],
[
1518,
1524
],
[
1605,
1611
]
],
[
[
696,
700
],
[
1531,
1535
],
[
1908,
1912
],
[
3207,
3211
]
],
[
[
... |
#------------------------------------------------------------------------------
# Copyright (c) 2008 Richard W. Lincoln
#
# 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 restricti... | [
[
[
1519,
1523
]
],
[
[
1525,
1532
]
],
[
[
1567,
1580
],
[
1913,
1926
],
[
2047,
2060
],
[
2178,
2191
],
[
2324,
2337
],
[
2677,
2690
],
[
... |
# Copyright 2022 The BladeDISC Authors. 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 ... | [
[
[
605,
616
],
[
5070,
5081
],
[
12024,
12035
],
[
5961,
5972
]
],
[
[
624,
632
],
[
22192,
22200
]
],
[
[
640,
645
],
[
1142,
1147
],
[
... |
"""Collectors to crawl free IP proxies from the internet
"""
| [] |
#dealing with unexpected results
#great for writing complex programs
try:
print (a) #throw an exception
except:
print("a is not defined")
#a is not defined, instead of crashing program,
#we can ask it to tell us what the problem is
try:
print(a)
except NameError: #if this is the error...
print("... | [] |
# Copyright 2020 The PEGASUS 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... | [
[
[
664,
673
],
[
2612,
2621
],
[
3192,
3201
],
[
3892,
3901
]
],
[
[
700,
707
],
[
2637,
2644
]
],
[
[
733,
750
],
[
2491,
2508
]
],
[
[
... |
from matplotlib import pyplot as plt
import figlatex
import afterpulse_tile21
import textbox
import colormap
vov = 5.5
################
ap21 = afterpulse_tile21.AfterPulseTile21(vov)
fig = plt.figure(num='figlaserpos-0', clear=True, figsize=[4.5, 3])
ap21.sim.hist('mainpos-offset', 'mainnpe==1', fig=fig, selectio... | [
[
[
23,
36
],
[
194,
197
],
[
486,
489
]
],
[
[
45,
53
],
[
918,
926
]
],
[
[
61,
78
],
[
147,
164
]
],
[
[
86,
93
],
[
350,
357... |
import random
number = random.randrange(1,10)
guess = input("Guess a number from 1 to 10: ")
guess = int(guess)
if guess == number:
print("Great job! You got it!")
else:
print("Sorry, better luck next time.")
print("The number was " + str(number)) | [
[
[
7,
13
],
[
23,
29
]
],
[
[
14,
20
],
[
124,
130
],
[
251,
257
]
],
[
[
46,
51
],
[
105,
110
]
],
[
[
93,
98
],
[
115,
120
... |
# Your Romeo API key, required for accessing the RoMEO API
# override this in your local config
ROMEO_API_KEY = ""
ROMEO_API_BASE_URL = "http://www.sherpa.ac.uk/romeo/api29.php"
ROMEO_DOWNLOAD_BASE_URL = "http://www.sherpa.ac.uk/downloads/" | [
[
[
96,
109
]
],
[
[
116,
134
]
],
[
[
180,
203
]
]
] |
from abc import ABC, abstractmethod
from pathlib import Path
from virtool_workflow.data_model import Index
from virtool_workflow.data_model.files import VirtoolFileFormat
class AbstractIndexProvider(ABC):
@abstractmethod
async def get(self) -> Index:
"""Get the current index."""
...
@ab... | [
[
[
16,
19
],
[
202,
205
]
],
[
[
21,
35
],
[
214,
228
],
[
318,
332
],
[
481,
495
],
[
635,
649
]
],
[
[
56,
60
],
[
402,
406
]... |
import os
import io
import struct
import bson
class Packet:
def __init__(self, packet_id=0, status_code=0, packet_name="", body_type=0, body=b""):
self.packet_id = packet_id
self.status_code = status_code
self.packet_name = packet_name
self.body_type = body_type
self.body_... | [
[
[
7,
9
],
[
1325,
1327
]
],
[
[
17,
19
],
[
397,
399
],
[
1426,
1428
]
],
[
[
27,
33
],
[
426,
432
],
[
477,
483
],
[
732,
738
... |
"""
This test module will only run on a POSIX system. Windows support *may* be added at some point in the future.
"""
# Global imports
import json, operator, os, signal, sys
from argparse import ArgumentParser
from datetime import datetime
from pathlib import Path
from time import sleep
from time import time
# local ... | [
[
[
142,
146
]
],
[
[
148,
156
]
],
[
[
158,
160
]
],
[
[
162,
168
]
],
[
[
170,
173
],
[
3523,
3526
]
],
[
[
196,
210
]
],
[
[
232,
240... |
"""
Bundesagentur für Arbeit: Jobsuche API
Die größte Stellendatenbank Deutschlands durchsuchen, Details zu Stellenanzeigen und Informationen über Arbeitgeber abrufen. <br><br> Die Authentifizierung funktioniert per OAuth 2 Client Credentials mit JWTs. Folgende Client-Credentials können dafür verwendet werden:... | [
[
[
564,
566
]
],
[
[
588,
591
]
],
[
[
672,
684
],
[
6494,
6506
],
[
10648,
10660
]
],
[
[
690,
703
]
],
[
[
709,
720
],
[
1274,
1285
]
]... |
TESTBED_TEMPLATE = \
r"""
{
"name" : "WCB Test",
"description" : "Run WCB for {{ duration_minutes }} minutes",
"start_time" : "{{ start_time }}",
"duration" : {{ duration_seconds }},
"binaries" : {
"hardware" : "firefly",
"bin_file": "{{ abs_bin_path }}",
"programAddress":... | [
[
[
0,
16
]
]
] |
"""
Generates a cluster using a plummer model with a salpeter Initial Mass Function.
Compares the generated IMF against the expected line.
"""
import numpy
from matplotlib import pyplot
from amuse.units import units
from amuse.units import nbody_system
from amuse.ic.plummer import new_plummer_model
from amuse.ic.salp... | [
[
[
151,
156
],
[
1454,
1459
],
[
1517,
1522
]
],
[
[
181,
187
],
[
875,
881
],
[
2056,
2062
]
],
[
[
212,
217
],
[
501,
506
],
[
540,
... |
import torch
import numpy
# codes of this function are borrowed from https://github.com/yanx27/Pointnet_Pointnet2_pytorch/blob/master/models/pointnet2_utils.py
def index_points(device, points, idx):
"""
Input:
points: input points data, [B, N, C]
idx: sample index data, [B, S]
Return:
... | [
[
[
7,
12
],
[
666,
671
],
[
688,
693
],
[
1202,
1207
],
[
1212,
1217
],
[
1697,
1702
],
[
1770,
1775
],
[
1839,
1844
]
],
[
[
20,
25
... |
import numpy as np
from torch import Tensor, FloatTensor
from kospeech.data.audio.core import load_audio
from kospeech.data.audio.augment import NoiseInjector, SpecAugment
from kospeech.data.audio.feature import MelSpectrogram, MFCC, Spectrogram, FilterBank
class AudioParser(object):
"""
Provides inteface of ... | [
[
[
7,
18
],
[
5363,
5365
],
[
5384,
5386
]
],
[
[
37,
43
],
[
4443,
4449
]
],
[
[
45,
56
],
[
5351,
5362
],
[
5463,
5474
]
],
[
[
94,... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | [
[
[
22,
32
]
],
[
[
40,
80
],
[
2044,
2055
]
],
[
[
117,
147
]
],
[
[
149,
168
],
[
3258,
3277
],
[
3363,
3382
],
[
6182,
6201
],
[
11... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel Corp.
#
# Authors: Yunhong Jiang <yunhong.jiang@intel.com>
# Julien Danjou <julien@danjou.info>
#
# 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 ... | [
[
[
713,
721
],
[
36607,
36615
]
],
[
[
745,
754
],
[
2840,
2849
]
],
[
[
804,
813
],
[
5156,
5165
],
[
5314,
5323
],
[
5474,
5483
]
],
[
[
... |
# -*- coding: utf-8 -*-
import unittest
from tennis import TennisGame1
test_cases = [
(0, 0, "Love-All", '0-0', 'player1', 'player2'),
(1, 1, "Fifteen-All", '0-0', 'player1', 'player2'),
(2, 2, "Thirty-All", '0-0', 'player1', 'player2'),
(3, 3, "Deuce", '0-0', 'player1', 'player2'),
(4, 4, "Deuce... | [
[
[
32,
40
],
[
2520,
2528
],
[
3150,
3158
]
],
[
[
61,
72
],
[
2730,
2741
],
[
3007,
3018
]
],
[
[
74,
84
],
[
2610,
2620
],
[
2887,
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittest for cros_test_lib (tests for tests? Who'd a thunk it)."""
from __future__ import print_function
import os
import... | [
[
[
288,
302
]
],
[
[
311,
313
],
[
8695,
8697
],
[
8750,
8752
]
],
[
[
321,
331
],
[
11174,
11184
]
],
[
[
339,
342
],
[
7429,
7432
],
[
... |
import os
import time
import socket
from mmdet.apis import init_detector, inference_detector, show_result_pyplot, show_result_ins
import mmcv
# map
# config_file = '../configs/solo/decoupled_solo_r50_fpn_8gpu_3x.py'
# # download the checkpoint from model zoo and put it in `checkpoints/`
# checkpoint_file = '../checkp... | [
[
[
7,
9
],
[
1786,
1788
],
[
2439,
2441
],
[
2476,
2478
],
[
2530,
2532
],
[
2582,
2584
],
[
2673,
2675
]
],
[
[
17,
21
],
[
2616,
2620... |
from argparse import ArgumentParser
from api import State, util, engine
import random, csv, os
from rich import print
def run_tournament(options):
'''
NOTES FOR THE CSV FILENAME
the first bot is the tracked one, the other is the opponent
for example in T_Dataset_ml-rdeep.csv
ml is the tracked playe... | [
[
[
21,
35
],
[
4647,
4661
]
],
[
[
52,
57
],
[
1929,
1934
],
[
3338,
3343
]
],
[
[
59,
63
],
[
416,
420
]
],
[
[
65,
71
],
[
2016,
... |
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli... | [
[
[
733,
744
],
[
9447,
9449
]
],
[
[
769,
780
],
[
3450,
3461
],
[
3522,
3533
],
[
3597,
3608
],
[
4614,
4625
],
[
4662,
4673
],
[
4707,
... |
import unittest
from cmpcodesize.compare import listFunctionSizes
class ListFunctionSizesTestCase(unittest.TestCase):
def test_when_size_array_is_none_raises(self):
with self.assertRaises(TypeError):
listFunctionSizes(None)
def test_when_size_array_is_empty_returns_none(self):
se... | [
[
[
7,
15
],
[
101,
109
],
[
392,
400
]
],
[
[
49,
66
],
[
227,
244
],
[
336,
353
]
],
[
[
75,
100
]
]
] |
'''
数字类型:
int 整形
float 浮点型
Complex 啥东西
''' | [] |
import twint
c = twint.Config()
c.Since = "2021-02-01"
c.Until = "2021-03-14"
c.Search = "(mulher OR mulheres OR garotinha OR garotas OR menina OR garotas) AND \
((engenheira OR cientista OR arquiteta OR programação OR biologa) OR \
(engenharia OR ciência OR stem)) OR \
(matemática)... | [
[
[
7,
12
],
[
18,
23
],
[
510,
515
]
],
[
[
14,
15
],
[
33,
34
],
[
56,
57
],
[
79,
80
],
[
443,
444
],
[
457,
458
],
[
4... |
import argparse
import pprint
import sys
import torch
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from mtcnn.config import cfg
from mtcnn.datasets.iteration_based_batch_sampler import build_batch_sampler
from mtcnn.datasets.roidb import get_roidb
from mtcnn.engine.trainer impor... | [
[
[
7,
15
],
[
1135,
1143
]
],
[
[
23,
29
],
[
1471,
1477
],
[
1608,
1614
]
],
[
[
37,
40
],
[
1284,
1287
],
[
1336,
1339
]
],
[
[
49,... |
import abc
import decimal
import io
from typing import (
Any,
)
from eth_utils import (
big_endian_to_int,
to_normalized_address,
to_tuple,
)
from eth_abi.base import (
BaseCoder,
parse_tuple_type_str,
parse_type_str,
)
from eth_abi.exceptions import (
DecodingError,
InsufficientDa... | [
[
[
7,
10
],
[
3826,
3829
],
[
4034,
4037
]
],
[
[
18,
25
],
[
13485,
13492
],
[
13556,
13563
],
[
14132,
14139
],
[
14203,
14210
]
],
[
[
... |
import pytest
from blacksheep.common.files.pathsutils import (
get_file_extension_from_name,
get_mime_type_from_name,
)
@pytest.mark.parametrize(
"full_path,expected_result",
[
("hello.txt", ".txt"),
(".gitignore", ".gitignore"),
("ØØ Void.album", ".album"),
("", ""),
... | [
[
[
7,
13
],
[
132,
138
],
[
469,
475
]
],
[
[
68,
96
],
[
407,
435
]
],
[
[
102,
125
],
[
1083,
1106
]
],
[
[
333,
366
]
],
[
[
1... |
# tipo = coleta caracteres digitos para dizer seu tipo, se é numerio,etc..
# ========================================================================
# titulo e coleta de dados
print("\033[33m============[ EX 004 ]============")
print(34 * "=", "\033[m")
tipo = input("digite \033[33malgo\033[m: ")
print(34 * "\033[33m=... | [
[
[
255,
259
],
[
458,
462
],
[
491,
495
],
[
515,
519
],
[
542,
546
],
[
575,
579
],
[
610,
614
],
[
643,
647
],
[
676,
680
],
[
... |
# -*- coding: utf-8 -*-
"""Nexus 3 CLI
Usage:
nexus3 --help, -h
nexus3 login
nexus3 (list|ls) <repository_path>
nexus3 (upload|up) <from_src> <to_repository>
nexus3 repo create hosted maven <repo_name>
[--blob=<store_name>] [--version=<v_policy>]
[--layout=<l_policy>] [--strict-content]
... | [
[
[
2250,
2257
],
[
3066,
3073
]
],
[
[
2265,
2272
],
[
2489,
2496
]
],
[
[
2280,
2284
],
[
4047,
4051
]
],
[
[
2292,
2295
],
[
2656,
2659
],
... |
#! /usr/bin/python3
# Author: Maximilian Muth <mail@maxi-muth.de>
# https://github.com/mammuth/bing-wallpaper
# Version: 1.0
# License: GPL-2.0
# Description: Downloads the Bing picture of the Day and sets it as wallpaper (Linux / Windows).
import datetime
from urllib.request import urlopen, urlretrieve
from xml.dom i... | [
[
[
249,
257
],
[
2836,
2844
],
[
2881,
2889
]
],
[
[
285,
292
],
[
1888,
1895
]
],
[
[
294,
305
],
[
3505,
3516
],
[
3665,
3676
]
],
[
[
... |
import abc
import tempfile
import os
import typing
from core.data_block import DataBlock
Symbol = typing.Any
class DataStream(abc.ABC):
"""abstract class to represent a Data Stream
The DataStream facilitates the block interface.
From the interface standpoint, the two functions which are useful are:
... | [
[
[
7,
10
],
[
129,
132
],
[
713,
716
],
[
841,
844
],
[
2160,
2163
]
],
[
[
18,
26
],
[
9126,
9134
]
],
[
[
34,
36
],
[
9196,
9198
... |
def reverse_string(a_string: str):
"""Take the input a_string and return it reversed (e.g. "hello" becomes
"olleh"."""
reversed_string = ""
for i in range(len(a_string)):
reversed_string += a_string[~i]
return reversed_string
| [
[
[
4,
18
]
]
] |
#
# This file contains the Python code from Program 16.10 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm16_10.txt
#
class Graph(Conta... | [
[
[
309,
314
]
]
] |
from os import path, system, mkdir
from shutil import rmtree
from jinja2 import Template
from . import config
from .log import log
print(__file__)
def get_template(name):
template_path = path.join(path.dirname(__file__), 'templates/', name + ".jinja2")
with open(template_path) as file_:
template = Te... | [
[
[
15,
19
],
[
194,
198
],
[
204,
208
],
[
539,
543
],
[
1007,
1011
]
],
[
[
21,
27
],
[
426,
432
],
[
782,
788
]
],
[
[
29,
34
... |
# prefix where servers are kept
prefix = '/var/lib/mcp/servers'
# whether or not to allow server creation
creation = True
# whether to put servers and scripts in a container
container = False
# directory where the sources are kept; ignored if creation is disabled
sources = '/var/lib/mcp/sources'
# temprorary direct... | [
[
[
32,
38
]
],
[
[
107,
115
]
],
[
[
176,
185
]
],
[
[
267,
274
]
],
[
[
372,
375
]
],
[
[
471,
477
]
],
[
[
591,
600
]
],
[
[
670,
... |
#!/usr/bin/env python
#
# Electrum - lightweight UraniumX client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 with... | [
[
[
1173,
1176
]
],
[
[
1184,
1188
],
[
9921,
9925
],
[
12305,
12309
],
[
12614,
12618
]
],
[
[
1196,
1204
],
[
20019,
20027
],
[
20662,
20670
]
]... |
from collections import defaultdict
import json
import mmap
import operator
import os
import socket
from struct import Struct
MMDB_META_DATA_START = '\xAB\xCD\xEFMaxMind.com'
MMDB_META_DATA_BLOCK_MAX_SIZE = 131072
MMDB_DATA_SECTION_SEPARATOR = 16
unpack_int = Struct('>I').unpack
unpack_long = Struct('>Q').unpack
unpa... | [
[
[
24,
35
],
[
9050,
9061
]
],
[
[
43,
47
],
[
9016,
9020
],
[
9439,
9443
]
],
[
[
55,
59
],
[
8654,
8658
],
[
8686,
8690
]
],
[
[
67... |
# -*- coding: UTF-8 -*-
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="ARA"
__all__ = ['norm']
__date__ ="$Feb 14, 2012 11:40:06 AM$"
from . import common_obj as _com
from . import constants as _cst
import numpy as _np
from .pigasusObject imp... | [
[
[
136,
146
]
],
[
[
153,
160
]
],
[
[
172,
180
]
],
[
[
226,
244
]
],
[
[
259,
276
],
[
932,
936
],
[
3868,
3872
],
[
3961,
3965
],
[
... |
# -*- coding: utf-8 -*-
"""Climate indices computation package based on Xarray."""
from importlib.resources import contents, path
from xclim.core import units # noqa
from xclim.core.indicator import build_indicator_module_from_yaml
from xclim.core.locales import load_locale
from xclim.core.options import set_options ... | [
[
[
115,
123
],
[
521,
529
]
],
[
[
125,
129
],
[
725,
729
],
[
830,
834
],
[
944,
948
],
[
1059,
1063
]
],
[
[
154,
159
]
],
[
[
201,... |
"""Class for storing SRP password verifiers."""
from utils.cryptomath import *
from utils.compat import *
import mathtls
from BaseDB import BaseDB
class VerifierDB(BaseDB):
"""This class represent an in-memory or on-disk database of SRP
password verifiers.
A VerifierDB can be passed to a server handshake... | [
[
[
78,
79
]
],
[
[
105,
106
],
[
966,
980
],
[
996,
1010
],
[
1029,
1043
],
[
1069,
1083
],
[
1862,
1876
],
[
1892,
1906
],
[
1925,
193... |
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
'''
____ _ _ _ _ __ __ _
| _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __
| |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ /
| _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ <
|_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_\
'''
# 协议... | [
[
[
328,
337
]
],
[
[
345,
355
]
]
] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-04-02 16:27
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("poll", "0007_poll_content_type"),
]
operations = [
migrations.RemoveField(
... | [
[
[
95,
111
]
],
[
[
135,
145
],
[
164,
174
],
[
287,
297
]
],
[
[
154,
163
]
]
] |
from cmdbus import cmdbus, Command
class AddCommand(Command):
def __init__(self, v1: int, v2: int):
self.v1 = v1
self.v2 = v2
def handle(self):
return self.v1 + self.v2
def test_dispatch():
cmd = AddCommand(3, 5)
result = cmdbus.dispatch(cmd)
assert result is 8
| [
[
[
19,
25
],
[
267,
273
]
],
[
[
27,
34
],
[
54,
61
]
],
[
[
43,
53
],
[
237,
247
]
],
[
[
210,
223
]
]
] |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class OctConv(nn.Module):
def __init__(self, ch_in, ch_out, kernel_size, stride=1, alphas=(0.5, 0.5)):
super(OctConv, self).__init__()
self.alpha_in, self.alpha_out = alphas
assert 0 <= self.alpha_in <= 1... | [
[
[
7,
18
],
[
2828,
2830
],
[
2962,
2964
]
],
[
[
26,
31
],
[
3326,
3331
],
[
686,
691
],
[
790,
795
],
[
894,
899
],
[
998,
1003
]... |
#!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import unittest
from tvcm import parse_html_deps
from tvcm import module as module_module
from tvcm import html_generati... | [
[
[
196,
198
],
[
3635,
3637
]
],
[
[
206,
214
],
[
353,
361
],
[
10168,
10176
]
],
[
[
233,
248
],
[
416,
431
],
[
712,
727
],
[
1292,
... |
from typing import TypeVar, Callable
import unittest
from ._types import TestMethod
_F = TypeVar("_F", bound=TestMethod)
def test(method: _F) -> _F:
"""Decorator that flags a method as a test method."""
method._dectest_test = True # type: ignore
return method
def before(method: _F) -> _F:
"""Deco... | [
[
[
19,
26
],
[
91,
98
]
],
[
[
28,
36
],
[
880,
888
],
[
1320,
1328
],
[
1672,
1680
]
],
[
[
44,
52
],
[
1216,
1224
],
[
1551,
1559... |
# Databricks notebook source
# MAGIC %md
# MAGIC # CCU013_08 Paper subset data to cohort
# MAGIC
# MAGIC **Description**
# MAGIC
# MAGIC This notebook subsets the covid trajectory, severity and events tables to the cohort used for the phenotype severity paper.
# MAGIC
# MAGIC **Project(s)** CCU0013
# MAGIC
# MAG... | [
[
[
1549,
1552
],
[
3078,
3081
]
],
[
[
1554,
1557
]
],
[
[
1559,
1562
]
],
[
[
1585,
1591
]
],
[
[
1616,
1625
]
],
[
[
1647,
1655
],
[
3082,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
from keyword import kwlist
from ._compat import isidentifier
dict_list = [x for x in dict.__dict__]
kwset = set(kwlist + dict_list) # this is faster than iskeyword()
pat_identifier = re.compile(r"^[a-zA-Z_]\w*$")
def is_invalid_key(s):
# type: ... | [
[
[
53,
56
]
],
[
[
64,
66
],
[
253,
255
]
],
[
[
87,
93
],
[
180,
186
]
],
[
[
115,
127
],
[
868,
880
]
],
[
[
129,
138
],
[
189,... |
# Owner(s): ["oncall: fx"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
class TestReshapeConverter(AccTestCase):
... | [
[
[
35,
40
],
[
489,
494
],
[
750,
755
],
[
1052,
1057
],
[
1406,
1411
],
[
695,
700
],
[
1258,
1263
]
],
[
[
48,
95
],
[
843,
850
]... |
from __future__ import print_function, division, absolute_import
import time
import matplotlib
matplotlib.use('Agg') # fix execution of tests involving matplotlib on travis
import numpy as np
import six.moves as sm
import cv2
from scipy import ndimage
import imgaug as ia
from imgaug import augmenters as iaa
from im... | [
[
[
23,
37
]
],
[
[
39,
47
]
],
[
[
49,
64
]
],
[
[
73,
77
],
[
469,
473
],
[
592,
596
]
],
[
[
86,
96
],
[
97,
107
]
],
[
[
1... |
import sys
from setuptools import setup, find_packages
install_requires = [
'boto3>=1.2.3,<2.0',
'clint>0.5,<1.0',
'PyYAML>=3,<4.0',
'troposphere==2.0',
'Jinja2>=2.8,<3.0',
'six>1.9,<2.0'
]
# as of Python >= 2.7 argparse module is maintained within Python.
if sys.version_info < (2, 7):
in... | [
[
[
7,
10
],
[
287,
290
]
],
[
[
35,
40
],
[
363,
368
]
],
[
[
42,
55
],
[
736,
749
]
],
[
[
57,
73
],
[
318,
334
],
[
795,
811
... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
target = '1kB'
radeg = np.pi/180
def cart_to_pol(x,y):
r = np.sqrt(x**2 + y**2)
phi = np.arctan2(y,x)
return r, phi
def pol_to_cart(r,phi):
x = r*np.cos(... | [
[
[
57,
68
],
[
172,
174
],
[
1527,
1529
],
[
1629,
1631
],
[
1682,
1684
],
[
1733,
1735
],
[
1949,
1951
],
[
2257,
2259
],
[
2432,
2434
... |
import codecs
import os
import re
from setuptools import find_packages, setup
###############################################################################
# Using setup.py from Attrs as a template for finding components, awesome config.
# Original reference: https://github.com/python-attrs/attrs/blob/master/setup.... | [
[
[
7,
13
],
[
2096,
2102
]
],
[
[
21,
23
],
[
381,
383
],
[
1889,
1891
],
[
1905,
1907
],
[
2108,
2110
]
],
[
[
31,
33
],
[
2306,
2... |
from random import randint
from os import system
c = 0
#Limpa tela
system('cls')
print('=-'*20)
print('VAMOS JOGAR PAR OU IMPAR')
print('=-'*20)
#Loop do programa
while True:
n = int(input('Diga um valor: '))
computador = randint (0, 10)
while True:
decisao = str(input('Par ou impar [P/I] ')).u... | [
[
[
19,
26
],
[
230,
237
]
],
[
[
42,
48
],
[
67,
73
]
],
[
[
49,
50
],
[
692,
693
],
[
832,
833
],
[
1109,
1110
],
[
1249,
1250
... |
# Copyright 2021 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... | [
[
[
722,
724
],
[
1164,
1166
],
[
1882,
1884
],
[
1923,
1925
],
[
2049,
2051
],
[
2123,
2125
],
[
2166,
2168
],
[
3411,
3413
]
],
[
[
753,
... |
# Directly download tasks when nlp format is different than original dataset
SQUAD_TASKS = {"squad_v1", "squad_v2"}
DIRECT_DOWNLOAD_TASKS_TO_DATA_URLS = {
"wsc": f"https://dl.fbaipublicfiles.com/glue/superglue/data/v2/WSC.zip",
"multirc": f"https://dl.fbaipublicfiles.com/glue/superglue/data/v2/MultiRC.zip",
... | [
[
[
77,
88
]
],
[
[
116,
150
],
[
426,
460
]
],
[
[
402,
423
]
]
] |
import json
from types import SimpleNamespace
with open('./config/config.json') as json_file:
data = json.load(json_file, object_hook=lambda d: SimpleNamespace(**d)) | [
[
[
7,
11
],
[
106,
110
]
],
[
[
30,
45
],
[
149,
164
]
],
[
[
84,
93
],
[
116,
125
]
],
[
[
99,
103
]
]
] |
# Robot to enter weekly sales data into the RobotSpareBin Industries Intranet.
import os
from Browser import Browser
from Browser.utils.data_types import SelectAttribute
from RPA.Excel.Files import Files
from RPA.HTTP import HTTP
from RPA.PDF import PDF
browser = Browser()
def open_the_intranet_website():
bro... | [
[
[
87,
89
],
[
1488,
1490
]
],
[
[
111,
118
],
[
268,
275
]
],
[
[
156,
171
],
[
1012,
1027
]
],
[
[
200,
205
],
[
1181,
1186
]
],
[
[
... |
import os
import re
import sys
import time
from subprocess import PIPE, run
from types import ModuleType
from typing import Union
import docker
import requests
import storm.__main__ as storm
from lazycluster import Runtime, RuntimeGroup, RuntimeManager, RuntimeTask
from .config import RUNTIME_DOCKER_IMAGE, RUNTIME_N... | [
[
[
7,
9
],
[
4370,
4372
],
[
4539,
4541
],
[
5451,
5453
],
[
6913,
6915
]
],
[
[
17,
19
],
[
4945,
4947
]
],
[
[
27,
30
],
[
6834,
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 by University of Kassel, Tu Dortmund, RWTH Aachen University and Fraunhofer
# Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual
# contributors (see AUTHORS file for details). All rights reserved.
import numpy as np
from pandas import S... | [
[
[
288,
299
],
[
2592,
2594
],
[
2619,
2621
],
[
6319,
6321
],
[
6365,
6367
]
],
[
[
319,
325
],
[
3334,
3340
]
],
[
[
349,
367
],
[
3159... |
"""Example systems created in Python
"""
import numpy as np
from pysim.cythonsystem import Sys
class VanDerPol(Sys):
"""Simple example of a class representing a VanDerPol oscillator.
"""
def __init__(self):
self.add_state_scalar("x", "dx")
self.add_state_scalar("y", "dy")
self.add_... | [
[
[
48,
59
],
[
2545,
2547
],
[
2711,
2713
],
[
2876,
2878
],
[
2968,
2970
],
[
3019,
3021
],
[
3103,
3105
],
[
3146,
3148
]
],
[
[
92,
... |
from enum import Enum
from .durations import MINUTE, HOUR
class OpenshiftVersion(Enum):
VERSION_4_6 = "4.6"
VERSION_4_7 = "4.7"
VERSION_4_8 = "4.8"
VERSION_4_9 = "4.9"
class NetworkType:
OpenShiftSDN = "OpenShiftSDN"
OVNKubernetes = "OVNKubernetes"
WORKING_DIR = "build"
TF_FOLDER = f"{WOR... | [
[
[
17,
21
],
[
84,
88
]
],
[
[
46,
52
],
[
741,
747
],
[
860,
866
],
[
908,
914
],
[
953,
959
],
[
985,
991
],
[
1022,
1028
],
... |
from gym.envs.registration import register
register(
id='SimpleFlappy-v0',
entry_point='gym_simpleflappy.envs:FlappyEnv',
)
register(
id='SimpleFlappyDistance-v0',
entry_point='gym_simpleflappy.envs:FlappyEnvDistance',
)
| [
[
[
34,
42
],
[
44,
52
],
[
134,
142
]
]
] |
from haystack import indexes
from peeldb.models import (
JobPost,
Skill,
City,
FunctionalArea,
Industry,
Qualification,
State,
)
from datetime import datetime
from django.core import serializers
from mpcomp.views import get_absolute_url
class jobIndex(indexes.SearchIndex, indexes.Indexable... | [
[
[
21,
28
],
[
282,
289
],
[
303,
310
],
[
378,
385
],
[
492,
499
],
[
548,
555
],
[
604,
611
],
[
672,
679
],
[
713,
720
],
[
... |
#coding:utf-8
#
# id: bugs.core_5097
# title: COMPUTED-BY expressions are not converted to their field type inside the engine
# decription:
#
# tracker_id: CORE-5097
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, ... | [
[
[
277,
283
],
[
1620,
1626
]
],
[
[
308,
318
],
[
468,
478
]
],
[
[
320,
328
],
[
1127,
1135
]
],
[
[
330,
336
],
[
1667,
1673
]
],
[
... |
from enum import Enum
from typing import Any
from importlib import import_module
class ValidationError(Exception):
"""
Error class for validation failed
"""
def __init__(self, payload: dict):
"""
:param message: error message
"""
self.payload = payload
def generate... | [
[
[
17,
21
]
],
[
[
41,
44
],
[
4622,
4625
],
[
5188,
5191
],
[
5397,
5400
]
],
[
[
67,
80
],
[
1972,
1985
],
[
2078,
2091
],
[
2373,
... |
from engine.utils import RF_sq64, sq64_to_sq120, print_board
def react_chess_board_to_IZII_board(board):
if board is None:
exit()
izii_board = ["x"] * 120
pieces = board.split(',')
for i in range(len(izii_board)):
if i >= 20 and i < 100:
if i % 10 != 0 and i % 10 != 9:
... | [
[
[
25,
32
],
[
557,
564
]
],
[
[
34,
47
],
[
595,
608
]
],
[
[
49,
60
]
],
[
[
67,
98
]
]
] |
import numpy as np
import pandas as pd
import pytest
import ibis
import ibis.expr.datatypes as dt
from ibis.backends.pandas.udf import udf
def make_t():
return ibis.table(
[
('_timestamp', 'int32'),
('dim1', 'int32'),
('dim2', 'int32'),
('valid_seconds', 'i... | [
[
[
7,
18
],
[
4224,
4226
],
[
4285,
4287
],
[
4336,
4338
],
[
6934,
6936
]
],
[
[
26,
38
],
[
4181,
4183
],
[
4381,
4383
],
[
4500,
450... |
import time
from threading import Thread
def timestamp_datetime(value):
format = '%Y-%m-%d %H:%M:%S'
value = time.localtime(value)
dt = time.strftime(format, value)
return dt
def log(s):
print("[",timestamp_datetime(time.time()),"]",s)
| [
[
[
7,
11
],
[
118,
122
],
[
149,
153
],
[
239,
243
]
],
[
[
34,
40
]
],
[
[
46,
64
],
[
220,
238
]
],
[
[
198,
201
]
]
] |
from time import sleep
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
from celery.schedules import crontab
from celery.task import periodic_task
from crypto.models import Cryptocurrency
# @shared_task
@periodic_task(
run_every=(crontab(minute="*/15")),
name="create_cryptocurrency"... | [
[
[
17,
22
],
[
1781,
1786
],
[
3244,
3249
]
],
[
[
50,
57
],
[
536,
543
],
[
2053,
2060
]
],
[
[
59,
66
],
[
451,
458
],
[
1968,
19... |
# generated by datamodel-codegen:
# filename: schema/entity/data/database.json
# timestamp: 2021-09-27T15:46:37+00:00
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, Field, constr
from ...type import basic, entityReference, usageDetails
class DatabaseName(BaseMo... | [
[
[
147,
158
]
],
[
[
179,
187
],
[
508,
516
],
[
740,
748
],
[
906,
914
],
[
1011,
1019
],
[
1137,
1145
],
[
1431,
1439
],
[
1592,
1600... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and... | [
[
[
22,
28
],
[
1001,
1007
],
[
1059,
1065
],
[
1108,
1114
],
[
1157,
1163
],
[
1262,
1268
],
[
1327,
1333
],
[
1371,
1377
],
[
1442,
1448
... |
import re
import pickle
import tempfile
import pytest
from _pytest.config import Config
from _pytest._io.terminalwriter import TerminalWriter
from _pytest.reports import TestReport
from pytest_fold.tui_pytermtk import main as tuitk
from pytest_fold.tui_textual1 import main as tuitxt1
from pytest_fold.tui_textual2 impo... | [
[
[
7,
9
],
[
2822,
2824
],
[
3113,
3115
],
[
3340,
3342
],
[
3571,
3573
],
[
3802,
3804
],
[
4029,
4031
],
[
4318,
4320
]
],
[
[
17,
23... |
import argparse
import os
import sys
import time
import numpy as np
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHyperparameter, Constant
from sklearn... | [
[
[
7,
15
],
[
887,
895
]
],
[
[
23,
25
],
[
469,
471
],
[
5919,
5921
],
[
5949,
5951
]
],
[
[
33,
36
],
[
453,
456
]
],
[
[
44,
... |
# Copyright 2015 The TensorFlow Authors. 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 applica... | [
[
[
1484,
1495
],
[
50871,
50882
]
],
[
[
1503,
1505
],
[
9867,
9869
],
[
10095,
10097
]
],
[
[
1513,
1528
],
[
30735,
30750
]
],
[
[
1536,
1538
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.