code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
""" Handles logging in/registering/editing a user account """ from flask import ( flash, request, session, render_template, current_app, redirect, url_for, abort, ) import flask_login from sqlalchemy.exc import IntegrityError from is_safe_url import is_safe_url from muffin_shop.helpers.m...
[ "flask.render_template", "flask.request.args.get", "muffin_shop.forms.main.account_forms.RequestPasswordResetForm", "flask.current_app.logger.warning", "flask.current_app.session_interface.get_user_session", "muffin_shop.models.main.models.User", "flask.flash", "muffin_shop.forms.main.account_forms.Lo...
[((715, 745), 'muffin_shop.blueprint.Blueprint', 'Blueprint', (['"""account"""', '__name__'], {}), "('account', __name__)\n", (724, 745), False, 'from muffin_shop.blueprint import Blueprint\n'), ((812, 842), 'muffin_shop.helpers.main.plugins.rate_limiter.limit', 'rate_limiter.limit', (['"""6/minute"""'], {}), "('6/minu...
from vms.models import BackupDefine from api.decorators import api_view, request_data, setting_required from api.permissions import IsAdminOrReadOnly from api.utils.db import get_object from api.vm.utils import get_vm, get_vms from api.vm.snapshot.utils import get_disk_id, filter_disk_id from api.vm.backup.utils impor...
[ "api.decorators.request_data", "api.vm.utils.get_vms", "api.decorators.api_view", "api.vm.snapshot.utils.get_disk_id", "api.vm.backup.vm_backup_list.VmBackupList", "api.vm.backup.vm_backup.VmBackup", "api.utils.db.get_object", "api.vm.backup.utils.output_extended_backup_count", "api.vm.utils.get_vm"...
[((651, 669), 'api.decorators.api_view', 'api_view', (["('GET',)"], {}), "(('GET',))\n", (659, 669), False, 'from api.decorators import api_view, request_data, setting_required\n'), ((671, 717), 'api.decorators.request_data', 'request_data', ([], {'permissions': '(IsAdminOrReadOnly,)'}), '(permissions=(IsAdminOrReadOnl...
# -*- encoding: utf-8 -*- ''' @File : main.py @Time : 2020/12/15 11:02:48 @Author : Abelit @Version : 1.0 @Contact : <EMAIL> @Copyright : (C)Copyright 2020, dataforum.org @Licence : BSD-3-Clause @Desc : None ''' from flask import Flask, json, request, jsonify,Response from flask_jwt_extended...
[ "flask_jwt_extended.JWTManager", "flask_cors.CORS", "flask.Flask" ]
[((1541, 1556), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1546, 1556), False, 'from flask import Flask, json, request, jsonify, Response\n'), ((1726, 1776), 'flask_cors.CORS', 'CORS', (['_app'], {'resources': "{'/api/*': {'origins': '*'}}"}), "(_app, resources={'/api/*': {'origins': '*'}})\n", (1730,...
""" A module for asymmetric's core callback logic. """ import asyncio from typing import Any, Callable, Dict, Optional, Union import httpx from starlette.datastructures import Headers from starlette.responses import JSONResponse from asymmetric.callbacks.utils import get_header_finders, validate_callback_data from a...
[ "asymmetric.errors.InvalidCallbackHeadersError", "starlette.responses.JSONResponse", "starlette.datastructures.Headers", "asymmetric.errors.InvalidCallbackObjectError", "asymmetric.callbacks.utils.validate_callback_data", "asymmetric.callbacks.utils.get_header_finders", "httpx.AsyncClient", "asymmetri...
[((865, 874), 'starlette.datastructures.Headers', 'Headers', ([], {}), '()\n', (872, 874), False, 'from starlette.datastructures import Headers\n'), ((2311, 2385), 'starlette.responses.JSONResponse', 'JSONResponse', (["{'message': self.__invalid_callback_object}"], {'status_code': '(500)'}), "({'message': self.__invali...
import streamlit as st import streamlit.components.v1 as stc # Text Cleaning Pkgs import neattext as nt import neattext.functions as nfx from collections import Counter import pandas as pd # Text Viz Pkgs from wordcloud import WordCloud from textblob import TextBlob # Data Viz Pkgs import matplotlib.pyplot as plt ...
[ "altair.Chart", "streamlit.text_area", "streamlit.components.v1.html", "matplotlib.pyplot.imshow", "textblob.TextBlob", "streamlit.warning", "matplotlib.pyplot.plot", "pandas.DataFrame", "matplotlib.pyplot.axis", "matplotlib.pyplot.xticks", "streamlit.beta_columns", "matplotlib.use", "stream...
[((339, 360), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (353, 360), False, 'import matplotlib\n'), ((975, 1003), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (985, 1003), True, 'import matplotlib.pyplot as plt\n'), ((1004, 1017), 'matplotli...
import sys import json from .utils import check_inputs, zopen from .gff import gff2dict from .genbank import tbl2dict def stats(args): check_inputs([args.input] + [args.fasta]) if not args.input_format: # we have to guess if args.input.endswith((".tbl", ".tbl.gz")): args.input_format = "t...
[ "json.dumps", "sys.exit" ]
[((1121, 1154), 'json.dumps', 'json.dumps', (['annot_stats'], {'indent': '(4)'}), '(annot_stats, indent=4)\n', (1131, 1154), False, 'import json\n'), ((595, 606), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (603, 606), False, 'import sys\n'), ((1051, 1084), 'json.dumps', 'json.dumps', (['annot_stats'], {'indent': '...
""" 92. Reverse Linked List II Medium Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list. Example 1: Input: head = [1,2,3,4,5], left = 2, right = 4 Output: [1,4,3,2,5] Exampl...
[ "lintcode.ListNode" ]
[((3744, 3755), 'lintcode.ListNode', 'ListNode', (['(0)'], {}), '(0)\n', (3752, 3755), False, 'from lintcode import ListNode\n'), ((4731, 4749), 'lintcode.ListNode', 'ListNode', (['(-1)', 'head'], {}), '(-1, head)\n', (4739, 4749), False, 'from lintcode import ListNode\n'), ((5368, 5380), 'lintcode.ListNode', 'ListNode...
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Filename: field.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) import numpy as np import fitsio import scipy.optimize as optimize import matplotlib.pyplot as plt import ortools.sat.python.cp_model as cp_model import kaiju import kaiju.ro...
[ "numpy.sqrt", "numpy.argsort", "numpy.array", "numpy.arctan2", "numpy.sin", "numpy.arange", "kaiju.robotGrid.RobotGridFilledHex", "numpy.where", "numpy.float64", "fitsio.read", "fitsio.FITS", "fitsio.read_header", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "numpy.dtype", "o...
[((504, 733), 'numpy.dtype', 'np.dtype', (["[('ra', np.float64), ('dec', np.float64), ('catalogid', np.int64), (\n 'category', np.unicode_, 30), ('program', np.unicode_, 30), (\n 'fiberType', np.unicode_, 30), ('priority', np.int32), ('within', np.int32)\n ]"], {}), "([('ra', np.float64), ('dec', np.float64), ...
import numpy as np import pandas as pd from pathlib import Path from typing import Dict, List, Union from collections import OrderedDict from pathos.multiprocessing import ThreadPool as Pool from tqdm import tqdm from src.utils import remap_label, get_type_instances from .metrics import PQ, AJI, AJI_plus, DICE2, split...
[ "pandas.DataFrame.from_records", "numpy.unique", "pathlib.Path", "src.utils.remap_label", "pathos.multiprocessing.ThreadPool", "src.utils.get_type_instances", "pandas.DataFrame", "pandas.concat" ]
[((4430, 4464), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (['metrics'], {}), '(metrics)\n', (4455, 4464), True, 'import pandas as pd\n'), ((8377, 8391), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (8389, 8391), True, 'import pandas as pd\n'), ((1074, 1091), 'src.utils.remap_label', 'remap_...
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('template.html') @app.route('/user/<user>/<int:depo>') def hello_name(user,depo): return render_template('template.html', name=user, deposit=depo) if __name__=='__main__': app.run(debug=True...
[ "flask.render_template", "flask.Flask" ]
[((47, 62), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (52, 62), False, 'from flask import Flask, render_template\n'), ((104, 136), 'flask.render_template', 'render_template', (['"""template.html"""'], {}), "('template.html')\n", (119, 136), False, 'from flask import Flask, render_template\n'), ((214, ...
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # ...
[ "pydantic.Field" ]
[((950, 989), 'pydantic.Field', 'Field', (['"""messageCalendar"""'], {'alias': '"""@type"""'}), "('messageCalendar', alias='@type')\n", (955, 989), False, 'from pydantic import Field\n')]
#!/usr/bin/env python from setuptools import find_packages, setup setup( name='nameko-examples-orders', version='0.0.1', description='Store and serve orders', packages=find_packages(exclude=['test', 'test.*']), install_requires=[ 'nameko==2.8.5', 'nameko-sqlalchemy==0.0.4', ...
[ "setuptools.find_packages" ]
[((185, 226), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['test', 'test.*']"}), "(exclude=['test', 'test.*'])\n", (198, 226), False, 'from setuptools import find_packages, setup\n')]
from abc import ABC, abstractmethod from typing import AnyStr, List, Dict, Optional, Union from functools import partial class AdvancedFeaturizer(ABC): pass class SimpleFeaturizer(ABC): id = None parameters = [] # def __init__(self, files: Union[str, List[str]], series: Union[str, List[str], None]):...
[ "functools.partial" ]
[((1285, 1331), 'functools.partial', 'partial', (['self.featurize'], {'params': 'preparedParams'}), '(self.featurize, params=preparedParams)\n', (1292, 1331), False, 'from functools import partial\n')]
import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np import os def plot_bars(bars, values, name, save_name, y_label=None): plt.close('all') fig, ax = plt.subplots() pos = np.arange(len(bars)) rects=ax.bar(pos, values) ax.bar_label(rects, labels=[...
[ "os.path.exists", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xticks", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend", "os.remove" ]
[((181, 197), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (190, 197), True, 'import matplotlib.pyplot as plt\n'), ((212, 226), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (224, 226), True, 'import matplotlib.pyplot as plt\n'), ((379, 400), 'matplotlib.pyplot.xticks', 'p...
# Django from django.contrib import admin # Import our models to the admin from users.models import Profile # Register the model profile in the admin @admin.register(Profile) class ProfileAdmin(admin.ModelAdmin): list_display = ['pk', 'user','prof_register','picture'] list_display_links = ('pk', 'prof_regist...
[ "django.contrib.admin.register" ]
[((154, 177), 'django.contrib.admin.register', 'admin.register', (['Profile'], {}), '(Profile)\n', (168, 177), False, 'from django.contrib import admin\n')]
import glob import os from PIL import Image from os import path from psd_tools import PSDImage import cf as C from muse.psd_parser import PsdParser def scale(pil_img, max_size, method=Image.ANTIALIAS): """ resize 'image' to 'max_size' keeping the aspect ratio and place it in center of white 'max_size' i...
[ "os.listdir", "PIL.Image.open", "PIL.Image.new", "muse.psd_parser.PsdParser.parse_psd", "os.path.join", "os.path.splitext", "os.path.basename", "glob.glob", "psd_tools.PSDImage.load" ]
[((482, 517), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'max_size', '"""white"""'], {}), "('RGB', max_size, 'white')\n", (491, 517), False, 'from PIL import Image\n'), ((612, 635), 'psd_tools.PSDImage.load', 'PSDImage.load', (['psd_path'], {}), '(psd_path)\n', (625, 635), False, 'from psd_tools import PSDImage\n'), ...
"""デコレータのサンプル""" from random import gauss def noisy(func): def noisy_func(*args, **kwargs): y = func(*args, **kwargs) + gauss(0,0.01) return y return noisy_func @noisy def f(x): return 2.0*x for n in range(10): x = 0.1 * n print('f({0: 4.3f}) ~ {1: 4.3f}'.format(x,f(x)))
[ "random.gauss" ]
[((133, 147), 'random.gauss', 'gauss', (['(0)', '(0.01)'], {}), '(0, 0.01)\n', (138, 147), False, 'from random import gauss\n')]
import os import subprocess import tempfile from typing import Any, List import prefect from prefect.utilities.tasks import defaults_from_attrs class ShellTask(prefect.Task): """ Task for running arbitrary shell commands. Args: - command (string, optional): shell command to be executed; can also...
[ "subprocess.check_output", "os.environ.copy", "prefect.engine.signals.FAIL", "tempfile.NamedTemporaryFile", "prefect.utilities.tasks.defaults_from_attrs" ]
[((1750, 1787), 'prefect.utilities.tasks.defaults_from_attrs', 'defaults_from_attrs', (['"""command"""', '"""env"""'], {}), "('command', 'env')\n", (1769, 1787), False, 'from prefect.utilities.tasks import defaults_from_attrs\n'), ((2701, 2718), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (2716, 2718), Fals...
"""See out_of_range_error.__doc__.""" def out_of_range_error(stdscr, length): # noqa: D205, D400 """Print and out of range error message with the list of numbers based on the integer length. Args: length: The length of the listing of valid integer inputs. """ numbers = [] ...
[ "curses.endwin" ]
[((674, 689), 'curses.endwin', 'curses.endwin', ([], {}), '()\n', (687, 689), False, 'import curses\n')]
import requests import pandas def get_bool(prompt): while True: try: return {"true":True, "t": True, "false":False, "f":False, "yes":True, "no":False, "y":True, "n":False}[input(prompt).lower()] except KeyError: print("Invalid input, please enter True or False") def get_yea...
[ "pandas.DataFrame", "requests.get" ]
[((2354, 2371), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2366, 2371), False, 'import requests\n'), ((3812, 3829), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (3824, 3829), False, 'import requests\n'), ((5686, 5713), 'pandas.DataFrame', 'pandas.DataFrame', (['full_list'], {}), '(full_list...
# Generated by Django 3.1.2 on 2020-10-26 07:53 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
[ "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.migrations.swappable_dependency", "django.db.models.CharField" ]
[((276, 333), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (307, 333), False, 'from django.db import migrations, models\n'), ((462, 555), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)...
import unittest import gamedatacrunch class TestCompatibilityMethods(unittest.TestCase): def get_dummy_app_id(self): dummy_app_id = 730 return dummy_app_id def get_dummy_app_name(self): dummy_app_name = "Counter-Strike: Global Offensive" return dummy_app_name def get_dum...
[ "unittest.main", "gamedatacrunch.load_as_steamspy_api", "gamedatacrunch.convert_app_dict", "gamedatacrunch.load_as_steam_api" ]
[((2358, 2373), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2371, 2373), False, 'import unittest\n'), ((752, 811), 'gamedatacrunch.convert_app_dict', 'gamedatacrunch.convert_app_dict', (['gdc_app'], {'include_slug': '(True)'}), '(gdc_app, include_slug=True)\n', (783, 811), False, 'import gamedatacrunch\n'), ((...
import unittest from torchvision import transforms # (Ugly) Path hack. #TODO - get rid of it import sys, os; sys.path.insert(0, os.path.abspath('.')) from dataprocessor import MyDatasetDoc from dataprocessor.dataset import MyDatasetCorner, SmartDoc, SmartDocCorner from utils import draw_circle_pil, get_concat_h clas...
[ "utils.get_concat_h", "torchvision.transforms.ToPILImage", "dataprocessor.MyDatasetDoc", "unittest.main", "dataprocessor.dataset.SmartDoc", "os.path.abspath", "dataprocessor.dataset.MyDatasetCorner.from_directory", "dataprocessor.dataset.SmartDocCorner" ]
[((129, 149), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (144, 149), False, 'import sys, os\n'), ((3269, 3284), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3282, 3284), False, 'import unittest\n'), ((407, 479), 'dataprocessor.MyDatasetDoc', 'MyDatasetDoc', (['"""/home/mhadar/projects/d...
import requests, re import json, time, sys, os from functools import reduce from VocaloidParse import vocaloidparser class rankitem(object): def __init__(self, aid, title, parsedtitle, singers, author): self.title = title self.aid = aid self.parsedtitle = parsedtitle self.singers = ...
[ "json.loads", "VocaloidParse.vocaloidparser", "time.sleep", "requests.get", "sys.exit" ]
[((1355, 1372), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1367, 1372), False, 'import requests, re\n'), ((1388, 1412), 'json.loads', 'json.loads', (['wb_data.text'], {}), '(wb_data.text)\n', (1398, 1412), False, 'import json, time, sys, os\n'), ((2048, 2065), 'requests.get', 'requests.get', (['url'], {...
from utils import eda, eda_plotting import ipywidgets as widgets import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def check1(): eda_iv = eda_plotting.Eda_Plotting() check1()
[ "utils.eda_plotting.Eda_Plotting" ]
[((186, 213), 'utils.eda_plotting.Eda_Plotting', 'eda_plotting.Eda_Plotting', ([], {}), '()\n', (211, 213), False, 'from utils import eda, eda_plotting\n')]
# Generated by Django 3.1.5 on 2021-01-13 20:59 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Project', fields=[ ...
[ "django.db.models.DateTimeField", "django.db.models.AutoField", "django.db.models.CharField", "django.db.models.ForeignKey" ]
[((336, 429), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (352, 429), False, 'from django.db import migrations, models\...
import math AB, BC = int(input()), int(input()) print(str(int(round(math.degrees(math.atan2(AB,BC)))))+chr(176))
[ "math.atan2" ]
[((82, 100), 'math.atan2', 'math.atan2', (['AB', 'BC'], {}), '(AB, BC)\n', (92, 100), False, 'import math\n')]
# Copyright: (c) 2018, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = r""" lookup: aws_secret author: - <NAME> <<EMAIL>> version_added: "2.8" require...
[ "boto3.session.Session", "ansible.module_utils._text.to_native", "ansible.errors.AnsibleError", "botocore.session.get_session" ]
[((1805, 1871), 'ansible.errors.AnsibleError', 'AnsibleError', (['"""The lookup aws_secret requires boto3 and botocore."""'], {}), "('The lookup aws_secret requires boto3 and botocore.')\n", (1817, 1871), False, 'from ansible.errors import AnsibleError\n'), ((3358, 3388), 'botocore.session.get_session', 'botocore.sessi...
# https://leetcode.com/problems/split-a-string-in-balanced-strings/ # Balanced strings are those that have an equal quantity of 'L' and 'R' characters. # Given a balanced string s, split it in the maximum amount of balanced strings. # Return the maximum amount of split balanced strings. import pytest class Solution:...
[ "pytest.mark.parametrize" ]
[((696, 858), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('s', 'expected')", "[('LR', 1), ('RRLLLLRR', 2), ('RLRRLLRLRL', 4), ('LLRRLLRRLLLRRRRL', 4), (\n 'RLLLLRRRLR', 3), ('LLLLRRRR', 1)]"], {}), "(('s', 'expected'), [('LR', 1), ('RRLLLLRR', 2), (\n 'RLRRLLRLRL', 4), ('LLRRLLRRLLLRRRRL', 4), ('RLL...
import socket import struct from threading import Thread from python_qt_binding.QtCore import QMutex, QMutexLocker, QTimer from qt_gui.plugin import Plugin from pymavlink.mavutil import mavlink_connection from pymavlink.dialects.v10.ardupilotmega \ import MAVLink_global_position_int_message from pymavlink.dialect...
[ "pymavlink.mavutil.mavlink_connection", "python_qt_binding.QtCore.QMutex", "uctf.widget.Widget", "python_qt_binding.QtCore.QMutexLocker", "struct.pack", "struct.unpack", "python_qt_binding.QtCore.QTimer", "threading.Thread" ]
[((660, 668), 'uctf.widget.Widget', 'Widget', ([], {}), '()\n', (666, 668), False, 'from uctf.widget import Widget\n'), ((944, 952), 'python_qt_binding.QtCore.QMutex', 'QMutex', ([], {}), '()\n', (950, 952), False, 'from python_qt_binding.QtCore import QMutex, QMutexLocker, QTimer\n'), ((1194, 1202), 'python_qt_binding...
import tensorflow as tf def ridge(alpha, beta, family): return tf.reduce_sum(tf.square(beta)) def lasso(alpha, beta, family): return tf.reduce_sum(tf.abs(beta)) def network_fusion_x(graph): graph = tf.cast(graph, tf.float32) def tmp(alpha, beta, family): return tf.linalg.trace(tf.matmul(t...
[ "tensorflow.transpose", "tensorflow.matmul", "tensorflow.square", "tensorflow.cast", "tensorflow.abs" ]
[((216, 242), 'tensorflow.cast', 'tf.cast', (['graph', 'tf.float32'], {}), '(graph, tf.float32)\n', (223, 242), True, 'import tensorflow as tf\n'), ((423, 449), 'tensorflow.cast', 'tf.cast', (['graph', 'tf.float32'], {}), '(graph, tf.float32)\n', (430, 449), True, 'import tensorflow as tf\n'), ((83, 98), 'tensorflow.sq...
#!/usr/bin/env python3 import sys #import math import csv allpackages = eval(sys.stdin.read()) alltests = [] for p in allpackages: alltests = alltests + p['tests'] p['nsubtests'] = sum(len(t['subtests']) for t in p['tests']) subtests = [] for t in alltests: for st in t['subtests']: st['testname']...
[ "sys.stdin.read", "csv.writer" ]
[((79, 95), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (93, 95), False, 'import sys\n'), ((467, 486), 'csv.writer', 'csv.writer', (['csvfile'], {}), '(csvfile)\n', (477, 486), False, 'import csv\n'), ((916, 935), 'csv.writer', 'csv.writer', (['csvfile'], {}), '(csvfile)\n', (926, 935), False, 'import csv\n')...
import logging import os import sys from logging.handlers import SysLogHandler from dotenv import load_dotenv from helperBot.TelegramController import TelegramController from helperBot.DataBaseController import DataBaseController console_handler = logging.StreamHandler() handlers = [console_handler] SYSLOG_ADDRESS =...
[ "logging.getLogger", "logging.StreamHandler", "os.getenv", "dotenv.load_dotenv", "helperBot.TelegramController.TelegramController", "helperBot.DataBaseController.DataBaseController", "logging.handlers.SysLogHandler" ]
[((250, 273), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (271, 273), False, 'import logging\n'), ((321, 352), 'os.getenv', 'os.getenv', (['"""SYSLOG_ADDRESS"""', '""""""'], {}), "('SYSLOG_ADDRESS', '')\n", (330, 352), False, 'import os\n'), ((825, 852), 'logging.getLogger', 'logging.getLogger',...
import numpy as np from sympy import sin, Abs from devito import (Grid, Inc, Operator, Function, SubDomain, Eq, SubDimension, ConditionalDimension, switchconfig) from devito.tools import memoized_meth __all__ = ['Model'] def initialize_damp(damp, nbpml, spacing, mask=False): """ Initial...
[ "sympy.sin", "devito.SubDimension.left", "devito.ConditionalDimension", "devito.Function", "devito.Operator", "numpy.log", "numpy.max", "numpy.array", "devito.Eq", "numpy.min", "devito.SubDimension.right", "devito.Grid" ]
[((955, 1025), 'devito.SubDimension.left', 'SubDimension.left', ([], {'name': "('abc_%s_l' % d.name)", 'parent': 'd', 'thickness': 'nbpml'}), "(name='abc_%s_l' % d.name, parent=d, thickness=nbpml)\n", (972, 1025), False, 'from devito import Grid, Inc, Operator, Function, SubDomain, Eq, SubDimension, ConditionalDimensio...
# Generated by Django 3.1.3 on 2020-12-01 00:50 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('shipping', '0003_auto_20190322_1429'), ('catalog', '0001_initial'), ] operations = [ ...
[ "django.db.models.GenericIPAddressField", "django.db.models.EmailField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.models.DecimalField", "django.db.models.CharField" ]
[((420, 513), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (436, 513), False, 'from django.db import migrations, models\...
from django.shortcuts import render # Create your views here. def ai_coin_identifier_home_page(request): return render(request, 'ai_coin_identifier/index.html')
[ "django.shortcuts.render" ]
[((118, 166), 'django.shortcuts.render', 'render', (['request', '"""ai_coin_identifier/index.html"""'], {}), "(request, 'ai_coin_identifier/index.html')\n", (124, 166), False, 'from django.shortcuts import render\n')]
#!/people/chen423/sw/anaconda3/bin/python import numpy as np import xarray as xr import scipy.io as sio import sys scenario = 'HIST' year = int(sys.argv[1]) month = int(sys.argv[2]) para_b = int(10) def compute_moisture_intensity(in_ARtag, in_uIVT, in_ET, ref_mask): uIVT_total = in_uIVT[:,0][in_ARtag[:,0]==1].s...
[ "scipy.io.savemat", "numpy.floor", "numpy.zeros", "xarray.open_dataset", "numpy.arange" ]
[((1654, 1666), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1662, 1666), True, 'import numpy as np\n'), ((1678, 1690), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1686, 1690), True, 'import numpy as np\n'), ((1704, 1716), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1712, 1716), True, 'import num...
from fastapi import APIRouter router = APIRouter() @router.get("/") def get_current_mode(): return "TBD" @router.get("/wifi_console") def switch_to_wifi_console_mode(): return "TBD" @router.get("/hotspot") def switch_to_hotspot_mode(): return "TBD" @router.get("/wiperf") def switch_to_wiperf_mode()...
[ "fastapi.APIRouter" ]
[((40, 51), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (49, 51), False, 'from fastapi import APIRouter\n')]
import random import math import csv import pickle import os import numpy as np from .helpers.transforms import is_valid_vertical_offset, deg2rad controller_dir = os.path.dirname(os.path.realpath(__file__)) TEST_CASES_PKL = os.path.join(controller_dir, "test_cases/test_cases.pkl") TEST_CASES_CSV = os.path.join(contr...
[ "csv.DictWriter", "random.choice", "pickle.dump", "os.path.join", "pickle.load", "os.path.realpath", "numpy.linalg.norm", "numpy.arange" ]
[((227, 284), 'os.path.join', 'os.path.join', (['controller_dir', '"""test_cases/test_cases.pkl"""'], {}), "(controller_dir, 'test_cases/test_cases.pkl')\n", (239, 284), False, 'import os\n'), ((302, 359), 'os.path.join', 'os.path.join', (['controller_dir', '"""test_cases/test_cases.csv"""'], {}), "(controller_dir, 'te...
from random import randint from django.db import models from django.core.mail import EmailMessage from django.contrib.auth.models import PermissionsMixin from django.contrib.auth.base_user import AbstractBaseUser from django.utils.translation import gettext_lazy as _ from mentorbot.usermanager import UserManager clas...
[ "django.db.models.OneToOneField", "random.randint", "django.db.models.TextField", "django.utils.translation.gettext_lazy", "django.db.models.BooleanField", "django.db.models.ImageField", "django.db.models.DateTimeField", "django.core.mail.EmailMessage", "django.db.models.CharField", "mentorbot.use...
[((504, 559), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)', 'blank': '(True)', 'null': '(True)'}), '(max_length=128, blank=True, null=True)\n', (520, 559), False, 'from django.db import models\n'), ((579, 613), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(F...
""" ======================================================= Reconstruction with Constrained Spherical Deconvolution ======================================================= This example shows how to use Constrained Spherical Deconvolution (CSD) introduced by Tournier et al. [Tournier2007]_. This method is mainly usefu...
[ "numpy.mean", "dipy.data.fetch_stanford_hardi", "dipy.reconst.dti.fractional_anisotropy", "dipy.reconst.dti.TensorModel", "dipy.viz.fvtk.sphere_funcs", "numpy.where", "dipy.data.get_sphere", "numpy.array", "dipy.viz.fvtk.add", "numpy.isnan", "numpy.nonzero", "dipy.reconst.csdeconv.ConstrainedS...
[((770, 792), 'dipy.data.fetch_stanford_hardi', 'fetch_stanford_hardi', ([], {}), '()\n', (790, 792), False, 'from dipy.data import fetch_stanford_hardi, read_stanford_hardi\n'), ((805, 826), 'dipy.data.read_stanford_hardi', 'read_stanford_hardi', ([], {}), '()\n', (824, 826), False, 'from dipy.data import fetch_stanfo...
###################################################################### # # # Copyright 2009-2019 <NAME>. # # This file is part of gdspy, distributed under the terms of the # # Boost Software License - Version 1.0. See the accom...
[ "gdspy._hobby", "numpy.abs", "numpy.arccos", "gdspy._zero.reshape", "gdspy._func_bezier", "numpy.array", "numpy.linspace", "numpy.empty_like", "numpy.vstack", "numpy.cos", "numpy.empty", "numpy.sin", "numpy.sign" ]
[((3112, 3136), 'numpy.array', 'numpy.array', (['self.points'], {}), '(self.points)\n', (3123, 3136), False, 'import numpy\n'), ((7440, 7526), 'numpy.linspace', 'numpy.linspace', (['(initial_angle - rotation)', '(final_angle - rotation)', 'number_of_points'], {}), '(initial_angle - rotation, final_angle - rotation,\n ...
from unittest import TestCase from mock import patch, Mock from torch import nn from torchbearer.callbacks.manifold_mixup import ManifoldMixup import torchbearer import torch class TestModule(nn.Module): def __init__(self): super(TestModule, self).__init__() self.conv = nn.Conv1d(1, 1, 1) ...
[ "torch.nn.ReLU", "mock.patch", "torchbearer.callbacks.manifold_mixup._mixup_inputs", "torch.Tensor", "torchbearer.callbacks.manifold_mixup.ManifoldMixup", "torch.nn.BatchNorm1d", "torch.nn.Linear", "torch.nn.Conv1d", "torch.rand" ]
[((5947, 6038), 'mock.patch', 'patch', (['"""torchbearer.callbacks.manifold_mixup._mixup_inputs"""'], {'side_effect': '(lambda x, _: x)'}), "('torchbearer.callbacks.manifold_mixup._mixup_inputs', side_effect=lambda\n x, _: x)\n", (5952, 6038), False, 'from mock import patch, Mock\n'), ((6426, 6478), 'mock.patch', 'p...
import numpy as np import cv2 import glob import helpers warping_from = np.float32([[200, 720], [604, 450], [696, 450], [1120, 720]]) warping_to = np.float32([[200, 720], [200, 0], [1120, 0], [1120, 720]]) def calibrate(): criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) objp = np.z...
[ "cv2.getPerspectiveTransform", "cv2.undistort", "cv2.getOptimalNewCameraMatrix", "numpy.zeros", "cv2.warpPerspective", "cv2.cvtColor", "cv2.calibrateCamera", "cv2.findChessboardCorners", "cv2.resize", "cv2.cornerSubPix", "cv2.imread", "numpy.float32", "glob.glob" ]
[((73, 134), 'numpy.float32', 'np.float32', (['[[200, 720], [604, 450], [696, 450], [1120, 720]]'], {}), '([[200, 720], [604, 450], [696, 450], [1120, 720]])\n', (83, 134), True, 'import numpy as np\n'), ((148, 206), 'numpy.float32', 'np.float32', (['[[200, 720], [200, 0], [1120, 0], [1120, 720]]'], {}), '([[200, 720],...
from wagtail.admin.edit_handlers import FieldPanel from wagtail.contrib.modeladmin.views import CreateView, EditView from .models import InvestmentCategorySettings class CreateInvestmentView(CreateView): def get_form_kwargs(self): kwargs = super(CreateInvestmentView, self).get_form_kwargs() kwarg...
[ "wagtail.admin.edit_handlers.FieldPanel" ]
[((710, 732), 'wagtail.admin.edit_handlers.FieldPanel', 'FieldPanel', (['field_name'], {}), '(field_name)\n', (720, 732), False, 'from wagtail.admin.edit_handlers import FieldPanel\n'), ((1568, 1590), 'wagtail.admin.edit_handlers.FieldPanel', 'FieldPanel', (['field_name'], {}), '(field_name)\n', (1578, 1590), False, 'f...
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-02 19:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
[ "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DecimalField", "django.db.models.CharField" ]
[((402, 495), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (418, 495), False, 'from django.db import migrations, models\...
import requests import pandas import numpy import urllib.request from lxml import etree import time import os import logging logging.basicConfig(filename='spider_log.log',level=logging.DEBUG) start_page = 0 end_page = 200 book_number = 9140 # cookie_str = 'auth_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOiIyM...
[ "logging.basicConfig", "os.makedirs", "logging.warning", "time.sleep", "requests.get", "os.path.isdir", "lxml.etree.HTML", "logging.info" ]
[((126, 193), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""spider_log.log"""', 'level': 'logging.DEBUG'}), "(filename='spider_log.log', level=logging.DEBUG)\n", (145, 193), False, 'import logging\n'), ((1082, 1197), 'logging.info', 'logging.info', (["('Start downloading book %d, start from page %...
from multiprocessing import Process from typing import Any, Dict, Optional from fastapi import FastAPI from pydantic import BaseModel from starlette.responses import RedirectResponse from typing_extensions import Literal from .cluster_process import ClusterProcessProxy class ResponseMessage(BaseModel): message:...
[ "starlette.responses.RedirectResponse", "uvicorn.run" ]
[((2071, 2116), 'starlette.responses.RedirectResponse', 'RedirectResponse', ([], {'url': 'f"""{app.root_path}/docs"""'}), "(url=f'{app.root_path}/docs')\n", (2087, 2116), False, 'from starlette.responses import RedirectResponse\n'), ((5147, 5178), 'uvicorn.run', 'uvicorn.run', (['self.app'], {}), '(self.app, **kwargs)\...
import sys import os sys.path.append('..') sys.path.append('../common') print('PATH:', os.environ['PATH']) print('py', os.environ['PYTHONPATH']) from train_setup import * from tensorflow.keras.optimizers import Adam from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint import time def data_generator(): ...
[ "tensorflow.keras.callbacks.TensorBoard", "time.time", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.ModelCheckpoint", "sys.path.append" ]
[((21, 42), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (36, 42), False, 'import sys\n'), ((43, 71), 'sys.path.append', 'sys.path.append', (['"""../common"""'], {}), "('../common')\n", (58, 71), False, 'import sys\n'), ((3418, 3492), 'tensorflow.keras.optimizers.Adam', 'Adam', ([], {'lr': 'LEA...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-03 14:10 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('UserManagement', '0006_auto_20170303_1238'), ] operations = [ migrations.Cr...
[ "django.db.models.URLField", "django.db.models.AutoField", "django.db.models.CharField", "django.db.models.IntegerField" ]
[((1206, 1249), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(10)'}), "(default='', max_length=10)\n", (1222, 1249), False, 'from django.db import migrations, models\n'), ((1413, 1498), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'null': '(True...
import onmt import numpy as np import argparse import torch import codecs import json import sys import csv parser = argparse.ArgumentParser(description='preprocess.py') ## ## **Preprocess Options** ## parser.add_argument('-config', help="Read options from this file") parser.add_argument('-train_src', required=T...
[ "torch.manual_seed", "argparse.ArgumentParser", "torch.from_numpy", "onmt.Dict", "torch.save", "codecs.open", "csv.reader" ]
[((118, 170), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""preprocess.py"""'}), "(description='preprocess.py')\n", (141, 170), False, 'import argparse\n'), ((1524, 1551), 'torch.manual_seed', 'torch.manual_seed', (['opt.seed'], {}), '(opt.seed)\n', (1541, 1551), False, 'import torch\n'...
# Generated by Django 2.2.19 on 2021-04-10 14:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('repeaters', '0003_migrate_connectionsettings'), ] operations = [ migrations.AlterField( model_name='sqlrepeatrecordattempt', ...
[ "django.db.models.TextField" ]
[((364, 404), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'default': '""""""'}), "(blank=True, default='')\n", (380, 404), False, 'from django.db import migrations, models\n'), ((545, 585), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'default': '""""""'}), "...
def error(): from colorama import Fore from os import system system("clear") print(Fore.BLUE + """ A problem has occured and HybridOS needs to shut down. We will shut down and display the error when you press enter. We're sorry if we caused any inconvenience. == TEST BEGIN == { T0cgPSBUcnVlCk1PRCA9I...
[ "os.system" ]
[((65, 80), 'os.system', 'system', (['"""clear"""'], {}), "('clear')\n", (71, 80), False, 'from os import system\n')]
import argparse from collections import Counter, OrderedDict from prenlp.tokenizer import * TOKENIZER = {'nltk_moses': NLTKMosesTokenizer(), 'mecab' : Mecab()} class Vocab: """Defines a vocabulary object that will be used to numericalize text. Args: vocab_size (int) : the max...
[ "collections.Counter", "collections.OrderedDict", "argparse.ArgumentParser" ]
[((3445, 3470), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3468, 3470), False, 'import argparse\n'), ((1071, 1080), 'collections.Counter', 'Counter', ([], {}), '()\n', (1078, 1080), False, 'from collections import Counter, OrderedDict\n'), ((1102, 1115), 'collections.OrderedDict', 'Ordered...
import logging import unittest from velocityhelper.api.surfacemodel import SurfaceModel from velocityhelper.api.isomodel import IsoModel logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) class IsoModelTest(unittest.TestCase): def test_getList(self): result = IsoModel() ...
[ "logging.basicConfig", "velocityhelper.api.isomodel.IsoModel", "logging.getLogger" ]
[((140, 180), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (159, 180), False, 'import logging\n'), ((190, 217), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (207, 217), False, 'import logging\n'), ((305, 315), 'velocityhelper...
# FILE: autoload/conque_term/conque_sole_shared_memory.py # AUTHOR: <NAME> <<EMAIL>> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 <NAME> # # MIT License # # Permission is hereby granted, f...
[ "pickle.loads", "pickle.dumps", "mmap.mmap" ]
[((4050, 4114), 'mmap.mmap', 'mmap.mmap', (['(0)', '(self.mem_size * self.char_width)', 'name', 'mmap_access'], {}), '(0, self.mem_size * self.char_width, name, mmap_access)\n', (4059, 4114), False, 'import mmap\n'), ((4907, 4928), 'pickle.loads', 'pickle.loads', (['shm_str'], {}), '(shm_str)\n', (4919, 4928), False, '...
import numpy as np from collections import defaultdict import sys import argparse # we rely on ordered dictionaries here assert sys.version_info >= (3, 6) def read_fasta(fasta_path, alphabet='ACDEFGHIKLMNPQRSTVWY-', default_index=20): # read all the sequences into a dictionary seq_dict = {} with open(fa...
[ "numpy.unique", "argparse.ArgumentParser", "numpy.array", "numpy.zeros", "numpy.sum" ]
[((984, 1012), 'numpy.array', 'np.array', (['seq_msa'], {'dtype': 'int'}), '(seq_msa, dtype=int)\n', (992, 1012), True, 'import numpy as np\n'), ((1059, 1082), 'numpy.zeros', 'np.zeros', (['seq_msa.shape'], {}), '(seq_msa.shape)\n', (1067, 1082), True, 'import numpy as np\n'), ((1473, 1491), 'numpy.sum', 'np.sum', (['s...
# Python modules # 3rd party modules import wx #import wx.aui as aui import wx.lib.agw.aui as aui # NB. wx.aui version throws odd wxWidgets exception on Close/Exit ?? Not anymore in wxPython 4.0.6 ?? # Our modules import vespa.common.wx_gravy.util as wx_util """This module contains two classes that are su...
[ "wx.lib.agw.aui.AuiNotebook.__init__", "wx.Notebook.__init__", "wx.Size" ]
[((5125, 5163), 'wx.lib.agw.aui.AuiNotebook.__init__', 'aui.AuiNotebook.__init__', (['self', 'parent'], {}), '(self, parent)\n', (5149, 5163), True, 'import wx.lib.agw.aui as aui\n'), ((5979, 6013), 'wx.Notebook.__init__', 'wx.Notebook.__init__', (['self', 'parent'], {}), '(self, parent)\n', (5999, 6013), False, 'impor...
import pyblish.api import openpype.api from openpype.pipeline import PublishXmlValidationError class ValidateTextureBatchWorkfiles(pyblish.api.InstancePlugin): """Validates that textures workfile has collected resources (optional). Collected resources means secondary workfiles (in most cases). """ ...
[ "openpype.pipeline.PublishXmlValidationError" ]
[((1251, 1320), 'openpype.pipeline.PublishXmlValidationError', 'PublishXmlValidationError', (['self', 'msg'], {'formatting_data': 'formatting_data'}), '(self, msg, formatting_data=formatting_data)\n', (1276, 1320), False, 'from openpype.pipeline import PublishXmlValidationError\n')]
#!/usr/bin/bash python import argparse import os import sys import urllib.request import urllib.error from colours import TerminalColours from concurrent.futures import as_completed, ThreadPoolExecutor from http.client import HTTPMessage from socket import timeout from typing import Callable, List from output import...
[ "os.path.isabs", "argparse.ArgumentParser", "concurrent.futures.ThreadPoolExecutor", "output.write_file", "os.getcwd", "concurrent.futures.as_completed", "output.write_stdout_uni", "os.path.isdir", "output.write_stdout", "output.write_file_uni", "sys.exit", "output.uni_file_heading" ]
[((2721, 2746), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2744, 2746), False, 'import argparse\n'), ((3128, 3147), 'os.path.isabs', 'os.path.isabs', (['path'], {}), '(path)\n', (3141, 3147), False, 'import os\n'), ((2388, 2414), 'os.path.isdir', 'os.path.isdir', (['args.output'], {}), '(a...
import unittest from app import create_app from app.api.v2.models.users import Db class BaseTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.db_obj = Db() self.db_obj.drop_all_tables() self.db_obj.create_tables() self.client = self.app....
[ "unittest.main", "app.api.v2.models.users.Db", "app.create_app" ]
[((4218, 4244), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (4231, 4244), False, 'import unittest\n'), ((164, 185), 'app.create_app', 'create_app', (['"""testing"""'], {}), "('testing')\n", (174, 185), False, 'from app import create_app\n'), ((208, 212), 'app.api.v2.models.users.Db'...
import argparse import sys from tqdm import tqdm import json import subprocess import os import random import numpy as np import torch from sklearn.metrics import (roc_auc_score, auc, precision_recall_curve, r2_score, accuracy_score, log_loss) # optimization goal for various metrics METRI...
[ "sklearn.metrics.auc", "sklearn.metrics.roc_auc_score", "numpy.array", "sklearn.metrics.log_loss", "numpy.bitwise_not", "sklearn.metrics.r2_score", "argparse.ArgumentParser", "subprocess.Popen", "sys.stdout.flush", "random.shuffle", "sklearn.metrics.precision_recall_curve", "torch.einsum", "...
[((1393, 1403), 'tqdm.tqdm', 'tqdm', (['iter'], {}), '(iter)\n', (1397, 1403), False, 'from tqdm import tqdm\n'), ((2389, 2407), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (2405, 2407), False, 'import sys\n'), ((2578, 2635), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'shell': '(True)', 'executabl...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
[ "pretend.call_recorder", "warehouse.organizations.tasks.update_organization_invitation_status", "pretend.stub", "pretend.call", "pretend.raiser" ]
[((1274, 1327), 'pretend.call_recorder', 'pretend.call_recorder', (['(lambda *a, **kw: token_service)'], {}), '(lambda *a, **kw: token_service)\n', (1295, 1327), False, 'import pretend\n'), ((1337, 1386), 'warehouse.organizations.tasks.update_organization_invitation_status', 'update_organization_invitation_status', (['...
import discord from discord.ext import commands color = 0xf79805 format = "%a, %d %b %Y | %H:%M:%S %ZGMT" class Userinfo(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def userinfo(self, ctx, member: discord.Member = None): channel = ctx.channel ...
[ "discord.Embed", "discord.ext.commands.command" ]
[((198, 216), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (214, 216), False, 'from discord.ext import commands\n'), ((572, 756), 'discord.Embed', 'discord.Embed', ([], {'title': 'f"""📚 Informações de {ctx.author.name}."""', 'description': 'f"""**User ID:** {id}\n**Entrou aqui em:** {join}\n**...
from estimagic import get_benchmark_problems from estimagic.benchmarking.run_benchmark import run_benchmark def test_run_benchmark_dict_options(tmpdir): all_problems = get_benchmark_problems("more_wild") first_two_names = list(all_problems)[:2] first_two = {name: all_problems[name] for name in first_two_n...
[ "estimagic.get_benchmark_problems", "estimagic.benchmarking.run_benchmark.run_benchmark" ]
[((174, 209), 'estimagic.get_benchmark_problems', 'get_benchmark_problems', (['"""more_wild"""'], {}), "('more_wild')\n", (196, 209), False, 'from estimagic import get_benchmark_problems\n'), ((621, 730), 'estimagic.benchmarking.run_benchmark.run_benchmark', 'run_benchmark', ([], {'problems': 'first_two', 'optimize_opt...
#! /use/env/bin python import os import copy from collections import OrderedDict from CP2K_kit.tools import data_op from CP2K_kit.tools import log_info from CP2K_kit.tools import traj_info def check_step(init_step, end_step, start_frame_id, end_frame_id): ''' check_step: check the input step Args: init_st...
[ "collections.OrderedDict", "CP2K_kit.tools.data_op.get_id_list", "CP2K_kit.tools.log_info", "CP2K_kit.tools.data_op.str_to_bool", "CP2K_kit.tools.data_op.eval_str", "CP2K_kit.tools.data_op.split_str", "CP2K_kit.tools.traj_info.get_traj_info", "CP2K_kit.tools.log_info.log_error", "copy.deepcopy", "...
[((1498, 1523), 'copy.deepcopy', 'copy.deepcopy', (['center_dic'], {}), '(center_dic)\n', (1511, 1523), False, 'import copy\n'), ((33649, 33676), 'copy.deepcopy', 'copy.deepcopy', (['lmp2cp2k_dic'], {}), '(lmp2cp2k_dic)\n', (33662, 33676), False, 'import copy\n'), ((37864, 37886), 'copy.deepcopy', 'copy.deepcopy', (['r...
# # Collective Knowledge () # # # # # Developer: # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) ck=None # Will be updated by CK (initialized CK kernel) import os import sys import json import re import pandas as pd import numpy as np # Local s...
[ "json.dumps", "os.path.join", "json.load", "pandas.DataFrame", "pandas.MultiIndex.from_tuples", "pandas.concat" ]
[((4588, 4611), 'json.dumps', 'json.dumps', (['i'], {'indent': '(2)'}), '(i, indent=2)\n', (4598, 4611), False, 'import json\n'), ((12974, 12988), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\n', (12983, 12988), True, 'import pandas as pd\n'), ((10053, 10067), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\...
import os import pandas as pd import numpy as np import altair as alt import json import os # npm install vega-lite vega-cli canvas class BarGraph: def __init__(self, yearly_data): self.yearly_data = yearly_data def build_graph(self): with open(os.path.join(os.path.dirname(__file__)...
[ "altair.Chart", "altair.Axis", "os.path.dirname", "altair.X", "altair.Column", "json.load", "altair.Scale" ]
[((365, 377), 'json.load', 'json.load', (['f'], {}), '(f)\n', (374, 377), False, 'import json\n'), ((295, 320), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (310, 320), False, 'import os\n'), ((2995, 3020), 'altair.X', 'alt.X', (['"""c2:N"""'], {'title': 'None'}), "('c2:N', title=None)\n", ...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of...
[ "shlex.split", "primaires.interpreteur.masque.parametre.Parametre.__init__", "argparse.ArgumentParser" ]
[((3687, 3729), 'primaires.interpreteur.masque.parametre.Parametre.__init__', 'Parametre.__init__', (['self', '"""ajouter"""', '"""add"""'], {}), "(self, 'ajouter', 'add')\n", (3705, 3729), False, 'from primaires.interpreteur.masque.parametre import Parametre\n'), ((4453, 4504), 'argparse.ArgumentParser', 'argparse.Arg...
import unittest import unittest.mock from unittest.mock import patch from programy.extensions.maps.maps import GoogleMapsExtension from programy.utils.geo.google import GoogleDistance from programy.utils.geo.google import GoogleMaps from programytest.client import TestClient from programytest.extensions.maps.payloads i...
[ "programytest.client.TestClient", "unittest.mock.Mock", "programy.extensions.maps.maps.GoogleMapsExtension", "programy.utils.geo.google.GoogleDistance", "unittest.mock.patch" ]
[((3977, 4096), 'unittest.mock.patch', 'patch', (['"""programy.utils.geo.google.GoogleMaps.get_distance_between_addresses"""', 'patch_get_distance_between_addresses1'], {}), "('programy.utils.geo.google.GoogleMaps.get_distance_between_addresses',\n patch_get_distance_between_addresses1)\n", (3982, 4096), False, 'fro...
from functools import update_wrapper from django.conf.urls import url from django.core.paginator import Paginator from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.encoding import escape_uri_path, iri_to_uri from django.utils.t...
[ "django.http.HttpResponseRedirect", "django.utils.encoding.escape_uri_path", "django.utils.translation.ugettext_lazy", "django.contrib.admin.views.main.ChangeList", "django.contrib.admin.utils.unquote", "functools.update_wrapper" ]
[((3555, 3565), 'django.utils.translation.ugettext_lazy', '_', (['u"""Move"""'], {}), "(u'Move')\n", (3556, 3565), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((12043, 12053), 'django.utils.translation.ugettext_lazy', '_', (['u"""Move"""'], {}), "(u'Move')\n", (12044, 12053), True, 'from django....
import gradio as gr import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import cross_val_score from sklearn.neighbors import KNeighborsClassifier def load_data(): ''' Загрузка данных ''' data = pd.read_csv('data/occupancy_datatraining.txt',...
[ "numpy.mean", "gradio.Interface", "pandas.read_csv", "gradio.outputs.Label", "sklearn.neighbors.KNeighborsClassifier", "gradio.outputs.Textbox", "gradio.outputs.KeyValues", "gradio.inputs.Slider", "sklearn.preprocessing.MinMaxScaler" ]
[((1410, 1502), 'gradio.inputs.Slider', 'gr.inputs.Slider', ([], {'minimum': '(1)', 'maximum': '(300)', 'step': '(1)', 'default': '(5)', 'label': '"""Количество соседей"""'}), "(minimum=1, maximum=300, step=1, default=5, label=\n 'Количество соседей')\n", (1426, 1502), True, 'import gradio as gr\n'), ((1510, 1600), ...
""" Load a part config for inclusion into whole config """ import numpy as np from dlpoly.config import Atom from dlpoly.field import Molecule from dlpoly.utility import read_line, build_3d_rotation_matrix class CFG(Molecule): ''' Load a partial configuration ''' def __init__(self, source=None): Molec...
[ "dlpoly.utility.build_3d_rotation_matrix", "numpy.asarray", "numpy.max", "numpy.sum", "numpy.matmul", "numpy.min", "dlpoly.utility.read_line", "dlpoly.field.Molecule.__init__" ]
[((315, 338), 'dlpoly.field.Molecule.__init__', 'Molecule.__init__', (['self'], {}), '(self)\n', (332, 338), False, 'from dlpoly.field import Molecule\n'), ((1334, 1385), 'dlpoly.utility.build_3d_rotation_matrix', 'build_3d_rotation_matrix', (['alpha', 'beta', 'gamma', '"""deg"""'], {}), "(alpha, beta, gamma, 'deg')\n"...
""" Copyright (c) 2021, Electric Power Research Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this...
[ "ramp_rate_optimization.optimize_params", "pandas.read_csv", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "pandas.date_range" ]
[((1696, 1712), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (1705, 1712), True, 'import matplotlib.pyplot as plt\n'), ((4737, 4805), 'ramp_rate_optimization.optimize_params', 'ramp_rate_optimization.optimize_params', (["df['Power_scaled']", 'settings'], {}), "(df['Power_scaled'], settings)...
from django.contrib.auth.models import User, Group from rest_framework import serializers from delivery.models import Pizza, Order class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('username', 'id', 'url') class PizzaSerializer(serializers.Hyperlink...
[ "rest_framework.serializers.StringRelatedField", "rest_framework.serializers.SlugRelatedField" ]
[((500, 541), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {'many': '(True)'}), '(many=True)\n', (530, 541), False, 'from rest_framework import serializers\n'), ((553, 620), 'rest_framework.serializers.SlugRelatedField', 'serializers.SlugRelatedField', ([], {'read_only': '(Tru...
# -*- coding: utf-8 -*- import datetime import json import time from ..base.multi_account import MultiAccount class ZeveraCom(MultiAccount): __name__ = "ZeveraCom" __type__ = "account" __version__ = "0.38" __status__ = "testing" __pyload_version__ = "0.5" __config__ = [ ("mh_mode",...
[ "json.loads", "datetime.datetime.fromtimestamp" ]
[((1042, 1057), 'json.loads', 'json.loads', (['res'], {}), '(res)\n', (1052, 1057), False, 'import json\n'), ((1450, 1503), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (["res['premium_until']"], {}), "(res['premium_until'])\n", (1481, 1503), False, 'import datetime\n')]
import pytest from rest_framework import serializers from .models import Album, Track from drf_jsonschema import to_jsonschema from jsonschema import validate @pytest.mark.django_db def test_string_related_field(): album = Album.objects.create( album_name="Collected Stories", artist="<NAME>") track1 =...
[ "jsonschema.validate", "drf_jsonschema.to_jsonschema" ]
[((1143, 1171), 'jsonschema.validate', 'validate', (['valid', 'json_schema'], {}), '(valid, json_schema)\n', (1151, 1171), False, 'from jsonschema import validate\n'), ((1723, 1754), 'drf_jsonschema.to_jsonschema', 'to_jsonschema', (['album_serializer'], {}), '(album_serializer)\n', (1736, 1754), False, 'from drf_jsons...
import jax import jax.numpy as jnp from jax.scipy.stats import norm def mse(y_pred, y): """Helper fuction to calculate MSE. """ def squared_error(y, y_pred): return jnp.inner(y - y_pred, y - y_pred) return jnp.mean(jax.vmap(squared_error)(y, y_pred), axis=0) def normal_LL(x, mu, tau): ...
[ "jax.numpy.log", "jax.numpy.linalg.norm", "jax.vmap", "jax.numpy.mean", "jax.numpy.inner" ]
[((403, 426), 'jax.numpy.mean', 'jnp.mean', (['((x - mu) ** 2)'], {}), '((x - mu) ** 2)\n', (411, 426), True, 'import jax.numpy as jnp\n'), ((188, 221), 'jax.numpy.inner', 'jnp.inner', (['(y - y_pred)', '(y - y_pred)'], {}), '(y - y_pred, y - y_pred)\n', (197, 221), True, 'import jax.numpy as jnp\n'), ((243, 266), 'jax...
import datetime import logging from tornado import gen import hijackingprevention.db_int as db_int logger = logging.getLogger(__name__) class Session(db_int.Interface): """This class handles reading, writing, and manipulating session objects.""" def __init__(self, sid, site, db): self.__id_type = "sid" self._...
[ "logging.getLogger", "datetime.timedelta", "datetime.datetime.utcnow" ]
[((110, 137), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (127, 137), False, 'import logging\n'), ((1144, 1170), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (1168, 1170), False, 'import datetime\n'), ((1186, 1213), 'datetime.timedelta', 'datetime.timedelta...
"""add archived to loadtbl Revision ID: <KEY> Revises: 146580790cd Create Date: 2016-01-08 12:32:49.891035 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('LoadTbl', sa.Column('archived', sa.Boo...
[ "alembic.op.drop_column", "sqlalchemy.Column" ]
[((350, 387), 'alembic.op.drop_column', 'op.drop_column', (['"""LoadTbl"""', '"""archived"""'], {}), "('LoadTbl', 'archived')\n", (364, 387), False, 'from alembic import op\n'), ((292, 325), 'sqlalchemy.Column', 'sa.Column', (['"""archived"""', 'sa.Boolean'], {}), "('archived', sa.Boolean)\n", (301, 325), True, 'import...
#!/usr/bin/python import os,sys import glob import json from collections import OrderedDict from Bio import SeqIO sys.path.insert(0, '/clusterCAD') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "clusterCAD.settings") import django django.setup() import pks.models def mibigSubtypes(filepath): '''Takes as input...
[ "os.environ.setdefault", "django.setup", "sys.path.insert", "collections.OrderedDict", "os.path.join", "os.path.basename", "json.load" ]
[((117, 150), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/clusterCAD"""'], {}), "(0, '/clusterCAD')\n", (132, 150), False, 'import os, sys\n'), ((151, 221), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""clusterCAD.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'cluster...
from django.contrib import admin from . import models # Register your models here. @admin.register(models.Topic) class TopicAdmin(admin.ModelAdmin): list_display = ('topic_name',) @admin.register(models.Webpage) class WebpageAdmin(admin.ModelAdmin): list_display = ('topic', 'name') @admin.register(mode...
[ "django.contrib.admin.register" ]
[((89, 117), 'django.contrib.admin.register', 'admin.register', (['models.Topic'], {}), '(models.Topic)\n', (103, 117), False, 'from django.contrib import admin\n'), ((192, 222), 'django.contrib.admin.register', 'admin.register', (['models.Webpage'], {}), '(models.Webpage)\n', (206, 222), False, 'from django.contrib im...
from gemd.entity.object.base_object import BaseObject from gemd.entity.object.has_quantities import HasQuantities from gemd.entity.setters import validate_list class IngredientSpec(BaseObject, HasQuantities): """ An ingredient specification. Ingredients annotate a material with information about its usag...
[ "gemd.entity.object.base_object.BaseObject.__init__", "gemd.entity.setters.validate_list", "gemd.entity.object.has_quantities.HasQuantities.__init__" ]
[((2524, 2622), 'gemd.entity.object.base_object.BaseObject.__init__', 'BaseObject.__init__', (['self'], {'name': 'name', 'uids': 'uids', 'tags': 'tags', 'notes': 'notes', 'file_links': 'file_links'}), '(self, name=name, uids=uids, tags=tags, notes=notes,\n file_links=file_links)\n', (2543, 2622), False, 'from gemd.e...
import sys import os import time from pathlib import Path from examinator import * from multiprocessing import Queue from joblib import Parallel, delayed import asyncio WORKERS = 8 LOGURU_ENQ = True LOG_ON = True LOG_LEVEL = "DEBUG" basepaths = ['..'] basepaths = map(Path, basepaths) file_q = Queue() def joblib_pro...
[ "time.perf_counter", "joblib.Parallel", "os.getpid", "joblib.delayed", "multiprocessing.Queue" ]
[((297, 304), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (302, 304), False, 'from multiprocessing import Queue\n'), ((892, 911), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (909, 911), False, 'import time\n'), ((962, 1007), 'joblib.Parallel', 'Parallel', ([], {'n_jobs': 'WORKERS', 'require': '"...
import urllib2 import json import os import logging from config import supported_configuration_versions from application import Application from action_handler import AsyncActionHandler logger = logging.getLogger('peachy') class ConfigException(Exception): def __init__(self, error_code, message): super(...
[ "logging.getLogger", "os.path.exists", "json.loads", "urllib2.urlopen", "os.getenv", "action_handler.AsyncActionHandler", "application.Application.from_configs" ]
[((197, 224), 'logging.getLogger', 'logging.getLogger', (['"""peachy"""'], {}), "('peachy')\n", (214, 224), False, 'import logging\n'), ((1084, 1117), 'urllib2.urlopen', 'urllib2.urlopen', (['self._config_url'], {}), '(self._config_url)\n', (1099, 1117), False, 'import urllib2\n'), ((1626, 1650), 'os.getenv', 'os.geten...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. import unittest2 as unittest import mock import os class CompressTest(unittest.TestCase): def test_compress_js(self): from couchapp....
[ "mock.patch", "unittest2.main", "os.path.dirname", "couchapp.config.Config", "couchapp.hooks.compress.default.compress" ]
[((2167, 2182), 'unittest2.main', 'unittest.main', ([], {}), '()\n', (2180, 2182), True, 'import unittest2 as unittest\n'), ((358, 366), 'couchapp.config.Config', 'Config', ([], {}), '()\n', (364, 366), False, 'from couchapp.config import Config\n'), ((456, 530), 'mock.patch', 'mock.patch', (['"""couchapp.hooks.compres...
from datetime import datetime from airflow import DAG from airflow.operators.valohai import ValohaiSubmitExecutionOperator, ValohaiDownloadExecutionOutputsOperator default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2018, 1, 1), 'email': ['<EMAIL>'], 'email_on_fai...
[ "airflow.operators.valohai.ValohaiSubmitExecutionOperator", "airflow.operators.valohai.ValohaiDownloadExecutionOutputsOperator", "datetime.datetime", "airflow.DAG" ]
[((371, 468), 'airflow.DAG', 'DAG', (['"""example_valohai_dag"""'], {'default_args': 'default_args', 'schedule_interval': 'None', 'catchup': '(False)'}), "('example_valohai_dag', default_args=default_args, schedule_interval=\n None, catchup=False)\n", (374, 468), False, 'from airflow import DAG\n'), ((497, 1125), 'a...
import numpy as np import matplotlib.pyplot as plt from IPython.html.widgets import interactive, IntSlider, widget, FloatText, FloatSlider, Checkbox, ToggleButtons sigmin = 0.01 sigmax = 0.1 sigma_0 = 0 # conductivity of the air h_1 = 1. h_boom = 0. h_boom_max = 2. zmax = 4. z = np.linspace(0.,zmax,1000) phi_v...
[ "numpy.ones", "IPython.html.widgets.FloatSlider", "numpy.linspace", "matplotlib.pyplot.tight_layout", "IPython.html.widgets.ToggleButtons", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((287, 315), 'numpy.linspace', 'np.linspace', (['(0.0)', 'zmax', '(1000)'], {}), '(0.0, zmax, 1000)\n', (298, 315), True, 'import numpy as np\n'), ((1288, 1323), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(3)'], {'figsize': '(11, 6)'}), '(1, 3, figsize=(11, 6))\n', (1300, 1323), True, 'import matplotlib.p...
#!/usr/bin/env python3 """ pdfmanip -------- Manipulate PDF files (e.g. remove given pages) https://github.com/jabbalaci/pdfmanip by <NAME> (<EMAIL>) """ import os import readline import sys from collections import deque from typing import Deque, List import pikepdf from pikepdf import Pdf from pyrsistent import ...
[ "pyrsistent.freeze", "collections.deque", "pyrsistent.v", "os.path.isfile", "pikepdf.open", "os.system" ]
[((1763, 1773), 'pyrsistent.freeze', 'freeze', (['li'], {}), '(li)\n', (1769, 1773), False, 'from pyrsistent import freeze, pvector, v\n'), ((1926, 1948), 'os.path.isfile', 'os.path.isfile', (['OUTPUT'], {}), '(OUTPUT)\n', (1940, 1948), False, 'import os\n'), ((2101, 2137), 'os.system', 'os.system', (['f"""ls -al | gre...
import argparse import torch def load_model(model_path): try: ckpt = torch.load(model_path) except RuntimeError: ckpt = torch.load(model_path, map_location="cpu") if "model" in ckpt.keys(): return ckpt["model"] return ckpt def parse_args(): parser = argparse.ArgumentPar...
[ "torch.save", "torch.load", "torch.all", "argparse.ArgumentParser" ]
[((300, 325), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (323, 325), False, 'import argparse\n'), ((1569, 1604), 'torch.save', 'torch.save', (['novel_model', 'save_model'], {}), '(novel_model, save_model)\n', (1579, 1604), False, 'import torch\n'), ((84, 106), 'torch.load', 'torch.load', ([...
import unittest from typing import List, NamedTuple, Tuple from bot.rules import attachments from tests.helpers import MockMessage, async_test class Case(NamedTuple): recent_messages: List[MockMessage] culprit: Tuple[str] total_attachments: int def msg(author: str, total_attachments: int) -> MockMessag...
[ "bot.rules.attachments.apply" ]
[((1302, 1363), 'bot.rules.attachments.apply', 'attachments.apply', (['last_message', 'recent_messages', 'self.config'], {}), '(last_message, recent_messages, self.config)\n', (1319, 1363), False, 'from bot.rules import attachments\n'), ((3012, 3073), 'bot.rules.attachments.apply', 'attachments.apply', (['last_message'...
# Copyright (C) 2014 Yahoo! Inc. All Rights Reserved. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
[ "mock.patch", "mock.Mock", "rally.benchmark.scenarios.base.AtomicAction", "rally.benchmark.scenarios.authenticate.authenticate.Authenticate", "tests.fakes.FakeClients", "mock.MagicMock" ]
[((870, 899), 'mock.patch', 'mock.patch', (['"""rally.osclients"""'], {}), "('rally.osclients')\n", (880, 899), False, 'import mock\n'), ((1274, 1303), 'mock.patch', 'mock.patch', (['"""rally.osclients"""'], {}), "('rally.osclients')\n", (1284, 1303), False, 'import mock\n'), ((1309, 1338), 'mock.patch', 'mock.patch', ...
# region [Imports] # * Standard Library Imports --> # * Standard Library Imports --> import os from typing import Optional # * Third Party Imports --> import discord from discord.ext import commands # * Gid Imports --> import gidlogger as glog # * Local Imports --> from antipetros_discordbot.cogs import get_alia...
[ "gidlogger.class_init_notification", "antipetros_discordbot.init_userdata.user_data_setup.ParaStorageKeeper.get_config", "antipetros_discordbot.init_userdata.user_data_setup.ParaStorageKeeper.get_appdata", "discord.ext.commands.is_owner", "antipetros_discordbot.cogs.get_aliases", "os.path.dirname", "gid...
[((810, 835), 'gidlogger.aux_logger', 'glog.aux_logger', (['__name__'], {}), '(__name__)\n', (825, 835), True, 'import gidlogger as glog\n'), ((836, 875), 'gidlogger.import_notification', 'glog.import_notification', (['log', '__name__'], {}), '(log, __name__)\n', (860, 875), True, 'import gidlogger as glog\n'), ((931, ...
import traceback import pymel.core as pm import mgear from mgear.vendor.Qt import QtCore from mgear.core.anim_utils import * # ============================================================================= # constants # ============================================================================= SYNOPTIC_WIDGET_...
[ "traceback.format_exc", "pymel.core.select", "pymel.core.ls", "pymel.core.PyNode", "mgear.log", "pymel.core.UndoChunk" ]
[((1242, 1259), 'pymel.core.ls', 'pm.ls', (['model_name'], {}), '(model_name)\n', (1247, 1259), True, 'import pymel.core as pm\n'), ((1307, 1328), 'pymel.core.PyNode', 'pm.PyNode', (['model_name'], {}), '(model_name)\n', (1316, 1328), True, 'import pymel.core as pm\n'), ((2185, 2199), 'pymel.core.UndoChunk', 'pm.UndoCh...
from django.contrib import admin from django.urls import path from . import views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('',views.home , name = "home"), path('about&contact',views.about , name = "about"), path('report',views.report_data , name = ...
[ "django.urls.path" ]
[((182, 215), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', views.home, name='home')\n", (186, 215), False, 'from django.urls import path\n'), ((223, 271), 'django.urls.path', 'path', (['"""about&contact"""', 'views.about'], {'name': '"""about"""'}), "('about&contact', views.abou...
import torch.nn as nn import torch.nn.functional as F class PadLayer(nn.Module): # E.g., (-1, 0) means this layer should crop the first and last rows of the feature map. And (0, -1) crops the first and last columns def __init__(self, pad): super(PadLayer, self).__init__() self.pad = pad ...
[ "torch.nn.functional.pad" ]
[((355, 383), 'torch.nn.functional.pad', 'F.pad', (['input', '([self.pad] * 4)'], {}), '(input, [self.pad] * 4)\n', (360, 383), True, 'import torch.nn.functional as F\n')]
# Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug # Copyright: (c) <<EMAIL>> # Released under the AGPL-3.0 License. from django.db import models from libs import ModelMixin, human_datetime from apps.account.models import User import json class History(models.Model, ModelMixin): STATUS = ( ...
[ "json.loads", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.SmallIntegerField", "django.db.models.CharField" ]
[((396, 417), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (415, 417), False, 'from django.db import models\n'), ((431, 471), 'django.db.models.SmallIntegerField', 'models.SmallIntegerField', ([], {'choices': 'STATUS'}), '(choices=STATUS)\n', (455, 471), False, 'from django.db import models...
import socket from sockets.broadcast_socket import BroadcastSocket import logger log = logger.getLogger(__name__) class BroadcastDiscoverer(BroadcastSocket): def __init__(self, port): super(BroadcastDiscoverer, self).__init__() self.socket.bind(('0.0.0.0', port)) def __del__(self): "...
[ "logger.getLogger" ]
[((88, 114), 'logger.getLogger', 'logger.getLogger', (['__name__'], {}), '(__name__)\n', (104, 114), False, 'import logger\n')]
"""Tools for gridding widgets History: 2003-05-06 ROwen Adapted from ChangedGridder. 2004-05-18 ROwen Modified _StatusConfigGridSet._makeChangedWdg to eliminate two unused args (colSpan and sticky). 2004-08-11 ROwen Renamed StatusConfigGridSet->_StatusConfigGridSet. De...
[ "opscore.RO.Wdg.Gridder.Gridder.__init__", "opscore.RO.Wdg.Gridder._BaseGridSet.__init__" ]
[((2680, 2750), 'opscore.RO.Wdg.Gridder.Gridder.__init__', 'Gridder.__init__', (['self'], {'master': 'master', 'row': 'row', 'col': 'col', 'sticky': 'sticky'}), '(self, master=master, row=row, col=col, sticky=sticky)\n', (2696, 2750), False, 'from opscore.RO.Wdg.Gridder import Gridder, _BaseGridSet\n'), ((8317, 8403), ...
from setuptools import setup, find_packages setup( name='django-url-mapper', version='1.0.1', author='<NAME>', scripts=[], description='Use fixed keys in your Django template to refer to dynamic URLs', long_description=open('README.md').read(), install_requires=[ "Django >= 1.6", ...
[ "setuptools.find_packages" ]
[((339, 354), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (352, 354), False, 'from setuptools import setup, find_packages\n')]