code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Use apscheduler to run a daily job to refresh the source tables.
"""
import random
import sys
import time
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from django.conf import settings
from django_apscheduler.jobstores import (
DjangoJobStore, register_events, register_job
)
... | [
"pytz.timezone",
"django_apscheduler.jobstores.register_events",
"sys.stdout.flush",
"django_apscheduler.jobstores.DjangoJobStore",
"apscheduler.schedulers.background.BackgroundScheduler",
"sys.stdout.write"
] | [((363, 384), 'apscheduler.schedulers.background.BackgroundScheduler', 'BackgroundScheduler', ([], {}), '()\n', (382, 384), False, 'from apscheduler.schedulers.background import BackgroundScheduler\n'), ((1092, 1118), 'django_apscheduler.jobstores.register_events', 'register_events', (['scheduler'], {}), '(scheduler)\n... |
import re
from config import es
def _highlight(response_es):
# 高亮展示es搜索结果
article_list = response_es["hits"]["hits"]
for article in article_list:
source = article["_source"]
highlight = article["highlight"]
for key in highlight.keys():
item = highlight[key][0]
... | [
"config.es.search",
"re.match"
] | [((2941, 2996), 'config.es.search', 'es.search', ([], {'index': '"""hot_words"""', 'doc_type': '"""doc"""', 'body': 'body'}), "(index='hot_words', doc_type='doc', body=body)\n", (2950, 2996), False, 'from config import es\n'), ((3228, 3283), 'config.es.search', 'es.search', ([], {'index': '"""hot_words"""', 'doc_type':... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.flatpages.models import FlatPage
from django.contrib.postgres.fields import JSONField
from mptt.models import MPTTModel, T... | [
"django.db.models.Manager",
"django.contrib.postgres.fields.JSONField",
"django.db.models.TextField",
"mptt.managers.TreeManager",
"django.db.models.ForeignKey",
"django.utils.translation.ugettext_lazy",
"reversion.revisions.set_comment",
"mptt.models.TreeForeignKey",
"django.db.models.ImageField",
... | [((742, 787), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(120)', 'unique': '(True)'}), '(max_length=120, unique=True)\n', (758, 787), False, 'from django.db import models\n'), ((1589, 1628), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_no... |
"""Logical optimization, composition, and transformation rules.
"""
import json
from pyfpm.matcher import Matcher
from .. import util
from .. import operators as _op
from ..operators import PhysicalOperator # required for the physical planning rules to compile
from .symbols import *
__pop__ = PhysicalOperator # this... | [
"json.loads"
] | [((5831, 5848), 'json.loads', 'json.loads', (['child'], {}), '(child)\n', (5841, 5848), False, 'import json\n')] |
from typing import List
import numpy as np
import pandas as pd
from TrainInfoProcess import TrainNumberInfo, originStations
def TrainNumberInfosExtraction(database: pd.DataFrame) -> List[TrainNumberInfo]:
"""提取列车信息
Args:
database (pd.DataFrame): 经初始化后的原始数据集
Returns:
List[TrainNumberInfo... | [
"TrainInfoProcess.TrainNumberInfo"
] | [((592, 648), 'TrainInfoProcess.TrainNumberInfo', 'TrainNumberInfo', (['trainNumber', 'originStation', 'destination'], {}), '(trainNumber, originStation, destination)\n', (607, 648), False, 'from TrainInfoProcess import TrainNumberInfo, originStations\n')] |
import logging
import os
from datetime import datetime
class Watcher:
def __init__(self, store, commander):
self.store = store
self.commander = commander
self.prevWorkMinute = -1
self.cryptoErrorState = False
def worker(self):
nowMinute = datetime.now().minute
i... | [
"datetime.datetime.now",
"logging.info",
"logging.error",
"logging.debug"
] | [((289, 303), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (301, 303), False, 'from datetime import datetime\n'), ((368, 424), 'logging.debug', 'logging.debug', (['"""Watcher: waiting for the next minute..."""'], {}), "('Watcher: waiting for the next minute...')\n", (381, 424), False, 'import logging\n'),... |
# Generated by Django 2.1.1 on 2018-11-10 07:27
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('IoT_DataMgmt', '0022_equipmentinstancedatafielddailyaggregate'),
]
oper... | [
"django.db.migrations.DeleteModel",
"django.db.models.DateField",
"django.db.models.FloatField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.migrations.RemoveField"
] | [((1946, 2057), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""equipmentinstancedatafielddailyaggregate"""', 'name': '"""equipment_data_field"""'}), "(model_name=\n 'equipmentinstancedatafielddailyaggregate', name='equipment_data_field')\n", (1968, 2057), False, 'from django.db... |
"""
Version 1.1.2
"""
from .Tokenizer import DDTokenizer
from sklearn import preprocessing
from .DDModelExceptions import *
from tensorflow.keras import backend
from .Models import Models
from .Parser import Parser
import tensorflow as tf
import pandas as pd
import numpy as np
import keras
import time
import os
import... | [
"pandas.Series",
"keras.backend.one_hot",
"numpy.reshape",
"keras.callbacks.History",
"tensorflow.keras.backend.count_params",
"tensorflow.keras.optimizers.Adam",
"sklearn.preprocessing.minmax_scale",
"time.time",
"warnings.filterwarnings"
] | [((330, 363), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (353, 363), False, 'import warnings\n'), ((3905, 3939), 'numpy.reshape', 'np.reshape', (['train_x', 'shape_train_x'], {}), '(train_x, shape_train_x)\n', (3915, 3939), True, 'import numpy as np\n'), ((3968, 4013),... |
#!/usr/bin/env python3
# pyEZmock.py: this file is part of the pyEZmock package.
#
# pyEZmock: Python wrapper of Effective Zel'dovich approximation mock (EZmock).
#
# Github repository:
# https://github.com/cheng-zhao/pyEZmock
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charg... | [
"copy.deepcopy",
"os.remove",
"subprocess.Popen",
"os.path.isdir",
"cosmoEZ.flatLCDM",
"os.mkdir",
"glob.glob",
"numpy.ceil",
"matplotlib.pyplot.savefig",
"os.rename",
"os.access",
"os.path.isfile",
"os.path.abspath",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.figure",
"js... | [((18415, 18441), 'copy.deepcopy', 'copy.deepcopy', (['self._param'], {}), '(self._param)\n', (18428, 18441), False, 'import copy\n'), ((20269, 20291), 'os.path.isfile', 'os.path.isfile', (['script'], {}), '(script)\n', (20283, 20291), False, 'import os\n'), ((26004, 26036), 'matplotlib.pyplot.figure', 'plt.figure', ([... |
from enum import IntEnum
import fnmatch
import os
from pathlib import Path
from typing import List
class DataTypes(IntEnum):
"""Constants for data types."""
DATASET = 0
CHARSET = 1
PALETTE = 2
DICOMDIR = 3
class DataStore:
"""Interface to pydicom-data data storage.
Attributes
-----... | [
"os.fspath",
"pathlib.Path"
] | [((1345, 1366), 'os.fspath', 'os.fspath', (['matches[0]'], {}), '(matches[0])\n', (1354, 1366), False, 'import os\n'), ((2036, 2048), 'os.fspath', 'os.fspath', (['p'], {}), '(p)\n', (2045, 2048), False, 'import os\n'), ((511, 525), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (515, 525), False, 'from pat... |
import json
import os
from typing import Any, Callable, Dict, List, Optional
import hpc.autoscale.hpclogging as logging
from hpc.autoscale import hpctypes as ht
RESOURCE_FILE = os.path.join(os.path.dirname(__file__), "vm_sizes.json")
VM_SIZES: Dict[str, Dict] = {}
def _inititialize_impl() -> None:
global VM_SIZ... | [
"json.load",
"os.path.dirname",
"hpc.autoscale.clilib.ShellDict"
] | [((192, 217), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (207, 217), False, 'import os\n'), ((2282, 2312), 'hpc.autoscale.clilib.ShellDict', 'ShellDict', (['self.__capabilities'], {}), '(self.__capabilities)\n', (2291, 2312), False, 'from hpc.autoscale.clilib import ShellDict\n'), ((428, ... |
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics.classification import accuracy_score, f1_score
def prediction_score(train_X, train_y, test_X, test_y, metric, model):
# if the train labels are always the same
value... | [
"numpy.ones_like",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.classification.f1_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.metrics.classification.accuracy_score"
] | [((1018, 1045), 'sklearn.metrics.classification.f1_score', 'f1_score', (['test_y', 'test_pred'], {}), '(test_y, test_pred)\n', (1026, 1045), False, 'from sklearn.metrics.classification import accuracy_score, f1_score\n'), ((479, 499), 'numpy.ones_like', 'np.ones_like', (['test_y'], {}), '(test_y)\n', (491, 499), True, ... |
# -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... | [
"unittest.TestSuite",
"unittest.TextTestRunner",
"os.path.join",
"nose.tools.assert_true",
"os.path.realpath",
"mock.call",
"nose.tools.assert_false",
"mock.MagicMock"
] | [((1307, 1327), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (1325, 1327), False, 'import unittest\n'), ((1567, 1583), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (1581, 1583), False, 'import mock\n'), ((1859, 1889), 'nose.tools.assert_true', 'assert_true', (['test._test_passed'], {}), '(test... |
import os
from django.db import models
from django.db.models.signals import post_delete
from django.dispatch import receiver
from django.utils.crypto import get_random_string
def upload_obfuscated_filename(instance, orig_filename):
_filename, _ext = os.path.splitext(orig_filename)
_fn = get_random_string(len... | [
"django.db.models.EmailField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"os.path.splitext",
"django.db.models.BooleanField",
"django.utils.crypto.get_random_string",
"django.db.models.ImageField",
"django.dispatch.r... | [((6036, 6073), 'django.dispatch.receiver', 'receiver', (['post_delete'], {'sender': 'Picture'}), '(post_delete, sender=Picture)\n', (6044, 6073), False, 'from django.dispatch import receiver\n'), ((257, 288), 'os.path.splitext', 'os.path.splitext', (['orig_filename'], {}), '(orig_filename)\n', (273, 288), False, 'impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103
################################################################################
# Copyright (c) 2006-2017 <NAME>.
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License whic... | [
"weakref.WeakValueDictionary",
"builtins.id"
] | [((2522, 2551), 'weakref.WeakValueDictionary', 'weakref.WeakValueDictionary', ([], {}), '()\n', (2549, 2551), False, 'import weakref\n'), ((5345, 5362), 'builtins.id', 'builtins.id', (['self'], {}), '(self)\n', (5356, 5362), False, 'import builtins\n')] |
from unicodedata import name
from flask import Flask
app=Flask(__name__)
@app.route('/',defaults={'name':'World'})
@app.route('/<name>')
def index(name):
return "Hello"+" "+ name +"!"
if __name__== "__main__" :
app.debug=False
app.run()
| [
"flask.Flask"
] | [((57, 72), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'from flask import Flask\n')] |
# Copyright (C) 2021 DB Systel GmbH.
#
# 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 w... | [
"coreml_converter.pytorch_to_coreml_converter.PytorchToCoreMLConverter",
"argparse.ArgumentParser"
] | [((1091, 1107), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1105, 1107), False, 'from argparse import ArgumentParser\n'), ((2340, 2487), 'coreml_converter.pytorch_to_coreml_converter.PytorchToCoreMLConverter', 'PytorchToCoreMLConverter', (['opt.model_input_path', 'opt.model_output_directory', 'opt.m... |
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import errno
import logging
import sys
from scout_apm.core.agent.manager import (
CoreAgentManager,
get_socket_path,
parse_manifest,
)
from scout_apm.core.config import scout_config
from tests.compat import m... | [
"tests.compat.mock.patch",
"scout_apm.core.config.scout_config.reset_all",
"scout_apm.core.agent.manager.CoreAgentManager",
"scout_apm.core.agent.manager.parse_manifest",
"scout_apm.core.config.scout_config.set",
"scout_apm.core.agent.manager.get_socket_path"
] | [((407, 463), 'scout_apm.core.config.scout_config.set', 'scout_config.set', ([], {'core_agent_socket_path': '"""/tmp/foo.sock"""'}), "(core_agent_socket_path='/tmp/foo.sock')\n", (423, 463), False, 'from scout_apm.core.config import scout_config\n'), ((687, 750), 'scout_apm.core.config.scout_config.set', 'scout_config.... |
#!/usr/bin/env python
from flask import *
from actor import get_actors_list
from actor import create_actor
from actor import modify_actor
from movies import get_movies_list
from movies import create_movie
from movies import modify_movie
import Queue as queue
import hollywood
data = hollywood.get_json_data()
app = Flas... | [
"movies.get_movies_list",
"Queue.Queue",
"actor.get_actors_list",
"hollywood.get_json_data"
] | [((284, 309), 'hollywood.get_json_data', 'hollywood.get_json_data', ([], {}), '()\n', (307, 309), False, 'import hollywood\n'), ((2751, 2764), 'Queue.Queue', 'queue.Queue', ([], {}), '()\n', (2762, 2764), True, 'import Queue as queue\n'), ((3007, 3020), 'Queue.Queue', 'queue.Queue', ([], {}), '()\n', (3018, 3020), True... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This is a sample plugin for Angular applications using ui-routing.
Now handles some React router cases too! Yay efficiency!
It's not going to find everything!
"""
import re
def get_ext():
"""Returns the file extensions associated with this plugin"""
... | [
"re.compile"
] | [((487, 520), 're.compile', 're.compile', (['"""(url:\\\\s*\')(/.*)(\')"""'], {}), '("(url:\\\\s*\')(/.*)(\')")\n', (497, 520), False, 'import re\n'), ((538, 607), 're.compile', 're.compile', (['"""(Route[\\\\s]+path[\\\\s]?=[\'\\\\"])([^\'\\\\"\\\\s]+)([\'\\\\"]+)"""'], {}), '(\'(Route[\\\\s]+path[\\\\s]?=[\\\'\\\\"])... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [
"warnings.warn"
] | [((1024, 1218), 'warnings.warn', 'warnings.warn', (['"""IBMEstimator class is deprecated and will be removed in a future release. You can now use qiskit_ibm_runtime.Estimator class instead."""', 'DeprecationWarning'], {'stacklevel': '(2)'}), "(\n 'IBMEstimator class is deprecated and will be removed in a future rele... |
from bs4 import BeautifulSoup
import requests
from retrying import retry
import pandas as pd
import re
ranking_page = "https://firstcycling.com/ranking.php?k=fc&rank={}&y={}&page={}"
def scrape_top(args):
year, page, mens = args
gender = "el" if mens else "wel"
with requests.get(ranking_page.format(gende... | [
"re.compile",
"requests.get",
"bs4.BeautifulSoup",
"sys.exc_info",
"retrying.retry",
"re.search"
] | [((497, 529), 'retrying.retry', 'retry', ([], {'stop_max_attempt_number': '(3)'}), '(stop_max_attempt_number=3)\n', (502, 529), False, 'from retrying import retry\n'), ((1051, 1083), 'retrying.retry', 'retry', ([], {'stop_max_attempt_number': '(3)'}), '(stop_max_attempt_number=3)\n', (1056, 1083), False, 'from retrying... |
#! /usr/bin/env python3
import os
from datetime import timedelta
import flask
from module.Interface import *
app = flask.Flask(__name__, template_folder="./static/html")
app.config['SECRET_KEY'] = os.urandom(24)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(minutes=30)
@app.route('/', methods=["GET", "POST"])... | [
"flask.redirect",
"os.urandom",
"datetime.timedelta",
"flask.Flask"
] | [((117, 171), 'flask.Flask', 'flask.Flask', (['__name__'], {'template_folder': '"""./static/html"""'}), "(__name__, template_folder='./static/html')\n", (128, 171), False, 'import flask\n'), ((199, 213), 'os.urandom', 'os.urandom', (['(24)'], {}), '(24)\n', (209, 213), False, 'import os\n'), ((257, 278), 'datetime.time... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: feast/specs/FeatureGroupSpec.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fro... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((482, 508), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (506, 508), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((3279, 3616), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""tags"""', 'full_nam... |
# -*- coding: utf-8 -*-
# Requires PIL (pillow) and NumPy
# Copyright (C) <NAME>, 2016
# License: MIT
import os
import json
import codecs
from PIL import Image
from io import BytesIO
import numpy as np
class Hexagram(object):
"""
Generate and write a hexagram to PNG
Input is an iterable of six binary di... | [
"os.path.exists",
"PIL.Image.fromarray",
"numpy.ones",
"os.makedirs",
"os.path.join",
"io.BytesIO",
"numpy.zeros",
"numpy.vstack",
"codecs.open"
] | [((2132, 2152), 'numpy.vstack', 'np.vstack', (['container'], {}), '(container)\n', (2141, 2152), True, 'import numpy as np\n'), ((2440, 2471), 'PIL.Image.fromarray', 'Image.fromarray', (['self.generated'], {}), '(self.generated)\n', (2455, 2471), False, 'from PIL import Image\n'), ((2629, 2676), 'os.path.join', 'os.pat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Front end window
import tkinter as tk
from tkinter import filedialog
# System and File access
import os
"""
oneSpotApp.py is a simple one click service that allows you to deploy all
the applications that you wish to, through a one time setup process.
"""
# Owned
__author_... | [
"tkinter.Button",
"os.path.isfile",
"tkinter.Tk.__init__",
"tkinter.Label",
"os.startfile",
"tkinter.Frame",
"tkinter.filedialog.askopenfilename"
] | [((455, 481), 'os.path.isfile', 'os.path.isfile', (['"""save.txt"""'], {}), "('save.txt')\n", (469, 481), False, 'import os\n'), ((742, 779), 'tkinter.Tk.__init__', 'tk.Tk.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (756, 779), True, 'import tkinter as tk\n'), ((928, 979), 'tkinter.Frame', 'tk.Fram... |
from __future__ import absolute_import
from storages.backends.s3boto import S3BotoStorage
MediaS3BotoStorage = lambda: S3BotoStorage(bucket='halalar-media')
StaticS3BotoStorage = lambda: S3BotoStorage(bucket='halalar') | [
"storages.backends.s3boto.S3BotoStorage"
] | [((121, 158), 'storages.backends.s3boto.S3BotoStorage', 'S3BotoStorage', ([], {'bucket': '"""halalar-media"""'}), "(bucket='halalar-media')\n", (134, 158), False, 'from storages.backends.s3boto import S3BotoStorage\n'), ((190, 221), 'storages.backends.s3boto.S3BotoStorage', 'S3BotoStorage', ([], {'bucket': '"""halalar"... |
import numpy as np
class BriansBrain:
def apply(self, current, neighbors):
result = np.zeros_like(current)
sum_one = np.zeros_like(current)
for key in neighbors:
sum_one += (neighbors[key]==1).astype(int)
current_state = current.copy()
zero = (current_state ==0)... | [
"numpy.zeros_like",
"numpy.logical_and"
] | [((97, 119), 'numpy.zeros_like', 'np.zeros_like', (['current'], {}), '(current)\n', (110, 119), True, 'import numpy as np\n'), ((138, 160), 'numpy.zeros_like', 'np.zeros_like', (['current'], {}), '(current)\n', (151, 160), True, 'import numpy as np\n'), ((490, 517), 'numpy.logical_and', 'np.logical_and', (['zero', 'two... |
#!/usr/bin/env python3
import pyo3_mixed
def test_get_42():
assert pyo3_mixed.get_42() == 42
| [
"pyo3_mixed.get_42"
] | [((74, 93), 'pyo3_mixed.get_42', 'pyo3_mixed.get_42', ([], {}), '()\n', (91, 93), False, 'import pyo3_mixed\n')] |
# -*- coding: utf-8 -*-
# 代理IP池程序入口
import re
import time
from threading import Thread
import schedule
import config
from crawler import get_all_proxies
from process import DataProcessor
from validate import validate, concat_proxy
# 数据处理器
dp = DataProcessor()
def crawler_task():
for item in get_all_proxies():... | [
"re.split",
"time.ctime",
"validate.concat_proxy",
"schedule.run_pending",
"process.DataProcessor",
"time.sleep",
"schedule.every",
"validate.validate",
"threading.Thread",
"crawler.get_all_proxies"
] | [((248, 263), 'process.DataProcessor', 'DataProcessor', ([], {}), '()\n', (261, 263), False, 'from process import DataProcessor\n'), ((302, 319), 'crawler.get_all_proxies', 'get_all_proxies', ([], {}), '()\n', (317, 319), False, 'from crawler import get_all_proxies\n'), ((1205, 1253), 'threading.Thread', 'Thread', ([],... |
##########
# Determine the Lowest Common Ancestor (LCA) of a set of taxonomic IDs
##########
import pandas as pd
import numpy as np
from ete3 import NCBITaxa
import boto3
import tempfile
import subprocess
import os
import io
import re
import time
import json
import pdb, traceback, sys
# NCBI Entrez functions
from Bi... | [
"pandas.Series",
"json.loads",
"os.listdir",
"boto3.client",
"pandas.read_csv",
"pandas.merge",
"time.sleep",
"os.path.normpath",
"boto3.resource",
"ete3.NCBITaxa",
"os.unlink",
"pdb.set_trace",
"tempfile.NamedTemporaryFile",
"os.system",
"io.StringIO",
"time.time",
"re.search"
] | [((417, 427), 'ete3.NCBITaxa', 'NCBITaxa', ([], {}), '()\n', (425, 427), False, 'from ete3 import NCBITaxa\n'), ((534, 552), 'ete3.NCBITaxa', 'NCBITaxa', ([], {'dbfile': 'x'}), '(dbfile=x)\n', (542, 552), False, 'from ete3 import NCBITaxa\n'), ((1080, 1095), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1090... |
import numpy as np
def count(LM):
co = 0
if LM.shape[0]>2:
index = np.argwhere(LM==1)[:5]
for it in index:
lm_ = np.delete(LM,it[0],0)
lm_ = np.delete(lm_,it[1]-1,0)
lm_ = np.delete(lm_,it[0],1)
lm = np.delete(lm_,it[1]-1,1)
L... | [
"numpy.array",
"numpy.argwhere",
"numpy.delete"
] | [((1208, 1221), 'numpy.array', 'np.array', (['LMn'], {}), '(LMn)\n', (1216, 1221), True, 'import numpy as np\n'), ((84, 104), 'numpy.argwhere', 'np.argwhere', (['(LM == 1)'], {}), '(LM == 1)\n', (95, 104), True, 'import numpy as np\n'), ((150, 173), 'numpy.delete', 'np.delete', (['LM', 'it[0]', '(0)'], {}), '(LM, it[0]... |
#!/opt/anaconda/envs/env_hazard_index/bin/python
import atexit
import cioppy
ciop = cioppy.Cioppy()
import xarray as xr
import numpy as np
import pandas as pd
import geopandas as gpd
import datetime
import sys
import gdal
from urllib.parse import urlparse
import os
SUCCESS = 0
ERR_RESOLUTION = 10
ERR_STAGEIN = 20
ERR... | [
"gdal.GetDriverByName",
"gdal.ParseCommandLine",
"pandas.to_datetime",
"os.remove",
"gdal.SetConfigOption",
"numpy.exp",
"numpy.empty",
"geopandas.GeoDataFrame",
"atexit.register",
"numpy.ceil",
"gdal.Translate",
"pandas.DatetimeIndex",
"numpy.isnan",
"numpy.vectorize",
"gdal.Open",
"u... | [((85, 100), 'cioppy.Cioppy', 'cioppy.Cioppy', ([], {}), '()\n', (98, 100), False, 'import cioppy\n'), ((854, 873), 'urllib.parse.urlparse', 'urlparse', (['enclosure'], {}), '(enclosure)\n', (862, 873), False, 'from urllib.parse import urlparse\n'), ((2597, 2642), 'numpy.vectorize', 'np.vectorize', (['remove_nan'], {'o... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.hvac_templates import HvactemplateSystemPackagedVav
log = logging.getLogger(__name__)
class TestHvactemplateSystemPackagedVav(unittest.TestCase):
def setUp(self):
s... | [
"logging.getLogger",
"pyidf.hvac_templates.HvactemplateSystemPackagedVav",
"pyidf.idf.IDF",
"tempfile.mkstemp",
"os.remove"
] | [((200, 227), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import logging\n'), ((340, 358), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (356, 358), False, 'import tempfile\n'), ((392, 412), 'os.remove', 'os.remove', (['self.path'], {}), '(self.path)\n',... |
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.contrib.operators.gcs_list_operator import GoogleCloudStorageListOperator
from airflow.models import Varia... | [
"datetime.datetime",
"airflow.models.Variable.get",
"json.loads",
"os.listdir",
"airflow.operators.python_operator.PythonOperator",
"airflow.operators.dummy_operator.DummyOperator",
"json.dumps",
"airflow.operators.bash_operator.BashOperator"
] | [((659, 704), 'airflow.operators.dummy_operator.DummyOperator', 'DummyOperator', ([], {'task_id': '"""kick_off_dynamic_dag"""'}), "(task_id='kick_off_dynamic_dag')\n", (672, 704), False, 'from airflow.operators.dummy_operator import DummyOperator\n'), ((1116, 1213), 'airflow.operators.python_operator.PythonOperator', '... |
import numpy as np
import sys
BEGIN_DEBUG=True
def log(string,filename="log.txt"):
np.set_printoptions(threshold='nan')
if BEGIN_DEBUG == True:
output = sys.stdout
outputfile = open("E:\\"+filename, "a")
sys.stdout = outputfile
print("------------------------");
print(s... | [
"numpy.set_printoptions"
] | [((89, 125), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '"""nan"""'}), "(threshold='nan')\n", (108, 125), True, 'import numpy as np\n')] |
# ------------------------------------------------------------
# imaparchiver/mailbox.py
#
# A single mailbox
#
# This file is part of imap-archiver.
# See the LICENSE file for the software license.
# (C) Copyright 2015-2019, <NAME>, <EMAIL>
# ------------------------------------------------------------
import email.u... | [
"re.match",
"re.compile"
] | [((1003, 1070), 're.compile', 're.compile', (['"""\\\\((?P<flags>.*?)\\\\) "(?P<delimiter>.*)" (?P<name>.*)"""'], {}), '(\'\\\\((?P<flags>.*?)\\\\) "(?P<delimiter>.*)" (?P<name>.*)\')\n', (1013, 1070), False, 'import re\n'), ((1173, 1207), 're.match', 're.match', (['""".*HasChildren.*"""', 'flags'], {}), "('.*HasChildr... |
# ======================================================================================================================
# Fakulta informacnich technologii VUT v Brne
# Bachelor thesis
# Author: <NAME> (xbalif00)
# License: MIT
# ==========================================================================================... | [
"django.contrib.admin.site.register"
] | [((440, 468), 'django.contrib.admin.site.register', 'admin.site.register', (['Profile'], {}), '(Profile)\n', (459, 468), False, 'from django.contrib import admin\n')] |
"""
SPDX-FileCopyrightText: 2021 International Photoacoustic Standardisation Consortium (IPASC)
SPDX-FileCopyrightText: 2021 <NAME>
SPDX-FileCopyrightText: 2021 <NAME>
SPDX-License-Identifier: MIT
"""
from tests.reconstruction_algorithms import TestClassBase
from image_reconstruction.reconstruction_algorithms.back_pro... | [
"image_reconstruction.reconstruction_algorithms.back_projection.BackProjection"
] | [((714, 730), 'image_reconstruction.reconstruction_algorithms.back_projection.BackProjection', 'BackProjection', ([], {}), '()\n', (728, 730), False, 'from image_reconstruction.reconstruction_algorithms.back_projection import BackProjection\n')] |
# coding: utf-8
"""
Domain Group API V1
Provides public access to Domain's microservices # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DomainSearchServiceV2ModelDomainSearchW... | [
"six.iteritems"
] | [((9259, 9292), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9272, 9292), False, 'import six\n')] |
from functools import wraps
from django.db import transaction
from accounts.models import User
from core.models import TelegramChat
def infuse_user():
"""
Adds user instance to args if possible.
Also creates
"""
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
... | [
"django.db.transaction.atomic",
"functools.wraps",
"accounts.models.User.objects.get_from_telegram_uid"
] | [((266, 277), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (271, 277), False, 'from functools import wraps\n'), ((405, 444), 'accounts.models.User.objects.get_from_telegram_uid', 'User.objects.get_from_telegram_uid', (['uid'], {}), '(uid)\n', (439, 444), False, 'from accounts.models import User\n'), ((508, 5... |
""" Demonstrates how to define a multivariate Gaussian Random Field,
sample a realization and plot it.
"""
import numpy as np
import torch
from meslas.means import LinearMean
from meslas.covariance.spatial_covariance_functions import Matern32
from meslas.covariance.cross_covariances import UniformMixing
from meslas.c... | [
"meslas.means.LinearMean",
"meslas.random_fields.DiscreteGRF.from_model",
"meslas.plotting.plot_grid_values",
"meslas.covariance.spatial_covariance_functions.Matern32",
"numpy.sqrt",
"numpy.array",
"torch.tensor",
"meslas.covariance.heterotopic.FactorCovariance",
"meslas.random_fields.GRF",
"mesla... | [((782, 812), 'meslas.covariance.spatial_covariance_functions.Matern32', 'Matern32', ([], {'lmbda': '(0.1)', 'sigma': '(1.0)'}), '(lmbda=0.1, sigma=1.0)\n', (790, 812), False, 'from meslas.covariance.spatial_covariance_functions import Matern32\n'), ((924, 976), 'meslas.covariance.heterotopic.FactorCovariance', 'Factor... |
import epics
import time
import pylab as P
import os
import matplotlib.pyplot as plt
import numpy
from scipy import signal
import glob
from datetime import datetime
outfname = "/tmp/data.txt"
pwelch_ratio = 8; # to set size of nperseg
def extract_data(datafp, first=0, last=0, filt=1):
cmd = "/usr/local/controls/... | [
"numpy.sqrt",
"numpy.diff",
"matplotlib.pyplot.figure",
"os.system",
"numpy.loadtxt",
"pylab.log",
"glob.glob",
"matplotlib.pyplot.show"
] | [((482, 496), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (491, 496), False, 'import os\n'), ((711, 773), 'glob.glob', 'glob.glob', (["('/data/smurf_data/%s/*/outputs/*.dat*' % '20190215')"], {}), "('/data/smurf_data/%s/*/outputs/*.dat*' % '20190215')\n", (720, 773), False, 'import glob\n'), ((1039, 1063), 'num... |
from fbapp import views
from flask_login import LoginManager
from fbapp import User
print("TEST")
if __name__ == '__main__':
views.app.run(host='0.0.0.0', port=80)
| [
"fbapp.views.app.run"
] | [((130, 168), 'fbapp.views.app.run', 'views.app.run', ([], {'host': '"""0.0.0.0"""', 'port': '(80)'}), "(host='0.0.0.0', port=80)\n", (143, 168), False, 'from fbapp import views\n')] |
"""tf.div(x, y, name = None)
解释:这个函数返回x与y逐元素相除的结果。现在已经不推荐该使用方法,推荐你使用tf.divide()
使用例子:"""
import tensorflow as tf
a = tf.constant([1, 2])
b = tf.constant(2)
c = tf.div(a, b)
sess = tf.Session()
print(sess.run(c)) # [0 1]
sess.close()
a0 = tf.constant([2, 4])
b0 = tf.constant([1, 2])
c0 = tf.div(a0, b0)
sess = tf.Se... | [
"tensorflow.div",
"tensorflow.Session",
"tensorflow.constant"
] | [((120, 139), 'tensorflow.constant', 'tf.constant', (['[1, 2]'], {}), '([1, 2])\n', (131, 139), True, 'import tensorflow as tf\n'), ((144, 158), 'tensorflow.constant', 'tf.constant', (['(2)'], {}), '(2)\n', (155, 158), True, 'import tensorflow as tf\n'), ((163, 175), 'tensorflow.div', 'tf.div', (['a', 'b'], {}), '(a, b... |
import json
def load_expressions():
"""
Returns the expressions_file loaded from JSON
"""
with open('../data/BotCycle/expressions.json') as expressions_file:
return json.load(expressions_file)
def load_expressions_atis():
with open('../data/atis_parsed_texts.json') as expressions_file:
... | [
"json.load"
] | [((191, 218), 'json.load', 'json.load', (['expressions_file'], {}), '(expressions_file)\n', (200, 218), False, 'import json\n'), ((333, 360), 'json.load', 'json.load', (['expressions_file'], {}), '(expressions_file)\n', (342, 360), False, 'import json\n'), ((639, 666), 'json.load', 'json.load', (['expressions_file'], {... |
import logging
import logging.config
import os
from os import path
from pathlib import Path
import yaml
logger = logging.getLogger(__name__)
def get_logging_cfg():
cfg_file = os.getenv('LOGGING_CFG', './config/logging-cfg-local.yml')
if 'LOGS_DIR' not in os.environ:
# Build paths inside the project ... | [
"logging.getLogger",
"logging.config.dictConfig",
"os.getenv",
"pathlib.Path"
] | [((115, 142), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (132, 142), False, 'import logging\n'), ((183, 241), 'os.getenv', 'os.getenv', (['"""LOGGING_CFG"""', '"""./config/logging-cfg-local.yml"""'], {}), "('LOGGING_CFG', './config/logging-cfg-local.yml')\n", (192, 241), False, 'impor... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from wagtail.admin.edit_handlers import FieldPanel
from areas.models.area import Area
from areas.widgets.place_widgets import PlaceChooser
class LocalCouncilDistrict(Area):
state_ref = models.ForeignKey(
'areas.State',
... | [
"wagtail.admin.edit_handlers.FieldPanel",
"django.utils.translation.ugettext_lazy",
"areas.widgets.place_widgets.PlaceChooser"
] | [((341, 351), 'django.utils.translation.ugettext_lazy', '_', (['"""State"""'], {}), "('State')\n", (342, 351), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((520, 530), 'django.utils.translation.ugettext_lazy', '_', (['"""Place"""'], {}), "('Place')\n", (521, 530), True, 'from django.utils.transl... |
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
from mlos.Mlos.SDK import MlosTelemetryAggregator
from mlos.Mlos.SDK.Utils.Clock import Clock, ClockTick
class Timer(MlosTelemetryAggregator):
""" An aggregator that responds to clock ticks.
The idea is that when a timer ru... | [
"mlos.Mlos.SDK.MlosTelemetryAggregator.register_callback"
] | [((667, 726), 'mlos.Mlos.SDK.MlosTelemetryAggregator.register_callback', 'MlosTelemetryAggregator.register_callback', (['Clock', 'ClockTick'], {}), '(Clock, ClockTick)\n', (708, 726), False, 'from mlos.Mlos.SDK import MlosTelemetryAggregator\n')] |
# class Base:
# def __init__(self,a,b=1):
# print("a:",a)
# print("b:",b)
# class A(Base):
# def __init__(self,c,d=1,**kwargs):
# super().__init__(**kwargs)
# print("c:",c)
# print("d:",d)
# a=A('c',a=2)
import argparse
import copy
import mmcv
import os
import time
imp... | [
"time.localtime",
"argparse.ArgumentParser",
"os.path.join",
"os.path.basename",
"mmcv.Config.fromfile",
"mmdet3d.utils.get_root_logger",
"os.path.abspath"
] | [((1048, 1076), 'mmcv.Config.fromfile', 'Config.fromfile', (['args.config'], {}), '(args.config)\n', (1063, 1076), False, 'from mmcv import Config, DictAction\n'), ((1363, 1405), 'os.path.join', 'osp.join', (['cfg.work_dir', 'f"""{timestamp}.log"""'], {}), "(cfg.work_dir, f'{timestamp}.log')\n", (1371, 1405), True, 'fr... |
from django.conf import settings
from django.dispatch import Signal, receiver
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from django.db.models.signals import pre_save, post_save
from django.contrib.sites.models import Site
fro... | [
"cms.models.Member",
"django.core.mail.send_mail",
"django.dispatch.Signal",
"django.core.urlresolvers.reverse",
"cms.models.ProjectMember",
"django.contrib.sites.models.Site.objects.get_current",
"django.template.loader.render_to_string"
] | [((389, 447), 'django.dispatch.Signal', 'Signal', ([], {'providing_args': "['user', 'group', 'classification']"}), "(providing_args=['user', 'group', 'classification'])\n", (395, 447), False, 'from django.dispatch import Signal, receiver\n'), ((470, 515), 'django.dispatch.Signal', 'Signal', ([], {'providing_args': "['p... |
import argparse
from sklearn.linear_model import LinearRegression
import pandas as pd
def train_model(train_dataset, train_columns, predict_columns):
data = pd.read_csv(train_dataset, sep=";")
data = data.fillna(0)
X = data[train_columns.split(";")]
Y = data[predict_columns.split(";")]
return Line... | [
"argparse.ArgumentParser",
"sklearn.linear_model.LinearRegression",
"pandas.read_csv"
] | [((163, 198), 'pandas.read_csv', 'pd.read_csv', (['train_dataset'], {'sep': '""";"""'}), "(train_dataset, sep=';')\n", (174, 198), True, 'import pandas as pd\n'), ((438, 475), 'pandas.read_csv', 'pd.read_csv', (['predict_dataset'], {'sep': '""";"""'}), "(predict_dataset, sep=';')\n", (449, 475), True, 'import pandas as... |
import datetime
import calendar
import pandas as pd
from timeseries import is_leap_day, split_annually
from dateutil.relativedelta import relativedelta
def replace_year(dt, year):
"""Replace the year in ``dt`` by ``year``. If dt has the last day in the month, keep also the last day of the
month for leap years... | [
"dateutil.relativedelta.relativedelta",
"pandas.Timestamp",
"calendar.isleap",
"timeseries.is_leap_day",
"pandas.DataFrame",
"timeseries.split_annually"
] | [((426, 442), 'pandas.Timestamp', 'pd.Timestamp', (['dt'], {}), '(dt)\n', (438, 442), True, 'import pandas as pd\n'), ((450, 465), 'timeseries.is_leap_day', 'is_leap_day', (['dt'], {}), '(dt)\n', (461, 465), False, 'from timeseries import is_leap_day, split_annually\n'), ((1492, 1508), 'pandas.Timestamp', 'pd.Timestamp... |
# -*- coding:utf-8 -*-
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE... | [
"gspylib.inspection.common.SharedFuncs.runSqlCmd"
] | [((1482, 1582), 'gspylib.inspection.common.SharedFuncs.runSqlCmd', 'SharedFuncs.runSqlCmd', (['sqldb', 'self.user', '""""""', 'self.port', 'self.tmpPath', '"""postgres"""', 'self.mpprcFile'], {}), "(sqldb, self.user, '', self.port, self.tmpPath,\n 'postgres', self.mpprcFile)\n", (1503, 1582), False, 'from gspylib.in... |
from Polynomials import Polynomial
from Rationals import Rational
print("Say we have a biased coin. It has P(Heads) = .6 and P(Tails) = .4 which we could represent as a Bernoulli distribution. However another option is to encode it as a polynomial generating function. That would be:")
Bern = Polynomial([.4,.6])
print... | [
"Polynomials.Polynomial",
"Rationals.Rational"
] | [((295, 317), 'Polynomials.Polynomial', 'Polynomial', (['[0.4, 0.6]'], {}), '([0.4, 0.6])\n', (305, 317), False, 'from Polynomials import Polynomial\n'), ((1536, 1550), 'Rationals.Rational', 'Rational', (['(1)', '(6)'], {}), '(1, 6)\n', (1544, 1550), False, 'from Rationals import Rational\n'), ((1557, 1590), 'Polynomia... |
# Generated by Django 2.2.3 on 2020-10-09 19:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commandcenter', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='cloudservicesconfiguration',
na... | [
"django.db.models.CharField"
] | [((355, 542), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""gw_ignore"""', 'help_text': '"""Ghostwriter will ignore cloud assets with one of these tags (comma-separated list)"""', 'max_length': '(255)', 'verbose_name': '"""Ignore Tags"""'}), "(default='gw_ignore', help_text=\n 'Ghostwriter w... |
import tensorflow as tf
from absl import app, flags
from external import datasets
import efficientnet_v2
FLAGS = flags.FLAGS
flags.DEFINE_string(
"data_dir",
default="/workspace/tfrecords/validation/",
help="Path to validation tfrecords directory (generaed by `imagenet_to_gcs.py`).",
)
flags.DEFINE_enum(
... | [
"absl.flags.DEFINE_bool",
"absl.flags.DEFINE_integer",
"tensorflow.keras.utils.Progbar",
"absl.app.run",
"tensorflow_hub.KerasLayer",
"external.datasets.get_dataset_class",
"absl.flags.DEFINE_enum",
"absl.flags.DEFINE_string",
"tensorflow.keras.metrics.TopKCategoricalAccuracy"
] | [((127, 299), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""data_dir"""'], {'default': '"""/workspace/tfrecords/validation/"""', 'help': '"""Path to validation tfrecords directory (generaed by `imagenet_to_gcs.py`)."""'}), "('data_dir', default='/workspace/tfrecords/validation/',\n help=\n 'Path to val... |
from django.contrib import admin
from . import models
admin.site.register(models.EducationInfo)
admin.site.register(models.TrainingInfo)
admin.site.register(models.JobInfo)
admin.site.register(models.ExperienceInfo)
admin.site.register(models.PersonalInfo)
| [
"django.contrib.admin.site.register"
] | [((56, 97), 'django.contrib.admin.site.register', 'admin.site.register', (['models.EducationInfo'], {}), '(models.EducationInfo)\n', (75, 97), False, 'from django.contrib import admin\n'), ((98, 138), 'django.contrib.admin.site.register', 'admin.site.register', (['models.TrainingInfo'], {}), '(models.TrainingInfo)\n', ... |
"""Financial projection for photovailtic system."""
# Utilities
import numpy as np
# Local
from .models import FinancialCalc
# Functions
def financial_calc(energy_by_month, kwh_cost, module, inverter, system):
"""
Returns:
- The month money savings of electrical coute derived of pv system.
-... | [
"numpy.array"
] | [((1651, 1668), 'numpy.array', 'np.array', (['consume'], {}), '(consume)\n', (1659, 1668), True, 'import numpy as np\n'), ((1716, 1730), 'numpy.array', 'np.array', (['cost'], {}), '(cost)\n', (1724, 1730), True, 'import numpy as np\n')] |
#
# Copyright 2019, Institute for Systems Biology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"logging.getLogger",
"flask.jsonify"
] | [((913, 952), 'logging.getLogger', 'logging.getLogger', (['settings.LOGGER_NAME'], {}), '(settings.LOGGER_NAME)\n', (930, 952), False, 'import logging\n'), ((7138, 7201), 'flask.jsonify', 'jsonify', (["{'code': 500, 'message': '/fields not yet supported.'}"], {}), "({'code': 500, 'message': '/fields not yet supported.'... |
from tir import Webapp
import unittest
class ATFA005(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup("SIGAATF", "01/04/2016", "T1", "D MG 01 ", "01")
inst.oHelper.Program("ATFA005")
def test_ATFA005_001(self):
self.oHelp... | [
"unittest.main",
"tir.Webapp"
] | [((2470, 2485), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2483, 2485), False, 'import unittest\n'), ((143, 151), 'tir.Webapp', 'Webapp', ([], {}), '()\n', (149, 151), False, 'from tir import Webapp\n')] |
from rss.objects import bot
from rss.create_rss import *
from main_config import BotConfig
from rss.default import error, start_command_handler, start_message_handler, guide_message_handler, back_message_handler
from rss.remove_rss import remove_rss_conversation_handler
from rss.rss_list import get_rss_list_handler
# f... | [
"rss.rss_send.BatchProcess"
] | [((829, 850), 'rss.rss_send.BatchProcess', 'BatchProcess', ([], {'bot': 'bot'}), '(bot=bot)\n', (841, 850), False, 'from rss.rss_send import BatchProcess\n')] |
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1[@class='titleProduct']",
'price' : "//div[@class='desc3']/span[@class='price']",
'category' : "//div[@class='inner']/a",
... | [
"scrapy.linkextractors.LinkExtractor"
] | [((826, 872), 'scrapy.linkextractors.LinkExtractor', 'LinkExtractor', ([], {'allow': "['/[a-zA-Z0-9-]+\\\\.htm$']"}), "(allow=['/[a-zA-Z0-9-]+\\\\.htm$'])\n", (839, 872), False, 'from scrapy.linkextractors import LinkExtractor\n')] |
# SPDX-FileCopyrightText: : 2017-2020 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
# coding: utf-8
"""
Adds extra extendable components to the clustered and simplified network.
Relevant Settings
-----------------
.. code:: yaml
costs:
year:
USD2013_to_EUR2013:
dico... | [
"logging.getLogger",
"numpy.sort",
"pypsa.Network",
"add_electricity.load_costs",
"add_electricity._add_missing_carriers_from_costs",
"add_electricity.add_nice_carrier_names",
"_helpers.mock_snakemake",
"_helpers.configure_logging"
] | [((2666, 2693), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2683, 2693), False, 'import logging\n'), ((2886, 2938), 'add_electricity._add_missing_carriers_from_costs', '_add_missing_carriers_from_costs', (['n', 'costs', 'carriers'], {}), '(n, costs, carriers)\n', (2918, 2938), False, ... |
import openturns as ot
class UBoolean:
"""
Wrapper class of ot.Bernoulli to enable boolean operator
"""
def __init__(self, confidence=ot.Bernoulli()):
self.confidence = confidence
def __str__(self):
return "UBoolean(" + str(self.confidence.getP()) + ")"
def __and__(self, oth... | [
"openturns.Bernoulli"
] | [((153, 167), 'openturns.Bernoulli', 'ot.Bernoulli', ([], {}), '()\n', (165, 167), True, 'import openturns as ot\n')] |
from math import atan
from tkinter import *
num = 0
list =[] # Заранее создаём списки.Для удобства.
list_two = []
list_three =[]
while num <= 3: # Объявляем цикл
num = int(input("Введите 1 для рассчёта G\nВведите 2 для рассчёта F\nВведите 3 для рассчёта Y\nВведите любую другую цифру для выхода\n"))
if num > 3 o... | [
"math.atan"
] | [((1693, 1734), 'math.atan', 'atan', (['(7 * x ** 2 - 2 * x * a - 9 * a ** 2)'], {}), '(7 * x ** 2 - 2 * x * a - 9 * a ** 2)\n', (1697, 1734), False, 'from math import atan\n'), ((2152, 2189), 'math.atan', 'atan', (['(2 * x ** 2 + x * a - 3 * a ** 2)'], {}), '(2 * x ** 2 + x * a - 3 * a ** 2)\n', (2156, 2189), False, '... |
from allauth.account.views import SignupView
from battery.models import BatteryType, BatteryModel
# Override the django-allauth SignupView to add a set of pre-defined BatteryType and BatteryModel when a new user
# is created
# https://tech.serhatteker.com/post/2020-06/custom-signup-view-in-django-allauth/
# https:/... | [
"allauth.account.views.SignupView.form_valid",
"battery.models.BatteryType",
"battery.models.BatteryModel"
] | [((910, 943), 'allauth.account.views.SignupView.form_valid', 'SignupView.form_valid', (['self', 'form'], {}), '(self, form)\n', (931, 943), False, 'from allauth.account.views import SignupView\n'), ((1013, 1067), 'battery.models.BatteryType', 'BatteryType', ([], {'type': '"""AA"""', 'description': '""""""', 'user': 'se... |
import json
import os
import subprocess
import base64
import sys
from tree.node import Node
from util.config_parser import parse_configs
from util.file_iterator import process_directory
from util.variable_resolver import resolve_variables
from util.should_run import should_run
from values.array import handle_array_arg... | [
"subprocess.Popen",
"json.dumps",
"os.path.join",
"tree.node.Node",
"os.environ.copy",
"util.should_run.should_run",
"util.variable_resolver.resolve_variables",
"os.path.abspath",
"util.config_parser.parse_configs"
] | [((676, 703), 'util.config_parser.parse_configs', 'parse_configs', (['config_files'], {}), '(config_files)\n', (689, 703), False, 'from util.config_parser import parse_configs\n'), ((623, 649), 'os.path.abspath', 'os.path.abspath', (['"""./tests"""'], {}), "('./tests')\n", (638, 649), False, 'import os\n'), ((1370, 140... |
import numpy
# scipy.special for the sigmoid function expit()
import scipy.special
# neural network class definition
class neuralNetwork:
# initialise the neural network
def __init__(self, inputnodes, hiddennodes, hiddenlayers, outputnodes, learningrate):
# set number of nodes in each input, hidde... | [
"numpy.array",
"numpy.dot",
"numpy.transpose"
] | [((1864, 1922), 'numpy.dot', 'numpy.dot', (['self.who[self.hiddenlayers - 1]', 'hidden_outputs'], {}), '(self.who[self.hiddenlayers - 1], hidden_outputs)\n', (1873, 1922), False, 'import numpy\n'), ((3419, 3454), 'numpy.dot', 'numpy.dot', (['self.who', 'hidden_outputs'], {}), '(self.who, hidden_outputs)\n', (3428, 3454... |
# -- coding: utf-8 --
# pylint: skip-file
# Copyright 2019 FairwindsOps Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
"re.sub",
"pkg_resources.get_distribution",
"pkgutil.get_data",
"re.compile"
] | [((723, 772), 're.compile', 're.compile', (['"""^([0-9]+\\\\.[0-9]+\\\\.[0-9]+)\\\\.(.*)$"""'], {}), "('^([0-9]+\\\\.[0-9]+\\\\.[0-9]+)\\\\.(.*)$')\n", (733, 772), False, 'import re\n'), ((1162, 1217), 're.sub', 're.sub', (['__version_modifier__', '"""\\\\g<1>-\\\\g<2>"""', '_raw_ver'], {}), "(__version_modifier__, '\\... |
import yaml
import io
from gkdtikz.tree import root, GkdInterface
n = yaml.load("""
a:
- a
- b
""", Loader=yaml.SafeLoader)
root(lambda x: print(x, end=''), n)
class S:
globals = {}
GkdInterface.load(S, lambda x: print(x, end='')) | [
"yaml.load"
] | [((71, 124), 'yaml.load', 'yaml.load', (['"""\na:\n- a\n- b\n"""'], {'Loader': 'yaml.SafeLoader'}), "('\\na:\\n- a\\n- b\\n', Loader=yaml.SafeLoader)\n", (80, 124), False, 'import yaml\n')] |
import csv
import cv2
import numpy as np
from keras.models import Model, Sequential
from keras.layers import Input, Convolution2D, Flatten, Dense, Dropout, Lambda, Activation, MaxPooling2D
import matplotlib.pyplot as plt
adjust_angles = [0, 0.25, -0.25]
def load_data():
"""
Load images and angles data collec... | [
"keras.layers.Convolution2D",
"cv2.imread",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.layers.Lambda",
"keras.models.Sequential",
"numpy.array",
"keras.layers.Input",
"keras.layers.Dropout",
"matplotlib.pyplot.figure",
"keras.models.Model",
"keras.layers.Activation",
"cv2.cv... | [((961, 977), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (969, 977), True, 'import numpy as np\n'), ((992, 1014), 'numpy.array', 'np.array', (['measurements'], {}), '(measurements)\n', (1000, 1014), True, 'import numpy as np\n'), ((1476, 1518), 'cv2.resize', 'cv2.resize', (['frame_cropped'], {'dsize': '... |
import tkinter as tk
from ttkbootstrap import Style
from random import choice
root = tk.Tk()
root.minsize(500, 500)
style = Style('superhero')
def new_theme():
theme = choice(style.theme_names())
print(theme)
style.theme_use(theme)
btn = tk.Button(root, text='Primary')
btn.configure(command=new_theme)
b... | [
"tkinter.Menu",
"ttkbootstrap.Style",
"tkinter.LabelFrame",
"tkinter.Checkbutton",
"tkinter.Entry",
"tkinter.Variable",
"tkinter.Button",
"tkinter.Radiobutton",
"tkinter.Scale",
"tkinter.Tk",
"tkinter.Spinbox",
"tkinter.Label",
"tkinter.Menubutton",
"tkinter.Text",
"tkinter.Frame",
"tk... | [((86, 93), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (91, 93), True, 'import tkinter as tk\n'), ((126, 144), 'ttkbootstrap.Style', 'Style', (['"""superhero"""'], {}), "('superhero')\n", (131, 144), False, 'from ttkbootstrap import Style\n'), ((254, 285), 'tkinter.Button', 'tk.Button', (['root'], {'text': '"""Primary"""... |
"""nvim_google_cal_class
The google calendar class, with Neovim options to log information
back to the user.
"""
from datetime import date, datetime, time
from os import path
from typing import Any, Dict, List, Optional, Union
from googleapiclient import discovery, errors
from httplib2 import Http, HttpLib2Error
fro... | [
"os.path.join",
"datetime.datetime.now",
"httplib2.Http",
"datetime.date.today",
"datetime.datetime.combine"
] | [((2727, 2741), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2739, 2741), False, 'from datetime import date, datetime, time\n'), ((3205, 3252), 'os.path.join', 'path.join', (['self.config_path', '"""credentials.json"""'], {}), "(self.config_path, 'credentials.json')\n", (3214, 3252), False, 'from os impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
#
# x11 - Module for Python X lib (X11) functions
#
# ==============================================================================
# noinspection SpellCheckingInspection
"""
To so... | [
"Xlib.ext.randr.get_screen_resources",
"collections.namedtuple",
"time.sleep",
"PIL.Image.frombytes",
"Xlib.display.Display"
] | [((1875, 1901), 'Xlib.display.Display', 'Xlib.display.Display', (['""":0"""'], {}), "(':0')\n", (1895, 1901), False, 'import Xlib\n'), ((2314, 2356), 'collections.namedtuple', 'namedtuple', (['"""Geometry"""', '"""x y width height"""'], {}), "('Geometry', 'x y width height')\n", (2324, 2356), False, 'from collections i... |
import logging
import os
import signal
import tempfile
import pytest
import pytest_fixture_config
import pytest_mock
import pytest_virtualenv
import yaml
import fair.common as fdp_com
import fair.testing as fdp_test
from . import registry_install as test_reg
TEST_JOB_FILE_TIMESTAMP = "2021-10-11_10_0_0_100000"
lo... | [
"logging.getLogger",
"tempfile.TemporaryDirectory",
"os.kill",
"yaml.dump",
"fair.testing.create_configurations",
"os.path.join",
"os.path.dirname",
"pytest_virtualenv.VirtualEnv",
"pytest_virtualenv.FixtureConfig",
"pytest.fixture"
] | [((383, 414), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (397, 414), False, 'import pytest\n'), ((4877, 4908), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (4891, 4908), False, 'import pytest\n'), ((1330, 1360), 'pytest_vi... |
import numpy as np
import time
nodes = []
class node:
def __init__(self, symbol):
self.symbol = symbol
self.edges = []
self.shortest_distance = float('inf')
self.shortest_path_via = None
nodes.append(self)
def add_edge(self, node, distance):
edge = [node, dist... | [
"numpy.array",
"time.perf_counter"
] | [((2561, 2580), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2578, 2580), False, 'import time\n'), ((2607, 3024), 'numpy.array', 'np.array', (['[[0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0], [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0], [0, \n 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0], [0, 0,\n 0... |
##################################################################
#
# Trap calibration with stage oscillation (by <NAME>)
# Ref: Tolic-Norrelykke et al. (2006)
#
##################################################################
from __future__ import division, print_function, absolute_import
import numpy as ... | [
"numpy.mean",
"numpy.arange",
"numpy.fft.fft",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"nptdms.TdmsFile"
] | [((1934, 1964), 'nptdms.TdmsFile', 'TdmsFile', (["(self.fname + '.tdms')"], {}), "(self.fname + '.tdms')\n", (1942, 1964), False, 'from nptdms import TdmsFile\n'), ((3442, 3464), 'numpy.mean', 'np.mean', (['PSD_X'], {'axis': '(0)'}), '(PSD_X, axis=0)\n', (3449, 3464), True, 'import numpy as np\n'), ((3494, 3516), 'nump... |
import asyncio
import logging
from typing import Dict, List, Optional, Set
import aiohttp
import uvloop
logger = logging.getLogger('gprmon')
uvloop.install()
GITHUB_URL = 'https://api.github.com'
API_PATH = '/api/v3'
CONN_TIMEOUT = 5
MAX_CONNECTIONS = 4
async def _fetch_url(session: aiohttp.ClientSession, url: st... | [
"logging.getLogger",
"aiohttp.ClientSession",
"aiohttp.TCPConnector",
"uvloop.install"
] | [((116, 143), 'logging.getLogger', 'logging.getLogger', (['"""gprmon"""'], {}), "('gprmon')\n", (133, 143), False, 'import logging\n'), ((144, 160), 'uvloop.install', 'uvloop.install', ([], {}), '()\n', (158, 160), False, 'import uvloop\n'), ((825, 868), 'aiohttp.TCPConnector', 'aiohttp.TCPConnector', ([], {'limit': 'M... |
import json
import uuid
from io import StringIO
from typing import Dict
import jwt
from django.conf import settings
from django.core.management import call_command, CommandError
from api.models import ApiToken
from frisky.models import Workspace
from frisky.test import FriskyTestCase
class ApiTestCase(FriskyTestCas... | [
"jwt.decode",
"json.loads",
"frisky.models.Workspace.objects.create",
"django.core.management.call_command",
"json.dumps",
"uuid.uuid4",
"api.models.ApiToken.objects.create",
"api.models.ApiToken.objects.get",
"io.StringIO",
"jwt.encode"
] | [((572, 617), 'api.models.ApiToken.objects.create', 'ApiToken.objects.create', ([], {'name': '"""Testing Token"""'}), "(name='Testing Token')\n", (595, 617), False, 'from api.models import ApiToken\n'), ((959, 1018), 'api.models.ApiToken.objects.create', 'ApiToken.objects.create', ([], {'name': '"""Revoked Token"""', '... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
#
# Copyright 2018 EMVA
#
# 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://ww... | [
"harvesters_gui._private.frontend.canvas.Canvas2D",
"harvesters.core.Harvester",
"PyQt5.QtWidgets.QApplication",
"harvesters_gui._private.frontend.helper.compose_tooltip",
"harvesters.util.logging.get_logger",
"harvesters_gui._private.frontend.pyqt5.helper.get_system_font",
"PyQt5.QtWidgets.QDesktopWidg... | [((2363, 2378), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['str'], {}), '(str)\n', (2373, 2378), False, 'from PyQt5.QtCore import QMutexLocker, QMutex, pyqtSignal, QThread\n'), ((2416, 2428), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (2426, 2428), False, 'from PyQt5.QtCore import QMutexLocker, QMutex, ... |
from config.redfish1_0_config import config
from config.auth import *
from config.settings import *
from logger import Log
from json import loads, dumps
import pexpect
import pxssh
import subprocess
LOG = Log(__name__)
class Auth(object):
"""
Class to abstract python authentication functionality
"""
@... | [
"logger.Log",
"config.redfish1_0_config.config.api_client.last_response.getheader",
"config.redfish1_0_config.config.api_client.call_api"
] | [((206, 219), 'logger.Log', 'Log', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'from logger import Log\n'), ((673, 740), 'config.redfish1_0_config.config.api_client.call_api', 'config.api_client.call_api', (['resource_path', 'method'], {'body': 'body_params'}), '(resource_path, method, body=body_params)\n', ... |
from fastapi import Depends
from rx import operators as rxops
from api_server.base_app import BaseApp
from api_server.fast_io import FastIORouter, SubscriptionRequest
from api_server.models import BuildingMap
from api_server.repositories.rmf import RmfRepository
class BuildingMapRouter(FastIORouter):
def __init_... | [
"fastapi.Depends",
"rx.operators.filter"
] | [((499, 520), 'fastapi.Depends', 'Depends', (['app.rmf_repo'], {}), '(app.rmf_repo)\n', (506, 520), False, 'from fastapi import Depends\n'), ((821, 858), 'rx.operators.filter', 'rxops.filter', (['(lambda x: x is not None)'], {}), '(lambda x: x is not None)\n', (833, 858), True, 'from rx import operators as rxops\n')] |
import datetime
import json
import os
def get_utc_now():
return datetime.datetime.utcnow()
def format_datetime(date_time):
"""Generate string from datetime object."""
return date_time.strftime("%Y-%m-%d %H:%M:%S")
def get_vcap_service():
vcap_config = os.getenv('VCAP_SERVICES', None... | [
"json.loads",
"os.getenv",
"datetime.datetime.utcnow"
] | [((76, 102), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (100, 102), False, 'import datetime\n'), ((289, 321), 'os.getenv', 'os.getenv', (['"""VCAP_SERVICES"""', 'None'], {}), "('VCAP_SERVICES', None)\n", (298, 321), False, 'import os\n'), ((369, 392), 'json.loads', 'json.loads', (['vcap_c... |
"""
Provide tests for command line interface's get the public key of the atomic swap commands.
"""
import json
import re
import pytest
from click.testing import CliRunner
from cli.constants import (
DEV_CONSENSUS_GENESIS_NODE_IP_ADDRESS_FOR_TESTING,
FAILED_EXIT_FROM_COMMAND_CODE,
PASSED_EXIT_FROM_COMMAND_... | [
"json.loads",
"cli.utils.dict_to_pretty_json",
"re.match",
"click.testing.CliRunner",
"pytest.mark.parametrize"
] | [((2456, 2562), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""node_url_with_protocol"""', "['http://masternode.com', 'https://masternode.com']"], {}), "('node_url_with_protocol', ['http://masternode.com',\n 'https://masternode.com'])\n", (2479, 2562), False, 'import pytest\n'), ((569, 580), 'click.test... |
"""
These are some scripts used in testing multiple particles.
"""
import time
import datetime
import numpy as np
from particle import Particle
#==============================================================================
def fill_particles(diameter, density, births, lifetime, initial_positions, u0):
# somePart... | [
"numpy.array",
"datetime.timedelta",
"time.time",
"particle.Particle"
] | [((720, 743), 'numpy.array', 'np.array', (['someParticles'], {}), '(someParticles)\n', (728, 743), True, 'import numpy as np\n'), ((799, 834), 'numpy.array', 'np.array', (['[[x0, y] for y in list_y]'], {}), '([[x0, y] for y in list_y])\n', (807, 834), True, 'import numpy as np\n'), ((916, 927), 'time.time', 'time.time'... |
# Generated by Django 3.0.6 on 2020-05-23 10:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('photos', '0002_auto_20200523_1317'),
]
operations = [
migrations.AlterModelOptions(
name='image',
options={},
),
... | [
"django.db.migrations.AlterModelOptions",
"django.db.migrations.RenameField"
] | [((226, 280), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""image"""', 'options': '{}'}), "(name='image', options={})\n", (254, 280), False, 'from django.db import migrations\n'), ((325, 420), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name':... |
from typing import Union, List
from pydantic.fields import ModelField
from fhir.resources.resource import Resource
from fhir.resources import get_fhir_model_class
from fhir.resources.fhirtypes import ResourceType
def get_resource_fields(resource: Union[Resource, ResourceType, str]) -> List[ModelField]:
"""
... | [
"fhir.resources.get_fhir_model_class"
] | [((528, 558), 'fhir.resources.get_fhir_model_class', 'get_fhir_model_class', (['resource'], {}), '(resource)\n', (548, 558), False, 'from fhir.resources import get_fhir_model_class\n'), ((798, 833), 'fhir.resources.get_fhir_model_class', 'get_fhir_model_class', (['resource_name'], {}), '(resource_name)\n', (818, 833), ... |
from epsilon.extime import Time
from axiom.store import Store
from axiom import attributes
from axiom.tags import Catalog
from axiom.item import Item
from axiom.dependency import installOn
from nevow.livetrial import testcase
from nevow import tags, loaders
from nevow.athena import expose
from xmantissa.webtheme imp... | [
"xquotient.exmess.MessageDetail",
"epsilon.extime.Time",
"xmantissa.people.Person",
"epsilon.extime.Time.fromPOSIXTimestamp",
"xquotient.inbox.Inbox",
"xquotient.exmess.MessageBodyFragment",
"axiom.attributes.reference",
"axiom.attributes.integer",
"nevow.tags.directive",
"xquotient.test.util.Part... | [((613, 635), 'axiom.attributes.reference', 'attributes.reference', ([], {}), '()\n', (633, 635), False, 'from axiom import attributes\n'), ((647, 664), 'axiom.attributes.text', 'attributes.text', ([], {}), '()\n', (662, 664), False, 'from axiom import attributes\n'), ((677, 694), 'axiom.attributes.text', 'attributes.t... |
import json
import pandas as pd
with open('category.json') as f:
json_data = json.loads(f.read())
total_cards = json_data['cards']
code_df = pd.DataFrame(columns=["code", "title", "title_url"])
for card in total_cards:
code = card['items'][0]['item']['code']
title = card['items'][0]['item']['title']
... | [
"pandas.DataFrame"
] | [((147, 199), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['code', 'title', 'title_url']"}), "(columns=['code', 'title', 'title_url'])\n", (159, 199), True, 'import pandas as pd\n')] |
# Copyright 2022 iiPython
# Wrapper for the builtin Python socket module
# It includes basic encryption using Python cryptography
# Modules
import json
import socket
import base64
from typing import Any, List
from types import FunctionType
from copy import copy as copyobj
try:
from cryptography.fernet import Fer... | [
"json.loads",
"base64.urlsafe_b64encode",
"json.dumps",
"cryptography.hazmat.primitives.asymmetric.ec.SECP384R1",
"copy.copy",
"cryptography.hazmat.primitives.asymmetric.ec.ECDH",
"cryptography.hazmat.primitives.hashes.SHA256"
] | [((789, 801), 'copy.copy', 'copyobj', (['obj'], {}), '(obj)\n', (796, 801), True, 'from copy import copy as copyobj\n'), ((1750, 1766), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (1760, 1766), False, 'import json\n'), ((2061, 2075), 'cryptography.hazmat.primitives.asymmetric.ec.SECP384R1', 'ec.SECP384R1', ... |
import requests
"""
A webscraping tool that looks for information from a URL based
on the keyword argument 'get_info_of'.
Currently only tested on
https://iris.lmsal.com/iris2/iris2_chapter02_01.html#inversion-of-iris-mg-ii-h-k-lines-with-iris2
because of its relevance.
Definitely not the most elegant approach, but wo... | [
"requests.get"
] | [((525, 542), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (537, 542), False, 'import requests\n')] |
from django.db import models
from django.db import models
from tenant_schemas.models import TenantMixin
class Client(TenantMixin):
"""
TenantMixin has 2 fields
- domain_url
- schema_name
"""
name = models.CharField(max_length=100)
created_at = models.DateTimeField(auto_now_add=Tru... | [
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((233, 265), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (249, 265), False, 'from django.db import models\n'), ((283, 322), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (303, 322), False, ... |
import unittest
from amazon_paapi.errors import AsinNotFoundException
from amazon_paapi.tools import get_asin
class TestTools(unittest.TestCase):
def test_get_asin(self):
self.assertEqual(get_asin("B01N5IB20Q"), "B01N5IB20Q")
self.assertEqual(
get_asin("https://www.amazon.es/gp/produc... | [
"amazon_paapi.tools.get_asin"
] | [((203, 225), 'amazon_paapi.tools.get_asin', 'get_asin', (['"""B01N5IB20Q"""'], {}), "('B01N5IB20Q')\n", (211, 225), False, 'from amazon_paapi.tools import get_asin\n'), ((279, 334), 'amazon_paapi.tools.get_asin', 'get_asin', (['"""https://www.amazon.es/gp/product/B07PHPXHQS"""'], {}), "('https://www.amazon.es/gp/produ... |
from yacv.grammar import Production
from yacv.constants import YACV_EPSILON
from pprint import pformat
class AbstractSyntaxTree(object):
def __init__(self, *args):
if len(args) == 0:
self.root = None
self.desc = []
self.prod_id = None
self.node_id = None
... | [
"pprint.pformat"
] | [((840, 858), 'pprint.pformat', 'pformat', (['self.desc'], {}), '(self.desc)\n', (847, 858), False, 'from pprint import pformat\n')] |
from cartography.intel.azure import compute
from tests.data.azure.compute import DESCRIBE_DISKS
from tests.data.azure.compute import DESCRIBE_SNAPSHOTS
from tests.data.azure.compute import DESCRIBE_VM_DATA_DISKS
from tests.data.azure.compute import DESCRIBE_VMAVAILABLESIZES
from tests.data.azure.compute import DESCRIBE... | [
"cartography.intel.azure.compute.load_vm_extensions",
"cartography.intel.azure.compute.load_vm_scale_sets",
"cartography.intel.azure.compute.load_vms",
"cartography.intel.azure.compute.load_snapshots",
"cartography.intel.azure.compute.load_vm_available_sizes",
"cartography.intel.azure.compute.load_vm_data... | [((646, 734), 'cartography.intel.azure.compute.load_vms', 'compute.load_vms', (['neo4j_session', 'TEST_SUBSCRIPTION_ID', 'DESCRIBE_VMS', 'TEST_UPDATE_TAG'], {}), '(neo4j_session, TEST_SUBSCRIPTION_ID, DESCRIBE_VMS,\n TEST_UPDATE_TAG)\n', (662, 734), False, 'from cartography.intel.azure import compute\n'), ((1605, 16... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Library with PME calculation functions, provides utility for Private Equity analysis.
@author: <NAME> (<EMAIL>)
"""
import pandas as pd
import numpy as np
import scipy.optimize
from datetime import date
#Helper functions
def nearest(series, lookup, debug = False):
... | [
"numpy.log",
"datetime.date",
"numpy.timedelta64",
"pandas.concat",
"pandas.to_datetime"
] | [((3929, 3956), 'pandas.to_datetime', 'pd.to_datetime', (['dates_index'], {}), '(dates_index)\n', (3943, 3956), True, 'import pandas as pd\n'), ((7370, 7397), 'pandas.to_datetime', 'pd.to_datetime', (['dates_index'], {}), '(dates_index)\n', (7384, 7397), True, 'import pandas as pd\n'), ((10043, 10058), 'numpy.log', 'np... |
# -*- coding: utf-8 -*-
from unittest import mock
def prepare_testdir(testdir):
testdir.makepyfile("""
import pytest
def test_one():
print("One")
def test_two():
print("Two")
""")
def test_reordering(testdir):
prepare_testdir(testdir)
result = testdir... | [
"unittest.mock.call",
"unittest.mock.patch"
] | [((998, 1027), 'unittest.mock.patch', 'mock.patch', (['"""socketio.Client"""'], {}), "('socketio.Client')\n", (1008, 1027), False, 'from unittest import mock\n'), ((1251, 1262), 'unittest.mock.call', 'mock.call', ([], {}), '()\n', (1260, 1262), False, 'from unittest import mock\n'), ((1280, 1291), 'unittest.mock.call',... |
from functools import wraps
from flask import redirect, url_for, flash
from flask_login import current_user
from winejournal.data_models.timestamp import TimeStampMixin
from winejournal.extensions import db
class Category(db.Model, TimeStampMixin):
__tablename__ = 'categories'
id = db.Column(db.Integer, pr... | [
"winejournal.extensions.db.backref",
"flask_login.current_user.is_admin",
"winejournal.extensions.db.String",
"flask.flash",
"winejournal.extensions.db.ForeignKey",
"functools.wraps",
"flask.url_for",
"winejournal.extensions.db.session.query",
"winejournal.extensions.db.Column"
] | [((296, 335), 'winejournal.extensions.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (305, 335), False, 'from winejournal.extensions import db\n'), ((406, 424), 'winejournal.extensions.db.Column', 'db.Column', (['db.Text'], {}), '(db.Text)\n', (415, 424), False... |
from flask import request, current_app
import jwt
from app.models.auth import User
from app.api import api
# required_token decorator
def token_required(f):
def wrapper(*args, **kwargs):
auth_header = request.headers.get('Authorization')
current_user = None
if auth_header:
try... | [
"jwt.decode",
"app.models.auth.User.query.get",
"flask.request.headers.get",
"app.api.api.abort"
] | [((216, 252), 'flask.request.headers.get', 'request.headers.get', (['"""Authorization"""'], {}), "('Authorization')\n", (235, 252), False, 'from flask import request, current_app\n'), ((1032, 1064), 'app.api.api.abort', 'api.abort', (['(403)', '"""Token required"""'], {}), "(403, 'Token required')\n", (1041, 1064), Fal... |