code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""[summary]
:return: [description]
:rtype: [type]
"""
import os
import constants
import pytest
import json
import logging
import CKANData
import tests.helpers.CKANDataHelpers as CKANDataHelpers
LOGGER = logging.getLogger(__name__)
@pytest.fixture(scope="session")
def CKANData_User_Data_Raw():
"""returns a use... | [
"json.dump",
"json.load",
"CKANData.CKANOrganizationDataSet",
"pytest.fixture",
"os.path.exists",
"CKANData.CKANUsersDataSet",
"tests.helpers.CKANDataHelpers.CKAN_Test_Data",
"logging.getLogger"
] | [((207, 234), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (224, 234), False, 'import logging\n'), ((238, 269), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (252, 269), False, 'import pytest\n'), ((477, 508), 'pytest.fixture', 'pytest.fixt... |
from app import *
from threading import Thread
def get_morning_news() :
root_logger.critical("< NEWS > get_morning_new Thread Started ... ")
while True :
d_month = datetime.now().month
d_day = datetime.now().day
d_hour = datetime.now().hour
# 정해진 시간에 뉴스 전송
... | [
"threading.Thread"
] | [((1868, 1899), 'threading.Thread', 'Thread', ([], {'target': 'get_morning_news'}), '(target=get_morning_news)\n', (1874, 1899), False, 'from threading import Thread\n')] |
from rcj_soccer.base import app, db
from rcj_soccer.models import Competition
from flask import render_template, jsonify, request
from datetime import datetime
from dateutil.parser import parse
from rcj_soccer.util import config, obj_to_dict
import logging
logger = logging.getLogger(__name__)
@app.route("/")
def lis... | [
"rcj_soccer.base.db.session.delete",
"dateutil.parser.parse",
"rcj_soccer.base.db.session.add",
"rcj_soccer.base.app.route",
"rcj_soccer.base.db.session.commit",
"rcj_soccer.models.Competition.query.order_by",
"rcj_soccer.models.Competition.start_date.desc",
"flask.jsonify",
"rcj_soccer.models.Compe... | [((267, 294), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (284, 294), False, 'import logging\n'), ((298, 312), 'rcj_soccer.base.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (307, 312), False, 'from rcj_soccer.base import app, db\n'), ((609, 639), 'rcj_soccer.base.app.route', ... |
#!/usr/bin/python
"""
A very crude emulator of dejagnu, just enough to integrate the libbfi
unittests into the pyobjc ones.
"""
import os
import re
import sys
import signal
from fnmatch import fnmatch
import unittest
from distutils.util import get_platform
gDgCommands=re.compile(r'''
(?:{\s*(dg-do)\s*run\s*({[... | [
"unittest.TestCase.__init__",
"unittest.TextTestRunner",
"unittest.TestSuite",
"os.path.basename",
"os.unlink",
"os.path.dirname",
"os.popen",
"os.walk",
"os.WTERMSIG",
"os.WIFEXITED",
"os.WEXITSTATUS",
"fnmatch.fnmatch",
"os.WIFSIGNALED",
"os.path.join",
"os.listdir",
"re.compile"
] | [((270, 442), 're.compile', 're.compile', (['"""\n (?:{\\\\s*(dg-do)\\\\s*run\\\\s*({[^}]*})?\\\\s*})\n |\n (?:{\\\\s*(dg-output)\\\\s*"([^"]*)"\\\\s*})\n """', '(re.VERBOSE | re.MULTILINE)'], {}), '(\n """\n (?:{\\\\s*(dg-do)\\\\s*run\\\\s*({[^}]*})?\\\\s*})\n |\n (?... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('poll', '0002_remove_poll_expires'),
]
operations = [
migrations.AddFie... | [
"datetime.datetime"
] | [((430, 493), 'datetime.datetime', 'datetime.datetime', (['(2015)', '(10)', '(25)', '(17)', '(52)', '(51)', '(968925)'], {'tzinfo': 'utc'}), '(2015, 10, 25, 17, 52, 51, 968925, tzinfo=utc)\n', (447, 493), False, 'import datetime\n')] |
import os
import time
import re
# import lxml
from lxml import etree
from tool import read_txt_file_to_list
with open('ttttt.html','a',encoding = 'utf-8') as f:
f.write('盖雅放假啊')
f.write('\n')
with open('ttttt.html','r',encoding = 'utf-8') as f:
fileHtml = f.read()
sensitiveKeywordListUri = './config/sensi... | [
"tool.read_txt_file_to_list",
"re.compile"
] | [((361, 407), 'tool.read_txt_file_to_list', 'read_txt_file_to_list', (['sensitiveKeywordListUri'], {}), '(sensitiveKeywordListUri)\n', (382, 407), False, 'from tool import read_txt_file_to_list\n'), ((575, 613), 're.compile', 're.compile', (["('' + sensitiveKeyword + '')"], {}), "('' + sensitiveKeyword + '')\n", (585, ... |
# coding: utf-8
import re
import logging
from decimal import Decimal
from allauth import account
from django import forms
from django.forms import widgets
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.forms.utils import ErrorList, ErrorDict
fro... | [
"allauth.account.models.EmailAddress.objects.filter",
"django.core.exceptions.ValidationError",
"django.forms.EmailField",
"decimal.Decimal",
"django.forms.utils.ErrorDict",
"allauth.account.adapter.get_adapter",
"re.match",
"django.forms.Textarea",
"autocomplete_light.shortcuts.register",
"django... | [((675, 702), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (692, 702), False, 'import logging\n'), ((734, 908), 'autocomplete_light.shortcuts.register', 'autocomplete_light.register', (['models.Manufacturer'], {'search_fields': "['name']", 'autocomplete_js_attributes': "{'minimum_charac... |
import os
import argparse
import json
from utils import print_host
from xml.dom import minidom
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--input", type=str, help="input dir")
parser.add_argument("--output", type=str, help="output file")
args = parser.parse_args(... | [
"os.listdir",
"json.dump",
"xml.dom.minidom.parse",
"argparse.ArgumentParser"
] | [((136, 161), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (159, 161), False, 'import argparse\n'), ((370, 392), 'os.listdir', 'os.listdir', (['args.input'], {}), '(args.input)\n', (380, 392), False, 'import os\n'), ((508, 550), 'xml.dom.minidom.parse', 'minidom.parse', (["(args.input + '/' +... |
from pathlib import Path
import numpy as np
from tifffile import imread
from tracker.export import ExportResults
from tracker.extract_data import get_img_files
from tracker.extract_data import get_indices_pandas
from tracker.tracking import TrackingConfig, MultiCellTracker
def run_tracker(img_path, segm_path, res_p... | [
"numpy.stack",
"argparse.ArgumentParser",
"tracker.tracking.MultiCellTracker",
"tracker.extract_data.get_img_files",
"tracker.tracking.TrackingConfig",
"pathlib.Path",
"numpy.array",
"tracker.export.ExportResults"
] | [((372, 386), 'pathlib.Path', 'Path', (['img_path'], {}), '(img_path)\n', (376, 386), False, 'from pathlib import Path\n'), ((403, 418), 'pathlib.Path', 'Path', (['segm_path'], {}), '(segm_path)\n', (407, 418), False, 'from pathlib import Path\n'), ((434, 448), 'pathlib.Path', 'Path', (['res_path'], {}), '(res_path)\n'... |
from functools import wraps
from flask import abort
from flask_login import current_user
from .models import Permission
def permission_required(permission):
def decorator(f):
@wraps(f)
def decarated_function(*args,**kwargs):
if not current_user.can(permission):
abort(40... | [
"flask_login.current_user.can",
"flask.abort",
"functools.wraps"
] | [((190, 198), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (195, 198), False, 'from functools import wraps\n'), ((266, 294), 'flask_login.current_user.can', 'current_user.can', (['permission'], {}), '(permission)\n', (282, 294), False, 'from flask_login import current_user\n'), ((312, 322), 'flask.abort', 'abort',... |
"""
Application name: users.py
Author/Programmer: <NAME>
Date application created: April 1st, 2022
This model helps to define the strucutre of stored data.
The fields used are:
*id
*is_active
*email
*username
*name
*last_name
*is_verified
"""
from django.db... | [
"django.utils.translation.gettext_lazy",
"django.db.models.BooleanField",
"django.db.models.EmailField"
] | [((735, 855), 'django.db.models.EmailField', 'models.EmailField', (['"""email address"""'], {'unique': '(True)', 'error_messages': "{'unique': 'A user with that email already exists.'}"}), "('email address', unique=True, error_messages={'unique':\n 'A user with that email already exists.'})\n", (752, 855), False, 'f... |
# -*- coding: utf-8 -*-
"""nncli_gui module"""
import hashlib
import subprocess
import threading
import urwid
from . import view_titles, view_note, view_help, view_log, user_input
from .utils import exec_cmd_on_note, get_pager
# pylint: disable=too-many-instance-attributes, unused-argument
class NncliGui:
"""Nncl... | [
"threading.Thread",
"urwid.Text",
"subprocess.Popen",
"urwid.Pile",
"urwid.ExitMainLoop",
"urwid.MainLoop",
"threading.Lock"
] | [((732, 748), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (746, 748), False, 'import threading\n'), ((828, 919), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.ndb.sync_worker', 'args': '[self.config.state.do_server_sync]'}), '(target=self.ndb.sync_worker, args=[self.config.state.\n do_serve... |
from aiounittest import AsyncTestCase
from urllib.parse import urlparse
from robot.api import Context
from robot.context.core import ContextImpl
class ResolveUrlContextImplTest(AsyncTestCase):
context: Context = None
@classmethod
def setUpClass(cls):
cls.context = ContextImpl(url=urlparse('http:/... | [
"urllib.parse.urlparse"
] | [((304, 364), 'urllib.parse.urlparse', 'urlparse', (['"""http://example.com/path1/page1?q=query#element-1"""'], {}), "('http://example.com/path1/page1?q=query#element-1')\n", (312, 364), False, 'from urllib.parse import urlparse\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file : spm_dataset.py
@author: zijun
@contact : <EMAIL>
@date : 2021/1/21 15:00
@version: 1.0
@desc : Dataset for sentence pair matching tasks
"""
from functools import partial
import torch
from torch.utils.data import DataLoader
from datasets.chinese_bert_datase... | [
"functools.partial",
"torch.LongTensor"
] | [((1729, 1774), 'torch.LongTensor', 'torch.LongTensor', (['([101] + bert_tokens + [102])'], {}), '([101] + bert_tokens + [102])\n', (1745, 1774), False, 'import torch\n'), ((2340, 2393), 'functools.partial', 'partial', (['collate_to_max_length'], {'fill_values': '[0, 0, 0]'}), '(collate_to_max_length, fill_values=[0, 0... |
from nose.tools import assert_raises, assert_true, assert_equal
from vispy.util.keys import Key, ENTER
def test_key():
"""Test basic key functionality"""
def bad():
return (ENTER == dict())
assert_raises(ValueError, bad)
assert_true(not (ENTER == None)) # noqa
assert_equal('Return', ENTE... | [
"nose.tools.assert_true",
"nose.tools.assert_equal",
"nose.tools.assert_raises",
"vispy.util.keys.Key"
] | [((213, 243), 'nose.tools.assert_raises', 'assert_raises', (['ValueError', 'bad'], {}), '(ValueError, bad)\n', (226, 243), False, 'from nose.tools import assert_raises, assert_true, assert_equal\n'), ((248, 278), 'nose.tools.assert_true', 'assert_true', (['(not ENTER == None)'], {}), '(not ENTER == None)\n', (259, 278)... |
import argparse
import os, sys, time
import json
import jsonlines
import nltk
from nltk import word_tokenize, sent_tokenize
import pandas as pd
from pathlib import Path
import pickle
from utils import timed_func
categories = [
"AAAI", "ACL", "COLING", "CVPR", "EMNLP", "ICML", "ICRA", "IJCAI", "NAACL", "N... | [
"pickle.dump",
"argparse.ArgumentParser",
"json.loads",
"pandas.read_csv",
"nltk.sent_tokenize",
"time.time",
"pathlib.Path",
"pickle.load"
] | [((4068, 4085), 'pathlib.Path', 'Path', (['args.export'], {}), '(args.export)\n', (4072, 4085), False, 'from pathlib import Path\n'), ((4199, 4224), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4222, 4224), False, 'import argparse\n'), ((869, 887), 'pandas.read_csv', 'pd.read_csv', (['fname'... |
import numpy as np
class BBoxFilter(object):
def __init__(self, min_area, max_area, min_ratio):
self.min_area = min_area
self.max_area = max_area
self.min_ratio = min_ratio
def __call__(self, bbox):
assert len(bbox) == 4
area = bbox[2] * bbox[3]
if area < self.min_area or area > self.... | [
"numpy.maximum",
"numpy.sum",
"numpy.argmax",
"numpy.empty",
"numpy.floor",
"numpy.clip",
"numpy.add.outer",
"numpy.prod",
"numpy.multiply",
"numpy.maximum.outer",
"numpy.divide",
"numpy.minimum",
"numpy.asarray",
"numpy.all",
"numpy.subtract",
"numpy.zeros",
"numpy.any",
"numpy.wh... | [((497, 523), 'numpy.clip', 'np.clip', (['bbox[0]', '(0)', '(w - 1)'], {}), '(bbox[0], 0, w - 1)\n', (504, 523), True, 'import numpy as np\n'), ((533, 569), 'numpy.clip', 'np.clip', (['(bbox[0] + bbox[2])', '(0)', '(w - 1)'], {}), '(bbox[0] + bbox[2], 0, w - 1)\n', (540, 569), True, 'import numpy as np\n'), ((579, 605)... |
#!/usr/bin/env python
import sys
from nibabel import load as nib_load
import nibabel as nib
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.api as sm
from scipy import signal
import os
from numpy import genfromtxt
from sklearn.decomposition import PCA
def... | [
"matplotlib.pyplot.title",
"os.mkdir",
"numpy.sum",
"numpy.abs",
"numpy.nanmedian",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.figure",
"numpy.mean",
"os.path.join",
"numpy.nanmean",
"numpy.multiply",
"numpy.copy",
"numpy.std",
"numpy.power",
"matplotlib.pyplot.imsh... | [((525, 547), 'nibabel.load', 'nib_load', (['path_to_file'], {}), '(path_to_file)\n', (533, 547), True, 'from nibabel import load as nib_load\n'), ((764, 786), 'nibabel.load', 'nib_load', (['path_to_file'], {}), '(path_to_file)\n', (772, 786), True, 'from nibabel import load as nib_load\n'), ((1165, 1188), 'numpy.power... |
import unittest
import aiostripe
from aiostripe.test.helper import StripeResourceTest, DUMMY_COUPON
class CouponTest(StripeResourceTest):
async def test_create_coupon(self):
await aiostripe.Coupon.create(**DUMMY_COUPON)
self.requestor_mock.request.assert_called_with('post', '/v1/coupons',
... | [
"unittest.main",
"aiostripe.Coupon.construct_from",
"aiostripe.Coupon.create",
"aiostripe.Customer",
"aiostripe.Coupon"
] | [((1609, 1624), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1622, 1624), False, 'import unittest\n'), ((445, 524), 'aiostripe.Coupon.construct_from', 'aiostripe.Coupon.construct_from', (["{'id': 'cu_update', 'metadata': {}}", '"""api_key"""'], {}), "({'id': 'cu_update', 'metadata': {}}, 'api_key')\n", (476, 52... |
# faça u programa que leia um ângulo qualquer e mostre na etla o valor do seno, cosseno e tangente desse ângulo.
import math
n = int(input('Digite o ângulo: '))
sen = math.sin(math.radians(n))
cos = math.cos(math.radians(n))
tan = math.tan(math.radians(n))
print('Sabendo que o ângulo vale {}º, o seno vale {:.2f}, o c... | [
"math.radians"
] | [((178, 193), 'math.radians', 'math.radians', (['n'], {}), '(n)\n', (190, 193), False, 'import math\n'), ((210, 225), 'math.radians', 'math.radians', (['n'], {}), '(n)\n', (222, 225), False, 'import math\n'), ((242, 257), 'math.radians', 'math.radians', (['n'], {}), '(n)\n', (254, 257), False, 'import math\n')] |
import nltk
from nltk.corpus import words
from pprint import pprint
end = '_end_'
def is_valid(trie, word):
pos = trie
for letter in word:
if letter not in pos:
return False
pos = pos[letter]
return end in pos
def is_prefix(trie, word):
pos = trie
for letter in word:
... | [
"pprint.pprint",
"nltk.corpus.words.words"
] | [((1867, 1880), 'pprint.pprint', 'pprint', (['board'], {}), '(board)\n', (1873, 1880), False, 'from pprint import pprint\n'), ((1963, 1976), 'nltk.corpus.words.words', 'words.words', ([], {}), '()\n', (1974, 1976), False, 'from nltk.corpus import words\n')] |
import open3d as o3d
import os
import glob
import numpy as np
import json
class Open3DReconstructionDataset:
def __init__(self, root_dir):
self.root_dir = root_dir
self.len_frame = len(list(glob.glob(os.path.join(root_dir, "color/*.jpg"))))
def get_rgb_paths(self):
open3d_rgb_paths = ... | [
"numpy.zeros",
"numpy.array",
"os.path.join",
"open3d.camera.PinholeCameraIntrinsic"
] | [((1236, 1250), 'numpy.array', 'np.array', (['rows'], {}), '(rows)\n', (1244, 1250), True, 'import numpy as np\n'), ((1576, 1800), 'open3d.camera.PinholeCameraIntrinsic', 'o3d.camera.PinholeCameraIntrinsic', (["intrinsics['width']", "intrinsics['height']", "intrinsics['intrinsic_matrix'][0]", "intrinsics['intrinsic_mat... |
import numpy as np
x = [0, 1, 2, 3, 4]
y = [5, 6, 7, 8, 9]
z = []
for i, j in zip(x, y):
z.append(i + j)
print(z)
z = np.add(x, y)
print(z)
def my_add(a, b):
return a + b
my_add = np.frompyfunc(my_add, 2, 1)
z = my_add(x, y)
print(z)
print(type(np.add))
print(type(np.concatenate))
print(type(my_add))
| [
"numpy.add",
"numpy.frompyfunc"
] | [((123, 135), 'numpy.add', 'np.add', (['x', 'y'], {}), '(x, y)\n', (129, 135), True, 'import numpy as np\n'), ((190, 217), 'numpy.frompyfunc', 'np.frompyfunc', (['my_add', '(2)', '(1)'], {}), '(my_add, 2, 1)\n', (203, 217), True, 'import numpy as np\n')] |
"""
Copyright 2021 <NAME> (<EMAIL>)
Licensed under the Apache License v2.0
http://www.apache.org/licenses/LICENSE-2.0
"""
from multiprocessing import Process, Lock
from tool import log as _log
import time, argparse
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter
)
parser.add_argumen... | [
"argparse.ArgumentParser",
"first_process.init",
"time.sleep",
"flasksrv.app_run",
"tool.log",
"multiprocessing.Process"
] | [((225, 295), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawTextHelpFormatter'}), '(formatter_class=argparse.RawTextHelpFormatter)\n', (248, 295), False, 'import time, argparse\n'), ((471, 483), 'tool.log', '_log', (['"""MAIN"""'], {}), "('MAIN')\n", (475, 483), True, 'from... |
"""Asynchronized (distributed) cnn training."""
import os # noqa isort:skip
os.environ['OMP_NUM_THREADS'] = '1' # noqa isort:skip
import argparse
import logging
import pprint
import time
from dataclasses import asdict, dataclass
from functools import partial
from pathlib import Path
import numpy as np
from dqn.act... | [
"functools.partial",
"dqn.async_train.AsyncTrainerConfig",
"dqn.cnn.replay_buffer.ReplayBufferServer",
"argparse.ArgumentParser",
"dqn.evaluator.EvaluatorClient",
"dqn.actor_manager.ActorManagerClient",
"dqn.async_train.async_train",
"dqn.cnn.learner.Learner",
"dqn.param_distributor.ParamDistributor... | [((1198, 1218), 'dqn.async_train.AsyncTrainerConfig', 'AsyncTrainerConfig', ([], {}), '()\n', (1216, 1218), False, 'from dqn.async_train import AsyncTrainerConfig, async_train\n'), ((1804, 1831), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1821, 1831), False, 'import logging\n'), ((24... |
#!/usr/bin/env python
# Set the path explicitly #
sys.path.insert(0, os.path.abspath(__file__+"/../.."))
import unittest
class BasicTestSuit(unittest.TestCase):
"""Basic test cases."""
def test_absolute_truth_and_meaning(self):
assert True
def test_check_environment(self):
hrcbus.che... | [
"unittest.main"
] | [((383, 398), 'unittest.main', 'unittest.main', ([], {}), '()\n', (396, 398), False, 'import unittest\n')] |
# class does ...
import sys
import numpy as np
import math
import random
import time
from enum import Enum
from chapters.wall.hyperspace_helper.Segment import Segment
from chapters.wall.hyperspace_helper.AssetLibrary import AssetLibrary
from chapters.wall.hyperspace_helper.RingAssembly import RingAssembly
from chapt... | [
"chapters.wall.hyperspace_helper.Segment.Segment",
"random.randint",
"chapters.wall.hyperspace_helper.AssetLibrary.AssetLibrary",
"numpy.identity",
"numpy.linalg.norm",
"numpy.array",
"numpy.dot",
"chapters.wall.hyperspace_helper.Maze.Maze",
"chapters.wall.hyperspace_helper.Curve.Curve.euler_angles_... | [((2598, 2621), 'chapters.wall.hyperspace_helper.AssetLibrary.AssetLibrary', 'AssetLibrary', (['self.pi3d'], {}), '(self.pi3d)\n', (2610, 2621), False, 'from chapters.wall.hyperspace_helper.AssetLibrary import AssetLibrary\n'), ((2724, 2730), 'chapters.wall.hyperspace_helper.Maze.Maze', 'Maze', ([], {}), '()\n', (2728,... |
# Copyright 2016 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.0
#
# Unless required by applicable ... | [
"os.mkdir",
"os.makedirs",
"argparse.ArgumentParser",
"os.stat",
"os.path.exists",
"six.moves.urllib.request.urlretrieve",
"tarfile.open",
"os.path.join"
] | [((1347, 1385), 'os.path.join', 'os.path.join', (['work_directory', 'filename'], {}), '(work_directory, filename)\n', (1359, 1385), False, 'import os\n'), ((1665, 1690), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1688, 1690), False, 'import argparse\n'), ((1907, 1978), 'os.path.join', 'os.... |
import rlcard
rlcard.make('whist', config={'record_action': True}) | [
"rlcard.make"
] | [((14, 66), 'rlcard.make', 'rlcard.make', (['"""whist"""'], {'config': "{'record_action': True}"}), "('whist', config={'record_action': True})\n", (25, 66), False, 'import rlcard\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-07 13:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("site_config", "0014_auto_20171025_1053")]
operations = [
migrations.AlterField(
... | [
"django.db.models.CharField",
"django.db.models.PositiveIntegerField",
"django.db.models.EmailField"
] | [((405, 517), 'django.db.models.EmailField', 'models.EmailField', ([], {'blank': '(True)', 'help_text': '"""Email will be sent from this address."""', 'max_length': '(254)', 'null': '(True)'}), "(blank=True, help_text=\n 'Email will be sent from this address.', max_length=254, null=True)\n", (422, 517), False, 'from... |
from __future__ import print_function
import boto3
from decimal import Decimal
import json
import urllib
import os
print('Loading function')
rekognition = boto3.client('rekognition')
s3 = boto3.client('s3')
# --------------- Helper Functions to call Rekognition APIs ------------------
def add_image_to_Collection... | [
"boto3.client"
] | [((158, 185), 'boto3.client', 'boto3.client', (['"""rekognition"""'], {}), "('rekognition')\n", (170, 185), False, 'import boto3\n'), ((191, 209), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (203, 209), False, 'import boto3\n')] |
"""This module contains the class definition for Users."""
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship
from server.models.Base import BaseModel
from server.models.Devotional import DevotionalModel
from server.models.Comment import CommentModel
class UserModel(BaseModel):
... | [
"sqlalchemy.String",
"sqlalchemy.orm.relationship",
"sqlalchemy.Column"
] | [((410, 443), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (416, 443), False, 'from sqlalchemy import Column, Integer, String\n'), ((565, 612), 'sqlalchemy.orm.relationship', 'relationship', (['DevotionalModel'], {'backref': '"""author"""'}), "(DevotionalMode... |
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from djangobmf.workflows import Workflow, State, Transition
import datetime
class QuotationWorkflow(Workflow):
class States:
draft = State(_(u"Draft"), True, d... | [
"django.utils.translation.ugettext_lazy",
"datetime.datetime.now"
] | [((300, 311), 'django.utils.translation.ugettext_lazy', '_', (['u"""Draft"""'], {}), "(u'Draft')\n", (301, 311), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((354, 364), 'django.utils.translation.ugettext_lazy', '_', (['u"""Send"""'], {}), "(u'Send')\n", (355, 364), True, 'from django.utils.tran... |
import pandas as pd
import holoviews as hv
import matplotlib.pyplot as plt
hv.extension('bokeh', width=90)
def plot_heatmap(feature_count_table, feature_count_start_column,
feature_count_end_column, y_label_, output_file):
table = pd.read_table(feature_count_table, sep="\t")
table.set_index(... | [
"matplotlib.pyplot.show",
"holoviews.extension",
"pandas.read_table",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((76, 107), 'holoviews.extension', 'hv.extension', (['"""bokeh"""'], {'width': '(90)'}), "('bokeh', width=90)\n", (88, 107), True, 'import holoviews as hv\n'), ((255, 299), 'pandas.read_table', 'pd.read_table', (['feature_count_table'], {'sep': '"""\t"""'}), "(feature_count_table, sep='\\t')\n", (268, 299), True, 'imp... |
import re
from collections import defaultdict
from copy import deepcopy
from typing import Dict, List
from ConfigSpace import CategoricalHyperparameter, Constant
from ConfigSpace import ConfigurationSpace, Configuration
from ConfigSpace import ForbiddenInClause, ForbiddenEqualsClause, ForbiddenAndConjunction
from Conf... | [
"ConfigSpace.ConfigurationSpace",
"copy.deepcopy",
"ultraopt.hdl.utils.is_hdl_bottom",
"ConfigSpace.CategoricalHyperparameter",
"ConfigSpace.Constant",
"ultraopt.utils.logging_.get_logger",
"collections.defaultdict",
"ultraopt.hdl.hp_def._encode",
"ConfigSpace.ForbiddenAndConjunction",
"re.compile... | [((553, 573), 'ultraopt.utils.logging_.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (563, 573), False, 'from ultraopt.utils.logging_ import get_logger\n'), ((2025, 2042), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2036, 2042), False, 'from collections import defaultdict\n')... |
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import os
from digits import utils
from digits.utils import subclass
from flask.ext.wtf import Form
from wtforms import validators
@subclass
class DatasetForm(Form):
"""
A form used to create a Sunnyb... | [
"digits.utils.forms.SelectField",
"os.path.isdir",
"digits.utils.forms.StringField",
"os.path.exists",
"wtforms.validators.DataRequired",
"wtforms.validators.ValidationError"
] | [((996, 1118), 'digits.utils.forms.StringField', 'utils.forms.StringField', (['"""Dataset server ip"""'], {'validators': '[]', 'tooltip': '"""Dataset server ip in format \'xxx.xxx.xxx.xxx\'."""'}), '(\'Dataset server ip\', validators=[], tooltip=\n "Dataset server ip in format \'xxx.xxx.xxx.xxx\'.")\n', (1019, 1118)... |
import itertools
import numpy as np
import string
__all__ = ['BigramGenerator', 'SkipgramGenerator',
'id2bigram', 'vocabulary_size', 'all_bigrams']
letters = sorted(set((string.ascii_letters + string.digits + " ").lower()))
class WhitelistTable(object):
# there will be stories
def __init__(self,... | [
"numpy.zeros",
"numpy.array",
"itertools.product"
] | [((944, 978), 'numpy.array', 'np.array', (['sequence'], {'dtype': 'np.int16'}), '(sequence, dtype=np.int16)\n', (952, 978), True, 'import numpy as np\n'), ((1512, 1560), 'numpy.zeros', 'np.zeros', ([], {'shape': 'self._batch_size', 'dtype': 'np.int16'}), '(shape=self._batch_size, dtype=np.int16)\n', (1520, 1560), True,... |
import numpy as np
import eex
import os
from . import amber_metadata as amd
def get_energies(prmtop=None, crd=None, input_file=None, amb_path=None):
"""Evaluate energies of AMBER files. Based on InterMol
Args:
input_file = path to input file (expects data file in same folder)
lmp_path = path t... | [
"eex.utility.canonicalize_energy_names",
"os.path.abspath",
"eex.utility.run_subprocess",
"eex.utility.which",
"os.path.normpath",
"os.path.join"
] | [((701, 737), 'os.path.join', 'os.path.join', (['directory', '"""amber.out"""'], {}), "(directory, 'amber.out')\n", (713, 737), False, 'import os\n'), ((756, 799), 'os.path.join', 'os.path.join', (['directory', '"""amber_stdout.txt"""'], {}), "(directory, 'amber_stdout.txt')\n", (768, 799), False, 'import os\n'), ((818... |
"""Retirement Calculator"""
from datetime import date
def prompt(difference_check):
"""Calculate the year you can retire
difference_check - a function that takes a number and returns boolean,
the number provided is the difference between current age and retirement age
"""
age = int(input('What is... | [
"datetime.date.today"
] | [((428, 440), 'datetime.date.today', 'date.today', ([], {}), '()\n', (438, 440), False, 'from datetime import date\n')] |
name = "api"
import os
import sys
import requests
import logging
import revops.exceptions
__LOGGING_DEFAULTS__ = {'level': logging.INFO}
__DEFAULT_ENDPOINT__ = 'https://api.revops.io'
logging.basicConfig(**__LOGGING_DEFAULTS__)
class RevOpsAPI(object):
headers = {}
"""
This is the RevOps API Client
... | [
"os.environ.get",
"requests.request",
"logging.basicConfig"
] | [((189, 232), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '(**__LOGGING_DEFAULTS__)\n', (208, 232), False, 'import logging\n'), ((634, 675), 'os.environ.get', 'os.environ.get', (['"""REVOPS_API_KEY"""', 'api_key'], {}), "('REVOPS_API_KEY', api_key)\n", (648, 675), False, 'import os\n'), ((838, 885), 'os.env... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
"""
This file implements a psychrometric chart for air at 1 atm
"""
from CoolProp.HumidAirProp import HAPropsSI
from .Plots import InlineLabel
import matplotlib, numpy, textwrap
import_template = (
"""
# This file was auto-gener... | [
"textwrap.dedent",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"CoolProp.HumidAirProp.HAPropsSI",
"numpy.linspace"
] | [((799, 827), 'numpy.linspace', 'numpy.linspace', (['(-10)', '(60)', '(100)'], {}), '(-10, 60, 100)\n', (813, 827), False, 'import matplotlib, numpy, textwrap\n'), ((5180, 5221), 'matplotlib.pyplot.figure', 'matplotlib.pyplot.figure', ([], {'figsize': '(10, 8)'}), '(figsize=(10, 8))\n', (5204, 5221), False, 'import mat... |
#!/usr/bin/python
import socket
import sys
from Crypto.Cipher import AES
from Crypto import Random
from config import Config
def createMsg(cfg, user, ip = None):
ipstring = ''
if ip != None:
ipstring = ';'+ip
salt = Random.new().read(16)
cipher = AES.new(cfg.key, AES.MODE_CFB, salt)
... | [
"config.Config",
"socket.socket",
"Crypto.Cipher.AES.new",
"sys.argv.index",
"Crypto.Random.new"
] | [((280, 316), 'Crypto.Cipher.AES.new', 'AES.new', (['cfg.key', 'AES.MODE_CFB', 'salt'], {}), '(cfg.key, AES.MODE_CFB, salt)\n', (287, 316), False, 'from Crypto.Cipher import AES\n'), ((518, 567), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', ... |
from functools import partial
from math import inf, nan
from typing import Union
import hypothesis.extra.numpy as npst
import torch
from hypothesis import given, strategies as st
from hypothesis.strategies import SearchStrategy
from pytest import fixture, mark
from torch import allclose, as_tensor, isclose, tensor
fr... | [
"functools.partial",
"phytorch.roots.companion_matrix",
"hypothesis.extra.numpy.arrays",
"pytest.fixture",
"tests.common.dtypes.make_dtype_tests",
"_pytest.monkeypatch.MonkeyPatch",
"phytorch.roots.sroots",
"hypothesis.strategies.complex_numbers",
"torch.broadcast_shapes",
"phytorch.roots.roots",
... | [((1571, 1611), 'pytest.mark.xfail', 'mark.xfail', ([], {'reason': '"""flaky"""', 'strict': '(False)'}), "(reason='flaky', strict=False)\n", (1581, 1611), False, 'from pytest import fixture, mark\n'), ((663, 700), 'hypothesis.strategies.integers', 'st.integers', ([], {'min_value': '(2)', 'max_value': '(4)'}), '(min_val... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, EqualTo
class RegisterForm(FlaskForm):
"""登录表单类"""
username = StringField('用户名', validators=[DataRequired()])
password = PasswordField('密码', validators=[DataRequired()])
password... | [
"wtforms.validators.DataRequired"
] | [((233, 247), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (245, 247), False, 'from wtforms.validators import DataRequired, EqualTo\n'), ((295, 309), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (307, 309), False, 'from wtforms.validators import DataRequired, EqualTo\n'),... |
import pandas as pd
import unittest
import common_python.constants as cn
from common_python.util.item_aggregator import ItemAggregator
IGNORE_TEST = False
SIZE = 10
MULT = 5
ITEMS = [(n, MULT*n) for n in range(SIZE)]
class TestItemAggregator(unittest.TestCase):
def setUp(self):
self.aggregator = ItemAggregato... | [
"unittest.main",
"common_python.util.item_aggregator.ItemAggregator"
] | [((1008, 1023), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1021, 1023), False, 'import unittest\n'), ((307, 337), 'common_python.util.item_aggregator.ItemAggregator', 'ItemAggregator', (['(lambda v: v[0])'], {}), '(lambda v: v[0])\n', (321, 337), False, 'from common_python.util.item_aggregator import ItemAggr... |
"""
Unit tests for Deployment class
"""
from unittest.mock import MagicMock, Mock
import pytest
from colour import Colour
from deployment import Deployment
BLACK = Colour("black")
@pytest.fixture(name="simple_deployment")
def simple_deployment_fixture(simple_box):
"""
This fixture will return a simple Dep... | [
"unittest.mock.MagicMock",
"unittest.mock.Mock",
"pytest.fixture",
"colour.Colour",
"deployment.Deployment",
"pytest.mark.parametrize"
] | [((168, 183), 'colour.Colour', 'Colour', (['"""black"""'], {}), "('black')\n", (174, 183), False, 'from colour import Colour\n'), ((187, 227), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""simple_deployment"""'}), "(name='simple_deployment')\n", (201, 227), False, 'import pytest\n'), ((495, 544), 'pytest.mark.p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyprometheus.values
~~~~~~~~~~~~~~~~~~~
Prometheus instrumentation library for Python applications
:copyright: (c) 2017 by <NAME>.
:license: , see LICENSE for more details.
:github: http://github.com/Lispython/pyprometheus
"""
import time
from pyprometheus.utils imp... | [
"pyprometheus.managers.GaugeTimerManager",
"pyprometheus.managers.TimerManager",
"time.time",
"pyprometheus.managers.InprogressTrackerManager",
"pyprometheus.utils.escape_str"
] | [((2941, 2958), 'pyprometheus.utils.escape_str', 'escape_str', (['label'], {}), '(label)\n', (2951, 2958), False, 'from pyprometheus.utils import escape_str\n'), ((3555, 3585), 'pyprometheus.managers.InprogressTrackerManager', 'InprogressTrackerManager', (['self'], {}), '(self)\n', (3579, 3585), False, 'from pypromethe... |
import scattertext as st
from scattertext import RankDifference
convention_df = st.SampleCorpora.ConventionData2012.get_data()
convention_df['parse'] = convention_df['text'].apply(st.whitespace_nlp_with_sentences)
unigram_corpus = (st.CorpusFromParsedDocuments(convention_df,
... | [
"scattertext.SentencesForTopicModeling",
"scattertext.CorpusFromParsedDocuments",
"scattertext.RankDifference",
"scattertext.FeatsFromTopicModel",
"scattertext.SampleCorpora.ConventionData2012.get_data"
] | [((81, 127), 'scattertext.SampleCorpora.ConventionData2012.get_data', 'st.SampleCorpora.ConventionData2012.get_data', ([], {}), '()\n', (125, 127), True, 'import scattertext as st\n'), ((903, 938), 'scattertext.FeatsFromTopicModel', 'st.FeatsFromTopicModel', (['topic_model'], {}), '(topic_model)\n', (925, 938), True, '... |
from box import Box
class Board(Box):
def __init__(self):
"""Initialize the board empty."""
self.board = []
self.hitted_not_sunk = [] #Only for CPU
for row in range(10):
line = []
for column in range(10):
element = Box('.', (row, column))
... | [
"box.Box"
] | [((292, 315), 'box.Box', 'Box', (['"""."""', '(row, column)'], {}), "('.', (row, column))\n", (295, 315), False, 'from box import Box\n')] |
# Copyright (c) 2020 Vail-Zero. All Rights Resarved.
# 必要なライブラリーインポート
from tkinter import messagebox
from pack import decker
import tkinter
import threading
import os
import sys
from pack import passgen
# from pack import config
# from pack import GUIl
from tkinter import *
from tkinter import ttk
fr... | [
"tkinter.ttk.Label",
"os.path.isfile",
"pack.decker.comzip",
"pack.passgen.gen",
"os.path.join",
"random.randint",
"pyperclip.paste",
"tkinter.Button",
"tkinter.Entry",
"tkinter.filedialog.askopenfilename",
"tkinter.Tk",
"pack.PassBox.PswdBox",
"threading.Thread",
"tkinter.messagebox.showi... | [((5218, 5230), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (5228, 5230), False, 'import tkinter\n'), ((5493, 5531), 'tkinter.Entry', 'tkinter.Entry', ([], {'font': "('', 15)", 'show': '"""*"""'}), "(font=('', 15), show='*')\n", (5506, 5531), False, 'import tkinter\n'), ((5643, 5696), 'tkinter.Button', 'tkinter.Butto... |
# This is an answer to: https://codegolf.stackexchange.com/questions/189277/bridge-the-gaps
import sys
import os
from PIL import Image
import numpy as np
import scipy.ndimage
def obtain_groups(image, threshold, structuring_el):
"""
Obtain isles of unconnected pixels via a threshold on the R channel
"""
... | [
"numpy.ndindex",
"PIL.Image.open",
"numpy.array",
"PIL.Image.fromarray",
"os.listdir"
] | [((2124, 2144), 'os.listdir', 'os.listdir', (['"""images"""'], {}), "('images')\n", (2134, 2144), False, 'import os\n'), ((2349, 2361), 'numpy.array', 'np.array', (['im'], {}), '(im)\n', (2357, 2361), True, 'import numpy as np\n'), ((2604, 2631), 'numpy.ndindex', 'np.ndindex', (['image.shape[:2]'], {}), '(image.shape[:... |
#!/usr/bin/env python
import rospy
import sys
import time
import numpy as np
from realtimepseudoAstar import plan
from globaltorobotcoords import transform
from nubot_common.msg import ActionCmd, VelCmd, OminiVisionInfo, BallInfo, ObstaclesInfo, RobotInfo, BallIsHolding
#Initialize desired x depending on obstacle num... | [
"globaltorobotcoords.transform",
"nubot_common.msg.ActionCmd",
"rospy.Rate",
"numpy.array",
"numpy.linalg.norm",
"rospy.spin",
"numpy.all"
] | [((822, 839), 'rospy.Rate', 'rospy.Rate', (['hertz'], {}), '(hertz)\n', (832, 839), False, 'import rospy\n'), ((955, 983), 'numpy.array', 'np.array', (['[r.pos.x, r.pos.y]'], {}), '([r.pos.x, r.pos.y])\n', (963, 983), True, 'import numpy as np\n'), ((1494, 1560), 'globaltorobotcoords.transform', 'transform', (['target[... |
#
# -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# 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
"""
The cisco.ios_route_maps config file.
It is in this file where the current conf... | [
"ansible_collections.cisco.ios.plugins.module_utils.network.ios.rm_templates.route_maps.Route_mapsTemplate",
"ansible.module_utils.six.iteritems",
"ansible_collections.cisco.ios.plugins.module_utils.network.ios.facts.facts.Facts",
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.util... | [((2995, 3011), 'ansible.module_utils.six.iteritems', 'iteritems', (['wantd'], {}), '(wantd)\n', (3004, 3011), False, 'from ansible.module_utils.six import iteritems\n'), ((8768, 8783), 'ansible.module_utils.six.iteritems', 'iteritems', (['want'], {}), '(want)\n', (8777, 8783), False, 'from ansible.module_utils.six imp... |
"""
cpsg.py
~~~~~~
Concfg Preset Screenshot Generator
Only works in pure powershell/pwsh session, does not work in terminal like cmder.
Prerequisites:
Python3.4+, Pillow, jinja2, pywin32
"""
import os
import sys
import glob
import time
import shutil
import argparse
import win... | [
"win32gui.GetWindowRect",
"argparse.ArgumentParser",
"os.makedirs",
"PIL.ImageGrab.grab",
"win32gui.IsWindowVisible",
"win32process.GetWindowThreadProcessId",
"os.path.realpath",
"os.path.basename",
"os.path.exists",
"shutil.which",
"time.sleep",
"win32gui.EnumWindows",
"win32gui.SetForegrou... | [((518, 564), 'os.path.join', 'os.path.join', (['SCRIPT_DIR', 'os.pardir', '"""presets"""'], {}), "(SCRIPT_DIR, os.pardir, 'presets')\n", (530, 564), False, 'import os\n'), ((588, 642), 'os.path.join', 'os.path.join', (['SCRIPT_DIR', 'os.pardir', '"""preset_examples"""'], {}), "(SCRIPT_DIR, os.pardir, 'preset_examples'... |
"""
Brython MDCComponent: MDCList
=============================
"""
from browser import html
from .core import MDCTemplate
########################################################################
class __listItem__(MDCTemplate):
""""""
MDC_optionals = {
'meta': '<span class="mdc-list-item__meta">... | [
"browser.html.H3"
] | [((6421, 6470), 'browser.html.H3', 'html.H3', (['label'], {'Class': '"""mdc-list-group__subheader"""'}), "(label, Class='mdc-list-group__subheader')\n", (6428, 6470), False, 'from browser import html\n')] |
"""Exercise 2 skeleton: Create a square that bounces when it reaches any boundary of the canvas
Remember to fill out all the TODO's, you can quickly scan for them by pressing CTRL/CMD + F
"""
import sys
import os
import pygame
"""
SETUP section - preparing everything before the main loop runs
"""
pygame.init()
scre... | [
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.draw.rect",
"pygame.Rect",
"pygame.init",
"pygame.display.flip",
"pygame.time.Clock",
"sys.exit"
] | [((301, 314), 'pygame.init', 'pygame.init', ([], {}), '()\n', (312, 314), False, 'import pygame\n'), ((365, 419), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(screen_width, screen_height)'], {}), '((screen_width, screen_height))\n', (388, 419), False, 'import pygame\n'), ((429, 448), 'pygame.time.Clock', '... |
import fs
from conftest import rules_shortcut, make_files, read_files
from organize import core
def test_rename_issue52():
# test for issue https://github.com/tfeldmann/organize/issues/51
files = {
"files": {
"19asd_WF_test2.PDF": "",
"other.pdf": "",
"18asd_WFX_tes... | [
"fs.open_fs",
"conftest.make_files",
"conftest.read_files",
"organize.core.run",
"conftest.rules_shortcut"
] | [((358, 379), 'fs.open_fs', 'fs.open_fs', (['"""temp://"""'], {}), "('temp://')\n", (368, 379), False, 'import fs\n'), ((396, 418), 'conftest.make_files', 'make_files', (['mem', 'files'], {}), '(mem, files)\n', (406, 418), False, 'from conftest import rules_shortcut, make_files, read_files\n'), ((436, 749), 'conftest.r... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
app = dash.Dash(__name__)
app.layout = html.Div([
html.H2("True Cost of Car (with Interest and Monthly Expenses)", style={'text-align':'cen... | [
"pandas.DataFrame",
"dash.Dash",
"dash_html_components.H2",
"plotly.express.line",
"dash_core_components.Input",
"dash.dependencies.Input",
"dash_html_components.P",
"dash_core_components.Graph",
"pandas.melt",
"dash.dependencies.Output",
"dash_html_components.Hr"
] | [((182, 201), 'dash.Dash', 'dash.Dash', (['__name__'], {}), '(__name__)\n', (191, 201), False, 'import dash\n'), ((1660, 1707), 'pandas.DataFrame', 'pd.DataFrame', (["{'Downpayment': downpayment_list}"], {}), "({'Downpayment': downpayment_list})\n", (1672, 1707), True, 'import pandas as pd\n'), ((2056, 2099), 'pandas.m... |
from django.urls import reverse
from django.shortcuts import resolve_url
from django.contrib.auth import REDIRECT_FIELD_NAME as redirect_field_name
from .models import is_mfa_enabled, is_u2f_enabled
from .views import verify_rmb_cookie
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError: ... | [
"django.urls.reverse",
"django.contrib.auth.views.redirect_to_login"
] | [((821, 856), 'django.urls.reverse', 'reverse', (['"""mfa:verify_second_factor"""'], {}), "('mfa:verify_second_factor')\n", (828, 856), False, 'from django.urls import reverse\n'), ((858, 897), 'django.urls.reverse', 'reverse', (['"""mfa:verify_second_factor_u2f"""'], {}), "('mfa:verify_second_factor_u2f')\n", (865, 89... |
# Generated by Django 3.2.8 on 2021-10-24 02:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('amcm', '0002_auto_20211024_0134'),
]
operations = [
migrations.AlterModelOptions(
name='tipofec... | [
"django.db.models.ForeignKey",
"django.db.migrations.AlterModelOptions",
"django.db.models.DateField"
] | [((265, 426), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""tipofecha"""', 'options': "{'verbose_name': 'Tipo de Fecha del Evento', 'verbose_name_plural':\n 'Tipos de Fechas del Evento'}"}), "(name='tipofecha', options={'verbose_name':\n 'Tipo de Fecha del Evento', 'v... |
import os
import sys
from flask import Flask, render_template
from flask.ext.mongoengine import MongoEngine
app = Flask(__name__)
app.config.from_object('config')
app.config["MONGODB_SETTINGS"] = {
"DB": os.environ.get("U_DB"),
"USERNAME": os.environ.get("U_USER"),
"PASSWORD": os.environ.get("U_PASS"),
... | [
"os.environ.get",
"flask.Flask",
"flask.render_template",
"flask.ext.mongoengine.MongoEngine"
] | [((115, 130), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (120, 130), False, 'from flask import Flask, render_template\n'), ((369, 385), 'flask.ext.mongoengine.MongoEngine', 'MongoEngine', (['app'], {}), '(app)\n', (380, 385), False, 'from flask.ext.mongoengine import MongoEngine\n'), ((211, 233), 'os.e... |
from django.contrib import admin
from archives.models import *
from archives.forms import DocumentForm
class AddressInline(admin.StackedInline):
model = Address
extra = 1
class ContainerStatementInline(admin.TabularInline):
model = ContainerStatements
extra = 1
class DocumentStatementInline(admin... | [
"django.contrib.admin.site.register"
] | [((1932, 1980), 'django.contrib.admin.site.register', 'admin.site.register', (['Collection', 'CollectionAdmin'], {}), '(Collection, CollectionAdmin)\n', (1951, 1980), False, 'from django.contrib import admin\n'), ((1981, 2029), 'django.contrib.admin.site.register', 'admin.site.register', (['Repository', 'RepositoryAdmi... |
import numpy as np
from keras.callbacks import Callback
from keras import backend as K
import tensorflow as tf
class SummaryCallback(Callback):
def __init__(self, trainer, validation=False):
super(SummaryCallback, self)
self.trainer = trainer
self.summarysteps = trainer.config['summarystep... | [
"tensorflow.assign",
"tensorflow.Variable",
"keras.backend.eval",
"numpy.rollaxis"
] | [((382, 420), 'tensorflow.Variable', 'tf.Variable', (['(0.0)'], {'validate_shape': '(False)'}), '(0.0, validate_shape=False)\n', (393, 420), True, 'import tensorflow as tf\n'), ((440, 478), 'tensorflow.Variable', 'tf.Variable', (['(0.0)'], {'validate_shape': '(False)'}), '(0.0, validate_shape=False)\n', (451, 478), Tru... |
import logging
logger = logging.getLogger(__name__)
async def do(param: str) -> None:
pass # pragma: no cover
async def log_something() -> None:
logger.debug("debug log")
logger.info("info log")
logger.warning("warning log")
logger.error("debug log")
logger.critical("critical log")
lo... | [
"logging.getLogger"
] | [((25, 52), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (42, 52), False, 'import logging\n')] |
import pytest
from ithkuil.morphology.words import remove_stress
txts_to_test = [
('a', 'a'),
('o', 'o'),
('áu', 'au'),
('ái', 'ai'),
('aú', 'aù'),
('aé', 'ae'),
('á', 'a')
]
@pytest.mark.parametrize('txt, expected', txts_to_test)
def test_word(txt, expected):
assert remove_stress(txt)... | [
"pytest.mark.parametrize",
"ithkuil.morphology.words.remove_stress"
] | [((206, 260), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""txt, expected"""', 'txts_to_test'], {}), "('txt, expected', txts_to_test)\n", (229, 260), False, 'import pytest\n'), ((302, 320), 'ithkuil.morphology.words.remove_stress', 'remove_stress', (['txt'], {}), '(txt)\n', (315, 320), False, 'from ithkui... |
import argparse
import logging
import os
from typing import Tuple
import warnings
import torch
import torchvision
from .. import headmeta
from . import basenetworks, heads, nets
# generate hash values with: shasum -a 256 filename.pkl
PRETRAINED_UNAVAILABLE = object()
# Dataset cocokp is implied. All other datasets... | [
"os.path.basename",
"warnings.filterwarnings",
"torch.load",
"torch.hub.get_dir",
"os.path.exists",
"warnings.catch_warnings",
"os.path.join",
"os.getenv",
"logging.getLogger"
] | [((3844, 3871), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3861, 3871), False, 'import logging\n'), ((3920, 3946), 'os.path.exists', 'os.path.exists', (['checkpoint'], {}), '(checkpoint)\n', (3934, 3946), False, 'import os\n'), ((4614, 4639), 'os.path.exists', 'os.path.exists', (['fi... |
# coding=utf-8
from random import shuffle
from bs4 import BeautifulSoup
from bandcamp_parser.request import Request
class AlbumResult(object):
""" Just for autocompletion and more 'static' structure instead of json/soup """
def __init__(self, soup):
self.title = soup.attrs['title']
self.href... | [
"random.shuffle",
"bandcamp_parser.request.Request.get"
] | [((1295, 1310), 'random.shuffle', 'shuffle', (['tracks'], {}), '(tracks)\n', (1302, 1310), False, 'from random import shuffle\n'), ((684, 705), 'bandcamp_parser.request.Request.get', 'Request.get', (['self.url'], {}), '(self.url)\n', (695, 705), False, 'from bandcamp_parser.request import Request\n')] |
from pytibrv.status import *
from pytibrv.api import *
from pytibrv.disp import *
import unittest
class DispatcherTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
status = tibrv_Open()
assert status == TIBRV_OK, tibrvStatus_GetText(status)
@classmethod
def tearDownClass(cls... | [
"unittest.main"
] | [((984, 1010), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (997, 1010), False, 'import unittest\n')] |
from packerpy import PackerExecutable
from jinja2 import Environment, FileSystemLoader
from modules import aws_service
import sys
class PackerController():
def __init__(self, config, log):
self.config = config
self.log = log
self.p = PackerExecutable("/usr/local/bin/packer")
sel... | [
"modules.aws_service.deregister_images",
"packerpy.PackerExecutable",
"sys.exit",
"jinja2.FileSystemLoader"
] | [((267, 308), 'packerpy.PackerExecutable', 'PackerExecutable', (['"""/usr/local/bin/packer"""'], {}), "('/usr/local/bin/packer')\n", (283, 308), False, 'from packerpy import PackerExecutable\n'), ((2174, 2244), 'modules.aws_service.deregister_images', 'aws_service.deregister_images', (['self.packer_amis', 'self.config'... |
import sys
import requests
import logging
from splunklib.modularinput import *
class MI(Script):
def get_scheme(self):
scheme = Scheme("Twitch Input")
scheme.description = 'Collect Twitch channel stats'
scheme.use_external_validation = True
scheme.use_single_instance = True
... | [
"logging.info",
"logging.debug"
] | [((633, 665), 'logging.info', 'logging.info', (['"""Validating input"""'], {}), "('Validating input')\n", (645, 665), False, 'import logging\n'), ((738, 776), 'logging.debug', 'logging.debug', (['f"""username: {username}"""'], {}), "(f'username: {username}')\n", (751, 776), False, 'import logging\n')] |
"""
Plotting facilities, based on Python's MPL library.
The L{Chart} object is a facade which provides intuitive access to MPL's plotting
objects. The following examples show a typical use of L{Chart}:
1. Instantiation
>>> chart = Chart() # a chart with a single plot
>>> chart... | [
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"time.sleep",
"wx.CallAfter",
"matplotlib.figure.Figure",
"threading.Event",
"matplotlib.backends.backend_wx.FigureFrameWx"
] | [((3701, 3708), 'threading.Event', 'Event', ([], {}), '()\n', (3706, 3708), False, 'from threading import Thread, Event\n'), ((3741, 3748), 'threading.Event', 'Event', ([], {}), '()\n', (3746, 3748), False, 'from threading import Thread, Event\n'), ((10566, 10595), 'wx.CallAfter', 'wx.CallAfter', (['callable', '*args']... |
"""Author: <NAME>."""
from typing import Optional, Tuple
import distutils.version
import uuid
from datetime import datetime
from pathlib import Path
import warnings
import numpy as np
import neo.io.baseio
import pynwb
from hdmf.backends.hdf5 import H5DataIO
from ..nwb_helpers import add_device_from_metadata
from ...u... | [
"warnings.warn",
"pathlib.Path",
"uuid.uuid4",
"pynwb.NWBFile"
] | [((5267, 5383), 'warnings.warn', 'warnings.warn', (['"""When adding Icephys Electrode, no Devices were found on nwbfile. Creating a Device now..."""'], {}), "(\n 'When adding Icephys Electrode, no Devices were found on nwbfile. Creating a Device now...'\n )\n", (5280, 5383), False, 'import warnings\n'), ((8304, 8... |
import os
import torch
import torch.distributed as dist
from megatron import get_args
from megatron import print_rank_0
from megatron.indexer_emdr2 import IndexBuilder
from megatron.checkpointing import get_checkpoint_tracker_filename
from megatron.initialize import init_distributed, _init_autoresume, _set_random_see... | [
"megatron.checkpointing.get_checkpoint_tracker_filename",
"megatron.mpu.initialize.get_data_parallel_group",
"os.path.isfile",
"torch.distributed.get_world_size",
"megatron.initialize._set_random_seed",
"megatron.mpu.initialize.mips_is_initialized",
"torch.distributed.get_rank",
"megatron.mpu.initiali... | [((968, 978), 'megatron.get_args', 'get_args', ([], {}), '()\n', (976, 978), False, 'from megatron import get_args\n'), ((1053, 1071), 'megatron.initialize.init_distributed', 'init_distributed', ([], {}), '()\n', (1069, 1071), False, 'from megatron.initialize import init_distributed, _init_autoresume, _set_random_seed,... |
import cv2
import numpy as np
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_pose = mp.solutions.pose
# ---------------------------------------------------------------------
filter = np.array(
[
[0, -1, 0],
[-1, 5, -1],
[0,-1... | [
"cv2.getPerspectiveTransform",
"cv2.bilateralFilter",
"cv2.rectangle",
"cv2.absdiff",
"cv2.imshow",
"cv2.warpPerspective",
"cv2.contourArea",
"cv2.filter2D",
"cv2.dilate",
"cv2.cvtColor",
"cv2.boundingRect",
"cv2.destroyAllWindows",
"cv2.resize",
"cv2.waitKey",
"numpy.float32",
"cv2.th... | [((250, 297), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 5, -1], [0, -1, 0]]'], {}), '([[0, -1, 0], [-1, 5, -1], [0, -1, 0]])\n', (258, 297), True, 'import numpy as np\n'), ((514, 578), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""../video_file/Hackathon_high_home_1_Trim.mp4"""'], {}), "('../video_file/Hackathon_... |
# Written by: <NAME>, @dataoutsider
# Viz: "Good Read", enjoy!
import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup
import re
import matplotlib.pyplot as plt
import os
#region Site 1: https://mostrecommendedbooks.com/best-books
def crawl(url):
content = requests.get(url)
soup... | [
"bs4.BeautifulSoup",
"os.path.dirname",
"re.search",
"requests.get"
] | [((294, 311), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (306, 311), False, 'import requests\n'), ((323, 365), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content.text', '"""html.parser"""'], {}), "(content.text, 'html.parser')\n", (336, 365), False, 'from bs4 import BeautifulSoup\n'), ((801, 835), 're.sear... |
import tensorflow as tf
import numpy as np
import pandas as pd
import re
import nltk
import string
import random
random.seed(0)
np.random.seed(0)
tf.random.set_seed(42)
tf.random.set_seed(42)
from nltk.tokenize import word_tokenize
from nltk.tokenize.treebank import TreebankWordDetokenizer
df = pd.read_csv("imdb.csv... | [
"tensorflow.random.set_seed",
"pickle.dump",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.callbacks.ModelCheckpoint",
"nltk.tokenize.treebank.TreebankWordDetokenizer",
"tensorflow.keras.preprocessing.text.Token... | [((114, 128), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (125, 128), False, 'import random\n'), ((129, 146), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (143, 146), True, 'import numpy as np\n'), ((147, 169), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(42)'], {}), '(42)\n', (16... |
from core.consumable import Consumable
from core.events import *
from core.engine import Engine
class Port:
def __init__(self, id):
self.id = id
self.target = None
self.link_out = None
self.link_in = None
self.delegated = None
# This variable is used to calculate ... | [
"core.engine.Engine"
] | [((3077, 3103), 'core.engine.Engine', 'Engine', (['self.ctx'], {}), '(self.ctx, **kwargs)\n', (3083, 3103), False, 'from core.engine import Engine\n')] |
# ---
# jupyter:
# jupytext_format_version: '1.2'
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# language_info:
# codemirror_mode:
# name: ipython
# version: 3
# file_extension: .py
# mimetype: text/x-python
# name: python
# nbconvert_export... | [
"matplotlib.pyplot.title",
"numpy.sum",
"abs_models.attack_utils.LineSearchAttack",
"numpy.sqrt",
"foolbox.criteria.Misclassification",
"foolbox.models.TensorFlowModel",
"matplotlib.pyplot.imshow",
"abs_models.utils.get_batch",
"foolbox.adversarial.Adversarial",
"abs_models.models.get_VAE",
"abs... | [((405, 432), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./../"""'], {}), "(0, './../')\n", (420, 432), False, 'import sys\n'), ((800, 821), 'abs_models.models.get_VAE', 'mz.get_VAE', ([], {'n_iter': '(10)'}), '(n_iter=10)\n', (810, 821), True, 'from abs_models import models as mz\n'), ((1840, 1861), 'abs_model... |
#
# Copyright (C) 2021 <NAME> <<EMAIL>>
# License: MIT
#
# pylint: disable=missing-docstring
import unittest
import anyconfig.api
from . import common
LOADER_TYPES = frozenset(anyconfig.api.list_types())
@unittest.skipIf('yaml' not in LOADER_TYPES,
'yaml loader is not available')
class YamlTestCa... | [
"unittest.skipIf"
] | [((211, 286), 'unittest.skipIf', 'unittest.skipIf', (["('yaml' not in LOADER_TYPES)", '"""yaml loader is not available"""'], {}), "('yaml' not in LOADER_TYPES, 'yaml loader is not available')\n", (226, 286), False, 'import unittest\n'), ((384, 459), 'unittest.skipIf', 'unittest.skipIf', (["('toml' not in LOADER_TYPES)"... |
from entities.cache.cache_options import CacheOptions
import os
from services.file_service import FileService
from torch._C import dtype
import numpy as np
import torch
from tqdm import tqdm
from typing import List, Tuple
from enums.ocr_output_type import OCROutputType
from enums.language import Language
from servic... | [
"entities.cache.cache_options.CacheOptions"
] | [((4164, 4199), 'entities.cache.cache_options.CacheOptions', 'CacheOptions', (['token_pairs_cache_key'], {}), '(token_pairs_cache_key)\n', (4176, 4199), False, 'from entities.cache.cache_options import CacheOptions\n'), ((4921, 4956), 'entities.cache.cache_options.CacheOptions', 'CacheOptions', (['token_pairs_cache_key... |
"""
# T: maturity
# n: # option periods
# N: # futures periods
# S: initial stock price
# r: continuously-compounded interest rate
# c: dividend yield
# sigma: annualized volatility
# K: strike price
# cp: +1/-1 with regards to call/put
"""
from __future__ import division
from math import exp, sqrt
import numpy as np... | [
"math.exp",
"numpy.zeros",
"math.sqrt",
"numpy.sqrt"
] | [((771, 782), 'math.exp', 'exp', (['(r * dt)'], {}), '(r * dt)\n', (774, 782), False, 'from math import exp, sqrt\n'), ((1034, 1058), 'numpy.zeros', 'np.zeros', (['(n + 1, n + 1)'], {}), '((n + 1, n + 1))\n', (1042, 1058), True, 'import numpy as np\n'), ((1755, 1779), 'numpy.zeros', 'np.zeros', (['(n + 1, n + 1)'], {})... |
from fenics import *
from matplotlib.pyplot import show
from dolfin_adjoint import *
from ufl_dnn.neural_network import ANN
class BoundaryOuter(SubDomain):
def inside(self, x, on_boundary):
return on_boundary
def a_u(u, v):
return my * (inner(grad(u), grad(v)) + inner(grad(u), nabla_grad(v))) * dx
def... | [
"sympy.symbols",
"sympy.printing.ccode",
"matplotlib.pyplot.show",
"sympy.diff",
"sympy.cos",
"ufl_dnn.neural_network.ANN",
"sympy.sin"
] | [((591, 616), 'sympy.symbols', 'sym.symbols', (['"""x[0], x[1]"""'], {}), "('x[0], x[1]')\n", (602, 616), True, 'import sympy as sym\n'), ((3084, 3090), 'matplotlib.pyplot.show', 'show', ([], {}), '()\n', (3088, 3090), False, 'from matplotlib.pyplot import show\n'), ((3170, 3203), 'ufl_dnn.neural_network.ANN', 'ANN', (... |
import click
import logging
import os
import requests
import xml.etree.ElementTree as ET
from multiprocessing.dummy import Pool
class OctocatsDownloader:
feeds_url = "http://feeds.feedburner.com/Octocats"
def __init__(self, output="octocats", max_threads=5, force=False, logger=None):
if not os.path.e... | [
"os.mkdir",
"xml.etree.ElementTree.fromstring",
"multiprocessing.dummy.Pool",
"requests.Session",
"click.option",
"os.path.exists",
"click.command",
"click.IntRange",
"click.open_file",
"click.Path",
"os.path.join",
"logging.getLogger"
] | [((2179, 2194), 'click.command', 'click.command', ([], {}), '()\n', (2192, 2194), False, 'import click\n'), ((2530, 2588), 'click.option', 'click.option', (['"""-p"""', '"""--proxy"""'], {'type': 'str', 'help': '"""HTTP Proxy"""'}), "('-p', '--proxy', type=str, help='HTTP Proxy')\n", (2542, 2588), False, 'import click\... |
from pyflink.table import *
from pyflink.table.expressions import col, lit, concat
from pyflink.table.window import Tumble
def demo01():
# environment configuration
t_env = BatchTableEnvironment.create(environment_settings=EnvironmentSettings.new_instance().in_batch_mode().use_blink_planner().build())
# ... | [
"pyflink.table.expressions.col",
"pyflink.table.expressions.lit",
"pyflink.table.expressions.concat"
] | [((1520, 1545), 'pyflink.table.expressions.concat', 'concat', (['orders.c', '"""sunny"""'], {}), "(orders.c, 'sunny')\n", (1526, 1545), False, 'from pyflink.table.expressions import col, lit, concat\n'), ((2274, 2282), 'pyflink.table.expressions.col', 'col', (['"""a"""'], {}), "('a')\n", (2277, 2282), False, 'from pyfl... |
# -*- coding: utf-8 -*-
"""
PID Control Class
"""
# Author: <NAME> <<EMAIL>>
# License: MIT
from collections import deque
import math
import numpy as np
import carla
class Controller:
"""
PID Controller implementation.
Parameters
----------
args : dict
The configuration dictionary parse... | [
"math.radians",
"numpy.cross",
"numpy.clip",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"carla.VehicleControl",
"collections.deque"
] | [((1110, 1126), 'collections.deque', 'deque', ([], {'maxlen': '(10)'}), '(maxlen=10)\n', (1115, 1126), False, 'from collections import deque\n'), ((1362, 1378), 'collections.deque', 'deque', ([], {'maxlen': '(10)'}), '(maxlen=10)\n', (1367, 1378), False, 'from collections import deque\n'), ((2932, 3022), 'numpy.clip', ... |
from abc_type import IdaTypes
from ida_types import IDA_TYPES
class IdaTStr(IdaTypes):
def __init__(self, ida_type=IDA_TYPES['str']):
self.ida_type = {'idt': ida_type, 'value': ''}
def decode(self, data):
count = ord(data[0])
offset = 1
for i in range(0, count):
im... | [
"ida_decoder.decode_hybrid_type"
] | [((365, 419), 'ida_decoder.decode_hybrid_type', 'ida_decoder.decode_hybrid_type', ([], {'ida_type': 'data[offset:]'}), '(ida_type=data[offset:])\n', (395, 419), False, 'import ida_decoder\n')] |
"""
Test with multiple nodes, and multiple PoP endorsements, checking to make sure nodes stay in sync.
"""
import time
from ..framework.test_framework import PopIntegrationTestFramework
from ..framework.pop_util import endorse_block, mine_until_pop_enabled
from ..framework.sync_util import start_all, connect_all, sync... | [
"pypoptools.pypopminer.MockMiner",
"time.sleep"
] | [((701, 712), 'pypoptools.pypopminer.MockMiner', 'MockMiner', ([], {}), '()\n', (710, 712), False, 'from pypoptools.pypopminer import MockMiner, PublicationData\n'), ((2105, 2118), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (2115, 2118), False, 'import time\n')] |
""" rct cnf fs because don't knwo where else to put it and avoid
circular imports
"""
from mechanalyzer.inf import thy as tinfo
from mechlib.filesys._build import build_fs
from mechlib.filesys.mincnf import min_energy_conformer_locators
def rcts_cnf_fs(rct_infos, thy_dct, es_keyword_dct, run_prefix, save_prefix... | [
"mechanalyzer.inf.thy.from_dct",
"mechlib.filesys._build.build_fs",
"mechlib.filesys.mincnf.min_energy_conformer_locators",
"mechanalyzer.inf.thy.modify_orb_label"
] | [((448, 478), 'mechanalyzer.inf.thy.from_dct', 'tinfo.from_dct', (['ini_method_dct'], {}), '(ini_method_dct)\n', (462, 478), True, 'from mechanalyzer.inf import thy as tinfo\n'), ((560, 606), 'mechanalyzer.inf.thy.modify_orb_label', 'tinfo.modify_orb_label', (['ini_thy_info', 'rct_info'], {}), '(ini_thy_info, rct_info)... |
import sys
import os
try:
import sublime
except Exception:
pass
NEW_ACCOUNT_TXT = '''Welcome {username}!\n\nYou're all set to collaborate. You should check out our docs at https://{host}/help/plugins/sublime#usage.
You must run 'Floobits - Complete Sign Up' so you can log in to the website.'''
LINKED_ACCOU... | [
"sublime.message_dialog",
"sublime.platform",
"sublime.set_timeout",
"sublime.active_window",
"sublime.status_message",
"sublime.load_settings",
"sublime.error_message",
"sublime.ok_cancel_dialog"
] | [((699, 731), 'sublime.ok_cancel_dialog', 'sublime.ok_cancel_dialog', (['dialog'], {}), '(dialog)\n', (723, 731), False, 'import sublime\n'), ((762, 788), 'sublime.error_message', 'sublime.error_message', (['msg'], {}), '(msg)\n', (783, 788), False, 'import sublime\n'), ((820, 847), 'sublime.status_message', 'sublime.s... |
from __future__ import print_function
import os
from supervisord_dependent_startup.supervisord_dependent_startup import (DependentStartup,
DependentStartupError,
get_all_co... | [
"os.environ.get"
] | [((1112, 1148), 'os.environ.get', 'os.environ.get', (['"""TEST_TMP_DIR"""', 'None'], {}), "('TEST_TMP_DIR', None)\n", (1126, 1148), False, 'import os\n'), ((950, 989), 'os.environ.get', 'os.environ.get', (['"""CLEANUP_TESTS"""', '"""True"""'], {}), "('CLEANUP_TESTS', 'True')\n", (964, 989), False, 'import os\n')] |
#!/usr/bin/env python
# Copyright 2019-2022 AstroLab Software
# Author: <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | [
"asyncio.get_event_loop",
"argparse.ArgumentParser",
"gzip.open",
"fink_alert_simulator.alertProducer.schedule_delays",
"time.time",
"fink_alert_simulator.parser.getargs",
"fink_alert_simulator.avroUtils.readschemadata",
"fink_alert_simulator.alertProducer.AlertProducer",
"numpy.array_split",
"os.... | [((962, 1006), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (985, 1006), False, 'import argparse\n'), ((1018, 1033), 'fink_alert_simulator.parser.getargs', 'getargs', (['parser'], {}), '(parser)\n', (1025, 1033), False, 'from fink_alert_simulator.par... |
"""Implementation of Rule L001."""
from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@document_fix_compatible
class Rule_L001(BaseRule):
"""Unnecessary trailing whitespace.
| **Anti-pattern**
| The • character represe... | [
"sqlfluff.core.rules.base.LintResult",
"sqlfluff.core.rules.base.LintFix"
] | [((1319, 1331), 'sqlfluff.core.rules.base.LintResult', 'LintResult', ([], {}), '()\n', (1329, 1331), False, 'from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix\n'), ((1249, 1269), 'sqlfluff.core.rules.base.LintFix', 'LintFix', (['"""delete"""', 'd'], {}), "('delete', d)\n", (1256, 1269), False, 'from sq... |
#==================================================================================
# PROGRAM: "Hannibal.py"
# LOCATION: beluga>examples>Mansell
# Author: <NAME> (2016)
#
# Description: Preliminary test of a track path optimization using a user-defined
# terrain elevation profile.
#========================... | [
"beluga.Beluga.run",
"beluga.bvpsol.algorithms.MultipleShooting"
] | [((2001, 2138), 'beluga.bvpsol.algorithms.MultipleShooting', 'algorithms.MultipleShooting', ([], {'derivative_method': '"""fd"""', 'tolerance': '(0.0001)', 'max_iterations': '(1000)', 'verbose': '(True)', 'cached': '(False)', 'number_arcs': '(4)'}), "(derivative_method='fd', tolerance=0.0001,\n max_iterations=1000, ... |
import typing as tp
from dataclasses import dataclass
from datetime import datetime, timedelta
@dataclass()
class ChannelUploadInfo:
"""
Channel Upload info structure
:param uuid: uuid of db entry to feed
:param interval: interval between readings in seconds
:param factor: multiply to original val... | [
"dataclasses.dataclass"
] | [((98, 109), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (107, 109), False, 'from dataclasses import dataclass\n')] |
from django.db import models
from django.utils import timezone
import datetime
# Create your models here.
class PurchaseOrder(models.Model):
razorpay_payment_id=models.CharField(max_length=100)
razorpay_order_id=models.CharField(max_length=100)
razorpay_signature=models.CharField(max_length=500)
user_unique_id=mo... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.FloatField",
"django.db.models.EmailField"
] | [((164, 196), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (180, 196), False, 'from django.db import models\n'), ((216, 248), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (232, 248), False, 'from django.d... |
# -*- coding: UTF-8 -*-
import cv2
import matplotlib.pyplot as plt
import numpy as np
class PROIE():
def __init__(self):
#####
pass
# PRIVATE METHODS
def _threshold(self):
#####
self.blur_img = cv2.GaussianBlur(self.in_img_g, (5, 5), 0)
_, self.thresh_img = cv2.... | [
"matplotlib.pyplot.title",
"cv2.GaussianBlur",
"numpy.fft.rfft",
"numpy.arctan2",
"numpy.argsort",
"cv2.warpAffine",
"matplotlib.pyplot.figure",
"cv2.rectangle",
"cv2.getRotationMatrix2D",
"numpy.fft.irfft",
"cv2.cvtColor",
"cv2.imwrite",
"matplotlib.pyplot.imshow",
"cv2.drawContours",
"... | [((244, 286), 'cv2.GaussianBlur', 'cv2.GaussianBlur', (['self.in_img_g', '(5, 5)', '(0)'], {}), '(self.in_img_g, (5, 5), 0)\n', (260, 286), False, 'import cv2\n'), ((316, 389), 'cv2.threshold', 'cv2.threshold', (['self.blur_img', '(0)', '(255)', '(cv2.THRESH_BINARY + cv2.THRESH_OTSU)'], {}), '(self.blur_img, 0, 255, cv... |
import numpy as np
from pandas.testing import assert_frame_equal
import warnings
from hdmf.backends.hdf5 import HDF5IO
from hdmf.common import DynamicTable, VectorData, get_manager, AlignedDynamicTable
from hdmf.testing import TestCase, remove_test_file
class TestAlignedDynamicTableContainer(TestCase):
"""
T... | [
"pandas.testing.assert_frame_equal",
"warnings.simplefilter",
"hdmf.common.VectorData",
"numpy.asarray",
"hdmf.common.DynamicTable",
"hdmf.common.AlignedDynamicTable",
"numpy.arange",
"hdmf.common.get_manager",
"hdmf.testing.remove_test_file"
] | [((402, 433), 'warnings.simplefilter', 'warnings.simplefilter', (['"""always"""'], {}), "('always')\n", (423, 433), False, 'import warnings\n'), ((557, 584), 'hdmf.testing.remove_test_file', 'remove_test_file', (['self.path'], {}), '(self.path)\n', (573, 584), False, 'from hdmf.testing import TestCase, remove_test_file... |
from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.forms.forms import ErrorDict
from django.http import HttpResponseRedire... | [
"django.http.HttpResponseRedirect",
"django.utils.decorators.method_decorator",
"djblets.forms.fieldsets.filter_fieldsets",
"djblets.siteconfig.models.SiteConfiguration.objects.get_current",
"django.core.urlresolvers.reverse",
"django.utils.six.text_type",
"reviewboard.notifications.email.decorators.pre... | [((9993, 10037), 'reviewboard.notifications.email.decorators.preview_email', 'preview_email', (['prepare_password_changed_mail'], {}), '(prepare_password_changed_mail)\n', (10006, 10037), False, 'from reviewboard.notifications.email.decorators import preview_email\n'), ((10151, 10191), 'djblets.features.decorators.feat... |
# -*- coding: utf-8 -*-
"""
main module for cluster_based_k_anon
"""
import operator
import random
import time
from functools import cmp_to_key
from basic_mondrian.models.numrange import NumRange
from basic_mondrian.utils.utility import (cmp_str, get_num_list_from_str,
qid_t... | [
"basic_mondrian.utils.utility.qid_to_key",
"basic_mondrian.utils.utility.get_num_list_from_str",
"time.time",
"operator.itemgetter",
"functools.cmp_to_key"
] | [((4657, 4675), 'basic_mondrian.utils.utility.qid_to_key', 'qid_to_key', (['record'], {}), '(record)\n', (4667, 4675), False, 'from basic_mondrian.utils.utility import cmp_str, get_num_list_from_str, qid_to_key\n'), ((14217, 14228), 'time.time', 'time.time', ([], {}), '()\n', (14226, 14228), False, 'import time\n'), ((... |
from django.conf.urls import patterns, url
from pyramidal import views
urlpatterns = patterns('',
#Index
url(r'^$',views.index,name='index'),
#Geneset Views
url(r'^geneset/(?P<gene_list>[a-zA-Z0-9_\-\.\+]+)/?$',views.geneset,name='gene_set'),
#Isoform Views
url(r'^genes?/(?P<gene_id>[\w.-]+)/isoforms?/?$',vie... | [
"django.conf.urls.url"
] | [((109, 145), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.index'], {'name': '"""index"""'}), "('^$', views.index, name='index')\n", (112, 145), False, 'from django.conf.urls import patterns, url\n'), ((164, 256), 'django.conf.urls.url', 'url', (['"""^geneset/(?P<gene_list>[a-zA-Z0-9_\\\\-\\\\.\\\\+]+)/?$"""', '... |