code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
'''
Go through a given fasta file (later - mod for sets of fastas),
and output a new fasta file, with sequences containg unknown, or non standard AA
removed; too short sequences removed.
Later, can be used to filter sequences whose ID is a classname; (keeping those
with a minimum amount of examples, e.g. 30+ samples ... | [
"os.listdir",
"collections.Counter",
"os.path.isfile",
"Bio.SeqIO.parse",
"Bio.SeqIO.write"
] | [((1659, 1680), 'os.listdir', 'os.listdir', (['os.curdir'], {}), '(os.curdir)\n', (1669, 1680), False, 'import os\n'), ((2049, 2058), 'collections.Counter', 'Counter', ([], {}), '()\n', (2056, 2058), False, 'from collections import Counter\n'), ((2759, 2787), 'Bio.SeqIO.parse', 'SeqIO.parse', (['handle', '"""fasta"""']... |
import hashlib
import json
import time
from urllib.parse import urlparse
from uuid import uuid4
import requests
from flask import Flask,jsonify,request
from typing import Any,Dict,List,Optional #数据结构
class NewBlockChain:
def __init__(self):
self.current_trans = [] #当前的交易
self.chain = [] #区块链管... | [
"urllib.parse.urlparse",
"flask.Flask",
"json.dumps",
"requests.get",
"uuid.uuid4",
"flask.request.get_json",
"hashlib.sha512",
"time.time",
"flask.jsonify"
] | [((3707, 3722), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (3712, 3722), False, 'from flask import Flask, jsonify, request\n'), ((4672, 4690), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (4688, 4690), False, 'from flask import Flask, jsonify, request\n'), ((5095, 5113), 'flask.reque... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import argparse
import pandas as pd
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
FEATURES = ["crim", "zn", "indus", "nox", "rm",
"age", "dis", "tax", "ptratio"]
LA... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"tensorflow.logging.set_verbosity",
"tensorflow.contrib.layers.real_valued_column",
"tensorflow.contrib.learn.DNNRegressor",
"tensorflow.constant",
"tensorflow.app.run"
] | [((182, 223), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (206, 223), True, 'import tensorflow as tf\n'), ((520, 555), 'tensorflow.constant', 'tf.constant', (['data_set[LABEL].values'], {}), '(data_set[LABEL].values)\n', (531, 555), True, 'import ten... |
import copy
import numpy as np
import pandas as pd
from sklearn.linear_model import RidgeCV
from sklearn.model_selection import cross_val_score, GridSearchCV
import warnings
# warnings.simplefilter('ignore')
def main():
features = [
'OverallQual',
'GrLivArea',
'GarageArea',
'Tota... | [
"pandas.read_feather",
"numpy.log",
"copy.deepcopy"
] | [((487, 530), 'pandas.read_feather', 'pd.read_feather', (['"""data/input/train.feather"""'], {}), "('data/input/train.feather')\n", (502, 530), True, 'import pandas as pd\n'), ((955, 978), 'copy.deepcopy', 'copy.deepcopy', (['features'], {}), '(features)\n', (968, 978), False, 'import copy\n'), ((1406, 1435), 'numpy.lo... |
import dataclasses
import glob
import importlib.util
import inspect
import os
import sys
import types
import graphviz as gv
def _get_fullname(entity):
return '{}.{}'.format(entity.__module__, entity.__name__)
def _get_methods(entity) -> list:
return [
k
for k, v in entity.__dict__.items()
... | [
"os.path.exists",
"sys.path.insert",
"os.path.isdir",
"graphviz.Digraph",
"inspect.isclass",
"dataclasses.is_dataclass"
] | [((1250, 1281), 'dataclasses.is_dataclass', 'dataclasses.is_dataclass', (['klass'], {}), '(klass)\n', (1274, 1281), False, 'import dataclasses\n'), ((4147, 4174), 'graphviz.Digraph', 'gv.Digraph', ([], {'comment': '"""Graph"""'}), "(comment='Graph')\n", (4157, 4174), True, 'import graphviz as gv\n'), ((4751, 4772), 'os... |
#!/usr/bin/env python3
# Author: @m8r0wn
# Description: test ipparser development changes.
from sys import path, argv
path.append('..')
from ipparser import ipparser
target=argv[-1]
print('[*] Testing Input: {}'.format(target))
x= ipparser(target, resolve=True, ns=['1.1.1.1'], debug=True)
print('[*] {} Result(s)'.for... | [
"ipparser.ipparser",
"sys.path.append"
] | [((119, 136), 'sys.path.append', 'path.append', (['""".."""'], {}), "('..')\n", (130, 136), False, 'from sys import path, argv\n'), ((233, 291), 'ipparser.ipparser', 'ipparser', (['target'], {'resolve': '(True)', 'ns': "['1.1.1.1']", 'debug': '(True)'}), "(target, resolve=True, ns=['1.1.1.1'], debug=True)\n", (241, 291... |
from __future__ import division
import numpy as np
from numpy import pi, sqrt, exp, power, log, log10
import os
import constants as ct
import particle as pt
import tools as tl
##############################
# Preparing SKA configurations
##############################
def initialize():
"""This routine is supp... | [
"numpy.log10",
"numpy.sqrt",
"numpy.log",
"numpy.array",
"constants.angle_to_solid_angle",
"numpy.where",
"numpy.heaviside",
"numpy.concatenate",
"numpy.logspace",
"numpy.isinf",
"numpy.abs",
"numpy.squeeze",
"particle.lambda_from_nu",
"numpy.interp",
"numpy.ones_like",
"tools.treat_as... | [((22044, 22104), 'numpy.loadtxt', 'np.loadtxt', (["(local_path + '/data/Tsky_mid.csv')"], {'delimiter': '""","""'}), "(local_path + '/data/Tsky_mid.csv', delimiter=',')\n", (22054, 22104), True, 'import numpy as np\n'), ((22114, 22174), 'numpy.loadtxt', 'np.loadtxt', (["(local_path + '/data/Tsky_low.csv')"], {'delimit... |
import os
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from src.data_management.New_DataSplitter_leave_k_out import New_DataSplitter_leave_k_out
from src.data_management.RecSys2019Reader import RecSys2019Reader
from src.data_management.data_reader import get_ICM_train, get_UCM_train... | [
"matplotlib.pyplot.ylabel",
"src.utils.general_utility_functions.get_split_seed",
"numpy.arange",
"os.path.exists",
"src.data_management.data_reader.get_ICM_train",
"numpy.sort",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.mkdir",
"src.feature.demographics_content.get_user_demographi... | [((733, 742), 'matplotlib.pyplot.gcf', 'plt.gcf', ([], {}), '()\n', (740, 742), True, 'import matplotlib.pyplot as plt\n'), ((1520, 1552), 'src.data_management.RecSys2019Reader.RecSys2019Reader', 'RecSys2019Reader', (['root_data_path'], {}), '(root_data_path)\n', (1536, 1552), False, 'from src.data_management.RecSys201... |
import pandas as pd
import requests
import os
import json
import numpy as np
from tqdm import tqdm
import multiprocessing
import os
import gc
# cofig
feature_names = [
'TransactionAmt',
'ProductCD',
'card1',
'C1',
'C2',
'C3',
'C4',
'C5',
'C6',
'C7',
'C8',
'C9',
'C10'... | [
"os.path.abspath",
"json.dumps",
"os.path.join",
"multiprocessing.cpu_count"
] | [((472, 499), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (497, 499), False, 'import multiprocessing\n'), ((893, 918), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (908, 918), False, 'import os\n'), ((952, 1013), 'os.path.join', 'os.path.join', (['package_dir... |
from asciimatics.exceptions import ResizeScreenError
from asciimatics.screen import Screen
from th.state import GameState
from th.screens import stage
if __name__ == "__main__":
game_state = GameState()
while True:
try:
Screen.wrapper(stage, catch_interrupt=False, arguments=[game_state])
... | [
"th.state.GameState",
"asciimatics.screen.Screen.wrapper"
] | [((196, 207), 'th.state.GameState', 'GameState', ([], {}), '()\n', (205, 207), False, 'from th.state import GameState\n'), ((249, 317), 'asciimatics.screen.Screen.wrapper', 'Screen.wrapper', (['stage'], {'catch_interrupt': '(False)', 'arguments': '[game_state]'}), '(stage, catch_interrupt=False, arguments=[game_state])... |
import operator
import functools
from lark import Lark, Transformer
from dae.variants.attributes import Inheritance
INHERITANCE_QUERY_GRAMMAR = r"""
reference: "reference"
mendelian: "mendelian"
denovo: "denovo"
possible_denovo: "possible_denovo"
omission: "omission"
possible_omission: "poss... | [
"functools.reduce",
"dae.variants.attributes.Inheritance.from_name",
"lark.Lark"
] | [((1015, 1066), 'lark.Lark', 'Lark', (['INHERITANCE_QUERY_GRAMMAR'], {'start': '"""expression"""'}), "(INHERITANCE_QUERY_GRAMMAR, start='expression')\n", (1019, 1066), False, 'from lark import Lark, Transformer\n'), ((2974, 3020), 'functools.reduce', 'functools.reduce', (['operator.or_', 'atom_values', '(0)'], {}), '(o... |
# Copyright 2018 The Batfish Open Source Project
#
# 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 applicab... | [
"datetime.datetime",
"dateutil.parser.parse",
"json.loads",
"dateutil.relativedelta.relativedelta",
"pybatfish.client.consts.WorkStatusCode",
"dateutil.tz.tzlocal",
"json.dumps",
"pybatfish.client.consts.WorkStatusCode.is_terminated",
"time.sleep",
"pybatfish.exception.BatfishException",
"dateti... | [((3998, 4052), 'pybatfish.client.consts.WorkStatusCode', 'WorkStatusCode', (['answer[CoordConsts.SVC_KEY_WORKSTATUS]'], {}), '(answer[CoordConsts.SVC_KEY_WORKSTATUS])\n', (4012, 4052), False, 'from pybatfish.client.consts import BfConsts, CoordConsts, WorkStatusCode\n'), ((8371, 8393), 'json.dumps', 'json.dumps', (['e... |
#!/usr/bin/env python3
import rospy
from std_msgs.msg import Int32
zodiac_num = 0
print("卯")
def cb(message):
global zodiac_num
zodiac_num = message.data
zodiac_num = zodiac_num - 1995
while zodiac_num > 12:
if zodiac_num > 12:
zodiac_num = zodiac_num - 12
elif zodiac_num... | [
"rospy.Subscriber",
"rospy.is_shutdown",
"rospy.init_node",
"rospy.Rate",
"rospy.Publisher"
] | [((996, 1020), 'rospy.init_node', 'rospy.init_node', (['"""twice"""'], {}), "('twice')\n", (1011, 1020), False, 'import rospy\n'), ((1031, 1070), 'rospy.Subscriber', 'rospy.Subscriber', (['"""count_up"""', 'Int32', 'cb'], {}), "('count_up', Int32, cb)\n", (1047, 1070), False, 'import rospy\n'), ((1081, 1126), 'rospy.Pu... |
from typing import Text, Any, Dict, List, Union, Optional, Tuple, Set
from anytree import Resolver
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from anytree.node.nodemixin import NodeMixin
from anytree.node.util import _repr
from anytree.search import findall, findall_by_attr, find
fr... | [
"logging.getLogger",
"anytree.Resolver",
"anytree.node.util._repr",
"sagas.ofbiz.services.oc.all_service_names",
"sagas.conf.conf.cf.get_bucket",
"sagas.ofbiz.services.OfService",
"sagas.ofbiz.entities.all_entities",
"sagas.from_global_id",
"anytree.search.find",
"sagas.nlu.warehouse_service.AnalS... | [((710, 737), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (727, 737), False, 'import logging\n'), ((1016, 1027), 'anytree.node.util._repr', '_repr', (['self'], {}), '(self)\n', (1021, 1027), False, 'from anytree.node.util import _repr\n'), ((1086, 1117), 'sagas.ofbiz.entities.all_entit... |
"""Interactive shells for isolated user program access."""
import abc
import argparse
import readline
from typing import List
from typing import Union
class ShellCompleter(list):
"""A command completion container which validates user input against the stored contents to find matches.
Attribute... | [
"readline.set_completer",
"readline.set_completer_delims",
"readline.parse_and_bind",
"readline.get_completer"
] | [((2103, 2127), 'readline.get_completer', 'readline.get_completer', ([], {}), '()\n', (2125, 2127), False, 'import readline\n'), ((2293, 2341), 'readline.set_completer', 'readline.set_completer', (['self._completer.complete'], {}), '(self._completer.complete)\n', (2315, 2341), False, 'import readline\n'), ((2351, 2391)... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.db.models import Max
from django_sample_generator import fields, generator
from .models import Comment
from .utils import update_comments_h... | [
"common_utils.generator_fields.NameFieldGenerator",
"common_utils.generator_fields.SentenceFieldGenerator",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"random.randrange",
"common_utils.get_default_manager",
"common_utils.generator_fields.LongHtmlFieldGenerator",
"accounts.mo... | [((674, 734), 'common_utils.generator_fields.SentenceFieldGenerator', 'extra_generator_fields.SentenceFieldGenerator', ([], {'max_length': '(60)'}), '(max_length=60)\n', (719, 734), True, 'from common_utils import get_default_manager, generator_fields as extra_generator_fields\n'), ((889, 932), 'common_utils.generator_... |
import webapp2
import json
from google.appengine.ext import ndb
from datetime import datetime
import logging
DEFAULT_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
class APIRequest(webapp2.RequestHandler):
def __init__(self, request, response):
# super(APIRequest, self).__init__() # pycharm really wants me to ad... | [
"json.loads"
] | [((1587, 1616), 'json.loads', 'json.loads', (['self.request.body'], {}), '(self.request.body)\n', (1597, 1616), False, 'import json\n')] |
# -*- coding: UTF-8 -*-
from django.http import HttpResponse
import simplejson as json
from common.utils.extend_json_encoder import ExtendJSONEncoder
from themis.utils.raiseerr import APIError
def temRes(func):
def _jsonRes(request, *args, **kwargs):
try:
response = func(request, *args, **kwa... | [
"simplejson.dumps",
"themis.utils.raiseerr.APIError"
] | [((726, 792), 'simplejson.dumps', 'json.dumps', (['response'], {'cls': 'ExtendJSONEncoder', 'bigint_as_string': '(True)'}), '(response, cls=ExtendJSONEncoder, bigint_as_string=True)\n', (736, 792), True, 'import simplejson as json\n'), ((394, 418), 'themis.utils.raiseerr.APIError', 'APIError', (['u"""类型错误"""', '(10000)... |
import json
from pathlib import Path
from typing import Any, Dict, Optional, Set, Union
import numpy
from pydantic import BaseModel, BaseSettings
from ..testing import compare_recursive
from ..util import deserialize, serialize, yaml_import
from ..util.autodocs import AutoPydanticDocGenerator
from ..util.decorators i... | [
"pathlib.Path"
] | [((3544, 3554), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (3548, 3554), False, 'from pathlib import Path\n'), ((5517, 5527), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (5521, 5527), False, 'from pathlib import Path\n')] |
import os
from pathlib import Path
from time import time
from tqdm import tqdm
from argparse import ArgumentParser
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from datasets import GloveDataset
from glove import GloveModel,... | [
"torch.utils.tensorboard.SummaryWriter",
"numpy.mean",
"torch.log",
"argparse.ArgumentParser",
"pathlib.Path",
"tqdm.tqdm",
"glove.weight_func",
"torch.cuda.is_available",
"glove.GloveModel",
"time.time"
] | [((809, 850), 'glove.GloveModel', 'GloveModel', (['dataset._vocab_len', 'EMBED_DIM'], {}), '(dataset._vocab_len, EMBED_DIM)\n', (819, 850), False, 'from glove import GloveModel, weight_func, wmse_loss\n'), ((961, 967), 'time.time', 'time', ([], {}), '()\n', (965, 967), False, 'from time import time\n'), ((1165, 1194), ... |
from app import app
from flask import request, redirect, url_for, session, flash, render_template
@app.route('/save_to_local_storage')
def save_to_local_storage():
access_token = request.args.get('access_token', '')
user_id = request.args.get('user_id', '')
redirect_location = request.args.get('redirect',... | [
"flask.render_template",
"flask.request.args.get",
"app.app.route"
] | [((101, 136), 'app.app.route', 'app.route', (['"""/save_to_local_storage"""'], {}), "('/save_to_local_storage')\n", (110, 136), False, 'from app import app\n'), ((185, 221), 'flask.request.args.get', 'request.args.get', (['"""access_token"""', '""""""'], {}), "('access_token', '')\n", (201, 221), False, 'from flask imp... |
import urwid
class TableCell(urwid.Text):
def __init__(self, content, width = 10, separator=True,align='left'):
self.separator = separator
self._content = content
self._align = align
self._width = width
self._content = self._render_content()
super().__init__(self._co... | [
"urwid.register_signal",
"urwid.SimpleFocusListWalker",
"urwid.AttrMap",
"urwid.emit_signal"
] | [((2532, 2600), 'urwid.register_signal', 'urwid.register_signal', (['self.__class__', "['keypress', 'item_selected']"], {}), "(self.__class__, ['keypress', 'item_selected'])\n", (2553, 2600), False, 'import urwid\n'), ((3036, 3082), 'urwid.emit_signal', 'urwid.emit_signal', (['self', '"""keypress"""', 'self', 'key'], {... |
from credmark.cmf.model import Model
@Model.describe(
slug='contrib.neilz',
display_name='An example of a contrib model',
description="This model exists simply as an example of how and where to \
contribute a model to the Credmark framework",
version='1.0',
developer='neilz.eth',
outpu... | [
"credmark.cmf.model.Model.describe"
] | [((40, 315), 'credmark.cmf.model.Model.describe', 'Model.describe', ([], {'slug': '"""contrib.neilz"""', 'display_name': '"""An example of a contrib model"""', 'description': '"""This model exists simply as an example of how and where to contribute a model to the Credmark framework"""', 'version': '"""1.0"""', ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Neuron.Neuron import Neuron
## Imports
from random import randint
class Perceptron(Neuron):
def __init__(self, input_range, Validator):
self.input_range = input_range
super().__init__([ [randint(0, 10) for i in range(2)] ] * self.input_range,... | [
"random.randint"
] | [((321, 335), 'random.randint', 'randint', (['(0)', '(10)'], {}), '(0, 10)\n', (328, 335), False, 'from random import randint\n'), ((265, 279), 'random.randint', 'randint', (['(0)', '(10)'], {}), '(0, 10)\n', (272, 279), False, 'from random import randint\n')] |
"""Make any window dockable within Maya.
:created: 8 Jun 2018
:author: <NAME> <<EMAIL>>
"""
from PySide2.QtCore import QObject
from maya import cmds, mel
from . import utils
def dock_widget(widget, label="DockWindow", area="right", floating=False):
"""Dock the given widget properly for both M2016 and 2017+."""... | [
"maya.cmds.deleteUI",
"maya.cmds.control",
"maya.mel.eval",
"maya.cmds.workspaceControl"
] | [((1063, 1097), 'maya.cmds.control', 'cmds.control', (['control'], {'exists': '(True)'}), '(control, exists=True)\n', (1075, 1097), False, 'from maya import cmds, mel\n'), ((1564, 1594), 'maya.cmds.workspaceControl', 'cmds.workspaceControl', (['control'], {}), '(control)\n', (1585, 1594), False, 'from maya import cmds,... |
import sys
import warnings
if sys.version_info.major == 2:
warnings.warn(
"Python 2 is no longer supported. Please consider using the DIALS 2.2 release branch. "
"For more information on Python 2.7 support please go to https://github.com/dials/dials/issues/1175.",
UserWarning,
)
| [
"warnings.warn"
] | [((64, 288), 'warnings.warn', 'warnings.warn', (['"""Python 2 is no longer supported. Please consider using the DIALS 2.2 release branch. For more information on Python 2.7 support please go to https://github.com/dials/dials/issues/1175."""', 'UserWarning'], {}), "(\n 'Python 2 is no longer supported. Please conside... |
# 实现PCA分析和法向量计算,并加载数据集中的文件进行验证
import os
import time
import numpy as np
from pyntcloud import PyntCloud
import open3d as o3d
def PCA(data: PyntCloud.points, correlation: bool=False, sort: bool=True) -> np.array:
""" Calculate PCA
Parameters
----------
data(PyntCloud.points): 点云,NX3的矩阵
co... | [
"numpy.mean",
"numpy.full",
"open3d.geometry.KDTreeFlann",
"open3d.utility.Vector2iVector",
"os.path.join",
"numpy.asarray",
"numpy.array",
"numpy.dot",
"os.path.isdir",
"open3d.visualization.draw_geometries",
"numpy.vstack",
"open3d.geometry.PointCloud",
"open3d.geometry.TriangleMesh.create... | [((671, 687), 'numpy.dot', 'np.dot', (['X_.T', 'X_'], {}), '(X_.T, X_)\n', (677, 687), True, 'import numpy as np\n'), ((991, 1007), 'numpy.linalg.svd', 'np.linalg.svd', (['H'], {}), '(H)\n', (1004, 1007), True, 'import numpy as np\n'), ((612, 633), 'numpy.mean', 'np.mean', (['data'], {'axis': '(0)'}), '(data, axis=0)\n... |
from Voicelab.pipeline.Node import Node
from parselmouth.praat import call
from Voicelab.toolkits.Voicelab.VoicelabNode import VoicelabNode
from Voicelab.toolkits.Voicelab.MeasurePitchNode import measure_pitch
from scipy import stats
import statistics
class MeasureFormantPositionsNode(VoicelabNode):
def __init__(... | [
"parselmouth.praat.call",
"Voicelab.toolkits.Voicelab.MeasurePitchNode.measure_pitch",
"statistics.median",
"scipy.stats.zscore",
"scipy.stats.normaltest"
] | [((1254, 1341), 'Voicelab.toolkits.Voicelab.MeasurePitchNode.measure_pitch', 'measure_pitch', ([], {'voice': 'voice', 'measure': '"""cc"""', 'floor': 'pitch_floor', 'ceiling': 'pitch_ceiling'}), "(voice=voice, measure='cc', floor=pitch_floor, ceiling=\n pitch_ceiling)\n", (1267, 1341), False, 'from Voicelab.toolkits... |
from multiprocessing import Queue
from os import environ
from queue import Empty
from sys import exit as sysexit
from time import sleep, time
import rethinkdb
class RethinkInterface:
def pattern(self, output_data):
# ...
self.logger.send(["dbprocess",
"".join(("The... | [
"time.time"
] | [((404, 410), 'time.time', 'time', ([], {}), '()\n', (408, 410), False, 'from time import sleep, time\n')] |
from unittest.mock import patch, ANY
import numpy as np
import cv2
from tasks import (
_download_image, ascii, candy, mosaic, the_scream,
udnie, celeba_distill, face_paint, paprika
)
IMAGE_URL = "image_url"
IMAGE_NAME = "image_name"
IMAGE_PATH = "image_path"
IMAGE_IPFS_URL = "pinata_hash_123"
METADATA_IPFS_URL = ... | [
"tasks.ascii",
"tasks.paprika",
"tasks.the_scream",
"tasks.celeba_distill",
"tasks.mosaic",
"tasks.candy",
"tasks.face_paint",
"unittest.mock.patch",
"tasks.udnie",
"cv2.imread"
] | [((1612, 1635), 'unittest.mock.patch', 'patch', (['"""tasks.requests"""'], {}), "('tasks.requests')\n", (1617, 1635), False, 'from unittest.mock import patch, ANY\n'), ((1637, 1655), 'unittest.mock.patch', 'patch', (['"""tasks.cv2"""'], {}), "('tasks.cv2')\n", (1642, 1655), False, 'from unittest.mock import patch, ANY\... |
""" Learn home view """
from django.http import HttpRequest
from django.shortcuts import render
from django.views.generic import View
from constance import config
from learning.models import Tutorial
class HomeView(View):
"""Home view"""
def get(self, request: HttpRequest):
carousel_count = config.LE... | [
"django.shortcuts.render",
"learning.models.Tutorial.objects.active_and_confirmed_tutorials"
] | [((942, 988), 'django.shortcuts.render', 'render', (['request', '"""learning/home.html"""', 'context'], {}), "(request, 'learning/home.html', context)\n", (948, 988), False, 'from django.shortcuts import render\n'), ((388, 437), 'learning.models.Tutorial.objects.active_and_confirmed_tutorials', 'Tutorial.objects.active... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author: rainsty
@file: middleware.py
@time: 2019-12-30 13:32:29
@description: middleware
"""
import falcon
import json
from .code import msg
class UserHttpError(falcon.HTTPError):
"""User Http Error"""
def __init__(self, title=None, description=None, heade... | [
"json.dumps"
] | [((1703, 1719), 'json.dumps', 'json.dumps', (['body'], {}), '(body)\n', (1713, 1719), False, 'import json\n')] |
import os, pickle,uuid
class ControlBase(object):
_value = None
_label = None
_controlHTML = ""
def __init__(self, *args, **kwargs):
self._id = uuid.uuid4()
self._value = kwargs.get('default', None)
self._parent = 1
self._label = kwargs.get('label... | [
"uuid.uuid4"
] | [((193, 205), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (203, 205), False, 'import os, pickle, uuid\n')] |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Dashboard.views.home', name='home'),
# url(r'^Dashboard/', include('Dashboard.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('dj... | [
"django.conf.urls.url"
] | [((457, 515), 'django.conf.urls.url', 'url', (['"""^$"""', '"""apps.web.adminboard.views.index"""'], {'name': '"""index"""'}), "('^$', 'apps.web.adminboard.views.index', name='index')\n", (460, 515), False, 'from django.conf.urls import patterns, include, url\n'), ((551, 645), 'django.conf.urls.url', 'url', (['"""^ajax... |
from __future__ import absolute_import
from datashader.utils import ngjit
from numba import vectorize, int64
import numpy as np
import os
"""
Initially based on https://github.com/galtay/hilbert_curve, but specialized
for 2 dimensions with numba acceleration
"""
NUMBA_DISABLE_JIT = os.environ.get('NUMBA_DISABLE_JIT',... | [
"numpy.array",
"numpy.zeros",
"numba.int64",
"os.environ.get"
] | [((285, 323), 'os.environ.get', 'os.environ.get', (['"""NUMBA_DISABLE_JIT"""', '(0)'], {}), "('NUMBA_DISABLE_JIT', 0)\n", (299, 323), False, 'import os\n'), ((464, 495), 'numpy.zeros', 'np.zeros', (['width'], {'dtype': 'np.uint8'}), '(width, dtype=np.uint8)\n', (472, 495), True, 'import numpy as np\n'), ((1761, 1792), ... |
import logging
import os
import re
import i18n
import discord
from discord.ext import commands
from .help import YLHelpCommand
intents = discord.Intents.none()
intents.emojis = True
intents.guilds = True
intents.members = True
intents.voice_states = True
intents.messages = True
intents.reactions = True
YB_BOT = com... | [
"discord.ext.commands.when_mentioned_or",
"discord.Colour.orange",
"discord.utils.oauth_url",
"discord.Colour.dark_purple",
"discord.ext.commands.dm_only",
"discord.Game",
"logging.warning",
"discord.Permissions",
"os.environ.get",
"discord.ext.commands.is_owner",
"os.path.dirname",
"discord.I... | [((140, 162), 'discord.Intents.none', 'discord.Intents.none', ([], {}), '()\n', (160, 162), False, 'import discord\n'), ((2293, 2312), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (2310, 2312), False, 'from discord.ext import commands\n'), ((2314, 2332), 'discord.ext.commands.dm_only', 'comma... |
'''Creates groups of files (fixed number) as folders based on last modification time
Adjacent ranges of time group folders have symlinks between them
Creates the file location hierarchy below the time group folder.
Eg - /time_root_deeper_location/Apr_9_2019-Apr_11_2019/FileSystemTest/VISA/Offline/imm5247e.pdf
Creates t... | [
"time.ctime",
"os.path.join",
"operator.itemgetter",
"os.mkdir",
"os.path.abspath",
"os.path.getmtime",
"os.walk"
] | [((1070, 1083), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1077, 1083), False, 'import os, time\n'), ((897, 920), 'os.mkdir', 'os.mkdir', (['timeroot_path'], {}), '(timeroot_path)\n', (905, 920), False, 'import os, time\n'), ((530, 556), 'os.path.join', 'os.path.join', (['path', 'dir[0]'], {}), '(path, dir[0])\... |
""" A plugin that collects by-place token-count stats.
.. rubric:: Public package interface
- Class :class:`TokenCounterPlugin` (see below)
.. rubric:: Internal submodules
.. autosummary::
:template: module_reference.rst
:recursive:
:toctree:
petsi.plugins.tokencounter._tokencounter
"""
from datacl... | [
"dataclasses.dataclass"
] | [((666, 685), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)'}), '(eq=False)\n', (675, 685), False, 'from dataclasses import dataclass\n')] |
# =============================================================================
# HEPHAESTUS VALIDATION 8 - BEAM DISPLACEMENTS AND ROTATIONS SIMPLE AL BOX BEAM
# =============================================================================
# IMPORTS:
import sys
import os
sys.path.append(os.path.abspath('..\..'))
fr... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.hold",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"AeroComBAT.AircraftParts.Wing",
"numpy.array",
"numpy.linspace",
"AeroComBAT.FEM.Model",
"matplotlib.pyplot.figure",
"numpy.linalg.nor... | [((579, 604), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (587, 604), True, 'import numpy as np\n'), ((605, 631), 'numpy.array', 'np.array', (['[0.0, 0.0, 20.0]'], {}), '([0.0, 0.0, 20.0])\n', (613, 631), True, 'import numpy as np\n'), ((635, 659), 'numpy.linspace', 'np.linspace', (['(0... |
# AMZ-Driverless
# Copyright (c) 2019 Authors:
# - <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | [
"sqlalchemy.orm.relationship",
"rbb_swagger_server.models.Comment"
] | [((1631, 1680), 'sqlalchemy.orm.relationship', 'relationship', (['"""Rosbag"""'], {'back_populates': '"""comments"""'}), "('Rosbag', back_populates='comments')\n", (1643, 1680), False, 'from sqlalchemy.orm import relationship\n'), ((1692, 1712), 'sqlalchemy.orm.relationship', 'relationship', (['"""User"""'], {}), "('Us... |
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights
# in this software.
# Licensed... | [
"os.path.abspath",
"inspect.currentframe",
"pkg_resources.get_distribution"
] | [((857, 883), 'pkg_resources.get_distribution', 'get_distribution', (['"""pygsti"""'], {}), "('pygsti')\n", (873, 883), False, 'from pkg_resources import get_distribution, DistributionNotFound\n'), ((1036, 1050), 'inspect.currentframe', 'currentframe', ([], {}), '()\n', (1048, 1050), False, 'from inspect import getfile... |
import os
import logging
from pathlib import Path
from dotenv import load_dotenv
from hypothepy.v1.api import HypoApi
load_dotenv(dotenv_path='./.env')
HYPOTHESIS_USER=os.getenv("HYPOTHESIS_USER")
HYPOTHESIS_API_KEY=os.getenv("HYPOTHESIS_API_KEY")
HYPO = HypoApi(HYPOTHESIS_API_KEY, HYPOTHESIS_USER)
logger = logging.... | [
"logging.getLogger",
"logging.StreamHandler",
"os.getenv",
"pathlib.Path",
"logging.Formatter",
"dotenv.load_dotenv",
"hypothepy.v1.api.HypoApi",
"logging.FileHandler"
] | [((119, 152), 'dotenv.load_dotenv', 'load_dotenv', ([], {'dotenv_path': '"""./.env"""'}), "(dotenv_path='./.env')\n", (130, 152), False, 'from dotenv import load_dotenv\n'), ((169, 197), 'os.getenv', 'os.getenv', (['"""HYPOTHESIS_USER"""'], {}), "('HYPOTHESIS_USER')\n", (178, 197), False, 'import os\n'), ((217, 248), '... |
from upwork import config
def test_config_initialization():
cfg = config.Config(
{
"client_id": "keyxxxxxxxxxxxxxxxxxxxx",
"client_secret": "<KEY>",
"redirect_uri": "https://a.callback.url",
"token": {"access_token": "a"},
}
)
assert cfg.cli... | [
"upwork.config.Config"
] | [((72, 236), 'upwork.config.Config', 'config.Config', (["{'client_id': 'keyxxxxxxxxxxxxxxxxxxxx', 'client_secret': '<KEY>',\n 'redirect_uri': 'https://a.callback.url', 'token': {'access_token': 'a'}}"], {}), "({'client_id': 'keyxxxxxxxxxxxxxxxxxxxx', 'client_secret':\n '<KEY>', 'redirect_uri': 'https://a.callback... |
from cas import cas
from sims4 import protocol_buffer_utils
from sims4.service_manager import Service
import services
class RelgraphService(Service):
RELGRAPH_ENABLED = False
@classmethod
def get_relgraph_service(cls):
if cls.RELGRAPH_ENABLED:
return RelgraphService()
else:
... | [
"cas.cas.relgraph_add_child",
"cas.cas.relgraph_get",
"cas.cas.relgraph_get_genealogy",
"services.get_persistence_service",
"cas.cas.relgraph_set_edge",
"cas.cas.relgraph_set",
"sims4.protocol_buffer_utils.has_field",
"cas.cas.relgraph_set_marriage",
"cas.cas.relgraph_cull"
] | [((625, 696), 'sims4.protocol_buffer_utils.has_field', 'protocol_buffer_utils.has_field', (['relgraph_service_data', '"""relgraph_data"""'], {}), "(relgraph_service_data, 'relgraph_data')\n", (656, 696), False, 'from sims4 import protocol_buffer_utils\n'), ((1167, 1238), 'sims4.protocol_buffer_utils.has_field', 'protoc... |
import pkg_resources
import re
import requests
import numpy as np
import scipy as sp
import scipy.sparse
import scipy.sparse.linalg
from . import index
__all__ = ['PowerNetwork', 'load_case']
class PowerNetwork:
def __init__(self, basemva, bus=None, gen=None, gencost=None, branch=None, perunit=True):
i... | [
"scipy.sparse.csc_matrix",
"numpy.multiply",
"pkg_resources.resource_exists",
"numpy.ones",
"numpy.arange",
"numpy.where",
"requests.get",
"numpy.max",
"numpy.sum",
"numpy.concatenate",
"pkg_resources.resource_stream",
"numpy.all",
"pkg_resources.resource_listdir",
"numpy.divide",
"re.se... | [((10122, 10172), 'pkg_resources.resource_listdir', 'pkg_resources.resource_listdir', (['"""phasorpy"""', '"""data"""'], {}), "('phasorpy', 'data')\n", (10152, 10172), False, 'import pkg_resources\n'), ((3941, 3974), 'numpy.all', 'np.all', (["(self.gen['RAMP_AGC'] == 0)"], {}), "(self.gen['RAMP_AGC'] == 0)\n", (3947, 3... |
# Generated by Django 3.0.6 on 2020-05-07 11:56
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | [
"django.db.models.FloatField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"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'), ((2188, 2275), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
from math import sqrt
MOVING_AVERAGE_DECAY = 0.9999
def tf_inference(images, BATCH_SIZE, image_size, NUM_CLASSES):
def _variable_with_weight_decay(name, shape, stddev, wd):
var = tf.get_variable(name, shape=shape, initializer=tf.trunc... | [
"tensorflow.nn.conv2d",
"tensorflow.nn.max_pool",
"tensorflow.variable_scope",
"tensorflow.nn.relu",
"tensorflow.nn.zero_fraction",
"tensorflow.nn.l2_loss",
"tensorflow.truncated_normal_initializer",
"tensorflow.matmul",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.add_to... | [((1117, 1215), 'tensorflow.nn.max_pool', 'tf.nn.max_pool', (['conv1'], {'ksize': '[1, 3, 3, 1]', 'strides': '[1, 2, 2, 1]', 'padding': '"""SAME"""', 'name': '"""pool1"""'}), "(conv1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding=\n 'SAME', name='pool1')\n", (1131, 1215), True, 'import tensorflow as tf\n'), ((16... |
# -*- coding: utf-8 -*-
from .context import FetchPublicBlacklists # noqa
from FetchPublicBlacklists import FetchPublicBlacklists # noqa
from FetchPublicBlacklists import helpers # noqa
import unittest
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_absolute_truth_and_meaning(s... | [
"FetchPublicBlacklists.helpers.IPv4s_to_IPs",
"FetchPublicBlacklists.helpers.getBcastAddrforIPv4",
"FetchPublicBlacklists.helpers.IP_to_IPv4",
"FetchPublicBlacklists.helpers.IPs_to_ints",
"FetchPublicBlacklists.helpers.IPv4_to_IP",
"FetchPublicBlacklists.helpers.IP_to_int",
"FetchPublicBlacklists.helper... | [((6158, 6173), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6171, 6173), False, 'import unittest\n'), ((1938, 2008), 'FetchPublicBlacklists.helpers.ints_to_IPv4s', 'helpers.ints_to_IPv4s', (['[111239847, 167239847, 2291809961, 67306243, 0]'], {}), '([111239847, 167239847, 2291809961, 67306243, 0])\n', (1959, 2... |
"""
Make a mini system that uses the
INTERACTIVE HELP of python. User
enters the command, and doc appears.
When user enters 'END', the program
ends.
NOTE1: use colors.
NOTE2: It works as figured out in pycharm so far.
"""
def fancytxt(txt, fg, bg):
import sys
from termcolor import cprint
cprint('~'*len(tx... | [
"termcolor.cprint"
] | [((336, 360), 'termcolor.cprint', 'cprint', (['f"""{txt}"""', 'fg', 'bg'], {}), "(f'{txt}', fg, bg)\n", (342, 360), False, 'from termcolor import cprint\n')] |
import argparse
from contextlib import contextmanager
from ipaddress import ip_network
import logging
import sys
from typing import Generator, Optional
from greensim import Simulator, Signal, advance, local, now, Process, add
from greensim.logging import Filter
from greensim.random import VarRandom, constant, normal, ... | [
"logging.getLogger",
"logging.StreamHandler",
"sys.exit",
"ipaddress.ip_network",
"greensim.random.normal",
"greensim.advance",
"argparse.ArgumentParser",
"greensim.now",
"greensim.Signal",
"greensim.logging.Filter",
"greensim.Process.current",
"greensim.random.distribution",
"itsim.network.... | [((3153, 3166), 'greensim.random.expo', 'expo', (['(2.0 * H)'], {}), '(2.0 * H)\n', (3157, 3166), False, 'from greensim.random import VarRandom, constant, normal, expo, distribution\n'), ((3196, 3212), 'greensim.random.expo', 'expo', (['(10.0 * MIN)'], {}), '(10.0 * MIN)\n', (3200, 3212), False, 'from greensim.random i... |
import re
from django.utils.html import escape
from django.utils.safestring import mark_safe
class OrderingOptionsMixin:
"""
Mixin for easier implementation of ordering in Django's generic ListView.
Add `ordering_options` to your subclass and you should be ready to go.
Note that the user-passed quer... | [
"re.search"
] | [((1480, 1528), 're.search', 're.search', (['"""^ordering_query_([_a-zA-Z]+)$"""', 'item'], {}), "('^ordering_query_([_a-zA-Z]+)$', item)\n", (1489, 1528), False, 'import re\n')] |
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
import numpy as np
class Identity(torch.nn.Module):
def __init__(self):
super(Identity, self).__init__()
def forward(self, x):
return x
class Flatten(nn.Module):
def forward(self, input):
... | [
"torch.mul",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.ReflectionPad2d",
"torch.nn.L1Loss",
"torch.sqrt",
"torch.pow",
"torch.from_numpy",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.Sigmoid",
"numpy.histogram",
"torch.mean",
"torch.nn... | [((2338, 2349), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {}), '()\n', (2347, 2349), True, 'import torch.nn as nn\n'), ((3231, 3273), 'torch.cat', 'torch.cat', (['(hue, saturation, value)'], {'dim': '(1)'}), '((hue, saturation, value), dim=1)\n', (3240, 3273), False, 'import torch\n'), ((3375, 3410), 'torch.nn.functional.l1... |
import unittest
import numpy as np
from hypothesis import given
import hypothesis.strategies as some
import hypothesis.extra.numpy as some_np
from extractor.gps import gps_to_ltp, gps_from_ltp, \
interpolate_gps
class TestGps(unittest.TestCase):
@given(
some_np.arrays(
dtype=np.float... | [
"extractor.gps.gps_to_ltp",
"numpy.allclose",
"hypothesis.strategies.integers",
"extractor.gps.interpolate_gps",
"extractor.gps.gps_from_ltp",
"hypothesis.strategies.floats",
"numpy.array"
] | [((648, 663), 'extractor.gps.gps_to_ltp', 'gps_to_ltp', (['gps'], {}), '(gps)\n', (658, 663), False, 'from extractor.gps import gps_to_ltp, gps_from_ltp, interpolate_gps\n'), ((688, 717), 'extractor.gps.gps_from_ltp', 'gps_from_ltp', (['gps_ltp', 'origin'], {}), '(gps_ltp, origin)\n', (700, 717), False, 'from extractor... |
from examples.vulnerable_encryption_service import VulnerableEncryptionService
VEC = VulnerableEncryptionService()
class TestVulnerableEncryptionService:
def test_encryption_and_decryption(self):
plaintext_misaligned = b"Misaligned plaintext!"
ciphertext = VEC.encrypt(plaintext_misaligned)
... | [
"examples.vulnerable_encryption_service.VulnerableEncryptionService"
] | [((86, 115), 'examples.vulnerable_encryption_service.VulnerableEncryptionService', 'VulnerableEncryptionService', ([], {}), '()\n', (113, 115), False, 'from examples.vulnerable_encryption_service import VulnerableEncryptionService\n')] |
# author: <NAME> (https://github.com/sjbecque)
from expects import expect, equal, be_a, be
from tetris.src.tetromino_factory import TetrominoFactory
from tetris.src.cube_sets.tetromino import Tetromino
with describe(Cube) as self:
with describe('produce'):
with it('produces tetrominos'):
expect... | [
"expects.be_a",
"tetris.src.tetromino_factory.TetrominoFactory"
] | [((354, 369), 'expects.be_a', 'be_a', (['Tetromino'], {}), '(Tetromino)\n', (358, 369), False, 'from expects import expect, equal, be_a, be\n'), ((321, 339), 'tetris.src.tetromino_factory.TetrominoFactory', 'TetrominoFactory', ([], {}), '()\n', (337, 339), False, 'from tetris.src.tetromino_factory import TetrominoFacto... |
"""A class that models a STAC Catalog."""
from examples._utils import Utils
from examples.relation import RelationType
from examples.traversable import Traversable
class Catalog(Traversable):
"""A class that models a STAC Catalog."""
def __init__(self, data=None):
"""Initialize the Catalog instance ... | [
"examples._utils.Utils.render_html"
] | [((1713, 1760), 'examples._utils.Utils.render_html', 'Utils.render_html', (['"""catalog.html"""'], {'catalog': 'self'}), "('catalog.html', catalog=self)\n", (1730, 1760), False, 'from examples._utils import Utils\n')] |
from flask import current_app as app
from tabulate import tabulate
from flask_rq2 import RQ
from config import get_env
from app.utils.githelper import GitApi
from app.utils.slackhelper import SlackHelper
rq = RQ()
__slack_helper = SlackHelper()
__git_helper = GitApi()
@rq.job
def pull_request_of_given_repo(args):
... | [
"tabulate.tabulate",
"flask_rq2.RQ",
"config.get_env",
"app.utils.githelper.GitApi",
"app.utils.slackhelper.SlackHelper"
] | [((210, 214), 'flask_rq2.RQ', 'RQ', ([], {}), '()\n', (212, 214), False, 'from flask_rq2 import RQ\n'), ((232, 245), 'app.utils.slackhelper.SlackHelper', 'SlackHelper', ([], {}), '()\n', (243, 245), False, 'from app.utils.slackhelper import SlackHelper\n'), ((261, 269), 'app.utils.githelper.GitApi', 'GitApi', ([], {}),... |
import discord
import re
import db
def parse(message, quotes_file):
content = message.content
match = re.search('.+([A-Za-z0-9]:|\]:)+.+(\n[A-Za-z0-9].*)*', content)
if(match is not None):
if(match.group(0) == content):
db.insert('quotes', {'content': content})
return True
... | [
"db.cursor",
"db.insert",
"re.search"
] | [((111, 178), 're.search', 're.search', (['""".+([A-Za-z0-9]:|\\\\]:)+.+(\n[A-Za-z0-9].*)*"""', 'content'], {}), '(""".+([A-Za-z0-9]:|\\\\]:)+.+(\n[A-Za-z0-9].*)*""", content)\n', (120, 178), False, 'import re\n'), ((359, 370), 'db.cursor', 'db.cursor', ([], {}), '()\n', (368, 370), False, 'import db\n'), ((496, 507), ... |
from django.shortcuts import render, get_object_or_404
from . import models, serializers
from rest_framework import viewsets, status, permissions
from rest_framework.decorators import action
import datetime
from core import models as coremodels
from library import models as librarymodels
from student import models as s... | [
"student.models.StudentUBFPayment.objects.filter",
"rest_framework.response.Response",
"pandas.DataFrame",
"datetime.date.today",
"sklearn.linear_model.LinearRegression",
"student.models.StudentPayment.objects.filter"
] | [((857, 878), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (876, 878), False, 'import datetime\n'), ((3981, 3999), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (3993, 3999), True, 'import pandas as pd\n'), ((4074, 4105), 'sklearn.linear_model.LinearRegression', 'linear_model.Linear... |
import re
def complete_shorten_address(address):
shorten_pattern = re.compile(r"^[\w\-_\.]+/[\w\-_\.]+$")
if shorten_pattern.match(address):
return f'<EMAIL>:{address}.git'
return address | [
"re.compile"
] | [((73, 116), 're.compile', 're.compile', (['"""^[\\\\w\\\\-_\\\\.]+/[\\\\w\\\\-_\\\\.]+$"""'], {}), "('^[\\\\w\\\\-_\\\\.]+/[\\\\w\\\\-_\\\\.]+$')\n", (83, 116), False, 'import re\n')] |
# -*- coding:utf-8 -*-
# 使用逻辑回归对信用卡欺诈进行分类
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import itertools
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, precision_recall_... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.xticks",
"sklearn.model_... | [((392, 425), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (415, 425), False, 'import warnings\n'), ((1763, 1794), 'pandas.read_csv', 'pd.read_csv', (['"""./creditcard.csv"""'], {}), "('./creditcard.csv')\n", (1774, 1794), True, 'import pandas as pd\n'), ((1893, 1905), '... |
import torch
from torch.utils.data import Dataset, DataLoader
import torchvision
from torchvision import transforms
import torch.nn as nn
import os
import glob
import numpy as np
import time
import cv2
from einops import rearrange, reduce, repeat
from PIL import Image
#from utils.augmentations import SSDAugmentation,... | [
"torch.stack",
"einops.rearrange",
"torch.tensor",
"os.path.isdir",
"numpy.std",
"numpy.load",
"cv2.imread",
"torch.FloatTensor",
"glob.glob"
] | [((10433, 10449), 'torch.stack', 'torch.stack', (['rfs'], {}), '(rfs)\n', (10444, 10449), False, 'import torch\n'), ((11547, 11563), 'torch.stack', 'torch.stack', (['rfs'], {}), '(rfs)\n', (11558, 11563), False, 'import torch\n'), ((1526, 1553), 'glob.glob', 'glob.glob', (["(data_path + '/*')"], {}), "(data_path + '/*'... |
import pandas as pd
from tqdm import tqdm
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
class ConvergencePlot:
def __init__(self, df: pd.DataFrame):
self.df = df
def render(self, title=None, bs_samples=1000, interval=5):
all_medians = []
for bs_size in tqdm(... | [
"seaborn.lineplot",
"pandas.melt",
"pandas.DataFrame",
"pandas.concat",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend"
] | [((778, 800), 'pandas.concat', 'pd.concat', (['all_medians'], {}), '(all_medians)\n', (787, 800), True, 'import pandas as pd\n'), ((819, 849), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(20, 20)'}), '(figsize=(20, 20))\n', (831, 849), True, 'import matplotlib.pyplot as plt\n'), ((858, 967), 'seabor... |
import os
from chaoslib import Configuration, Secrets
from azure.storage.queue import QueueServiceClient, QueueClient
from logzero import logger
# Can only count 32 visible messages in max
def count_visible_messages(secrets: Secrets = None, queue_name=None) -> int:
logger.debug(
f"Start count_visible_mess... | [
"azure.storage.queue.QueueClient.from_connection_string",
"logzero.logger.debug"
] | [((272, 344), 'logzero.logger.debug', 'logger.debug', (['f"""Start count_visible_messages: queue_name=\'{queue_name}\'"""'], {}), '(f"Start count_visible_messages: queue_name=\'{queue_name}\'")\n', (284, 344), False, 'from logzero import logger\n'), ((374, 450), 'azure.storage.queue.QueueClient.from_connection_string',... |
#!/usr/bin/env python
import configparser
def getconfig ( input ):
config = configparser.ConfigParser()
config.sections()
config.read( input )
config.sections()
config_dict={}
for section in config:
for var in config[ section ]:
config_dict[ var ] = config[ section ][ var... | [
"configparser.ConfigParser"
] | [((83, 110), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (108, 110), False, 'import configparser\n')] |
import torch.nn as nn
class ModuleParallel(nn.Module):
def __init__(self, module):
super(ModuleParallel, self).__init__()
self.module = module
def forward(self, x_parallel):
return [self.module(x) for x in x_parallel]
class ModuleIndivParallel(nn.Module):
def __init__(self, modu... | [
"torch.nn.BatchNorm2d"
] | [((1175, 1203), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['num_features'], {}), '(num_features)\n', (1189, 1203), True, 'import torch.nn as nn\n'), ((851, 879), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', (['num_features'], {}), '(num_features)\n', (865, 879), True, 'import torch.nn as nn\n')] |
from vkbottle.exception_factory import VKAPIError
try:
raise VKAPIError(2, "Some exception occurred")
except VKAPIError(3):
print("Oh, third exception.")
except VKAPIError(2):
print("Oh, second exception.")
except VKAPIError():
print("Unknown vk error")
| [
"vkbottle.exception_factory.VKAPIError"
] | [((66, 106), 'vkbottle.exception_factory.VKAPIError', 'VKAPIError', (['(2)', '"""Some exception occurred"""'], {}), "(2, 'Some exception occurred')\n", (76, 106), False, 'from vkbottle.exception_factory import VKAPIError\n'), ((114, 127), 'vkbottle.exception_factory.VKAPIError', 'VKAPIError', (['(3)'], {}), '(3)\n', (1... |
# -*- coding: utf-8 -*-
from quartical.config.external import Gain
from quartical.config.internal import yield_from
from loguru import logger # noqa
import numpy as np
import dask.array as da
from pathlib import Path
import shutil
from daskms.experimental.zarr import xds_to_zarr
from quartical.gains import TERM_TYPES
... | [
"dask.array.compute",
"dask.array.blockwise",
"numpy.tile",
"numpy.ones",
"loguru.logger.info",
"pathlib.Path",
"quartical.config.internal.yield_from",
"quartical.gains.general.generics.combine_gains",
"dask.array.map_blocks",
"loguru.logger.warning",
"quartical.utils.dask.blockwise_unique",
"... | [((3964, 3996), 'dask.array.compute', 'da.compute', (['tipc_list', 'fipc_list'], {}), '(tipc_list, fipc_list)\n', (3974, 3996), True, 'import dask.array as da\n'), ((9030, 9106), 'quartical.gains.general.generics.combine_gains', 'combine_gains', (['t_bin_arr', 'f_map_arr', 'd_map_arr', 'net_shape', 'corr_mode', '*gains... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 19 01:31:38 2019.
@author: mtageld
"""
import unittest
import girder_client
import numpy as np
from skimage.transform import resize
# from matplotlib import pylab as plt
# from matplotlib.colors import ListedColormap
from histomicstk.saliency.tissue... | [
"histomicstk.saliency.tissue_detection.get_tissue_mask",
"girder_client.GirderClient",
"histomicstk.preprocessing.color_normalization.deconvolution_based_normalization.deconvolution_based_normalization",
"numpy.array",
"unittest.main",
"skimage.transform.resize",
"histomicstk.saliency.tissue_detection.g... | [((839, 880), 'girder_client.GirderClient', 'girder_client.GirderClient', ([], {'apiUrl': 'APIURL'}), '(apiUrl=APIURL)\n', (865, 880), False, 'import girder_client\n'), ((1181, 1310), 'numpy.array', 'np.array', (['[[0.5807549, 0.08314027, 0.08213795], [0.71681094, 0.90081588, 0.41999816],\n [0.38588316, 0.42616716, ... |
from django.db import models
class Product(models.Model):
title = models.CharField(max_length=100)
year = models.IntegerField()
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
creator = models.ForeignKey('auth.User', related_name='products', on_... | [
"django.db.models.DateTimeField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((71, 103), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (87, 103), False, 'from django.db import models\n'), ((115, 136), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (134, 136), False, 'from django.db import models\n'), ((154, 193... |
from greenclock.utils import Scheduler, every_second, every_hour
from datetime import datetime
import time
def func_1():
print('Calling func_1() at ' + str(datetime.now()))
time.sleep(2)
print('Ended call to func_1() at ' + str(datetime.now()))
def func_2():
print('Calling func_2() at ' + str(datet... | [
"greenclock.utils.Scheduler",
"time.sleep",
"greenclock.utils.every_second",
"datetime.datetime.now",
"greenclock.utils.every_hour"
] | [((184, 197), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (194, 197), False, 'import time\n'), ((336, 349), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (346, 349), False, 'import time\n'), ((488, 501), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (498, 501), False, 'import time\n'), ((609, 648), ... |
import vertica_sdk
import urllib.request
import time
class validate_url(vertica_sdk.ScalarFunction):
"""Validates HTTP requests.
Returns the status code of a webpage. Pages that cannot be accessed return
"Failed to load page."
"""
def __init__(self):
pass
def setup(self, server_... | [
"time.sleep"
] | [((762, 775), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (772, 775), False, 'import time\n')] |
# -*- coding: utf-8 -*-
"""Constants for Bio2BEL WikiPathways."""
from dataclasses import dataclass
from typing import Dict
from bio2bel import get_data_dir
from bio2bel.utils import ensure_path
VERSION = '0.3.0-dev'
MODULE_NAME = 'wikipathways'
DATA_DIR = get_data_dir(MODULE_NAME)
HGNC = 'hgnc'
WIKIPATHWAYS = 'w... | [
"bio2bel.get_data_dir",
"bio2bel.utils.ensure_path"
] | [((262, 287), 'bio2bel.get_data_dir', 'get_data_dir', (['MODULE_NAME'], {}), '(MODULE_NAME)\n', (274, 287), False, 'from bio2bel import get_data_dir\n'), ((795, 829), 'bio2bel.utils.ensure_path', 'ensure_path', (['MODULE_NAME', 'self.url'], {}), '(MODULE_NAME, self.url)\n', (806, 829), False, 'from bio2bel.utils import... |
"""
Spaces defined for the algorithms to user
It might be a good idea to experiment with some of the distributions here
"""
from math import log
from hyperopt import hp
from hyperopt.pyll.base import scope
LR_LOG_LOWER = log(0.0001)
LR_LOG_UPPER = log(0.1)
# NOTE: Do not use keyword arguments for hyperopt distributi... | [
"hyperopt.hp.quniform",
"math.log",
"hyperopt.hp.uniform",
"hyperopt.hp.choice",
"hyperopt.hp.loguniform"
] | [((223, 234), 'math.log', 'log', (['(0.0001)'], {}), '(0.0001)\n', (226, 234), False, 'from math import log\n'), ((250, 258), 'math.log', 'log', (['(0.1)'], {}), '(0.1)\n', (253, 258), False, 'from math import log\n'), ((523, 573), 'hyperopt.hp.loguniform', 'hp.loguniform', (['"""lr_bu"""', 'LR_LOG_LOWER', 'LR_LOG_UPPE... |
from django.contrib.auth.models import AnonymousUser
from django.conf import settings
from rest_framework import routers, serializers, viewsets
from .base.models import User
class UserSerializer(serializers.HyperlinkedModelSerializer):
'''
Serializers define the API representation.
'''
class Meta:
... | [
"rest_framework.routers.DefaultRouter"
] | [((2853, 2876), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (2874, 2876), False, 'from rest_framework import routers, serializers, viewsets\n')] |
import os
import shutil
import hashlib
import requests
import ruamel.yaml as yaml
from loguru import logger
from .filelock import FileLock
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
ASSET_DIRECTORY = os.environ.get('VEROS_ASSET_DIR') or os.path.join(os.path.expanduser('~'), '... | [
"hashlib.md5",
"os.makedirs",
"shutil.copyfileobj",
"urllib.parse.urlparse",
"loguru.logger.info",
"os.path.join",
"os.environ.get",
"requests.get",
"os.path.isfile",
"os.path.isdir",
"ruamel.yaml.safe_load",
"os.path.expanduser"
] | [((244, 277), 'os.environ.get', 'os.environ.get', (['"""VEROS_ASSET_DIR"""'], {}), "('VEROS_ASSET_DIR')\n", (258, 277), False, 'import os\n'), ((1630, 1669), 'os.path.join', 'os.path.join', (['ASSET_DIRECTORY', 'asset_id'], {}), '(ASSET_DIRECTORY, asset_id)\n', (1642, 1669), False, 'import os\n'), ((3032, 3045), 'hashl... |
import functools
from flask import abort, request
from flask_stupe import marshmallow
__all__ = []
if marshmallow:
def _load_schema(schema, json):
try:
return schema.load(json)
except marshmallow.exceptions.ValidationError as e:
abort(400, e.messages)
def schema_req... | [
"flask.abort",
"flask.request.get_json",
"functools.wraps"
] | [((571, 589), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (586, 589), False, 'import functools\n'), ((278, 300), 'flask.abort', 'abort', (['(400)', 'e.messages'], {}), '(400, e.messages)\n', (283, 300), False, 'from flask import abort, request\n'), ((655, 683), 'flask.request.get_json', 'request.get_jso... |
import json
import pathlib
from datetime import datetime, timezone
from typing import Union, List
from dateutil.parser import isoparse
from discord.ext.commands import Context, Cog, Bot, command
from discord.ext import tasks
from discord import (
Embed,
Colour,
File,
Member,
User,
Role,
Gui... | [
"loguru.logger.info",
"pathlib.Path",
"dateutil.parser.isoparse",
"discord.Colour.from_rgb",
"discord.Embed",
"datetime.datetime.now",
"discord.ext.tasks.loop",
"discord.ext.commands.command",
"discord.File"
] | [((784, 830), 'loguru.logger.info', 'logger.info', (['"""called by {}"""', 'context.author.id'], {}), "('called by {}', context.author.id)\n", (795, 830), False, 'from loguru import logger\n'), ((1084, 1147), 'loguru.logger.info', 'logger.info', (['"""called by {}, index {}"""', 'context.author.id', 'index'], {}), "('c... |
from .ray import *
from numpy import *
import matplotlib.pyplot as plt
import pickle
import time
import os
""" A group of rays kept as a list, to be used as a starting
point (i.e. an object) or as a cumulative detector (i.e. at an image
or output plane) for ImagingPath, MatrixGroup or any tracing function.
Subclasses ... | [
"os.path.exists",
"os.path.getsize",
"matplotlib.pyplot.ioff",
"time.sleep",
"pickle.Pickler",
"pickle.Unpickler",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((2838, 2848), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (2846, 2848), True, 'import matplotlib.pyplot as plt\n'), ((2869, 2884), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (2881, 2884), True, 'import matplotlib.pyplot as plt\n'), ((3624, 3634), 'matplotlib.pyplot.show', 'plt.s... |
# mathematical imports -
import numpy as np
# pytorch imports -
import torch
import torch.utils.data as data
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def createDiff(data):
dataOut = np.zeros(shape=(data.shape[0],data.shape[1]-1))
for i in range(data.shape[1]-1):
da... | [
"torch.Tensor",
"numpy.zeros",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"numpy.load"
] | [((225, 275), 'numpy.zeros', 'np.zeros', ([], {'shape': '(data.shape[0], data.shape[1] - 1)'}), '(shape=(data.shape[0], data.shape[1] - 1))\n', (233, 275), True, 'import numpy as np\n'), ((7075, 7099), 'numpy.load', 'np.load', (['(path + fileName)'], {}), '(path + fileName)\n', (7082, 7099), True, 'import numpy as np\n... |
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot
import cv2
class DataAugmentation:
shift = 0.15;
datagen = None;
# constructor
def __init__(self):
# define data preparation
self.datagen = ImageDataGenerator(featurewise_center=False,
samplewis... | [
"matplotlib.pyplot.imshow",
"cv2.flip",
"keras.preprocessing.image.ImageDataGenerator",
"numpy.squeeze",
"numpy.array",
"cv2.resize",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((256, 686), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'featurewise_center': '(False)', 'samplewise_center': '(False)', 'featurewise_std_normalization': '(False)', 'samplewise_std_normalization': '(False)', 'zca_whitening': '(False)', 'rotation_range': '(0.0)', 'width_shift_range': 's... |
"""
Coded by @majhcc
"""
import re
def youtube_url_validation(url):
youtube_regex = (
r'(https?://)?(www\.)?'
'(youtube|youtu)\.(com|be)/'
'(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})')
youtube_regex_match = re.match(youtube_regex, url)
if youtube_regex_match:
return youtube... | [
"re.match",
"pytube.YouTube"
] | [((241, 269), 're.match', 're.match', (['youtube_regex', 'url'], {}), '(youtube_regex, url)\n', (249, 269), False, 'import re\n'), ((483, 495), 'pytube.YouTube', 'YouTube', (['url'], {}), '(url)\n', (490, 495), False, 'from pytube import YouTube\n')] |
import glob, os, shutil, sys, json
from pathlib import Path
import pylab as plt
import trimesh
import open3d
from easydict import EasyDict
import numpy as np
from tqdm import tqdm
import utils
from features import MeshFPFH
FIX_BAD_ANNOTATION_HUMAN_15 = 0
# Labels for all datasets
# -----------------------
sigg17_pa... | [
"csv.DictReader",
"numpy.array",
"open3d.io.read_triangle_mesh",
"numpy.linalg.norm",
"trimesh.proximity.closest_point",
"numpy.sin",
"os.path.exists",
"numpy.savez",
"os.listdir",
"numpy.mean",
"pathlib.Path",
"numpy.asarray",
"numpy.max",
"os.path.split",
"easydict.EasyDict",
"numpy.... | [((6944, 6977), 'numpy.dot', 'np.dot', (['vertices', 'R'], {'out': 'vertices'}), '(vertices, R, out=vertices)\n', (6950, 6977), True, 'import numpy as np\n'), ((7017, 7095), 'trimesh.Trimesh', 'trimesh.Trimesh', ([], {'vertices': "mesh['vertices']", 'faces': "mesh['faces']", 'process': '(False)'}), "(vertices=mesh['ver... |
# -*- coding: utf-8 -*-
"""\
Caelus/OpenFOAM Dictionary Implementation
-----------------------------------------
"""
import re
try:
from collections import deque
from collections.abc import Mapping
except ImportError: # pragma: no cover
from collections import Mapping
import six
from ..utils import stru... | [
"six.StringIO"
] | [((528, 542), 'six.StringIO', 'six.StringIO', ([], {}), '()\n', (540, 542), False, 'import six\n')] |
#
# From Ippsec YouTube video of HTB Arkham
#
# https://youtu.be/krC5j1Ab44I
#
from base64 import b64decode, b64encode
from hashlib import sha1
import pyDes, hmac
import requests
from cmd import Cmd
URL = "http://10.10.10.130:8080/userSubscribe.faces"
# Adding Cmd to get terminal functionality
class Terminal(Cmd)... | [
"requests.post",
"base64.b64encode",
"base64.b64decode",
"pyDes.des",
"cmd.Cmd.__init__"
] | [((10148, 10173), 'base64.b64decode', 'b64decode', (['"""SnNGOTg3Ni0="""'], {}), "('SnNGOTg3Ni0=')\n", (10157, 10173), False, 'from base64 import b64decode, b64encode\n'), ((10184, 10234), 'pyDes.des', 'pyDes.des', (['key', 'pyDes.ECB'], {'padmode': 'pyDes.PAD_PKCS5'}), '(key, pyDes.ECB, padmode=pyDes.PAD_PKCS5)\n', (1... |
import argparse
import sys
import time
def parse_args(args):
parser = argparse.ArgumentParser(description='Hello World VoTT-train plugin.')
parser.add_argument('--annotations', help='URL to annotations csv.', default=None, type=str)
parser.add_argument('--model', help='URL to Azure Storage Container or AWS... | [
"argparse.ArgumentParser",
"time.sleep",
"sys.exit"
] | [((673, 687), 'time.sleep', 'time.sleep', (['(30)'], {}), '(30)\n', (683, 687), False, 'import time\n'), ((688, 699), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (696, 699), False, 'import sys\n'), ((75, 144), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Hello World VoTT-train plug... |
# Simple Snake Game
# By Tech@chime
import os
import turtle
import time
import random
wn = turtle.Screen()
wn.title("Snake Game By Tech@chime")
wn.bgcolor("green")
wn.setup(width=600,height=600)
wn.tracer(0)
delay = 0.1
score = 0
high_score = 0
# Snake Head
head = turtle.Turtle()
head.shape("square")
head.speed(0)
... | [
"turtle.Screen",
"random.randint",
"turtle.Turtle",
"time.sleep"
] | [((93, 108), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (106, 108), False, 'import turtle\n'), ((269, 284), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (282, 284), False, 'import turtle\n'), ((413, 428), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (426, 428), False, 'import turtle\n'), ((558, 5... |
from ..tasks import video, task_base
import numpy as np
def get_videos(subject, session):
video_idx = np.loadtxt(
"data/liris/order_fmri_neuromod.csv", delimiter=",", skiprows=1, dtype=np.int
)
selected_idx = video_idx[video_idx[:, 0] == session, subject + 1]
return selected_idx
def get_task... | [
"numpy.loadtxt"
] | [((108, 201), 'numpy.loadtxt', 'np.loadtxt', (['"""data/liris/order_fmri_neuromod.csv"""'], {'delimiter': '""","""', 'skiprows': '(1)', 'dtype': 'np.int'}), "('data/liris/order_fmri_neuromod.csv', delimiter=',', skiprows=1,\n dtype=np.int)\n", (118, 201), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
"""
author: Gonzalo
date started: 19/10/18
This script creates a list of individuals that are present in all specified waves.
It selects one of these individuals at random and tracks their evolution over time.
It outputs the status of the chosen variable at each wave.
Things to do:
-see if a ch... | [
"random.sample",
"common.longevity",
"argparse.ArgumentParser",
"pandas.read_csv"
] | [((2699, 2724), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2722, 2724), False, 'import argparse\n'), ((1212, 1249), 'pandas.read_csv', 'pd.read_csv', (["('data/' + name)"], {'sep': '"""\t"""'}), "('data/' + name, sep='\\t')\n", (1223, 1249), True, 'import pandas as pd\n'), ((926, 945), 'co... |
import sys,os,string
import math
from ROOT import *
from PlotUtils import *
from array import array
def SyncBands2(hist):
print (hist.GetName())
theCVhisto = MnvH2D()
theCVHisto = hist.Clone()
theCVHisto.SetDirectory(0);
bandnames = hist.GetErrorBandNames();
# "Synching Error Band CV's with MnvH1D's CV" << ... | [
"os.path.dirname",
"sys.exit"
] | [((1666, 1677), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1674, 1677), False, 'import sys, os, string\n'), ((1711, 1732), 'os.path.dirname', 'os.path.dirname', (['file'], {}), '(file)\n', (1726, 1732), False, 'import sys, os, string\n'), ((2161, 2172), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2169, 2172)... |
import re
from mathpy.grammar.complex.lexer import lexer as cmpxlex
from mathpy.grammar.paranthesis.lexer import lexer as paranlex
from mathpy.grammar.differentiation.lexer import lexer as dfrtnlex
from mathpy.grammar.complex.parser import parser as cmpx
from mathpy.grammar.paranthesis.parser import parser as paran
fro... | [
"mathpy.grammar.complex.parser.parser.parse",
"plotly.tools.make_subplots",
"mathpy.grammar.differentiation.parser.parser.parse",
"plotly.offline.plot",
"plotly.graph_objs.Scatter",
"mathpy.grammar.paranthesis.parser.parser.parse",
"os.mkdir",
"re.findall"
] | [((498, 515), 'os.mkdir', 'os.mkdir', (['"""plots"""'], {}), "('plots')\n", (506, 515), False, 'import os\n'), ((562, 592), 'mathpy.grammar.paranthesis.parser.parser.parse', 'paran.parse', (['s'], {'lexer': 'paranlex'}), '(s, lexer=paranlex)\n', (573, 592), True, 'from mathpy.grammar.paranthesis.parser import parser as... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##########
# IMPORT #
##########
# Systeem
import sys
from sys import platform as _platform
import time
# SQL
#import sqlite3
# GUI - TKInter
import tkinter as tk
from tkinter import ttk
from tkinter import font
from tkinter import Text
# GUI - Extensions
from gui.tkEx... | [
"tkinter.Menu",
"tkinter.ttk.Button",
"tkinter.ttk.Style",
"tkinter.ttk.Frame",
"tkinter.ttk.Label",
"tkinter.font.Font",
"tkinter.Tk.__init__",
"tkinter.ttk.Frame.__init__",
"tkinter.Menu.__init__",
"tkinter.ttk.Notebook"
] | [((514, 534), 'tkinter.Tk.__init__', 'tk.Tk.__init__', (['self'], {}), '(self)\n', (528, 534), True, 'import tkinter as tk\n'), ((682, 693), 'tkinter.ttk.Style', 'ttk.Style', ([], {}), '()\n', (691, 693), False, 'from tkinter import ttk\n'), ((1214, 1244), 'tkinter.Menu.__init__', 'tk.Menu.__init__', (['self', 'parent'... |
from django import forms
from dal import autocomplete
from .models import Punchline, Song
class SongAdminForm(forms.ModelForm):
class Meta:
model = Song
fields = '__all__'
widgets = {
'album': autocomplete.ModelSelect2(url='admin:album-autocomplete'),
}
class Punch... | [
"dal.autocomplete.ModelSelect2"
] | [((238, 295), 'dal.autocomplete.ModelSelect2', 'autocomplete.ModelSelect2', ([], {'url': '"""admin:album-autocomplete"""'}), "(url='admin:album-autocomplete')\n", (263, 295), False, 'from dal import autocomplete\n'), ((464, 522), 'dal.autocomplete.ModelSelect2', 'autocomplete.ModelSelect2', ([], {'url': '"""admin:artis... |
"""Module providing adapter class making node-label prediction possible in sklearn models."""
from sklearn.base import ClassifierMixin
from typing import Type, List, Dict, Optional, Any
import numpy as np
import copy
from ensmallen import Graph
from embiggen.embedding_transformers import NodeLabelPredictionTransformer,... | [
"embiggen.utils.sklearn_utils.must_be_an_sklearn_classifier_model",
"embiggen.embedding_transformers.NodeLabelPredictionTransformer",
"numpy.array",
"copy.deepcopy",
"embiggen.embedding_transformers.NodeTransformer"
] | [((1386, 1437), 'embiggen.utils.sklearn_utils.must_be_an_sklearn_classifier_model', 'must_be_an_sklearn_classifier_model', (['model_instance'], {}), '(model_instance)\n', (1421, 1437), False, 'from embiggen.utils.sklearn_utils import must_be_an_sklearn_classifier_model\n'), ((1786, 1805), 'copy.deepcopy', 'copy.deepcop... |
import re
import sys
import os
import json
import argparse
from collections import OrderedDict
class TestJobResult:
def __init__(self, status, job_url, step_failed):
self.job_url = job_url
self.status = status
self.step_failed = step_failed
def summarize_test():
return ''
... | [
"os.path.exists",
"collections.OrderedDict",
"argparse.ArgumentParser",
"re.compile",
"os.environ.get",
"os.path.join",
"os.path.normpath",
"json.load",
"os.walk",
"re.search"
] | [((524, 537), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (535, 537), False, 'from collections import OrderedDict\n'), ((561, 574), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (572, 574), False, 'from collections import OrderedDict\n'), ((594, 607), 'collections.OrderedDict', 'OrderedDic... |
#!/usr/bin/python
#
# Copyright 2018, <NAME>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaim... | [
"logging.getLogger",
"sklearn.model_selection.GridSearchCV",
"logging.StreamHandler",
"rdkit.Chem.AllChem.GetMolFrags",
"rdkit.Chem.AllChem.SanitizeMol",
"pandas.read_csv",
"sklearn.metrics.classification_report",
"rdkit.Chem.AllChem.Compute2DCoords",
"numpy.log",
"rdkit.Chem.AllChem.SDMolSupplier... | [((3056, 3079), 'rdkit.Chem.AllChem.GetPeriodicTable', 'Chem.GetPeriodicTable', ([], {}), '()\n', (3077, 3079), True, 'from rdkit.Chem import AllChem as Chem\n'), ((13855, 14034), 'logging.info', 'logging.info', (["('Generating feature using RDKit matrix from: %s -- with options skipH (%r) iterative(%r) filterRubbish(%... |
import collections.abc
import enum
import os
from typing import (
TYPE_CHECKING,
Annotated,
Any,
AsyncGenerator,
Optional,
Union,
)
import aiohttp
import inflection
import numpy as np
import pandas as pd
import pydantic
import structlog
import uplink
import uplink.converters
from pandera.decora... | [
"numpy.log",
"uplink.retry.backoff.jittered",
"uplink.retry.stop.after_delay",
"uplink.Query",
"wraeblast.constants.get_cluster_jewel_passive",
"uplink.ratelimit",
"pandera.model_components.Field",
"pandas.DataFrame",
"inflection.pluralize",
"pydantic.PrivateAttr",
"pydantic.validator",
"wraeb... | [((782, 804), 'structlog.get_logger', 'structlog.get_logger', ([], {}), '()\n', (802, 804), False, 'import structlog\n'), ((11725, 11766), 'pandera.decorators.check_output', 'check_output', (['ExtendedNinjaOverviewSchema'], {}), '(ExtendedNinjaOverviewSchema)\n', (11737, 11766), False, 'from pandera.decorators import c... |
#!/usr/bin/python3
'''
# Exploit Title: OpenNetAdmin 18.1.1 - Remote Code Execution
# Date: 2020-01-18
# Exploit Author: @amriunix (https://amriunix.com)
# Vendor Homepage: http://opennetadmin.com/
# Software Link: https://github.com/opennetadmin/ona
# Version: v18.1.1
# Tested on: Linux
'''
import requests
import sy... | [
"requests.post",
"requests.packages.urllib3.disable_warnings",
"requests.get"
] | [((433, 508), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {'category': 'InsecureRequestWarning'}), '(category=InsecureRequestWarning)\n', (475, 508), False, 'import requests\n'), ((807, 845), 'requests.get', 'requests.get', ([], {'url': 'target', 'verify': '(False)'}... |
from datetime import date
import datetime
import calendar
import pandas as pd
def VaccinesBar():
fill = "▓"
empty ="░"
indiaVacData = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/country_data/India.csv"
df = pd.read_csv(indiaVacData)
todaydf = df.iloc[[-1]... | [
"datetime.date.today",
"pandas.read_csv"
] | [((268, 293), 'pandas.read_csv', 'pd.read_csv', (['indiaVacData'], {}), '(indiaVacData)\n', (279, 293), True, 'import pandas as pd\n'), ((1016, 1028), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1026, 1028), False, 'from datetime import date\n')] |
from record_service.database.database import db
from record_service.models.base import Base
from record_service.models.user import User
from record_service.models.record import Record
from sqlalchemy.dialects.postgresql import UUID
class RecordKey(Base):
"""Stores AES keys that were used to encrypt records, which... | [
"record_service.database.database.db.Column",
"sqlalchemy.dialects.postgresql.UUID",
"record_service.database.database.db.ForeignKey"
] | [((632, 666), 'record_service.database.database.db.Column', 'db.Column', (['db.Text'], {'nullable': '(False)'}), '(db.Text, nullable=False)\n', (641, 666), False, 'from record_service.database.database import db\n'), ((676, 710), 'record_service.database.database.db.Column', 'db.Column', (['db.Text'], {'nullable': '(Fa... |