code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from functools import partial
from typing import Any, Optional, List
from torchvision.prototype.transforms import ImageNetEval
from torchvision.transforms.functional import InterpolationMode
from ...models.mobilenetv3 import MobileNetV3, _mobilenet_v3_conf, InvertedResidualConfig
from ._api import WeightsEnum, Weight... | [
"functools.partial"
] | [((1531, 1567), 'functools.partial', 'partial', (['ImageNetEval'], {'crop_size': '(224)'}), '(ImageNetEval, crop_size=224)\n', (1538, 1567), False, 'from functools import partial\n'), ((1973, 2026), 'functools.partial', 'partial', (['ImageNetEval'], {'crop_size': '(224)', 'resize_size': '(232)'}), '(ImageNetEval, crop_... |
from django.urls import re_path
from django.views.generic import TemplateView
from .views import RegisterView, VerifyEmailView
urlpatterns = [
re_path(r'^$', RegisterView.as_view(), name='rest_register'),
re_path(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'),
# This url is use... | [
"django.views.generic.TemplateView.as_view"
] | [((971, 993), 'django.views.generic.TemplateView.as_view', 'TemplateView.as_view', ([], {}), '()\n', (991, 993), False, 'from django.views.generic import TemplateView\n')] |
"""dedupper_app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | [
"django.urls.path",
"django.contrib.admin.autodiscover"
] | [((727, 747), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (745, 747), False, 'from django.contrib import admin\n'), ((769, 812), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""contact_index"""'}), "('', views.index, name='contact_index')\n", (773, 812), False, 'fro... |
#!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"logging.basicConfig",
"google.cloud.storage.Client",
"flask.Flask",
"logging.exception",
"transform.create_png",
"google.cloud.storage.Blob",
"logging.info"
] | [((727, 748), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (738, 748), False, 'import flask\n'), ((860, 936), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)s: %(message)s', level=logging.INFO)\n", (... |
import pyperclip
import random
import string
class Credential:
'''
class that generates new credentials
'''
credential_list = []
def __init__(self,username,sitename,password):
self.username = username
self.password = password
self.sitename = sitename
def save_credential(self):
'''
sav... | [
"pyperclip.copy",
"random.choice"
] | [((2094, 2134), 'pyperclip.copy', 'pyperclip.copy', (['find_credential.password'], {}), '(find_credential.password)\n', (2108, 2134), False, 'import pyperclip\n'), ((1419, 1439), 'random.choice', 'random.choice', (['chars'], {}), '(chars)\n', (1432, 1439), False, 'import random\n')] |
import bpy
import random as rnd
from collections import Counter
import itertools as iter
feld_von, feld_bis = -4, 4
spielfeld_von, spielfeld_bis = feld_von-6, feld_bis+6
anz = int((feld_bis-feld_von)**3*.3)
spielfeld = {(rnd.randint(feld_von, feld_bis), rnd.randint(
feld_von, feld_bis), rnd.randint(feld_von, fe... | [
"bpy.context.collection.objects.link",
"bpy.data.objects.new",
"random.randint",
"bpy.ops.mesh.primitive_cube_add"
] | [((950, 1013), 'bpy.ops.mesh.primitive_cube_add', 'bpy.ops.mesh.primitive_cube_add', ([], {'size': '(0.001)', 'location': '(0, 0, 0)'}), '(size=0.001, location=(0, 0, 0))\n', (981, 1013), False, 'import bpy\n'), ((1182, 1208), 'bpy.data.objects.new', 'bpy.data.objects.new', (['n', 'm'], {}), '(n, m)\n', (1202, 1208), F... |
from dataclasses import dataclass
import numpy as np
import xarray as xr
from power_perceiver.load_prepared_batches.data_sources import PV
from power_perceiver.load_prepared_batches.data_sources.prepared_data_source import XarrayBatch
@dataclass
class ReduceNumPVSystems:
"""Reduce the number of PV systems per e... | [
"numpy.nonzero",
"numpy.zeros",
"numpy.random.default_rng",
"xarray.DataArray"
] | [((713, 736), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (734, 736), True, 'import numpy as np\n'), ((942, 1019), 'numpy.zeros', 'np.zeros', ([], {'shape': '(num_examples, self.requested_num_pv_systems)', 'dtype': 'np.int32'}), '(shape=(num_examples, self.requested_num_pv_systems), dtype=np.... |
#encoding=utf8
# 按天生成文件
import logging
import time
from logging.handlers import TimedRotatingFileHandler
#----------------------------------------------------------------------
if __name__ == "__main__":
logFilePath = "timed_test.log"
logger = logging.getLogger("YouLoggerName")
logger.setLevel(logging.... | [
"logging.getLogger",
"logging.Formatter",
"logging.handlers.TimedRotatingFileHandler"
] | [((257, 291), 'logging.getLogger', 'logging.getLogger', (['"""YouLoggerName"""'], {}), "('YouLoggerName')\n", (274, 291), False, 'import logging\n'), ((341, 415), 'logging.handlers.TimedRotatingFileHandler', 'TimedRotatingFileHandler', (['logFilePath'], {'when': '"""d"""', 'interval': '(1)', 'backupCount': '(7)'}), "(l... |
from operator import eq
class PersonAction:
def __init__(self, action):
self.action = action
def __str__(self): return self.action
def __eq__(self, other):
return eq(self.action, other.action)
# Necessary when __cmp__ or __eq__ is defined
# in order to make this class usable as ... | [
"operator.eq"
] | [((195, 224), 'operator.eq', 'eq', (['self.action', 'other.action'], {}), '(self.action, other.action)\n', (197, 224), False, 'from operator import eq\n')] |
# Tool Name :- MyServer
# Author :- LordReaper
# Date :- 13/11/2018 - 9/11/2019
# Powered By :- H1ckPro Software's
import sys
import os
from time import sleep
from core.system import *
if len(sys.argv)>1:
pass
else:
print ("error : invalid arguments !!")
print ("use : myserver --help for more information")
s... | [
"os.system",
"sys.exit"
] | [((319, 329), 'sys.exit', 'sys.exit', ([], {}), '()\n', (327, 329), False, 'import sys\n'), ((408, 458), 'os.system', 'os.system', (["('sudo python3 core/s.py ' + sys.argv[1])"], {}), "('sudo python3 core/s.py ' + sys.argv[1])\n", (417, 458), False, 'import os\n'), ((473, 518), 'os.system', 'os.system', (["('python3 co... |
""" test gen_epub. """
from tmx2epub.gen_epub import gen_epub
def test_gen_epub2():
""" test_gen_epub2. """
from pathlib import Path
infile = r"tests\2.tmx"
stem = Path(infile).absolute().stem
outfile = f"{Path(infile).absolute().parent / stem}.epub"
assert gen_epub(infile, debug=True) == out... | [
"tmx2epub.gen_epub.gen_epub",
"pathlib.Path"
] | [((285, 313), 'tmx2epub.gen_epub.gen_epub', 'gen_epub', (['infile'], {'debug': '(True)'}), '(infile, debug=True)\n', (293, 313), False, 'from tmx2epub.gen_epub import gen_epub\n'), ((183, 195), 'pathlib.Path', 'Path', (['infile'], {}), '(infile)\n', (187, 195), False, 'from pathlib import Path\n'), ((229, 241), 'pathli... |
import json
import time
import random
import logging
import requests
import os
logging.basicConfig(level=logging.INFO)
base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv(
'DAPR_HTTP_PORT', '3500')
PUBSUB_NAME = 'order_pub_sub'
TOPIC = 'orders'
logging.info('Publishing to baseUR... | [
"logging.basicConfig",
"requests.post",
"os.getenv",
"json.dumps",
"time.sleep",
"logging.info"
] | [((80, 119), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (99, 119), False, 'import logging\n'), ((286, 393), 'logging.info', 'logging.info', (["('Publishing to baseURL: %s, Pubsub Name: %s, Topic: %s' % (base_url,\n PUBSUB_NAME, TOPIC))"], {}), "('Publishi... |
# Copyright 2018 The TensorFlow Probability 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 o... | [
"tensorflow.compat.v2.control_dependencies",
"tensorflow.compat.v2.reduce_mean",
"tensorflow.compat.v2.nest.map_structure",
"tensorflow.compat.v2.cast",
"tensorflow_probability.python.internal.prefer_static.size",
"tensorflow.compat.v2.get_static_value",
"tensorflow.compat.v2.maximum",
"tensorflow.com... | [((8267, 8323), 'tensorflow_probability.python.internal.nest_util.broadcast_structure', 'nest_util.broadcast_structure', (['states', 'filter_beyond_lag'], {}), '(states, filter_beyond_lag)\n', (8296, 8323), False, 'from tensorflow_probability.python.internal import nest_util\n'), ((8345, 8400), 'tensorflow_probability.... |
from torch import nn as nn
from .base_model import BaseModel
from ..nn.conv2d import DenseConv2d
from ..nn.linear import DenseLinear
__all__ = ["Conv2", "conv2", "Conv4", "conv4"]
class Conv2(BaseModel):
def __init__(self):
super(Conv2, self).__init__()
self.features = nn.Sequential(DenseConv2d(... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.MaxPool2d"
] | [((404, 425), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (411, 425), True, 'from torch import nn as nn\n'), ((465, 490), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['(2)'], {'stride': '(2)'}), '(2, stride=2)\n', (477, 490), True, 'from torch import nn as nn\n'), ((639, 660), 'torch.nn.ReLU... |
import bpy
from bpy.app.handlers import persistent
bl_info = {
"name": "Playback Once",
"author": "<NAME>",
"version": (1, 0, 0),
"blender": (2, 67, 3),
"location": "",
"description": "Playback once.",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Animation"}
@... | [
"bpy.ops.screen.animation_cancel",
"bpy.app.handlers.frame_change_pre.remove",
"bpy.app.handlers.frame_change_pre.append"
] | [((471, 530), 'bpy.app.handlers.frame_change_pre.append', 'bpy.app.handlers.frame_change_pre.append', (['stopPlaybackAtEnd'], {}), '(stopPlaybackAtEnd)\n', (511, 530), False, 'import bpy\n'), ((554, 613), 'bpy.app.handlers.frame_change_pre.remove', 'bpy.app.handlers.frame_change_pre.remove', (['stopPlaybackAtEnd'], {})... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
from typing import AsyncIterator
import pytest
from aioresponses import aioresponses
from faker import Faker
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from models_... | [
"hypothesis.strategies.builds",
"simcore_service_webserver.director_v2_api.get_cluster_details",
"hypothesis.strategies.from_type",
"simcore_service_webserver.director_v2_api.delete_cluster",
"simcore_service_webserver.director_v2_api.delete_pipeline",
"simcore_service_webserver.director_v2_api.ping_clust... | [((728, 744), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (742, 744), False, 'import pytest\n'), ((2065, 2134), 'hypothesis.settings', 'settings', ([], {'suppress_health_check': '[HealthCheck.function_scoped_fixture]'}), '(suppress_health_check=[HealthCheck.function_scoped_fixture])\n', (2073, 2134), False, '... |
import numpy as np
def random_augmentation(img, mask):
#you can add any augmentations you need
return img, mask
def batch_generator(image, mask,
batch_size=1,
crop_size=0,
patch_size=256,
bbox= None,
augment... | [
"numpy.ndim",
"numpy.max",
"numpy.array",
"numpy.random.randint",
"numpy.expand_dims",
"numpy.moveaxis"
] | [((1181, 1194), 'numpy.max', 'np.max', (['image'], {}), '(image)\n', (1187, 1194), True, 'import numpy as np\n'), ((950, 963), 'numpy.ndim', 'np.ndim', (['mask'], {}), '(mask)\n', (957, 963), True, 'import numpy as np\n'), ((972, 986), 'numpy.ndim', 'np.ndim', (['image'], {}), '(image)\n', (979, 986), True, 'import num... |
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
from collections import OrderedDict
# Django
from django.core.exceptions import PermissionDenied
from django.db.models.fields import PositiveIntegerField, BooleanField
from django.db.models.fields.related import ForeignKey
from django.http import Http404
from ... | [
"collections.OrderedDict",
"django.utils.translation.ugettext_lazy",
"awx.main.scheduler.kubernetes.PodManager",
"django.utils.encoding.force_text",
"rest_framework.request.clone_request",
"django.utils.encoding.smart_text"
] | [((1028, 1041), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1039, 1041), False, 'from collections import OrderedDict\n'), ((8352, 8382), 'rest_framework.request.clone_request', 'clone_request', (['request', 'method'], {}), '(request, method)\n', (8365, 8382), False, 'from rest_framework.request import ... |
import json
from washer.worker.actions import AppendStdout, AppendStderr
from washer.worker.actions import CreateNamedLog, AppendToLog
from washer.worker.actions import SetProperty
from washer.worker.commands import washertask
def pipenv_graph2deps(rawgraph):
graph = json.loads(rawgraph)
def build_entry(dat... | [
"json.loads",
"invoke.Context",
"washer.worker.actions.AppendStderr",
"washer.worker.actions.AppendStdout"
] | [((275, 295), 'json.loads', 'json.loads', (['rawgraph'], {}), '(rawgraph)\n', (285, 295), False, 'import json\n'), ((1174, 1190), 'invoke.Context', 'invoke.Context', ([], {}), '()\n', (1188, 1190), False, 'import invoke\n'), ((1643, 1659), 'invoke.Context', 'invoke.Context', ([], {}), '()\n', (1657, 1659), False, 'impo... |
import numpy as np
import pickle
from collections import defaultdict
from parsing import parser
from analysis import training
def main():
parse = parser.Parser();
train_digits = parse.parse_file('data/pendigits-train');
test_digits = parse.parse_file('data/pendigits-test')
centroids = training.get_d... | [
"pickle.dump",
"parsing.parser.Parser",
"analysis.training.get_digit_kmeans_centroids",
"numpy.ndarray",
"collections.defaultdict",
"analysis.training.set_digit_observations"
] | [((152, 167), 'parsing.parser.Parser', 'parser.Parser', ([], {}), '()\n', (165, 167), False, 'from parsing import parser\n'), ((306, 364), 'analysis.training.get_digit_kmeans_centroids', 'training.get_digit_kmeans_centroids', (['train_digits', '(256 - 3)'], {}), '(train_digits, 256 - 3)\n', (341, 364), False, 'from ana... |
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import abc
import importlib
import os
import pkgutil
import re
import time
from typing import Dict, List, ... | [
"importlib.import_module",
"re.compile",
"os.path.splitext",
"os.path.dirname",
"time.time",
"pkgutil.iter_modules"
] | [((1834, 1845), 'time.time', 'time.time', ([], {}), '()\n', (1843, 1845), False, 'import time\n'), ((2057, 2095), 'pkgutil.iter_modules', 'pkgutil.iter_modules', (['[validators_dir]'], {}), '([validators_dir])\n', (2077, 2095), False, 'import pkgutil\n'), ((3045, 3056), 'time.time', 'time.time', ([], {}), '()\n', (3054... |
import json
import re
from copy import copy
from logging import Formatter
from .profile import used_memory
from ..helper import colored
class ColorFormatter(Formatter):
"""Format the log into colored logs based on the log-level. """
MAPPING = {
'DEBUG': dict(color='white', on_color=None), # white
... | [
"copy.copy",
"json.dumps"
] | [((749, 761), 'copy.copy', 'copy', (['record'], {}), '(record)\n', (753, 761), False, 'from copy import copy\n'), ((1128, 1140), 'copy.copy', 'copy', (['record'], {}), '(record)\n', (1132, 1140), False, 'from copy import copy\n'), ((1701, 1713), 'copy.copy', 'copy', (['record'], {}), '(record)\n', (1705, 1713), False, ... |
import sys
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
n,x=map(int,input().split())
a=list(map(int,input().split()))
aa=list(filter(lambda b:b!=x,a))
print(*aa) | [
"sys.stdin.readline",
"sys.setrecursionlimit"
] | [((11, 42), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10000000)'], {}), '(10000000)\n', (32, 42), False, 'import sys\n'), ((58, 78), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (76, 78), False, 'import sys\n')] |
import re
from abc import ABC, abstractmethod
from typing import Any, Dict, Generator
class IncorrectVenueImplementation(Exception):
pass
# class AbstractVenue(metaclass=ABC):
class AbstractVenue(ABC):
def __init__(self):
self.url = ""
self.name = ""
self.city = ""
self.count... | [
"re.compile"
] | [((362, 386), 're.compile', 're.compile', (['"""[0-9.,]+.€"""'], {}), "('[0-9.,]+.€')\n", (372, 386), False, 'import re\n'), ((417, 439), 're.compile', 're.compile', (['"""[0-9.,]+"""'], {}), "('[0-9.,]+')\n", (427, 439), False, 'import re\n')] |
# Copyright 2018 Johns Hopkins University. 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... | [
"tensorflow.data.TFRecordDataset",
"collections.namedtuple",
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.python.ops.parsing_ops.parse_example",
"tensorflow.train.Int64List",
"tensorflow.reshape",
"tensorflow.sparse_tensor_to_dense"
] | [((3882, 3920), 'collections.namedtuple', 'namedtuple', (['"""bucket_info"""', '"""func pads"""'], {}), "('bucket_info', 'func pads')\n", (3892, 3920), False, 'from collections import namedtuple\n'), ((1446, 1484), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['tfrecord_file'], {}), '(tfrecord_file)\n... |
from py65.devices import mpu6502
from py65.utils.devices import make_instruction_decorator
class MPU(mpu6502.MPU):
def __init__(self, *args, **kwargs):
mpu6502.MPU.__init__(self, *args, **kwargs)
self.name = '65C02'
self.waiting = False
def step(self):
if self.waiting:
... | [
"py65.devices.mpu6502.MPU.step",
"py65.utils.devices.make_instruction_decorator",
"py65.devices.mpu6502.MPU.__init__"
] | [((646, 719), 'py65.utils.devices.make_instruction_decorator', 'make_instruction_decorator', (['instruct', 'disassemble', 'cycletime', 'extracycles'], {}), '(instruct, disassemble, cycletime, extracycles)\n', (672, 719), False, 'from py65.utils.devices import make_instruction_decorator\n'), ((166, 209), 'py65.devices.m... |
import pandas as pd
import shutil
import os
import io
from ms_mint.Mint import Mint
from pathlib import Path as P
from ms_mint.io import (
ms_file_to_df,
mzml_to_pandas_df_pyteomics,
convert_ms_file_to_feather,
convert_ms_file_to_parquet,
MZMLB_AVAILABLE,
)
from paths import (
TEST_MZML,
... | [
"pathlib.Path",
"os.path.join",
"ms_mint.io.mzml_to_pandas_df_pyteomics",
"os.path.isfile",
"ms_mint.Mint.Mint",
"shutil.copy",
"pandas.read_excel",
"pandas.DataFrame",
"ms_mint.io.convert_ms_file_to_parquet",
"ms_mint.io.ms_file_to_df",
"ms_mint.io.convert_ms_file_to_feather"
] | [((459, 483), 'ms_mint.io.ms_file_to_df', 'ms_file_to_df', (['TEST_MZML'], {}), '(TEST_MZML)\n', (472, 483), False, 'from ms_mint.io import ms_file_to_df, mzml_to_pandas_df_pyteomics, convert_ms_file_to_feather, convert_ms_file_to_parquet, MZMLB_AVAILABLE\n'), ((847, 892), 'ms_mint.io.ms_file_to_df', 'ms_file_to_df', (... |
#!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2022 EntySec
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | [
"os.path.exists",
"hatsploit.core.cli.badges.Badges",
"hatsploit.lib.storage.LocalStorage",
"hatsploit.lib.config.Config"
] | [((1316, 1324), 'hatsploit.core.cli.badges.Badges', 'Badges', ([], {}), '()\n', (1322, 1324), False, 'from hatsploit.core.cli.badges import Badges\n'), ((1338, 1346), 'hatsploit.lib.config.Config', 'Config', ([], {}), '()\n', (1344, 1346), False, 'from hatsploit.lib.config import Config\n'), ((1367, 1381), 'hatsploit.l... |
from bluesky.plans import scan
from bluesky.simulators import (print_summary, print_summary_wrapper,
summarize_plan,
check_limits,
plot_raster_path)
import pytest
from bluesky.plans import grid_scan
def test_print_summary(... | [
"bluesky.plans.scan",
"bluesky.simulators.check_limits",
"bluesky.plans.grid_scan",
"pytest.raises",
"bluesky.plan_tools.plot_raster_path",
"pytest.warns"
] | [((2359, 2419), 'bluesky.plans.grid_scan', 'grid_scan', (['[det]', 'motor1', '(-5)', '(5)', '(10)', 'motor2', '(-7)', '(7)', '(15)', '(True)'], {}), '([det], motor1, -5, 5, 10, motor2, -7, 7, 15, True)\n', (2368, 2419), False, 'from bluesky.plans import grid_scan\n'), ((2424, 2482), 'bluesky.plan_tools.plot_raster_path... |
import warnings
import pytest
from leapp.libraries.actor.systemfacts import get_selinux_status
from leapp.models import SELinuxFacts
no_selinux = False
try:
import selinux
except ImportError:
no_selinux = True
warnings.warn(
'Tests which uses `selinux` will be skipped'
' due to library un... | [
"warnings.warn",
"leapp.libraries.actor.systemfacts.get_selinux_status",
"leapp.models.SELinuxFacts",
"pytest.mark.skipif"
] | [((436, 493), 'pytest.mark.skipif', 'pytest.mark.skipif', (['no_selinux'], {'reason': 'reason_to_skip_msg'}), '(no_selinux, reason=reason_to_skip_msg)\n', (454, 493), False, 'import pytest\n'), ((1261, 1318), 'pytest.mark.skipif', 'pytest.mark.skipif', (['no_selinux'], {'reason': 'reason_to_skip_msg'}), '(no_selinux, r... |
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-IPxlatCfg
GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.p... | [
"construct.Struct",
"etl.parsers.etw.core.guid"
] | [((511, 565), 'construct.Struct', 'Struct', (["('ErrorString' / CString)", "('ErrorCode' / Int32ul)"], {}), "('ErrorString' / CString, 'ErrorCode' / Int32ul)\n", (517, 565), False, 'from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct\n'), ((737, 82... |
import uuid
from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION
import db
from models.response import post_error
import logging
log = logging.getLogger('file')
class OrgUtils:
def __init__(self):
pass
#orgId generation
@staticmethod
def generate_org_id():
"""UUID gener... | [
"logging.getLogger",
"db.get_db",
"models.response.post_error",
"uuid.uuid4"
] | [((150, 175), 'logging.getLogger', 'logging.getLogger', (['"""file"""'], {}), "('file')\n", (167, 175), False, 'import logging\n'), ((366, 378), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (376, 378), False, 'import uuid\n'), ((1643, 1693), 'models.response.post_error', 'post_error', (['"""Data Missing"""', '"""code ... |
# validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java
#----------------------------------------------------------------------------
# Copyright (c) <NAME> 2015. All Rights Reserved.
#
# Created in support of Team 2465 (Kauaibots). Go Purple Wave!
#
# Open Source Softw... | [
"logging.getLogger",
"wpilib.timer.Timer.getFPGATimestamp",
"wpilib.timer.Timer.delay"
] | [((679, 704), 'logging.getLogger', 'logging.getLogger', (['"""navx"""'], {}), "('navx')\n", (696, 704), False, 'import logging\n'), ((13452, 13476), 'wpilib.timer.Timer.getFPGATimestamp', 'Timer.getFPGATimestamp', ([], {}), '()\n', (13474, 13476), False, 'from wpilib.timer import Timer\n'), ((13619, 13643), 'wpilib.tim... |
#pylint: disable=invalid-name
#pylint: disable=too-many-instance-attributes
#pylint: disable=too-many-return-statements
#pylint: disable=too-many-statements
"""
Class structure and methods for an oscilloscope channel.
The idea is to collect all the relevant information from all the Rigol
scope waveforms into a single ... | [
"numpy.array",
"numpy.frombuffer",
"numpy.linspace"
] | [((2293, 2334), 'numpy.frombuffer', 'np.frombuffer', (['w.data.raw'], {'dtype': 'np.uint8'}), '(w.data.raw, dtype=np.uint8)\n', (2306, 2334), True, 'import numpy as np\n'), ((6716, 6747), 'numpy.linspace', 'np.linspace', (['(-h)', 'h', 'self.points'], {}), '(-h, h, self.points)\n', (6727, 6747), True, 'import numpy as ... |
import os
import sys
import base64
from django.db.models import F, Q
from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer
from util.logger import Logger, logging
# hpclibrary will be in ste... | [
"hpclib.HpcLibrary.__init__",
"observer.syncstep.SyncStep.__init__",
"sys.path.insert",
"observer.syncstep.SyncStep.fetch_pending",
"hpc.models.OriginServer.objects.all",
"os.path.dirname",
"util.logger.Logger"
] | [((383, 412), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (398, 412), False, 'import sys\n'), ((453, 479), 'util.logger.Logger', 'Logger', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (459, 479), False, 'from util.logger import Logger, logging\n'), ((351, 376), 'o... |
#!/usr/bin/env python3
from PIL import Image
def tranform(r, g, b):
tmp = b
b = g // 2
g = tmp
r = r // 2
return r, g, b
def main():
im = Image.open('blue-flames.jpg')
input_pixels = im.getdata()
output_pixels = tuple(tranform(*pixel) for pixel in input_pixels)
im.putdata(output_... | [
"PIL.Image.open"
] | [((166, 195), 'PIL.Image.open', 'Image.open', (['"""blue-flames.jpg"""'], {}), "('blue-flames.jpg')\n", (176, 195), False, 'from PIL import Image\n')] |
from setuptools import setup
setup(
name='firetv',
version='1.0.7',
description='Communicate with an Amazon Fire TV device via ADB over a network.',
url='https://github.com/happyleavesaoc/python-firetv/',
license='MIT',
author='happyleaves',
author_email='<EMAIL>',
packages=['firetv'],
... | [
"setuptools.setup"
] | [((30, 747), 'setuptools.setup', 'setup', ([], {'name': '"""firetv"""', 'version': '"""1.0.7"""', 'description': '"""Communicate with an Amazon Fire TV device via ADB over a network."""', 'url': '"""https://github.com/happyleavesaoc/python-firetv/"""', 'license': '"""MIT"""', 'author': '"""happyleaves"""', 'author_emai... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0002_auto_20170208_1738'),
]
operations = [
migrations.AlterField(
model_name='project',
... | [
"django.db.models.TextField"
] | [((367, 395), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (383, 395), False, 'from django.db import migrations, models\n'), ((528, 556), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (544, 556), False, 'from django.db im... |
from django import forms
from django.utils.translation import gettext_lazy as _
COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)]
class CartAddCourseForm(forms.Form):
quantity = forms.TypedChoiceField(
choices=COURSE_QUANTITY_CHOICES, coerce=int, label=_("Quantité")
)
override = form... | [
"django.forms.BooleanField",
"django.utils.translation.gettext_lazy"
] | [((316, 391), 'django.forms.BooleanField', 'forms.BooleanField', ([], {'required': '(False)', 'initial': '(False)', 'widget': 'forms.HiddenInput'}), '(required=False, initial=False, widget=forms.HiddenInput)\n', (334, 391), False, 'from django import forms\n'), ((281, 294), 'django.utils.translation.gettext_lazy', '_',... |
# 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
# d... | [
"neutron.objects.ports.Port",
"neutron.manager.init",
"neutron.objects.network.Network",
"unittest.mock.call.create",
"unittest.mock.call.update",
"neutron.objects.network.NetworkSegment",
"unittest.mock.call.QosPolicy",
"copy.copy",
"unittest.mock.patch",
"neutron.objects.qos.rule.QosPacketRateLi... | [((30625, 30711), 'unittest.mock.patch', 'mock.patch', (['"""neutron.objects.rbac_db.RbacNeutronDbObjectMixin.create_rbac_policy"""'], {}), "(\n 'neutron.objects.rbac_db.RbacNeutronDbObjectMixin.create_rbac_policy')\n", (30635, 30711), False, 'from unittest import mock\n'), ((30732, 30782), 'unittest.mock.patch', 'm... |
import re
import discord
from redbot.core import commands
class Covfefe(commands.Cog):
"""
Convert almost any word into covfefe
"""
def __init__(self, bot):
self.bot = bot
async def covfefe(self, x, k="aeiouy])"):
"""
https://codegolf.stackexchange.com/a/123697
"... | [
"re.findall",
"redbot.core.commands.command"
] | [((661, 679), 'redbot.core.commands.command', 'commands.command', ([], {}), '()\n', (677, 679), False, 'from redbot.core import commands\n'), ((358, 398), 're.findall', 're.findall', (['f"""(.*?[{k}([^{k}.*?([{k}"""', 'x'], {}), "(f'(.*?[{k}([^{k}.*?([{k}', x)\n", (368, 398), False, 'import re\n')] |
import os
import numpy as np
import tensorflow as tf
from models_gqa.model import Model
from models_gqa.config import build_cfg_from_argparse
from util.gqa_train.data_reader import DataReader
import json
# Load config
cfg = build_cfg_from_argparse()
# Start session
os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID... | [
"os.makedirs",
"models_gqa.config.build_cfg_from_argparse",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"os.path.join",
"numpy.argmax",
"tensorflow.global_variables",
"numpy.sum",
"util.gqa_train.data_reader.DataReader",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.GPUOptions... | [((226, 251), 'models_gqa.config.build_cfg_from_argparse', 'build_cfg_from_argparse', ([], {}), '()\n', (249, 251), False, 'from models_gqa.config import build_cfg_from_argparse\n'), ((615, 1173), 'util.gqa_train.data_reader.DataReader', 'DataReader', (['imdb_file'], {'shuffle': '(False)', 'one_pass': '(True)', 'batch_... |
#!/usr/bin/env python3
"""
example of 3D scalar field
If you get this error, ParaView doesn't know your data file format:
TypeError: TestFileReadability argument %Id: %V
"""
from pathlib import Path
import argparse
import paraview.simple as pvs
p = argparse.ArgumentParser()
p.add_argument("fn", help="data file to l... | [
"argparse.ArgumentParser",
"pathlib.Path"
] | [((253, 278), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (276, 278), False, 'import argparse\n'), ((380, 390), 'pathlib.Path', 'Path', (['P.fn'], {}), '(P.fn)\n', (384, 390), False, 'from pathlib import Path\n')] |
from django import forms
from .models import *
from server.models import *
class ChoiceFieldNoValidation(forms.ChoiceField):
def validate(self, value):
pass
class SaveSearchForm(forms.ModelForm):
class Meta:
model = SavedSearch
fields = ('name',)
class SearchRowForm(forms.ModelForm):... | [
"django.forms.HiddenInput"
] | [((1317, 1336), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (1334, 1336), False, 'from django import forms\n')] |
# In[42]:
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt
# In[43]:
# describe the model
def deriv(y, t, N, beta, gamma, delta):
S, E, I, R = y
dSdt = -beta * S * I / N # S(t) – susceptible (de som är mottagliga för infektion).
dEdt = beta * S * I / N - gamma * ... | [
"matplotlib.pyplot.savefig",
"scipy.integrate.odeint",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1045, 1068), 'numpy.linspace', 'np.linspace', (['(0)', '(99)', '(100)'], {}), '(0, 99, 100)\n', (1056, 1068), True, 'import numpy as np\n'), ((1210, 1260), 'scipy.integrate.odeint', 'odeint', (['deriv', 'y0', 't'], {'args': '(N, beta, gamma, delta)'}), '(deriv, y0, t, args=(N, beta, gamma, delta))\n', (1216, 1260), ... |
from yezdi.lexer.token import TokenType
from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement
class Parser:
def __init__(self, lexer):
self.lexer = lexer
self.current_token = None
self.peek_token = None
self.next_token()
self.next_token()
... | [
"yezdi.parser.ast.Program",
"yezdi.parser.ast.Participant",
"yezdi.parser.ast.Statement",
"yezdi.parser.ast.Title",
"yezdi.parser.ast.LineStatement"
] | [((507, 516), 'yezdi.parser.ast.Program', 'Program', ([], {}), '()\n', (514, 516), False, 'from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement\n'), ((1260, 1292), 'yezdi.parser.ast.Participant', 'Participant', (['participant_literal'], {}), '(participant_literal)\n', (1271, 1292), False, ... |
# list categories in category folder
from os import walk
from os.path import abspath,join, pardir
categories_folder = abspath(join(__file__,pardir,pardir,"category"))
post_folder = abspath(join(__file__,pardir,pardir,"_posts"))
site_categories = []
for root,directories,files in walk(categories_folder):
for f in ... | [
"os.path.join",
"os.walk"
] | [((282, 305), 'os.walk', 'walk', (['categories_folder'], {}), '(categories_folder)\n', (286, 305), False, 'from os import walk\n'), ((464, 481), 'os.walk', 'walk', (['post_folder'], {}), '(post_folder)\n', (468, 481), False, 'from os import walk\n'), ((128, 170), 'os.path.join', 'join', (['__file__', 'pardir', 'pardir'... |
"""
sentry.options.defaults
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from sentry.logging import LoggingFormat
from sentry.options import (
FLAG_IMMUTAB... | [
"sentry.options.register"
] | [((589, 640), 'sentry.options.register', 'register', (['"""system.admin-email"""'], {'flags': 'FLAG_REQUIRED'}), "('system.admin-email', flags=FLAG_REQUIRED)\n", (597, 640), False, 'from sentry.options import FLAG_IMMUTABLE, FLAG_NOSTORE, FLAG_PRIORITIZE_DISK, FLAG_REQUIRED, FLAG_ALLOW_EMPTY, register\n'), ((641, 720),... |
"""Download `Unicodedata` files."""
from __future__ import unicode_literals
import os
import zipfile
import codecs
from urllib.request import urlopen
__version__ = '2.2.0'
HOME = os.path.dirname(os.path.abspath(__file__))
def zip_unicode(output, version):
"""Zip the Unicode files."""
zipper = zipfile.ZipFi... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.join",
"os.path.basename",
"os.path.abspath",
"codecs.open",
"urllib.request.urlopen",
"os.walk"
] | [((197, 222), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (212, 222), False, 'import os\n'), ((420, 464), 'os.path.join', 'os.path.join', (['output', '"""unicodedata"""', 'version'], {}), "(output, 'unicodedata', version)\n", (432, 464), False, 'import os\n'), ((537, 552), 'os.walk', 'os.w... |
# See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
import datetime
from policy import assoc... | [
"n_way_cache.n_way_cache",
"debug.print_raw",
"debug.error",
"datetime.datetime.now",
"globals.OPTS.replacement_policy.has_sram_array"
] | [((1151, 1176), 'n_way_cache.n_way_cache', 'cache', (['cache_config', 'name'], {}), '(cache_config, name)\n', (1156, 1176), True, 'from n_way_cache import n_way_cache as cache\n'), ((1475, 1516), 'debug.print_raw', 'debug.print_raw', (['"""Saving output files..."""'], {}), "('Saving output files...')\n", (1490, 1516), ... |
#!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sur... | [
"logging.getLogger",
"logging.debug",
"configparser.ConfigParser",
"re.compile",
"os.path.ismount",
"os.getuid",
"urllib.request.Request",
"os.open",
"time.sleep",
"sys.exit",
"urllib.parse.urlencode",
"datetime.timedelta",
"hashlib.sha1",
"logging.info",
"logging.error",
"os.remove",
... | [((4023, 4062), 're.compile', 're.compile', (['"""^(?P<fs_id>fs-[0-9a-f]+)$"""'], {}), "('^(?P<fs_id>fs-[0-9a-f]+)$')\n", (4033, 4062), False, 'import re\n'), ((4077, 4191), 're.compile', 're.compile', (['"""^(?P<fs_id>fs-[0-9a-f]+)\\\\.efs\\\\.(?P<region>[a-z0-9-]+)\\\\.(?P<dns_name_suffix>[a-z0-9.]+)$"""'], {}), "(\n... |
"""
This script is where the preprocessed data is used to train the SVM model to
perform the classification. I am using Stratified K-Fold Cross Validation to
prevent bias and/or any imbalance that could affect the model's accuracy.
REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-usin... | [
"numpy.mean",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.std",
"numpy.max",
"sklearn.model_selection.StratifiedKFold",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.min",
"sklearn.svm.SVC"
] | [((686, 730), 'pandas.read_csv', 'pd.read_csv', (['"""preprocessed.csv"""'], {'index_col': '(0)'}), "('preprocessed.csv', index_col=0)\n", (697, 730), True, 'import pandas as pd\n'), ((857, 944), 'sklearn.model_selection.train_test_split', 'model_selection.train_test_split', (["df['Text']", "df['PublicationTitle']"], {... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | [
"lxml.etree.XML",
"openerp.osv.fields.many2many",
"lxml.etree.tostring",
"time.strftime"
] | [((1249, 1348), 'openerp.osv.fields.many2many', 'fields.many2many', (['"""payment.line"""', '"""payment_line_rel_"""', '"""payment_id"""', '"""line_id"""', '"""Payment Lines"""'], {}), "('payment.line', 'payment_line_rel_', 'payment_id',\n 'line_id', 'Payment Lines')\n", (1265, 1348), False, 'from openerp.osv import... |
from cklib.args import get_arg_parser, ArgumentParser
from cloudkeeper_plugin_cleanup_aws_loadbalancers import CleanupAWSLoadbalancersPlugin
def test_args():
arg_parser = get_arg_parser()
CleanupAWSLoadbalancersPlugin.add_args(arg_parser)
arg_parser.parse_args()
assert ArgumentParser.args.cleanup_aws_... | [
"cklib.args.get_arg_parser",
"cloudkeeper_plugin_cleanup_aws_loadbalancers.CleanupAWSLoadbalancersPlugin.add_args"
] | [((177, 193), 'cklib.args.get_arg_parser', 'get_arg_parser', ([], {}), '()\n', (191, 193), False, 'from cklib.args import get_arg_parser, ArgumentParser\n'), ((198, 248), 'cloudkeeper_plugin_cleanup_aws_loadbalancers.CleanupAWSLoadbalancersPlugin.add_args', 'CleanupAWSLoadbalancersPlugin.add_args', (['arg_parser'], {})... |
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
__author__ = "<NAME>, <NAME>, and <NAME>"
__copyright__ = "Copyright 2013-2015 UKP TU Darmstadt"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__license__ = "ASL"
class Redirector(webapp.RequestHandler):
def get(self)... | [
"google.appengine.ext.webapp.WSGIApplication",
"google.appengine.ext.webapp.util.run_wsgi_app"
] | [((437, 494), 'google.appengine.ext.webapp.WSGIApplication', 'webapp.WSGIApplication', (["[('/.*', Redirector)]"], {'debug': '(True)'}), "([('/.*', Redirector)], debug=True)\n", (459, 494), False, 'from google.appengine.ext import webapp\n'), ((522, 547), 'google.appengine.ext.webapp.util.run_wsgi_app', 'run_wsgi_app',... |
from __future__ import annotations
import json
import logging
from contextlib import contextmanager, ExitStack
from typing import List, Dict
import pandas as pd
from lithops.storage import Storage
from lithops.storage.utils import CloudObject, StorageNoSuchKeyError
from sm.engine.annotation_lithops.build_moldb impor... | [
"logging.getLogger",
"sm.engine.annotation.isocalc_wrapper.IsocalcWrapper",
"sm.engine.annotation_lithops.io.iter_cobjects_with_prefetch",
"sm.engine.annotation_lithops.calculate_centroids.calculate_centroids",
"sm.engine.annotation_lithops.io.save_cobj",
"json.dumps",
"sm.engine.annotation_lithops.buil... | [((886, 926), 'logging.getLogger', 'logging.getLogger', (['"""annotation-pipeline"""'], {}), "('annotation-pipeline')\n", (903, 926), False, 'import logging\n'), ((1614, 1638), 'sm.engine.annotation_lithops.utils.jsonhash', 'jsonhash', (['self.ds_config'], {}), '(self.ds_config)\n', (1622, 1638), False, 'from sm.engine... |
from PyQt5.QtWidgets import QMenu
from gui.main_window.node_editor.items.connector_item import ConnectorItem
class ConnectorTopItem(ConnectorItem):
""" Class to provide top connector functionality """
def __init__(self, index, nodeItem, nodeEditor, parent=None):
super(ConnectorTopItem, self).__init_... | [
"PyQt5.QtWidgets.QMenu"
] | [((2120, 2127), 'PyQt5.QtWidgets.QMenu', 'QMenu', ([], {}), '()\n', (2125, 2127), False, 'from PyQt5.QtWidgets import QMenu\n')] |
from django.contrib import admin
from users.models import Friendship
admin.site.register(Friendship)
# Register your models here.
| [
"django.contrib.admin.site.register"
] | [((71, 102), 'django.contrib.admin.site.register', 'admin.site.register', (['Friendship'], {}), '(Friendship)\n', (90, 102), False, 'from django.contrib import admin\n')] |
import docx
doc = docx.Document('demo.docx')
print('paragraphs number: %s' % len(doc.paragraphs))
print('1st paragraph: %s' % doc.paragraphs[0].text)
print('2nd paragraph: %s' % doc.paragraphs[1].text)
print('paragraphs runs: %s' % len(doc.paragraphs[1].runs))
print('1st paragraph run: %s' % doc.paragraphs[1].r... | [
"docx.Document"
] | [((21, 47), 'docx.Document', 'docx.Document', (['"""demo.docx"""'], {}), "('demo.docx')\n", (34, 47), False, 'import docx\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import glob
import random
import struct
def get_old_seed():
with open('include/syscalls.h') as f:
code = f.read()
match = re.search(r'#define SW2_SEED (0x[a-fA-F0-9]{8})', code)
assert match is not None, 'SW2_SEED not found!'
... | [
"re.compile",
"re.findall",
"random.randint",
"glob.glob",
"re.search"
] | [((208, 262), 're.search', 're.search', (['"""#define SW2_SEED (0x[a-fA-F0-9]{8})"""', 'code'], {}), "('#define SW2_SEED (0x[a-fA-F0-9]{8})', code)\n", (217, 262), False, 'import re\n'), ((1357, 1411), 're.compile', 're.compile', (['"""__declspec\\\\(naked\\\\) NTSTATUS (Nt[^(]+)"""'], {}), "('__declspec\\\\(naked\\\\)... |
import os
from pathlib import Path
__all__ = ['list_files_recur', 'scan_and_create_dir_tree', 'get_all_data_files', 'get_subsubdirs']
def list_files_recur(path):
"""
Cheater function that wraps path.rglob().
:param Path path: path to list recursively
:return list: list of Path objects
"""
fi... | [
"os.scandir",
"pathlib.Path"
] | [((926, 940), 'pathlib.Path', 'Path', (['parts[0]'], {}), '(parts[0])\n', (930, 940), False, 'from pathlib import Path\n'), ((1959, 1977), 'os.scandir', 'os.scandir', (['subdir'], {}), '(subdir)\n', (1969, 1977), False, 'import os\n'), ((1992, 2008), 'os.scandir', 'os.scandir', (['path'], {}), '(path)\n', (2002, 2008),... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes
from openvino.tools.mo.ops.op import Op
class ExperimentalDetectronDetectionOutput(Op):
op = ... | [
"openvino.tools.mo.front.common.partial_infer.utils.shape_array"
] | [((2352, 2393), 'openvino.tools.mo.front.common.partial_infer.utils.shape_array', 'shape_array', (['[dynamic_dimension_value, 4]'], {}), '([dynamic_dimension_value, 4])\n', (2363, 2393), False, 'from openvino.tools.mo.front.common.partial_infer.utils import dynamic_dimension_value, shape_array, set_input_shapes\n'), ((... |
#!/usr/bin/env python
import numpy as np, os, sys
from get_sepsis_score import load_sepsis_model, get_sepsis_score
def load_challenge_data(file):
with open(file, 'r') as f:
header = f.readline().strip()
column_names = header.split('|')
data = np.loadtxt(f, delimiter='|')
# Ignore Seps... | [
"get_sepsis_score.load_sepsis_model",
"os.listdir",
"os.path.join",
"numpy.zeros",
"os.path.isdir",
"os.mkdir",
"get_sepsis_score.get_sepsis_score",
"numpy.loadtxt"
] | [((1015, 1042), 'os.listdir', 'os.listdir', (['input_directory'], {}), '(input_directory)\n', (1025, 1042), False, 'import numpy as np, os, sys\n'), ((1308, 1327), 'get_sepsis_score.load_sepsis_model', 'load_sepsis_model', ([], {}), '()\n', (1325, 1327), False, 'from get_sepsis_score import load_sepsis_model, get_sepsi... |
import os
import df2img
import disnake
import pandas as pd
from PIL import Image
import discordbot.config_discordbot as cfg
from discordbot.config_discordbot import logger
from discordbot.helpers import autocrop_image
from gamestonk_terminal.economy import wsj_model
async def currencies_command(ctx):
"""Currenc... | [
"disnake.Embed",
"PIL.Image.open",
"discordbot.helpers.autocrop_image",
"gamestonk_terminal.economy.wsj_model.global_currencies",
"df2img.save_dataframe",
"discordbot.config_discordbot.logger.debug",
"pandas.DataFrame.from_dict",
"disnake.File",
"os.remove"
] | [((496, 525), 'gamestonk_terminal.economy.wsj_model.global_currencies', 'wsj_model.global_currencies', ([], {}), '()\n', (523, 525), False, 'from gamestonk_terminal.economy import wsj_model\n'), ((539, 565), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['df'], {}), '(df)\n', (561, 565), True, 'import pandas... |
# @Title: 最长字符串链 (Longest String Chain)
# @Author: KivenC
# @Date: 2019-05-26 20:35:25
# @Runtime: 144 ms
# @Memory: 13.3 MB
class Solution:
# # way 1
# def longestStrChain(self, words: List[str]) -> int:
# # 动态规划
# # dp[i] = max(dp[i], dp[j] + 1) (0 <= j < i 且 words[j] 是 words[i] 的前身)
# ... | [
"collections.defaultdict"
] | [((1844, 1873), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1867, 1873), False, 'import collections\n')] |
import connexion
import six
from openapi_server import query_manager
from openapi_server.utils.vars import DATATRANSFORMATION_TYPE_NAME, DATATRANSFORMATION_TYPE_URI
from openapi_server.models.data_transformation import DataTransformation # noqa: E501
from openapi_server import util
def custom_datasetspecifications_i... | [
"openapi_server.query_manager.delete_resource",
"openapi_server.query_manager.post_resource",
"openapi_server.query_manager.get_resource",
"connexion.request.get_json",
"openapi_server.query_manager.put_resource"
] | [((813, 1020), 'openapi_server.query_manager.get_resource', 'query_manager.get_resource', ([], {'id': 'id', 'custom_query_name': 'custom_query_name', 'username': 'username', 'rdf_type_uri': 'DATATRANSFORMATION_TYPE_URI', 'rdf_type_name': 'DATATRANSFORMATION_TYPE_NAME', 'kls': 'DataTransformation'}), '(id=id, custom_que... |
import numpy as np
import scipy
import warnings
try:
import matplotlib.pyplot as pl
import matplotlib
except ImportError:
warnings.warn("matplotlib could not be loaded!")
pass
from . import labels
from . import colors
def truncate_text(text, max_len):
if len(text) > max_len:
return text[:i... | [
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.figure",
"scipy.stats.ttest_ind",
"matplotlib.pyplot.scatter",
"numpy.min",
"warnings.warn",
"numpy.argmin",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.show"
] | [((1417, 1443), 'matplotlib.pyplot.figure', 'pl.figure', ([], {'figsize': '(10, 3)'}), '(figsize=(10, 3))\n', (1426, 1443), True, 'import matplotlib.pyplot as pl\n'), ((1792, 1805), 'numpy.min', 'np.min', (['pvals'], {}), '(pvals)\n', (1798, 1805), True, 'import numpy as np\n'), ((1998, 2064), 'matplotlib.pyplot.scatte... |
import re
import os
import cmd
import sys
import common
from getpass import getpass
from kp import KeePassError, get_password
from configmanager import ConfigManager, ConfigManagerError
common.init()
class ParseArgsException(Exception):
def __init__(self, msg):
self.msg = msg
class ModuleCore(cmd.Cmd):
def __... | [
"kp.get_password",
"common.chdir",
"kp.KeePassError",
"getpass.getpass",
"configmanager.ConfigManager",
"sys.stdin.readline",
"common.init",
"sys.stdin.isatty",
"re.findall",
"common.get_cdir",
"cmd.Cmd.__init__"
] | [((189, 202), 'common.init', 'common.init', ([], {}), '()\n', (200, 202), False, 'import common\n'), ((349, 371), 'cmd.Cmd.__init__', 'cmd.Cmd.__init__', (['self'], {}), '(self)\n', (365, 371), False, 'import cmd\n'), ((1374, 1434), 're.findall', 're.findall', (['""""+.*"+|[a-zA-Z0-9!@#$%^&*()_+-,./<>?]+"""', 'string']... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 14:57:32 2020
@author: Nicolai
"""
import sys
import os
importpath = os.path.dirname(os.path.realpath(__file__)) + "/../"
sys.path.append(importpath)
from FemPdeBase import FemPdeBase
import numpy as np
# import from ngsolve
import ngsolve as ngs
from netgen.geom2d i... | [
"psutil.Process",
"netgen.geom2d.unit_square.GenerateMesh",
"time.sleep",
"numpy.array",
"ngsolve.Preconditioner",
"sys.path.append",
"numpy.arange",
"gc.enable",
"gc.disable",
"gc.isenabled",
"ngsolve.GridFunction",
"numpy.meshgrid",
"ngsolve.LinearForm",
"ngsolve.HDiv",
"gc.collect",
... | [((174, 201), 'sys.path.append', 'sys.path.append', (['importpath'], {}), '(importpath)\n', (189, 201), False, 'import sys\n'), ((6776, 6788), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6786, 6788), True, 'import matplotlib.pyplot as plt\n'), ((6848, 6872), 'numpy.arange', 'np.arange', (['(0)', '(1.01... |
import pytest
from pydantic import ValidationError
from overhave.transport import OverhaveS3ManagerSettings
class TestS3ManagerSettings:
""" Unit tests for :class:`OverhaveS3ManagerSettings`. """
@pytest.mark.parametrize("test_s3_enabled", [False])
def test_disabled(self, test_s3_enabled: bool) -> None:... | [
"pytest.mark.parametrize",
"overhave.transport.OverhaveS3ManagerSettings",
"pytest.raises"
] | [((209, 260), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_s3_enabled"""', '[False]'], {}), "('test_s3_enabled', [False])\n", (232, 260), False, 'import pytest\n'), ((543, 593), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_s3_enabled"""', '[True]'], {}), "('test_s3_enabled', [Tru... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("LIKELIHOODPDFDBREADER")
# process.load("MuonAnalysis.MomentumScaleCalibration.local_CSA08_Y_cff")
process.source = cms.Source("EmptySource",
numberEventsInRun = cms.untracked.uint32(1),
firstRun = cms.untracked.uint32(1)
)
process.load("Configur... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.uint32",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.Path",
"FWCore.ParameterSet.Config.EDAnalyzer"
] | [((52, 88), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""LIKELIHOODPDFDBREADER"""'], {}), "('LIKELIHOODPDFDBREADER')\n", (63, 88), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1452, 1491), 'FWCore.ParameterSet.Config.EDAnalyzer', 'cms.EDAnalyzer', (['"""LikelihoodPdfDBReader"""'], {}), "('Likeli... |
#!/usr/bin/python
from mod_pywebsocket import msgutil
import time
def web_socket_do_extra_handshake(request):
pass # Always accept.
def web_socket_transfer_data(request):
time.sleep(3)
msgutil.send_message(request, "line")
| [
"mod_pywebsocket.msgutil.send_message",
"time.sleep"
] | [((177, 190), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (187, 190), False, 'import time\n'), ((192, 229), 'mod_pywebsocket.msgutil.send_message', 'msgutil.send_message', (['request', '"""line"""'], {}), "(request, 'line')\n", (212, 229), False, 'from mod_pywebsocket import msgutil\n')] |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
"airflow.providers.microsoft.psrp.hooks.psrp.PSRPHook",
"airflow.exceptions.AirflowException"
] | [((2123, 2145), 'airflow.providers.microsoft.psrp.hooks.psrp.PSRPHook', 'PSRPHook', (['self.conn_id'], {}), '(self.conn_id)\n', (2131, 2145), False, 'from airflow.providers.microsoft.psrp.hooks.psrp import PSRPHook\n'), ((2344, 2378), 'airflow.exceptions.AirflowException', 'AirflowException', (['"""Process failed"""'],... |
"""
This module contains the rule-based inference (rulebased_deduction engine)
"""
import itertools
from collections import defaultdict
from itertools import chain
from excut.explanations_mining.descriptions import dump_explanations_to_file
from excut.explanations_mining.descriptions_new import Description2, Atom, loa... | [
"excut.clustering.target_entities.load_from_file",
"excut.explanations_mining.descriptions_new.Atom",
"excut.kg.utils.data_formating.n3_repr",
"itertools.chain.from_iterable",
"collections.defaultdict",
"excut.kg.kg_indexing.Indexer",
"excut.explanations_mining.explaining_engines_extended.PathBasedClust... | [((9790, 9877), 'excut.clustering.target_entities.load_from_file', 'tes.load_from_file', (['"""/scratch/GW/pool0/gadelrab/ExDEC/data/yago/yago_art_3_4k.tsv"""'], {}), "(\n '/scratch/GW/pool0/gadelrab/ExDEC/data/yago/yago_art_3_4k.tsv')\n", (9808, 9877), True, 'from excut.clustering import target_entities as tes\n'),... |
import logging
import random
from datetime import timedelta
from typing import TYPE_CHECKING
from duration import to_iso8601
from pyramid.httpexceptions import HTTPBadRequest, HTTPCreated, HTTPNotFound, HTTPOk
from weaver import sort
from weaver.config import WEAVER_CONFIGURATION_ADES, WEAVER_CONFIGURATION_EMS, get_w... | [
"logging.getLogger",
"weaver.datatype.Quote",
"pyramid.httpexceptions.HTTPNotFound",
"pyramid.httpexceptions.HTTPOk",
"weaver.processes.wps_package.get_package_workflow_steps",
"weaver.config.get_weaver_configuration",
"weaver.wps_restapi.swagger_definitions.PostQuote",
"weaver.wps_restapi.swagger_def... | [((1050, 1077), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1067, 1077), False, 'import logging\n'), ((1938, 2040), 'weaver.exceptions.log_unhandled_exceptions', 'log_unhandled_exceptions', ([], {'logger': 'LOGGER', 'message': 'sd.InternalServerErrorResponseSchema.description'}), '(lo... |
from django.db import models
class JobOffer(models.Model):
company_name = models.CharField(max_length=50)
company_email = models.EmailField()
job_title = models.CharField(max_length=60)
job_description = models.TextField()
salary = models.PositiveIntegerField()
city = models.CharField(max_leng... | [
"django.db.models.EmailField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.BooleanField",
"django.db.models.PositiveIntegerField",
"django.db.models.CharField"
] | [((80, 111), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (96, 111), False, 'from django.db import models\n'), ((132, 151), 'django.db.models.EmailField', 'models.EmailField', ([], {}), '()\n', (149, 151), False, 'from django.db import models\n'), ((168, 199), 'dj... |
from django.shortcuts import render,redirect
from django.contrib.auth.models import User
from django.contrib import messages
from .forms import PictureUploadForm,CommentForm
from .models import Image,Profile,Likes,Comments
from django.contrib.auth.decorators import login_required
from django.contrib .auth import authen... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.contrib.messages.error",
"django.contrib.auth.login",
"datetime.datetime.now",
"django.shortcuts.redirect",
"django.contrib.auth.forms.UserCreationForm",
"django.contrib.auth.decorators.login_required",
"django.contrib.auth.model... | [((1915, 1948), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""login"""'}), "(login_url='login')\n", (1929, 1948), False, 'from django.contrib.auth.decorators import login_required\n'), ((2314, 2347), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'lo... |
"""Create diapivot annotation."""
import logging
import pickle
import xml.etree.ElementTree as etree
import sparv.util as util
from sparv import Annotation, Model, ModelOutput, Output, annotator, modelbuilder
log = logging.getLogger(__name__)
PART_DELIM1 = "^1"
# @annotator("Diapivot annotation", language=["swe-1... | [
"logging.getLogger",
"sparv.util.test_lexicon",
"pickle.load",
"sparv.Model",
"sparv.Annotation",
"xml.etree.ElementTree.iterparse",
"sparv.ModelOutput",
"sparv.Output"
] | [((218, 245), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (235, 245), False, 'import logging\n'), ((363, 450), 'sparv.Output', 'Output', (['"""<token>:hist.diapivot"""'], {'description': '"""SALDO IDs corresponding to lemgrams"""'}), "('<token>:hist.diapivot', description=\n 'SALDO ... |
import os
def get_root_path():
current_path = os.path.abspath(os.path.dirname(__file__))
root_path = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(current_path)))
)
return os.path.join(root_path, "xbot")
def get_config_path():
config_path = os.path.abspath(os.path.join... | [
"os.path.dirname",
"os.path.join"
] | [((217, 248), 'os.path.join', 'os.path.join', (['root_path', '"""xbot"""'], {}), "(root_path, 'xbot')\n", (229, 248), False, 'import os\n'), ((68, 93), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (83, 93), False, 'import os\n'), ((321, 346), 'os.path.dirname', 'os.path.dirname', (['__file_... |
from django.utils.html import format_html
from wagtail.wagtailcore import hooks
@hooks.register('insert_editor_js')
def enable_source():
return format_html(
"""
<script>
registerHalloPlugin('hallohtml');
</script>
"""
)
| [
"wagtail.wagtailcore.hooks.register",
"django.utils.html.format_html"
] | [((83, 117), 'wagtail.wagtailcore.hooks.register', 'hooks.register', (['"""insert_editor_js"""'], {}), "('insert_editor_js')\n", (97, 117), False, 'from wagtail.wagtailcore import hooks\n'), ((150, 269), 'django.utils.html.format_html', 'format_html', (['"""\n <script>\n registerHalloPlugin(\'hallohtm... |
from buildbot.process.remotecommand import RemoteCommand
from buildbot.interfaces import WorkerTooOldError
import stat
class FileExists(object):
"""I check a file existence on the worker. I return True if the file
with the given name exists, False if the file does not exist or that is
a directory.
Us... | [
"stat.S_ISLNK",
"stat.S_ISREG",
"buildbot.process.remotecommand.RemoteCommand"
] | [((623, 669), 'buildbot.process.remotecommand.RemoteCommand', 'RemoteCommand', (['"""stat"""', "{'file': self.filename}"], {}), "('stat', {'file': self.filename})\n", (636, 669), False, 'from buildbot.process.remotecommand import RemoteCommand\n'), ((1688, 1734), 'buildbot.process.remotecommand.RemoteCommand', 'RemoteC... |
"""Hyper-distributions."""
from libqif.core.secrets import Secrets
from libqif.core.channel import Channel
from numpy import array, arange, zeros
from numpy import delete as npdelete
class Hyper:
def __init__(self, channel):
"""Hyper-distribution. To create an instance of this class it is
class i... | [
"numpy.delete",
"numpy.array",
"libqif.core.secrets.Secrets",
"numpy.arange"
] | [((2486, 2518), 'numpy.arange', 'arange', (['self.channel.num_outputs'], {}), '(self.channel.num_outputs)\n', (2492, 2518), False, 'from numpy import array, arange, zeros\n'), ((2742, 2774), 'numpy.arange', 'arange', (['self.channel.num_outputs'], {}), '(self.channel.num_outputs)\n', (2748, 2774), False, 'from numpy im... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | [
"ansible.module_utils.basic.AnsibleModule",
"ansible.module_utils.network.fortios.fortios.FortiOSHandler",
"fortiosapi.FortiOSAPI",
"ansible.module_utils.connection.Connection"
] | [((52308, 52370), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'fields', 'supports_check_mode': '(False)'}), '(argument_spec=fields, supports_check_mode=False)\n', (52321, 52370), False, 'from ansible.module_utils.basic import AnsibleModule\n'), ((53210, 53222), 'fortiosapi.FortiO... |
"""
# Step 1 - Create the App
# Step 2 - Create the Game
# Step 3 - Build the Game
# Step 4 - Run the App
"""
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty
from kivy.vector import Vector
from kivy.clock import C... | [
"kivy.properties.NumericProperty",
"kivy.vector.Vector",
"kivy.clock.Clock.schedule_interval",
"kivy.properties.ReferenceListProperty",
"random.randint",
"kivy.properties.ObjectProperty"
] | [((397, 415), 'kivy.properties.NumericProperty', 'NumericProperty', (['(0)'], {}), '(0)\n', (412, 415), False, 'from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty\n'), ((607, 625), 'kivy.properties.NumericProperty', 'NumericProperty', (['(0)'], {}), '(0)\n', (622, 625), False, 'from kivy... |
"""Data Test Suite."""
from aiogithubapi.objects import repository
import pytest
import os
from homeassistant.core import HomeAssistant
from custom_components.hacs.hacsbase.data import HacsData
from custom_components.hacs.helpers.classes.repository import HacsRepository
from custom_components.hacs.hacsbase.configuratio... | [
"custom_components.hacs.hacsbase.data.HacsData",
"homeassistant.core.HomeAssistant",
"tests.dummy_repository.dummy_repository_base",
"custom_components.hacs.hacsbase.configuration.Configuration",
"custom_components.hacs.share.get_hacs"
] | [((532, 542), 'custom_components.hacs.hacsbase.data.HacsData', 'HacsData', ([], {}), '()\n', (540, 542), False, 'from custom_components.hacs.hacsbase.data import HacsData\n'), ((554, 564), 'custom_components.hacs.share.get_hacs', 'get_hacs', ([], {}), '()\n', (562, 564), False, 'from custom_components.hacs.share import... |
import re
from curtsies.formatstring import fmtstr, FmtStr
from curtsies.termformatconstants import (
FG_COLORS,
BG_COLORS,
colors as CURTSIES_COLORS,
)
from functools import partial
from ..lazyre import LazyReCompile
COLORS = CURTSIES_COLORS + ("default",)
CNAMES = dict(zip("krgybmcwd", COLORS))
# hack... | [
"curtsies.formatstring.FmtStr",
"curtsies.formatstring.fmtstr"
] | [((2247, 2274), 'curtsies.formatstring.fmtstr', 'fmtstr', (["d['string']"], {}), "(d['string'], **atts)\n", (2253, 2274), False, 'from curtsies.formatstring import fmtstr, FmtStr\n'), ((1558, 1566), 'curtsies.formatstring.FmtStr', 'FmtStr', ([], {}), '()\n', (1564, 1566), False, 'from curtsies.formatstring import fmtst... |
"""Library for executing user-defined dance."""
import logging
from typing import Any, Dict, Optional, Callable
import datetime
import ac
import ac.blocks
from ac import ACs, AC
JC = Dict[str, Any]
class DanceStartException(Exception):
pass
class Step:
"""Base class for all specific dance steps."""
... | [
"ac.AC.__init__",
"datetime.datetime.now",
"ac.ACs.values",
"ac.blocks.on_block_change",
"ac.AC.on_update",
"ac.blocks.unregister",
"logging.info",
"ac.blocks.register"
] | [((6074, 6101), 'ac.blocks.on_block_change', 'ac.blocks.on_block_change', ([], {}), '()\n', (6099, 6101), False, 'import ac\n'), ((6164, 6176), 'ac.ACs.values', 'ACs.values', ([], {}), '()\n', (6174, 6176), False, 'from ac import ACs, AC\n'), ((4503, 4535), 'ac.AC.__init__', 'AC.__init__', (['self', 'id_', 'password'],... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Break repeating-key XOR
#
# It is officially on, now.
#
# This challenge isn't conceptually hard, but it involves actual
# error-prone coding. The other challenges in this set are there to bring
# you up to speed. This one is there to qualify you. If you can do t... | [
"util.loader.loader",
"itertools.zip_longest",
"util.text.englishness",
"inspect.getfile",
"util.text.single_byte_xor",
"util.text.repeating_key_xor"
] | [((3574, 3608), 'itertools.zip_longest', 'zip_longest', (['bs1', 'bs2'], {'fillvalue': '(0)'}), '(bs1, bs2, fillvalue=0)\n', (3585, 3608), False, 'from itertools import zip_longest\n'), ((3740, 3778), 'util.loader.loader', 'loader', (['"""6.txt"""', '"""base64"""'], {'split': '(False)'}), "('6.txt', 'base64', split=Fal... |
import torch
import torch.nn as nn
import torch.nn.functional as f
from prettytable import PrettyTable
from c2nl.modules.char_embedding import CharEmbedding
from c2nl.modules.embeddings import Embeddings
from c2nl.modules.highway import Highway
from c2nl.encoders.transformer import TransformerEncoder
from c2nl.decoder... | [
"c2nl.modules.highway.Highway",
"torch.mul",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"c2nl.encoders.transformer.TransformerEncoder",
"torch.max",
"torch.nn.functional.softmax",
"torch.nn.Sigmoid",
"c2nl.modules.char_embedding.CharEmbedding",
"c2nl.... | [((3482, 3510), 'torch.nn.Dropout', 'nn.Dropout', (['args.dropout_emb'], {}), '(args.dropout_emb)\n', (3492, 3510), True, 'import torch.nn as nn\n'), ((6238, 6484), 'c2nl.encoders.transformer.TransformerEncoder', 'TransformerEncoder', ([], {'num_layers': 'args.nlayers', 'd_model': 'input_size', 'heads': 'args.num_head'... |
import logging
from cattle import Config
from cattle.utils import reply, popen
from .compute import DockerCompute
from cattle.agent.handler import BaseHandler
from cattle.progress import Progress
from cattle.type_manager import get_type, MARSHALLER
from . import docker_client
import subprocess
import os
import time
... | [
"logging.getLogger",
"cattle.Config.config_url",
"cattle.type_manager.get_type",
"time.sleep",
"cattle.utils.popen",
"cattle.progress.Progress",
"cattle.Config.home",
"cattle.utils.reply"
] | [((326, 353), 'logging.getLogger', 'logging.getLogger', (['"""docker"""'], {}), "('docker')\n", (343, 353), False, 'import logging\n'), ((652, 672), 'cattle.type_manager.get_type', 'get_type', (['MARSHALLER'], {}), '(MARSHALLER)\n', (660, 672), False, 'from cattle.type_manager import get_type, MARSHALLER\n'), ((1075, 1... |
import sys
import pytz
#import xml.utils.iso8601
import time
import numpy
from datetime import date, datetime, timedelta
from matplotlib import pyplot as plt
from exchange import cb_exchange as cb_exchange
from exchange import CoinbaseExchangeAuth
from abc import ABCMeta, abstractmethod
class strategy(object):
"""... | [
"sys.stdout.write",
"numpy.array",
"sys.stdout.flush",
"numpy.average"
] | [((5274, 5296), 'numpy.array', 'numpy.array', (['fltprices'], {}), '(fltprices)\n', (5285, 5296), False, 'import numpy\n'), ((5327, 5350), 'numpy.array', 'numpy.array', (['fltvolumes'], {}), '(fltvolumes)\n', (5338, 5350), False, 'import numpy\n'), ((5374, 5436), 'numpy.average', 'numpy.average', (['np_discrete_prices'... |
"""
Learns a matrix of Z-Space directions using a pre-trained BigGAN Generator.
Modified from train.py in the PyTorch BigGAN repo.
"""
import os
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.optim
import utils
import train_fns
from sync_batchnorm import patch_replication_callback
from torch.u... | [
"torch.cuda.device_count",
"direction_utils.init_wandb",
"layers.fast_gram_schmidt",
"torch.utils.tensorboard.SummaryWriter",
"torch.eye",
"torch.nn.init.kaiming_normal_",
"direction_utils.download_G",
"train_fns.save_and_sample",
"sync_batchnorm.patch_replication_callback",
"utils.progress",
"u... | [((1355, 1369), 'direction_utils.load_G', 'load_G', (['config'], {}), '(config)\n', (1361, 1369), False, 'from direction_utils import visualize_directions, load_G, get_direction_padding_fn, init_wandb, download_G\n'), ((1585, 1610), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (1608, 1610), F... |
import xlsxwriter
import pandas as pd
import numpy as np
import mysql.connector
australia=pd.read_excel(r'\Users\jesica\Desktop\RCEP_economic_analysis.xlsx', sheet_name='Australia')
brunei=pd.read_excel(r'\Users\jesica\Desktop\RCEP_economic_analysis.xlsx', sheet_name='Brunei')
cambodia=pd.read_excel(r'\Users\jesica\De... | [
"pandas.read_excel"
] | [((91, 189), 'pandas.read_excel', 'pd.read_excel', (['"""\\\\Users\\\\jesica\\\\Desktop\\\\RCEP_economic_analysis.xlsx"""'], {'sheet_name': '"""Australia"""'}), "('\\\\Users\\\\jesica\\\\Desktop\\\\RCEP_economic_analysis.xlsx',\n sheet_name='Australia')\n", (104, 189), True, 'import pandas as pd\n'), ((190, 285), 'p... |
#!/usr/bin/env python3
import os
import re
import glob
import boto3
import requests
import subprocess
from time import sleep
AWS_REGION = os.environ['AWS_REGION']
DEPLOY_UUID = os.environ['DEPLOY_UUID']
SERVICE_NAME = os.environ['SERVICE_NAME']
MOUNT_POINT = "/var/lib/" + SERVICE_NAME... | [
"boto3.setup_default_session",
"boto3.client",
"re.match",
"time.sleep",
"os.chmod",
"requests.get",
"boto3.resource",
"re.sub",
"glob.glob"
] | [((444, 465), 'boto3.resource', 'boto3.resource', (['"""ec2"""'], {}), "('ec2')\n", (458, 465), False, 'import boto3\n'), ((782, 801), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (794, 801), False, 'import boto3\n'), ((814, 835), 'boto3.resource', 'boto3.resource', (['"""ec2"""'], {}), "('ec2')\n"... |
import csv
import datetime
import random
import os
from parsers.parser_base import ParserBase
FILE_TIME_EPOCH = datetime.datetime(1601, 1, 1)
FILE_TIME_MICROSECOND = 10
def filetime_to_epoch_datetime(file_time):
if isinstance(file_time, int):
microseconds_since_file_time_epoch = file_time / FILE_TIME_MIC... | [
"datetime.datetime",
"os.listdir",
"csv.DictReader",
"os.path.join",
"os.mkdir",
"datetime.timedelta",
"random.randint"
] | [((113, 142), 'datetime.datetime', 'datetime.datetime', (['(1601)', '(1)', '(1)'], {}), '(1601, 1, 1)\n', (130, 142), False, 'import datetime\n'), ((452, 519), 'datetime.timedelta', 'datetime.timedelta', ([], {'microseconds': 'microseconds_since_file_time_epoch'}), '(microseconds=microseconds_since_file_time_epoch)\n',... |
from django.http import HttpRequest
from django.middleware.csrf import _compare_salted_tokens as equivalent_tokens
from django.template.context_processors import csrf
from django.test import SimpleTestCase
class TestContextProcessor(SimpleTestCase):
def test_force_token_to_string(self):
request ... | [
"django.template.context_processors.csrf",
"django.http.HttpRequest"
] | [((322, 335), 'django.http.HttpRequest', 'HttpRequest', ([], {}), '()\n', (333, 335), False, 'from django.http import HttpRequest\n'), ((433, 446), 'django.template.context_processors.csrf', 'csrf', (['request'], {}), '(request)\n', (437, 446), False, 'from django.template.context_processors import csrf\n')] |
#! /usr/bin/python3
from help import *
import time
# short-forms are used, so as to reduce the .json file size
# t : type - d or f
# d : directory
# f : file
# ts : timestamp
# dirs : The dictionary containing info about directory contents
# time : edit time of the file/folder
# s : size of the file/folder
# p : full ... | [
"time.time"
] | [((3659, 3670), 'time.time', 'time.time', ([], {}), '()\n', (3668, 3670), False, 'import time\n'), ((4352, 4363), 'time.time', 'time.time', ([], {}), '()\n', (4361, 4363), False, 'import time\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Simple service for SL (Storstockholms Lokaltrafik)."""
import datetime
import json
import logging
from datetime import timedelta
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from ho... | [
"logging.getLogger",
"voluptuous.Any",
"hasl.tl2api",
"datetime.timedelta",
"voluptuous.Optional",
"hasl.haslapi",
"voluptuous.All",
"json.dumps",
"homeassistant.util.Throttle",
"homeassistant.util.dt.now",
"hasl.fpapi",
"hasl.si2api",
"voluptuous.Required",
"voluptuous.Coerce",
"voluptu... | [((990, 1017), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1007, 1017), False, 'import logging\n'), ((1743, 1764), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(10)'}), '(minutes=10)\n', (1752, 1764), False, 'from datetime import timedelta\n'), ((2124, 2150), 'voluptuous.Optio... |
"""
A quick library to deal with searching simbad for info
about a SN and parsing the results.
Author: <NAME>, <EMAIL>, 2014
example SIMBAD uri query:
http://simbad.u-strasbg.fr/simbad/sim-id?output.format=ASCII&Ident=sn%201998S
"""
import re
from urllib2 import urlopen
def get_SN_info( name ):
"""
Querie... | [
"re.search"
] | [((950, 981), 're.search', 're.search', (['regex_coords', 'result'], {}), '(regex_coords, result)\n', (959, 981), False, 'import re\n'), ((997, 1030), 're.search', 're.search', (['regex_redshift', 'result'], {}), '(regex_redshift, result)\n', (1006, 1030), False, 'import re\n'), ((1047, 1076), 're.search', 're.search',... |
import os
from math import cos
from math import sin
import Sofa.Core
from splib.numerics import Quat, Vec3
from sofacontrol import measurement_models
path = os.path.dirname(os.path.abspath(__file__))
class TemplateEnvironment:
def __init__(self, name='Template', rayleighMass=0.1, rayleighStiffness=0.1, dt=0.01... | [
"sofacontrol.measurement_models.linearModel",
"splib.numerics.Vec3",
"math.cos",
"os.path.abspath",
"math.sin"
] | [((176, 201), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (191, 201), False, 'import os\n'), ((3298, 3339), 'splib.numerics.Vec3', 'Vec3', (['(0.0)', '(length2 - length1)', 'lengthTrunk'], {}), '(0.0, length2 - length1, lengthTrunk)\n', (3302, 3339), False, 'from splib.numerics import Quat... |