code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... | [
"json.loads",
"jobnavi.api.jobnavi_api.JobNaviApi",
"common.decorators.params_valid",
"common.log.sys_logger.exception",
"rest_framework.response.Response",
"common.decorators.detail_route",
"jobnavi.exception.exceptions.InterfaceError",
"jobnavi.api_helpers.resourcecenter.resourcecenter_helper.Resour... | [((2035, 2085), 'common.decorators.params_valid', 'params_valid', ([], {'serializer': 'RetrieveTaskLogSerializer'}), '(serializer=RetrieveTaskLogSerializer)\n', (2047, 2085), False, 'from common.decorators import params_valid, detail_route\n'), ((3684, 3741), 'common.decorators.detail_route', 'detail_route', ([], {'met... |
from context import Project, ProjectFiles
project = Project("t", ProjectFiles(
{
"hello" : "frfefe"
},
["data"]
)).create() | [
"context.ProjectFiles"
] | [((68, 111), 'context.ProjectFiles', 'ProjectFiles', (["{'hello': 'frfefe'}", "['data']"], {}), "({'hello': 'frfefe'}, ['data'])\n", (80, 111), False, 'from context import Project, ProjectFiles\n')] |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... | [
"torch.get_default_dtype",
"torch.set_printoptions",
"rcsenv.ControlPolicy",
"torch.set_default_dtype",
"numpy.array",
"pyrado.policies.features.FeatureStack",
"pyrado.spaces.box.BoxSpace",
"numpy.set_printoptions"
] | [((2690, 2722), 'torch.set_default_dtype', 'to.set_default_dtype', (['to.float32'], {}), '(to.float32)\n', (2710, 2722), True, 'import torch as to\n'), ((3092, 3123), 'rcsenv.ControlPolicy', 'ControlPolicy', (['"""torch"""', 'tmpfile'], {}), "('torch', tmpfile)\n", (3105, 3123), False, 'from rcsenv import ControlPolicy... |
##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
"zope.configuration.fields.MessageID"
] | [((1786, 1886), 'zope.configuration.fields.MessageID', 'MessageID', ([], {'title': 'u"""Title"""', 'description': 'u"""The title of the group used in the UI."""', 'required': '(True)'}), "(title=u'Title', description=\n u'The title of the group used in the UI.', required=True)\n", (1795, 1886), False, 'from zope.con... |
# Generated by Django 3.2.3 on 2021-05-22 12:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='product',
name='sku',
field=m... | [
"django.db.models.CharField"
] | [((319, 420), 'django.db.models.CharField', 'models.CharField', ([], {'default': '(1)', 'max_length': '(255)', 'unique': '(True)', 'verbose_name': '"""Unique Product ID (SKU)"""'}), "(default=1, max_length=255, unique=True, verbose_name=\n 'Unique Product ID (SKU)')\n", (335, 420), False, 'from django.db import migr... |
from __future__ import unicode_literals
import pytest
import pandas as pd
from dagster import (
DependencyDefinition,
InputDefinition,
PipelineConfigEvaluationError,
PipelineDefinition,
OutputDefinition,
execute_pipeline,
solid,
)
from dagster.utils import script_relative_path
from dagst... | [
"pandas.read_parquet",
"pandas.read_csv",
"dagster.execute_pipeline",
"dagster.utils.test.get_temp_file_name",
"dagster.InputDefinition",
"dagster.PipelineDefinition",
"pytest.raises",
"pandas.read_table",
"dagster.OutputDefinition",
"pandas.DataFrame",
"dagster.utils.script_relative_path",
"d... | [((660, 701), 'dagster.PipelineDefinition', 'PipelineDefinition', ([], {'solids': '[df_as_config]'}), '(solids=[df_as_config])\n', (678, 701), False, 'from dagster import DependencyDefinition, InputDefinition, PipelineConfigEvaluationError, PipelineDefinition, OutputDefinition, execute_pipeline, solid\n'), ((1313, 1354... |
import numpy as np
import pandas as pd
from typing import List
from .phantom_class import Phantom
class Beam:
"""A class used to create an X-ray beam and detector.
Attributes
----------
r : np.array
5*3 array, locates the xyz coordinates of the apex and verticies of a
pyramid shaped X... | [
"numpy.cross",
"numpy.where",
"numpy.column_stack",
"numpy.array",
"numpy.deg2rad",
"numpy.dot",
"numpy.matmul",
"numpy.vstack",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin"
] | [((3201, 3239), 'numpy.array', 'np.array', (['[0, data_norm.DSI[event], 0]'], {}), '([0, data_norm.DSI[event], 0])\n', (3209, 3239), True, 'import numpy as np\n'), ((3331, 3425), 'numpy.array', 'np.array', (['[[+0.5, -1.0, +0.5], [+0.5, -1.0, -0.5], [-0.5, -1.0, -0.5], [-0.5, -1.0, +0.5]\n ]'], {}), '([[+0.5, -1.0, ... |
# coding: utf-8
"""
BillForward REST API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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... | [
"unittest.main",
"billforward.apis.amendments_api.AmendmentsApi"
] | [((4017, 4032), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4030, 4032), False, 'import unittest\n'), ((1046, 1093), 'billforward.apis.amendments_api.AmendmentsApi', 'billforward.apis.amendments_api.AmendmentsApi', ([], {}), '()\n', (1091, 1093), False, 'import billforward\n')] |
import numpy as np
import cv2
from iPERCore.tools.utils.visualizers.visdom_visualizer import VisdomVisualizer
visualizer = VisdomVisualizer(
env="test_train",
ip="http://localhost", # need to be replaced.
port=8097 # need to be replaced.
)
mask0 = cv2.imread("/media/Diskf/Datasets/iper/primitives/006/1/... | [
"cv2.waitKey",
"iPERCore.tools.utils.visualizers.visdom_visualizer.VisdomVisualizer",
"cv2.imread",
"cv2.imshow"
] | [((124, 192), 'iPERCore.tools.utils.visualizers.visdom_visualizer.VisdomVisualizer', 'VisdomVisualizer', ([], {'env': '"""test_train"""', 'ip': '"""http://localhost"""', 'port': '(8097)'}), "(env='test_train', ip='http://localhost', port=8097)\n", (140, 192), False, 'from iPERCore.tools.utils.visualizers.visdom_visuali... |
# ======================================================================================================================
# File: Tests/Model/MeasureableUnits/test_SpecificVolumeType.py
# Project: AlphaBrew
# Description: Test cases for the SpecificVolumeType measureable unit
# Author: <NAME> <<E... | [
"Model.MeasurableUnits.SpecificVolumeType",
"pytest.mark.parametrize",
"pytest.approx",
"random.randint"
] | [((2299, 2536), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""unit"""', "['qt/lb', 'gal/lb', 'gal/oz', 'l/g', 'l/kg', 'floz/oz', 'm^3/kg', 'ft^3/lb',\n 'quartperpound', 'quartsperpound', 'qtperlb', 'gallonperpound',\n 'gallonsperpound', 'galperlb', 'litersperkilogram']"], {}), "('unit', ['qt/lb', 'g... |
import numpy as np
from numpy.linalg import norm
from data_manager import read_data
import time
import tqdm
import matplotlib.pyplot as plt
from conjugate_gradient import conjugate_gradient
import random
A, b = read_data('data/ML-CUP19-TR.csv')
m, n = A.shape
# Our solution
start = time.perf_counter_ns()
x, status, i... | [
"numpy.transpose",
"matplotlib.pyplot.savefig",
"numpy.random.rand",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.yscale",
"numpy.zeros",
"numpy.matmul",
"numpy.linalg.lstsq",
"numpy.linalg.norm",
"conjugate_gradient.conj... | [((212, 245), 'data_manager.read_data', 'read_data', (['"""data/ML-CUP19-TR.csv"""'], {}), "('data/ML-CUP19-TR.csv')\n", (221, 245), False, 'from data_manager import read_data\n'), ((285, 307), 'time.perf_counter_ns', 'time.perf_counter_ns', ([], {}), '()\n', (305, 307), False, 'import time\n'), ((325, 349), 'conjugate... |
# This file is part of wallriori
# (c) <NAME>
# The code is released under the MIT Licence.
# See LICENCE.txt and the Legal section in the README for more information
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from functools import pa... | [
"numpy.abs",
"numpy.log",
"numpy.max",
"numpy.sum",
"functools.partial"
] | [((1323, 1340), 'numpy.abs', 'np.abs', (['wallGradU'], {}), '(wallGradU)\n', (1329, 1340), True, 'import numpy as np\n'), ((1398, 1443), 'numpy.max', 'np.max', (['[0.0, uTau ** 2 / magGradU - self.nu]'], {}), '([0.0, uTau ** 2 / magGradU - self.nu])\n', (1404, 1443), True, 'import numpy as np\n'), ((1490, 1540), 'funct... |
from util.postgres.dao_util import DaoPostgresSQL
import pandas as pd
class DaoCNES(DaoPostgresSQL):
def __init__(self, arquivo_configuracao):
super(DaoCNES, self).__init__(arquivo_configuracao)
def get_df_estabelecimento_regiao_saude(self):
"""
Retorna os estabelecimentos juntamente ... | [
"pandas.read_sql"
] | [((681, 711), 'pandas.read_sql', 'pd.read_sql', (['sql', 'self.conexao'], {}), '(sql, self.conexao)\n', (692, 711), True, 'import pandas as pd\n')] |
# versi 1.26.11
from string import ascii_lowercase, ascii_uppercase
from random import randint
from datetime import datetime
class NStr:
def __init__(self):
self.nstr = ""
self.dt = datetime.now()
def cap_random(self, alpa: str, cap: str) -> str:
# null = ""
lower_to_upper = {k... | [
"datetime.datetime.now",
"doctest.testmod",
"random.randint"
] | [((2934, 2943), 'doctest.testmod', 'testmod', ([], {}), '()\n', (2941, 2943), False, 'from doctest import testmod\n'), ((203, 217), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (215, 217), False, 'from datetime import datetime\n'), ((751, 766), 'random.randint', 'randint', (['(0)', '(100)'], {}), '(0, 100... |
"""
WSGI config for this Django project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.wsgi impo... | [
"django.core.wsgi.get_wsgi_application",
"os.environ.get",
"django.core.exceptions.ImproperlyConfigured"
] | [((775, 797), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (795, 797), False, 'from django.core.wsgi import get_wsgi_application\n'), ((567, 607), 'os.environ.get', 'os.environ.get', (['"""DJANGO_SETTINGS_MODULE"""'], {}), "('DJANGO_SETTINGS_MODULE')\n", (581, 607), False, 'import ... |
from utils import text_processing
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.metrics import confusion_matrix, clas... | [
"sklearn.feature_extraction.text.TfidfTransformer",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.confusi... | [((394, 425), 'pandas.read_csv', 'pd.read_csv', (['"""train_tweets.csv"""'], {}), "('train_tweets.csv')\n", (405, 425), True, 'import pandas as pd\n'), ((440, 470), 'pandas.read_csv', 'pd.read_csv', (['"""test_tweets.csv"""'], {}), "('test_tweets.csv')\n", (451, 470), True, 'import pandas as pd\n'), ((1035, 1113), 'skl... |
#!/usr/bin/env python3
import argparse
import tempfile
import logging
import difflib
import glob
import json
import sys
import os
import re
from pprint import pformat
from .counter import PapersForCount, SenateCounter
from .aecdata import CandidateList, SenateATL, SenateBTL, FormalPreferences
from .common import logge... | [
"os.listdir",
"argparse.ArgumentParser",
"re.compile",
"json.dump",
"os.path.join",
"pprint.pformat",
"os.rmdir",
"tempfile.mkdtemp",
"os.unlink",
"sys.exit",
"json.load",
"os.path.abspath",
"glob.glob"
] | [((9749, 9783), 're.compile', 're.compile', (['"""^round_(\\\\d+)\\\\.json"""'], {}), "('^round_(\\\\d+)\\\\.json')\n", (9759, 9783), False, 'import re\n'), ((9816, 9840), 'os.listdir', 'os.listdir', (['verified_dir'], {}), '(verified_dir)\n', (9826, 9840), False, 'import os\n'), ((11199, 11229), 'glob.glob', 'glob.glo... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from djutil.models import TimeStampedModel
class CsvJob(TimeStampedModel):
SuccessStatus = 'success'
FailedStatus = 'failed'
PendingStatus = 'pending'
STATUSES = (
... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"datetime.datetime.now",
"datetime.timedelta",
"django.db.models.CharField"
] | [((443, 474), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (459, 474), False, 'from django.db import models\n'), ((488, 537), 'django.db.models.CharField', 'models.CharField', ([], {'choices': 'STATUSES', 'max_length': '(20)'}), '(choices=STATUSES, max_length=20)\... |
import math
class Point:
"""
Point in the plane.
"""
def __init__(self, x = 0, y = 0):
'''
Creates a point at the center of the axis
'''
self._x = x
self._y = y
def setX(self, ex):
'''
Sets the x coordinate of the point.
Require... | [
"math.sqrt"
] | [((1129, 1167), 'math.sqrt', 'math.sqrt', (['(delta_x ** 2 + delta_y ** 2)'], {}), '(delta_x ** 2 + delta_y ** 2)\n', (1138, 1167), False, 'import math\n')] |
import os
from collections import OrderedDict
# compatibility with python 2/3
try:
basestring
except NameError:
basestring = str
class EnvModifierError(Exception):
"""Env modifier error."""
class EnvModifierInvalidVarError(EnvModifierError):
"""Env modifier invalid var error."""
class EnvModifierInv... | [
"collections.OrderedDict"
] | [((635, 648), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (646, 648), False, 'from collections import OrderedDict\n'), ((672, 685), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (683, 685), False, 'from collections import OrderedDict\n'), ((711, 724), 'collections.OrderedDict', 'OrderedDic... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
from webassets.filter import Filter
import dukpy
__all__ = ('BabelJSX', )
class BabelJSX(Filter):
name = 'babeljsx'
max_debug_level = None
options = {
'loader': 'BABEL_MODULES_LOADER'
}
def input... | [
"os.path.basename"
] | [((375, 410), 'os.path.basename', 'os.path.basename', (["kw['source_path']"], {}), "(kw['source_path'])\n", (391, 410), False, 'import os\n')] |
import redis
import time
conn = redis.Redis()
def no_trans():
print(conn.incr('notrans:'))
time.sleep(.1)
conn.incr('notrans:', -1)
"""
>>> if 1:
... for i in xrange(3):
... threading.Thread(target=notrans).start()
... time.sleep(.5)
1
2
3
- Because there’s no transaction, each of the ... | [
"time.sleep",
"redis.Redis"
] | [((33, 46), 'redis.Redis', 'redis.Redis', ([], {}), '()\n', (44, 46), False, 'import redis\n'), ((101, 116), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (111, 116), False, 'import time\n'), ((493, 508), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (503, 508), False, 'import time\n')] |
# coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.
from __future__ import absolute_import
from pants.goal.task_registrar import TaskRegistrar as task
from fsqio.pants.buildgen.python.buildgen_python import BuildgenPython
from fsqio.pants.buildgen.python.map_python_exported_symbols import MapPy... | [
"pants.goal.task_registrar.TaskRegistrar"
] | [((367, 440), 'pants.goal.task_registrar.TaskRegistrar', 'task', ([], {'name': '"""map-python-exported-symbols"""', 'action': 'MapPythonExportedSymbols'}), "(name='map-python-exported-symbols', action=MapPythonExportedSymbols)\n", (371, 440), True, 'from pants.goal.task_registrar import TaskRegistrar as task\n'), ((467... |
import tensorflow as tf
import numpy
class ExponentialBoundaryCondition(tf.keras.layers.Layer):
"""A simple module for applying an exponential boundary condition in N dimensions
Note that the exponent is *inside* of the power of 2 in the exponent.
This is to prevent divergence when it is trainable an... | [
"tensorflow.Variable",
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Layer.__init__",
"tensorflow.exp",
"tensorflow.abs"
] | [((929, 965), 'tensorflow.keras.layers.Layer.__init__', 'tf.keras.layers.Layer.__init__', (['self'], {}), '(self)\n', (959, 965), True, 'import tensorflow as tf\n'), ((1178, 1215), 'tensorflow.Variable', 'tf.Variable', (['exp'], {'trainable': 'trainable'}), '(exp, trainable=trainable)\n', (1189, 1215), True, 'import te... |
import re
from .exceptions import (
RuleViolation,
StopValidation,
)
def override_defaults(rule):
rule.override_defaults = True
return rule
@override_defaults
def Required(data):
if data is None or data == '':
raise RuleViolation(code='required', message='Required value.')
@overri... | [
"re.match"
] | [((1938, 1966), 're.match', 're.match', (['self.pattern', 'data'], {}), '(self.pattern, data)\n', (1946, 1966), False, 'import re\n')] |
from itertools import zip_longest
from typing import Callable, Iterable, Optional, Sequence, Type, TypeVar, Union, cast
import attr
import pydash
from ebl.lemmatization.domain.lemmatization import (
LemmatizationError,
LemmatizationToken,
)
from ebl.merger import Merger
from ebl.transliteration.domain.alignme... | [
"attr.s",
"itertools.zip_longest",
"attr.evolve",
"ebl.lemmatization.domain.lemmatization.LemmatizationToken",
"ebl.merger.Merger",
"pydash.flow",
"ebl.transliteration.domain.atf_visitor.convert_to_atf",
"typing.cast",
"typing.TypeVar"
] | [((865, 897), 'typing.TypeVar', 'TypeVar', (['"""L"""', '"""TextLine"""', '"""Line"""'], {}), "('L', 'TextLine', 'Line')\n", (872, 897), False, 'from typing import Callable, Iterable, Optional, Sequence, Type, TypeVar, Union, cast\n'), ((902, 914), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (909, 914), ... |
from rdflib.namespace import OWL, RDF
from client.model import RDFDataset
from client.model._TERN import TERN
def test_basic_rdf():
r1 = RDFDataset()
rdf = r1.to_graph()
assert (None, RDF.type, OWL.Class) not in rdf
assert (None, RDF.type, TERN.RDFDataset) in rdf
| [
"client.model.RDFDataset"
] | [((144, 156), 'client.model.RDFDataset', 'RDFDataset', ([], {}), '()\n', (154, 156), False, 'from client.model import RDFDataset\n')] |
import uuid
from sqlalchemy import Column, String, func, Index, ForeignKey
from sqlalchemy_utils import ArrowType, UUIDType
from registry.sql.database import Base
class Module(Base):
__tablename__ = 'modules'
id = Column(UUIDType, primary_key=True, default=uuid.uuid4)
organization_id = Column(UUIDType,... | [
"sqlalchemy.func.now",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column",
"sqlalchemy.Index"
] | [((227, 281), 'sqlalchemy.Column', 'Column', (['UUIDType'], {'primary_key': '(True)', 'default': 'uuid.uuid4'}), '(UUIDType, primary_key=True, default=uuid.uuid4)\n', (233, 281), False, 'from sqlalchemy import Column, String, func, Index, ForeignKey\n'), ((392, 422), 'sqlalchemy.Column', 'Column', (['String'], {'nullab... |
import os
import numpy as np
from data.dataset import VoxelizationDataset, DatasetPhase
class S3DISDataset(VoxelizationDataset):
category = ['wall', 'floor', 'beam', 'chair', 'sofa', 'table',
'door', 'window', 'bookcase', 'column', 'clutter', 'ceiling', 'board']
CLIP_SIZE = None
CLIP_BOUND... | [
"os.listdir",
"os.path.join"
] | [((1144, 1186), 'os.path.join', 'os.path.join', (["config['data_path']", '"""train"""'], {}), "(config['data_path'], 'train')\n", (1156, 1186), False, 'import os\n'), ((1462, 1483), 'os.listdir', 'os.listdir', (['data_root'], {}), '(data_root)\n', (1472, 1483), False, 'import os\n'), ((1303, 1343), 'os.path.join', 'os.... |
import numpy as np
from models.datastructures import BoundaryType
def WaveEquation1D(grid, x0, boundary_cond, c, sigma0, num_reflections=4):
""" Analytical solution with Dirichlet or Neumann boundaries
num_reflections: number of reflections in the solution
"""
assert(boundary_cond == BoundaryType.D... | [
"numpy.asarray",
"numpy.max",
"numpy.array",
"numpy.min",
"numpy.mod"
] | [((444, 458), 'numpy.min', 'np.min', (['x_mesh'], {}), '(x_mesh)\n', (450, 458), True, 'import numpy as np\n'), ((470, 484), 'numpy.max', 'np.max', (['x_mesh'], {}), '(x_mesh)\n', (476, 484), True, 'import numpy as np\n'), ((2089, 2103), 'numpy.min', 'np.min', (['x_mesh'], {}), '(x_mesh)\n', (2095, 2103), True, 'import... |
import torch
import torch.nn as nn
from torch3d.nn import SetAbstraction, FeaturePropagation
class PointNetSSG(nn.Module):
def __init__(self, in_channels, num_classes, dropout=0.5):
super(PointNetSSG, self).__init__()
self.sa1 = SetAbstraction(in_channels, [32, 32, 64], 1024, 32, 0.1, bias=False)
... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch3d.nn.FeaturePropagation",
"torch.nn.BatchNorm1d",
"torch3d.nn.SetAbstraction",
"torch.nn.Conv1d"
] | [((251, 319), 'torch3d.nn.SetAbstraction', 'SetAbstraction', (['in_channels', '[32, 32, 64]', '(1024)', '(32)', '(0.1)'], {'bias': '(False)'}), '(in_channels, [32, 32, 64], 1024, 32, 0.1, bias=False)\n', (265, 319), False, 'from torch3d.nn import SetAbstraction, FeaturePropagation\n'), ((339, 402), 'torch3d.nn.SetAbstr... |
"""
Main application package
Contains the app factory function.
"""
# Third party imports
import dash
import dash_bootstrap_components as dbc
from flask import Flask
from flask.helpers import get_root_path, get_debug_flag
from flask_cas import login_required
# Local application imports
from config import DevConfig, ... | [
"app.extensions.dynamo.init_app",
"flask.Flask",
"app.extensions.cas.init_app",
"flask.helpers.get_debug_flag",
"flask.helpers.get_root_path",
"flask_cas.login_required"
] | [((684, 699), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (689, 699), False, 'from flask import Flask\n'), ((3970, 3986), 'flask.helpers.get_debug_flag', 'get_debug_flag', ([], {}), '()\n', (3984, 3986), False, 'from flask.helpers import get_root_path, get_debug_flag\n'), ((6792, 6812), 'app.extensions.... |
# -*- coding: utf-8 -*-
"""
Requires Numpy, scipy, astropy, matplotlib
@author: <NAME>
"""
import cute_snr_calculator as csc
t_star = 7000 # Stellar Temperature in K (required)
r_star = 1.2 # Stellar Radius in R sun ()
m_star = 7 # Stellar V magnitude ()
s_dist = 10 ... | [
"cute_snr_calculator.cute_snr_calculator"
] | [((1478, 1733), 'cute_snr_calculator.cute_snr_calculator', 'csc.cute_snr_calculator', (['t_star', 'r_star', 'm_star', 's_dist', 'logr', 'spectral_type', 'Ra', 'Dec', 'transit_duration', 'ud', 'fwhm', 'r_noise', 'dark_noise', 'exptime', 'G', 'width', 'line_core_emission', 'mg2_col', 'mg1_col', 'fe2_col', 'add_ism_abs', ... |
#!/usr/bin/env python
# coding: utf-8
from setuptools import setup
setup_args = dict(
name = 'slurmformspawner',
packages = ['slurmformspawner'],
version = "2.2.3",
description = "slurmformspawner: JupyterHub SlurmSpawner with a dynamic spawn form",
au... | [
"setuptools.setup"
] | [((1335, 1354), 'setuptools.setup', 'setup', ([], {}), '(**setup_args)\n', (1340, 1354), False, 'from setuptools import setup\n')] |
import os
import sys
from path import Path
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from environ import Env as get_env
env = get_env()
current_path = os.path.join(__file__)
root_path = Path(current_path).parent.parent
... | [
"os.path.exists",
"alembic.context.run_migrations",
"alembic.context.configure",
"alembic.context.is_offline_mode",
"os.path.join",
"path.Path",
"logging.config.fileConfig",
"alembic.context.begin_transaction",
"environ.Env"
] | [((227, 236), 'environ.Env', 'get_env', ([], {}), '()\n', (234, 236), True, 'from environ import Env as get_env\n'), ((252, 274), 'os.path.join', 'os.path.join', (['__file__'], {}), '(__file__)\n', (264, 274), False, 'import os\n'), ((437, 461), 'os.path.exists', 'os.path.exists', (['env_path'], {}), '(env_path)\n', (4... |
def test_read_hdf5():
import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from read_hdf5 import read_hdf5
import os
import numpy as np
import h5py
# Make tmp mat file and save
fs = np.uint16(np.array([100]))
ecg = n... | [
"read_hdf5.read_hdf5",
"h5py.File",
"os.path.realpath",
"numpy.array",
"numpy.array_equal",
"os.system"
] | [((390, 414), 'h5py.File', 'h5py.File', (['"""tmp.h5"""', '"""w"""'], {}), "('tmp.h5', 'w')\n", (399, 414), False, 'import h5py\n'), ((547, 603), 'read_hdf5.read_hdf5', 'read_hdf5', (['"""tmp.h5"""'], {'offset': '(0)', 'count_read': '(4)', 'init_flag': '(0)'}), "('tmp.h5', offset=0, count_read=4, init_flag=0)\n", (556,... |
# coding=utf-8
"""
Compute TaskEmb for classification/ regression/ question-answering tasks (Vu et al., 2020).
Adapted from https://github.com/tuvuumass/task-transferability.
"""
import argparse
import logging
import os
from dataclasses import dataclass
import numpy as np
import torch
from torch.distributions.normal ... | [
"logging.getLogger",
"logging.basicConfig",
"itrain.runner.set_seed",
"os.path.exists",
"torch.log",
"torch.multinomial",
"argparse.ArgumentParser",
"itrain.arguments.DatasetArguments",
"os.makedirs",
"os.listdir",
"tqdm.tqdm",
"os.path.join",
"torch.softmax",
"torch.tensor",
"itrain.Run... | [((762, 789), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (779, 789), False, 'import logging\n'), ((12159, 12198), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (12178, 12198), False, 'import logging\n'), ((12532, 12586), 'os.p... |
#-*- coding: utf-8 -*-
import os
import json
from StringIO import StringIO
from django.test import TestCase, RequestFactory
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.utils.translation import ugettext as _
from django.core... | [
"spirit.forms.comment.CommentForm",
"spirit.signals.comment.comment_pre_update.connect",
"spirit.models.comment.Comment.objects.all",
"spirit.templatetags.tags.comment.render_comments_form",
"django.core.urlresolvers.reverse",
"utils.create_user",
"spirit.utils.markdown.quotify",
"spirit.models.topic.... | [((1153, 1169), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (1167, 1169), False, 'from django.contrib.auth import get_user_model\n'), ((22196, 22245), 'django.test.utils.override_settings', 'override_settings', ([], {'ST_ALLOWED_UPLOAD_IMAGE_EXT': '[]'}), '(ST_ALLOWED_UPLOAD_IMAGE_EXT=[])\... |
# -*- coding: utf-8 -*-
"""
Professor.test_models
~~~~~~~~~~~~~~
Testa coisas relacionada ao modelo.
:copyright: (c) 2011 by <NAME>.
"""
from django.test import TestCase
from model_mommy import mommy
from Professor.models import Professor, Monitor
class ProfessorTest(TestCase):
def setUp(self)... | [
"model_mommy.mommy.make_one"
] | [((347, 372), 'model_mommy.mommy.make_one', 'mommy.make_one', (['Professor'], {}), '(Professor)\n', (361, 372), False, 'from model_mommy import mommy\n'), ((638, 661), 'model_mommy.mommy.make_one', 'mommy.make_one', (['Monitor'], {}), '(Monitor)\n', (652, 661), False, 'from model_mommy import mommy\n')] |
from genologics.entities import Step
from config import Config
from epp.useq_run_status_mail import run_finished
def routeArtifacts(lims, step_uri, input):
step = Step(lims, uri=step_uri)
current_step = step.configuration.name
print(current_step)
to_route = {}
for io_map in step.details.input_out... | [
"genologics.entities.Step",
"epp.useq_run_status_mail.run_finished"
] | [((169, 193), 'genologics.entities.Step', 'Step', (['lims'], {'uri': 'step_uri'}), '(lims, uri=step_uri)\n', (173, 193), False, 'from genologics.entities import Step\n'), ((5031, 5109), 'epp.useq_run_status_mail.run_finished', 'run_finished', (['lims', 'Config.MAIL_SENDER', 'Config.TRELLO_ANALYSIS_BOARD', 'artifact'], ... |
# Copyright 2021 The TF-Coder Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"pickle.dump",
"tf_coder.datasets.github.tokenizer.tokenize",
"sklearn.svm.LinearSVC",
"pickle.load",
"sklearn.feature_extraction.text.TfidfVectorizer",
"tf_coder.datasets.github.data_loader.get_full_context",
"sklearn.naive_bayes.MultinomialNB",
"tf_coder.datasets.github.data_loader.load_data",
"tf... | [((1238, 1279), 'pickle.dump', 'pickle.dump', (['[vectorizer, classifiers]', 'f'], {}), '([vectorizer, classifiers], f)\n', (1249, 1279), False, 'import pickle\n'), ((1373, 1387), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1384, 1387), False, 'import pickle\n'), ((3566, 3605), 'tf_coder.datasets.github.data_l... |
# -*- coding: utf-8 -*-
"""
aulaszeus.extensions
~~~~~~~~~~~~~~~~~~~~~~~~~~
AulasZeus extensions module
:copyright: (c) 2016 by Haynesss.
:license: BSD, see LICENSE for more details.
"""
from flask_mongoengine import MongoEngine
from flask_mail import Mail
from flask_assets import Environment
from... | [
"flask_mail.Mail",
"flask_cache.Cache",
"flask_assets.Environment",
"flask_bootstrap.Bootstrap",
"flask_mongoengine.MongoEngine"
] | [((392, 398), 'flask_mail.Mail', 'Mail', ([], {}), '()\n', (396, 398), False, 'from flask_mail import Mail\n'), ((404, 417), 'flask_mongoengine.MongoEngine', 'MongoEngine', ([], {}), '()\n', (415, 417), False, 'from flask_mongoengine import MongoEngine\n'), ((427, 440), 'flask_assets.Environment', 'Environment', ([], {... |
import sys
import os
import logging
import datetime
import datetime
import json
import traceback
import copy
import random
import string
import gzip
import asyncio
from pathlib import Path
from collections.abc import Iterable
import discord
from tqdm import tqdm
__version__ = "0.3.3"
PBAR_UPDATE_INTERVAL = 100
PBAR_... | [
"os.path.exists",
"traceback.format_exc",
"random.choice",
"os.makedirs",
"pathlib.Path",
"tqdm.tqdm",
"sys.exc_info",
"datetime.datetime.now",
"json.dump"
] | [((6448, 6462), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (6460, 6462), False, 'import sys\n'), ((7608, 7652), 'datetime.datetime.now', 'datetime.datetime.now', (['datetime.timezone.utc'], {}), '(datetime.timezone.utc)\n', (7629, 7652), False, 'import datetime\n'), ((8368, 8405), 'os.path.exists', 'os.path.exis... |
import pickle
def audio_condition():
# natural versus narration
narration_users = ['user2', 'user4', 'user7', 'user8', 'user10','user14','user16','user18','user20']
natural_users = ['user3','user5','user6','user9','user11','user12','user15','user17','user19']
filename = '../data/narration_users.pkl'
... | [
"pickle.dump"
] | [((368, 438), 'pickle.dump', 'pickle.dump', (['narration_users', 'handle'], {'protocol': 'pickle.HIGHEST_PROTOCOL'}), '(narration_users, handle, protocol=pickle.HIGHEST_PROTOCOL)\n', (379, 438), False, 'import pickle\n'), ((540, 608), 'pickle.dump', 'pickle.dump', (['natural_users', 'handle'], {'protocol': 'pickle.HIGH... |
from django.http import HttpResponse
import json
def bcbpay(request):
res = {
"ver": 3,
"appUISeg": {
"title": "通用支付",
"value": "0.1",
"affCode": "",
"referInfo": "进行支付操作",
"defaultPayAddr": "",
"symbol": "BCB"
},
... | [
"json.dumps"
] | [((793, 808), 'json.dumps', 'json.dumps', (['res'], {}), '(res)\n', (803, 808), False, 'import json\n'), ((834, 849), 'json.dumps', 'json.dumps', (['res'], {}), '(res)\n', (844, 849), False, 'import json\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.layer1_VQA = nn.Linear(1, 20)
self.layer1_R1 = nn.Linear(1, 5)
self.layer1_R2 = nn.Embedding(3, 5)
self.layer1_M = nn.Linear(1, 1... | [
"torch.nn.functional.dropout",
"torch.nn.Embedding",
"torch.nn.Linear"
] | [((180, 196), 'torch.nn.Linear', 'nn.Linear', (['(1)', '(20)'], {}), '(1, 20)\n', (189, 196), True, 'import torch.nn as nn\n'), ((222, 237), 'torch.nn.Linear', 'nn.Linear', (['(1)', '(5)'], {}), '(1, 5)\n', (231, 237), True, 'import torch.nn as nn\n'), ((263, 281), 'torch.nn.Embedding', 'nn.Embedding', (['(3)', '(5)'],... |
from Cryptodome.Cipher import AES
from secrets import token_bytes
from tkinter import *
import threading
screen = Tk()
screen.geometry("500x450")
screen.title("Enkriptimi AES")
#deklarimi i variablave
mesazhi = StringVar()
enc = StringVar()
Label(text="Enkriptimi me AES", bg="pink", width="400",
height="2", fon... | [
"Cryptodome.Cipher.AES.new"
] | [((921, 947), 'Cryptodome.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_EAX'], {}), '(key, AES.MODE_EAX)\n', (928, 947), False, 'from Cryptodome.Cipher import AES\n'), ((1147, 1186), 'Cryptodome.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_EAX'], {'nonce': 'nonce'}), '(key, AES.MODE_EAX, nonce=nonce)\n', (1154, 1186... |
"""
This file contains the REST class for the 802.1X controller.
"""
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 <NAME> <yamahata at private email ne jp>
# Copyright (C) 2014 <NAME> < joe at wand net nz >
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... | [
"logging.getLogger",
"json.loads",
"logging.StreamHandler",
"logging.Formatter",
"socket.inet_aton",
"webob.Response"
] | [((1273, 1296), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1294, 1296), False, 'import logging\n'), ((1496, 1555), 'logging.Formatter', 'logging.Formatter', (['"""%(levelname)s - %(name)s - %(message)s"""'], {}), "('%(levelname)s - %(name)s - %(message)s')\n", (1513, 1555), False, 'import logg... |
#Libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import Calib... | [
"seaborn.factorplot",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.calibration.CalibratedClassifierCV",
"sklearn.linear_model.LogisticRegression",
"seaborn.set_style",
"n... | [((104, 130), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (117, 130), True, 'import seaborn as sns\n'), ((599, 632), 'pandas.read_csv', 'pd.read_csv', (['"""../input/train.csv"""'], {}), "('../input/train.csv')\n", (610, 632), True, 'import pandas as pd\n'), ((640, 672), 'pandas.... |
from io import BytesIO
from typing import Tuple
import pytest
from app import app
from neo4japp.database import get_file_type_service
from neo4japp.models import Files
@pytest.mark.parametrize(
'pair', [
('vnd.lifelike.filesystem/directory', True),
('vnd.lifelike.document/map', True),
('... | [
"neo4japp.models.Files",
"io.BytesIO",
"pytest.mark.parametrize",
"app.app.app_context",
"neo4japp.database.get_file_type_service"
] | [((173, 551), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""pair"""', "[('vnd.lifelike.filesystem/directory', True), ('vnd.lifelike.document/map',\n True), ('vnd.lifelike.document/enrichment-table', True), (\n 'application/pdf', True), ('image/png', True), ('text/plain', True), (\n 'application/o... |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
browser = webdriver.Chrome("C:\\Users\\brik7\\PycharmProjects\\Hackathon 2019\\chromedriver.exe")
browser.get("... | [
"selenium.webdriver.support.expected_conditions.url_changes",
"selenium.webdriver.Chrome",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((219, 311), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""C:\\\\Users\\\\brik7\\\\PycharmProjects\\\\Hackathon 2019\\\\chromedriver.exe"""'], {}), "(\n 'C:\\\\Users\\\\brik7\\\\PycharmProjects\\\\Hackathon 2019\\\\chromedriver.exe')\n", (235, 311), False, 'from selenium import webdriver\n'), ((443, 468), ... |
from unittest import SkipTest
from django.apps import apps
from django.test import TransactionTestCase
from django.db.migrations.executor import MigrationExecutor
from django.db import connection
from django.conf import settings
from test_without_migrations.management.commands.test import DisableMigrations
class Migr... | [
"django.db.migrations.executor.MigrationExecutor",
"unittest.SkipTest",
"django.apps.apps.get_model"
] | [((1061, 1090), 'django.db.migrations.executor.MigrationExecutor', 'MigrationExecutor', (['connection'], {}), '(connection)\n', (1078, 1090), False, 'from django.db.migrations.executor import MigrationExecutor\n'), ((1456, 1485), 'django.db.migrations.executor.MigrationExecutor', 'MigrationExecutor', (['connection'], {... |
import numpy as np
def calculate_exploration_prob(loss_history, act_explor_prob,threshold):
mean = np.mean(loss_history)
variance = 0
for i in loss_history:
variance += np.square(i-mean)
if threshold >= variance:
act_explor_prob += 0.05
else:
act_explor_prob -= 0.05
i... | [
"numpy.mean",
"numpy.square"
] | [((104, 125), 'numpy.mean', 'np.mean', (['loss_history'], {}), '(loss_history)\n', (111, 125), True, 'import numpy as np\n'), ((192, 211), 'numpy.square', 'np.square', (['(i - mean)'], {}), '(i - mean)\n', (201, 211), True, 'import numpy as np\n')] |
# OS library
import os
from os.path import join
# SYS library
import sys
# Scientific library
import scipy.io as sio
import numpy as np
import pandas as pd
# Joblib library
### Module to performed parallel processing
from joblib import Parallel, delayed
# Multiprocessing library
import multiprocessing
# HDF5
import h5p... | [
"numpy.savez",
"pandas.read_csv",
"scipy.io.loadmat",
"joblib.Parallel",
"numpy.array",
"joblib.delayed"
] | [((1396, 1424), 'pandas.read_csv', 'pd.read_csv', (['gt_csv_filename'], {}), '(gt_csv_filename)\n', (1407, 1424), True, 'import pandas as pd\n'), ((506, 520), 'scipy.io.loadmat', 'sio.loadmat', (['f'], {}), '(f)\n', (517, 520), True, 'import scipy.io as sio\n'), ((992, 1018), 'numpy.array', 'np.array', (['vol_lbp_top_h... |
import yaml
import logging
from v1.comms import Comms
from v1.sensor import SensorType, SensorTypes
from v1.monitor import Monitor, Monitors
MONITORS = None
COMMS = None
SENSORS = None
class Gateway:
# api_token = None
# send_update_cron = 1440
# comms = Comms()
# send_update_cron = "0 0 * * *"
... | [
"logging.info",
"yaml.dump"
] | [((2174, 2226), 'yaml.dump', 'yaml.dump', (['data', 'yaml_file'], {'default_flow_style': '(False)'}), '(data, yaml_file, default_flow_style=False)\n', (2183, 2226), False, 'import yaml\n'), ((2269, 2310), 'logging.info', 'logging.info', (['"""Configration file created"""'], {}), "('Configration file created')\n", (2281... |
# Generated by Django 3.1.7 on 2021-03-11 18:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("okr", "0049_auto_20210310_2321"),
]
operations = [
migrations.CreateModel(
name="PodcastCategory",
fields=[
... | [
"django.db.models.AutoField",
"django.db.models.ManyToManyField",
"django.db.models.TextField",
"django.db.models.DateTimeField"
] | [((1591, 1851), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'db_table': '"""podcast_podcast_category"""', 'help_text': '"""Die für den Podcast hier manuell vergebenen Kategorien"""', 'related_name': '"""podcasts"""', 'related_query_name': '"""podcast"""', 'to': '"""okr.Podcast... |
# Generated by Django 2.1.7 on 2019-02-17 11:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0002_pollingplaces_chance_of_sausage'),
]
operations = [
migrations.RemoveField(
model_name='pollingplacenoms',
name=... | [
"django.db.migrations.RemoveField"
] | [((236, 315), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""pollingplacenoms"""', 'name': '"""chance_of_sausage"""'}), "(model_name='pollingplacenoms', name='chance_of_sausage')\n", (258, 315), False, 'from django.db import migrations\n')] |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Usefull calculus fonctions compatible with Quantity objects.
These are basically numpy function wrapped with dimensions checks.
"""
import numbers as nb
import numpy as np
import scipy
import scipy.integrate
import scipy.optimize
import sympy as sp
from .dimension ... | [
"numpy.array",
"numpy.trapz",
"numpy.vectorize"
] | [((659, 677), 'numpy.vectorize', 'np.vectorize', (['func'], {}), '(func)\n', (671, 677), True, 'import numpy as np\n'), ((1937, 1967), 'numpy.trapz', 'np.trapz', (['Zs'], {'axis': '(-1)', 'x': 'ech_x'}), '(Zs, axis=-1, x=ech_x)\n', (1945, 1967), True, 'import numpy as np\n'), ((1981, 2014), 'numpy.trapz', 'np.trapz', (... |
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import unittest
from mock import Mock, patch
from nose.plugins.attrib import attr
from datawinners.accountmanagement.models import Organization, OrganizationSetting
class TestOrganizationSetting(unittest.TestCase):
@attr('unit_test')
def test_should_get_organisatio... | [
"mock.Mock",
"datawinners.accountmanagement.models.OrganizationSetting",
"mock.patch.object",
"nose.plugins.attrib.attr"
] | [((267, 284), 'nose.plugins.attrib.attr', 'attr', (['"""unit_test"""'], {}), "('unit_test')\n", (271, 284), False, 'from nose.plugins.attrib import attr\n'), ((359, 382), 'mock.Mock', 'Mock', ([], {'spec': 'Organization'}), '(spec=Organization)\n', (363, 382), False, 'from mock import Mock, patch\n'), ((435, 489), 'moc... |
# -*- coding: utf-8 -*-
import daft
import pytest
class TestPGM:
def test_auto_size(self):
pgm = daft.PGM()
pgm.add_node("node1", x=0.0, y=0.0)
pgm.add_node("node2", x=1.0, y=0.0)
pgm.add_edge("node1", "node2")
pgm.render()
def test_manual_size(self):
pgm = da... | [
"daft._pop_multiple",
"daft.Node",
"pytest.raises",
"daft.PGM"
] | [((112, 122), 'daft.PGM', 'daft.PGM', ([], {}), '()\n', (120, 122), False, 'import daft\n'), ((318, 355), 'daft.PGM', 'daft.PGM', ([], {'shape': '[1, 1]', 'origin': '[0, 0]'}), '(shape=[1, 1], origin=[0, 0])\n', (326, 355), False, 'import daft\n'), ((370, 380), 'daft.PGM', 'daft.PGM', ([], {}), '()\n', (378, 380), Fals... |
#!python
# pyindent scan
# TDB: get rid of global var
"""
The input is iterator yielding lines from a single pyindent form. Each
line is tokenised independently, except keeping track of the
indentation.
For the scanner, a line begins with 0+ indents.
It continues with either one word and a newline, or
two words, a ... | [
"re.split",
"re.match"
] | [((585, 616), 're.match', 're.match', (['"""([ ]*)(.*)\\\\n"""', 'line'], {}), "('([ ]*)(.*)\\\\n', line)\n", (593, 616), False, 'import re\n'), ((1054, 1076), 're.split', 're.split', (['"""\\\\s+"""', 'more'], {}), "('\\\\s+', more)\n", (1062, 1076), False, 'import re\n')] |
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Arc, Polygon
from . import looptools
def plot_interaction(
l, r, n_lef=0,
height_factor=1.0,
max_height = 150,
height=None,
y=10,
plot_text=True,
color=(223.0/2... | [
"matplotlib.patches.Arc",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim"
] | [((560, 685), 'matplotlib.patches.Arc', 'Arc', ([], {'xy': 'arc_center', 'width': '(r - l)', 'height': 'arc_height', 'theta1': '(0)', 'theta2': '(180)', 'alpha': '(0.45)', 'lw': '(5)', 'color': 'color', 'capstyle': '"""round"""'}), "(xy=arc_center, width=r - l, height=arc_height, theta1=0, theta2=180,\n alpha=0.45, ... |
from django.http import HttpResponse
from django.views import generic
from django.views.generic import TemplateView
from easy_statblock import *
from .models import Creature
class CreatureView(TemplateView):
model = Creature
template_name = "creature/index.html"
def get(self, request, *args, **kwargs):
... | [
"django.http.HttpResponse"
] | [((668, 697), 'django.http.HttpResponse', 'HttpResponse', (['"""Hello, world."""'], {}), "('Hello, world.')\n", (680, 697), False, 'from django.http import HttpResponse\n'), ((335, 444), 'django.http.HttpResponse', 'HttpResponse', (['f"""Hello from the other side.\nrequest = {request}\nargs = {args}\nkwargs = {kwargs}"... |
from selenium import webdriver as wb
from selenium.webdriver.common.keys import Keys
import unittest
import time
class NewVisitorTest( unittest.TestCase ):
def check_for_row_in_list_table( self, row_text ):
table = self.browser.find_element_by_id( 'id_list_table' )
rows = table.find_elements_b... | [
"unittest.main",
"selenium.webdriver.Chrome",
"time.sleep"
] | [((1556, 1571), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1569, 1571), False, 'import unittest\n'), ((721, 741), 'time.sleep', 'time.sleep', (['duration'], {}), '(duration)\n', (731, 741), False, 'import time\n'), ((792, 832), 'selenium.webdriver.Chrome', 'wb.Chrome', (['"""C:\\\\Downloads\\\\chromedriver"""... |
# -*- coding: utf-8 -*-
""" config for characterOCR
"""
import tensorflow as tf
with open('wordset/words.txt', encoding='utf-8') as fwords:
words = fwords.read().strip()
with open('wordset/punct.txt', encoding='utf-8') as fpunct:
punct = fpunct.read().strip()
WORDSET = words + punct
tf.app.flags.DEFINE_strin... | [
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.app.flags.DEFINE_boolean"
] | [((295, 365), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""wordset"""', 'WORDSET', '"""Wordset to recognize"""'], {}), "('wordset', WORDSET, 'Wordset to recognize')\n", (321, 365), True, 'import tensorflow as tf\n'), ((476, 572), 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_i... |
# -*- coding: utf-8 -*-
"""
:Author: <NAME>
:Date: 2018. 6. 21.
"""
import math
import pandas as pd
from dateutil.relativedelta import relativedelta
from ksif.io.google_drive import query_google_spreadsheet, HOLDING_COMPANY_GID, DELISTED_COMPANY_GID, \
MERGED_COMPANY_GID, RELISTED_COMPANY_GID
from preprocess.core... | [
"pandas.isnull",
"dateutil.relativedelta.relativedelta",
"ksif.io.google_drive.query_google_spreadsheet",
"pandas.concat",
"math.isnan"
] | [((1718, 1763), 'ksif.io.google_drive.query_google_spreadsheet', 'query_google_spreadsheet', (['HOLDING_COMPANY_GID'], {}), '(HOLDING_COMPANY_GID)\n', (1742, 1763), False, 'from ksif.io.google_drive import query_google_spreadsheet, HOLDING_COMPANY_GID, DELISTED_COMPANY_GID, MERGED_COMPANY_GID, RELISTED_COMPANY_GID\n'),... |
from typing import Dict
from django.http import HttpRequest
from klanad.models import KlanadTranslations
def footer_processor(request: HttpRequest) -> Dict[str, str]:
"""Add the footer email me message to the context of all templates since the footer is included everywhere."""
try:
message = KlanadT... | [
"klanad.models.KlanadTranslations.objects.all"
] | [((313, 345), 'klanad.models.KlanadTranslations.objects.all', 'KlanadTranslations.objects.all', ([], {}), '()\n', (343, 345), False, 'from klanad.models import KlanadTranslations\n')] |
"""Build the projects."""
import os
import re
import json
import zipfile
import pathlib
EXCLUDEDIRS = ["build", ".git", ".github"]
def main():
"""Main"""
generate_script_zips()
gather_all()
def generate_script_zips():
"""Make the script zipfiles, build the settings-json file from defaults."""
... | [
"zipfile.ZipFile",
"pathlib.Path",
"json.dumps",
"os.path.join",
"os.mkdir",
"json.load",
"re.search"
] | [((937, 960), 'pathlib.Path', 'pathlib.Path', (['"""./build"""'], {}), "('./build')\n", (949, 960), False, 'import pathlib\n'), ((3339, 3388), 'json.dumps', 'json.dumps', (['outdata'], {'indent': '(4)', 'ensure_ascii': '(False)'}), '(outdata, indent=4, ensure_ascii=False)\n', (3349, 3388), False, 'import json\n'), ((33... |
from srs_sqlite import load_srs
if __name__ == '__main__':
# load_srs('user/PathoKnowledge.db', debug=True)
load_srs('user/PathoImages.db', debug=True)
| [
"srs_sqlite.load_srs"
] | [((118, 161), 'srs_sqlite.load_srs', 'load_srs', (['"""user/PathoImages.db"""'], {'debug': '(True)'}), "('user/PathoImages.db', debug=True)\n", (126, 161), False, 'from srs_sqlite import load_srs\n')] |
import cirq
import numpy as np
import pandas as pd
import sympy
from qnn.qnlp.phrases_database import extract_words
class CircuitsWords:
""" A class used to represent the circuits and some information associated to them
"""
def __init__(self, data: str, num_qubits: int, num_phrases: int):
""" Initializes the c... | [
"qnn.qnlp.phrases_database.extract_words",
"pandas.read_csv",
"cirq.rx",
"cirq.GridQubit",
"sympy.symbols",
"cirq.Circuit",
"cirq.Simulator",
"cirq.measure",
"numpy.arange"
] | [((826, 853), 'sympy.symbols', 'sympy.symbols', (['"""theta:1000"""'], {}), "('theta:1000')\n", (839, 853), False, 'import sympy\n'), ((941, 965), 'qnn.qnlp.phrases_database.extract_words', 'extract_words', (['self.data'], {}), '(self.data)\n', (954, 965), False, 'from qnn.qnlp.phrases_database import extract_words\n')... |
import functools, sys
@functools.lru_cache(maxsize=None)
def rec(c):
if c == 0:
return 0
ret = INF
for coin in coins:
if c - coin >= 0:
ret = min(ret, rec(c-coin) + 1)
return ret
INF = 10**6
N, M = map(int, input().split())
coins = [int(x) for x in input().split()]
sys.set... | [
"sys.setrecursionlimit",
"functools.lru_cache"
] | [((25, 58), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (44, 58), False, 'import functools, sys\n'), ((313, 339), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['INF'], {}), '(INF)\n', (334, 339), False, 'import functools, sys\n')] |
import random
from esper.prelude import *
from rekall.video_interval_collection import VideoIntervalCollection
from rekall.temporal_predicates import *
from esper.rekall import *
import cv2
import pickle
import multiprocessing as mp
from query.models import Video, Shot
from tqdm import tqdm
import django
import sys
imp... | [
"os.path.exists",
"rekall.video_interval_collection.VideoIntervalCollection.from_django_qs",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"os.makedirs",
"django.db.connections.close_all",
"torch.load",
"tqdm.tqdm",
"pickle.load",
"torch.stack",
"query.models.Video.objects.get",
"esper.shot_dete... | [((13689, 13764), 'esper.shot_detection_torch.models.deepsbd_resnet.resnet18', 'deepsbd_resnet.resnet18', ([], {'num_classes': '(3)', 'sample_size': '(128)', 'sample_duration': '(16)'}), '(num_classes=3, sample_size=128, sample_duration=16)\n', (13712, 13764), True, 'import esper.shot_detection_torch.models.deepsbd_res... |
#需要的库
import requests
from pikepdf import Pdf
#说明
print("请在脚本同一目录下编辑list.txt文件\n格式:班别(文件名)+姓名+身份证号,一行一组")
print("信息不匹配将无法输出,并在同一目录下生成error.txt名单\n仅对广东省注册志愿者有效\n\n")
#列表处理
list=[] #初始化二维列表
with open("list.txt", "r", encoding="utf-8") as f:
for line in f.readlines... | [
"pikepdf.Pdf.open",
"pikepdf.Pdf.new",
"requests.get"
] | [((1069, 1086), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1081, 1086), False, 'import requests\n'), ((1729, 1765), 'pikepdf.Pdf.open', 'Pdf.open', (["(i[0] + '-' + i[1] + '.pdf')"], {}), "(i[0] + '-' + i[1] + '.pdf')\n", (1737, 1765), False, 'from pikepdf import Pdf\n'), ((1780, 1789), 'pikepdf.Pdf.new... |
#!/usr/bin/env python
# coding: utf-8
# # Aging Setup Data Prep
# ### Imports
import os
import io
import sys
import re
import glob
import math
import logging
import numpy as np
import pandas as pd
from bric_analysis_libraries import standard_functions as std
# ## Data Prep
# convenience functions
def sample_... | [
"pandas.Series",
"pandas.MultiIndex.from_product",
"pandas.read_csv",
"re.compile",
"bric_analysis_libraries.standard_functions.metadata_from_file_name",
"numpy.stack",
"numpy.empty",
"pandas.DataFrame",
"bric_analysis_libraries.standard_functions.import_data",
"pandas.MultiIndex.from_tuples",
"... | [((381, 451), 'bric_analysis_libraries.standard_functions.metadata_from_file_name', 'std.metadata_from_file_name', (['name_search', 'file'], {'delimeter': '"""_"""', 'group': '(1)'}), "(name_search, file, delimeter='_', group=1)\n", (408, 451), True, 'from bric_analysis_libraries import standard_functions as std\n'), (... |
import jwt
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.shortcuts import render
from rest_framework import viewsets, status, permissions
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import mixins
from rest_framewo... | [
"django.contrib.auth.get_user_model",
"django.contrib.auth.authenticate",
"rest_framework.permissions.IsAuthenticated",
"api.models.Post.objects.all",
"django.contrib.auth.login",
"rest_framework.response.Response",
"django.contrib.auth.logout"
] | [((578, 594), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (592, 594), False, 'from django.contrib.auth import get_user_model\n'), ((2515, 2533), 'api.models.Post.objects.all', 'Post.objects.all', ([], {}), '()\n', (2531, 2533), False, 'from api.models import Post\n'), ((1719, 1774), 'djang... |
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import dataent
def get_context(context):
token = dataent.local.form_dict.token
if token:
dataent.db.set_value("Integration Request", token, "status", "Cancelled")
dataent.db.commit()
| [
"dataent.db.commit",
"dataent.db.set_value"
] | [((224, 297), 'dataent.db.set_value', 'dataent.db.set_value', (['"""Integration Request"""', 'token', '"""status"""', '"""Cancelled"""'], {}), "('Integration Request', token, 'status', 'Cancelled')\n", (244, 297), False, 'import dataent\n'), ((300, 319), 'dataent.db.commit', 'dataent.db.commit', ([], {}), '()\n', (317,... |
import datetime
import uuid
from mamba import description, it
from bookshop.sqlalchemy.convert_properties import convert_sqlalchemy_properties_to_dict_properties
from bookshop.domain.Genre import genre as genre_domain_model
from bookshop.sqlalchemy.model import Genre
BOOK_UUID = uuid.uuid4()
datetime_now = datetim... | [
"uuid.uuid4",
"datetime.datetime.now",
"bookshop.sqlalchemy.convert_properties.convert_sqlalchemy_properties_to_dict_properties",
"datetime.datetime.today",
"mamba.it",
"mamba.description"
] | [((284, 296), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (294, 296), False, 'import uuid\n'), ((313, 336), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (334, 336), False, 'import datetime\n'), ((352, 377), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (375, 377), Fals... |
import os
import logging
from flask import send_from_directory
from werkzeug.exceptions import NotFound
from confidant import authnz
from confidant.app import app
@app.route('/')
@authnz.redirect_to_logout_if_no_auth
def index():
return app.send_static_file('index.html')
@app.route('/loggedout')
@authnz.requi... | [
"os.path.join",
"confidant.app.app.route",
"confidant.app.app.send_static_file"
] | [((168, 182), 'confidant.app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (177, 182), False, 'from confidant.app import app\n'), ((283, 306), 'confidant.app.app.route', 'app.route', (['"""/loggedout"""'], {}), "('/loggedout')\n", (292, 306), False, 'from confidant.app import app\n'), ((408, 433), 'confidant.a... |
import pytest
import requests
import requests_mock
from transcriptor import amazon
###SUPPORTING VALUES###
speaker_segment = {
"speakers": 4,
"segments": [
{
"start_time": "0.44",
"speaker_label": "spk_0",
"end_time": "3.3",
... | [
"transcriptor.amazon.add_speaker",
"transcriptor.amazon.from_amazon_uri",
"transcriptor.amazon.Job.assert_called",
"requests_mock.get",
"transcriptor.amazon.add_marker"
] | [((1105, 1126), 'transcriptor.amazon.add_speaker', 'amazon.add_speaker', (['(0)'], {}), '(0)\n', (1123, 1126), False, 'from transcriptor import amazon\n'), ((1330, 1398), 'transcriptor.amazon.add_marker', 'amazon.add_marker', (["speaker_segment['segments'][0]"], {'has_speakers': '(True)'}), "(speaker_segment['segments'... |
import unittest
import numpy as np
import scipy.sparse
from injector import Injector
from decai.simulation.data.featuremapping.feature_index_mapper import FeatureIndexMapper
from decai.simulation.logging_module import LoggingModule
class TestFeatureIndexMapper(unittest.TestCase):
@classmethod
def setUpClass... | [
"numpy.array_equal",
"numpy.array",
"injector.Injector",
"numpy.random.random_sample"
] | [((341, 366), 'injector.Injector', 'Injector', (['[LoggingModule]'], {}), '([LoggingModule])\n', (349, 366), False, 'from injector import Injector\n'), ((484, 516), 'numpy.random.random_sample', 'np.random.random_sample', (['(10, 3)'], {}), '((10, 3))\n', (507, 516), True, 'import numpy as np\n'), ((534, 580), 'numpy.r... |
from pyNastran.dev.bdf_vectorized.test.test_coords import *
from pyNastran.dev.bdf_vectorized.test.test_mass import *
from pyNastran.dev.bdf_vectorized.cards.elements.solid.test_solids import *
from pyNastran.dev.bdf_vectorized.cards.elements.shell.test_shell import *
from pyNastran.dev.bdf_vectorized.cards.elements.r... | [
"unittest.main"
] | [((796, 811), 'unittest.main', 'unittest.main', ([], {}), '()\n', (809, 811), False, 'import unittest\n')] |
#this is a file to display text
#contains a text class and functions
import pygame
from pygame.locals import *
pygame.init()
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
##
##class Message():
## def __init__(self,length,heigh... | [
"pygame.init"
] | [((115, 128), 'pygame.init', 'pygame.init', ([], {}), '()\n', (126, 128), False, 'import pygame\n')] |
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import argparse
import pygame
def play_music(filename):
clock = pygame.time.Clock()
pygame.mixer.music.load(filename)
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
clock.tick(30)
parser = argparse.ArgumentPar... | [
"pygame.mixer.init",
"argparse.ArgumentParser",
"pygame.mixer.music.stop",
"pygame.mixer.music.set_volume",
"pygame.mixer.music.get_busy",
"pygame.time.Clock",
"pygame.mixer.music.play",
"pygame.mixer.music.fadeout",
"pygame.mixer.music.load"
] | [((300, 342), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Play MIDI files"""'], {}), "('Play MIDI files')\n", (323, 342), False, 'import argparse\n'), ((529, 579), 'pygame.mixer.init', 'pygame.mixer.init', (['freq', 'bitsize', 'channels', 'buffer'], {}), '(freq, bitsize, channels, buffer)\n', (546, 579)... |
import io
import time
import picamera
from base_camera import BaseCamera
class Camera(BaseCamera):
@staticmethod
def frames():
with picamera.PiCamera() as camera:
# let camera warm up
time.sleep(2)
stream = io.BytesIO()
camera.rotation = 180 #CV... | [
"io.BytesIO",
"picamera.PiCamera",
"time.sleep"
] | [((150, 169), 'picamera.PiCamera', 'picamera.PiCamera', ([], {}), '()\n', (167, 169), False, 'import picamera\n'), ((226, 239), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (236, 239), False, 'import time\n'), ((262, 274), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (272, 274), False, 'import io\n')] |
import torch.nn as nn
import torch.nn.functional as F
import torch
from .utils import weight_reduce_loss
from ..builder import DISTILL_LOSSES
@DISTILL_LOSSES.register_module()
class ChannelWiseDivergence(nn.Module):
"""PyTorch version of `Channel-wise Distillation for Semantic Segmentation
<https://arxiv.o... | [
"torch.nn.AvgPool2d",
"torch.nn.LogSoftmax",
"torch.nn.Conv2d"
] | [((1021, 1072), 'torch.nn.AvgPool2d', 'nn.AvgPool2d', (['(2, 2)'], {'stride': '(2, 2)', 'padding': '(0, 0)'}), '((2, 2), stride=(2, 2), padding=(0, 0))\n', (1033, 1072), True, 'import torch.nn as nn\n'), ((1091, 1142), 'torch.nn.AvgPool2d', 'nn.AvgPool2d', (['(2, 2)'], {'stride': '(2, 2)', 'padding': '(0, 1)'}), '((2, ... |
# Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
from unittest import TestCase
import macaroonbakery.httpbakery as httpbakery
import requests
from mock import patch
from httmock import HTTMock, response, urlmatch
ID_PATH = 'http://example.com/someprotecteurl'
json_macaroon ... | [
"httmock.response",
"mock.patch",
"httmock.HTTMock",
"macaroonbakery.httpbakery.Client",
"httmock.urlmatch"
] | [((1776, 1811), 'httmock.urlmatch', 'urlmatch', ([], {'path': '""".*/someprotecteurl"""'}), "(path='.*/someprotecteurl')\n", (1784, 1811), False, 'from httmock import HTTMock, response, urlmatch\n'), ((2729, 2791), 'httmock.urlmatch', 'urlmatch', ([], {'netloc': '"""example.com:8000"""', 'path': '""".*/someprotecteurl"... |
import numpy as np
import pickle
from pathlib import Path
import sys
import pyvista as pv
# Finding the sim root directory
cwd = Path.cwd()
for dirname in tuple(cwd.parents):
if dirname.name == '3D-CG':
sim_root_dir = dirname
continue
sys.path.append(str(sim_root_dir.joinpath('util')))
sys.path.ap... | [
"helper.interpolate_high_order",
"pathlib.Path.cwd",
"helper.reshape_field",
"pickle.load",
"viz.visualize",
"numpy.concatenate",
"pyvista.read"
] | [((130, 140), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (138, 140), False, 'from pathlib import Path\n'), ((809, 847), 'pyvista.read', 'pv.read', (['"""./fem_solutions/d8/flow.vtu"""'], {}), "('./fem_solutions/d8/flow.vtu')\n", (816, 847), True, 'import pyvista as pv\n'), ((1268, 1334), 'helper.reshape_field', ... |
import json
import pathlib
import shutil
from typing import Text
from notebook.notebookapp import NotebookApp
from pytest import fixture
from tornado.queues import Queue
# local imports
from jupyter_lsp import LanguageServerManager
from jupyter_lsp.handlers import LanguageServersHandler, LanguageServerWebSocketHandle... | [
"jupyter_lsp.LanguageServerManager",
"shutil.which",
"tornado.queues.Queue",
"pathlib.Path"
] | [((874, 897), 'jupyter_lsp.LanguageServerManager', 'LanguageServerManager', ([], {}), '()\n', (895, 897), False, 'from jupyter_lsp import LanguageServerManager\n'), ((2049, 2056), 'tornado.queues.Queue', 'Queue', ([], {}), '()\n', (2054, 2056), False, 'from tornado.queues import Queue\n'), ((750, 767), 'shutil.which', ... |
import base64
import os
import arrow
import httpx
import streamlit as st
import sweat
from bokeh.models.widgets import Div
import pandas as pd
import datetime
APP_URL = os.environ["APP_URL"]
STRAVA_CLIENT_ID = os.environ["STRAVA_CLIENT_ID"]
STRAVA_CLIENT_SECRET = os.environ["STRAVA_CLIENT_SECRET"]
STRAVA_AUTHORIZATI... | [
"base64.b64encode",
"bokeh.models.widgets.Div",
"sweat.read_strava",
"streamlit.empty",
"streamlit.cache",
"streamlit.experimental_get_query_params",
"httpx.get",
"streamlit.stop",
"pandas.DataFrame",
"streamlit.columns",
"streamlit.markdown",
"streamlit.write",
"streamlit.selectbox",
"htt... | [((502, 530), 'streamlit.cache', 'st.cache', ([], {'show_spinner': '(False)'}), '(show_spinner=False)\n', (510, 530), True, 'import streamlit as st\n'), ((2640, 2694), 'streamlit.cache', 'st.cache', ([], {'show_spinner': '(False)', 'suppress_st_warning': '(True)'}), '(show_spinner=False, suppress_st_warning=True)\n', (... |
# -*- coding: utf-8 -*-
# Adapted from lstm_text_generation.py in keras/examples
from __future__ import print_function
from keras.layers.recurrent import SimpleRNN
from keras.models import Sequential
from keras.layers import Dense, Activation
import numpy as np
INPUT_FILE = "../data/alice_in_wonderland.txt"
# extract... | [
"numpy.argmax",
"keras.models.Sequential",
"keras.layers.recurrent.SimpleRNN",
"numpy.zeros",
"keras.layers.Activation",
"keras.layers.Dense"
] | [((2520, 2532), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2530, 2532), False, 'from keras.models import Sequential\n'), ((2543, 2638), 'keras.layers.recurrent.SimpleRNN', 'SimpleRNN', (['HIDDEN_SIZE'], {'return_sequences': '(False)', 'input_shape': '(SEQLEN, nb_chars)', 'unroll': '(True)'}), '(HIDDEN_... |
from moabb.datasets import utils
import unittest
class Test_Utils(unittest.TestCase):
def test_channel_intersection_fun(self):
print(utils.find_intersecting_channels(
[d() for d in utils.dataset_list])[0])
def test_dataset_search_fun(self):
print([type(i).__name__ for i in utils.... | [
"unittest.main",
"moabb.datasets.utils.dataset_search"
] | [((1972, 1987), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1985, 1987), False, 'import unittest\n'), ((504, 601), 'moabb.datasets.utils.dataset_search', 'utils.dataset_search', (['"""imagery"""'], {'events': "['right_hand', 'left_hand', 'feet', 'tongue', 'rest']"}), "('imagery', events=['right_hand', 'left_ha... |
import sublime, sublimeplugin
import functools
import sys
class GotoSymbolCommand(sublimeplugin.TextCommand):
def gotoRegion(self, view, regions, index):
view.sel().clear()
view.sel().add(regions[index])
view.show(view.sel(), True)
def run(self, view, args):
pt = view.sel()[0].... | [
"sublime.statusMessage",
"functools.partial"
] | [((401, 436), 'sublime.statusMessage', 'sublime.statusMessage', (['"""No symbols"""'], {}), "('No symbols')\n", (422, 436), False, 'import sublime, sublimeplugin\n'), ((996, 1045), 'functools.partial', 'functools.partial', (['self.gotoRegion', 'view', 'regions'], {}), '(self.gotoRegion, view, regions)\n', (1013, 1045),... |
from server.rest.endpoint import Endpoint
from server.rest.invalidusage import InvalidUsage
from server.rest.response import Response
from server.utils import Permissions
class RestEndpoint(Endpoint):
def __init__(self, server):
super().__init__()
self.server = server
self.path = '/users/{uid}'
self.types = ... | [
"server.rest.invalidusage.InvalidUsage",
"server.rest.response.Response"
] | [((883, 900), 'server.rest.invalidusage.InvalidUsage', 'InvalidUsage', (['(401)'], {}), '(401)\n', (895, 900), False, 'from server.rest.invalidusage import InvalidUsage\n'), ((1721, 1756), 'server.rest.invalidusage.InvalidUsage', 'InvalidUsage', (['(404)', '"""User not found"""'], {}), "(404, 'User not found')\n", (173... |
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.hood import ZoneUtil
import random
LOADING_SCREEN_SORT_INDEX = 4000
class ToontownLoadingScreen:
defaultTex = 'phase_3.5/maps/loading/defaul... | [
"toontown.toon.Toon.Toon",
"random.choice",
"toontown.toonbase.ToontownGlobals.getSignFont",
"toontown.hood.ZoneUtil.getBranchZone",
"toontown.toonbase.TTLocalizer.TipDict.get"
] | [((4485, 4515), 'toontown.hood.ZoneUtil.getBranchZone', 'ZoneUtil.getBranchZone', (['zoneId'], {}), '(zoneId)\n', (4507, 4515), False, 'from toontown.hood import ZoneUtil\n'), ((2973, 3002), 'toontown.toonbase.ToontownGlobals.getSignFont', 'ToontownGlobals.getSignFont', ([], {}), '()\n', (3000, 3002), False, 'from toon... |
import pytest
from django.urls import reverse
from logs.models import ImportBatch
from test_fixtures.entities.credentials import CredentialsFactory
from test_fixtures.entities.fetchattempts import FetchAttemptFactory
from test_fixtures.entities.logs import ManualDataUploadFactory, ImportBatchFullFactory
from test_fix... | [
"logs.models.ImportBatch.objects.count",
"logs.models.ImportBatch.objects.all",
"test_fixtures.entities.logs.ImportBatchFullFactory",
"django.urls.reverse",
"pytest.fixture",
"test_fixtures.entities.fetchattempts.FetchAttemptFactory"
] | [((652, 682), 'django.urls.reverse', 'reverse', (['"""import-batch-lookup"""'], {}), "('import-batch-lookup')\n", (659, 682), False, 'from django.urls import reverse\n'), ((699, 728), 'django.urls.reverse', 'reverse', (['"""import-batch-purge"""'], {}), "('import-batch-purge')\n", (706, 728), False, 'from django.urls i... |
"""
Versão inicial do ChatBot
Robô para atendimento de um delivery de lanchos.
Modelo criado para aprendizagem e testes.
"""
import pandas as pd
tabelalanches = pd.read_excel('cardapio.xlsx', sheet_name=0, index_col=0).to_dict() # tabela dos lanches
tabelaporcoes = pd.read_excel('cardapio.xlsx', sheet_name=1, index_... | [
"pandas.read_excel"
] | [((163, 220), 'pandas.read_excel', 'pd.read_excel', (['"""cardapio.xlsx"""'], {'sheet_name': '(0)', 'index_col': '(0)'}), "('cardapio.xlsx', sheet_name=0, index_col=0)\n", (176, 220), True, 'import pandas as pd\n'), ((269, 326), 'pandas.read_excel', 'pd.read_excel', (['"""cardapio.xlsx"""'], {'sheet_name': '(1)', 'inde... |
""" 卷积神经网络训练MNIST """
#%%
# 准备工作
# 定义常量
import os
import shutil
import time
dataPath = 'MNIST_data'
modelSavePath = 'MNIST_conv'
modelCkpPath = os.path.join(modelSavePath, 'conv')
modelMetaFile = modelCkpPath + ".meta"
batchSize = 50
trainSteps = 500
logPeriod = 100
savePeriod = 1000
startStep = 0
# 读取数据
from tensorfl... | [
"os.path.exists",
"tensorflow.summary.merge_all",
"tensorflow.Session",
"tensorflow.train.Saver",
"os.path.join",
"ls05_mnist.build_graph",
"tensorflow.global_variables_initializer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.train.import_meta_graph",
"os.mkdir",
... | [((144, 179), 'os.path.join', 'os.path.join', (['modelSavePath', '"""conv"""'], {}), "(modelSavePath, 'conv')\n", (156, 179), False, 'import os\n'), ((374, 423), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['dataPath'], {'one_hot': '(True)'}), '(dataPath, one_hot=True)... |
from sqlalchemy import MetaData
from sqlalchemy.orm.session import sessionmaker
from academics.model import Journal, ScopusPublication
meta = MetaData()
from sqlalchemy import MetaData
meta = MetaData()
def upgrade(migrate_engine):
conn = migrate_engine.connect()
conn.execute('''
UPDATE scopus_pub... | [
"sqlalchemy.MetaData"
] | [((144, 154), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (152, 154), False, 'from sqlalchemy import MetaData\n'), ((196, 206), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (204, 206), False, 'from sqlalchemy import MetaData\n')] |
import json
from collections import Iterator
from os.path import join
from elasticsearch import Elasticsearch
from examples.imdb.conf import ES_HOST, ES_USE_AUTH, ES_PASSWORD, ES_USER, DATA_DIR
from pandagg.index import DeclarativeIndex, Action
from pandagg.mappings import Keyword, Text, Float, Nested, Integer
class... | [
"json.loads",
"pandagg.mappings.Integer",
"elasticsearch.Elasticsearch",
"os.path.join",
"pandagg.mappings.Keyword",
"pandagg.mappings.Float"
] | [((1889, 1919), 'elasticsearch.Elasticsearch', 'Elasticsearch', ([], {}), '(**client_kwargs)\n', (1902, 1919), False, 'from elasticsearch import Elasticsearch\n'), ((458, 467), 'pandagg.mappings.Keyword', 'Keyword', ([], {}), '()\n', (465, 467), False, 'from pandagg.mappings import Keyword, Text, Float, Nested, Integer... |
import sys
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-15s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M', stream=sys.stderr)
| [
"logging.basicConfig"
] | [((27, 181), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s %(name)-15s %(levelname)-8s %(message)s"""', 'datefmt': '"""%m-%d %H:%M"""', 'stream': 'sys.stderr'}), "(level=logging.DEBUG, format=\n '%(asctime)s %(name)-15s %(levelname)-8s %(message)s', datefmt=\... |