code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import json
import os
def update_handler(event, context):
#print('request: {}'.format(json.dumps(event)))
telegram_message = json.loads(event['body'])
print('request: {}'.format(json.dumps(telegram_message)))
if 'message' in telegram_message:
received_message = telegram_message['message... | [
"json.loads",
"json.dumps"
] | [((137, 162), 'json.loads', 'json.loads', (["event['body']"], {}), "(event['body'])\n", (147, 162), False, 'import json\n'), ((194, 222), 'json.dumps', 'json.dumps', (['telegram_message'], {}), '(telegram_message)\n', (204, 222), False, 'import json\n')] |
import os
import urllib.request
from flask_appbuilder.models.mixins import ImageColumn
from flask import Flask, jsonify, redirect, request
from flask_sqlalchemy import SQLAlchemy
from werkzeug.utils import secure_filename
app = Flask(__name__)
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEM... | [
"flask_appbuilder.models.mixins.ImageColumn",
"flask.Flask",
"os.path.join",
"werkzeug.utils.secure_filename",
"flask_sqlalchemy.SQLAlchemy",
"flask.jsonify"
] | [((229, 244), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (234, 244), False, 'from flask import Flask, jsonify, redirect, request\n'), ((485, 500), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (495, 500), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((1754, 1784), 'werk... |
import os
from typing import TYPE_CHECKING, List, Dict, Set, Type, Optional
from d20.Manual.Logger import logging, Logger
from d20.Manual.Registration import BackStoryRegistrationForm
from d20.Manual.Utils import loadExtras
from d20.Manual.Facts import Fact, getFactClass
from d20.Manual.Config import Configuration, En... | [
"d20.Manual.Facts.getFactClass",
"d20.Manual.Registration.BackStoryRegistrationForm",
"d20.Manual.Logger.logging.getLogger",
"d20.Manual.Utils.loadExtras",
"os.path.abspath"
] | [((537, 564), 'd20.Manual.Logger.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (554, 564), False, 'from d20.Manual.Logger import logging, Logger\n'), ((3095, 3130), 'd20.Manual.Registration.BackStoryRegistrationForm', 'BackStoryRegistrationForm', ([], {}), '(**kwargs)\n', (3120, 3130), Fa... |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | [
"flexbe_core.OperatableStateMachine",
"hector_flexbe_states.get_robot_pose.GetRobotPose",
"hector_flexbe_states.ErrorOperator.ErrorOperator",
"roslib.load_manifest",
"geometry_msgs.msg.PoseStamped"
] | [((398, 449), 'roslib.load_manifest', 'roslib.load_manifest', (['"""behavior_simplemissionerror"""'], {}), "('behavior_simplemissionerror')\n", (418, 449), False, 'import roslib\n'), ((1357, 1504), 'flexbe_core.OperatableStateMachine', 'OperatableStateMachine', ([], {'outcomes': "['failed', 'toStart', 'toEnd']", 'input... |
import argparse
import sys
from mkhdr import *
from ui import start_ui
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--directory',
help="""the directory that contains the
original images. If not specified,
... | [
"argparse.ArgumentParser"
] | [((113, 138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (136, 138), False, 'import argparse\n')] |
from PyQt5.QtCore import QEasingCurve, QPropertyAnimation, Qt, pyqtProperty
from PyQt5.QtGui import QColor, QPainter
from PyQt5.QtWidgets import QCheckBox
class Switch(QCheckBox):
"""A custom toggle switch widget which inherits from QCheckBox."""
def __init__(
self,
bg_colour="#777777",
... | [
"PyQt5.QtCore.pyqtProperty",
"PyQt5.QtCore.QPropertyAnimation",
"PyQt5.QtGui.QColor",
"PyQt5.QtGui.QPainter"
] | [((1255, 1272), 'PyQt5.QtCore.pyqtProperty', 'pyqtProperty', (['int'], {}), '(int)\n', (1267, 1272), False, 'from PyQt5.QtCore import QEasingCurve, QPropertyAnimation, Qt, pyqtProperty\n'), ((549, 573), 'PyQt5.QtGui.QColor', 'QColor', (['active_bg_colour'], {}), '(active_bg_colour)\n', (555, 573), False, 'from PyQt5.Qt... |
from random import randint
import random
class Player:
def __init__(self, startX = None, startY = None, startDirection = None, color = (50, 255, 50), window = None, apples = None, players = None, ki = True):
if startX == None:
startX = randint(0, 640 / 20 - 1)
if startY == None:
... | [
"random.choice",
"random.randint"
] | [((4163, 4185), 'random.choice', 'random.choice', (['directs'], {}), '(directs)\n', (4176, 4185), False, 'import random\n'), ((262, 286), 'random.randint', 'randint', (['(0)', '(640 / 20 - 1)'], {}), '(0, 640 / 20 - 1)\n', (269, 286), False, 'from random import randint\n'), ((335, 359), 'random.randint', 'randint', (['... |
# Copyright 2018 Platform9 Systems, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wr... | [
"logging.getLogger",
"argparse.ArgumentParser",
"openstack.config.OpenStackConfig",
"sys.exit",
"qbertconfig.qbertclient.QbertClient"
] | [((750, 777), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (767, 777), False, 'import logging\n'), ((1185, 1248), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Manages Kubeconfig files"""'}), "(description='Manages Kubeconfig files')\n", (1208, 1248), Fa... |
#
# Copyright 2016 <NAME> (<EMAIL>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | [
"logging.basicConfig",
"logging.getLogger",
"configparser.ConfigParser",
"os.makedirs",
"zonebot.find_config",
"os.path.isfile",
"os.path.dirname",
"os.path.isdir",
"zonebot.validate_config",
"nose.tools.assert_equal",
"os.path.expanduser",
"os.remove"
] | [((719, 762), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.CRITICAL'}), '(level=logging.CRITICAL)\n', (738, 762), False, 'import logging\n'), ((763, 791), 'logging.getLogger', 'logging.getLogger', (['"""zonebot"""'], {}), "('zonebot')\n", (780, 791), False, 'import logging\n'), ((919, 933), 'co... |
from __future__ import print_function
import sys
import numpy
import pytest
import struct
from stl import mesh
_STL_FILE = '''
solid test.stl
facet normal -0.014565 0.073223 -0.002897
outer loop
vertex 0.399344 0.461940 1.044090
vertex 0.500000 0.500000 1.500000
vertex 0.576120 0.500000 1.117320
endlo... | [
"struct.pack",
"numpy.array",
"numpy.zeros",
"pytest.raises",
"stl.mesh.Mesh"
] | [((3715, 3752), 'numpy.zeros', 'numpy.zeros', (['(3)'], {'dtype': 'mesh.Mesh.dtype'}), '(3, dtype=mesh.Mesh.dtype)\n', (3726, 3752), False, 'import numpy\n'), ((3778, 3826), 'numpy.array', 'numpy.array', (['[[0, 0, 0], [1, 0, 0], [0, 1, 1.0]]'], {}), '([[0, 0, 0], [1, 0, 0], [0, 1, 1.0]])\n', (3789, 3826), False, 'impo... |
"""
Downloader module, gets and unpacks the dataset if not present.
"""
import os
import wget
import zipfile
import rnn.logger as logger
# downloads config
SAVE_DIR = "data"
DATASET_DOWNLOAD_PATH = "https://nlp.stanford.edu/projects/snli/snli_1.0.zip"
DATASET_FILENAME = "snli"
GLOVE_DOWNLOAD_PATH = "http://nlp.stanfo... | [
"wget.download",
"os.path.exists",
"rnn.logger.header",
"os.makedirs",
"zipfile.ZipFile",
"rnn.logger.info",
"rnn.logger.success",
"rnn.logger.error",
"os.path.isdir",
"os.remove"
] | [((472, 516), 'os.path.isdir', 'os.path.isdir', (["(SAVE_DIR + '/' + archive_name)"], {}), "(SAVE_DIR + '/' + archive_name)\n", (485, 516), False, 'import os\n'), ((1280, 1344), 'rnn.logger.info', 'logger.info', (["('Downloading the ' + label + ' archive from ' + url)"], {}), "('Downloading the ' + label + ' archive fr... |
from mri_modules.utils import *
import os
import numpy as np
import cv2
import shutil
from skimage.measure import marching_cubes_lewiner as marching_cubes
import stl
from stl import mesh
import tensorflow as tf
from tensorflow.keras.models import load_model
import skimage.transform
import nibabel as nib
imp... | [
"tensorflow.keras.layers.Conv3D",
"scipy.ndimage.measurements.label",
"numpy.isin",
"skimage.measure.marching_cubes_lewiner",
"numpy.count_nonzero",
"tensorflow.keras.layers.UpSampling3D",
"tensorflow.keras.models.load_model",
"numpy.rot90",
"scipy.ndimage.gaussian_filter",
"scipy.ndimage.interpol... | [((19163, 19174), 'time.time', 'time.time', ([], {}), '()\n', (19172, 19174), False, 'import time\n'), ((827, 872), 'scipy.ndimage.generate_binary_structure', 'scipy.ndimage.generate_binary_structure', (['(3)', '(1)'], {}), '(3, 1)\n', (866, 872), False, 'import scipy\n'), ((2353, 2415), 'scipy.ndimage.measurements.lab... |
# coding=utf-8
# Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | [
"tensorflow.compat.v2.argmax",
"tensorflow_probability.distributions.Categorical",
"tensorflow.compat.v2.keras.optimizers.Adam",
"tensorflow.compat.v2.equal",
"tensorflow.compat.v2.nn.log_softmax",
"valan.r2r.curriculum_env_config.get_default_curriculum_env_config",
"valan.r2r.env_config.get_default_env... | [((1432, 1535), 'collections.namedtuple', 'collections.namedtuple', (['"""R2RDebugInfo"""', "['episode_undisc_reward', 'episode_num_steps', 'num_paths']"], {}), "('R2RDebugInfo', ['episode_undisc_reward',\n 'episode_num_steps', 'num_paths'])\n", (1454, 1535), False, 'import collections\n'), ((4123, 4176), 'tensorflo... |
# ------------------------------------------------------------------------------
#
# Copyright 2021 Fetch.AI Limited
#
# 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://w... | [
"colearn.standalone_driver.run_one_round",
"colearn.utils.results.Result"
] | [((1273, 1281), 'colearn.utils.results.Result', 'Result', ([], {}), '()\n', (1279, 1281), False, 'from colearn.utils.results import Result\n'), ((1797, 1805), 'colearn.utils.results.Result', 'Result', ([], {}), '()\n', (1803, 1805), False, 'from colearn.utils.results import Result\n'), ((1841, 1893), 'colearn.standalon... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 applic... | [
"tensorflow.feature_column.indicator_column",
"tensorflow.feature_column.numeric_column",
"tensorflow.feature_column.categorical_column_with_identity",
"tensorflow.feature_column.embedding_column",
"tensorflow.feature_column.categorical_column_with_hash_bucket"
] | [((8373, 8508), 'tensorflow.feature_column.categorical_column_with_hash_bucket', 'tf.feature_column.categorical_column_with_hash_bucket', (['column_name'], {'hash_bucket_size': 'HASH_BUCKET_SIZES[column_name]', 'dtype': 'tf.int32'}), '(column_name,\n hash_bucket_size=HASH_BUCKET_SIZES[column_name], dtype=tf.int32)\n... |
#!/usr/bin/env python
"""
This module test the rotation of vertices for a given points.
"""
import os
import unittest
import sys
from dataSet import transform_points
from set_para import filename, root
from set_para import transformOutputPath
from set_para import get_image, get_path, validate
if not os.path.exist... | [
"os.path.exists",
"set_para.validate",
"os.makedirs",
"os.path.join",
"sys._getframe",
"set_para.get_image",
"unittest.main",
"sys.path.append",
"os.path.abspath",
"set_para.get_path"
] | [((307, 342), 'os.path.exists', 'os.path.exists', (['transformOutputPath'], {}), '(transformOutputPath)\n', (321, 342), False, 'import os\n'), ((348, 380), 'os.makedirs', 'os.makedirs', (['transformOutputPath'], {}), '(transformOutputPath)\n', (359, 380), False, 'import os\n'), ((3607, 3622), 'unittest.main', 'unittest... |
'''
MIT License
Copyright 2019 Oak Ridge National Laboratory
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, copy, modify, mer... | [
"faro.FaceGallery.SearchableGalleryWorker",
"faro.proto.face_service_pb2.FaceServiceInfo",
"os.path.join",
"pyvision.CenteredRect",
"numpy.zeros",
"insightface.model_zoo.get_model",
"numpy.linalg.norm",
"faro.proto.proto_types.image_pv2proto",
"faro.proto.proto_types.vector_np2proto",
"faro.proto.... | [((1442, 1487), 'faro.FaceGallery.SearchableGalleryWorker', 'SearchableGalleryWorker', (['options', 'fsd.NEG_DOT'], {}), '(options, fsd.NEG_DOT)\n', (1465, 1487), False, 'from faro.FaceGallery import SearchableGalleryWorker\n'), ((1847, 1909), 'insightface.model_zoo.get_model', 'insightface.model_zoo.get_model', (['"""... |
import os
import re
from lxml import html
import requests
import jsbeautifier
response = requests.get('http://app.youneedabudget.com')
with open('index.html', 'w', encoding='utf-8') as file_before:
file_before.write(response.text)
parsed = html.fromstring(response.text)
for src in parsed.xpath('//script/@src'):
... | [
"re.compile",
"lxml.html.fromstring",
"os.path.join",
"requests.get",
"jsbeautifier.beautify"
] | [((89, 134), 'requests.get', 'requests.get', (['"""http://app.youneedabudget.com"""'], {}), "('http://app.youneedabudget.com')\n", (101, 134), False, 'import requests\n'), ((244, 274), 'lxml.html.fromstring', 'html.fromstring', (['response.text'], {}), '(response.text)\n', (259, 274), False, 'from lxml import html\n'),... |
import sys
import os
import re
import pdb
sys.path.append(os.path.join(os.path.dirname(__file__), '../problem_classification'))
import problem_instance_classifier
import time, sys
from datetime import timedelta
MAX_TASK_AMOUNT = 1024
PROCESSED_DATA_DIRECTORY = '../problem_instance_generator/data-processed/'
CLASSIFI... | [
"problem_instance_classifier.set_machine_amount",
"os.path.dirname",
"problem_instance_classifier.classify_problem_instance",
"datetime.timedelta",
"time.time",
"re.search"
] | [((6540, 6551), 'time.time', 'time.time', ([], {}), '()\n', (6549, 6551), False, 'import time, sys\n'), ((72, 97), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (87, 97), False, 'import os\n'), ((3653, 3695), 're.search', 're.search', (['"""x(\\\\d+)-"""', 'classifier_filename'], {}), "('x(\... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return[
{
"label": _("Subscription"),
"icon": "fa fa-money",
"items": [
{
"type": "doctype",
"name": "mp Abo",
... | [
"frappe._"
] | [((121, 138), 'frappe._', '_', (['"""Subscription"""'], {}), "('Subscription')\n", (122, 138), False, 'from frappe import _\n'), ((722, 732), 'frappe._', '_', (['"""Tools"""'], {}), "('Tools')\n", (723, 732), False, 'from frappe import _\n'), ((1881, 1897), 'frappe._', '_', (['"""Master Data"""'], {}), "('Master Data')... |
#!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python_task_helper', 'files'))
from task_helper import TaskHelper
class PyTask(TaskHelper):
def task(self, args):
return {'result': 'Hi, this is a python task and my name is '+args['name']}
if __name... | [
"os.path.dirname"
] | [((67, 92), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'import os, sys\n')] |
import numpy as np
import copy
def update_income(behavioral_effect, calcY):
delta_inc = np.where(calcY.c00100 > 0, behavioral_effect, 0)
# Attribute the behavioral effects across itemized deductions,
# wages, and other income.
_itemized = np.where(calcY.c04470 < calcY._standard,
... | [
"numpy.where",
"copy.deepcopy"
] | [((94, 142), 'numpy.where', 'np.where', (['(calcY.c00100 > 0)', 'behavioral_effect', '(0)'], {}), '(calcY.c00100 > 0, behavioral_effect, 0)\n', (102, 142), True, 'import numpy as np\n'), ((259, 316), 'numpy.where', 'np.where', (['(calcY.c04470 < calcY._standard)', '(0)', 'calcY.c04470'], {}), '(calcY.c04470 < calcY._st... |
"""Dialog classes for hotkeys
"""
import os
import collections
import PyQt5.QtWidgets as qtw
## import PyQt5.QtGui as gui
import PyQt5.QtCore as core
import editor.shared as shared
def show_message(win, message_id='', text='', args=None):
"""toon een boodschap in een dialoog
args is bedoeld voor als er tekst... | [
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QInputDialog.getItem",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"editor.shared.log_exc",
"PyQt5.QtWidgets.QTableWidget",
"editor.shared.get_title",
"PyQt5.QtWidgets.QDialog.accept",
"PyQt5.QtWidgets.QComboBox",
"PyQt... | [((383, 427), 'editor.shared.get_text', 'shared.get_text', (['win', 'message_id', 'text', 'args'], {}), '(win, message_id, text, args)\n', (398, 427), True, 'import editor.shared as shared\n'), ((699, 743), 'editor.shared.get_text', 'shared.get_text', (['win', 'message_id', 'text', 'args'], {}), '(win, message_id, text... |
import numpy as np
import sacrebleu
import torch
from torch import nn, optim
from tqdm import tqdm
from src.modules import make_baseline_model, make_ps_model
class ModelManager:
"""
Manages PyTorch nn.Module instance
- Train Loop
- Evaluate Loop
- TODO: early stopping, better logging... | [
"torch.manual_seed",
"torch.load",
"torch.nn.NLLLoss",
"numpy.random.seed",
"torch.save",
"torch.no_grad"
] | [((3998, 4031), 'torch.save', 'torch.save', (['checkpoint', 'self.path'], {}), '(checkpoint, self.path)\n', (4008, 4031), False, 'import torch\n'), ((4085, 4106), 'torch.load', 'torch.load', (['self.path'], {}), '(self.path)\n', (4095, 4106), False, 'import torch\n'), ((4339, 4360), 'numpy.random.seed', 'np.random.seed... |
import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | [
"re.match",
"contextlib.suppress",
"attr.ib"
] | [((143, 172), 'attr.ib', 'attr.ib', ([], {'convert': 'pathlib.Path'}), '(convert=pathlib.Path)\n', (150, 172), False, 'import attr\n'), ((603, 656), 're.match', 're.match', (['"""^Python (\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)$"""', 'output'], {}), "('^Python (\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)$', output)\n", (611, 656), Fal... |
from sympy import (
Add,
Mul,
S,
Symbol,
cos,
cot,
pi,
I,
sin,
sqrt,
tan,
root,
csc,
sec,
powsimp,
symbols,
sinh,
cosh,
tanh,
coth,
sech,
csch,
Dummy,
Rational,
)
from sympy.simplify.fu import (
L,
TR1,
TR10,
... | [
"sympy.cos",
"sympy.Symbol",
"sympy.root",
"sympy.sqrt",
"sympy.sech",
"sympy.simplify.fu.TR12",
"sympy.testing.randtest.verify_numerically",
"sympy.simplify.fu._osborne",
"sympy.Dummy",
"sympy.simplify.fu.TR3",
"sympy.csch",
"sympy.Mul",
"sympy.simplify.fu.hyper_as_trig",
"sympy.abc.x.cou... | [((2980, 3006), 'sympy.symbols', 'symbols', (['"""i"""'], {'integer': '(True)'}), "('i', integer=True)\n", (2987, 3006), False, 'from sympy import Add, Mul, S, Symbol, cos, cot, pi, I, sin, sqrt, tan, root, csc, sec, powsimp, symbols, sinh, cosh, tanh, coth, sech, csch, Dummy, Rational\n'), ((6410, 6416), 'sympy.cos', ... |
from schematics import Model
from spaceone.inventory.libs.schema.resource import CloudWatchModel, CloudWatchDimensionModel
from schematics.types import ModelType, StringType, IntType, DateTimeType, ListType, BooleanType, \
FloatType
class Tags(Model):
key = StringType(deserialize_from="Key")
value = Strin... | [
"schematics.types.IntType",
"schematics.types.ModelType",
"schematics.types.DateTimeType",
"schematics.types.StringType",
"spaceone.inventory.libs.schema.resource.CloudWatchDimensionModel",
"schematics.types.FloatType",
"schematics.types.ListType",
"schematics.types.BooleanType"
] | [((268, 302), 'schematics.types.StringType', 'StringType', ([], {'deserialize_from': '"""Key"""'}), "(deserialize_from='Key')\n", (278, 302), False, 'from schematics.types import ModelType, StringType, IntType, DateTimeType, ListType, BooleanType, FloatType\n'), ((315, 351), 'schematics.types.StringType', 'StringType',... |
"""ラムダ式のサンプル"""
from random import gauss
f = lambda x: 2.0*x + gauss(0,0.01)
for n in range(10):
x = 0.1 * n
print('f({0: 4.3f}) ~ {1: 4.3f}'.format(x,f(x))) | [
"random.gauss"
] | [((64, 78), 'random.gauss', 'gauss', (['(0)', '(0.01)'], {}), '(0, 0.01)\n', (69, 78), False, 'from random import gauss\n')] |
import streamlit as st
from transformers import pipeline
@st.cache(allow_output_mutation=True)
def get_pipeline():
model_path = "./trained_models"
model_name = "beomi/kcgpt2"
return pipeline('text-generation', model=model_path, tokenizer=model_name)
st.title("음식리뷰 생성기")
select_types = ('긍정적 리뷰', '부정적리뷰'... | [
"streamlit.cache",
"streamlit.button",
"streamlit.radio",
"streamlit.spinner",
"streamlit.success",
"streamlit.error",
"streamlit.text_input",
"streamlit.slider",
"transformers.pipeline",
"streamlit.title"
] | [((60, 96), 'streamlit.cache', 'st.cache', ([], {'allow_output_mutation': '(True)'}), '(allow_output_mutation=True)\n', (68, 96), True, 'import streamlit as st\n'), ((265, 285), 'streamlit.title', 'st.title', (['"""음식리뷰 생성기"""'], {}), "('음식리뷰 생성기')\n", (273, 285), True, 'import streamlit as st\n'), ((333, 378), 'stream... |
'''
<NAME> | <EMAIL>
'''
import socket
import json
# parComMOD = mod('/IO/base_com/parComMOD')
import parComMOD
class Com:
'''
This is a bare bones Communcation class.
This sample class has several important features that can be described here.
Notes
-------------... | [
"socket.gethostbyname",
"json.dumps",
"socket.gethostname",
"json.loads"
] | [((735, 755), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (753, 755), False, 'import socket\n'), ((781, 816), 'socket.gethostbyname', 'socket.gethostbyname', (['self.Hostname'], {}), '(self.Hostname)\n', (801, 816), False, 'import socket\n'), ((1886, 1905), 'json.loads', 'json.loads', (['str_msg'], {}... |
import base64
import logging
import operator
import numpy as np
from api.v1alpha1.grpc_proto.grpc_algorithm.python3 import api_pb2
logger = logging.getLogger(__name__)
class Parameter:
def __init__(self, name, space_list):
self.name = name
self.space_list = space_list
self.space_list.so... | [
"logging.getLogger",
"operator.attrgetter",
"api.v1alpha1.grpc_proto.grpc_algorithm.python3.api_pb2.KeyValue",
"numpy.random.randint",
"api.v1alpha1.grpc_proto.grpc_algorithm.python3.api_pb2.ParameterAssignments"
] | [((143, 170), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (160, 170), False, 'import logging\n'), ((570, 596), 'operator.attrgetter', 'operator.attrgetter', (['"""key"""'], {}), "('key')\n", (589, 596), False, 'import operator\n'), ((1170, 1197), 'operator.attrgetter', 'operator.attrge... |
#!/usr/bin/env python
"""
Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-ND 4.0 license (https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode).
"""
'''
Takes a two, two way trainers and generates composed image to image translation
across four distributions
'''
import ... | [
"torchvision.utils.save_image",
"optparse.OptionParser",
"itertools.izip"
] | [((542, 556), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (554, 556), False, 'from optparse import OptionParser\n'), ((2524, 2602), 'itertools.izip', 'itertools.izip', (['train_loader_a', 'train_loader_b', 'train_loader_c', 'train_loader_d'], {}), '(train_loader_a, train_loader_b, train_loader_c, train_l... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='cm500',
version='1.0',
description='Python Distribution Utilities',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/WanderingStar/munin-netgear-cm500.git',
requires=['requests'],
packages=['cm... | [
"distutils.core.setup"
] | [((57, 353), 'distutils.core.setup', 'setup', ([], {'name': '"""cm500"""', 'version': '"""1.0"""', 'description': '"""Python Distribution Utilities"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/WanderingStar/munin-netgear-cm500.git"""', 'requires': "['requests']", 'packag... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 shlomif <<EMAIL>>
#
# Distributed under terms of the MIT license.
"""
"""
import os.path
import re
import subprocess
import sys
idx = int(sys.argv[1])
SEG = 100000
start = idx * SEG + 1
MAX = ((1 << 33) - 1)
end = min((idx + 1) * S... | [
"re.search",
"sys.stderr.write",
"sys.exit"
] | [((384, 394), 'sys.exit', 'sys.exit', ([], {}), '()\n', (392, 394), False, 'import sys\n'), ((826, 886), 're.search', 're.search', (['"""(Solved|Intractable) Board No\\\\. ([0-9]+)"""', 'line'], {}), "('(Solved|Intractable) Board No\\\\. ([0-9]+)', line)\n", (835, 886), False, 'import re\n'), ((989, 1015), 're.search',... |
import xbmcgui
import xbmcplugin
import xbmcaddon
import simplejson as json
import hyperion_client
import pyxbmct
import socket
import routing
ADDON = xbmcaddon.Addon()
#ADDONNAME = ADDON.getAddonInfo('id')
plugin = routing.Plugin()
xbmcplugin.setContent(plugin.handle, 'files')
#path = os.path.dirname(os.path.real... | [
"hyperion_client.hyperion_client",
"pyxbmct.Slider",
"routing.Plugin",
"xbmcplugin.setContent",
"pyxbmct.Button",
"simplejson.load",
"xbmcaddon.Addon",
"xbmcgui.ListItem",
"xbmcgui.Dialog",
"xbmcplugin.endOfDirectory"
] | [((153, 170), 'xbmcaddon.Addon', 'xbmcaddon.Addon', ([], {}), '()\n', (168, 170), False, 'import xbmcaddon\n'), ((219, 235), 'routing.Plugin', 'routing.Plugin', ([], {}), '()\n', (233, 235), False, 'import routing\n'), ((237, 282), 'xbmcplugin.setContent', 'xbmcplugin.setContent', (['plugin.handle', '"""files"""'], {})... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\situations\complex\paparazzi_lock_out_situation.py
# Compiled at: 2018-09-17 20:18:03
# Size of sour... | [
"situations.situation_complex.TunableSituationJobAndRoleState",
"sims4.tuning.instances.lock_instance_tunables",
"situations.situation_complex.SituationStateData",
"situations.base_situation._RequestUserData"
] | [((2534, 2703), 'sims4.tuning.instances.lock_instance_tunables', 'lock_instance_tunables', (['PaparazziLockOutSituation'], {'creation_ui_option': 'SituationCreationUIOption.NOT_AVAILABLE', 'exclusivity': 'BouncerExclusivityCategory.PRE_VISIT'}), '(PaparazziLockOutSituation, creation_ui_option=\n SituationCreationUIO... |
from __future__ import annotations
import contextlib
import os.path
from typing import Generator
from typing import Sequence
import pre_commit.constants as C
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import Var
from pre_commit.hook import Hook
f... | [
"pre_commit.languages.helpers.assert_no_additional_deps",
"pre_commit.languages.helpers.run_setup_cmd",
"pre_commit.languages.helpers.environment_dir",
"pre_commit.languages.helpers.assert_version_default",
"pre_commit.languages.helpers.run_xargs",
"pre_commit.util.clean_path_on_failure",
"pre_commit.en... | [((824, 875), 'pre_commit.languages.helpers.environment_dir', 'helpers.environment_dir', (['ENVIRONMENT_DIR', 'C.DEFAULT'], {}), '(ENVIRONMENT_DIR, C.DEFAULT)\n', (847, 875), False, 'from pre_commit.languages import helpers\n'), ((1106, 1155), 'pre_commit.languages.helpers.assert_version_default', 'helpers.assert_versi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# C++ version Copyright (c) 2006-2007 <NAME> http://www.box2d.org
# Python version Copyright (c) 2010 kne / sirkne at gmail dot com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for an... | [
"pygame.draw.aaline",
"pygame.draw.circle",
"Box2D.b2Vec2",
"pygame.draw.polygon",
"pygame.init",
"pygame.display.set_mode",
"pygame.display.flip",
"Box2D.b2DrawExtended.__init__",
"pygame.draw.aalines",
"pygame.time.Clock",
"pygame.display.set_caption",
"pygame.font.Font"
] | [((1424, 1466), 'Box2D.b2DrawExtended.__init__', 'b2.b2DrawExtended.__init__', (['self'], {}), '(self, **kwargs)\n', (1450, 1466), True, 'import Box2D as b2\n'), ((2559, 2613), 'pygame.draw.aalines', 'pygame.draw.aalines', (['self.surface', 'color', '(True)', 'points'], {}), '(self.surface, color, True, points)\n', (25... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import xml.etree.ElementTree as ET
import arrow
from builtins import *
from nzbhydra.categories import getByNewznabCats
from nzbhydra.exceptions import I... | [
"logging.getLogger",
"nzbhydra.search_module.IndexerProcessingResult",
"nzbhydra.exceptions.IndexerResultParsingException",
"arrow.get",
"nzbhydra.categories.getByNewznabCats"
] | [((516, 541), 'logging.getLogger', 'logging.getLogger', (['"""root"""'], {}), "('root')\n", (533, 541), False, 'import logging\n'), ((4050, 4078), 'nzbhydra.categories.getByNewznabCats', 'getByNewznabCats', (['categories'], {}), '(categories)\n', (4066, 4078), False, 'from nzbhydra.categories import getByNewznabCats\n'... |
from py14.tracer import value_type, value_expr, decltype, is_list, is_recursive
from common.context import add_variable_context, add_list_calls
from common.scope import add_scope_context
import ast
def parse(*args):
source = ast.parse("\n".join(args))
add_variable_context(source)
add_scope_context(source)... | [
"py14.tracer.is_list",
"py14.tracer.decltype",
"py14.tracer.value_type",
"py14.tracer.value_expr",
"common.scope.add_scope_context",
"common.context.add_variable_context",
"py14.tracer.is_recursive",
"common.context.add_list_calls"
] | [((262, 290), 'common.context.add_variable_context', 'add_variable_context', (['source'], {}), '(source)\n', (282, 290), False, 'from common.context import add_variable_context, add_list_calls\n'), ((295, 320), 'common.scope.add_scope_context', 'add_scope_context', (['source'], {}), '(source)\n', (312, 320), False, 'fr... |
# Copyright 2016 Ifwe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.ForeignKey",
"sqlalchemy.dialects.mysql.INTEGER"
] | [((1196, 1231), 'sqlalchemy.orm.relationship', 'relationship', (['"""Host"""'], {'uselist': '(False)'}), "('Host', uselist=False)\n", (1208, 1231), False, 'from sqlalchemy.orm import relationship\n'), ((818, 827), 'sqlalchemy.dialects.mysql.INTEGER', 'INTEGER', ([], {}), '()\n', (825, 827), False, 'from sqlalchemy.dial... |
"""Test for models module."""
from urllib.parse import urlparse, parse_qs
import os
from PIL import Image
import pytest
import vcr
from gbooru_images_download import models
@pytest.fixture()
def tmp_pic(tmpdir):
"""Temporary pic."""
img_input = tmpdir.join("test.jpg")
img = Image.new('RGB', (500, 500), ... | [
"pytest.fixture",
"PIL.Image.new"
] | [((178, 194), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (192, 194), False, 'import pytest\n'), ((291, 326), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(500, 500)', '"""red"""'], {}), "('RGB', (500, 500), 'red')\n", (300, 326), False, 'from PIL import Image\n')] |
"""
This file gives you super powers in game!
They can be activated by:
- right clicking a block with a sword
- shooting an arrow
- typing specific messages into chat
"""
# These two lines are because of the folder the demos are located in, and aren't normally necessary
import os.path, sys
sys.path.append(os.path.jo... | [
"mcpi.minecraft.Minecraft.create",
"time.sleep"
] | [((492, 553), 'mcpi.minecraft.Minecraft.create', 'minecraft.Minecraft.create', ([], {'address': '"""127.0.0.1"""', 'name': '"""steve"""'}), "(address='127.0.0.1', name='steve')\n", (518, 553), True, 'import mcpi.minecraft as minecraft\n'), ((2348, 2363), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (2358, 23... |
# Databricks notebook source
from weather import temp
# COMMAND ----------
Temp = temp.Temperature(spark=spark, low_path="/databricks-datasets/weather/low_temps", high_path="/databricks-datasets/weather/high_temps")
# COMMAND ----------
try:
Temp.joint_df
except AttributeError:
print("Run .join() method to crea... | [
"weather.temp.Temperature"
] | [((84, 227), 'weather.temp.Temperature', 'temp.Temperature', ([], {'spark': 'spark', 'low_path': '"""/databricks-datasets/weather/low_temps"""', 'high_path': '"""/databricks-datasets/weather/high_temps"""'}), "(spark=spark, low_path=\n '/databricks-datasets/weather/low_temps', high_path=\n '/databricks-datasets/w... |
# Generated by Django 3.0.2 on 2020-01-19 02:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('movies', '0002_myfavoritemovies'),
]
operations = [
migrations.RenameField(
model_name='myfavoritemovies',
old_name='idMovie... | [
"django.db.migrations.RenameField"
] | [((224, 319), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""myfavoritemovies"""', 'old_name': '"""idMovie"""', 'new_name': '"""movie"""'}), "(model_name='myfavoritemovies', old_name='idMovie',\n new_name='movie')\n", (246, 319), False, 'from django.db import migrations\n')] |
"""
System - Bot management commands
Dependancies: Auth
"""
from enum import Enum
from glob import glob
import asyncio, os
from typing import Optional
import disnake
from disnake.ext import commands
class Actions(int, Enum):
""" Actions that can be performed on an option """
list = 0
load = 1
unload = 2
... | [
"os.path.join",
"disnake.ext.commands.cooldown",
"disnake.ext.commands.slash_command"
] | [((845, 869), 'disnake.ext.commands.slash_command', 'commands.slash_command', ([], {}), '()\n', (867, 869), False, 'from disnake.ext import commands\n'), ((5274, 5298), 'disnake.ext.commands.slash_command', 'commands.slash_command', ([], {}), '()\n', (5296, 5298), False, 'from disnake.ext import commands\n'), ((5302, 5... |
import torch
import torch.nn as nn
from torch import Tensor
"""
An implementation of CoordBDVAE that combines a Spatial Broadcast Decoder VAE with Coordinate Convolutional Layers.
Original author: <NAME>
Heavily modified by <NAME>
"""
class CoordConv(nn.Module):
"""
A Coordinate Convolutional Layer that use... | [
"torch.nn.ReLU",
"torch.nn.Flatten",
"torch.exp",
"torch.nn.Conv2d",
"torch.randn_like",
"torch.meshgrid",
"torch.nn.Linear",
"torch.linspace"
] | [((975, 1060), 'torch.nn.Conv2d', 'nn.Conv2d', (['(in_channels + 2)', 'out_channels', 'kernel_size', 'stride', 'padding'], {}), '(in_channels + 2, out_channels, kernel_size, stride, padding, **kwargs\n )\n', (984, 1060), True, 'import torch.nn as nn\n'), ((2116, 2144), 'torch.linspace', 'torch.linspace', (['(-1)', '... |
from pyml.base import BaseLearner, Transformer
from pyml.maths import covariance, eigen, mean, dot_product, transpose, subtract, add
class PCA(BaseLearner, Transformer):
"""
Principal component analysis
"""
def __init__(self, n_components=0.95, tolerance=1.0e-9, max_iterations=1000):
BaseLe... | [
"pyml.maths.transpose",
"pyml.maths.covariance",
"pyml.maths.subtract",
"pyml.maths.mean",
"pyml.base.BaseLearner.__init__",
"pyml.base.Transformer.__init__",
"pyml.maths.eigen"
] | [((314, 340), 'pyml.base.BaseLearner.__init__', 'BaseLearner.__init__', (['self'], {}), '(self)\n', (334, 340), False, 'from pyml.base import BaseLearner, Transformer\n'), ((349, 375), 'pyml.base.Transformer.__init__', 'Transformer.__init__', (['self'], {}), '(self)\n', (369, 375), False, 'from pyml.base import BaseLea... |
from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "NISTSchema-SV-IV-list-time-pattern-5-NS"
@dataclass
class NistschemaSvIvListTimePattern5:
class Meta:
name = "NISTSchema-SV-IV-list-time-pattern-5"
namespace = "NISTSchema-SV-IV-list-time-pattern-5-NS"
value: L... | [
"dataclasses.field"
] | [((331, 483), 'dataclasses.field', 'field', ([], {'default_factory': 'list', 'metadata': "{'pattern':\n '\\\\d2:\\\\d8:3\\\\d 1\\\\d:\\\\d7:\\\\d5 1\\\\d:\\\\d4:0\\\\d \\\\d3:\\\\d9:4\\\\d \\\\d4:4\\\\d:3\\\\d'\n , 'tokens': True}"}), "(default_factory=list, metadata={'pattern':\n '\\\\d2:\\\\d8:3\\\\d 1\\\\d:... |
from datetime import datetime
class Snowflake:
def __init__(self, id: str) -> None:
self.id = id
binary = format(int(id), '064b')
unix_s = (int(binary[:42], 2) + 1420070400000) / 1000
self.timestamp = datetime.fromtimestamp(unix_s)
def __str__(self) -> str:
return self.id
def __int__(self) -> int:
r... | [
"datetime.datetime.fromtimestamp"
] | [((213, 243), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['unix_s'], {}), '(unix_s)\n', (235, 243), False, 'from datetime import datetime\n')] |
import argparse
import os
import sys
from sklearn.datasets import load_boston
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
sys.path.append(os.getcwd())
from automlToolkit.utils.data_manager import DataManager
from automlToolkit.estimators import Regressor
parser... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_boston",
"os.getcwd",
"sklearn.metrics.mean_squared_error",
"automlToolkit.estimators.Regressor",
"automlToolkit.utils.data_manager.DataManager"
] | [((323, 348), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (346, 348), False, 'import argparse\n'), ((992, 1005), 'sklearn.datasets.load_boston', 'load_boston', ([], {}), '()\n', (1003, 1005), False, 'from sklearn.datasets import load_boston\n'), ((1075, 1129), 'sklearn.model_selection.train_... |
from unittest import TestCase
from grab.spider import Spider, Task, Data
from .tornado_util import SERVER
from .mixin.spider_queue import SpiderQueueMixin
class BasicSpiderTestCase(TestCase, SpiderQueueMixin):
def setUp(self):
SERVER.reset()
def setup_queue(self, bot):
bot.setup_queue(backend... | [
"grab.spider.Task"
] | [((661, 701), 'grab.spider.Task', 'Task', (['"""page"""'], {'url': 'SERVER.BASE_URL', 'num': '(1)'}), "('page', url=SERVER.BASE_URL, num=1)\n", (665, 701), False, 'from grab.spider import Spider, Task, Data\n'), ((724, 775), 'grab.spider.Task', 'Task', (['"""page"""'], {'url': 'SERVER.BASE_URL', 'delay': '(1.5)', 'num'... |
"""Makes event-attribution schematics for 2019 tornado-prediction paper."""
import numpy
import pandas
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as pyplot
from descartes import PolygonPatch
from gewittergefahr.gg_utils import storm_tracking_utils as tracking_utils
from gewittergefahr.gg_utils im... | [
"numpy.sqrt",
"numpy.array",
"numpy.mean",
"numpy.where",
"pandas.DataFrame.from_dict",
"numpy.max",
"matplotlib.pyplot.close",
"gewittergefahr.plotting.imagemagick_utils.concatenate_images",
"numpy.min",
"gewittergefahr.gg_utils.polygons.vertex_arrays_to_polygon_object",
"numpy.round",
"matpl... | [((122, 143), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (136, 143), False, 'import matplotlib\n'), ((875, 919), 'numpy.array', 'numpy.array', (['[-1, 1, 1, -1, -1]'], {'dtype': 'float'}), '([-1, 1, 1, -1, -1], dtype=float)\n', (886, 919), False, 'import numpy\n'), ((1038, 1102), 'numpy.array... |
from sklearn.neighbors import KernelDensity
from scipy import signal
import networkx as nx
import numpy as np
def ClusterPeak(List,sd):
sd = max(10,sd)
x=np.array(sorted(List))
y=[[i] for i in x]
kde = KernelDensity(kernel='gaussian', bandwidth=min(sd/2,100)).fit(y)
log_density = kde.score_samples(y)
... | [
"numpy.median",
"networkx.connected_component_subgraphs",
"numpy.linalg.pinv",
"numpy.ones",
"numpy.delete",
"networkx.Graph",
"numpy.exp",
"numpy.array",
"numpy.dot",
"scipy.signal.find_peaks",
"numpy.percentile"
] | [((334, 353), 'numpy.exp', 'np.exp', (['log_density'], {}), '(log_density)\n', (340, 353), True, 'import numpy as np\n'), ((369, 411), 'scipy.signal.find_peaks', 'signal.find_peaks', (['est_density'], {'distance': '(3)'}), '(est_density, distance=3)\n', (386, 411), False, 'from scipy import signal\n'), ((1692, 1702), '... |
# Copyright 2021 Quantapix Authors. 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 l... | [
"logging.getLogger",
"torch.mean",
"functools.partial",
"datasets.load_dataset",
"torch.no_grad",
"torch.cat"
] | [((1031, 1058), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1048, 1058), False, 'import logging\n'), ((4872, 4884), 'torch.cat', 'torch.cat', (['y'], {}), '(y)\n', (4881, 4884), False, 'import torch\n'), ((1283, 1331), 'datasets.load_dataset', 'load_dataset', (['ps.dataset_name', 'ps.... |
from dateutil import parser as date_parser
from lxml import etree, objectify
from operator import itemgetter
from terms import Term
class Notice:
def __init__(self, filename=None, notice_type='regulation'):
self.filename = filename
self.terms = []
self.modified = False
self.effe... | [
"lxml.etree.Element",
"dateutil.parser.parse",
"terms.Term",
"lxml.etree.XMLParser",
"lxml.etree.fromstring",
"lxml.etree.QName",
"lxml.etree.tostring"
] | [((1523, 1708), 'lxml.etree.Element', 'etree.Element', (['notice_type'], {'nsmap': "{None: 'eregs', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',\n 'schemaLocation': 'http://cfpb.github.io/regulations-schema/src/eregs.xsd'}"}), "(notice_type, nsmap={None: 'eregs', 'xsi':\n 'http://www.w3.org/2001/XMLSchema-... |
import pandas as pd
# load data
exprs = pd.read_table(snakemake.input[0], index_col=[0, 1])["expr_map"].unstack(0).fillna(0)
exprs.to_csv(snakemake.output[0], sep="\t")
| [
"pandas.read_table"
] | [((41, 92), 'pandas.read_table', 'pd.read_table', (['snakemake.input[0]'], {'index_col': '[0, 1]'}), '(snakemake.input[0], index_col=[0, 1])\n', (54, 92), True, 'import pandas as pd\n')] |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 20 15:37:43 2016
@author: rmatam
"""
import pandas as pd
#import matplotlib as mpb
train=pd.read_csv('E:\\DataScience\\kaggle\\titanic\\Data\\train.csv')
print(train)
print(train[1:3])
| [
"pandas.read_csv"
] | [((147, 211), 'pandas.read_csv', 'pd.read_csv', (['"""E:\\\\DataScience\\\\kaggle\\\\titanic\\\\Data\\\\train.csv"""'], {}), "('E:\\\\DataScience\\\\kaggle\\\\titanic\\\\Data\\\\train.csv')\n", (158, 211), True, 'import pandas as pd\n')] |
import numpy as np
X = np.array(([2, 9], [1, 5], [3, 6]), dtype=float)
y = np.array(([92], [86], [89]), dtype=float)
X = X/np.amax(X,axis=0) # maximum of X array longitudinally
y = y/100
#Sigmoid Function
def sigmoid (x):
return 1/(1 + np.exp(-x))
#Derivative of Sigmoid Function
def derivatives_sigmoid(x)... | [
"numpy.exp",
"numpy.array",
"numpy.dot",
"numpy.random.uniform",
"numpy.amax"
] | [((24, 71), 'numpy.array', 'np.array', (['([2, 9], [1, 5], [3, 6])'], {'dtype': 'float'}), '(([2, 9], [1, 5], [3, 6]), dtype=float)\n', (32, 71), True, 'import numpy as np\n'), ((77, 118), 'numpy.array', 'np.array', (['([92], [86], [89])'], {'dtype': 'float'}), '(([92], [86], [89]), dtype=float)\n', (85, 118), True, 'i... |
import os
import os.path
import sys
import random
import json
import tempfile
import shutil
from twisted.internet import reactor, defer
from twisted.trial import unittest
pd = os.path.dirname
this_dir = pd(os.path.abspath(__file__))
sys.path.append( pd(this_dir) )
sys.path.append( os.path.join(pd(this_dir), 'exampl... | [
"zpax.network.test_node.setup",
"zpax.durable.MemoryOnlyStateStore",
"os.path.abspath",
"zpax.network.test_node.NetworkNode",
"twisted.internet.defer.Deferred"
] | [((209, 234), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (224, 234), False, 'import os\n'), ((560, 576), 'twisted.internet.defer.Deferred', 'defer.Deferred', ([], {}), '()\n', (574, 576), False, 'from twisted.internet import reactor, defer\n'), ((798, 828), 'zpax.network.test_node.Network... |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
from flask import Blueprint
from ggrc import settings
from ggrc.app import app
blueprint = Blueprint(
'gdrive',... | [
"ggrc.models.Document.late_init_fileable",
"ggrc.models.PopulationSampleResponse.late_init_folderable",
"ggrc.models.Meeting.late_init_eventable",
"ggrc.models.Program.late_init_folderable",
"ggrc.models.DocumentationResponse.late_init_folderable",
"ggrc.models.Audit.late_init_folderable",
"ggrc.service... | [((298, 436), 'flask.Blueprint', 'Blueprint', (['"""gdrive"""', '__name__'], {'template_folder': '"""templates"""', 'static_folder': '"""static"""', 'static_url_path': '"""/static/ggrc_gdrive_integration"""'}), "('gdrive', __name__, template_folder='templates', static_folder=\n 'static', static_url_path='/static/ggr... |
# Part 1: 562
# Part 2: 1076922
from copy import deepcopy
# from math import e
from collections import deque
from collections import Counter
from math import prod
class Name:
def __init__(self, path):
with open(path, "r") as f:
self.data = []
for line in f:
line = l... | [
"math.prod"
] | [((2156, 2175), 'math.prod', 'prod', (['ans[-1:-4:-1]'], {}), '(ans[-1:-4:-1])\n', (2160, 2175), False, 'from math import prod\n')] |
import os
import requests
import json
import time
from pathlib import Path
from datetime import datetime
from common import constants
BASE_DIR = Path(__file__).resolve(strict=True).parent
FILE_PATH = os.path.join(BASE_DIR, 'commitee_report_detail_urls.json')
def url(path):
return (
'https://www.govinfo.go... | [
"datetime.datetime.today",
"json.loads",
"os.path.join",
"pathlib.Path"
] | [((201, 259), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""commitee_report_detail_urls.json"""'], {}), "(BASE_DIR, 'commitee_report_detail_urls.json')\n", (213, 259), False, 'import os\n'), ((488, 513), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (498, 513), False, 'import json\n'), (... |
# -*- coding: utf-8 -*-
"""
coolmagic.utils
~~~~~~~~~~~~~~~
This module contains the subclasses of the base request and response
objects provided by werkzeug. The subclasses know about their charset
and implement some additional functionallity like the ability to link
to view functions.
:c... | [
"os.path.dirname",
"werkzeug.wrappers.BaseRequest.__init__",
"werkzeug.local.LocalManager",
"werkzeug.local.Local"
] | [((663, 670), 'werkzeug.local.Local', 'Local', ([], {}), '()\n', (668, 670), False, 'from werkzeug.local import Local\n'), ((687, 708), 'werkzeug.local.LocalManager', 'LocalManager', (['[local]'], {}), '([local])\n', (699, 708), False, 'from werkzeug.local import LocalManager\n'), ((1855, 1890), 'werkzeug.wrappers.Base... |
import torch
import sys
import os
import numpy as np
from abc import ABC
from transformers import BertTokenizer
import transformers
from typing import List
sys.path.append(os.path.join('..', 'stel'))
from set_for_global import set_global_seed, set_torch_device, set_logging, EVAL_BATCH_SIZE
BERT_MAX_WORDS = 250
# OPT... | [
"transformers.RobertaTokenizer.from_pretrained",
"numpy.array",
"torch.nn.functional.softmax",
"transformers.BertForNextSentencePrediction.from_pretrained",
"transformers.BertModel.from_pretrained",
"set_for_global.set_global_seed",
"set_for_global.set_torch_device",
"transformers.PreTrainedModel.from... | [((447, 460), 'set_for_global.set_logging', 'set_logging', ([], {}), '()\n', (458, 460), False, 'from set_for_global import set_global_seed, set_torch_device, set_logging, EVAL_BATCH_SIZE\n'), ((461, 502), 'transformers.logging.set_verbosity_info', 'transformers.logging.set_verbosity_info', ([], {}), '()\n', (500, 502)... |
import pytest
import warnings
warnings.filterwarnings('ignore')
@pytest.mark.basic
def test_resize_ratio():
"""
Testing the resize_ratio function
Returns: Nothing
"""
import numpy as np
from deep_utils import resize_ratio
dummy_images = [np.random.randint(0, 255, (1200, 900, 3), dtype=np.... | [
"numpy.random.randint",
"deep_utils.resize_ratio",
"warnings.filterwarnings"
] | [((31, 64), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (54, 64), False, 'import warnings\n'), ((269, 326), 'numpy.random.randint', 'np.random.randint', (['(0)', '(255)', '(1200, 900, 3)'], {'dtype': 'np.uint8'}), '(0, 255, (1200, 900, 3), dtype=np.uint8)\n', (286, 326)... |
# coding: utf-8
import sys
import argparse
import collections
class Manager(object):
def __init__(self, settings):
self.settings = settings
self.commands = {}
self._parser = argparse.ArgumentParser()
self._commands_parser = self._parser.add_subparsers(dest="command", help="comma... | [
"argparse.ArgumentParser"
] | [((207, 232), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (230, 232), False, 'import argparse\n')] |
from pgmpy.estimators import BayesianEstimator, MaximumLikelihoodEstimator
from pgmpy.models import BayesianModel
default_list = [
('cluster_rt-37', 'cluster_rt'),
('cluster_rt-5', 'cluster_rt'),
('cluster_rt-1', 'cluster_rt')]
def train_model(df, lst_relations: list=default_list) -> BayesianModel:
mo... | [
"pgmpy.models.BayesianModel"
] | [((326, 354), 'pgmpy.models.BayesianModel', 'BayesianModel', (['lst_relations'], {}), '(lst_relations)\n', (339, 354), False, 'from pgmpy.models import BayesianModel\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Command line args with argparse.
See:
- https://realpython.com/command-line-interfaces-python-argparse/
- https://docs.python.org/3/library/argparse.html
Usage:
python3 try-argparse.py
"""
import argparse
def init_argparse() -> argparse.ArgumentParser:
"""Cr... | [
"argparse.ArgumentParser"
] | [((408, 495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Does something with command line arguments."""'}), "(description=\n 'Does something with command line arguments.')\n", (431, 495), False, 'import argparse\n')] |
import os
import logging
import posixpath
import stat
from django.utils.http import urlquote
from seaserv import seafile_api
from seahub.base.models import UserStarredFiles
from seahub.base.templatetags.seahub_tags import email2nickname, email2contact_email
from seahub.settings import ENABLE_VIDEO_THUMBNAIL, THUMBNAI... | [
"logging.getLogger",
"seahub.base.models.UserStarredFiles.objects.filter",
"seahub.utils.repo.is_group_repo_staff",
"posixpath.join",
"django.utils.http.urlquote",
"seaserv.seafile_api.get_dir_id_by_path",
"seaserv.seafile_api.list_dir_by_path",
"os.path.exists",
"stat.S_ISDIR",
"seahub.thumbnail.... | [((657, 684), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (674, 684), False, 'import logging\n'), ((1133, 1174), 'seahub.utils.repo.is_repo_owner', 'is_repo_owner', (['request', 'repo_id', 'username'], {}), '(request, repo_id, username)\n', (1146, 1174), False, 'from seahub.utils.repo ... |
'''
Refer to AdderNet code.
Efficient CUDA implementation for AdderNet training.
'''
import torch
import torch.nn as nn
# import adder_cuda
import numpy as np
from torch.autograd import Function
from .quantize import quantize, quantize_grad, QuantMeasure, calculate_qparams
import deepshift.ste as ste
from torch.utils.... | [
"torch.unique",
"torch.abs",
"torch.floor",
"torch.sign",
"torch.utils.cpp_extension.load",
"torch.log2",
"torch.norm",
"torch.round",
"torch.zeros",
"torch.zeros_like",
"torch.randn",
"torch.clamp"
] | [((359, 451), 'torch.utils.cpp_extension.load', 'load', (['"""adder_cuda"""', "['adder/adder_cuda.cpp', 'adder/adder_cuda_kernel.cu']"], {'verbose': '(True)'}), "('adder_cuda', ['adder/adder_cuda.cpp', 'adder/adder_cuda_kernel.cu'],\n verbose=True)\n", (363, 451), False, 'from torch.utils.cpp_extension import load\n... |
from fastapi.requests import Request
from semantic_version import Version
from fastapi_versioned import VersionRouter
version = VersionRouter(Version("0.0.2"))
@version.router.get("/test2")
def route(request: Request):
return {"version": str(request.app.version)}
| [
"semantic_version.Version"
] | [((144, 160), 'semantic_version.Version', 'Version', (['"""0.0.2"""'], {}), "('0.0.2')\n", (151, 160), False, 'from semantic_version import Version\n')] |
import discord
import io, base64
import json
@bot.command()
async def removebg(ctx, text):
response = requests.post(
'https://api.remove.bg/v1.0/removebg',
data = {
'image_url': (text),
'size': 'auto'
},
headers = { 'X-Api-Key': "your-api-key" , 'Accept': 'ap... | [
"json.loads",
"discord.Embed",
"base64.b64decode"
] | [((410, 435), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (420, 435), False, 'import json\n'), ((672, 800), 'discord.Embed', 'discord.Embed', ([], {'title': '"""Erreur inconnue"""', 'description': 'f"""Erreur console {response.status_code, response.text}"""', 'color': '(16711680)'}), "(tit... |
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Add, Subtract, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import RMSprop
import tensorflow.keras.backend as K
c = tf.constant(['a', 'b'])
e = tf.math.erf([1.0, -0.5, 3.4, -2.1, 0.0, -6.5])
input = tf.keras... | [
"tensorflow.math.erf",
"tensorflow.keras.layers.Input",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Dense",
"tensorflow.constant",
"tensorflow.keras.layers.Subtract",
"tensorflow.keras.Input",
"tensorflow... | [((228, 251), 'tensorflow.constant', 'tf.constant', (["['a', 'b']"], {}), "(['a', 'b'])\n", (239, 251), True, 'import tensorflow as tf\n'), ((257, 303), 'tensorflow.math.erf', 'tf.math.erf', (['[1.0, -0.5, 3.4, -2.1, 0.0, -6.5]'], {}), '([1.0, -0.5, 3.4, -2.1, 0.0, -6.5])\n', (268, 303), True, 'import tensorflow as tf\... |
import string
def calculate_gc(x):
"""Calculates the GC content of DNA sequence x.
x: a string composed only of A's, T's, G's, and C's."""
if x == '':
return 1
x = x.upper()
gc = float(string.count(x, "G") +string.count(x, "C")) / len(x)
return gc
| [
"string.count"
] | [((214, 234), 'string.count', 'string.count', (['x', '"""G"""'], {}), "(x, 'G')\n", (226, 234), False, 'import string\n'), ((236, 256), 'string.count', 'string.count', (['x', '"""C"""'], {}), "(x, 'C')\n", (248, 256), False, 'import string\n')] |
# The first step os to follow <NAME>'s lead [here](https://github.com/TEAMSchools/sync_deanslist).
#
# However, we will combine this into one file rather than a module and a scipt file since we will be using Airflow, it will be easier to maintain in a single file.
#
# The first chunk comes from the config file. You'll ... | [
"datetime.datetime",
"airflow.models.Variable.get",
"deanslist_api.dl.get_endpoint",
"airflow.operators.dummy_operator.DummyOperator",
"airflow.operators.python_operator.PythonOperator",
"airflow.contrib.operators.file_to_gcs.FileToGoogleCloudStorageOperator",
"ast.literal_eval",
"airflow.DAG",
"dat... | [((1181, 1196), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (1191, 1196), False, 'from os.path import expanduser\n'), ((1347, 1374), 'airflow.models.Variable.get', 'Variable.get', (['"""dl_api_keys"""'], {}), "('dl_api_keys')\n", (1359, 1374), False, 'from airflow.models import Variable\n'), ((138... |
"""
Inner module for enumerations and base types.
"""
import logging
from onirim import util
LOGGER = logging.getLogger(__name__)
class Color(util.AutoNumberEnum):
"""
Enumerated colors of cards.
Attributes:
red
blue
green
yellow
"""
red = ()
blue = ()
... | [
"logging.getLogger"
] | [((106, 133), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (123, 133), False, 'import logging\n')] |
import os
import numpy as np
from azureml.monitoring import ModelDataCollector
from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType
from inference_schema.schema_decorators import input_schema, output_schema
# sklearn.externals.joblib is removed in 0.23
from sklearn import __version__ as... | [
"os.getenv",
"azureml.monitoring.ModelDataCollector",
"inference_schema.parameter_types.numpy_parameter_type.NumpyParameterType",
"numpy.array",
"packaging.version.Version",
"joblib.load"
] | [((1350, 1383), 'numpy.array', 'np.array', (['[[30, -85, 21, 150, 6]]'], {}), '([[30, -85, 21, 150, 6]])\n', (1358, 1383), True, 'import numpy as np\n'), ((1400, 1417), 'numpy.array', 'np.array', (['[8.995]'], {}), '([8.995])\n', (1408, 1417), True, 'import numpy as np\n'), ((373, 392), 'packaging.version.Version', 'Ve... |
# -*- coding: utf-8 -*-
import logging
import logging.handlers
import os
def init_logger(parent_path='/intellif/log/', sub_path='',module_name=''):
print('init_logger')
"""
usage: output to logfile and console simultaneous
"""
path = parent_path + sub_path
if not os.path.exists(path):
... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"os.makedirs",
"logging.Formatter",
"logging.handlers.TimedRotatingFileHandler",
"logging.info"
] | [((498, 528), 'logging.getLogger', 'logging.getLogger', (['module_name'], {}), '(module_name)\n', (515, 528), False, 'import logging\n'), ((2390, 2409), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (2407, 2409), False, 'import logging\n'), ((2515, 2538), 'logging.StreamHandler', 'logging.StreamHandler', ... |
import json
import logging
import os
from random import Random
from typing import Dict, Optional, Iterable, List
import srsly
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import TextField, MetadataField
from allennlp.data.instance import Instance
from allennlp.data.t... | [
"logging.getLogger",
"src.preprocessing.preprocess.add_schema_description",
"src.data_classes.data_classes.AnnotatedSQL",
"src.ext_services.jsql_parser.JSQLParser.create",
"allennlp.data.token_indexers.SingleIdTokenIndexer",
"src.preprocessing.sql_utils.preprocess_for_jsql",
"random.Random",
"allennlp... | [((800, 827), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (817, 827), False, 'import logging\n'), ((897, 931), 'allennlp.data.dataset_readers.dataset_reader.DatasetReader.register', 'DatasetReader.register', (['"""text2sql"""'], {}), "('text2sql')\n", (919, 931), False, 'from allennlp.... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-04-11 10:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tasks', '0003_auto_20200330_1225'),
]
operations ... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.migrations.AlterModelOptions",
"django.db.models.AutoField",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((1273, 1417), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""source"""', 'options': "{'ordering': ('name',), 'verbose_name': 'источник', 'verbose_name_plural':\n 'источники'}"}), "(name='source', options={'ordering': ('name',),\n 'verbose_name': 'источник', 'verbose_... |
from collections import OrderedDict, deque
from rlkit.core.eval_util import create_stats_ordered_dict
from rlkit.samplers.data_collector.base import PathCollector
from rlkit.torch.model_based.dreamer.rollout_functions import vec_rollout
class VecMdpPathCollector(PathCollector):
def __init__(
self,
... | [
"rlkit.core.eval_util.create_stats_ordered_dict",
"collections.OrderedDict",
"collections.deque"
] | [((772, 817), 'collections.deque', 'deque', ([], {'maxlen': 'self._max_num_epoch_paths_saved'}), '(maxlen=self._max_num_epoch_paths_saved)\n', (777, 817), False, 'from collections import OrderedDict, deque\n'), ((2984, 3029), 'collections.deque', 'deque', ([], {'maxlen': 'self._max_num_epoch_paths_saved'}), '(maxlen=se... |
# Generated by Django 3.0.7 on 2020-09-22 15:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_auto_20200922_1553'),
]
operations = [
migrations.RenameModel(
old_name='Applications',
new_name='Application',... | [
"django.db.migrations.RenameModel"
] | [((224, 295), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Applications"""', 'new_name': '"""Application"""'}), "(old_name='Applications', new_name='Application')\n", (246, 295), False, 'from django.db import migrations\n')] |
# Copyright 2017 CBSD Project Authors. 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 applic... | [
"controllers.CLIUtils.Step.Step",
"csv.DictReader",
"pathlib.Path"
] | [((1137, 1160), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (1151, 1160), False, 'import csv\n'), ((2197, 2220), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (2211, 2220), False, 'import csv\n'), ((1676, 1694), 'pathlib.Path', 'Path', (['pathExpected'], {}), '(pathExpe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# 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/LICENS... | [
"distutils.version.LooseVersion",
"itertools.count",
"cgi.escape",
"itertools.groupby"
] | [((42398, 42413), 'itertools.groupby', 'groupby', (['lev', 'f'], {}), '(lev, f)\n', (42405, 42413), False, 'from itertools import groupby\n'), ((45084, 45102), 'itertools.count', 'itertools.count', (['(1)'], {}), '(1)\n', (45099, 45102), False, 'import itertools\n'), ((45355, 45373), 'itertools.count', 'itertools.count... |
from datetime import timedelta
import airflow
from airflow import DAG
from airflow.sensors.s3_prefix_sensor import S3PrefixSensor
from airflow.contrib.operators.emr_create_job_flow_operator import EmrCreateJobFlowOperator
from airflow.contrib.operators.emr_add_steps_operator import EmrAddStepsOperator
from ... | [
"airflow.contrib.operators.emr_terminate_job_flow_operator.EmrTerminateJobFlowOperator",
"airflow.contrib.operators.emr_add_steps_operator.EmrAddStepsOperator",
"airflow.contrib.operators.emr_create_job_flow_operator.EmrCreateJobFlowOperator",
"airflow.contrib.sensors.emr_step_sensor.EmrStepSensor",
"awsair... | [((1295, 1397), 'airflow.sensors.s3_prefix_sensor.S3PrefixSensor', 'S3PrefixSensor', ([], {'task_id': '"""s3_sensor"""', 'bucket_name': 'S3_BUCKET_NAME', 'prefix': '"""data/raw/green"""', 'dag': 'dag'}), "(task_id='s3_sensor', bucket_name=S3_BUCKET_NAME, prefix=\n 'data/raw/green', dag=dag)\n", (1309, 1397), False, ... |
#!/usr/bin/env python3
########################################################################
# File: compareSampleSets.py
# executable:
# Purpose:
#
#
# Author: <NAME>
# History: cms 01/08/2020 Created
#
########################################################################
###################... | [
"numpy.mean",
"argparse.ArgumentParser",
"statsmodels.stats.multitest.multipletests",
"numpy.isin",
"numpy.isnan",
"scipy.stats.ranksums",
"sys.exit",
"numpy.load"
] | [((1455, 1669), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""TBD"""', 'epilog': '"""Please feel free to forward any usage questions or concerns"""', 'add_help': '(True)', 'prefix_chars': '"""-"""', 'usage': '"""%(prog)s -m1 manifest1.txt -m2 manifest2.txt"""'}), "(description='TBD', ep... |
texts = []
#texts = ["\ue00cPlay 2 Games to Get Registered\ue00c", "Only Top 5 Players of this server can only use custom Tag\n Create a profile with '/tag<space>' as prefix\n Ex : '/tag MyCustomTag'", "\ue046DO NOT ASK FOR ADMINSHIP\ue046", "Visit eoni.ml website or join Discord @ \nhttp://discord.io/EoniOfficial \ngr... | [
"ba.newnode",
"ba.Material",
"ba.getactivity",
"ba.animate",
"ba.timer",
"ba.getsession",
"ba.getmodel",
"ba.gettexture",
"ba.Lstr",
"ba.getcollidemodel",
"bastd.gameutils.SharedObjects.get"
] | [((3546, 3559), 'ba.Material', 'ba.Material', ([], {}), '()\n', (3557, 3559), False, 'import ba, _ba, random, mysettings\n'), ((3769, 3788), 'bastd.gameutils.SharedObjects.get', 'SharedObjects.get', ([], {}), '()\n', (3786, 3788), False, 'from bastd.gameutils import SharedObjects\n'), ((3809, 4075), 'ba.newnode', 'ba.n... |
"""Peformance measure convenience utils.
"""
__author__ = '<NAME>'
import logging
import inspect
import time as tm
from functools import wraps
import errno
import os
import signal
time_logger = logging.getLogger(__name__)
class time(object):
"""Used in a ``with`` scope that executes the body and logs the elaps... | [
"logging.getLogger",
"signal.signal",
"inspect.currentframe",
"functools.wraps",
"signal.alarm",
"time.time",
"os.strerror"
] | [((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((2258, 2282), 'os.strerror', 'os.strerror', (['errno.ETIME'], {}), '(errno.ETIME)\n', (2269, 2282), False, 'import os\n'), ((1389, 1411), 'inspect.currentframe', 'inspect.currentframe', (... |
# coding: utf-8
"""
Telegram notifications.
"""
__all__ = ["notify_telegram"]
import threading
import logging
import six
from law.config import Config
logger = logging.getLogger(__name__)
def notify_telegram(title, content, token=None, chat=None, mention_user=None, **kwargs):
"""
Sends a telegram not... | [
"logging.getLogger",
"traceback.format_exc",
"law.config.Config.instance",
"os.path.expandvars",
"telegram.Bot",
"os.path.isfile",
"threading.Thread"
] | [((169, 196), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (186, 196), False, 'import logging\n'), ((537, 554), 'law.config.Config.instance', 'Config.instance', ([], {}), '()\n', (552, 554), False, 'from law.config import Config\n'), ((1839, 1909), 'threading.Thread', 'threading.Thread'... |
from wagtail.core import blocks
class SectionBlock(blocks.StructBlock):
presentation_class = blocks.ChoiceBlock(choices=[
('is-default', 'Default'),
('is-invisible', 'No background/border'),
('is-bevel', 'Bevel'),
])
heading = blocks.CharBlock()
content = blocks.RichTextBlock()... | [
"wagtail.core.blocks.CharBlock",
"wagtail.core.blocks.RichTextBlock",
"wagtail.core.blocks.ChoiceBlock"
] | [((99, 223), 'wagtail.core.blocks.ChoiceBlock', 'blocks.ChoiceBlock', ([], {'choices': "[('is-default', 'Default'), ('is-invisible', 'No background/border'), (\n 'is-bevel', 'Bevel')]"}), "(choices=[('is-default', 'Default'), ('is-invisible',\n 'No background/border'), ('is-bevel', 'Bevel')])\n", (117, 223), Fals... |
import urllib.request,json
from . import create_app
import requests
def get_quotes():
response = requests.get('http://quotes.stormconsultancy.co.uk/random.json (Links to an external site.)')
if response.status_code == 200:
quote = response.json()
return quote
| [
"requests.get"
] | [((103, 206), 'requests.get', 'requests.get', (['"""http://quotes.stormconsultancy.co.uk/random.json (Links to an external site.)"""'], {}), "(\n 'http://quotes.stormconsultancy.co.uk/random.json (Links to an external site.)'\n )\n", (115, 206), False, 'import requests\n')] |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# 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 mus... | [
"pyrado.utils.data_types.RenderMode",
"torch.abs",
"pyrado.environment_wrappers.action_normalization.ActNormWrapper",
"pyrado.policies.recurrent.rnn.LSTMPolicy",
"pyrado.environments.rcspysim.ball_on_plate.BallOnPlate5DSim",
"pyrado.domain_randomization.utils.print_domain_params",
"rcsenv.setLogLevel",
... | [((2325, 2346), 'rcsenv.setLogLevel', 'rcsenv.setLogLevel', (['(4)'], {}), '(4)\n', (2343, 2346), False, 'import rcsenv\n'), ((2424, 2487), 'pyrado.environments.rcspysim.ball_on_plate.BallOnPlate5DSim', 'BallOnPlate5DSim', ([], {'physicsEngine': '"""Vortex"""', 'dt': 'dt', 'max_steps': '(2000)'}), "(physicsEngine='Vort... |
import logging
log = logging.getLogger(__name__)
import random
import ircbot.plugin
class Bitcoin:
currencies = (
'Razielcoins', 'bitcoins', 'cmd.exe resizes', 'scotweb extortions',
'warp-in staplers', 'dead Palestinian children', 'typematrix keyboards',
'marble eggs in a shitty condom', 'clean teeth', 'muta... | [
"logging.getLogger",
"random.choice",
"random.randint"
] | [((21, 48), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (38, 48), False, 'import logging\n'), ((1285, 1306), 'random.randint', 'random.randint', (['(0)', '(99)'], {}), '(0, 99)\n', (1299, 1306), False, 'import random\n'), ((1316, 1343), 'random.choice', 'random.choice', (["('AM', 'PM')... |
import glob
import os
header = """
# encoding: utf-8
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
#
# Generated from ../LaTeX.g4, derived from latex2sympy
# latex2sympy is licensed under the MIT license
# https://github.com/augustt198/latex2sympy/blob/master/LICENSE.txt
#
# Generated with antl... | [
"os.path.basename",
"os.path.join",
"os.unlink"
] | [((771, 786), 'os.unlink', 'os.unlink', (['path'], {}), '(path)\n', (780, 786), False, 'import os\n'), ((488, 524), 'os.path.join', 'os.path.join', (['output_dir', '"""LaTeX*.*"""'], {}), "(output_dir, 'LaTeX*.*')\n", (500, 524), False, 'import os\n'), ((543, 579), 'os.path.join', 'os.path.join', (['output_dir', '"""la... |
# -*- coding: utf-8 -*-
"""Console script for dfinder."""
from __future__ import print_function
import json
import sys
import click
from tabulate import tabulate
from .df_request import search_images
class SoftwareType(click.ParamType):
name = 'software_type'
def convert(self, value, param, ctx):
... | [
"click.Choice",
"click.prompt",
"json.dumps",
"click.echo",
"click.ClickException",
"click.command"
] | [((599, 614), 'click.command', 'click.command', ([], {}), '()\n', (612, 614), False, 'import click\n'), ((1411, 1423), 'click.echo', 'click.echo', ([], {}), '()\n', (1421, 1423), False, 'import click\n'), ((1638, 1655), 'click.echo', 'click.echo', (['table'], {}), '(table)\n', (1648, 1655), False, 'import click\n'), ((... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Neighborhood Profiler Script
<NAME>; Feb-April 2016
This script uses an mxd map template to query neighborhood information, places
that info into an HTML template, and finally kicks those HTML files out to PDF.
This script relies on up-to-date data that is managed man... | [
"sys.path.insert",
"pandas.read_csv",
"tkit.cli.GetError",
"arcpy.da.SearchCursor",
"time.sleep",
"sys.exit",
"pandas.read_excel",
"arcpy.SelectLayerByLocation_management",
"os.path.exists",
"os.listdir",
"arcpy.SelectLayerByAttribute_management",
"tkit.cli.StatusLine",
"jinja2.FileSystemLoa... | [((793, 870), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""\\\\\\\\cityfiles\\\\DEVServices\\\\WallyG\\\\Scripts\\\\conversion"""'], {}), "(0, '\\\\\\\\cityfiles\\\\DEVServices\\\\WallyG\\\\Scripts\\\\conversion')\n", (808, 870), False, 'import sys\n'), ((999, 1015), 'tkit.cli.StatusLine', 'cli.StatusLine', ([], ... |
"""Utility functions for dtoolcore."""
import os
import errno
import getpass
import hashlib
import json
import platform
import binascii
import base64
import datetime
import re
import socket
import logging
try:
from urlparse import urlparse, urlunparse
except ImportError:
from urllib.parse import urlparse, url... | [
"logging.getLogger",
"datetime.datetime",
"urllib.parse.urlparse",
"os.makedirs",
"json.dump",
"os.environ.get",
"base64.b64decode",
"os.chmod",
"os.path.isfile",
"os.path.dirname",
"platform.system",
"json.load",
"getpass.getuser",
"socket.gethostname",
"hashlib.sha1",
"os.path.abspat... | [((338, 365), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (355, 365), False, 'import logging\n'), ((466, 514), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.config/dtool/dtool.json"""'], {}), "('~/.config/dtool/dtool.json')\n", (484, 514), False, 'import os\n'), ((536, 572), 'os... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | [
"tensorflow.compat.v1.FixedLenFeature",
"tensorflow.compat.v1.to_int32",
"tensorflow.compat.v1.constant",
"absl.flags.DEFINE_string",
"tensorflow.compat.v1.gfile.Glob",
"tensorflow.compat.v1.data.TFRecordDataset",
"tensorflow.compat.v1.expand_dims"
] | [((1225, 1331), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""nq_short_pipeline_train_pattern"""', 'None', '"""Path to NQ short answer training data."""'], {}), "('nq_short_pipeline_train_pattern', None,\n 'Path to NQ short answer training data.')\n", (1244, 1331), False, 'from absl import flags\n'), ((13... |
import os, json
from os import path
# don't mind this
base = [
"IS_PROGRAM=0",
"UE_EDITOR=1",
"ENABLE_PGO_PROFILE=0",
"USE_VORBIS_FOR_STREAMING=1",
"USE_XMA2_FOR_STREAMING=1",
"WITH_DEV_AUTOMATION_TESTS=1",
"WITH_PERF_AUTOMATION_TESTS=1",
"UNICODE",
"_UNICODE",
"__UNREAL__",
... | [
"os.path.exists",
"os.listdir",
"json.dumps",
"os.path.join",
"os.getcwd",
"json.load"
] | [((10299, 10321), 'os.listdir', 'os.listdir', (['pluginpath'], {}), '(pluginpath)\n', (10309, 10321), False, 'import os, json\n'), ((11063, 11108), 'os.path.join', 'os.path.join', (['vscode', '"""c_cpp_properties.json"""'], {}), "(vscode, 'c_cpp_properties.json')\n", (11075, 11108), False, 'import os, json\n'), ((10260... |