code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from abc import abstractmethod
import types
import numpy as np
import os
from multiprocessing import Pool
import schwimmbad
# from schwimmbad import SerialPool, MultiPool, MPIPool
from argparse import ArgumentParser
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from corner impo... | [
"utils.make_dir",
"argparse.ArgumentParser",
"numpy.abs",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplot2grid",
"parameters.PARS_ORDER.items",
"matplotlib.pyplot.figure",
"numpy.mean",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"zeus.EnsembleSampler",
"numpy.random.randn",
"... | [((528, 544), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (542, 544), False, 'from argparse import ArgumentParser\n'), ((20159, 20195), 'os.path.join', 'os.path.join', (['utils.TEST_DIR', '"""mcmc"""'], {}), "(utils.TEST_DIR, 'mcmc')\n", (20171, 20195), False, 'import os\n'), ((20200, 20222), 'utils.... |
#!/usr/bin/python
# coding=UTF-8
'''
@Author: ysy
@Date: 2019-08-29 12:13:21
@LastEditTime: 2019-09-05 16:49:25
'''
from flask import make_response, jsonify
import json
status_code_em = {
20003: "用户名或密码不正确",
20004: "数据违法不能为空",
20005: "邀请码不正确",
30001: "域名信息已存在",
500: "错误"
}
def success_response(data... | [
"flask.jsonify",
"json.dumps"
] | [((604, 697), 'flask.jsonify', 'jsonify', (["{'status_code': status_code, 'message': status_code_em[status_code], 'data': {}\n }"], {}), "({'status_code': status_code, 'message': status_code_em[status_code],\n 'data': {}})\n", (611, 697), False, 'from flask import make_response, jsonify\n'), ((832, 891), 'flask.j... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 19.py
# 2016/10/11(火)
# walkingmask
# cut -f1 hightemp.txt | sort | uniq -c | sort -k1 -n -r
print('Hello, World!')
sorteds = []
for line in open('hightemp.txt', 'r'):
sorteds.append(line.split("\t")[0])
from collections import Counter
uniqs = Counter(sorteds)
p... | [
"collections.Counter"
] | [((301, 317), 'collections.Counter', 'Counter', (['sorteds'], {}), '(sorteds)\n', (308, 317), False, 'from collections import Counter\n')] |
"""
Aurora is using axelrod_aurora_test1 to reproduce Table 2 from the Axelrod paper.
"""
import sys
import dworp
import igraph
import logging
import numpy as np
import axelrod_aurora_test1
import pdb
import pickle as pkl
import time
# --- Constant Parameters ---
xdim = 10
ydim = 10
n_tsteps = 8000 # because we cycle... | [
"numpy.random.seed",
"axelrod_aurora_test1.AxelrodTerminator",
"logging.basicConfig",
"dworp.TwoStageSimulation",
"numpy.median",
"time.clock",
"axelrod_aurora_test1.AxelrodEnvironment",
"numpy.random.RandomState",
"numpy.random.randint",
"numpy.mean",
"pdb.set_trace",
"axelrod_aurora_test1.Ax... | [((516, 555), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.WARN'}), '(level=logging.WARN)\n', (535, 555), False, 'import logging\n'), ((793, 821), 'numpy.random.seed', 'np.random.seed', (['toplevelseed'], {}), '(toplevelseed)\n', (807, 821), True, 'import numpy as np\n'), ((1114, 1126), 'time.c... |
import rclpy
from rclpy.node import Node
from my_service.srv import Add
import random
class Client(Node):
def __init__(self):
super().__init__('client')
self.client = self.create_client(Add, 'add_floats')
self.request = Add.Request()
while not self.client.wait_for_service(timeout_se... | [
"rclpy.spin_once",
"my_service.srv.Add.Request",
"random.uniform",
"rclpy.init",
"rclpy.spin_until_future_complete",
"rclpy.shutdown",
"rclpy.ok"
] | [((898, 919), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (908, 919), False, 'import rclpy\n'), ((952, 962), 'rclpy.ok', 'rclpy.ok', ([], {}), '()\n', (960, 962), False, 'import rclpy\n'), ((1050, 1066), 'rclpy.shutdown', 'rclpy.shutdown', ([], {}), '()\n', (1064, 1066), False, 'import rclpy\n'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy import integrate
import sympy as sp
sp.init_printing(use_unicode=True)
def stopFunCombined(t, s, lst, events, out=[]):
""" Universal event detection function that handles multiple events.
Intended for scipy.integrate.ode solo... | [
"numpy.asarray",
"sympy.init_printing",
"math.fabs",
"scipy.integrate.ode"
] | [((114, 148), 'sympy.init_printing', 'sp.init_printing', ([], {'use_unicode': '(True)'}), '(use_unicode=True)\n', (130, 148), True, 'import sympy as sp\n'), ((6746, 6775), 'scipy.integrate.ode', 'integrate.ode', (['model.equation'], {}), '(model.equation)\n', (6759, 6775), False, 'from scipy import integrate\n'), ((747... |
import json
import logging
from collections import defaultdict
from collections.abc import Mapping
from aquarium.provenance import (
CollectionEntity,
ItemEntity,
ExternalFileEntity,
FileEntity,
JobActivity,
OperationActivity,
OperationItemPin,
OperationParameter,
PartEntity,
Pla... | [
"util.plate.coordinates_for",
"aquarium.provenance.PartEntity",
"aquarium.provenance.PlanActivity",
"collections.defaultdict",
"json.dumps",
"aquarium.trace.patch.create_patch_visitor",
"aquarium.provenance.ExternalFileEntity",
"aquarium.provenance.ProvenanceTrace",
"logging.error",
"logging.warni... | [((787, 831), 'aquarium.provenance.ProvenanceTrace', 'ProvenanceTrace', ([], {'experiment_id': 'experiment_id'}), '(experiment_id=experiment_id)\n', (802, 831), False, 'from aquarium.provenance import CollectionEntity, ItemEntity, ExternalFileEntity, FileEntity, JobActivity, OperationActivity, OperationItemPin, Operati... |
import json
class DependencyTrackLDAP(object):
def list_ldapgroups(self, pageSize=100):
"""
This API performs a pass-thru query to the configured LDAP server. Search criteria results are cached using default Alpine CacheManager policy.
Returns the DNs of all accessible groups within the... | [
"json.dumps"
] | [((2130, 2146), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (2140, 2146), False, 'import json\n')] |
#!/usr/bin/env python
import pika
import logging
import time
import json
defaults = {'logging': {'levels': {'': 'INFO'}}}
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s+0000 - %(name)s - %(levelname)s - %(message)s')
logging.Formatter.converter = time.gmtime
logging.getLogger('pika').... | [
"logging.basicConfig",
"pika.ConnectionParameters",
"json.dumps",
"pika.BasicProperties",
"logging.getLogger"
] | [((123, 236), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s+0000 - %(name)s - %(levelname)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s+0000 - %(name)s - %(levelname)s - %(message)s')\n", (142, 236), False, 'import logging\n'), ((353, 3... |
from __future__ import division, print_function
import sys, os, glob, time, warnings, gc
import numpy as np
# import matplotlib
# matplotlib.use("Agg")
# import matplotlib.pyplot as plt
from astropy.table import Table, vstack, hstack, join
import fitsio
# from astropy.io import fits
columns = ['SGA_ID', 'REF_CAT', 'G... | [
"fitsio.read",
"numpy.argsort"
] | [((361, 481), 'fitsio.read', 'fitsio.read', (['"""/global/cfs/cdirs/cosmo/data/legacysurvey/dr9/masking/SGA-ellipse-v3.0.kd.fits"""'], {'columns': 'columns'}), "(\n '/global/cfs/cdirs/cosmo/data/legacysurvey/dr9/masking/SGA-ellipse-v3.0.kd.fits'\n , columns=columns)\n", (372, 481), False, 'import fitsio\n'), ((48... |
from datetime import timedelta, datetime
t = timedelta(days=4, hours=10)
print(t.days)
print(t.seconds)
# timedelta objects have no 'hours' attribute and the seconds
# only go up to the equivalent of 24 hours.
# t.hours # fails
print(t.seconds / 60 / 60) # <- 10 hours
total_seconds = t.total_seconds()
print(tota... | [
"datetime.timedelta",
"datetime.datetime.today"
] | [((47, 74), 'datetime.timedelta', 'timedelta', ([], {'days': '(4)', 'hours': '(10)'}), '(days=4, hours=10)\n', (56, 74), False, 'from datetime import timedelta, datetime\n'), ((412, 430), 'datetime.timedelta', 'timedelta', ([], {'hours': '(6)'}), '(hours=6)\n', (421, 430), False, 'from datetime import timedelta, dateti... |
# coding=utf-8
# Copyright (c) 2015 EMC 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
#
#... | [
"hamcrest.equal_to",
"storops.vnx.resource.mount_point.VNXFsMountPoint.create",
"storops_test.vnx.nas_mock.t_nas",
"storops.vnx.resource.mount_point.VNXFsMountPoint",
"hamcrest.greater_than_or_equal_to",
"hamcrest.raises",
"storops.vnx.resource.mover.VNXMover"
] | [((1633, 1653), 'storops.vnx.resource.mover.VNXMover', 'VNXMover', ([], {'mover_id': '(1)'}), '(mover_id=1)\n', (1641, 1653), False, 'from storops.vnx.resource.mover import VNXMover\n'), ((1832, 1852), 'storops.vnx.resource.mover.VNXMover', 'VNXMover', ([], {'mover_id': '(1)'}), '(mover_id=1)\n', (1840, 1852), False, '... |
from sklearn.metrics import classification_report, accuracy_score
from collections import OrderedDict
from privacy.analysis.rdp_accountant import compute_rdp
from privacy.analysis.rdp_accountant import get_privacy_spent
from privacy.optimizers import dp_optimizer
import tensorflow as tf
import numpy as np
import... | [
"argparse.ArgumentParser",
"tensorflow.reshape",
"privacy.optimizers.dp_optimizer.DPAdamGaussianOptimizer",
"tensorflow.estimator.Estimator",
"numpy.unique",
"tensorflow.keras.regularizers.l2",
"tensorflow.metrics.accuracy",
"privacy.analysis.rdp_accountant.get_privacy_spent",
"os.path.exists",
"n... | [((2559, 2622), 'tensorflow.keras.losses.sparse_categorical_crossentropy', 'tf.keras.losses.sparse_categorical_crossentropy', (['labels', 'logits'], {}), '(labels, logits)\n', (2606, 2622), True, 'import tensorflow as tf\n'), ((2642, 2669), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['vector_loss'], {}), '(vector_los... |
"""Tests for the Grant and Profile objects of the CBC SDK"""
import pytest
import logging
import copy
from cbc_sdk.platform import Grant
from cbc_sdk.rest_api import CBCloudAPI
from cbc_sdk.errors import ApiError, NonQueryableModel
from tests.unit.fixtures.CBCSDKMock import CBCSDKMock
from tests.unit.fixtures.platform... | [
"cbc_sdk.platform.Grant",
"cbc_sdk.platform.Grant.create",
"copy.deepcopy",
"cbc_sdk.platform.Grant.get_permitted_role_urns",
"logging.basicConfig",
"cbc_sdk.rest_api.CBCloudAPI",
"pytest.fixture",
"pytest.raises",
"tests.unit.fixtures.CBCSDKMock.CBCSDKMock"
] | [((709, 822), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s:%(message)s"""', 'level': 'logging.DEBUG', 'filename': '"""log.txt"""'}), "(format='%(asctime)s %(levelname)s:%(message)s', level=\n logging.DEBUG, filename='log.txt')\n", (728, 822), False, 'import logging\n'),... |
import pytest
from quarry.web.app import create_app
conf = {
"TESTING": True,
"OAUTH_CONSUMER_TOKEN": None,
"OAUTH_SECRET_TOKEN": None,
"REDIS_HOST": "localhost",
"REDIS_PORT": 6379,
"REDIS_DB": 0,
"DB_USER": "Quarry",
"DB_PASSWORD": "<PASSWORD>",
"DB_HOST": "no_such_host",
"DB_... | [
"quarry.web.app.create_app",
"pytest.fixture"
] | [((415, 447), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (429, 447), False, 'import pytest\n'), ((945, 961), 'quarry.web.app.create_app', 'create_app', (['conf'], {}), '(conf)\n', (955, 961), False, 'from quarry.web.app import create_app\n')] |
from utils.test_io_utils import test_io_utils
from utils.test_data_utils import test_data_utils
from models.test_esim import test_esim
from utils.logging_utils import _set_basic_logging
def main():
# test_io_utils()
# test_data_utils()
test_esim()
if __name__ == "__main__":
_set_basic_logging()
ma... | [
"utils.logging_utils._set_basic_logging",
"models.test_esim.test_esim"
] | [((249, 260), 'models.test_esim.test_esim', 'test_esim', ([], {}), '()\n', (258, 260), False, 'from models.test_esim import test_esim\n'), ((293, 313), 'utils.logging_utils._set_basic_logging', '_set_basic_logging', ([], {}), '()\n', (311, 313), False, 'from utils.logging_utils import _set_basic_logging\n')] |
import re
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas.core.algorithms import mode
import pandas_datareader as web
import datetime as dt
from six import unichr
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras import models
from tensorflow.keras.layers import De... | [
"pandas_datareader.DataReader",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.MinMaxScaler",
"datetime.datetime",
"numpy.array",
"numpy.reshape"... | [((500, 523), 'datetime.datetime', 'dt.datetime', (['(2016)', '(1)', '(1)'], {}), '(2016, 1, 1)\n', (511, 523), True, 'import datetime as dt\n'), ((528, 545), 'datetime.datetime.now', 'dt.datetime.now', ([], {}), '()\n', (543, 545), True, 'import datetime as dt\n'), ((554, 611), 'pandas_datareader.DataReader', 'web.Dat... |
""" Defines the Project object.
"""
import arcgis
from arcgis.features import FeatureLayer
from arcgis.gis import Group
from arcgis._impl.common._utils import _lazy_property
import json
from ._schemas import *
from .managers import *
class Project:
"""
A Workforce Project
================== ========... | [
"arcgis.gis.Group",
"arcgis.features.FeatureLayer",
"json.dumps"
] | [((7810, 7860), 'arcgis.features.FeatureLayer', 'FeatureLayer', (['self.assignments_layer_url', 'self.gis'], {}), '(self.assignments_layer_url, self.gis)\n', (7822, 7860), False, 'from arcgis.features import FeatureLayer\n'), ((7999, 8049), 'arcgis.features.FeatureLayer', 'FeatureLayer', (['self.dispatchers_layer_url',... |
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
from contact.models import Contact, ContactMessage
'''
N.B. To see what icons are available for use in Wagtail menus and StreamField block types,
enable the styleguide in settings:
INSTALLED_APPS = (
...
'wagtail.contrib.style... | [
"wagtail.contrib.modeladmin.options.modeladmin_register"
] | [((1379, 1418), 'wagtail.contrib.modeladmin.options.modeladmin_register', 'modeladmin_register', (['ContactsModelAdmin'], {}), '(ContactsModelAdmin)\n', (1398, 1418), False, 'from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register\n')] |
import turtle
tortugajuan = turtle.Turtle()
colors=['orange', 'red', 'yellow', 'blue', 'red', 'orange', 'light green','light blue',]
tortugajuan.pensize(15)
#Letra J
tortugajuan.pencolor("red")
tortugajuan.goto(120,0)
tortugajuan.goto(80,0)
tortugajuan.goto(80,-100)
tortugajuan.goto(-50,-50)
tortugajuan.penup()
#Letr... | [
"turtle.Turtle"
] | [((28, 43), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (41, 43), False, 'import turtle\n')] |
'''
Project: Farnsworth
Author: <NAME>
'''
from django.contrib.auth.models import User, Group, Permission
from django.core.urlresolvers import reverse
from django.db import models
from base.models import UserProfile
class Thread(models.Model):
'''
The Thread model. Used to group messages.
'''
owner... | [
"django.db.models.signals.post_delete.connect",
"django.db.models.signals.pre_save.connect",
"django.db.models.ManyToManyField",
"django.db.models.TextField",
"django.core.urlresolvers.reverse",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.PositiveIntegerField",
"dj... | [((3354, 3421), 'django.db.models.signals.post_save.connect', 'models.signals.post_save.connect', (['post_save_message'], {'sender': 'Message'}), '(post_save_message, sender=Message)\n', (3386, 3421), False, 'from django.db import models\n'), ((3422, 3493), 'django.db.models.signals.post_delete.connect', 'models.signal... |
import cv2
import numpy as np
import os
import pickle
import base64
from django.core.mail import EmailMessage
def extract_features(image_path):
image = cv2.imread(image_path, 0)
dim = (500, 500)
resize_img = cv2.resize(image, dim, interpolation = cv2.INTER_AREA)
kaze = cv2.KAZE_create()
kp, des = kaze.detect... | [
"pickle.dump",
"cv2.BFMatcher",
"cv2.imread",
"pickle.load",
"django.core.mail.EmailMessage",
"cv2.KAZE_create",
"cv2.resize"
] | [((155, 180), 'cv2.imread', 'cv2.imread', (['image_path', '(0)'], {}), '(image_path, 0)\n', (165, 180), False, 'import cv2\n'), ((215, 267), 'cv2.resize', 'cv2.resize', (['image', 'dim'], {'interpolation': 'cv2.INTER_AREA'}), '(image, dim, interpolation=cv2.INTER_AREA)\n', (225, 267), False, 'import cv2\n'), ((279, 296... |
#%% Env
from O365 import Account, MSGraphProtocol
import datetime as dt
CLIENT_ID = ""
SECRET_ID = ""
with open('client.key','r') as f:
CLIENT_ID = f.read()
with open('secret.key','r') as f:
SECRET_ID = f.read()
credentials = (CLIENT_ID, SECRET_ID)
#%% Auth
protocol = MSGraphProtocol('O365-Python... | [
"O365.MSGraphProtocol",
"O365.Account",
"datetime.datetime"
] | [((292, 322), 'O365.MSGraphProtocol', 'MSGraphProtocol', (['"""O365-Python"""'], {}), "('O365-Python')\n", (307, 322), False, 'from O365 import Account, MSGraphProtocol\n'), ((431, 470), 'O365.Account', 'Account', (['credentials'], {'protocol': 'protocol'}), '(credentials, protocol=protocol)\n', (438, 470), False, 'fro... |
from typing import Any, List, Literal, TypedDict
from .FHIR_CodeableConcept import FHIR_CodeableConcept
from .FHIR_Element import FHIR_Element
from .FHIR_string import FHIR_string
# A collection of error, warning, or information messages that result from a system action.
FHIR_OperationOutcome_Issue = TypedDict(
"... | [
"typing.TypedDict"
] | [((304, 1250), 'typing.TypedDict', 'TypedDict', (['"""FHIR_OperationOutcome_Issue"""', "{'id': FHIR_string, 'extension': List[Any], 'modifierExtension': List[Any],\n 'severity': Literal['fatal', 'error', 'warning', 'information'],\n '_severity': FHIR_Element, 'code': Literal['invalid', 'structure',\n 'required... |
# "magictoken" is used for markers as beginning and ending of example text.
import unittest
from numba.tests.support import captured_stdout, override_config
class DocsLLVMPassTimings(unittest.TestCase):
def test_pass_timings(self):
with override_config('LLVM_PASS_TIMINGS', True):
with captur... | [
"unittest.main",
"numba.tests.support.override_config",
"numba.tests.support.captured_stdout"
] | [((937, 952), 'unittest.main', 'unittest.main', ([], {}), '()\n', (950, 952), False, 'import unittest\n'), ((253, 295), 'numba.tests.support.override_config', 'override_config', (['"""LLVM_PASS_TIMINGS"""', '(True)'], {}), "('LLVM_PASS_TIMINGS', True)\n", (268, 295), False, 'from numba.tests.support import captured_std... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 11:39:19 2020
@author: Pablo
"""
import requests
from elasticsearch import Elasticsearch
def questionAnswering(collection_id, query, ids ):
hed = {
'accept': 'application/json'
}
ids_txt=""
for ide ... | [
"pandas.DataFrame",
"elasticsearch.Elasticsearch",
"sklearn.metrics.pairwise.cosine_similarity",
"tensorflow_hub.load",
"requests.get",
"requests.post",
"pandas.set_option"
] | [((7829, 7907), 'tensorflow_hub.load', 'hub.load', (['"""https://tfhub.dev/google/universal-sentence-encoder-multilingual/3"""'], {}), "('https://tfhub.dev/google/universal-sentence-encoder-multilingual/3')\n", (7837, 7907), True, 'import tensorflow_hub as hub\n'), ((8266, 8311), 'sklearn.metrics.pairwise.cosine_simila... |
from typing import Optional, Dict
from auth.passwords import compare_hash_and_password
from db import with_database, Database
@with_database
def login(db: Database, user_name: str, password: str) -> Optional[Dict]:
user = db.users.find_by_name(user_name)
if user is None:
return None
password_cor... | [
"auth.passwords.compare_hash_and_password"
] | [((327, 380), 'auth.passwords.compare_hash_and_password', 'compare_hash_and_password', (["user['password']", 'password'], {}), "(user['password'], password)\n", (352, 380), False, 'from auth.passwords import compare_hash_and_password\n')] |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pathlib import Path
from seabreeze.spectrometers import Spectrometer
class OceanMea():
def __init__(self,intgtime=1000,ave=10):
self.intgtime = intgtime
self.ave = ave
self.spec = Spectrometer.from_first... | [
"pandas.DataFrame",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"time.sleep",
"pathlib.Path",
"seabreeze.spectrometers.Spectrometer.from_first_available"
] | [((5316, 5329), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (5326, 5329), False, 'import time\n'), ((5362, 5375), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (5372, 5375), False, 'import time\n'), ((297, 332), 'seabreeze.spectrometers.Spectrometer.from_first_available', 'Spectrometer.from_first_availabl... |
# encoding:utf-8
__author__ = 'Sun'
import CsdnBlogSpider
from tkinter import *
import tkinter as tk
import tkinter.messagebox as messagebox
import tkinter.font
import threading
import queue
gui_que = queue.Queue()
class Application(threading.Thread):
def __init__(self, root):
'''Init frame
'''
threading.Thre... | [
"queue.Queue",
"threading.Thread.__init__",
"tkinter.LabelFrame",
"tkinter.Button",
"tkinter.Entry",
"tkinter.messagebox.showwarning",
"tkinter.messagebox.showerror",
"tkinter.Label",
"tkinter.Tk"
] | [((203, 216), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (214, 216), False, 'import queue\n'), ((3224, 3231), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (3229, 3231), True, 'import tkinter as tk\n'), ((306, 337), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (331, 337), False,... |
from rest_framework import generics
from rest_framework.response import Response
from rest_framework import serializers
from django.utils.timezone import now, localtime
from datetime import timedelta
from .models import MyFile
class UploadFileSerializer(serializers.ModelSerializer):
def validate_expire_on(self,... | [
"django.utils.timezone.now",
"rest_framework.response.Response",
"datetime.timedelta",
"rest_framework.serializers.ValidationError"
] | [((1095, 1125), 'rest_framework.response.Response', 'Response', (['"""deleted expired..."""'], {}), "('deleted expired...')\n", (1103, 1125), False, 'from rest_framework.response import Response\n'), ((384, 448), 'rest_framework.serializers.ValidationError', 'serializers.ValidationError', (['"""expire on cannot be less... |
from datetime import datetime
import re
from urllib.request import urlopen, Request
import mlflow
from mlflow.entities import ViewType, LifecycleStage
import pandas as pd
import vim
def getRunsPageMLflow(mlflow_tracking_uri):
out = []
out.append("Vim-MLflow Marked Runs")
out.append("\" Press ? for help")... | [
"pandas.DataFrame",
"vim.eval",
"mlflow.get_run",
"urllib.request.urlopen",
"pandas.to_datetime",
"re.sub"
] | [((338, 362), 'vim.eval', 'vim.eval', (['"""s:debuglines"""'], {}), "('s:debuglines')\n", (346, 362), False, 'import vim\n'), ((6258, 6291), 're.sub', 're.sub', (['"""[^ ]"""', 'divchar', 'lines[0]'], {}), "('[^ ]', divchar, lines[0])\n", (6264, 6291), False, 'import re\n'), ((425, 452), 'vim.eval', 'vim.eval', (['"""s... |
import json
from test.core.acon_helper import AconHelper
from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase
class EMRAlgorithmTestBase(EMRSystemUnitTestBase):
def env_setup(
self,
tmpdir,
destination_system,
destination_database,
des... | [
"json.load",
"json.dumps"
] | [((1124, 1146), 'json.load', 'json.load', (['result_file'], {}), '(result_file)\n', (1133, 1146), False, 'import json\n'), ((1188, 1208), 'json.dumps', 'json.dumps', (['tmp_dict'], {}), '(tmp_dict)\n', (1198, 1208), False, 'import json\n')] |
# Generated by Django 2.1.3 on 2018-11-13 08:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('engine', '0003_auto_20181113_0510'),
]
operations = [
migrations.AddField(
model_name='game',
name='phase',
... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((330, 520), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('draw', 'Draw'), ('main1', 'Main 1'), ('attack', 'Attack'), ('block',\n 'Block'), ('main2', 'Main 2'), ('upkeep', 'Upkeep')]", 'default': '"""draw"""', 'max_length': '(20)'}), "(choices=[('draw', 'Draw'), ('main1', 'Main 1'), ('attac... |
from django.contrib import admin
from django.urls import path, include
from . import views
app_name = 'search'
urlpatterns = [
path('', views.search_index, name='search_index'),
path('load', views.load, name='load'),
path('search', views.search, name='search'),
]
| [
"django.urls.path"
] | [((134, 183), 'django.urls.path', 'path', (['""""""', 'views.search_index'], {'name': '"""search_index"""'}), "('', views.search_index, name='search_index')\n", (138, 183), False, 'from django.urls import path, include\n'), ((189, 226), 'django.urls.path', 'path', (['"""load"""', 'views.load'], {'name': '"""load"""'}),... |
import os
from dateutil.parser import parse
from dockerfile_parse import DockerfileParser
from requests_html import HTMLSession
def should_update_build(last_build, new_build):
def as_date(text):
return parse(text, fuzzy_with_tokens=False)
return as_date(new_build) > as_date(last_build)
def update_... | [
"dateutil.parser.parse",
"os.path.basename",
"dockerfile_parse.DockerfileParser",
"os.path.dirname",
"requests_html.HTMLSession"
] | [((374, 396), 'dockerfile_parse.DockerfileParser', 'DockerfileParser', (['"""./"""'], {}), "('./')\n", (390, 396), False, 'from dockerfile_parse import DockerfileParser\n'), ((750, 763), 'requests_html.HTMLSession', 'HTMLSession', ([], {}), '()\n', (761, 763), False, 'from requests_html import HTMLSession\n'), ((217, 2... |
#-*-coding:utf-8-*-
import tensorflow as tf
import Data_helper
from utils.data_util import from_project_root
from tensorflow.contrib import learn
import numpy as np
from sklearn.metrics import f1_score
from sklearn.metrics import accuracy_score
from tqdm import tqdm
import pickle as pk
# ============================... | [
"tensorflow.contrib.learn.preprocessing.VocabularyProcessor.restore",
"tensorflow.train.import_meta_graph",
"sklearn.metrics.accuracy_score",
"tensorflow.Session",
"utils.data_util.from_project_root",
"tensorflow.ConfigProto",
"sklearn.metrics.f1_score",
"numpy.array",
"tensorflow.Graph",
"tensorf... | [((390, 485), 'tensorflow.flags.DEFINE_boolean', 'tf.flags.DEFINE_boolean', (['"""allow_soft_placement"""', '(True)', '"""Allow device soft device placement"""'], {}), "('allow_soft_placement', True,\n 'Allow device soft device placement')\n", (413, 485), True, 'import tensorflow as tf\n'), ((482, 575), 'tensorflow.... |
import threading
from django.http import HttpResponse
from django.shortcuts import render
import configparser
from mwebhook.messages.builder import Builder
from mwebhook.messages.reader import Reader
from django.views.decorators.csrf import csrf_exempt
from google.url_api import UrlShortner
import re
config = configp... | [
"mwebhook.messages.builder.Builder",
"django.http.HttpResponse",
"re.findall",
"mwebhook.messages.reader.Reader",
"configparser.ConfigParser"
] | [((313, 340), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (338, 340), False, 'import configparser\n'), ((431, 445), 'mwebhook.messages.builder.Builder', 'Builder', (['token'], {}), '(token)\n', (438, 445), False, 'from mwebhook.messages.builder import Builder\n'), ((455, 463), 'mwebhook.... |
from arq import Worker
from pytest_toolbox.comparison import CloseToNow
from em2.core import Action, ActionTypes, construct_conv
from .conftest import Factory
async def test_publish_em2(factory: Factory, worker: Worker, alt_cli, alt_db_conn, alt_conns):
await factory.create_user(email='<EMAIL>')
recipient ... | [
"pytest_toolbox.comparison.CloseToNow",
"em2.core.Action",
"em2.core.construct_conv"
] | [((2118, 2189), 'em2.core.Action', 'Action', ([], {'actor_id': 'factory.user.id', 'act': 'ActionTypes.msg_add', 'body': '"""msg 2"""'}), "(actor_id=factory.user.id, act=ActionTypes.msg_add, body='msg 2')\n", (2124, 2189), False, 'from em2.core import Action, ActionTypes, construct_conv\n'), ((4199, 4274), 'em2.core.Act... |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import numpy as np
import pandas as pd
import copy
from common.quaternion import expmap_to_quaternion, qfix, qmul_np
from commo... | [
"copy.deepcopy",
"numpy.load",
"common.skeleton.Skeleton",
"common.quaternion.qmul_np",
"numpy.array",
"numpy.ascontiguousarray",
"numpy.concatenate"
] | [((439, 1497), 'common.skeleton.Skeleton', 'Skeleton', ([], {'offsets': '[[0.0, 0.0, 0.0], [-132.948591, 0.0, 0.0], [0.0, -442.894612, 0.0], [0.0, -\n 454.206447, 0.0], [0.0, 0.0, 162.767078], [0.0, 0.0, 74.999437], [\n 132.948826, 0.0, 0.0], [0.0, -442.894413, 0.0], [0.0, -454.20659, 0.0],\n [0.0, 0.0, 162.76... |
from typing import List
import numpy as np
import torch
from searl.neuroevolution.components.utils import Transition
from searl.rl_algorithms.components.wrappers import make_atari, wrap_deepmind, wrap_pytorch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print("train CUDA", device == torch.de... | [
"torch.LongTensor",
"torch.FloatTensor",
"searl.rl_algorithms.components.wrappers.wrap_pytorch",
"numpy.random.RandomState",
"numpy.var",
"searl.rl_algorithms.components.wrappers.wrap_deepmind",
"numpy.mean",
"torch.cuda.is_available",
"numpy.array",
"torch.device",
"searl.rl_algorithms.componen... | [((244, 269), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (267, 269), False, 'import torch\n'), ((312, 332), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (324, 332), False, 'import torch\n'), ((446, 491), 'numpy.random.RandomState', 'np.random.RandomState', (['config.s... |
import os
import pdb
from math import floor
from dCC_Python_SodaMachine.backpack import Backpack
from dCC_Python_SodaMachine.customer import Customer
from dCC_Python_SodaMachine.soda_machine import SodaMachine
from dCC_Python_SodaMachine.wallet import Wallet
# One thing I notice is that this Python file doesn't nee... | [
"math.floor",
"os.system"
] | [((4870, 4918), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (4879, 4918), False, 'import os\n'), ((4185, 4203), 'math.floor', 'floor', (['(f * 10 ** n)'], {}), '(f * 10 ** n)\n', (4190, 4203), False, 'from math import floor\n')] |
# --------------------------------------------------------------------------------------------------
# Copyright (c) 2018 Microsoft Corporation
#
# 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 Softw... | [
"os.path.dirname",
"collections.deque",
"json.dumps",
"numpy.isclose",
"logging.getLogger",
"csv.DictWriter"
] | [((6846, 6871), 'collections.deque', 'deque', ([], {'maxlen': 'num_targets'}), '(maxlen=num_targets)\n', (6851, 6871), False, 'from collections import deque\n'), ((7992, 8019), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (8009, 8019), False, 'import logging\n'), ((8827, 8862), 'csv.Dic... |
#!/usr/bin/env python
"""
This is a proc meant to stand in for the UI until we have it ready. It
expects this structure in settings:
stub_services:
- foo
stub_notification_lists:
- name: devs
recipients:
- <EMAIL>
- <EMAIL>
- <EMAIL>
stub_pipelines:
- name: bar
crontab: "0 2 * * *"
service: foo
notific... | [
"sys.stdin.read",
"mettle.models.Service",
"logging.basicConfig",
"mettle.models.Pipeline",
"mettle.db.make_session_cls",
"mettle.settings.get_settings",
"mettle.models.NotificationList",
"logging.getLogger"
] | [((1033, 1054), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (1052, 1054), False, 'import logging\n'), ((1064, 1083), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1081, 1083), False, 'import logging\n'), ((1143, 1157), 'mettle.settings.get_settings', 'get_settings', ([], {}), '()\n', ... |
#/usr/bin/env python2
#-*- coding: utf-8 -*-
'''
@author <NAME>. <<EMAIL>>
@description helper functions
'''
import re
def optimize_space(text):
'''
Remove several whitespace into one, remove whitespace after full stop
if it located in bracket.
'''
text = re.sub(r'\s+', ' ', text)
text = ... | [
"re.sub"
] | [((283, 308), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 'text'], {}), "('\\\\s+', ' ', text)\n", (289, 308), False, 'import re\n'), ((320, 365), 're.sub', 're.sub', (['"""(\\\\.) ([\\\\)\\\\]\\\\}])"""', '"""\\\\1\\\\2"""', 'text'], {}), "('(\\\\.) ([\\\\)\\\\]\\\\}])', '\\\\1\\\\2', text)\n", (326, 365), False,... |
from django.urls import path
from . import views
from .views import ProjectListView, ProjectCreateView
from .views import TaskCreateView, TaskDetailView, TaskDeleteView, TaskUpdateView, TaskListView
urlpatterns = [
path('', views.home, name= 'home-page'),
path('task/list', TaskListView.as_view(), name= 'task-l... | [
"django.urls.path"
] | [((220, 258), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home-page"""'}), "('', views.home, name='home-page')\n", (224, 258), False, 'from django.urls import path\n')] |
import cv2
import numpy as np
class Color_Detection(object):
def __init__(self):
self.ColorStandard = np.array([[255, 0, 0], # red
[0, 0, 255], # blue
[0, 255, 0], # green
[0... | [
"cv2.cvtColor",
"numpy.zeros",
"numpy.array"
] | [((116, 180), 'numpy.array', 'np.array', (['[[255, 0, 0], [0, 0, 255], [0, 255, 0], [0, 255, 255]]'], {}), '([[255, 0, 0], [0, 0, 255], [0, 255, 0], [0, 255, 255]])\n', (124, 180), True, 'import numpy as np\n'), ((558, 652), 'numpy.array', 'np.array', (['[[120, 130, 160, 180], [15, 25, 85, 105], [30, 40, 200, 220], [80... |
import os
from scipy.io import loadmat, matlab
from scipy.signal import spectrogram, find_peaks, medfilt
import pandas as pd
import numpy as np
from joblib import Parallel, delayed
# remove these exercises from targets since there are no data samples
ignore_exercises = ['<Initial Activity>', 'Arm straight up', 'Invali... | [
"numpy.pad",
"numpy.maximum",
"numpy.abs",
"numpy.log",
"scipy.io.loadmat",
"pandas.read_csv",
"numpy.log2",
"scipy.signal.medfilt",
"numpy.hstack",
"numpy.diff",
"numpy.array",
"numpy.exp",
"scipy.signal.spectrogram",
"numpy.tile",
"numpy.arange"
] | [((483, 550), 'pandas.read_csv', 'pd.read_csv', (['"""codes/exercises.txt"""'], {'header': 'None', 'names': "['exercise']"}), "('codes/exercises.txt', header=None, names=['exercise'])\n", (494, 550), True, 'import pandas as pd\n'), ((3151, 3209), 'scipy.io.loadmat', 'loadmat', (['filename'], {'struct_as_record': '(Fals... |
from flask import *
from functools import wraps
from collections import Counter
from hashlib import sha512
import dataset
import codecs
import json
import secrets
app = Flask(__name__)
db = dataset.connect(
'sqlite:///data.db', engine_kwargs={"connect_args": {'check_same_thread': False}})
surveys = db["surveys"]... | [
"json.load",
"codecs.open",
"json.loads",
"jinja2.Markup",
"dataset.connect",
"collections.Counter",
"json.dumps",
"functools.wraps",
"jinja2.escape",
"secrets.choice",
"re.compile"
] | [((193, 296), 'dataset.connect', 'dataset.connect', (['"""sqlite:///data.db"""'], {'engine_kwargs': "{'connect_args': {'check_same_thread': False}}"}), "('sqlite:///data.db', engine_kwargs={'connect_args': {\n 'check_same_thread': False}})\n", (208, 296), False, 'import dataset\n'), ((1438, 1474), 're.compile', 're.... |
# -*- coding: utf-8 -*-
"""The command line launcher of apimd."""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2020"
__license__ = "MIT"
__email__ = "<EMAIL>"
from argparse import ArgumentParser
def main() -> None:
"""Main function."""
from .compiler import gen_api
parser = ArgumentParser(
... | [
"argparse.ArgumentParser"
] | [((300, 454), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Compile Python public API into Generic Markdown."""', 'epilog': 'f"""{__copyright__} {__license__} {__author__} {__email__}"""'}), "(description=\n 'Compile Python public API into Generic Markdown.', epilog=\n f'{__copyright__} {_... |
# -*- coding: utf-8 -*-
import os
from ncc import (
__CACHE_DIR__,
__BPE_DIR__, __LIBS_DIR__,
LOGGER,
)
from dataset.codexglue.code_to_code import (
DATASET_DIR
)
DATASET_NAME = "translation"
DATASET_DIR = os.path.join(DATASET_DIR, DATASET_NAME)
RAW_DIR = os.path.join(DATASET_DIR, 'raw')
ATTRIBUTES_DI... | [
"os.path.dirname",
"os.path.join"
] | [((223, 262), 'os.path.join', 'os.path.join', (['DATASET_DIR', 'DATASET_NAME'], {}), '(DATASET_DIR, DATASET_NAME)\n', (235, 262), False, 'import os\n'), ((274, 306), 'os.path.join', 'os.path.join', (['DATASET_DIR', '"""raw"""'], {}), "(DATASET_DIR, 'raw')\n", (286, 306), False, 'import os\n'), ((324, 363), 'os.path.joi... |
# Conversion of Washington DC Taxi Trips (2017): https://www.kaggle.com/bvc5283/dc-taxi-trips
import argparse
import pandas as pd
import numpy as np
def convertData(inFile, outFile, startDate, endDate):
df = pd.read_csv(inFile)
df_out = df[['StartDateTime',
'OriginLatitude', 'OriginLongitude'... | [
"numpy.sum",
"argparse.ArgumentParser",
"pandas.read_csv",
"pandas.to_datetime",
"numpy.prod"
] | [((214, 233), 'pandas.read_csv', 'pd.read_csv', (['inFile'], {}), '(inFile)\n', (225, 233), True, 'import pandas as pd\n'), ((692, 780), 'pandas.to_datetime', 'pd.to_datetime', (["df_out['request time']"], {'format': '"""%Y-%m-%d %H:%M:%S"""', 'errors': '"""coerce"""'}), "(df_out['request time'], format='%Y-%m-%d %H:%M... |
import param
from nick_derobertis_site.common.component import HTMLComponent
from nick_derobertis_site.general.widgets.button import (
PageButtonBase,
PrimaryOutlineDarkBackgroundSkillsButton,
PrimaryOutlineDarkBackgroundButton,
)
from .carousel_item_model import CarouselItemModel
class CarouselItemCompo... | [
"nick_derobertis_site.general.widgets.button.PrimaryOutlineDarkBackgroundSkillsButton",
"param.List",
"param.ClassSelector",
"nick_derobertis_site.general.widgets.button.PrimaryOutlineDarkBackgroundButton"
] | [((353, 398), 'param.ClassSelector', 'param.ClassSelector', ([], {'class_': 'CarouselItemModel'}), '(class_=CarouselItemModel)\n', (372, 398), False, 'import param\n'), ((413, 446), 'param.List', 'param.List', ([], {'class_': 'PageButtonBase'}), '(class_=PageButtonBase)\n', (423, 446), False, 'import param\n'), ((687, ... |
from configparser import ConfigParser
from distutils.version import StrictVersion
class Plugin(object):
def __init__(self, plugin_name, plugin_path):
self.__details = ConfigParser()
self.__name = plugin_name
self.__path = plugin_path
self.__fill_empty_fields()
# variables... | [
"configparser.ConfigParser"
] | [((182, 196), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (194, 196), False, 'from configparser import ConfigParser\n')] |
# Partially based on the code from opencv demo in maskrcnn-benchmark
import torch
from torchvision import transforms as T
from maskrcnn_benchmark.data.transforms import transforms as TT
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.utils.checkpoint import DetectronChec... | [
"maskrcnn_benchmark.utils.checkpoint.DetectronCheckpointer",
"maskrcnn_benchmark.config.cfg.clone",
"maskrcnn_benchmark.modeling.detector.build_detection_model",
"torchvision.transforms.ToPILImage",
"torch.nonzero",
"maskrcnn_benchmark.config.cfg.merge_from_file",
"torch.device",
"maskrcnn_benchmark.m... | [((650, 682), 'maskrcnn_benchmark.config.cfg.merge_from_file', 'cfg.merge_from_file', (['config_file'], {}), '(config_file)\n', (669, 682), False, 'from maskrcnn_benchmark.config import cfg\n'), ((727, 739), 'maskrcnn_benchmark.config.cfg.freeze', 'cfg.freeze', ([], {}), '()\n', (737, 739), False, 'from maskrcnn_benchm... |
from tkinter import *
import tkinter as tk
from PIL import ImageTk, Image
import calendar
root = tk.Tk()
root.geometry('400x300')
root.title('Calender')
def show():
m = int(month.get())
y = int(year.get())
output = calendar.month(y,m)
cal.insert('end',output)
def cl... | [
"calendar.month",
"tkinter.Tk",
"PIL.Image.open"
] | [((101, 108), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (106, 108), True, 'import tkinter as tk\n'), ((255, 275), 'calendar.month', 'calendar.month', (['y', 'm'], {}), '(y, m)\n', (269, 275), False, 'import calendar\n'), ((433, 459), 'PIL.Image.open', 'Image.open', (['"""calendar.png"""'], {}), "('calendar.png')\n", (44... |
# BSM Python library and command line tool
#
# Copyright (C) 2020 chargeIT mobility GmbH
#
# SPDX-License-Identifier: Apache-2.0
from ..sunspec.core import suns
import re
_HEADER_BLOCK_TYPE = 'header'
_SYMBOL_POINT_TYPES = [
suns.SUNS_TYPE_BITFIELD16,
suns.SUNS_TYPE_BITFIELD32,
suns.SUNS_T... | [
"re.sub"
] | [((476, 503), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 'string'], {}), "('\\\\s+', ' ', string)\n", (482, 503), False, 'import re\n')] |
import numpy as np
from sklearn import linear_model
reg = linear_model.LinearRegression(fit_intercept=True)
def get_doubling_time_via_regression(in_array):
''' Use a linear regression to approximate the doubling rate'''
y = np.array(in_array)
X = np.arange(-1,2).reshape(-1, 1)
assert len(in_... | [
"sklearn.linear_model.LinearRegression",
"numpy.array",
"numpy.arange"
] | [((59, 108), 'sklearn.linear_model.LinearRegression', 'linear_model.LinearRegression', ([], {'fit_intercept': '(True)'}), '(fit_intercept=True)\n', (88, 108), False, 'from sklearn import linear_model\n'), ((239, 257), 'numpy.array', 'np.array', (['in_array'], {}), '(in_array)\n', (247, 257), True, 'import numpy as np\n... |
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | [
"os.path.dirname"
] | [((1188, 1215), 'os.path.dirname', 'os.path.dirname', (['"""__file__"""'], {}), "('__file__')\n", (1203, 1215), False, 'import os\n')] |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import socket
import re
import time
import os
#path
path = os.getcwd()
cache = (path+'/cache')
poc = (path+'/core/poc')
exp = (path+'/core/exp')
backdoor = (path+'/core/backdoor')
utils = (path+'/lib/utils')
#get ip address
'''
print("[+] Get IP address..")
url =... | [
"os.getcwd",
"os.popen",
"os.system"
] | [((115, 126), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (124, 126), False, 'import os\n'), ((1060, 1138), 'os.system', 'os.system', (['("awk \'{print $2}\' %s/port.log > %s/port_info.log " % (cache, cache))'], {}), '("awk \'{print $2}\' %s/port.log > %s/port_info.log " % (cache, cache))\n', (1069, 1138), False, 'impo... |
# Generated by Django 2.2.9 on 2020-08-12 19:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('proponentes', '0013_proponente_descricao'),
]
operations = [
migrations.RenameField(
model_name='proponente',
old_name='desc... | [
"django.db.migrations.RenameField"
] | [((233, 329), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""proponente"""', 'old_name': '"""descricao"""', 'new_name': '"""observacao"""'}), "(model_name='proponente', old_name='descricao',\n new_name='observacao')\n", (255, 329), False, 'from django.db import migrations\n')] |
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import copy
import json
import unittest
from cfn_policy_validator.tests.boto_mocks import BotoResponse
from cfn_policy_validator.tests.parsers_tests import mock_node_evaluator_setup, mock_identity_parser_setup
fro... | [
"copy.deepcopy",
"cfn_policy_validator.tests.utils.load",
"cfn_policy_validator.tests.parsers_tests.mock_identity_parser_setup",
"cfn_policy_validator.tests.boto_mocks.BotoResponse",
"cfn_policy_validator.parsers.identity.IdentityParser.parse"
] | [((2494, 2522), 'cfn_policy_validator.tests.parsers_tests.mock_identity_parser_setup', 'mock_identity_parser_setup', ([], {}), '()\n', (2520, 2522), False, 'from cfn_policy_validator.tests.parsers_tests import mock_node_evaluator_setup, mock_identity_parser_setup\n'), ((2991, 3019), 'cfn_policy_validator.tests.parsers_... |
"""Elementwise operators"""
from __future__ import absolute_import as _abs
import tvm
@tvm.tag_scope(tag="ewise")
def relu(x):
"""Take relu of input x.
Parameters
----------
x : tvm.Tensor
Input argument.
Returns
-------
y : tvm.Tensor
The result.
"""
return tvm.co... | [
"tvm.tag_scope"
] | [((88, 114), 'tvm.tag_scope', 'tvm.tag_scope', ([], {'tag': '"""ewise"""'}), "(tag='ewise')\n", (101, 114), False, 'import tvm\n')] |
import unittest
from functools import reduce
from iterable_collections import collect
from iterable_collections.utils import spread_tuple_parameter
class TestReduceItems(unittest.TestCase):
def test_list(self):
c = collect(list(range(10)))
with self.assertRaises(ValueError):
c.reduce... | [
"iterable_collections.utils.spread_tuple_parameter",
"iterable_collections.collect"
] | [((883, 908), 'iterable_collections.collect', 'collect', (["{'a': 1, 'b': 2}"], {}), "({'a': 1, 'b': 2})\n", (890, 908), False, 'from iterable_collections import collect\n'), ((1011, 1065), 'iterable_collections.utils.spread_tuple_parameter', 'spread_tuple_parameter', (['(lambda c_, k, v: v + c_)'], {'pos': '(1)'}), '(... |
"""Script filename: example_optFrog.py
Exemplary calculation of an optFrog trace for data obtained from
the numerical propagation of a short and intense few-cycle optical
pulse in presence of the refractive index profile of an endlessly single
mode photonic crystal fiber.
"""
import sys
import numpy as np
import nump... | [
"numpy.load",
"optfrog.optFrog",
"numpy.exp",
"figure.spectrogramFigure",
"numpy.sqrt"
] | [((851, 941), 'optfrog.optFrog', 'optFrog', (['t', 'Et', 'windowFuncGauss'], {'alpha': 'a0', 'tLim': '(tMin, tMax, 10)', 'wLim': '(wMin, wMax, 3)'}), '(t, Et, windowFuncGauss, alpha=a0, tLim=(tMin, tMax, 10), wLim=(wMin,\n wMax, 3))\n', (858, 941), False, 'from optfrog import optFrog\n'), ((934, 978), 'figure.spectr... |
"""
Expense models
"""
import datetime as dt
import calendar
from expense_tracker.database import (
Column,
db,
Model,
reference_col,
relationship,
UserRelated
)
class Expense(UserRelated, Model):
"""
Class for expense line items
"""
__tablename__ = "expense"
name = Column... | [
"expense_tracker.database.reference_col",
"expense_tracker.database.relationship",
"expense_tracker.database.db.String",
"expense_tracker.database.Column"
] | [((374, 403), 'expense_tracker.database.Column', 'Column', (['db.Integer'], {'default': '(0)'}), '(db.Integer, default=0)\n', (380, 403), False, 'from expense_tracker.database import Column, db, Model, reference_col, relationship, UserRelated\n'), ((423, 456), 'expense_tracker.database.Column', 'Column', (['db.Integer'... |
import json
import logging
from flask import request, url_for, redirect, render_template, current_app, Blueprint, g
from sqlalchemy import case, desc
from ..proxies import db_session, current_repo
from ..models import User, Post, PageView
from ..utils.render import render_post, render_comment, render_post_raw
loggi... | [
"flask.Blueprint",
"flask.current_app.config.get",
"flask.request.args.get",
"logging.basicConfig",
"json.dumps",
"flask.url_for",
"flask.render_template",
"sqlalchemy.desc",
"logging.getLogger"
] | [((315, 354), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (334, 354), False, 'import logging\n'), ((364, 391), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (381, 391), False, 'import logging\n'), ((406, 499), 'flask.Blueprint'... |
import cv2
import numpy as np
import os
aaa = cv2.imread('seed0075.png')
aaa2 = cv2.imread('seed00752.png')
ddd = np.mean((aaa2 - aaa)**2)
print('ddd=%.6f' % ddd)
print()
| [
"cv2.imread",
"numpy.mean"
] | [((51, 77), 'cv2.imread', 'cv2.imread', (['"""seed0075.png"""'], {}), "('seed0075.png')\n", (61, 77), False, 'import cv2\n'), ((85, 112), 'cv2.imread', 'cv2.imread', (['"""seed00752.png"""'], {}), "('seed00752.png')\n", (95, 112), False, 'import cv2\n'), ((120, 146), 'numpy.mean', 'np.mean', (['((aaa2 - aaa) ** 2)'], {... |
from setuptools import setup, find_packages
setup(
name='IVIM Kurtosis Implementation',
version='1.0',
packages=["kurtosis"],
package_dir={
"": ".",
"kurtosis": "./",
},
)
| [
"setuptools.setup"
] | [((45, 171), 'setuptools.setup', 'setup', ([], {'name': '"""IVIM Kurtosis Implementation"""', 'version': '"""1.0"""', 'packages': "['kurtosis']", 'package_dir': "{'': '.', 'kurtosis': './'}"}), "(name='IVIM Kurtosis Implementation', version='1.0', packages=[\n 'kurtosis'], package_dir={'': '.', 'kurtosis': './'})\n"... |
import copy
import collections
import logging
import os
logger = logging.getLogger(__name__)
def rupdate(target, src):
"""Recursively update target dict with src.
Like «deepupdate» but only merging dictionaries
(«deepupdate» copyright <NAME>, MIT license.)
(lists and sets are replaced, not merged)... | [
"copy.deepcopy",
"os.path.exists",
"logging.getLogger",
"os.path.dirname"
] | [((66, 93), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (83, 93), False, 'import logging\n'), ((899, 923), 'os.path.exists', 'os.path.exists', (['filePath'], {}), '(filePath)\n', (913, 923), False, 'import os\n'), ((708, 724), 'copy.deepcopy', 'copy.deepcopy', (['v'], {}), '(v)\n', (72... |
import re
import os
import sys
from jira import JIRA
#PARAMS RECEIVED FROM ZABBIX SERVER:
#sys.argv[1] = TO
#sys.argv[2] = SUBJECT
#sys.argv[3] = BODY
options_server = {'server': 'YOUR-DOMAIN-JIRA-SERVER'}
jira = JIRA(options=options_server, basic_auth=('USERNAME', 'PASSWORD'))
#Get all the issues
issues = jira.... | [
"jira.JIRA"
] | [((218, 283), 'jira.JIRA', 'JIRA', ([], {'options': 'options_server', 'basic_auth': "('USERNAME', 'PASSWORD')"}), "(options=options_server, basic_auth=('USERNAME', 'PASSWORD'))\n", (222, 283), False, 'from jira import JIRA\n')] |
import unittest
import numpy as np
from chainer0 import Variable, Chain
from chainer0.links import EmbedID, Linear
from chainer0.functions import sigmoid, tanh, mean_squared_error
from chainer0.optimizers import SGD
class TestEmbedModel(unittest.TestCase):
def test_train(self):
x = Variable(np.array([1, ... | [
"chainer0.functions.mean_squared_error",
"numpy.random.seed",
"chainer0.functions.tanh",
"chainer0.functions.sigmoid",
"numpy.array",
"chainer0.optimizers.SGD",
"numpy.random.rand",
"chainer0.links.EmbedID",
"chainer0.links.Linear"
] | [((670, 681), 'chainer0.optimizers.SGD', 'SGD', ([], {'lr': '(0.5)'}), '(lr=0.5)\n', (673, 681), False, 'from chainer0.optimizers import SGD\n'), ((722, 739), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (736, 739), True, 'import numpy as np\n'), ((769, 789), 'numpy.random.rand', 'np.random.rand', (['... |
import networkx as nx
directions = {"N": 1, "E": 1j, "S": -1, "W": -1j}
def parse(line: str):
graph = nx.Graph()
pos = {0}
starts = {0}
ends = set()
stack = list()
for c in line[1:-1]:
if c == "|":
ends.update(pos)
pos = starts
elif c in "NSEW":
... | [
"networkx.Graph",
"networkx.algorithms.shortest_path_length"
] | [((109, 119), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (117, 119), True, 'import networkx as nx\n'), ((715, 759), 'networkx.algorithms.shortest_path_length', 'nx.algorithms.shortest_path_length', (['graph', '(0)'], {}), '(graph, 0)\n', (749, 759), True, 'import networkx as nx\n'), ((852, 896), 'networkx.algorith... |
#!/usr/bin/python
# coding=utf-8
# Copyright 2016-2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"unittest.TextTestRunner",
"ase.build.bulk",
"ase.build.molecule",
"unittest.TestLoader"
] | [((948, 1001), 'ase.build.bulk', 'ase.build.bulk', (['"""Cu"""', '"""fcc"""'], {'a': '(3.6)', 'orthorhombic': '(True)'}), "('Cu', 'fcc', a=3.6, orthorhombic=True)\n", (962, 1001), False, 'import ase\n'), ((1021, 1046), 'ase.build.molecule', 'ase.build.molecule', (['"""H2O"""'], {}), "('H2O')\n", (1039, 1046), False, 'i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'nosoyyo'
import time
import random
from quickstart import cookSoup, randomUA
from pretommy import headers, getTheSpan
from pipelines import QiniuPipeline, MongoDBPipeline
# init m, q
m = MongoDBPipeline()
m.switch('fashion', 'tommy')
q = QiniuPipeline()
# ... | [
"pipelines.QiniuPipeline",
"quickstart.cookSoup",
"quickstart.randomUA",
"pipelines.MongoDBPipeline",
"time.ctime",
"time.sleep"
] | [((250, 267), 'pipelines.MongoDBPipeline', 'MongoDBPipeline', ([], {}), '()\n', (265, 267), False, 'from pipelines import QiniuPipeline, MongoDBPipeline\n'), ((301, 316), 'pipelines.QiniuPipeline', 'QiniuPipeline', ([], {}), '()\n', (314, 316), False, 'from pipelines import QiniuPipeline, MongoDBPipeline\n'), ((370, 38... |
import logging
from serializers import LatestDonationSerializer
from bluebottle.donations.models import Donation
from bluebottle.utils.utils import StatusDefinition
from rest_framework import permissions, generics
from bluebottle.utils.model_dispatcher import get_project_model
PROJECT_MODEL = get_project_model()
log... | [
"bluebottle.utils.model_dispatcher.get_project_model",
"logging.getLogger"
] | [((296, 315), 'bluebottle.utils.model_dispatcher.get_project_model', 'get_project_model', ([], {}), '()\n', (313, 315), False, 'from bluebottle.utils.model_dispatcher import get_project_model\n'), ((326, 353), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (343, 353), False, 'import loggi... |
from unittest import TestCase
import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import feladatok
class TesPrimszamok(TestCase):
def test_feladat01(self):
parameter=1
... | [
"inspect.currentframe",
"os.path.dirname",
"sys.path.insert",
"feladatok.primszamok"
] | [((154, 182), 'os.path.dirname', 'os.path.dirname', (['current_dir'], {}), '(current_dir)\n', (169, 182), False, 'import os, sys, inspect\n'), ((183, 213), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parent_dir'], {}), '(0, parent_dir)\n', (198, 213), False, 'import os, sys, inspect\n'), ((332, 363), 'feladatok.pri... |
# -*- coding: utf-8 -*-
import re
from core.models import Trouble, System, Symptom, Cause, Solution
class CleanDataPipeline(object):
TAG_RE = re.compile(r'<[^>]+>')
NON_BREAK_SPACE = u'\xa0'
def process_item(self, item, spider):
item['code'] = self._clean_code(item['code'])
item['title']... | [
"core.models.Trouble.objects.create",
"core.models.Cause.objects.create",
"core.models.Symptom.objects.create",
"core.models.System.objects.get_or_create",
"re.sub",
"core.models.Solution.objects.create",
"re.compile"
] | [((149, 170), 're.compile', 're.compile', (['"""<[^>]+>"""'], {}), "('<[^>]+>')\n", (159, 170), False, 'import re\n'), ((1691, 1714), 're.sub', 're.sub', (['""" +"""', '""" """', 'text'], {}), "(' +', ' ', text)\n", (1697, 1714), False, 'import re\n'), ((2548, 2705), 'core.models.Trouble.objects.create', 'Trouble.objec... |
import math
print(math.radians(1000))
print(math.radians(180))
# using print() to print the result | [
"math.radians"
] | [((19, 37), 'math.radians', 'math.radians', (['(1000)'], {}), '(1000)\n', (31, 37), False, 'import math\n'), ((46, 63), 'math.radians', 'math.radians', (['(180)'], {}), '(180)\n', (58, 63), False, 'import math\n')] |
# Generated by Django 3.1 on 2020-09-05 05:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app1', '0006_site_image'),
]
operations = [
migrations.RenameField(
model_name='site',
old_name='site_name',
... | [
"django.db.migrations.RenameField"
] | [((226, 317), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""site"""', 'old_name': '"""site_name"""', 'new_name': '"""clientName"""'}), "(model_name='site', old_name='site_name', new_name=\n 'clientName')\n", (248, 317), False, 'from django.db import migrations\n'), ((374, 462)... |
#! /usr/bin/env python3
import sys, os, csv, json, math, logging
sys.path.append(os.path.expanduser('~/adapt/tools'))
import gremlin_query
# varibale bindings for gremlin queries
bindings = {
'ETYPE':'eventType',
'STYPE':'subjectType',
'SIZE':'size',
'STIME':'startedAtTime',
'DPORT':'dstPort',
... | [
"os.path.expanduser"
] | [((82, 117), 'os.path.expanduser', 'os.path.expanduser', (['"""~/adapt/tools"""'], {}), "('~/adapt/tools')\n", (100, 117), False, 'import sys, os, csv, json, math, logging\n')] |
import json
import os
import unittest
from unittest import TestCase
from unittest.mock import Mock, patch
from api_batch_create.main import lambda_handler
from botocore.exceptions import ClientError
from test_shared.mock_objects import InputTestData, TestContext
class TestCase(TestCase):
def mock_sagemaker_api_c... | [
"unittest.main",
"botocore.exceptions.ClientError",
"test_shared.mock_objects.TestContext",
"unittest.mock.Mock",
"unittest.mock.patch.dict",
"json.dumps",
"unittest.mock.patch"
] | [((562, 599), 'unittest.mock.patch', 'patch', (['"""shared.db.get_batch_metadata"""'], {}), "('shared.db.get_batch_metadata')\n", (567, 599), False, 'from unittest.mock import Mock, patch\n'), ((605, 684), 'unittest.mock.patch', 'patch', (['"""botocore.client.BaseClient._make_api_call"""'], {'new': 'mock_sagemaker_api_... |
try:
from zoneinfo import ZoneInfo
def default_zone_info_deserializer(obj: ZoneInfo, *_, **__) -> ZoneInfo:
"""
Deserialize a ZoneInfo.
:param obj: a serialized ZoneInfo object.
:return: an instance of ZoneInfo.
"""
return ZoneInfo(obj['key'])
except ImportErro... | [
"zoneinfo.ZoneInfo"
] | [((281, 301), 'zoneinfo.ZoneInfo', 'ZoneInfo', (["obj['key']"], {}), "(obj['key'])\n", (289, 301), False, 'from zoneinfo import ZoneInfo\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class LICACritic(nn.Module):
def __init__(self, scheme, args):
super(LICACritic, self).__init__()
self.args = args
self.n_actions = args.n_actions
self.n_agents = args.n_agents
self.outp... | [
"torch.nn.ReLU",
"torch.bmm",
"numpy.prod",
"torch.nn.Linear"
] | [((1544, 1583), 'torch.nn.Linear', 'nn.Linear', (['self.state_dim', 'self.hid_dim'], {}), '(self.state_dim, self.hid_dim)\n', (1553, 1583), True, 'import torch.nn as nn\n'), ((2313, 2334), 'torch.bmm', 'torch.bmm', (['h', 'w_final'], {}), '(h, w_final)\n', (2322, 2334), False, 'import torch\n'), ((396, 421), 'numpy.pro... |
'''
Created with love by Sigmoid
@Author - <NAME> - <EMAIL>
'''
# Importing all libraries
import numpy as np
import pandas as pd
from scipy.stats import norm
import sys
from .erorrs import NotBinaryData, NoSuchColumn
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
class MT... | [
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.random.seed",
"scipy.stats.norm.cdf",
"numpy.array",
"pandas.concat"
] | [((923, 948), 'numpy.random.seed', 'np.random.seed', (['self.seed'], {}), '(self.seed)\n', (937, 948), True, 'import numpy as np\n'), ((5630, 5687), 'pandas.DataFrame', 'pd.DataFrame', (['self.synthetic_data'], {'columns': 'self.X_columns'}), '(self.synthetic_data, columns=self.X_columns)\n', (5642, 5687), True, 'impor... |
#!/usr/bin/env python
from allennlp.commands.train import train_model_from_file
import torch
import typer
from ger_wiki.batch_predictor import RunBatchPredictions
app = typer.Typer()
def train_model(name: str):
typer.echo(f"Running {name}")
try:
train_model_from_file(
parameter_filename=... | [
"typer.echo",
"typer.Typer",
"ger_wiki.batch_predictor.RunBatchPredictions",
"typer.run",
"torch.cuda.is_available",
"allennlp.commands.train.train_model_from_file"
] | [((171, 184), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (182, 184), False, 'import typer\n'), ((219, 248), 'typer.echo', 'typer.echo', (['f"""Running {name}"""'], {}), "(f'Running {name}')\n", (229, 248), False, 'import typer\n'), ((573, 598), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n'... |
#!/usr/bin/env python2
#coding: utf-8
# Copyright (c) 2017-present, Facebook, 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
#
# Unles... | [
"argparse.ArgumentParser",
"core.config.merge_cfg_from_file",
"cv2.VideoWriter_fourcc",
"collections.defaultdict",
"datasets.dummy_datasets.get_coco_dataset",
"cv2.rectangle",
"cv2.VideoWriter",
"cv2.imshow",
"sys.path.append",
"cv2.cvtColor",
"core.config.assert_and_infer_cfg",
"sys.setdefaul... | [((1268, 1316), 'sys.path.append', 'sys.path.append', (['"""/home/vpa/github/caffe2/build"""'], {}), "('/home/vpa/github/caffe2/build')\n", (1283, 1316), False, 'import sys\n'), ((1671, 1702), 'utils.c2.import_detectron_ops', 'c2_utils.import_detectron_ops', ([], {}), '()\n', (1700, 1702), True, 'import utils.c2 as c2_... |
"""Integration Test for local_implicit_grid + PDELayer."""
# pylint: disable=import-error, no-member, too-many-arguments, no-self-use
import unittest
import numpy as np
import torch
from parameterized import parameterized
from local_implicit_grid import query_local_implicit_grid
from implicit_net import ImNet
from pd... | [
"unittest.main",
"pde.PDELayer",
"implicit_net.ImNet",
"local_implicit_grid.query_local_implicit_grid",
"torch.rand",
"numpy.testing.assert_allclose"
] | [((3752, 3767), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3765, 3767), False, 'import unittest\n'), ((2812, 2868), 'torch.rand', 'torch.rand', (['batch_size', 'grid_res', 'grid_res', 'grid_res', 'nc'], {}), '(batch_size, grid_res, grid_res, grid_res, nc)\n', (2822, 2868), False, 'import torch\n'), ((2889, 29... |
import torch, sys, math
from adult_model import log_likelihood, log_prior
from linear import ReparamXpand
from transform import softmax
log_2pi = math.log(2*math.pi)
def mvn_entropy(model):
return 0.5*torch.mean(torch.sum(log_2pi+1+2*model.weight, dim=-1))
def DPVI(model, T, data, batch_size, optimizer, C, sigma, va... | [
"adult_model.log_prior",
"linear.ReparamXpand",
"adult_model.log_likelihood",
"torch.randn",
"sys.stdout.flush",
"math.log",
"torch.sum"
] | [((147, 168), 'math.log', 'math.log', (['(2 * math.pi)'], {}), '(2 * math.pi)\n', (155, 168), False, 'import torch, sys, math\n'), ((3937, 4010), 'linear.ReparamXpand', 'ReparamXpand', (['(1)', 'model.input_dim', 'model.param_dims', 'model.flat_param_dims'], {}), '(1, model.input_dim, model.param_dims, model.flat_param... |
import nltk
from nltk.corpus import wordnet as wn
from nltk.corpus.reader import wordnet
import vaderSentiment
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from scipy import stats
analyzer = SentimentIntensityAnalyzer()
base_fh = open('vaderSentiment\\baseform.txt')
mono = 0
mono_list = []
po... | [
"nltk.corpus.wordnet.lemmas",
"scipy.stats.spearmanr",
"nltk.corpus.wordnet.synsets",
"scipy.stats.pearsonr",
"vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer"
] | [((217, 245), 'vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (243, 245), False, 'from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n'), ((391, 403), 'nltk.corpus.wordnet.lemmas', 'wn.lemmas', (['w'], {}), '(w)\n', (400, 403), True, 'from nl... |
#!/usr/bin/python
# Classification (U)
"""Program: run_program.py
Description: Unit testing of run_program in cf_monitor.py.
Usage:
test/unit/cf_monitor/run_program.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
import u... | [
"unittest.main",
"os.getcwd",
"cf_monitor.run_program",
"mock.patch",
"mock.Mock"
] | [((419, 430), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (428, 430), False, 'import os\n'), ((1474, 1519), 'mock.patch', 'mock.patch', (['"""cf_monitor.gen_libs.load_module"""'], {}), "('cf_monitor.gen_libs.load_module')\n", (1484, 1519), False, 'import mock\n'), ((1838, 1853), 'unittest.main', 'unittest.main', ([], {... |
# -*- coding: utf-8 -*-
"""
flask.ext.hippocket.tasks
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
from flask import Blueprint, Markup, request, render_template
from itertools import chain
from os import path
from pkgutil import walk_packag... | [
"flask.Markup",
"pkgutil.walk_packages",
"os.path.join",
"werkzeug.utils.import_string"
] | [((807, 834), 'werkzeug.utils.import_string', 'import_string', (['apps_package'], {}), '(apps_package)\n', (820, 834), False, 'from werkzeug.utils import import_string\n'), ((1255, 1282), 'os.path.join', 'path.join', (['app.root_path', 'p'], {}), '(app.root_path, p)\n', (1264, 1282), False, 'from os import path\n'), ((... |
from __future__ import absolute_import, print_function
from flytekit.sdk.tasks import python_task, inputs, outputs
from flytekit.sdk.types import Types
from flytekit.sdk.workflow import workflow_class, Input, Output
@inputs(a=Types.Integer)
@outputs(b=Types.Integer)
@python_task(gpu_request="1", gpu_limit="1")
def a... | [
"flytekit.sdk.workflow.Input",
"flytekit.sdk.tasks.inputs",
"flytekit.sdk.tasks.python_task",
"flytekit.sdk.tasks.outputs",
"flytekit.sdk.workflow.Output"
] | [((220, 243), 'flytekit.sdk.tasks.inputs', 'inputs', ([], {'a': 'Types.Integer'}), '(a=Types.Integer)\n', (226, 243), False, 'from flytekit.sdk.tasks import python_task, inputs, outputs\n'), ((245, 269), 'flytekit.sdk.tasks.outputs', 'outputs', ([], {'b': 'Types.Integer'}), '(b=Types.Integer)\n', (252, 269), False, 'fr... |
import os
import sys
import tensorflow as tf
import numpy as np
from model256 import LungSystem
from os.path import join as pjoin
import random
import logging
starting=False
logging.basicConfig(level=logging.INFO)
tf.app.flags.DEFINE_float("best_val_loss", float('inf'), "best val loss so far")
tf.app.flags.DEFINE... | [
"tensorflow.app.flags.DEFINE_float",
"tensorflow.gfile.Exists",
"numpy.load",
"numpy.save",
"logging.basicConfig",
"tensorflow.Session",
"logging.info",
"tensorflow.app.flags.DEFINE_string",
"sys.exit",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.run",
"os.listdir",
"tensorflow.tr... | [((178, 217), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (197, 217), False, 'import logging\n'), ((301, 400), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""model"""', '"""unet"""', '"""Type of model to use: linear or cnn or simple... |
# Copyright (c) 2021 Arm Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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/LICEN... | [
"argparse.ArgumentParser",
"os.path.basename",
"os.path.dirname",
"datetime.datetime.now",
"os.path.join"
] | [((877, 893), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (891, 893), False, 'from argparse import ArgumentParser\n'), ((1902, 1956), 'os.path.join', 'os.path.join', (['args.header_folder_path', 'header_filename'], {}), '(args.header_folder_path, header_filename)\n', (1914, 1956), False, 'import os\n... |
# coding:utf-8
from flask import Flask
app = Flask(__name__, template_folder='templates', static_folder="static")
app.config.from_pyfile("config.py")
| [
"flask.Flask"
] | [((48, 116), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""templates"""', 'static_folder': '"""static"""'}), "(__name__, template_folder='templates', static_folder='static')\n", (53, 116), False, 'from flask import Flask\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.batch.BatchServiceClient",
"azure.batch.models.OutputFileUploadOptions",
"azure.batch.models.OutputFileBlobContainerDestination",
"sys.exit",
"azure.batch.batch_auth.SharedKeyCredentials"
] | [((980, 1073), 'azure.batch.batch_auth.SharedKeyCredentials', 'SharedKeyCredentials', (["os.environ['AZ_BATCH_ACCOUNT_NAME']", "os.environ['AZURE_BATCH_KEY']"], {}), "(os.environ['AZ_BATCH_ACCOUNT_NAME'], os.environ[\n 'AZURE_BATCH_KEY'])\n", (1000, 1073), False, 'from azure.batch.batch_auth import SharedKeyCredenti... |
import pymongo
class Database:
"""
Manages the MongoDB connection
"""
def __init__(self, schema="twitter"):
self.schema = schema
self.client = None
self.database = None
self.closed = True
def connect(self):
"""
Opens a connection.
... | [
"pymongo.MongoClient"
] | [((406, 427), 'pymongo.MongoClient', 'pymongo.MongoClient', ([], {}), '()\n', (425, 427), False, 'import pymongo\n')] |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import unittest
from src.api_reader import *
class TestReferenceMethods(unittest.TestCase):
def setUp(self):
self.test_api_model = {
"shapes": {
"RegisterTaskDefini... | [
"unittest.main"
] | [((7764, 7779), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7777, 7779), False, 'import unittest\n')] |
#!/usr/bin/env python
# encoding: utf-8
# Attention-Based Aspect-Based Sentiment Extraction 2 (ABABSE2).
#
# https://github.com/LucaZampierin/ABABSE
#
# Adapted from Trusca, Wassenberg, Frasincar and Dekker (2020). Changes have been made to adapt the methods
# to the current project and to adapt the scripts to... | [
"nn_layer.reduce_mean_with_len",
"nn_layer.softmax_layer",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.matmul",
"tensorflow.ConfigProto",
"tensorflow.Variable",
"sklearn.metrics.f1_score",
"nn_layer.bi_dynamic_rnn_abse",
"utils.load_inputs_twitter",
"tensorflow.placeholder",
"ten... | [((1088, 1126), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (1124, 1126), True, 'import tensorflow as tf\n'), ((1074, 1085), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1083, 1085), False, 'import os, sys\n'), ((1790, 1827), 'tensorflow.nn.dropout', 'tf.nn.... |
import logging
import socket
from pathlib import Path
from typing import List, Optional
import click
from waitress import serve
from .app import create_app
from .config import Config
from .editor import (
Section,
create_project_dir,
export_presentation,
get_project,
get_scene,
populate_projec... | [
"socket.socket",
"click.option",
"click.command",
"pathlib.Path",
"waitress.serve",
"logging.getLogger"
] | [((2191, 2206), 'click.command', 'click.command', ([], {}), '()\n', (2204, 2206), False, 'import click\n'), ((2208, 2275), 'click.option', 'click.option', (['"""--debug"""'], {'is_flag': '(True)', 'help': '"""Launch in Debug mode."""'}), "('--debug', is_flag=True, help='Launch in Debug mode.')\n", (2220, 2275), False, ... |