code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
# This file was auto-generated by /Users/vogels/dev/domtree/generate_stubs.py.
from typing import overload, Callable, Dict, List, Any, Optional, Union, Generator
from domtree.node import Node
class A(Node):
"""
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/a
"""
@overload
def __call__(
... | [
"domtree.node.Node"
] | [((1979, 1988), 'domtree.node.Node', 'Node', (['"""a"""'], {}), "('a')\n", (1983, 1988), False, 'from domtree.node import Node\n'), ((3022, 3038), 'domtree.node.Node', 'Node', (['"""altGlyph"""'], {}), "('altGlyph')\n", (3026, 3038), False, 'from domtree.node import Node\n'), ((3842, 3861), 'domtree.node.Node', 'Node',... |
from nisar.products.readers import SLC
from nisar.workflows.geo2rdr_runconfig import Geo2rdrRunConfig
import nisar.workflows.helpers as helpers
import journal
import os
import h5py
import numpy as np
import warnings
class InsarRunConfig(Geo2rdrRunConfig):
def __init__(self, args):
super().__init__(args)
... | [
"h5py.File",
"nisar.products.readers.SLC",
"journal.error",
"os.path.isfile",
"numpy.array",
"journal.warning",
"os.path.join"
] | [((610, 652), 'journal.error', 'journal.error', (['"""InsarRunConfig.yaml_check"""'], {}), "('InsarRunConfig.yaml_check')\n", (623, 652), False, 'import journal\n'), ((679, 723), 'journal.warning', 'journal.warning', (['"""InsarRunConfig.yaml_check"""'], {}), "('InsarRunConfig.yaml_check')\n", (694, 723), False, 'impor... |
# Generated by Django 3.1.5 on 2021-01-19 22:27
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Log',
fields=[
('id', models.UU... | [
"django.db.models.TextField",
"django.db.models.UUIDField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.DateTimeField"
] | [((311, 402), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4', 'editable': '(False)', 'primary_key': '(True)', 'serialize': '(False)'}), '(default=uuid.uuid4, editable=False, primary_key=True,\n serialize=False)\n', (327, 402), False, 'from django.db import migrations, models\n'), ((4... |
"""empty message
Revision ID: c<PASSWORD>ad69c152
Revises: None
Create Date: 2016-06-05 07:39:52.804131
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | [
"alembic.op.drop_table",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Text",
"sqlalchemy.SmallInteger",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((1041, 1074), 'alembic.op.drop_table', 'op.drop_table', (['"""component_update"""'], {}), "('component_update')\n", (1054, 1074), False, 'from alembic import op\n'), ((885, 914), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (908, 914), True, 'import sqlalchemy as sa\n'... |
"""
@author: <NAME> <<EMAIL>>
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.model.utils import matrix_mul, element_wise_mul
class SentAttNet(nn.Module):
def __init__(self, sent_hidden_size=50, word_hidden_size=50, num_classes=14):
super(SentAttNet, self).__init__()
... | [
"torch.nn.GRU",
"torch.nn.functional.softmax",
"torch.Tensor",
"src.model.utils.matrix_mul",
"torch.nn.Linear"
] | [((591, 657), 'torch.nn.GRU', 'nn.GRU', (['(2 * word_hidden_size)', 'sent_hidden_size'], {'bidirectional': '(True)'}), '(2 * word_hidden_size, sent_hidden_size, bidirectional=True)\n', (597, 657), True, 'import torch.nn as nn\n'), ((676, 720), 'torch.nn.Linear', 'nn.Linear', (['(2 * sent_hidden_size)', 'num_classes'], ... |
#!/usr/bin/env python
# license removed for brevity
import rospy
from std_msgs.msg import UInt16
def talker():
max_angle = 180
direction = 1
angle = 10
increment = 5
pub = rospy.Publisher('servo', UInt16, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10) # 10h... | [
"rospy.is_shutdown",
"rospy.init_node",
"rospy.Publisher",
"rospy.Rate"
] | [((195, 242), 'rospy.Publisher', 'rospy.Publisher', (['"""servo"""', 'UInt16'], {'queue_size': '(10)'}), "('servo', UInt16, queue_size=10)\n", (210, 242), False, 'import rospy\n'), ((247, 288), 'rospy.init_node', 'rospy.init_node', (['"""talker"""'], {'anonymous': '(True)'}), "('talker', anonymous=True)\n", (262, 288),... |
from __future__ import print_function
import tensorflow as tf
import numpy as np
from dataset import load_data
from nn import nn_utils
# Training Parameters
learning_rate = 0.001
num_epochs = 1000
batch_size = 20
# Read workload dataset, sequence length and input dimensionality from the workload Matlab matrix
data,... | [
"tensorflow.contrib.rnn.GRUCell",
"tensorflow.trainable_variables",
"tensorflow.reshape",
"dataset.load_data",
"tensorflow.matmul",
"tensorflow.ConfigProto",
"tensorflow.contrib.rnn.static_rnn",
"tensorflow.split",
"tensorflow.GPUOptions",
"tensorflow.clip_by_global_norm",
"nn.nn_utils.max_pool"... | [((348, 403), 'dataset.load_data', 'load_data', (['"""workload"""'], {'one_hot': '(True)', 'validation_size': '(10)'}), "('workload', one_hot=True, validation_size=10)\n", (357, 403), False, 'from dataset import load_data\n'), ((1409, 1478), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None,... |
import unittest
import mock
from flashcards.sets import StudySet
from flashcards.cards import StudyCard
from flashcards import study
from flashcards.study import BaseStudySession
from flashcards.study import ShuffledStudySession
def create_study_set():
""" Create a simple study set for test purposes. """
ca... | [
"flashcards.cards.StudyCard",
"mock.patch",
"flashcards.study.ShuffledStudySession",
"flashcards.study.BaseStudySession",
"mock.Mock",
"flashcards.sets.StudySet",
"flashcards.study.get_study_session_template"
] | [((498, 521), 'flashcards.sets.StudySet', 'StudySet', (['"""Basic Maths"""'], {}), "('Basic Maths')\n", (506, 521), False, 'from flashcards.sets import StudySet\n'), ((2434, 2479), 'mock.patch', 'mock.patch', (['"""flashcards.study.random.shuffle"""'], {}), "('flashcards.study.random.shuffle')\n", (2444, 2479), False, ... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | [
"os.path.exists",
"os.path.join",
"os.makedirs",
"logging.getLogger"
] | [((1023, 1075), 'os.path.join', 'os.path.join', (['settings.STATIC_ROOT', '"""scss"""', '"""assets"""'], {}), "(settings.STATIC_ROOT, 'scss', 'assets')\n", (1035, 1075), False, 'import os\n'), ((1082, 1109), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1099, 1109), False, 'import loggi... |
import math
import numpy as np
from plotly import graph_objects as go
from plotly.subplots import make_subplots
from src.bsl_python.GUI.visualizations.visualization import Visualization
class AllChannelsTRF(Visualization):
trf = None
list_electrodes = []
height = 0.98
def __init__(self, trf, list_el... | [
"plotly.subplots.make_subplots",
"math.floor"
] | [((758, 896), 'plotly.subplots.make_subplots', 'make_subplots', ([], {'rows': 'nb_rows', 'cols': 'nb_cols', 'shared_xaxes': '(False)', 'shared_yaxes': '(False)', 'x_title': '"""Frequency (Hz)"""', 'y_title': '"""Intensity (dB)"""'}), "(rows=nb_rows, cols=nb_cols, shared_xaxes=False, shared_yaxes=\n False, x_title='F... |
import os
import torch
import numpy as np
import warnings
try:
from typing import Protocol
except ImportError: # noqa
# Python < 3.8
class Protocol:
pass
from .dsp.overlap_add import LambdaOverlapAdd
from .utils import get_device
class Separatable(Protocol):
"""Things that are separatable.... | [
"soundfile.read",
"os.path.isfile",
"librosa.resample",
"soundfile.write",
"warnings.warn",
"torch.no_grad",
"torch.from_numpy"
] | [((2704, 2719), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2717, 2719), False, 'import torch\n'), ((3474, 3495), 'torch.from_numpy', 'torch.from_numpy', (['wav'], {}), '(wav)\n', (3490, 3495), False, 'import torch\n'), ((4212, 4262), 'soundfile.read', 'sf.read', (['filename'], {'dtype': '"""float32"""', 'alwa... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD+Patents license found in the
# LICENSE file in the root directory of this source tree.
#! /usr/bin/env python2
"""make sure that the referenced objects are kept"""
import numpy as np
import unittest
imp... | [
"unittest.main",
"faiss.IndexIDMap",
"faiss.IndexIVFFlat",
"faiss.NormalizationTransform",
"faiss.IndexBinaryFlat",
"sys.getrefcount",
"gc.collect",
"numpy.random.rand",
"faiss.IndexFlatL2",
"faiss.IndexPreTransform",
"faiss.IndexShards"
] | [((2912, 2927), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2925, 2927), False, 'import unittest\n'), ((364, 386), 'numpy.random.rand', 'np.random.rand', (['(100)', 'd'], {}), '(100, d)\n', (378, 386), True, 'import numpy as np\n'), ((410, 431), 'numpy.random.rand', 'np.random.rand', (['(20)', 'd'], {}), '(20,... |
__author__ = "shekkizh"
import numpy as np
from utils.non_neg_qpsolver import non_negative_qpsolver
import scipy.sparse as sparse
def nnk_graph(G, mask, knn_param, reg=1e-6):
'''
Function to generate NNK graph given similarity matrix and mask
:param G: Similarity matrix
:param mask: each row correspo... | [
"utils.non_neg_qpsolver.non_negative_qpsolver",
"numpy.maximum",
"numpy.sum",
"numpy.argmax",
"scipy.sparse.find",
"numpy.ix_",
"numpy.zeros",
"numpy.expand_dims",
"numpy.where",
"numpy.arange",
"numpy.tile",
"numpy.dot"
] | [((638, 673), 'numpy.zeros', 'np.zeros', (['(num_of_nodes, knn_param)'], {}), '((num_of_nodes, knn_param))\n', (646, 673), True, 'import numpy as np\n'), ((694, 729), 'numpy.zeros', 'np.zeros', (['(num_of_nodes, knn_param)'], {}), '((num_of_nodes, knn_param))\n', (702, 729), True, 'import numpy as np\n'), ((749, 784), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# And changed even more by <NAME> for Apertium, in December 2013.
#
# Hacked up by <NAME> for use in Guampa, October 2013.
#
# =============================================================================
# Version: 2.5 (May 9, 2013)
# Author: <NAME> (<EMAIL>)... | [
"argparse.ArgumentParser",
"re.compile",
"bz2.BZ2File",
"sys.stdout.flush",
"gzip.GzipFile",
"re.sub",
"sys.exit",
"mimetypes.guess_type"
] | [((7409, 7444), 're.compile', 're.compile', (['"""<!--.*?-->"""', 're.DOTALL'], {}), "('<!--.*?-->', re.DOTALL)\n", (7419, 7444), False, 'import re\n'), ((8515, 8549), 're.compile', 're.compile', (['"""^ .*?$"""', 're.MULTILINE'], {}), "('^ .*?$', re.MULTILINE)\n", (8525, 8549), False, 'import re\n'), ((8637, 8670), 'r... |
import pytest
import numpy as np
import os, sys
os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../..')
from tests.embeddings_pipelines.model.test_models import AbstractTestKeywordExtractionModel
sys.path.append( os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../../src') )
from embeddings... | [
"os.path.abspath",
"embeddings_pipelines.models.keyword_extraction_models.DummyKeywordExtractionModel"
] | [((80, 105), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (95, 105), False, 'import os, sys\n'), ((259, 284), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (274, 284), False, 'import os, sys\n'), ((518, 547), 'embeddings_pipelines.models.keyword_extraction_models... |
import sys
import os
import cobra.io
import libsbml
from tqdm import tqdm
import pandas as pd
import re
import memote
from bioservices.kegg import KEGG
import helper_functions as hf
'''
Usage: annotate_reactions.py <path_input_sbml-file> <path_output_sbml-file>
<path_outfile-tsv_missing_bigg> <path_memote-report>
Adds... | [
"pandas.DataFrame",
"bioservices.kegg.KEGG",
"memote.snapshot_report",
"memote.test_model",
"pandas.read_csv",
"libsbml.SBMLReader",
"os.path.exists",
"libsbml.SBMLWriter",
"re.sub",
"sys.exit",
"helper_functions.add_link_annotation_reaction"
] | [((724, 744), 'libsbml.SBMLReader', 'libsbml.SBMLReader', ([], {}), '()\n', (742, 744), False, 'import libsbml\n'), ((758, 778), 'libsbml.SBMLWriter', 'libsbml.SBMLWriter', ([], {}), '()\n', (776, 778), False, 'import libsbml\n'), ((1002, 1065), 'pandas.read_csv', 'pd.read_csv', (['"""Databases/SEED/reactions.tsv"""'],... |
from argparse import ArgumentParser
import codecs
import os
"""
To encode:
python /home/david/Escritorio/encoding2multitask.py \
--input /home/david/Escritorio/dataset/ptb/ptb-dev.seq_lu \
--output /tmp/ptb-dev.multitask \
--status encode
To decode:
python /home/david/Escritorio/encoding2multitask.py \
--input /tmp... | [
"codecs.open",
"argparse.ArgumentParser"
] | [((2844, 2860), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (2858, 2860), False, 'from argparse import ArgumentParser\n'), ((3747, 3776), 'codecs.open', 'codecs.open', (['args.output', '"""w"""'], {}), "(args.output, 'w')\n", (3758, 3776), False, 'import codecs\n'), ((3798, 3821), 'codecs.open', 'cod... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 <NAME> <<EMAIL>>
# License: MIT (see LICENSE.TXT file)
from django import forms
from django.utils.translation import ugettext as _
from sanitizer.forms import SanitizedCharField
from config.settings import SANITIZER_ALLOWED_TAGS, SANITIZER_ALLOWED_ATTRIB... | [
"django.utils.translation.ugettext"
] | [((390, 400), 'django.utils.translation.ugettext', '_', (['"""TITLE"""'], {}), "('TITLE')\n", (391, 400), True, 'from django.utils.translation import ugettext as _\n'), ((441, 453), 'django.utils.translation.ugettext', '_', (['"""CONTENT"""'], {}), "('CONTENT')\n", (442, 453), True, 'from django.utils.translation impor... |
'''
ccache Wrapper
Copyright (c) 2015 - 2021 Rob "N3X15" Nelson <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy... | [
"buildtools.bt_logging.log.info",
"buildtools.os_utils.ENV.set",
"buildtools.os_utils.ENV.get",
"buildtools.os_utils.which"
] | [((1302, 1316), 'buildtools.os_utils.which', 'which', (['subject'], {}), '(subject)\n', (1307, 1316), False, 'from buildtools.os_utils import cmd, ENV, which\n'), ((1376, 1409), 'buildtools.bt_logging.log.info', 'log.info', (['"""Configuring ccache..."""'], {}), "('Configuring ccache...')\n", (1384, 1409), False, 'from... |
import logging
import os
import sys
import h5py
import argparse
import matplotlib as mpl
mpl.use('Agg') # Because of an issue in Qt5 causing seg fault
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import torch
from torchvision import datasets, transforms
from torch.utils.data import DataLoa... | [
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"indexedconv.utils.NumpyToTensor",
"logging.Formatter",
"torchvision.datasets.CIFAR10",
"numpy.mean",
"torch.arange",
"torch.device",
"torch.no_grad",
"indexedconv.utils.normalize",
"torch.utils.data.DataLoader",
"indexedconv.utils.get_gp... | [((90, 104), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (97, 104), True, 'import matplotlib as mpl\n'), ((2568, 2607), 'indexedconv.utils.build_hexagonal_position', 'utils.build_hexagonal_position', (['idx_mtx'], {}), '(idx_mtx)\n', (2598, 2607), True, 'import indexedconv.utils as utils\n'), ((2629,... |
import json
import logging
import tempfile
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from ...core.model.events import *
from ...core.reporting.blocks import *
from ...core.reporting.base import *
from ...core.reporting.utils import add_pngs_for_all_svgs
from ...core.reporting.callbacks... | [
"tempfile.NamedTemporaryFile",
"slack_sdk.WebClient",
"logging.debug",
"logging.error"
] | [((1005, 1033), 'slack_sdk.WebClient', 'WebClient', ([], {'token': 'slack_token'}), '(token=slack_token)\n', (1014, 1033), False, 'from slack_sdk import WebClient\n'), ((7490, 7644), 'logging.debug', 'logging.debug', (['f"""--sending to slack--\ntitle:{title}\nblocks: {output_blocks}\nattachment_blocks: {report_attachm... |
import sys
import os
import argparse
import multiprocessing
import logging
import collections
import itertools
import traceback
from functools import partial
import json
import base64
import time
import pysam
import pybedtools
from defaults import *
from sv_interval import *
precise_methods = set(["AS", "SR", "JM"])... | [
"pybedtools.Interval",
"base64.b64decode",
"json.dumps",
"os.path.isfile",
"os.path.join",
"traceback.print_exc",
"os.path.exists",
"pybedtools.BedTool",
"itertools.product",
"collections.Counter",
"pybedtools.set_tempdir",
"functools.partial",
"multiprocessing.current_process",
"os.path.g... | [((4736, 4907), 'pybedtools.Interval', 'pybedtools.Interval', (['feature.chrom', 'feature.start', 'feature.end'], {'name': "('%s,%s' % (feature.name, other_bp_field))", 'score': 'feature.score', 'otherfields': 'feature.fields[6:]'}), "(feature.chrom, feature.start, feature.end, name='%s,%s' %\n (feature.name, other_... |
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import (CategoricalHyperparameter,
UniformIntegerHyperparameter)
cs = ConfigurationSpace()
n_neighbors = UniformIntegerHyperparameter(
name="n_neighbors", lower=1, upper=100, lo... | [
"ConfigSpace.configuration_space.ConfigurationSpace",
"ConfigSpace.hyperparameters.CategoricalHyperparameter",
"ConfigSpace.hyperparameters.UniformIntegerHyperparameter"
] | [((208, 228), 'ConfigSpace.configuration_space.ConfigurationSpace', 'ConfigurationSpace', ([], {}), '()\n', (226, 228), False, 'from ConfigSpace.configuration_space import ConfigurationSpace\n'), ((244, 344), 'ConfigSpace.hyperparameters.UniformIntegerHyperparameter', 'UniformIntegerHyperparameter', ([], {'name': '"""n... |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
---
module: federation_idp_info
short_description: Get the information about the available federation identity
providers
author: OpenStack A... | [
"ansible_collections.openstack.cloud.plugins.module_utils.openstack.openstack_cloud_from_module",
"ansible_collections.openstack.cloud.plugins.module_utils.openstack.openstack_module_kwargs",
"ansible.module_utils.basic.AnsibleModule"
] | [((1910, 1935), 'ansible_collections.openstack.cloud.plugins.module_utils.openstack.openstack_module_kwargs', 'openstack_module_kwargs', ([], {}), '()\n', (1933, 1935), False, 'from ansible_collections.openstack.cloud.plugins.module_utils.openstack import openstack_module_kwargs\n'), ((1954, 2025), 'ansible.module_util... |
from helpers import console
def record_usage(ctx):
if ctx.guild:
console.info(f"{ctx.author} used {ctx.command} in {ctx.guild}|#{ctx.channel}")
else:
console.info(f"{ctx.author} used {ctx.command} in DM")
| [
"helpers.console.info"
] | [((79, 157), 'helpers.console.info', 'console.info', (['f"""{ctx.author} used {ctx.command} in {ctx.guild}|#{ctx.channel}"""'], {}), "(f'{ctx.author} used {ctx.command} in {ctx.guild}|#{ctx.channel}')\n", (91, 157), False, 'from helpers import console\n'), ((176, 230), 'helpers.console.info', 'console.info', (['f"""{ct... |
# -*- coding: utf-8 -*-
"""
obspy.clients.fdsn - FDSN web service client for ObsPy
======================================================
The obspy.clients.fdsn package contains a client to access web servers that
implement the `FDSN web service definitions`_.
:copyright:
The ObsPy Development Team (<EMAIL>)
:lice... | [
"future.utils.native_str",
"doctest.testmod"
] | [((10077, 10090), 'future.utils.native_str', 'native_str', (['x'], {}), '(x)\n', (10087, 10090), False, 'from future.utils import PY2, native_str\n'), ((10181, 10216), 'doctest.testmod', 'doctest.testmod', ([], {'exclude_empty': '(True)'}), '(exclude_empty=True)\n', (10196, 10216), False, 'import doctest\n')] |
"""NetApp DataOps Toolkit S3 Data Mover module"""
from kubernetes.client import (
V1ConfigMapVolumeSource,
V1Container,
V1EnvVar,
V1EnvVarSource,
V1KeyToPath,
V1ObjectMeta,
V1PersistentVolumeClaimVolumeSource,
V1PodSpec,
V1PodTemplateSpec,
V1ResourceRequirements,
V1SecretKey... | [
"netapp_dataops.k8s._get_labels",
"netapp_dataops.k8s.create_k8s_opaque_secret",
"kubernetes.client.V1PersistentVolumeClaimVolumeSource",
"kubernetes.client.V1VolumeMount",
"kubernetes.client.V1KeyToPath",
"kubernetes.client.V1ResourceRequirements",
"netapp_dataops.k8s.delete_k8s_secret",
"kubernetes.... | [((2320, 2366), 'netapp_dataops.k8s._get_labels', '_get_labels', ([], {'operation': '"""s3configsecret-create"""'}), "(operation='s3configsecret-create')\n", (2331, 2366), False, 'from netapp_dataops.k8s import _get_labels, create_k8s_opaque_secret, delete_k8s_secret\n'), ((2375, 2516), 'netapp_dataops.k8s.create_k8s_o... |
#!/usr/bin/env python
# This example demonstrates how to use the vtkPlaneWidget to probe a
# dataset and then generate contours on the probed data.
import vtk
# The sphere and spikes are appended into a single polydata.
# This just makes things simpler to manage.
apd = vtk.vtkSTLReader()
apd.SetFileName("/home/saito... | [
"vtk.vtkRenderer",
"vtk.vtkRenderWindow",
"vtk.vtkCubeAxesActor2D",
"vtk.vtkImplicitPlaneWidget2",
"vtk.vtkImplicitPlaneRepresentation",
"vtk.vtkTextProperty",
"vtk.vtkSTLReader",
"vtk.vtkActor",
"vtk.vtkOutlineFilter",
"vtk.vtkClipPolyData",
"vtk.vtkRenderWindowInteractor",
"vtk.vtkPlane",
... | [((273, 291), 'vtk.vtkSTLReader', 'vtk.vtkSTLReader', ([], {}), '()\n', (289, 291), False, 'import vtk\n'), ((468, 491), 'vtk.vtkPolyDataMapper', 'vtk.vtkPolyDataMapper', ([], {}), '()\n', (489, 491), False, 'import vtk\n'), ((556, 570), 'vtk.vtkActor', 'vtk.vtkActor', ([], {}), '()\n', (568, 570), False, 'import vtk\n... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-06-05 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('problems', '0092_auto_20170605_1412'),
]
operations = [
migrations.AlterFiel... | [
"django.db.models.NullBooleanField"
] | [((435, 511), 'django.db.models.NullBooleanField', 'models.NullBooleanField', ([], {'default': 'None', 'verbose_name': '"""initialization success"""'}), "(default=None, verbose_name='initialization success')\n", (458, 511), False, 'from django.db import migrations, models\n')] |
from potentiostat import Potentiostat
import matplotlib.pyplot as plt
port = '/dev/ttyACM0' # Serial port for potentiostat device
datafile = 'data.txt' # Output file for time, curr, volt data
channel_list = [1,7]
test_name = 'cyclic' # The name of the test to run
curr_range = '100uA' # The ... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"potentiostat.Potentiostat",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((1750, 1768), 'potentiostat.Potentiostat', 'Potentiostat', (['port'], {}), '(port)\n', (1762, 1768), False, 'from potentiostat import Potentiostat\n'), ((2896, 2906), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2904, 2906), True, 'import matplotlib.pyplot as plt\n'), ((2350, 2366), 'matplotlib.pyplot.fig... |
from django.db import models
from django.contrib.auth.models import User
from stocks.models import Stock
# Create your models here.
class StockUser(models.Model):
stock = models.ForeignKey(Stock, default=None, on_delete=models.PROTECT)
user = models.ForeignKey(User, default=None, on_delete=models.PROTECT)
... | [
"django.db.models.ForeignKey",
"django.db.models.DecimalField"
] | [((176, 240), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Stock'], {'default': 'None', 'on_delete': 'models.PROTECT'}), '(Stock, default=None, on_delete=models.PROTECT)\n', (193, 240), False, 'from django.db import models\n'), ((252, 315), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'defa... |
import traceback
import re
from django.core.exceptions import ValidationError
from django.db import transaction
from wildlifecompliance.components.applications.models import (
ApplicationDocument,
ApplicationFormDataRecord,
ApplicationSelectedActivity,
)
from wildlifecompliance.components.applications.seria... | [
"traceback.print_exc",
"wildlifecompliance.components.licences.models.LicencePurpose.objects.filter",
"wildlifecompliance.components.applications.models.ApplicationFormDataRecord.objects.get",
"re.match",
"wildlifecompliance.components.applications.serializers.SaveApplicationSerializer",
"django.db.transa... | [((1307, 1327), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (1325, 1327), False, 'from django.db import transaction\n'), ((2729, 2749), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (2747, 2749), False, 'from django.db import transaction\n'), ((9369, 9386), 're.matc... |
from yui.box import Box
from yui.box.apps.basic import App
from yui.event import Hello
def test_box_class():
box = Box()
assert not box.apps
assert not box.tasks
@box.command('test1')
async def test1(bot, event):
"""
TEST SHORT HELP
LONG CAT IS LONG
"""
h1 ... | [
"yui.box.Box"
] | [((121, 126), 'yui.box.Box', 'Box', ([], {}), '()\n', (124, 126), False, 'from yui.box import Box\n')] |
import unittest
from tests.lib.client import get_client
from tests.lib.card_products import CardProducts
from tests.lib.card_verifications import verify_card_response
class TestCardsCreate(unittest.TestCase):
"""Tests for the cards.create endpoint."""
@classmethod
def setUpClass(cls):
"""Setup f... | [
"tests.lib.client.get_client",
"tests.lib.card_verifications.verify_card_response",
"tests.lib.card_products.CardProducts"
] | [((372, 384), 'tests.lib.client.get_client', 'get_client', ([], {}), '()\n', (382, 384), False, 'from tests.lib.client import get_client\n'), ((1132, 1174), 'tests.lib.card_verifications.verify_card_response', 'verify_card_response', (['self', 'card', 'expected'], {}), '(self, card, expected)\n', (1152, 1174), False, '... |
# coding: utf-8
from django.utils.translation import ugettext_lazy as _
VIDEO_STATE_PENDING = 0
VIDEO_STATE_INPROGRESS = 1
VIDEO_STATE_ERROR = 2
VIDEO_STATE_SUCCESS = 3
VIDEO_QUALITY_HIGH = 'high'
VIDEO_QUALITY_SEMIHIGH = 'semi-high'
VIDEO_QUALITY_MEDIUM = 'medium'
VIDEO_QUALITY_LOW = 'low'
VIDEO_STATES = {
VIDE... | [
"django.utils.translation.ugettext_lazy"
] | [((337, 350), 'django.utils.translation.ugettext_lazy', '_', (['u"""pending"""'], {}), "(u'pending')\n", (338, 350), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((380, 397), 'django.utils.translation.ugettext_lazy', '_', (['u"""in progress"""'], {}), "(u'in progress')\n", (381, 397), True, 'from... |
from scout.utils.convert import make_bool, convert_number
def parse_peddy_ped(lines):
"""Parse a peddy.ped file
Args:
lines(iterable(str))
Returns:
peddy_ped(list(dict))
"""
peddy_ped = []
header = []
for i, line in enumerate(lines):
line = line.rstrip()
i... | [
"scout.utils.convert.convert_number"
] | [((654, 685), 'scout.utils.convert.convert_number', 'convert_number', (["ind_info['PC1']"], {}), "(ind_info['PC1'])\n", (668, 685), False, 'from scout.utils.convert import make_bool, convert_number\n'), ((716, 747), 'scout.utils.convert.convert_number', 'convert_number', (["ind_info['PC2']"], {}), "(ind_info['PC2'])\n"... |
from __future__ import print_function
import numpy as np
from numpy.testing import *
from skimage.transform import *
def rescale(x):
x = x.astype(float)
x -= x.min()
x /= x.max()
return x
def test_radon_iradon():
size = 100
debug = False
image = np.tri(size) + np.tri(size)[::-1]
for... | [
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.allclose",
"numpy.zeros",
"numpy.max",
"numpy.arange",
"numpy.linspace",
"numpy.tri",
"matplotlib.pyplot.subplots"
] | [((1958, 1989), 'numpy.allclose', 'np.allclose', (['s', 's[0]'], {'rtol': '(0.01)'}), '(s, s[0], rtol=0.01)\n', (1969, 1989), True, 'import numpy as np\n'), ((279, 291), 'numpy.tri', 'np.tri', (['size'], {}), '(size)\n', (285, 291), True, 'import numpy as np\n'), ((1060, 1072), 'numpy.tri', 'np.tri', (['size'], {}), '(... |
# import json # noqa: F401
from karp.utility.json_schema import create_entry_json_schema
CONFIG_PLACES = """{
"resource_id": "places",
"resource_name": "Platser i Sverige",
"fields": {
"name": {
"type": "string",
"required": true
},
"municipality": {
"collection": true,
"typ... | [
"karp.utility.json_schema.create_entry_json_schema"
] | [((684, 738), 'karp.utility.json_schema.create_entry_json_schema', 'create_entry_json_schema', (["json_schema_config['fields']"], {}), "(json_schema_config['fields'])\n", (708, 738), False, 'from karp.utility.json_schema import create_entry_json_schema\n')] |
# Generated by Django 2.2 on 2020-05-06 14:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0011_managementunit_grid10s'),
]
operations = [
migrations.CreateModel(
name='FinClip',
fields=[
... | [
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((332, 425), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (348, 425), False, 'from django.db import migrations, models\... |
"""Dataset module for functions related to an xarray.Dataset."""
import pathlib
from functools import partial
from glob import glob
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union
import pandas as pd
import xarray as xr
from xcdat import bounds # noqa: F401
from xcdat.axis import swap_l... | [
"functools.partial",
"xcdat.logger.setup_custom_logger",
"xarray.open_dataset",
"pandas.to_datetime",
"xarray.DataArray",
"glob.glob",
"xarray.open_mfdataset",
"pandas.DateOffset",
"xcdat.axis.swap_lon_axis"
] | [((383, 412), 'xcdat.logger.setup_custom_logger', 'setup_custom_logger', (['__name__'], {}), '(__name__)\n', (402, 412), False, 'from xcdat.logger import setup_custom_logger\n'), ((8254, 8363), 'xarray.open_mfdataset', 'xr.open_mfdataset', (['paths'], {'decode_times': 'decode_times', 'data_vars': 'data_vars', 'preproce... |
import logging
import numpy as np
from typing import Dict
from webserver.tasks import task_keeper
from webserver.utilities.configuration import configuration
logger = logging.getLogger(__name__)
la = None
if "prott5_annotations" in configuration['celery']['celery_worker_type']:
from bio_embeddings.extract.ligh... | [
"webserver.tasks.task_keeper.task",
"bio_embeddings.extract.light_attention.LightAttentionAnnotationExtractor",
"logging.getLogger"
] | [((170, 197), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (187, 197), False, 'import logging\n'), ((760, 778), 'webserver.tasks.task_keeper.task', 'task_keeper.task', ([], {}), '()\n', (776, 778), False, 'from webserver.tasks import task_keeper\n'), ((444, 705), 'bio_embeddings.extract... |
# Generated by Django 4.0.3 on 2022-03-15 19:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('prohub', '0002_rename_user_project_owner'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='project',
... | [
"django.db.migrations.RemoveField"
] | [((233, 293), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""profile"""', 'name': '"""project"""'}), "(model_name='profile', name='project')\n", (255, 293), False, 'from django.db import migrations\n')] |
#! /usr/bin/python3
import sys
sys.path.append('../../')
from nephelae_paparazzi.missions import MissionFactory, MissionManager
from nephelae_paparazzi.missions.rules import ParameterRules, SimpleBounds, AllowedValues, DefaultValue, Length
from nephelae_paparazzi.common import messageInterface, PprzMessage
def send_... | [
"sys.path.append",
"nephelae_paparazzi.common.messageInterface.send",
"nephelae_paparazzi.missions.rules.AllowedValues",
"nephelae_paparazzi.missions.rules.Length",
"nephelae_paparazzi.missions.rules.SimpleBounds",
"nephelae_paparazzi.missions.MissionManager",
"nephelae_paparazzi.common.PprzMessage"
] | [((32, 57), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (47, 57), False, 'import sys\n'), ((1388, 1442), 'nephelae_paparazzi.missions.MissionManager', 'MissionManager', (['"""200"""'], {'factories': "{'Lace': laceFactory}"}), "('200', factories={'Lace': laceFactory})\n", (1402, 1442), ... |
from django.contrib import admin
from .models import Card, EmailStore
# Register your models here.
admin.site.register(Card)
admin.site.register(EmailStore) | [
"django.contrib.admin.site.register"
] | [((100, 125), 'django.contrib.admin.site.register', 'admin.site.register', (['Card'], {}), '(Card)\n', (119, 125), False, 'from django.contrib import admin\n'), ((126, 157), 'django.contrib.admin.site.register', 'admin.site.register', (['EmailStore'], {}), '(EmailStore)\n', (145, 157), False, 'from django.contrib impor... |
import json
"""Demo of serialization and deserialization using JSON"""
# Serialize a dict
dict_obj = {
'name': 'Tom汤姆',
'age': 22,
'likes': ['dog', 'cat']
}
json_str = json.dumps(dict_obj)
print(json_str)
dict_obj_2 = json.loads(json_str)
print(dict_obj_2)
# Serialize a class object
class Man:
def... | [
"json.loads",
"json.dumps"
] | [((183, 203), 'json.dumps', 'json.dumps', (['dict_obj'], {}), '(dict_obj)\n', (193, 203), False, 'import json\n'), ((234, 254), 'json.loads', 'json.loads', (['json_str'], {}), '(json_str)\n', (244, 254), False, 'import json\n'), ((509, 533), 'json.dumps', 'json.dumps', (['man.__dict__'], {}), '(man.__dict__)\n', (519, ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import unittest
import os
from keras.layers.core import Dense
import dde
from dde.cnn_model import build_model, save_model
from dde.layers import MoleculeConv
from dde.uncertainty import RandomMask, EnsembleModel
class TestCNNModel(unittest.TestCase):
def test_buil... | [
"os.mkdir",
"os.path.dirname",
"os.path.exists",
"dde.cnn_model.save_model",
"dde.cnn_model.build_model",
"shutil.rmtree",
"os.path.join"
] | [((440, 547), 'dde.cnn_model.build_model', 'build_model', ([], {'embedding_size': 'embedding_size', 'attribute_vector_size': 'attribute_vector_size', 'hidden': 'hidden'}), '(embedding_size=embedding_size, attribute_vector_size=\n attribute_vector_size, hidden=hidden)\n', (451, 547), False, 'from dde.cnn_model import... |
from tkinter import *
from dnd_character_sheet.sheets.Abilities import Abilities
finestra = Tk()
finestra.geometry('500x300+400+200')
finestra.title('D&D CHARACTER SHEET')
abilities = Abilities()
abilities.strength = 13
abilities.dexterity = 16
abilities.constitution = 14
abilities.intelligence = 11
abilities.wisd... | [
"dnd_character_sheet.sheets.Abilities.Abilities"
] | [((188, 199), 'dnd_character_sheet.sheets.Abilities.Abilities', 'Abilities', ([], {}), '()\n', (197, 199), False, 'from dnd_character_sheet.sheets.Abilities import Abilities\n')] |
# import the necessary packages
from keras.models import Model
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Dropout
from keras.layers.core... | [
"keras.layers.core.Dense",
"tensorflow.image.rgb_to_grayscale",
"keras.layers.core.Activation",
"keras.layers.convolutional.MaxPooling2D",
"keras.layers.Flatten",
"keras.models.Model",
"keras.layers.convolutional.Conv2D",
"keras.layers.core.Dropout",
"keras.layers.Input",
"keras.layers.normalizati... | [((4977, 5000), 'keras.layers.Input', 'Input', ([], {'shape': 'inputShape'}), '(shape=inputShape)\n', (4982, 5000), False, 'from keras.layers import Input\n'), ((5281, 5359), 'keras.models.Model', 'Model', ([], {'inputs': 'inputs', 'outputs': '[categoryBranch, colorBranch]', 'name': '"""fashionnet"""'}), "(inputs=input... |
import cv2
name="num"
path='/home/jelly/catkin_ws/src/Yolo_mark/x64/Release/data/'
count=1954
last=1954
while count<=last :
try:
txt = open(path+name+str(count)+'.txt','r+')
print(count)
lines = txt.readlines()
print(lines)
for line in lines:
if line[0]=="0": ... | [
"cv2.waitKey"
] | [((792, 808), 'cv2.waitKey', 'cv2.waitKey', (['(500)'], {}), '(500)\n', (803, 808), False, 'import cv2\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .admin_saml_groups import *
from .apps_local import *
from .authentication_users impor... | [
"pulumi.ResourceOptions",
"pulumi.runtime.register_resource_module"
] | [((4802, 4898), 'pulumi.runtime.register_resource_module', 'pulumi.runtime.register_resource_module', (['"""splunk"""', '"""index/adminSamlGroups"""', '_module_instance'], {}), "('splunk', 'index/adminSamlGroups',\n _module_instance)\n", (4841, 4898), False, 'import pulumi\n'), ((4899, 4989), 'pulumi.runtime.registe... |
"""Construct an array by repeating A the number of times given by reps."""
from __future__ import annotations
import numpy
import numpy.typing
import numpoly
from ..baseclass import ndpoly, PolyLike
from ..dispatch import implements
@implements(numpy.tile)
def tile(A: PolyLike, reps: numpy.typing.ArrayLike) -> ndpo... | [
"numpoly.aspolynomial",
"numpy.tile"
] | [((1641, 1664), 'numpoly.aspolynomial', 'numpoly.aspolynomial', (['A'], {}), '(A)\n', (1661, 1664), False, 'import numpoly\n'), ((1678, 1709), 'numpy.tile', 'numpy.tile', (['A.values'], {'reps': 'reps'}), '(A.values, reps=reps)\n', (1688, 1709), False, 'import numpy\n'), ((1721, 1773), 'numpoly.aspolynomial', 'numpoly.... |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file is stored in the variable path
#Code starts here
# Data Loading
data = pd.read_csv(path)
data.rename(columns = {'Total':'Total_Medals'}, inplace = True)
data.head(10)
# Summer or Winter... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.where",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((205, 222), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (216, 222), True, 'import pandas as pd\n'), ((344, 417), 'numpy.where', 'np.where', (["(data['Total_Summer'] > data['Total_Winter'])", '"""Summer"""', '"""Winter"""'], {}), "(data['Total_Summer'] > data['Total_Winter'], 'Summer', 'Winter')\n", ... |
import asyncio
import time
import os
import pathlib
default_directory = pathlib.Path(__file__).parent.absolute()
async def get_file_extension():
"""
docstring
"""
try:
extension = ''
lst = [os.path.splitext(x)[1] for x in str(default_directory)]
my_final_list = dict.fromk... | [
"asyncio.gather",
"pathlib.Path",
"asyncio.get_event_loop",
"os.path.splitext"
] | [((1075, 1099), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1097, 1099), False, 'import asyncio\n'), ((486, 502), 'asyncio.gather', 'asyncio.gather', ([], {}), '()\n', (500, 502), False, 'import asyncio\n'), ((998, 1014), 'asyncio.gather', 'asyncio.gather', ([], {}), '()\n', (1012, 1014), Fal... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 1 10:07:27 2020
@author: <NAME>
"""
##
from os import path, makedirs
##
# A method to create the start for a python class structure with getters and setters for all the attributes.\n
# @param module The python module (a.k.a. file) to write the object ... | [
"os.path.exists",
"os.makedirs"
] | [((3497, 3536), 'os.path.exists', 'path.exists', (["(directory + module + '.py')"], {}), "(directory + module + '.py')\n", (3508, 3536), False, 'from os import path, makedirs\n'), ((1009, 1028), 'os.makedirs', 'makedirs', (['directory'], {}), '(directory)\n', (1017, 1028), False, 'from os import path, makedirs\n'), ((3... |
# This file is Copyright (c) 2015-2018 <NAME> <<EMAIL>>
# This file is Copyright (c) 2017-2018 <NAME> <<EMAIL>>
# License: BSD
import os
import subprocess
from litex.build.generic_programmer import GenericProgrammer
from litex.build import tools
class LatticeProgrammer(GenericProgrammer):
needs_bitreverse = Fal... | [
"serial.Serial",
"litex.build.generic_programmer.GenericProgrammer.__init__",
"subprocess.call",
"litex.build.tools.write_to_file"
] | [((594, 636), 'litex.build.tools.write_to_file', 'tools.write_to_file', (['xcf_file', 'xcf_content'], {}), '(xcf_file, xcf_content)\n', (613, 636), False, 'from litex.build import tools\n'), ((645, 693), 'subprocess.call', 'subprocess.call', (["['pgrcmd', '-infile', xcf_file]"], {}), "(['pgrcmd', '-infile', xcf_file])\... |
# -*- coding: utf-8 -*-
# Copyright 2011 <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 ... | [
"blockdiag.utils.Box",
"blockdiag.utils.Size",
"blockdiag.utils.XY",
"blockdiag.noderenderer.install_renderer"
] | [((4681, 4713), 'blockdiag.noderenderer.install_renderer', 'install_renderer', (['"""actor"""', 'Actor'], {}), "('actor', Actor)\n", (4697, 4713), False, 'from blockdiag.noderenderer import install_renderer\n'), ((1369, 1414), 'blockdiag.utils.XY', 'XY', (['self.center.x', '(self.center.y - r * 9 // 2)'], {}), '(self.c... |
from rest_framework import generics, permissions
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.decorators import api_view
from django.views.decorators.csrf import csrf_exempt
from .serializers import LoginUserSerializer, UserSerializer, RegisterSerializer, Ch... | [
"knox.models.AuthToken.objects.create",
"rest_framework.response.Response",
"profile_page.models.Profile.objects.all",
"django.http.JsonResponse"
] | [((3357, 3378), 'profile_page.models.Profile.objects.all', 'Profile.objects.all', ([], {}), '()\n', (3376, 3378), False, 'from profile_page.models import Profile\n'), ((3563, 3584), 'profile_page.models.Profile.objects.all', 'Profile.objects.all', ([], {}), '()\n', (3582, 3584), False, 'from profile_page.models import ... |
import sys
from pybkb.common.bayesianKnowledgeBase import bayesianKnowledgeBase as BKB
from pybkb.python_base.reasoning import checkMutex
from pybkb.python_base.fusion import fuse
from chp.patientBKFProcessor import PatientProcessor
from chp.reasoner import Reasoner
from chp.query import Query
from chp_data.bkb_hand... | [
"chp.reasoner.Reasoner",
"pybkb.python_base.reasoning.checkMutex",
"chp_data.bkb_handler.BkbDataHandler",
"pybkb.common.bayesianKnowledgeBase.bayesianKnowledgeBase"
] | [((379, 384), 'pybkb.common.bayesianKnowledgeBase.bayesianKnowledgeBase', 'BKB', ([], {}), '()\n', (382, 384), True, 'from pybkb.common.bayesianKnowledgeBase import bayesianKnowledgeBase as BKB\n'), ((789, 865), 'chp_data.bkb_handler.BkbDataHandler', 'BkbDataHandler', ([], {'bkb_version': '"""special"""', 'dataset_vers... |
#!/usr/bin/env python3
from classes.JsonConfig import loadJsonFile
configFile = '../config/config.json'
def main():
config = loadJsonFile(configFile)
print(config['io']['MoveSteering'][0])
print(config['io']['MoveSteering'][1])
main() | [
"classes.JsonConfig.loadJsonFile"
] | [((129, 153), 'classes.JsonConfig.loadJsonFile', 'loadJsonFile', (['configFile'], {}), '(configFile)\n', (141, 153), False, 'from classes.JsonConfig import loadJsonFile\n')] |
from django.conf import settings
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("", include("realworld.apps.articles.urls")),
path("", include("realworld.apps.accounts.urls")),
path("comments/", include("realworld.apps.comments.urls")),
path(settings.ADMIN_U... | [
"django.urls.path",
"django.urls.include"
] | [((299, 340), 'django.urls.path', 'path', (['settings.ADMIN_URL', 'admin.site.urls'], {}), '(settings.ADMIN_URL, admin.site.urls)\n', (303, 340), False, 'from django.urls import include, path\n'), ((134, 173), 'django.urls.include', 'include', (['"""realworld.apps.articles.urls"""'], {}), "('realworld.apps.articles.url... |
"""
test RGW with SSL configured on Beast or Civetweb
Usage - test_frontends_with_ssl.py -c configs/<input-yaml>
where <input-yaml> are test_ssl_civetweb.yaml and test_ssl_beast.yaml
Operation:
- Create a user taking the inputs for frontends and authentication from the input-yaml
- Create a bucket for that user and v... | [
"v2.lib.s3.write_io_info.BasicIOInfoStructure",
"v2.lib.s3.auth.Auth",
"v2.utils.utils.gen_bucket_name_from_userid",
"v2.tests.s3_swift.reusable.create_bucket",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.exists",
"v2.lib.resource_op.Config",
"v2.lib.s3.write_io_info.IOInfoInitialize",
"v2.... | [((1110, 1129), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1127, 1129), False, 'import logging\n'), ((1204, 1222), 'v2.lib.s3.write_io_info.IOInfoInitialize', 'IOInfoInitialize', ([], {}), '()\n', (1220, 1222), False, 'from v2.lib.s3.write_io_info import IOInfoInitialize, BasicIOInfoStructure\n'), ((1... |
import unittest
try:
from coding_problems.src.algorithms.binary_search_algorithm import \
binary_search
except ImportError as e:
from coding_problems.src.algorithms.answers.binary_search_algorithm \
import binary_search
class Test_Binary_Search(unittest.TestCase):
def test_error_with_tar... | [
"unittest.main",
"coding_problems.src.algorithms.answers.binary_search_algorithm.binary_search"
] | [((1228, 1254), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (1241, 1254), False, 'import unittest\n'), ((392, 422), 'coding_problems.src.algorithms.answers.binary_search_algorithm.binary_search', 'binary_search', (['None', '[1, 2, 3]'], {}), '(None, [1, 2, 3])\n', (405, 422), False,... |
# -*- coding: utf-8 -*-
"""
db_normalizer.csv_handler.reader
----------------------------------------
Reading toolbox for .csv files.
:authors: <NAME>, <NAME>.
:licence: MIT, see LICENSE for more details.
"""
import re
from typing import List, Iterator, Optional
from pathlib2 import Path
from db... | [
"pathlib2.Path",
"re.findall"
] | [((642, 657), 'pathlib2.Path', 'Path', (['file_path'], {}), '(file_path)\n', (646, 657), False, 'from pathlib2 import Path\n'), ((1907, 1944), 're.findall', 're.findall', (['Parsing.parse_regex', 'line'], {}), '(Parsing.parse_regex, line)\n', (1917, 1944), False, 'import re\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... | [
"json.load",
"cairis.tools.JsonConverter.json_deserialize",
"urllib.quote",
"cairis.core.Locations.Locations",
"cairis.mio.ModelImport.importModelFile",
"jsonpickle.decode",
"cairis.core.Location.Location",
"cairis.mio.ModelImport.importLocationsFile",
"logging.getLogger",
"jsonpickle.encode"
] | [((1387, 1496), 'cairis.mio.ModelImport.importModelFile', 'importModelFile', (["(os.environ['CAIRIS_SRC'] + '/../examples/exemplars/ACME_Water/ACME_Water.xml')", '(1)', '"""test"""'], {}), "(os.environ['CAIRIS_SRC'] +\n '/../examples/exemplars/ACME_Water/ACME_Water.xml', 1, 'test')\n", (1402, 1496), False, 'from cai... |
from pyfiglet import Figlet
from . import routine
from . import prompt
from . import exercises
import xlsxwriter
@prompt.click.command()
def main():
"""Generate custom strength, cardio, and HIIT exercise routines using parametric curves"""
# splash screen
prompt.click.clear()
prompt.click.echo(Figlet(... | [
"pyfiglet.Figlet"
] | [((313, 336), 'pyfiglet.Figlet', 'Figlet', ([], {'font': '"""standard"""'}), "(font='standard')\n", (319, 336), False, 'from pyfiglet import Figlet\n')] |
import collections
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def verticalTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[List[int]]
... | [
"collections.defaultdict"
] | [((382, 411), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (405, 411), False, 'import collections\n'), ((715, 744), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (738, 744), False, 'import collections\n')] |
import io
import importlib
from dataframe_store import settings
def to_csv(fileobj, df, **kwargs):
return df.to_csv(fileobj, **kwargs)
def to_excel(fileobj, df, **kwargs):
return df.to_excel(fileobj, **kwargs)
def get_func(func_path=None):
module_path = '.'.join(func_path.split('.')[:-1])
func_nam... | [
"io.BytesIO",
"io.StringIO",
"importlib.import_module"
] | [((362, 398), 'importlib.import_module', 'importlib.import_module', (['module_path'], {}), '(module_path)\n', (385, 398), False, 'import importlib\n'), ((623, 636), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (634, 636), False, 'import io\n'), ((671, 683), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (681, 683), F... |
# ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: 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, ... | [
"tqdm.tqdm",
"diplomacy_research.utils.proto.read_next_bytes",
"diplomacy_research.utils.proto.bytes_to_zlib",
"os.path.exists",
"diplomacy_research.models.training.memory_buffer.MemoryBuffer",
"diplomacy_research.utils.proto.bytes_to_proto",
"pickle.load",
"shutil.move",
"os.path.join",
"logging.... | [((1602, 1629), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1619, 1629), False, 'import logging\n'), ((1775, 1809), 'os.path.exists', 'os.path.exists', (['REDIS_DATASET_PATH'], {}), '(REDIS_DATASET_PATH)\n', (1789, 1809), False, 'import os\n'), ((2650, 2664), 'diplomacy_research.model... |
# -*- coding: utf-8 -*-
"""
Url's map for documents board
"""
from django.conf.urls import *
from sveedocuments.views.board import (
BoardIndexView, PreviewView, BoardEditorSettingsView,
BoardPagesIndexView, BoardInsertsIndexView
)
from sveedocuments.views.board.page import (
PageCreateView,
PageEditVi... | [
"sveedocuments.views.board.insert.InsertQuicksaveView.as_view",
"sveedocuments.views.board.insert.InsertDeleteView.as_view",
"sveedocuments.views.board.page.PageCreateView.as_view",
"sveedocuments.views.board.attachment.PageAttachmentDeleteView.as_view",
"sveedocuments.views.board.BoardInsertsIndexView.as_v... | [((674, 698), 'sveedocuments.views.board.BoardIndexView.as_view', 'BoardIndexView.as_view', ([], {}), '()\n', (696, 698), False, 'from sveedocuments.views.board import BoardIndexView, PreviewView, BoardEditorSettingsView, BoardPagesIndexView, BoardInsertsIndexView\n'), ((743, 764), 'sveedocuments.views.board.PreviewVie... |
from example_app import models
from example_app.utils import MutationObjectType, QueryObjectType
import graphene
from .schemes import UserCreateMutation, UserUpdateMutation
class Query(QueryObjectType):
class Meta:
model_mudule = models
class Mutation(MutationObjectType):
class Meta:
model_m... | [
"graphene.Schema"
] | [((412, 459), 'graphene.Schema', 'graphene.Schema', ([], {'query': 'Query', 'mutation': 'Mutation'}), '(query=Query, mutation=Mutation)\n', (427, 459), False, 'import graphene\n')] |
from flask import Flask, render_template, flash, request, jsonify
from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField
import requests
import json
import logging
import requests_toolbelt.adapters.appengine
requests_toolbelt.adapters.appengine.monkeypatch()
try:
# For Python 3.0... | [
"flask.request.args.get",
"flask.request.form.get",
"flask.Flask",
"flask.render_template",
"flask.request.get_json"
] | [((643, 658), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (648, 658), False, 'from flask import Flask, render_template, flash, request, jsonify\n'), ((801, 830), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (816, 830), False, 'from flask import Flask, rende... |
import time
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from assertions import assert_one
from dtest import PRINT_DEBUG, Tester, debug
from tools import known_failure, rows_to_list, since
class TestReadRepair(Tester):
def setUp(self):
Tester.setUp(self)
se... | [
"dtest.debug",
"dtest.Tester.setUp",
"tools.since",
"cassandra.query.SimpleStatement",
"time.sleep",
"assertions.assert_one",
"tools.known_failure"
] | [((472, 613), 'tools.known_failure', 'known_failure', ([], {'failure_source': '"""test"""', 'jira_url': '"""https://issues.apache.org/jira/browse/CASSANDRA-11266"""', 'flaky': '(False)', 'notes': '"""windows"""'}), "(failure_source='test', jira_url=\n 'https://issues.apache.org/jira/browse/CASSANDRA-11266', flaky=Fa... |
from flask import Flask
from flask_cors import CORS
from config import DevConfig, ProdConfig
from Resources import api_bp
from Models import main_db, mongo_db, mongo_client
from Utils.JWT import jwt
def create_app():
app = Flask(__name__)
app.config.from_object(DevConfig)
app.register_blueprint(api_bp, u... | [
"Models.main_db.init_app",
"flask_cors.CORS",
"flask.Flask",
"Models.main_db.create_all",
"Utils.JWT.jwt.init_app"
] | [((229, 244), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (234, 244), False, 'from flask import Flask\n'), ((349, 394), 'flask_cors.CORS', 'CORS', (['app'], {'resources': "{'/*': {'origins': '*'}}"}), "(app, resources={'/*': {'origins': '*'}})\n", (353, 394), False, 'from flask_cors import CORS\n'), ((4... |
# -*- coding: utf-8 -*-
import logging
import os
import oss2
from oss2.models import PartInfo
import json
# event format
# {
# "dest_bucket": "",
# "key": "",
# "upload_id": "",
# "parts":[
# {"part_no": 1, "etag": ""},
# {"part_no": 2, "etag": ""}
# ]
# }
def handler(event, context):
logger = lo... | [
"oss2.Bucket",
"json.loads",
"oss2.Auth",
"logging.getLogger",
"oss2.models.PartInfo",
"oss2.StsAuth"
] | [((318, 337), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (335, 337), False, 'import logging\n'), ((346, 363), 'json.loads', 'json.loads', (['event'], {}), '(event)\n', (356, 363), False, 'import json\n'), ((1113, 1148), 'oss2.Bucket', 'oss2.Bucket', (['auth', 'endpoint', 'bucket'], {}), '(auth, endpoin... |
#!/usr/bin/env python3
import logging
import os.path
import subprocess
from typing import List, Tuple, Dict, Any
import settings
logging.basicConfig(
format='%(asctime)s %(levelname)-8s %(name)18s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.DEBUG
)
def main(sys: 'System'):
screen = Scr... | [
"subprocess.run",
"logging.getLogger",
"logging.basicConfig"
] | [((131, 272), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)-8s %(name)18s: %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s %(levelname)-8s %(name)18s: %(message)s', datefmt=\n '%Y-%m-%d %H:%M:%S', level=loggin... |
from substraclient import Client
from common.utils import Mapping
from trainer.substra.testmonai import instantiateMonaiAlgo
if __name__ == '__main__':
ma, class_names = instantiateMonaiAlgo(0.3, 0.5)
client = Client("client2", "localhost:50051")
client.bootstrap(ma.model, ma.optimizer)
# training an... | [
"trainer.substra.testmonai.instantiateMonaiAlgo",
"common.utils.Mapping",
"substraclient.Client"
] | [((175, 205), 'trainer.substra.testmonai.instantiateMonaiAlgo', 'instantiateMonaiAlgo', (['(0.3)', '(0.5)'], {}), '(0.3, 0.5)\n', (195, 205), False, 'from trainer.substra.testmonai import instantiateMonaiAlgo\n'), ((219, 255), 'substraclient.Client', 'Client', (['"""client2"""', '"""localhost:50051"""'], {}), "('client... |
from django.db import models
from Modulos.AreasTrabajo.models import AreasTrabajo
from Modulos.Base.models import ModeloBase
from django.utils.functional import lazy
from django.core.validators import MinValueValidator, MaxValueValidator
nivel_estudios = [
('pri', 'Primaria'),
('sec', 'Secundaria'),
('bac'... | [
"django.db.models.CharField",
"django.core.validators.MinValueValidator",
"django.db.models.ForeignKey",
"django.db.models.DateField"
] | [((492, 533), 'django.db.models.CharField', 'models.CharField', (['"""Nombre"""'], {'max_length': '(50)'}), "('Nombre', max_length=50)\n", (508, 533), False, 'from django.db import models\n'), ((552, 596), 'django.db.models.CharField', 'models.CharField', (['"""Apellidos"""'], {'max_length': '(50)'}), "('Apellidos', ma... |
from ._base import SpecificationPrimitiveBase
from pmaf.pipe.agents.mediators._metakit import MediatorTaxonomyMetabase
from pmaf.pipe.factors._metakit import FactorBackboneMetabase
from pmaf.pipe.agents.miners._miner import Miner
from pmaf.pipe.agents.dockers._mediums._id_medium import DockerIdentifierMedium
from pmaf.... | [
"pmaf.pipe.agents.miners._miner.Miner",
"pmaf.pipe.agents.dockers._mediums._id_medium.DockerIdentifierMedium"
] | [((1037, 1086), 'pmaf.pipe.agents.miners._miner.Miner', 'Miner', ([], {'mediator': 'mediator', 'factor': 'factor'}), '(mediator=mediator, factor=factor, **kwargs)\n', (1042, 1086), False, 'from pmaf.pipe.agents.miners._miner import Miner\n'), ((1662, 1701), 'pmaf.pipe.agents.dockers._mediums._id_medium.DockerIdentifier... |
from django.conf import settings
from django.conf.urls import url
from .import views
urlpatterns = [
url(r'^$', views.hello, name='hello')
] | [
"django.conf.urls.url"
] | [((106, 142), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.hello'], {'name': '"""hello"""'}), "('^$', views.hello, name='hello')\n", (109, 142), False, 'from django.conf.urls import url\n')] |
import random
import numpy as np
import torch
from horch.common import CUDA
def manual_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.random.manual_seed(seed)
if CUDA:
torch.cuda.manual_seed(seed) | [
"numpy.random.seed",
"torch.cuda.manual_seed",
"random.seed",
"torch.random.manual_seed"
] | [((107, 124), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (118, 124), False, 'import random\n'), ((129, 149), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (143, 149), True, 'import numpy as np\n'), ((154, 184), 'torch.random.manual_seed', 'torch.random.manual_seed', (['seed'], {}), '... |
import numpy as np
from itertools import combinations
def multiply_entries(array, n_entries):
values = None
for combi in combinations(array, n_entries):
if sum(combi) == 2020:
values = combi
break
return np.prod(values)
if __name__ == '__main__':
path_to_data_file = '..... | [
"itertools.combinations",
"numpy.genfromtxt",
"numpy.prod"
] | [((130, 160), 'itertools.combinations', 'combinations', (['array', 'n_entries'], {}), '(array, n_entries)\n', (142, 160), False, 'from itertools import combinations\n'), ((249, 264), 'numpy.prod', 'np.prod', (['values'], {}), '(values)\n', (256, 264), True, 'import numpy as np\n'), ((353, 396), 'numpy.genfromtxt', 'np.... |
import numpy as np
from constants import *
import itertools
class Player():
def __init__(self, val):
self.val = val
def setNext(self):
self.val = White if self.val == Black else Black
return self.val
def get(self):
return self.val
def rev(self):
return White ... | [
"numpy.diag",
"numpy.fliplr",
"numpy.zeros",
"numpy.arange"
] | [((413, 443), 'numpy.zeros', 'np.zeros', (['(8, 8)'], {'dtype': 'np.int'}), '((8, 8), dtype=np.int)\n', (421, 443), True, 'import numpy as np\n'), ((1234, 1258), 'numpy.diag', 'np.diag', (['self.tab', '(j - i)'], {}), '(self.tab, j - i)\n', (1241, 1258), True, 'import numpy as np\n'), ((1538, 1551), 'numpy.arange', 'np... |
from bs4 import BeautifulSoup
from HTMLParser import HTMLParser
import pdb
import os
import re
import requests
playstoreLink = None
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
urlPath = None
hasHref = False
hasClickTarget = False
if playstoreLink is None:
if 'a' == tag:
for ... | [
"requests.get"
] | [((759, 828), 'requests.get', 'requests.get', (['"""https://play.google.com/store/search?"""'], {'params': 'payload'}), "('https://play.google.com/store/search?', params=payload)\n", (771, 828), False, 'import requests\n')] |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateLogDumpObsRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict)... | [
"huaweicloudsdkcore.utils.http_utils.sanitize_for_serialization",
"six.iteritems",
"sys.setdefaultencoding"
] | [((8751, 8784), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (8764, 8784), False, 'import six\n'), ((9769, 9800), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (9791, 9800), False, 'import sys\n'), ((9827, 9859), 'huaweicloudsdkcor... |
#! user/bin/python3
import bs4,requests,pyperclip,time,os
welcome = "Welcom To Musica"
print(welcome.center(50, '='))
print("\n\n")
err_count = 0
os.makedirs("Musica", exist_ok=True)
location = ""
while 1:
try:
print('Initialising...')
resi=requests.get('https://mp3skull.la')
init = bs4.Beau... | [
"os.makedirs",
"time.sleep",
"requests.get",
"pyperclip.copy",
"bs4.BeautifulSoup",
"os.path.join"
] | [((146, 182), 'os.makedirs', 'os.makedirs', (['"""Musica"""'], {'exist_ok': '(True)'}), "('Musica', exist_ok=True)\n", (157, 182), False, 'import bs4, requests, pyperclip, time, os\n'), ((1059, 1101), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['res.text', '"""html.parser"""'], {}), "(res.text, 'html.parser')\n", (1076... |
"""
1.4. Pedro es un consumidor cuyas preferencias están representadas por la Tasa Marginal de Sustitución 𝑇𝑀𝑆 = 2𝑦/x . Si los precios son 𝑃x = 3 y 𝑃y =1, y tiene un ingreso de $ 180,
¿cuál es la canasta de bienes que maximiza su utilidad?
"""
# -*- coding: utf-8 -*-
import sympy as sp
sp.init_printing()
m... | [
"sympy.symbols",
"sympy.init_printing"
] | [((292, 310), 'sympy.init_printing', 'sp.init_printing', ([], {}), '()\n', (308, 310), True, 'import sympy as sp\n'), ((334, 361), 'sympy.symbols', 'sp.symbols', (['"""m,x,y,px,py,t"""'], {}), "('m,x,y,px,py,t')\n", (344, 361), True, 'import sympy as sp\n')] |
# flask
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash, make_response
from flask_negotiate import consumes, produces
from urllib.parse import urlparse
import io, json, logging, os, sqlite3, sys
import testdata
app = Flask(__name__)
app.config.from_object(__name__)... | [
"logging.basicConfig",
"flask.request.args.get",
"flask.Flask",
"testdata.generate_test_address_data",
"json.dumps",
"logging.info",
"sqlite3.connect",
"testdata.generate_test_contact",
"testdata.generate_test_medical_alarm_data",
"flask_negotiate.produces",
"testdata.generate_test_sevice_qual_d... | [((272, 287), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, make_response\n'), ((4181, 4295), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.DE... |
import csv
import requests
SOMWANG_BRANCH_DATA_API = "https://www.somwang.co.th/bin/searchBranchServlet"
if __name__ == "__main__":
body = {
"method": "getAllSomwangBranchDetail",
}
response = requests.post(SOMWANG_BRANCH_DATA_API, json=body)
data = response.json()
columns = [
"... | [
"requests.post",
"csv.DictWriter"
] | [((217, 266), 'requests.post', 'requests.post', (['SOMWANG_BRANCH_DATA_API'], {'json': 'body'}), '(SOMWANG_BRANCH_DATA_API, json=body)\n', (230, 266), False, 'import requests\n'), ((1066, 1109), 'csv.DictWriter', 'csv.DictWriter', (['csvfile'], {'fieldnames': 'columns'}), '(csvfile, fieldnames=columns)\n', (1080, 1109)... |
import numpy as np
import pandas as pd
import scipy
from estimagic.optimization.process_constraints import process_constraints
from estimagic.optimization.reparametrize import reparametrize_from_internal
from estimagic.optimization.reparametrize import reparametrize_to_internal
def transform_covariance(
params,
... | [
"pandas.DataFrame",
"numpy.abs",
"estimagic.optimization.process_constraints.process_constraints",
"numpy.clip",
"pandas.cut",
"numpy.random.multivariate_normal",
"numpy.array",
"numpy.diag",
"estimagic.optimization.reparametrize.reparametrize_from_internal"
] | [((1991, 2031), 'estimagic.optimization.process_constraints.process_constraints', 'process_constraints', (['constraints', 'params'], {}), '(constraints, params)\n', (2010, 2031), False, 'from estimagic.optimization.process_constraints import process_constraints\n'), ((3853, 3918), 'pandas.DataFrame', 'pd.DataFrame', ([... |
# No shebang line, this module is meant to be imported
#
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | [
"pyfarm.core.enums.operating_system",
"os.path.isfile",
"pyfarm.agent.entrypoints.parser.AgentArgumentParser",
"os.path.join",
"zipfile.is_zipfile",
"os.getgid",
"pyfarm.agent.logger.getLogger",
"pyfarm.agent.entrypoints.utility.start_daemon_posix",
"time.sleep",
"pyfarm.core.enums.OS.title",
"s... | [((1578, 1607), 'pyfarm.agent.logger.getLogger', 'getLogger', (['"""agent.supervisor"""'], {}), "('agent.supervisor')\n", (1587, 1607), False, 'from pyfarm.agent.logger import getLogger\n'), ((2119, 2189), 'pyfarm.agent.entrypoints.parser.AgentArgumentParser', 'AgentArgumentParser', ([], {'description': '"""Start and m... |
from secml.testing import CUnitTest
from secml.figure import CFigure
from secml.ml.classifiers import CClassifierSVM
from secml.data.loader import CDLRandom
from secml.ml.features.normalization import CNormalizerMinMax
class TestCPlot(CUnitTest):
"""Unit test for TestCPlot."""
def setUp(self):
self.... | [
"secml.testing.CUnitTest.main",
"secml.ml.features.normalization.CNormalizerMinMax",
"secml.ml.classifiers.CClassifierSVM",
"secml.figure.CFigure",
"secml.data.loader.CDLRandom"
] | [((1128, 1144), 'secml.testing.CUnitTest.main', 'CUnitTest.main', ([], {}), '()\n', (1142, 1144), False, 'from secml.testing import CUnitTest\n'), ((326, 342), 'secml.ml.classifiers.CClassifierSVM', 'CClassifierSVM', ([], {}), '()\n', (340, 342), False, 'from secml.ml.classifiers import CClassifierSVM\n'), ((689, 698),... |
# -*- coding: utf-8
"""
Parts of this code (and in the other modules that define the parser
class) are inspired by / taken from the py2js project.
Useful links:
* https://greentreesnakes.readthedocs.org/en/latest/nodes.html
* https://github.com/qsnake/py2js/blob/master/py2js/__init__.py
Known limitations for Browse... | [
"re.match",
"sys.exc_info"
] | [((1212, 1238), 're.match', 're.match', (['"""^[\\\\.\\\\w]*$"""', 'x'], {}), "('^[\\\\.\\\\w]*$', x)\n", (1220, 1238), False, 'import re\n'), ((1319, 1353), 're.match', 're.match', (['"""^[\\\\.\\\\w]*\\\\(.*\\\\)$"""', 'x'], {}), "('^[\\\\.\\\\w]*\\\\(.*\\\\)$', x)\n", (1327, 1353), False, 'import re\n'), ((6856, 687... |
import sys
import pandas
def generate(s):
data = pandas.read_csv('histo.csv')
fileout = open(s, 'w')
categories, sizes = data.shape
colsums = data.sum(axis=0)[1:]
total = colsums.sum()
adults = 0
fileout.write(str(total) + '\n')
fileout.write(str(sizes - 1) + '\n')
fileout.write(... | [
"pandas.read_csv"
] | [((55, 83), 'pandas.read_csv', 'pandas.read_csv', (['"""histo.csv"""'], {}), "('histo.csv')\n", (70, 83), False, 'import pandas\n')] |
# Generated by Django 2.2.10 on 2020-02-17 11:27
from django.conf import settings
from django.contrib.auth.models import User as AuthUser
from django.db import migrations
from django.db.migrations import RunPython
def forwards(apps, schema_editor):
User = apps.get_model(*settings.AUTH_USER_MODEL.split(".")) # t... | [
"django.db.migrations.RunPython",
"django.conf.settings.AUTH_USER_MODEL.split"
] | [((836, 866), 'django.db.migrations.RunPython', 'RunPython', (['forwards', 'backwards'], {}), '(forwards, backwards)\n', (845, 866), False, 'from django.db.migrations import RunPython\n'), ((279, 314), 'django.conf.settings.AUTH_USER_MODEL.split', 'settings.AUTH_USER_MODEL.split', (['"""."""'], {}), "('.')\n", (309, 31... |
# ########################################################################
# This is version 3.0.
# We see if we can improve the performance of the delete points
# so that we can get some improvement in measurement time ...
# ########################################################################
from scipy.ndi... | [
"numpy.meshgrid",
"numpy.ones",
"scipy.spatial.Voronoi",
"numpy.shape",
"numpy.array",
"scipy.ndimage.filters.convolve",
"scipy.ndimage.filters.median_filter",
"numpy.sqrt"
] | [((580, 595), 'numpy.ones', 'np.ones', (['(5, 5)'], {}), '((5, 5))\n', (587, 595), True, 'import numpy as np\n'), ((1415, 1426), 'numpy.shape', 'np.shape', (['d'], {}), '(d)\n', (1423, 1426), True, 'import numpy as np\n'), ((1509, 1533), 'scipy.ndimage.filters.median_filter', 'median_filter', (['d'], {'size': '(3)'}), ... |
import sys
from yamlSupport.YamlConfigurationSupport import YamlConfigurationSupport
from googleSheetSupport.GoogleSheetSupport import GoogleSheetSupport
from iosSupport.iOSLocalizationSettings import iOSLocalizationSettings
def log_menu():
menu = """commands:\n1. cnfg - create default localization.yml\n2. fetch ... | [
"googleSheetSupport.GoogleSheetSupport.GoogleSheetSupport.get_localizations",
"yamlSupport.YamlConfigurationSupport.YamlConfigurationSupport.create_default",
"yamlSupport.YamlConfigurationSupport.YamlConfigurationSupport.get_config",
"iosSupport.iOSLocalizationSettings.iOSLocalizationSettings.create"
] | [((486, 527), 'yamlSupport.YamlConfigurationSupport.YamlConfigurationSupport.create_default', 'YamlConfigurationSupport.create_default', ([], {}), '()\n', (525, 527), False, 'from yamlSupport.YamlConfigurationSupport import YamlConfigurationSupport\n'), ((574, 611), 'yamlSupport.YamlConfigurationSupport.YamlConfigurati... |
# A file emp.dat contains data attributes like : ecode, name and salary.
# Give function definitions to do the following
# a) Write the data of an employee.
# b) Read the employee data and display all the
# objects on the screen where salary is between 20000 and 30000.
import pickle
global global_flag, data_1
global_... | [
"pickle.dump",
"pickle.load"
] | [((812, 834), 'pickle.dump', 'pickle.dump', (['data_2', 'f'], {}), '(data_2, f)\n', (823, 834), False, 'import pickle\n'), ((936, 950), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (947, 950), False, 'import pickle\n')] |
"""empty message
Revision ID: 394ffd17<PASSWORD>8
Revises: <PASSWORD>
Create Date: 2014-07-22 19:06:57.321418
"""
# revision identifiers, used by Alembic.
revision = '394ffd17<PASSWORD>'
down_revision = '4<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by ... | [
"alembic.op.drop_index",
"alembic.op.create_unique_constraint",
"alembic.op.create_index",
"alembic.op.drop_constraint"
] | [((353, 400), 'alembic.op.drop_constraint', 'op.drop_constraint', (['u"""user_ip_addr_key"""', '"""user"""'], {}), "(u'user_ip_addr_key', 'user')\n", (371, 400), False, 'from alembic import op\n'), ((405, 457), 'alembic.op.drop_index', 'op.drop_index', (['"""user_ip_addr_key"""'], {'table_name': '"""user"""'}), "('user... |
import pygame
import sys
import os
import pandas as pd
from multinherit.multinherit import multi_super
from helper import c
import datetime
"""TKINTER PART"""
import tkinter as tk
import abc
#from tkinter import LEFT
import doxyplot.doxyplot_core as dp
root = tk.Tk()
root.withdraw()
"""
WINDOW_S... | [
"pygame.draw.line",
"pygame.event.get",
"pygame.mouse.get_pos",
"pygame.display.quit",
"pygame.font.SysFont",
"pygame.display.set_mode",
"pygame.event.pump",
"inspect.signature",
"pygame.display.set_caption",
"datetime.datetime.now",
"tkinter.Tk",
"pygame.quit",
"pygame.transform.smoothscale... | [((278, 285), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (283, 285), True, 'import tkinter as tk\n'), ((1052, 1065), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1063, 1065), False, 'import pygame\n'), ((1070, 1107), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Forloop"""'], {}), "('Forloop')\n",... |
import configparser
import os
from datetime import datetime
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf, col, to_date
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek, \
monotonically_increasing_id
from pyspark.sql.types import Times... | [
"pyspark.sql.functions.dayofmonth",
"pyspark.sql.functions.month",
"pyspark.sql.SparkSession.builder.config",
"pyspark.sql.functions.monotonically_increasing_id",
"pyspark.sql.functions.to_date",
"pyspark.sql.functions.weekofyear",
"pyspark.sql.functions.hour",
"datetime.datetime.fromtimestamp",
"py... | [((349, 376), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (374, 376), False, 'import configparser\n'), ((3064, 3079), 'pyspark.sql.types.TimestampType', 'TimestampType', ([], {}), '()\n', (3077, 3079), False, 'from pyspark.sql.types import TimestampType, DateType\n'), ((3249, 3264), 'pys... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.