code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# PYTHON configuration file for class: JetIdExample
# Description: Example showing how to conveniently select collection
# of jets in the event which pass the jet id criteria ("loose",
# "medium", "tight",..etc) using a simple one-line plugin.
#
# Author: <NAME>
# Date: 18 - January - 2011
import FWCore.ParameterSet... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.InputTag",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.int32",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.P... | [((1677, 1695), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""Ana"""'], {}), "('Ana')\n", (1688, 1695), True, 'import FWCore.ParameterSet.Config as cms\n'), ((2688, 2750), 'FWCore.ParameterSet.Config.untracked.vstring', 'cms.untracked.vstring', (['"""keep *"""', '"""drop *_MEtoEDMConverter_*_*"""'], {}), "... |
import gws
import gws.types as t
from .. import provider, user
@gws.ext.Object('auth.provider.system')
class Object(provider.Object):
users: t.Dict[str, user.User]
def configure(self):
self.users = {
'guest': user.create(user.Guest, self, 'guest', [gws.ROLE_GUEST]),
'system':... | [
"gws.ext.Object"
] | [((67, 105), 'gws.ext.Object', 'gws.ext.Object', (['"""auth.provider.system"""'], {}), "('auth.provider.system')\n", (81, 105), False, 'import gws\n')] |
import operator
import random
import time
from inspect import signature
from itertools import chain, count, islice, repeat
from types import SimpleNamespace
from about_time import about_time
from .utils import fix_signature
from ..utils.cells import fix_cells, is_wide, join_cells, strip_marks, to_cells
from ..utils.c... | [
"itertools.chain",
"operator.attrgetter",
"itertools.islice",
"random.choice",
"about_time.about_time",
"inspect.signature",
"time.sleep",
"itertools.chain.from_iterable",
"itertools.count"
] | [((6024, 6073), 'itertools.chain.from_iterable', 'chain.from_iterable', (['(cycle for cycle in spec.data)'], {}), '(cycle for cycle in spec.data)\n', (6043, 6073), False, 'from itertools import chain, count, islice, repeat\n'), ((12485, 12493), 'itertools.count', 'count', (['(1)'], {}), '(1)\n', (12490, 12493), False, ... |
from __future__ import absolute_import, division, print_function
import cctbx.xray.targets
from cctbx.array_family import flex
from libtbx.test_utils import approx_equal
from six.moves import range
def calc_k(f_obs, i_calc):
fc = flex.sqrt(i_calc)
num = flex.sum(f_obs * fc)
den = flex.sum(fc * fc)
assert den !... | [
"cctbx.array_family.flex.complex_double",
"cctbx.array_family.flex.mersenne_twister",
"six.moves.range",
"cctbx.array_family.flex.double",
"cctbx.array_family.flex.pow2",
"cctbx.array_family.flex.sqrt",
"libtbx.test_utils.approx_equal",
"cctbx.array_family.flex.sum",
"cctbx.array_family.flex.vec3_do... | [((233, 250), 'cctbx.array_family.flex.sqrt', 'flex.sqrt', (['i_calc'], {}), '(i_calc)\n', (242, 250), False, 'from cctbx.array_family import flex\n'), ((259, 279), 'cctbx.array_family.flex.sum', 'flex.sum', (['(f_obs * fc)'], {}), '(f_obs * fc)\n', (267, 279), False, 'from cctbx.array_family import flex\n'), ((288, 30... |
import os
import re
import traceback
from typing import List
import pytz
import tweepy
from django.core.management.base import BaseCommand
from django.db import transaction
from slacker import Slacker
from tweepy.cursor import ItemIterator
from apps.cultivar.apple import Apple
from apps.tweets.models import Tweets, L... | [
"pytz.timezone",
"traceback.format_exc",
"apps.cultivar.apple.Apple",
"re.compile",
"tweepy.Cursor",
"django.db.transaction.atomic",
"apps.tweets.models.LastSearch",
"apps.tweets.models.LastSearch.objects.first",
"apps.tweets.models.Tweets",
"slacker.Slacker",
"tweepy.API",
"tweepy.AppAuthHand... | [((348, 375), 'pytz.timezone', 'pytz.timezone', (['"""Asia/Tokyo"""'], {}), "('Asia/Tokyo')\n", (361, 375), False, 'import pytz\n'), ((844, 870), 'apps.tweets.models.LastSearch.objects.first', 'LastSearch.objects.first', ([], {}), '()\n', (868, 870), False, 'from apps.tweets.models import Tweets, LastSearch\n'), ((1355... |
'''
Psychophysics.py: Script containing functions to measure relevant psychophysical metrics for various tasks.
'''
import matplotlib.pyplot as plt
import numpy as np
import numpy.random as npr
import time
def dRSG_metronomic(RNN, ntrials=1, threshold=0.1, showtrialplots=1, **kwargs):
'''
Function designed fo... | [
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.argmax",
"inspect.getfullargspec",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.zeros",
"JazNets.Tasks.RHY",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1646, 1673), 'inspect.getfullargspec', 'inspect.getfullargspec', (['RHY'], {}), '(RHY)\n', (1668, 1673), False, 'import inspect\n'), ((1921, 1954), 'numpy.linspace', 'np.linspace', (['int_min', 'int_max', '(11)'], {}), '(int_min, int_max, 11)\n', (1932, 1954), True, 'import numpy as np\n'), ((2023, 2053), 'numpy.zer... |
from sklearn.model_selection import cross_val_score, train_test_split
from sklearn.datasets import load_boston, load_iris
from sklearn.metrics import roc_auc_score, make_scorer
from sklearn.preprocessing import LabelBinarizer
from sklearn.preprocessing.label import label_binarize
import pandas as pd
from dstools.ml.xg... | [
"sklearn.datasets.load_iris",
"dstools.ml.xgboost_tools.XGBoostClassifier",
"sklearn.preprocessing.LabelBinarizer",
"sklearn.model_selection.train_test_split",
"sklearn.base.clone",
"sklearn.datasets.load_boston",
"sklearn.metrics.make_scorer",
"sklearn.metrics.roc_auc_score",
"pandas.DataFrame",
... | [((492, 521), 'sklearn.metrics.roc_auc_score', 'roc_auc_score', (['y_bin', 'y_score'], {}), '(y_bin, y_score)\n', (505, 521), False, 'from sklearn.metrics import roc_auc_score, make_scorer\n'), ((559, 572), 'sklearn.datasets.load_boston', 'load_boston', ([], {}), '()\n', (570, 572), False, 'from sklearn.datasets import... |
import re
import uuid
import json
class MagicTrait:
'An inventory of magical data references'
def __delattr__(self, name):
'Processes delete properties'
self.__delitem__(name)
def __delitem__(self, key):
'Deletes the item accessed like an array'
# if it exists
if k... | [
"json.dumps",
"uuid.uuid4"
] | [((2709, 2744), 'json.dumps', 'json.dumps', (['self.__dict__'], {'indent': '(4)'}), '(self.__dict__, indent=4)\n', (2719, 2744), False, 'import json\n'), ((13669, 13698), 'json.dumps', 'json.dumps', (['results'], {'indent': '(4)'}), '(results, indent=4)\n', (13679, 13698), False, 'import json\n'), ((7139, 7151), 'uuid.... |
#!/usr/bin/snimpy
"""
Get serial number of a given equipment using ENTITY-MIB
"""
from __future__ import print_function
import sys
load("ENTITY-MIB")
host=sys.argv[1]
s = M(host=host, community=sys.argv[2])
# Locate parent of all other elements
print("[-] %s: Search for parent element" % host)
parent = None
for i... | [
"sys.exit"
] | [((497, 508), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (505, 508), False, 'import sys\n')] |
import FWCore.ParameterSet.Config as cms
from PhysicsTools.IsolationAlgos.tkIsoDeposits_cff import *
EcalIsolationForTracks = cms.EDProducer("IsolationProducerForTracks",
highPtTracks = cms.InputTag("highPtTracks"),
tracks = cms.InputTag("goodTracks"),
isoDeps = cms.InputTag("tkIsoDepositCalByAssociatorTow... | [
"FWCore.ParameterSet.Config.Sequence",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.InputTag"
] | [((728, 805), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(tkIsoDeposits + EcalIsolationForTracks + HcalIsolationForTracks)'], {}), '(tkIsoDeposits + EcalIsolationForTracks + HcalIsolationForTracks)\n', (740, 805), True, 'import FWCore.ParameterSet.Config as cms\n'), ((191, 219), 'FWCore.ParameterSet.Conf... |
from functools import partial
from typing import Callable, Union
import numpy as np
from numpy.typing import NDArray
from scipy import ndimage
from scipy.sparse import lil_matrix
from sklearn.ensemble import IsolationForest
from sklearn.ensemble._iforest import _average_path_length
from sklearn.utils import check_X_y
... | [
"numpy.abs",
"scipy.sparse.lil_matrix",
"numpy.unique",
"sklearn.ensemble._iforest._average_path_length",
"sklearn.utils.check_X_y",
"scipy.ndimage.mean",
"numpy.zeros",
"functools.partial",
"scipy.ndimage.sum_labels",
"scipy.ndimage.labeled_comprehension",
"numpy.all"
] | [((2063, 2121), 'scipy.ndimage.mean', 'ndimage.mean', (['values'], {'labels': 'indices', 'index': 'unique_indices'}), '(values, labels=indices, index=unique_indices)\n', (2075, 2121), False, 'from scipy import ndimage\n'), ((2391, 2455), 'scipy.ndimage.sum_labels', 'ndimage.sum_labels', (['values'], {'labels': 'indices... |
import torch
# from .residual_encoder import ResidualEncoder
from .text_encoder import TextEncoder
class Encoder(torch.nn.Module):
def __init__(self, num_tokens, num_speakers, dim):
super().__init__()
self.text_encoder = TextEncoder(num_tokens, dim)
self.speaker_embed = torch.nn.Embedding... | [
"torch.broadcast_to",
"torch.nn.Embedding"
] | [((302, 339), 'torch.nn.Embedding', 'torch.nn.Embedding', (['num_speakers', 'dim'], {}), '(num_speakers, dim)\n', (320, 339), False, 'import torch\n'), ((698, 764), 'torch.broadcast_to', 'torch.broadcast_to', (['encoded_speaker[..., None]', 'encoded_text.shape'], {}), '(encoded_speaker[..., None], encoded_text.shape)\n... |
# -*- test-case-name: twistedcaldav.test.test_wrapping,twistedcaldav.directory.test.test_calendar -*-
##
# Copyright (c) 2010-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | [
"twext.python.log.Logger",
"twisted.internet.defer.returnValue",
"twistedcaldav.directory.util.transactionFromRequest",
"twistedcaldav.directory.resource.DirectoryReverseProxyResource",
"txweb2.http.HTTPError"
] | [((1076, 1084), 'twext.python.log.Logger', 'Logger', ([], {}), '()\n', (1082, 1084), False, 'from twext.python.log import Logger\n'), ((2086, 2140), 'twistedcaldav.directory.util.transactionFromRequest', 'transactionFromRequest', (['request', 'self.parent._newStore'], {}), '(request, self.parent._newStore)\n', (2108, 2... |
# import unittest
import numpy as np
# require: pip install flaml[blendsearch, ray]
# require: pip install flaml[ray]
import time
from flaml import tune
def evaluate_config(config):
"""evaluate a hyperparameter configuration"""
# we uss a toy example with 2 hyperparameters
metric = (round(config["x"]) - ... | [
"flaml.tune.lograndint",
"flaml.tune.run",
"ray.tune.suggest.ConcurrencyLimiter",
"time.sleep",
"flaml.searcher.blendsearch.RandomSearch",
"flaml.searcher.blendsearch.CFO",
"flaml.searcher.blendsearch.BlendSearch",
"numpy.random.seed",
"flaml.tune.randint",
"ray.tune.run",
"flaml.tune.report"
] | [((539, 571), 'time.sleep', 'time.sleep', (["(config['x'] / 100000)"], {}), "(config['x'] / 100000)\n", (549, 571), False, 'import time\n'), ((631, 657), 'flaml.tune.report', 'tune.report', ([], {'metric': 'metric'}), '(metric=metric)\n', (642, 657), False, 'from flaml import tune\n'), ((693, 731), 'flaml.tune.lograndi... |
# -*- coding: utf-8 -*-
"""DNACenterAPI event_management API fixtures and tests.
Copyright (c) 2019-2021 Cisco Systems.
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, includ... | [
"pytest.raises",
"pytest.mark.skipif"
] | [((1337, 1424), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(DNA_CENTER_VERSION != '2.2.1')"], {'reason': '"""version does not match"""'}), "(DNA_CENTER_VERSION != '2.2.1', reason=\n 'version does not match')\n", (1355, 1424), False, 'import pytest\n'), ((2046, 2100), 'pytest.raises', 'pytest.raises', (['(JsonSch... |
import numpy as numpy
a = numpy.arange(10)
b = a[5]
c = a[2:]
d = a[2:5]
print (b)
print (c)
print (d)
| [
"numpy.arange"
] | [((27, 43), 'numpy.arange', 'numpy.arange', (['(10)'], {}), '(10)\n', (39, 43), True, 'import numpy as numpy\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from nycmap.util import FileReader
TEST_CSV_FILE = 'data/rollingsales_queensSample.csv'
TEST_COLUMN = "NEIGHBORHOOD"
def testParseExcelFile_correctSize():
df = FileReader.parseCsvFile(TEST_CSV_FILE)
assert df[TEST_COLUMN].size == 60
| [
"nycmap.util.FileReader.parseCsvFile"
] | [((227, 265), 'nycmap.util.FileReader.parseCsvFile', 'FileReader.parseCsvFile', (['TEST_CSV_FILE'], {}), '(TEST_CSV_FILE)\n', (250, 265), False, 'from nycmap.util import FileReader\n')] |
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-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
... | [
"getopt.getopt",
"aeon.DataLoader",
"time.sleep",
"sys.exit"
] | [((2737, 2759), 'aeon.DataLoader', 'DataLoader', ([], {'config': 'cfg'}), '(config=cfg)\n', (2747, 2759), False, 'from aeon import DataLoader\n'), ((1106, 1213), 'getopt.getopt', 'getopt.getopt', (['argv', '"""ha:p:i:r:s:"""', "['address=', 'port=', 'session_id=', 'rdma_address=', 'rdma_port=']"], {}), "(argv, 'ha:p:i:... |
#!.env/bin/python
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import argparse
import logging
from threading import Thread
import tornado
from tornado.web import Application
from conf import Conf, getIp
import log
from server.model import Model
from server.requestHandlers.templatesH... | [
"log.init",
"logging.debug",
"argparse.ArgumentParser",
"server.model.Model",
"tornado.ioloop.IOLoop.instance",
"tornado.web.Application",
"logging.info",
"conf.getIp"
] | [((574, 671), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run the server for the web-ui report"""', 'prog': '"""server.py"""'}), "(description='Run the server for the web-ui report',\n prog='server.py')\n", (597, 671), False, 'import argparse\n'), ((1785, 1802), 'conf.getIp', 'getI... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2019-08-07 23:49
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
... | [
"django.db.models.OneToOneField",
"django.db.migrations.swappable_dependency",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((347, 404), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (378, 404), False, 'from django.db import migrations, models\n'), ((540, 633), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from django.urls import path
from django.views.generic import RedirectView
from . import views
urlpatterns = [
path('login/', views.login, name='login'),
path('signup-request-otp/', views.signup_request_otp, name='signup-request-otp'),
path('signup-create-password/', views.signup_create_password, name='si... | [
"django.urls.path",
"django.views.generic.RedirectView.as_view"
] | [((117, 158), 'django.urls.path', 'path', (['"""login/"""', 'views.login'], {'name': '"""login"""'}), "('login/', views.login, name='login')\n", (121, 158), False, 'from django.urls import path\n'), ((164, 249), 'django.urls.path', 'path', (['"""signup-request-otp/"""', 'views.signup_request_otp'], {'name': '"""signup-... |
#!/usr/bin/env python
# Copyright (c) 2015-2017, <NAME>. All rights reserved.
from setuptools import setup
from setuptools import find_packages
setup(name='improc',
version='1.0.0',
description="A simple image process tool, \
especially for block or patch operation",
author='<N... | [
"setuptools.find_packages"
] | [((477, 492), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (490, 492), False, 'from setuptools import find_packages\n')] |
""" **Description**
A principal component model analyzes an incident signal to define
transformation matrices which consume an incident signal to produce a
reference signal, normalized and ordered to define orthogonal axes of
descending variance.
A principal component model is a... | [
"numpy.array",
"numpy.matmul",
"numpy.isscalar"
] | [((3129, 3144), 'numpy.array', 'numpy.array', (['[]'], {}), '([])\n', (3140, 3144), False, 'import numpy\n'), ((3339, 3354), 'numpy.array', 'numpy.array', (['[]'], {}), '([])\n', (3350, 3354), False, 'import numpy\n'), ((4464, 4487), 'numpy.matmul', 'numpy.matmul', (['self.v', 'z'], {}), '(self.v, z)\n', (4476, 4487), ... |
def get_account_bill(turbot_host, turbot_api_access_key, turbot_api_secret_key, turbot_host_certificate_verification, accountId, api_version):
""" Gets the month to date charges for a given account
"""
import requests
import json
import urllib.parse
api_method = "GET"
api_url = "/api/%s/a... | [
"json.loads"
] | [((794, 819), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (804, 819), False, 'import json\n')] |
from django.contrib import admin
from .models import Posts,Rates
admin.site.register(Posts)
admin.site.register(Rates)
| [
"django.contrib.admin.site.register"
] | [((66, 92), 'django.contrib.admin.site.register', 'admin.site.register', (['Posts'], {}), '(Posts)\n', (85, 92), False, 'from django.contrib import admin\n'), ((93, 119), 'django.contrib.admin.site.register', 'admin.site.register', (['Rates'], {}), '(Rates)\n', (112, 119), False, 'from django.contrib import admin\n')] |
"""
Challenge Exercises for Chapter 4.
"""
import timeit
from algs.modeling import numpy_error
from algs.table import DataTable, ExerciseNum, comma, caption
from algs.modeling import n_log_n_model
def merged_arrays(heap1, heap2):
"""Return combined array with sorted values."""
result = [None] * (heap1.N + he... | [
"random.shuffle",
"ch04.heap.PQ",
"algs.modeling.n_log_n_model",
"algs.table.caption",
"ch04.timing.trial_factorial_heap",
"numpy.array",
"algs.table.ExerciseNum",
"scipy.stats.stats.pearsonr",
"random.randint",
"algs.table.comma"
] | [((2968, 2973), 'ch04.heap.PQ', 'PQ', (['k'], {}), '(k)\n', (2970, 2973), False, 'from ch04.heap import PQ\n'), ((3705, 3718), 'random.shuffle', 'shuffle', (['vals'], {}), '(vals)\n', (3712, 3718), False, 'from random import shuffle\n'), ((4351, 4356), 'ch04.heap.PQ', 'PQ', (['N'], {}), '(N)\n', (4353, 4356), False, 'f... |
import json
tracklist_dir = "C:/Users/athor/Documents/git/SpotifyClassifier/Tracklists/"
genres = ["ambient","alternative","anime","blues","classical","country","death-metal","dubstep",\
"electronic","folk","gospel","goth","grindcore","guitar","hip-hop",\
"honky-tonk","indie","jazz","k-pop","l... | [
"json.load"
] | [((593, 613), 'json.load', 'json.load', (['tracklist'], {}), '(tracklist)\n', (602, 613), False, 'import json\n')] |
# Copyright 2017 British Broadcasting 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 law or a... | [
"threading.Thread.__init__",
"signal.signal",
"json.dumps",
"websocket.WebSocketApp",
"threading.Event",
"sys.exit"
] | [((3053, 3097), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal_handler'], {}), '(signal.SIGINT, signal_handler)\n', (3066, 3097), False, 'import signal\n'), ((922, 939), 'threading.Event', 'threading.Event', ([], {}), '()\n', (937, 939), False, 'import threading\n'), ((1012, 1043), 'threading.Thread.__ini... |
from rest_framework import serializers
from .models import Teacher, Student, Lecture, Div, Subject
class TeacherSerializer(serializers.ModelSerializer):
name = serializers.CharField(source='getfullname')
class Meta:
model = Teacher
fields = ('name', 'specialization', 'teacherID', 'su... | [
"rest_framework.serializers.CharField"
] | [((169, 212), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source': '"""getfullname"""'}), "(source='getfullname')\n", (190, 212), False, 'from rest_framework import serializers\n'), ((398, 441), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source': '"""getfullname"... |
import os
import pytest
# @pytest.mark.skipif(os.name == "posix", reason="do not run on mac os")
def _test_hf_data():
from flaml import AutoML
from datasets import load_dataset
train_dataset = (
load_dataset("xsum", split="validation[:1%]").to_pandas().iloc[0:4]
)
dev_dataset = (
... | [
"datasets.load_dataset",
"flaml.AutoML",
"pandas.read_csv"
] | [((782, 790), 'flaml.AutoML', 'AutoML', ([], {}), '()\n', (788, 790), False, 'from flaml import AutoML\n'), ((1300, 1308), 'flaml.AutoML', 'AutoML', ([], {}), '()\n', (1306, 1308), False, 'from flaml import AutoML\n'), ((1628, 1690), 'pandas.read_csv', 'pd.read_csv', (['"""data/input/train.tsv"""'], {'delimiter': '"""\... |
# Copyright (c) 2019, UC Berkeley
# 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, this
# list of conditions and the f... | [
"os.path.dirname",
"ast.get_docstring",
"os.path.join"
] | [((2179, 2201), 'ast.get_docstring', 'ast.get_docstring', (['mod'], {}), '(mod)\n', (2196, 2201), False, 'import ast\n'), ((2038, 2060), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (2050, 2060), False, 'from os import path\n'), ((2072, 2110), 'os.path.join', 'path.join', (['this_directory', '... |
import sys
import tensorflow as tf
from tensorflow.python.ops import summary_ops_v2
from tensorflow.python.eager import context
import numpy as np
from VOClabelcolormap import color_map
from common import blend_from_3d_one_hots
class MyTensorBoardCallback(tf.keras.callbacks.TensorBoard):
def __init__(self, args... | [
"tensorflow.python.eager.context.eager_mode",
"tensorflow.python.ops.summary_ops_v2.always_record_summaries",
"numpy.array",
"tensorflow.summary.text",
"common.blend_from_3d_one_hots",
"VOClabelcolormap.color_map"
] | [((745, 756), 'VOClabelcolormap.color_map', 'color_map', ([], {}), '()\n', (754, 756), False, 'from VOClabelcolormap import color_map\n'), ((2315, 2335), 'tensorflow.python.eager.context.eager_mode', 'context.eager_mode', ([], {}), '()\n', (2333, 2335), False, 'from tensorflow.python.eager import context\n'), ((2945, 3... |
# Copyright (C) 2020 by <NAME> <<EMAIL>>
# Copyright (C) 2020 by <NAME> <<EMAIL>>
# Copyright (C) 2020 by <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: 0BSD
from urllib.parse import urlparse
from fastapi import FastAPI, status
from fastapi.testclient import TestClient
from pytest import fixture
from kibicara import ... | [
"_pytest.monkeypatch.MonkeyPatch",
"fastapi.FastAPI",
"fastapi.testclient.TestClient",
"kibicara.model.Mapping.drop_all",
"pytest.fixture",
"kibicara.model.Mapping.create_all"
] | [((399, 422), 'pytest.fixture', 'fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (406, 422), False, 'from pytest import fixture\n'), ((581, 604), 'pytest.fixture', 'fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (588, 604), False, 'from pytest import fixture\n'), ((739, 762), 'pytest.... |
# -*- coding: utf-8 -*-
# Originally written by <NAME> (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/Albertino.py
import string
from struct import unpack
def calc_length(byte_str):
return unpack(">H", byte_str)[0]
def string_print(line):
return [x for x in line if x in string.p... | [
"struct.unpack"
] | [((224, 246), 'struct.unpack', 'unpack', (['""">H"""', 'byte_str'], {}), "('>H', byte_str)\n", (230, 246), False, 'from struct import unpack\n')] |
import json
from starlette.testclient import TestClient
from main import app
def test_results_are_the_same():
client = TestClient(app)
result_mongo = json.loads(client.get("/records/1").content.decode('utf-8'))
result_python = json.loads(client.get("/records_py/1").content.decode('utf-8'))
shared_i... | [
"starlette.testclient.TestClient"
] | [((127, 142), 'starlette.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (137, 142), False, 'from starlette.testclient import TestClient\n')] |
'''Build the Bilinear CNN model.'''
from tensorflow.python.keras import backend as keras_backend
from tensorflow.python.keras.layers import Input, Reshape, Dense, Lambda, Activation
from tensorflow.python.keras.optimizers import adam, RMSprop, SGD
from tensorflow.python.keras.models import Model
from tensorflow.python... | [
"tensorflow.python.keras.layers.Lambda",
"tensorflow.python.keras.regularizers.l2",
"tensorflow.python.keras.backend.sign",
"tensorflow.python.keras.layers.Activation",
"tensorflow.python.keras.applications.densenet.DenseNet121",
"tensorflow.python.keras.models.Model",
"tensorflow.python.keras.backend.a... | [((1425, 1465), 'tensorflow.python.keras.backend.l2_normalize', 'keras_backend.l2_normalize', (['x'], {'axis': 'axis'}), '(x, axis=axis)\n', (1451, 1465), True, 'from tensorflow.python.keras import backend as keras_backend\n'), ((2672, 2713), 'tensorflow.python.keras.layers.Input', 'Input', ([], {'shape': '[size_height... |
import unittest
from tests.base import BaseTestCase
class ApiExampleApiTestCase(BaseTestCase):
def test_get_api_examples(self):
pass
def test_new_api_example(self):
pass
def test_edit_api_example(self):
pass
def test_delete_api_example(self):
pass
if __name__ == '_... | [
"unittest.main"
] | [((334, 349), 'unittest.main', 'unittest.main', ([], {}), '()\n', (347, 349), False, 'import unittest\n')] |
##########################################################################
# NSAp - Copyright (C) CEA, 2013
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
##########... | [
"numpy.mean",
"nibabel.save",
"nibabel.load",
"numpy.where",
"numpy.asarray",
"os.path.join",
"numpy.sum",
"numpy.zeros",
"os.path.isdir",
"os.mkdir",
"numpy.concatenate",
"numpy.savetxt",
"numpy.loadtxt"
] | [((1205, 1231), 'nibabel.load', 'nibabel.load', (['dwi_nii_path'], {}), '(dwi_nii_path)\n', (1217, 1231), False, 'import nibabel\n'), ((1669, 1715), 'numpy.mean', 'numpy.mean', (['dwi_array[..., b0_indices]'], {'axis': '(3)'}), '(dwi_array[..., b0_indices], axis=3)\n', (1679, 1715), False, 'import numpy\n'), ((1792, 18... |
import subprocess
import psycopg2
from subprocess import PIPE
import json
import re
import os
#class DoSOCSv2(object):
#"""Uses the DoSOCSv2 database to return dataframes with interesting GitHub indicators"""
def scan(repo_name):
connection = psycopg2.connect(
user = "augur",
password = "****"... | [
"psycopg2.connect",
"json.dumps",
"json.dump"
] | [((253, 352), 'psycopg2.connect', 'psycopg2.connect', ([], {'user': '"""augur"""', 'password': '"""****"""', 'database': '"""augur"""', 'host': '"""localhost"""', 'port': '(5433)'}), "(user='augur', password='****', database='augur', host=\n 'localhost', port=5433)\n", (269, 352), False, 'import psycopg2\n'), ((6377... |
# pylint: disable=too-many-arguments
"""Helper code for api.py and async_api.py."""
from base64 import b64encode
from typing import Any, Dict, List, Optional, Tuple, Union, cast
try:
from typing import Literal # type: ignore
except ImportError:
from typing_extensions import Literal # type: ignore
from warni... | [
"solana.blockhash.BlockhashCache",
"based58.b58encode",
"base64.b64encode",
"solana.rpc.types.RPCMethod",
"solana.blockhash.Blockhash",
"warnings.warn",
"typing.cast"
] | [((1324, 1358), 'solana.rpc.types.RPCMethod', 'types.RPCMethod', (['"""getClusterNodes"""'], {}), "('getClusterNodes')\n", (1339, 1358), False, 'from solana.rpc import types\n'), ((1385, 1420), 'solana.rpc.types.RPCMethod', 'types.RPCMethod', (['"""getEpochSchedule"""'], {}), "('getEpochSchedule')\n", (1400, 1420), Fal... |
#Copyright 2019 Adobe. All rights reserved.
#This file is licensed to you 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 ag... | [
"json.loads",
"json.dumps"
] | [((1131, 1175), 'json.dumps', 'json.dumps', (['result'], {'sort_keys': '(True)', 'indent': '(2)'}), '(result, sort_keys=True, indent=2)\n', (1141, 1175), False, 'import json\n'), ((1102, 1117), 'json.loads', 'json.loads', (['jsn'], {}), '(jsn)\n', (1112, 1117), False, 'import json\n')] |
# -*- encoding: utf-8 -*-
#
# Copyright © 2017-2018 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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/LICE... | [
"gnocchi.utils.get_driver_class",
"collections.namedtuple",
"six.moves.range",
"numpy.array",
"daiquiri.getLogger",
"numpy.concatenate",
"numpy.frombuffer",
"six.iteritems",
"gnocchi.utils.retry_on_exception_and_log"
] | [((857, 885), 'daiquiri.getLogger', 'daiquiri.getLogger', (['__name__'], {}), '(__name__)\n', (875, 885), False, 'import daiquiri\n'), ((898, 955), 'collections.namedtuple', 'collections.namedtuple', (['"""Measure"""', "['timestamp', 'value']"], {}), "('Measure', ['timestamp', 'value'])\n", (920, 955), False, 'import c... |
# vFabric Administration Server API
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0... | [
"datetime.datetime.utcfromtimestamp",
"vas.gemfire.CacheServerNodeInstances.CacheServerNodeInstance",
"vas.util.LinkUtils.LinkUtils.get_link_href"
] | [((2889, 2957), 'vas.util.LinkUtils.LinkUtils.get_link_href', 'LinkUtils.get_link_href', (['self._details', '"""cache-server-node-instance"""'], {}), "(self._details, 'cache-server-node-instance')\n", (2912, 2957), False, 'from vas.util.LinkUtils import LinkUtils\n'), ((2992, 3041), 'vas.util.LinkUtils.LinkUtils.get_li... |
from core.Database import Database
from model.ProductEntity import ProductEntity
from core.DatabaseConf import DatabaseConf
import re
#https://blog.csdn.net/GuoQiZhang/article/details/91344509
class BaseMapper(object):
def __init__(self, obj, objName):
super(BaseMapper, self).__init__()
self.allMem... | [
"model.ProductEntity.ProductEntity",
"core.Database.Database",
"re.search"
] | [((2894, 2909), 'model.ProductEntity.ProductEntity', 'ProductEntity', ([], {}), '()\n', (2907, 2909), False, 'from model.ProductEntity import ProductEntity\n'), ((3164, 3179), 'model.ProductEntity.ProductEntity', 'ProductEntity', ([], {}), '()\n', (3177, 3179), False, 'from model.ProductEntity import ProductEntity\n'),... |
import click
import rich
from jiractl_shared_functions import get_config
@click.command(name="show")
@click.argument('key', required=False)
@click.pass_context
def show_config(ctx, key):
'''
Shows the current configuration file for JIRA communication and default values
Args:
key (str): the key to ... | [
"rich.print",
"click.argument",
"click.command",
"jiractl_shared_functions.get_config"
] | [((75, 101), 'click.command', 'click.command', ([], {'name': '"""show"""'}), "(name='show')\n", (88, 101), False, 'import click\n'), ((103, 140), 'click.argument', 'click.argument', (['"""key"""'], {'required': '(False)'}), "('key', required=False)\n", (117, 140), False, 'import click\n'), ((353, 365), 'jiractl_shared_... |
# -*- test-case-name: vumi.transports.smpp.tests.test_smpp -*-
from datetime import datetime
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from vumi import log
from vumi.utils import get_operator_number
from vumi.transports.base import Transport
from vumi.transp... | [
"vumi.log.err",
"twisted.internet.reactor.connectTCP",
"vumi.transports.smpp.clientserver.client.EsmeCallbacks",
"vumi.transports.smpp.clientserver.config.ClientConfig.from_config",
"datetime.datetime.strptime",
"vumi.transports.smpp.clientserver.client.EsmeReceiverFactory",
"vumi.log.msg",
"vumi.tran... | [((5273, 5310), 'vumi.transports.smpp.clientserver.config.ClientConfig.from_config', 'ClientConfig.from_config', (['self.config'], {}), '(self.config)\n', (5297, 5310), False, 'from vumi.transports.smpp.clientserver.config import ClientConfig\n'), ((5448, 5507), 'vumi.log.msg', 'log.msg', (["('Starting the SmppTranspor... |
from resources.robot_driver import RobotDriver
class BaseController:
def __init__(self):
self.robot_driver = RobotDriver()
| [
"resources.robot_driver.RobotDriver"
] | [((124, 137), 'resources.robot_driver.RobotDriver', 'RobotDriver', ([], {}), '()\n', (135, 137), False, 'from resources.robot_driver import RobotDriver\n')] |
"""
Copyright 2020 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | [
"setuptools.setup"
] | [((586, 1047), 'setuptools.setup', 'setup', ([], {'name': '"""asaph"""', 'version': '(2.0)', 'description': '"""SNP analysis"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""Apache License, Version 2.0"""', 'zip_safe': '(False)', 'packages': "['asaph']", 'python_requires': '""">=3.6"""', '... |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2021 BigML
#
# 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 ... | [
"os.path.exists",
"datetime.datetime.utcnow",
"nose.tools.assert_less",
"bigml.api_handlers.externalconnectorhandler.get_env_connection_info",
"bigml.util.get_exponential_wait",
"os.environ.get",
"pkg_resources.resource_filename",
"time.sleep",
"pprint.pformat",
"bigml.constants.RENAMED_RESOURCES.... | [((6711, 6767), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""bigml"""', "('../%s' % file)"], {}), "('bigml', '../%s' % file)\n", (6742, 6767), False, 'import pkg_resources\n'), ((8279, 8300), 'time.sleep', 'time.sleep', (['wait_time'], {}), '(wait_time)\n', (8289, 8300), False, 'import ti... |
__author__ = '<NAME>'
import time
class simpleclass:
def __init__(self):
self.variable = '\033[92m' + "[*]: i belong to the class" + '\033[0m'
def class_function(self):
print(self.variable)
@staticmethod
def static_function():
print('\033[92m' + "[*]: i don't need this class"... | [
"time.sleep"
] | [((415, 430), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (425, 430), False, 'import time\n'), ((658, 671), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (668, 671), False, 'import time\n'), ((788, 801), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (798, 801), False, 'import time\n'), ((888, 90... |
"""
Zombie Apocalypse mini-project
Using Breadth-First 2D Search
Principles of Computing Part 2
Author: <NAME>
Date: 7/14/15
CodeSkulptor source:
http://www.codeskulptor.org/#user40_iQQZl747fQ_13.py
"""
import random
import poc_grid
import poc_queue
import poc_zombie_gui
# global constants
EMPTY = 0
FULL = 1
FOUR_... | [
"random.choice",
"poc_grid.Grid.get_grid_width",
"poc_grid.Grid.clear",
"poc_grid.Grid.get_grid_height",
"poc_grid.Grid.__init__",
"poc_grid.Grid.eight_neighbors",
"poc_queue.Queue",
"poc_grid.Grid.is_empty",
"poc_grid.Grid",
"poc_grid.Grid.four_neighbors"
] | [((756, 809), 'poc_grid.Grid.__init__', 'poc_grid.Grid.__init__', (['self', 'grid_height', 'grid_width'], {}), '(self, grid_height, grid_width)\n', (778, 809), False, 'import poc_grid\n'), ((1349, 1374), 'poc_grid.Grid.clear', 'poc_grid.Grid.clear', (['self'], {}), '(self)\n', (1368, 1374), False, 'import poc_grid\n'),... |
# -*- coding: utf-8 -*-
"""
YEPY 控制器模块
by <EMAIL>
增加控制器的步骤:
1,新建xxxx.py
2,修改config.py[核心配置],注册新控制器
"""
from flask import Blueprint, render_template, abort, request, current_app, make_response
from jinja2 import TemplateNotFound
import bucket
_yepy_controller_version = '1.0b'
def init():
# init before action
o... | [
"flask.render_template",
"flask.abort",
"bucket.ConfigG"
] | [((325, 341), 'bucket.ConfigG', 'bucket.ConfigG', ([], {}), '()\n', (339, 341), False, 'import bucket\n'), ((731, 741), 'flask.abort', 'abort', (['(404)'], {}), '(404)\n', (736, 741), False, 'from flask import Blueprint, render_template, abort, request, current_app, make_response\n'), ((485, 537), 'flask.render_templat... |
#!/usr/bin/env python
import re,sys
import avh_pc_olo
sysargv = sys.argv
srcdir = re.sub(r'avh_olo\.py','',sysargv[0])
del sysargv[0]
kindmod = ''
dpkind = ''
qpkind = ''
ddtype = ''
qdtype = ''
mptype = ''
tlevel = ''
cppintf = ''
for option in sysargv:
if re.match(r'kindmod',option): kindmod = re.sub(r'kindmo... | [
"re.sub",
"re.match",
"sys.exit",
"avh_pc_olo.full"
] | [((83, 121), 're.sub', 're.sub', (['"""avh_olo\\\\.py"""', '""""""', 'sysargv[0]'], {}), "('avh_olo\\\\.py', '', sysargv[0])\n", (89, 121), False, 'import re, sys\n'), ((1842, 1935), 'avh_pc_olo.full', 'avh_pc_olo.full', (['srcdir', 'dpkind', 'qpkind', 'kindmod', 'ddtype', 'qdtype', 'mptype', 'tlevel', 'cppintf'], {}),... |
from flask import url_for, render_template, session, request, redirect
from functools import wraps
from .. import app
from .. import db
account_type = {
"ma" : "manager",
"em" : "employee",
"hr" : "hr"}
def require_access(access_level):
def decorator(func):
@wraps(func)
def decorated_func(*args... | [
"flask.render_template",
"functools.wraps"
] | [((698, 709), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (703, 709), False, 'from functools import wraps\n'), ((1023, 1054), 'flask.render_template', 'render_template', (['"""em-home.html"""'], {}), "('em-home.html')\n", (1038, 1054), False, 'from flask import url_for, render_template, session, request, re... |
#!/usr/bin/env python3 -u
# coding: utf-8
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__all__ = ["NaiveForecaster"]
__author__ = "<NAME>"
from warnings import warn
import numpy as np
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.forecasting.base._sktime import BaseLa... | [
"numpy.tile",
"numpy.ceil",
"sktime.utils.validation.forecasting.check_sp",
"numpy.nanmean",
"sktime.utils.validation.forecasting.check_window_length",
"numpy.isnan",
"warnings.warn"
] | [((3381, 3398), 'sktime.utils.validation.forecasting.check_sp', 'check_sp', (['self.sp'], {}), '(self.sp)\n', (3389, 3398), False, 'from sktime.utils.validation.forecasting import check_sp\n'), ((3621, 3660), 'sktime.utils.validation.forecasting.check_window_length', 'check_window_length', (['self.window_length'], {}),... |
# -*- coding: utf-8 -*-
import ipaddress
import json
import re
from datetime import datetime
from functools import lru_cache
from django.contrib import messages
from django.contrib.admin import SimpleListFilter
from django.contrib.admin.filters import FieldListFilter
from django.contrib.admin.options import IncorrectL... | [
"django.utils.translation.ugettext_lazy",
"ralph.security.models.SecurityScan.objects.filter",
"django.contrib.admin.filters.FieldListFilter.create",
"ralph.admin.autocomplete.get_results",
"re.compile",
"ralph.admin.helpers.get_field_by_relation_path",
"ralph.lib.mixins.fields.MACAddressField.normalize... | [((1098, 1116), 're.compile', 're.compile', (['"""[;|]"""'], {}), "('[;|]')\n", (1108, 1116), False, 'import re\n'), ((1148, 1165), 're.compile', 're.compile', (['"""[&]"""'], {}), "('[&]')\n", (1158, 1165), False, 'import re\n'), ((1170, 1181), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (1179, 1181), False,... |
import os
import sys
import mxnet as mx
def cifar100_iterator(cfg, kv):
train_rec = os.path.join(cfg.dataset.data_dir, "cifar100_train.rec")
val_rec = os.path.join(cfg.dataset.data_dir, "cifar100_test.rec")
mean = [129.31, 124.11, 112.4]
std = [68.21, 65.41, 70.41]
train = mx.io.ImageRecordIter... | [
"mxnet.io.ImageRecordIter",
"os.path.join"
] | [((91, 147), 'os.path.join', 'os.path.join', (['cfg.dataset.data_dir', '"""cifar100_train.rec"""'], {}), "(cfg.dataset.data_dir, 'cifar100_train.rec')\n", (103, 147), False, 'import os\n'), ((162, 217), 'os.path.join', 'os.path.join', (['cfg.dataset.data_dir', '"""cifar100_test.rec"""'], {}), "(cfg.dataset.data_dir, 'c... |
import os
import logging
from xml.dom.pulldom import parseString
import IPython.display as ipyd
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from sklearn.feature_extraction import img_to_graph
import torchvisio... | [
"logging.getLogger",
"plotly.graph_objects.Surface",
"PIL.Image.fromarray",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.text",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.close",
"n... | [((370, 397), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (387, 397), False, 'import logging\n'), ((681, 716), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'first'], {'label': 'labels[0]'}), '(x, first, label=labels[0])\n', (689, 716), True, 'import matplotlib.pyplot as plt\n'), ((721,... |
"""
Create an applet from a Python script.
You can drag in packages, Info.plist files, icons, etc.
It's expected that only one Python script is dragged in.
"""
from __future__ import print_function
import os, sys
from distutils.core import setup
from plistlib import Plist
import py2app
import tempfile
import shutil
... | [
"os.path.exists",
"distutils.core.setup",
"plistlib.Plist.fromFile",
"os.getcwd",
"os.chdir",
"os.path.dirname",
"os.path.realpath",
"os.path.isdir",
"tempfile.mkdtemp",
"os.path.basename",
"shutil.rmtree",
"os.path.abspath",
"sets.Set"
] | [((1259, 1264), 'sets.Set', 'set', ([], {}), '()\n', (1262, 1264), True, 'from sets import Set as set\n'), ((3981, 4007), 'os.path.exists', 'os.path.exists', (['"""setup.py"""'], {}), "('setup.py')\n", (3995, 4007), False, 'import os, sys\n'), ((4617, 4622), 'sets.Set', 'set', ([], {}), '()\n', (4620, 4622), True, 'fro... |
from libs import reaction as reactioncommand
import asyncio, re, discord
from libs import savetome
class Reaction(reactioncommand.AdminReactionAddCommand):
'''Creates messages that work with `give_role` and `remove_role` reaction commands
**Usage**
Send a message of the following form
```
` ``
<emoji id 1> : <rol... | [
"libs.savetome.save_role_messages",
"re.match",
"re.search"
] | [((1520, 1577), 're.search', 're.search', (['"""\\\\`{3}((\\\\s|.)+)\\\\`{3}"""', 'content', '(re.I | re.M)'], {}), "('\\\\`{3}((\\\\s|.)+)\\\\`{3}', content, re.I | re.M)\n", (1529, 1577), False, 'import asyncio, re, discord\n'), ((1297, 1389), 'libs.savetome.save_role_messages', 'savetome.save_role_messages', (['bot.... |
from wemake_python_styleguide.compat.packaging import (
PackageNotFoundError,
get_version,
)
def _get_version(dist_name: str) -> str: # pragma: no cover
"""Fetches distribution version."""
try:
return get_version(dist_name)
except PackageNotFoundError:
return '' # readthedocs can... | [
"wemake_python_styleguide.compat.packaging.get_version"
] | [((228, 250), 'wemake_python_styleguide.compat.packaging.get_version', 'get_version', (['dist_name'], {}), '(dist_name)\n', (239, 250), False, 'from wemake_python_styleguide.compat.packaging import PackageNotFoundError, get_version\n')] |
import base64
import uuid
from django import forms
from django.core.files.uploadedfile import SimpleUploadedFile
from webcam.widgets import CameraWidget
class CameraField(forms.FileField):
widget = CameraWidget
def __init__(self, width=320, height=240, format='jpg',
camera_width=320, camera_... | [
"uuid.uuid4"
] | [((1231, 1243), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1241, 1243), False, 'import uuid\n')] |
import os
import sys
import argparse
import logging
from typing import Set
import pathlib
from typing import List
curdir = pathlib.Path(__file__).parent.absolute()
sys.path.insert(0, f"{curdir}/../../../")
from src.utils import read_terms
logger = logging.getLogger(__name__)
def filter_terms(
terms_path: str,
... | [
"logging.getLogger",
"sys.path.insert",
"argparse.ArgumentParser",
"pathlib.Path",
"os.makedirs",
"src.utils.read_terms",
"os.path.isfile",
"os.path.dirname",
"sys.exit"
] | [((165, 206), 'sys.path.insert', 'sys.path.insert', (['(0)', 'f"""{curdir}/../../../"""'], {}), "(0, f'{curdir}/../../../')\n", (180, 206), False, 'import sys\n'), ((251, 278), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (268, 278), False, 'import logging\n'), ((690, 712), 'src.utils.r... |
from mn_gml import MnGML
from mininet.net import CLI
import os
mn_gml = MnGML(os.path.join(os.getcwd(), "examples/ping/Abilene.graphml"), image_name="qarawlus/ping")
net = mn_gml.net
topology = mn_gml.topology
# net, topology = mn_cls(controller=Controller)
net.start()
# CLI(net)
net.stop()
print("Done")
| [
"os.getcwd"
] | [((92, 103), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (101, 103), False, 'import os\n')] |
import pandas as pd
def pandas_excel_write(save_dir_path: str):
data1 = """
class precision recall
<18 0.0125 12
18-24 0.0250 16
25-34 0.00350 4
"""
data2 = """
sample values
<18 0
18-24 0.25
25-34 0.35
... | [
"pandas.Series",
"pandas.ExcelWriter",
"pandas.compat.StringIO"
] | [((637, 689), 'pandas.ExcelWriter', 'pd.ExcelWriter', (['write_file_path'], {'engine': '"""xlsxwriter"""'}), "(write_file_path, engine='xlsxwriter')\n", (651, 689), True, 'import pandas as pd\n'), ((1232, 1284), 'pandas.ExcelWriter', 'pd.ExcelWriter', (['write_file_path'], {'engine': '"""xlsxwriter"""'}), "(write_file_... |
import datetime
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy.orm import relationship
from sqlalchemy import String
from chainerui import database
from chainerui import db
from chainerui.tas... | [
"sqlalchemy.orm.relationship",
"chainerui.db.session.commit",
"chainerui.db.session.add",
"sqlalchemy.Boolean",
"sqlalchemy.ForeignKey",
"sqlalchemy.String",
"datetime.datetime.now",
"chainerui.tasks.crawl_result.crawl_result",
"sqlalchemy.Column"
] | [((450, 483), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (456, 483), False, 'from sqlalchemy import Column\n'), ((689, 738), 'sqlalchemy.orm.relationship', 'relationship', (['"""Log"""'], {'cascade': '"""all, delete-orphan"""'}), "('Log', cascade='all, dele... |
from dataclasses import dataclass
from datetime import date, datetime
from typing import Sequence
from duffel_api.models import OrderChangeOffer
from duffel_api.utils import get_and_transform
@dataclass
class OrderChangeRequestSliceAdd:
"""The slice to be added"""
cabin_class: str
departure_date: date
... | [
"datetime.datetime.strptime",
"duffel_api.models.OrderChangeOffer.from_json",
"datetime.date.fromisoformat"
] | [((565, 607), 'datetime.date.fromisoformat', 'date.fromisoformat', (["json['departure_date']"], {}), "(json['departure_date'])\n", (583, 607), False, 'from datetime import date, datetime\n'), ((2567, 2629), 'datetime.datetime.strptime', 'datetime.strptime', (["json['created_at']", '"""%Y-%m-%dT%H:%M:%S.%fZ"""'], {}), "... |
# coding=utf8
''' Text encoder '''
from __future__ import unicode_literals
from typing import Dict, List
import json
import codecs
import regex as re
__all__ = ['BytePairEncoding', 'get_bpe_from_files']
class BytePairEncoding(object):
def __init__(self, token_dict: Dict[str, int], bpe_rank: Dict[str, int]):
... | [
"json.load",
"codecs.open",
"regex.findall",
"regex.compile"
] | [((800, 906), 'regex.compile', 're.compile', (['"""\'s|\'t|\'re|\'ve|\'m|\'ll|\'d| ?\\\\p{L}+| ?\\\\p{N}+| ?[^\\\\s\\\\p{L}\\\\p{N}]+|\\\\s+(?!\\\\S)|\\\\s+"""'], {}), '(\n "\'s|\'t|\'re|\'ve|\'m|\'ll|\'d| ?\\\\p{L}+| ?\\\\p{N}+| ?[^\\\\s\\\\p{L}\\\\p{N}]+|\\\\s+(?!\\\\S)|\\\\s+"\n )\n', (810, 906), True, 'import... |
import numpy as np
from warnings import warn
from typing import List, Callable
from desdeo_emo.selection.SelectionBase import SelectionBase
from desdeo_emo.population.Population import Population
from desdeo_emo.othertools.ReferenceVectors import ReferenceVectors
from typing import TYPE_CHECKING
from desdeo_emo.otherto... | [
"numpy.mean",
"numpy.arccos",
"numpy.amin",
"numpy.hstack",
"numpy.where",
"numpy.power",
"numpy.asarray",
"numpy.argmax",
"desdeo_emo.othertools.ProbabilityWrong.Probability_wrong",
"numpy.array",
"numpy.dot",
"numpy.isnan",
"numpy.linalg.norm",
"numpy.nanmin",
"numpy.shape",
"numpy.t... | [((2344, 2368), 'numpy.amin', 'np.amin', (['fitness'], {'axis': '(0)'}), '(fitness, axis=0)\n', (2351, 2368), True, 'import numpy as np\n'), ((2436, 2478), 'numpy.linalg.norm', 'np.linalg.norm', (['translated_fitness'], {'axis': '(1)'}), '(translated_fitness, axis=1)\n', (2450, 2478), True, 'import numpy as np\n'), ((2... |
"""Widget demonstration of magicgui."""
import datetime
from enum import Enum
from pathlib import Path
from magicgui import magicgui
class Medium(Enum):
"""Enum for various media and their refractive indices."""
Glass = 1.520
Oil = 1.515
Water = 1.333
Air = 1.0003
@magicgui(
main_window=T... | [
"datetime.time",
"pathlib.Path.home",
"magicgui.magicgui",
"datetime.datetime.now",
"datetime.date"
] | [((293, 684), 'magicgui.magicgui', 'magicgui', ([], {'main_window': '(True)', 'call_button': '"""Calculate"""', 'layout': '"""vertical"""', 'result_widget': '(True)', 'slider_float': "{'widget_type': 'FloatSlider', 'max': 100}", 'slider_int': "{'widget_type': 'Slider', 'readout': False}", 'radio_option': "{'widget_type... |
from capstone import *
from capstone.x86 import *
from elftools.elf.elffile import ELFFile
import sys
NUMBER_OF_CANDIDATES = 20
MAX_RSP_OFFSET = 0x200
ONE_GADGET_LIB_DEBUG = False
# add
# call
# jmp
# lea
# mov
# nop
# push
# sub
# xor
# movq
# movaps
# movhps
# Most practical gadgets have simple constraints.
# S... | [
"elftools.elf.elffile.ELFFile"
] | [((13996, 14006), 'elftools.elf.elffile.ELFFile', 'ELFFile', (['f'], {}), '(f)\n', (14003, 14006), False, 'from elftools.elf.elffile import ELFFile\n')] |
import yaml
import os
import hashlib
import requests
from copy import deepcopy
def _version_key(v: str):
if v.startswith('cci.'):
return _version_key(f"0.{v[4:]}")
if v.startswith('v'):
return _version_key(v[1:])
tokens = v.split('.')
try:
return [int(it) for it in tokens]
... | [
"hashlib.sha256",
"argparse.ArgumentParser",
"yaml.dump",
"os.path.join",
"requests.get",
"yaml.safe_load",
"copy.deepcopy"
] | [((424, 467), 'os.path.join', 'os.path.join', (['"""recipes"""', 'name', '"""config.yml"""'], {}), "('recipes', name, 'config.yml')\n", (436, 467), False, 'import os\n'), ((1184, 1246), 'os.path.join', 'os.path.join', (['"""recipes"""', 'name', 'version_folder', '"""conandata.yml"""'], {}), "('recipes', name, version_f... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import ProjectKey
from sentry.testutils import APITestCase
class ListProjectKeysTest(APITestCase):
def test_simple(self):
project = self.create_project()
key = ProjectKey.objects.get_or_create(... | [
"sentry.models.ProjectKey.objects.get_or_create",
"sentry.models.ProjectKey.objects.get",
"django.core.urlresolvers.reverse"
] | [((392, 520), 'django.core.urlresolvers.reverse', 'reverse', (['"""sentry-api-0-project-keys"""'], {'kwargs': "{'organization_slug': project.organization.slug, 'project_slug': project.slug}"}), "('sentry-api-0-project-keys', kwargs={'organization_slug': project.\n organization.slug, 'project_slug': project.slug})\n"... |
from puzzle.utils import (get_gene_info, get_cytoband_coord)
class BaseVariantMixin(object):
"""Base class for variant mixins"""
def variants(self, case_id, skip=0, count=30, filters=None):
"""Return a results tuple with variants and nr_of_variants.
"""
raise NotImplementedError
... | [
"puzzle.utils.get_gene_info",
"puzzle.utils.get_cytoband_coord"
] | [((1060, 1125), 'puzzle.utils.get_gene_info', 'get_gene_info', ([], {'ensembl_ids': 'ensembl_ids', 'hgnc_symbols': 'hgnc_symbols'}), '(ensembl_ids=ensembl_ids, hgnc_symbols=hgnc_symbols)\n', (1073, 1125), False, 'from puzzle.utils import get_gene_info, get_cytoband_coord\n'), ((2050, 2108), 'puzzle.utils.get_cytoband_c... |
import os
def makedirs(path):
try:
os.makedirs(os.path.expanduser(path))
return True, "Created: {}".format(path)
except Exception as err:
return False, "Failed to create the directory path: {} - {}".format(path, err)
return False, "Failed to create the directory path: {}".format(pa... | [
"os.path.dirname",
"os.path.exists",
"os.path.expanduser"
] | [((825, 846), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (840, 846), False, 'import os\n'), ((1970, 1994), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1988, 1994), False, 'import os\n'), ((61, 85), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n'... |
# coding: utf-8
"""
qTest Manager API Version 8.6 - 9.1
qTest Manager API Version 8.6 - 9.1
OpenAPI spec version: 8.6 - 9.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class TestCycleRes... | [
"six.iteritems"
] | [((9925, 9954), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9934, 9954), False, 'from six import iteritems\n')] |
import discord
from discord.ext import commands
from Kiraro import bot
import json
import asyncio
@bot.command(aliases=['del_rank', 'delrank', 'remove_rank'])
@commands.has_permissions(administrator=True)
async def deleterank(ctx, ranking):
def check(m):
return m.author == ctx.author
if ranking.low... | [
"discord.ext.commands.has_permissions",
"Kiraro.bot.wait_for",
"Kiraro.bot.command",
"json.load",
"discord.Color.blue",
"discord.Embed",
"json.dump",
"discord.Color.red"
] | [((102, 161), 'Kiraro.bot.command', 'bot.command', ([], {'aliases': "['del_rank', 'delrank', 'remove_rank']"}), "(aliases=['del_rank', 'delrank', 'remove_rank'])\n", (113, 161), False, 'from Kiraro import bot\n'), ((163, 207), 'discord.ext.commands.has_permissions', 'commands.has_permissions', ([], {'administrator': '(... |
from django.urls import reverse
from django_filters.views import FilterView
from django_tables2.views import SingleTableMixin
from guardian.mixins import LoginRequiredMixin
from service_catalog.filters.operation_filter import OperationFilter
from service_catalog.models import Operation, Service
from service_catalog.ta... | [
"service_catalog.models.Service.objects.get",
"django.urls.reverse"
] | [((1164, 1203), 'django.urls.reverse', 'reverse', (['"""service_catalog:service_list"""'], {}), "('service_catalog:service_list')\n", (1171, 1203), False, 'from django.urls import reverse\n'), ((1253, 1295), 'django.urls.reverse', 'reverse', (['"""service_catalog:manage_services"""'], {}), "('service_catalog:manage_ser... |
"""
Methods for transforming Robot Framework ast model programmatically.
"""
from typing import Optional
from robotidy.app import Robotidy
from robotidy.cli import find_and_read_config, TransformType, validate_regex
from robotidy.files import DEFAULT_EXCLUDES
from robotidy.utils import GlobalFormattingConfig
class R... | [
"robotidy.cli.find_and_read_config",
"robotidy.cli.TransformType",
"robotidy.cli.validate_regex"
] | [((426, 454), 'robotidy.cli.find_and_read_config', 'find_and_read_config', (['(src,)'], {}), '((src,))\n', (446, 454), False, 'from robotidy.cli import find_and_read_config, TransformType, validate_regex\n'), ((573, 588), 'robotidy.cli.TransformType', 'TransformType', ([], {}), '()\n', (586, 588), False, 'from robotidy... |
from django import forms
from django.contrib.auth.models import User
from django.contrib.admin.widgets import FilteredSelectMultiple
from .models import Profile, Course
from register.models import Team
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('first_name', 'last_name',... | [
"register.models.Team.objects.all",
"django.forms.CharField",
"django.forms.CheckboxSelectMultiple"
] | [((1915, 1993), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(6)', 'label': '"""PIN"""', 'help_text': '"""Ask team admin for PIN"""'}), "(max_length=6, label='PIN', help_text='Ask team admin for PIN')\n", (1930, 1993), False, 'from django import forms\n'), ((1284, 1314), 'django.forms.CheckboxSelec... |
#!/usr/bin/env python
# coding=utf-8
"""New Document serializer/deserializer."""
from unittest import TestCase
from bson import ObjectId
import mongoengine as db
from mongoengine_goodjson import GoodJSONEncoder, Document, EmbeddedDocument
from mongoengine_goodjson.document import Helper
try:
from unittest.mock ... | [
"mock.patch",
"json.dumps",
"mongoengine.StringField",
"mock.call",
"bson.ObjectId",
"mock.MagicMock",
"mongoengine.ReferenceField"
] | [((2020, 2039), 'mock.patch', 'patch', (['"""json.dumps"""'], {}), "('json.dumps')\n", (2025, 2039), False, 'from mock import patch, MagicMock, call\n'), ((3978, 4037), 'mock.patch', 'patch', (['"""mongoengine_goodjson.document.generate_object_hook"""'], {}), "('mongoengine_goodjson.document.generate_object_hook')\n", ... |
import time
import os
import pandas as pd
import re
# %a 星期的简写。如 星期三为Web
# %A 星期的全写。如 星期三为Wednesday
# %b 月份的简写。如4月份为Apr
# %B 月份的全写。如4月份为April
# %c: 日期时间的字符串表示。(如: 04/07/10 10:43:39)
# %d: 日在这个月中的天数(是这个月的第几天)
# %f: 微秒(范围[0,999999])
# %H: 小时(24小时制,[0, 23])
# %I: 小时(12小时制,[0, 11])
# %j: 日在年中的天数 [001,366](是当年的第几天)
# ... | [
"os.path.exists",
"time.strptime",
"os.listdir",
"os.makedirs",
"pandas.read_csv",
"re.compile",
"time.strftime",
"pandas.read_excel",
"pandas.DataFrame",
"time.localtime",
"pandas.concat"
] | [((779, 810), 'time.strptime', 'time.strptime', (['date', '"""%Y-%m-%d"""'], {}), "(date, '%Y-%m-%d')\n", (792, 810), False, 'import time\n'), ((822, 857), 'time.strftime', 'time.strftime', (['"""%Y%m%d"""', 'time_array'], {}), "('%Y%m%d', time_array)\n", (835, 857), False, 'import time\n'), ((906, 944), 'time.strptime... |
# -*- coding: utf-8 -*-
"""
Written by <NAME>
Email: danaukes<at>gmail.com
Please see LICENSE for full license.
"""
import pynamics
from pynamics.frame import Frame
from pynamics.variable_types import Differentiable,Constant,Variable
from pynamics.system import System
from pynamics.body import Body
from pynamics.dyadi... | [
"pynamics.system.System",
"pynamics.body.Body",
"pynamics.dyadic.Dyadic.build",
"pynamics.set_system",
"pynamics.frame.Frame",
"matplotlib.pyplot.plot",
"pynamics.variable_types.Constant",
"matplotlib.pyplot.figure",
"pynamics.output.Output",
"pynamics.variable_types.Variable",
"matplotlib.pyplo... | [((498, 507), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (505, 507), True, 'import matplotlib.pyplot as plt\n'), ((537, 545), 'pynamics.system.System', 'System', ([], {}), '()\n', (543, 545), False, 'from pynamics.system import System\n'), ((546, 583), 'pynamics.set_system', 'pynamics.set_system', (['__name_... |
import numpy
import os
import torch as torch
import torch.nn as nn
import torch.nn.functional as F
from utils.node_object_creator import *
from layers.coding_layer import Coding_layer
from layers.convolutional_layer import Convolutional_layer
from layers.pooling_layer import Pooling_layer
from layers.dynamic_pooling i... | [
"os.path.exists",
"layers.dynamic_pooling.Max_pooling_layer",
"layers.convolutional_layer.Convolutional_layer",
"os.path.join",
"layers.hidden_layer.Hidden_layer",
"os.mkdir",
"layers.pooling_layer.Pooling_layer",
"layers.dynamic_pooling.Dynamic_pooling_layer"
] | [((943, 1031), 'layers.convolutional_layer.Convolutional_layer', 'Convolutional_layer', (['self.vector_size', 'self.device'], {'features_size': 'self.feature_size'}), '(self.vector_size, self.device, features_size=self.\n feature_size)\n', (962, 1031), False, 'from layers.convolutional_layer import Convolutional_lay... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import print_function, with_statement, absolute_import
import contextlib
import os
import socket
import subprocess
import sys
import threading
import... | [
"ptvsd.messaging.JsonIOStream.from_socket",
"socket.socket",
"subprocess.Popen",
"ptvsd.messaging.JsonMessageChannel",
"os.environ.copy",
"time.sleep",
"threading.Event",
"ptvsd.messaging.MessageHandlers",
"os.path.basename",
"threading.Thread",
"ptvsd.messaging.RequestFailure"
] | [((654, 686), 'os.path.basename', 'os.path.basename', (['ptvsd.__file__'], {}), '(ptvsd.__file__)\n', (670, 686), False, 'import os\n'), ((1178, 1195), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1193, 1195), False, 'import threading\n'), ((2613, 2630), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n... |
import torch
import torch.nn as nn
from paccmann_predictor.utils.hyperparams import ACTIVATION_FN_FACTORY
from paccmann_predictor.utils.layers import convolutional_layer
from paccmann_predictor.utils.utils import get_device
from toxsmi.utils.hyperparams import LOSS_FN_FACTORY
class CNN(nn.Module):
""" This is a ... | [
"torch.nn.Linear",
"torch.load",
"paccmann_predictor.utils.utils.get_device",
"paccmann_predictor.utils.layers.convolutional_layer"
] | [((1711, 1723), 'paccmann_predictor.utils.utils.get_device', 'get_device', ([], {}), '()\n', (1721, 1723), False, 'from paccmann_predictor.utils.utils import get_device\n'), ((2972, 3063), 'torch.nn.Linear', 'nn.Linear', (["(self.num_filters[-1] * self.params['smiles_embedding_size'])", 'self.num_tasks'], {}), "(self.n... |
"""
Order CQL expression parser.
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Jul 5, 2011.
"""
from everest.entities.utils import identifier_from_slug
from everest.querying.operators import ASCENDING
from everest.querying.operators i... | [
"everest.entities.utils.identifier_from_slug",
"pyparsing.Word",
"pyparsing.oneOf",
"pyparsing.ZeroOrMore",
"pyparsing.operatorPrecedence",
"pyparsing.Literal"
] | [((798, 810), 'pyparsing.Literal', 'Literal', (['""":"""'], {}), "(':')\n", (805, 810), False, 'from pyparsing import Literal\n'), ((819, 831), 'pyparsing.Literal', 'Literal', (['"""~"""'], {}), "('~')\n", (826, 831), False, 'from pyparsing import Literal\n'), ((844, 870), 'pyparsing.Word', 'Word', (['alphas', "(alphas... |
import RPi.GPIO as GPIO
import datetime
from time import sleep
from picamera import PiCamera
import requests
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
camera = PiCamera()
camera.resolution = (1900, 1080)
#camera.ISO = 1
#camera.shutter_... | [
"RPi.GPIO.setup",
"picamera.PiCamera",
"time.sleep",
"datetime.datetime.now",
"RPi.GPIO.input",
"RPi.GPIO.setmode"
] | [((110, 134), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (122, 134), True, 'import RPi.GPIO as GPIO\n'), ((135, 184), 'RPi.GPIO.setup', 'GPIO.setup', (['(16)', 'GPIO.IN'], {'pull_up_down': 'GPIO.PUD_UP'}), '(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)\n', (145, 184), True, 'import RPi.GPIO a... |
from ..utils import to_value, len_batch
from .callback_tensorboard import CallbackTensorboardBased
from ..train import utilities
from ..train import outputs_trw as O
import functools
import collections
import torch
import numpy as np
import logging
logger = logging.getLogger(__name__)
def get_as_image(images):
... | [
"logging.getLogger",
"torch.Tensor",
"numpy.stack",
"collections.defaultdict",
"functools.partial",
"numpy.concatenate"
] | [((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((7154, 7183), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (7177, 7183), False, 'import collections\n'), ((10363, 10385), 'numpy.concatenate', 'np.con... |
from __future__ import division
import numpy as np
from dolo.algos.dtcscc.simulations import simulate
from dolo.numeric.discretization.quadrature import gauss_hermite_nodes
from dolo.numeric.misc import mlinspace
class EulerErrors(dict):
@property
def max_errors(self):
return self['max_errors']
... | [
"numpy.ravel_multi_index",
"numpy.array",
"numpy.isfinite",
"numpy.row_stack",
"numpy.repeat",
"numpy.max",
"numpy.dot",
"numpy.linspace",
"numpy.random.seed",
"numpy.maximum",
"numpy.tile",
"numpy.ones",
"numpy.random.multivariate_normal",
"numpy.floor",
"time.time",
"dolo.numeric.mis... | [((1533, 1557), 'numpy.zeros', 'np.zeros', (['sigma.shape[0]'], {}), '(sigma.shape[0])\n', (1541, 1557), True, 'import numpy as np\n'), ((1563, 1583), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1577, 1583), True, 'import numpy as np\n'), ((1599, 1650), 'numpy.random.multivariate_normal', 'np.ra... |
from .packet_buffer import PacketBuffer
from zlib import compress
from minecraft.networking.types import (
VarInt, Enum
)
class Packet(object):
packet_name = "base"
id = None
definition = None
# To define the packet ID, either:
# 1. Define the attribute `id', of type int, in a subclass; or
... | [
"zlib.compress",
"minecraft.networking.types.VarInt.send"
] | [((3750, 3785), 'minecraft.networking.types.VarInt.send', 'VarInt.send', (['self.id', 'packet_buffer'], {}), '(self.id, packet_buffer)\n', (3761, 3785), False, 'from minecraft.networking.types import VarInt, Enum\n'), ((2779, 2800), 'zlib.compress', 'compress', (['packet_data'], {}), '(packet_data)\n', (2787, 2800), Fa... |
from loguru import logger
from aiogram import types
from aiogram.dispatcher.filters import IDFilter, Text
import bot_loader
from bot_loader import dp
from data.config import duty_team_ids, incidents_urn_bat, tasks_urn_bat
from keyboards.kb_tickets import cb_ticket_data
from services.messages import edit_ticket_msg, c... | [
"aiogram.dispatcher.filters.Text",
"loguru.logger.debug",
"aiogram.dispatcher.filters.IDFilter",
"loguru.logger.info",
"services.tickets.get_ticket_data",
"bot_loader.redis_client.lrem",
"services.messages.edit_ticket_msg",
"bot_loader.redis_client.lrange",
"services.tickets.save_ticket_data",
"se... | [((631, 674), 'loguru.logger.debug', 'logger.debug', (['f"""Ticket name: {ticket_name}"""'], {}), "(f'Ticket name: {ticket_name}')\n", (643, 674), False, 'from loguru import logger\n'), ((456, 487), 'aiogram.dispatcher.filters.IDFilter', 'IDFilter', ([], {'user_id': 'duty_team_ids'}), '(user_id=duty_team_ids)\n', (464,... |
import os
import uuid
import datetime
import base64
from skyportal.tests import api
from skyportal.models import Thumbnail, DBSession, Photometry, Source
def test_token_user_post_get_thumbnail(upload_data_token, public_group):
name = str(uuid.uuid4())
status, data = api('POST', 'telescope',
... | [
"uuid.uuid4",
"datetime.datetime.now",
"os.path.abspath",
"skyportal.tests.api",
"skyportal.models.DBSession.query"
] | [((277, 466), 'skyportal.tests.api', 'api', (['"""POST"""', '"""telescope"""'], {'data': "{'name': name, 'nickname': name, 'lat': 0.0, 'lon': 0.0, 'elevation': 0.0,\n 'diameter': 10.0, 'group_ids': [public_group.id]}", 'token': 'upload_data_token'}), "('POST', 'telescope', data={'name': name, 'nickname': name, 'lat'... |
import maya.cmds as cmds
import pyblish.api
import pype.api
import pype.hosts.maya.api.action
def has_shape_children(node):
# Check if any descendants
allDescendents = cmds.listRelatives(node,
allDescendents=True,
fullPath=True)
... | [
"maya.cmds.delete",
"maya.cmds.ls",
"maya.cmds.listRelatives"
] | [((179, 239), 'maya.cmds.listRelatives', 'cmds.listRelatives', (['node'], {'allDescendents': '(True)', 'fullPath': '(True)'}), '(node, allDescendents=True, fullPath=True)\n', (197, 239), True, 'import maya.cmds as cmds\n'), ((425, 461), 'maya.cmds.ls', 'cmds.ls', (['allDescendents'], {'shapes': '(True)'}), '(allDescend... |
#!/usr/bin/env python3
import functools
import json
import logging.config
import uuid
from concurrent.futures.thread import ThreadPoolExecutor
import tornado.concurrent
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.websocket
from tornado import gen
from auth.user import User
from confi... | [
"model.external_model.config_to_external",
"json.loads",
"web.web_utils.wrap_to_server_event",
"uuid.uuid4",
"tornado.gen.Return",
"model.external_model.parameter_to_external",
"concurrent.futures.thread.ThreadPoolExecutor"
] | [((1325, 1410), 'concurrent.futures.thread.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': '(1)', 'thread_name_prefix': "('-model-' + self.config_id)"}), "(max_workers=1, thread_name_prefix='-model-' + self.config_id\n )\n", (1343, 1410), False, 'from concurrent.futures.thread import ThreadPoolExecut... |
import math
import pandas as pd
from ..app import app
from . import Surgeon, User
def seed_db(db):
"""Add seed entities to the database."""
with app.app_context():
for x in User.create_defaults():
db.session.add(x)
db.session.commit()
df = pd.read_csv("../data/traditiona... | [
"pandas.read_csv",
"math.isnan"
] | [((289, 327), 'pandas.read_csv', 'pd.read_csv', (['"""../data/traditional.csv"""'], {}), "('../data/traditional.csv')\n", (300, 327), True, 'import pandas as pd\n'), ((452, 477), 'math.isnan', 'math.isnan', (['df.iloc[i][1]'], {}), '(df.iloc[i][1])\n', (462, 477), False, 'import math\n'), ((880, 905), 'math.isnan', 'ma... |
import numpy as np
import os
import paddle.fluid as fluid
import logging
import args
import random
import time
from evaluator import BiRNN
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger("fluid")
logger.setLevel(logging.INFO)
user_id = 0
class Dataset(object):
def... | [
"logging.basicConfig",
"evaluator.BiRNN",
"logging.getLogger",
"paddle.fluid.save",
"paddle.fluid.io.DataLoader.from_generator",
"paddle.fluid.default_startup_program",
"time.time",
"paddle.fluid.CPUPlace",
"paddle.fluid.default_main_program",
"numpy.random.randint",
"paddle.fluid.Executor",
"... | [((140, 211), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""'}), "(format='%(asctime)s - %(levelname)s - %(message)s')\n", (159, 211), False, 'import logging\n'), ((221, 247), 'logging.getLogger', 'logging.getLogger', (['"""fluid"""'], {}), "('fluid')\n", ... |
from tensorflow.keras.layers import Dense, Input
from tensorflow.keras.layers import Conv1D, Flatten, Lambda,MaxPool1D,BatchNormalization,UpSampling1D,Concatenate,Dropout
from tensorflow.keras.layers import ZeroPadding1D
from tensorflow.keras.layers import Reshape,Layer
from tensorflow.keras.models import Model
from te... | [
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Reshape",
"Enviroments.ExternalEnv.RPNet.network_keras.IncUNet",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.ZeroPadding1D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.l... | [((5581, 5638), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'encoded_shape', 'name': '"""encoder_input_combined"""'}), "(shape=encoded_shape, name='encoder_input_combined')\n", (5586, 5638), False, 'from tensorflow.keras.layers import Dense, Input\n'), ((7254, 7333), 'tensorflow.keras.models.Model', 'Model... |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from common import runtests
from .shared import while_loop_maker
from .shared import setGenerator, setKnownFail... | [
"common.runtests"
] | [((1321, 1346), 'common.runtests', 'runtests', (['test_exceptions'], {}), '(test_exceptions)\n', (1329, 1346), False, 'from common import runtests\n')] |
"""Case for conceptual tests.
ConceptCases are designed to be natural language tests that help
students understand high-level understanding. As such, these test cases
focus mainly on unlocking.
"""
from client import exceptions as ex
from client.sources.common import models as common_models
from client.sources.ok_tes... | [
"logging.getLogger",
"textwrap.dedent",
"client.sources.common.core.List",
"client.sources.common.core.Boolean",
"client.exceptions.SerializeException",
"client.sources.common.core.String"
] | [((426, 453), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (443, 453), False, 'import logging\n'), ((505, 532), 'client.sources.common.core.Boolean', 'core.Boolean', ([], {'default': '(False)'}), '(default=False)\n', (517, 532), False, 'from client.sources.common import core\n'), ((1582... |