code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright 2020 <NAME>. All rights reserved
# Created on Tue Feb 11 12:29:35 2020
# Author: <NAME>, Purdue University
#
#
# The original code came with the following disclaimer:
#
# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warra... | [
"numpy.sum",
"numpy.unique",
"numpy.zeros",
"numpy.argsort",
"numpy.array",
"numpy.concatenate"
] | [((1662, 1679), 'numpy.argsort', 'np.argsort', (['label'], {}), '(label)\n', (1672, 1679), True, 'import numpy as np\n'), ((1771, 1796), 'numpy.zeros', 'np.zeros', (['(H.shape[0], 0)'], {}), '((H.shape[0], 0))\n', (1779, 1796), True, 'import numpy as np\n'), ((1860, 1876), 'numpy.unique', 'np.unique', (['label'], {}), ... |
import os
import sys
sys.path.append('.')
sys.path.append('../')
import numpy as np
import cv2
import tensorflow as tf
import matplotlib.pyplot as plt
from dataset.violence import Violence
from dataset.tianchi_guangdong_defect import TianChiGuangdongDefect
if __name__ == '__main__':
config = {
"output shape" : ... | [
"sys.path.append",
"dataset.tianchi_guangdong_defect.TianChiGuangdongDefect"
] | [((22, 42), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (37, 42), False, 'import sys\n'), ((43, 65), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (58, 65), False, 'import sys\n'), ((445, 475), 'dataset.tianchi_guangdong_defect.TianChiGuangdongDefect', 'TianChiGuangdong... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import Poll, PollOption, PollParticipant, PollTranslation
class PollTranslationInlineAdmin(admin.StackedInline):
verbose_name = _(u'poll translation')
... | [
"django.utils.translation.ugettext_lazy",
"django.contrib.admin.site.register"
] | [((891, 927), 'django.contrib.admin.site.register', 'admin.site.register', (['Poll', 'PollAdmin'], {}), '(Poll, PollAdmin)\n', (910, 927), False, 'from django.contrib import admin\n'), ((928, 986), 'django.contrib.admin.site.register', 'admin.site.register', (['PollParticipant', 'PollParticipantAdmin'], {}), '(PollPart... |
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('cli', include_py_files=True) | [
"PyInstaller.utils.hooks.collect_data_files"
] | [((64, 112), 'PyInstaller.utils.hooks.collect_data_files', 'collect_data_files', (['"""cli"""'], {'include_py_files': '(True)'}), "('cli', include_py_files=True)\n", (82, 112), False, 'from PyInstaller.utils.hooks import collect_data_files\n')] |
# Generated by Django 2.1.1 on 2019-02-09 01:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('login', '0004_user_settings'),
]
operations = [
migrations.CreateModel(
nam... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.TextField",
"django.db.models.AutoField"
] | [((373, 466), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (389, 466), False, 'from django.db import migrations, models\... |
import os
from sklearn.metrics.pairwise import pairwise_distances_argmin
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatbot import *
from utils import *
import tensorflow as tf
class ThreadRanker(object):
def __init__(self, paths):
self.word_embeddings, self.embedding... | [
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"os.path.join",
"tensorflow.train.Saver"
] | [((521, 583), 'os.path.join', 'os.path.join', (['self.thread_embeddings_folder', "(tag_name + '.pkl')"], {}), "(self.thread_embeddings_folder, tag_name + '.pkl')\n", (533, 583), False, 'import os\n'), ((1568, 1618), 'tensorflow.GPUOptions', 'tf.GPUOptions', ([], {'per_process_gpu_memory_fraction': '(0.1)'}), '(per_proc... |
import unittest
from poker.card import Card
class CardTest(unittest.TestCase):
def test_has_rank(self):
card = Card(rank = "Queen", suit = "Hearts")
self.assertEqual(card.rank, "Queen")
def test_has_suit(self):
card = Card(rank = "2", suit = "Clubs")
self.assertEqual(card.suit,... | [
"poker.card.Card",
"poker.card.Card.create_standard_52_cards"
] | [((124, 157), 'poker.card.Card', 'Card', ([], {'rank': '"""Queen"""', 'suit': '"""Hearts"""'}), "(rank='Queen', suit='Hearts')\n", (128, 157), False, 'from poker.card import Card\n'), ((252, 280), 'poker.card.Card', 'Card', ([], {'rank': '"""2"""', 'suit': '"""Clubs"""'}), "(rank='2', suit='Clubs')\n", (256, 280), Fals... |
from random import randint
import datetime
import pymysql
import cgi
def getConnection():
return pymysql.connect(host='localhost',
user='root',
password='<PASSWORD>',
db='BookFetch')
def newBook():
Title = input("Enter the title ... | [
"pymysql.connect"
] | [((102, 192), 'pymysql.connect', 'pymysql.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'password': '"""<PASSWORD>"""', 'db': '"""BookFetch"""'}), "(host='localhost', user='root', password='<PASSWORD>', db=\n 'BookFetch')\n", (117, 192), False, 'import pymysql\n')] |
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from allauth.socialac... | [
"django.urls.reverse",
"django.contrib.auth.get_user_model"
] | [((743, 759), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (757, 759), False, 'from django.contrib.auth import get_user_model\n'), ((1255, 1327), 'django.urls.reverse', 'reverse', (['"""users:detail"""'], {'kwargs': "{'username': self.request.user.username}"}), "('users:detail', kwargs={'us... |
import random
import string
import other_info
import re
from dicttoxml import dicttoxml
def make_csrf_state(size):
''' Makes a CSRF state by randomly choosing uppercase letters and digits '''
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(size))
def valid_item_name(item_... | [
"dicttoxml.dicttoxml",
"random.choice",
"re.compile"
] | [((1118, 1216), 're.compile', 're.compile', (['"""/^(https?:\\\\/\\\\/)?([\\\\da-z\\\\.-]+)\\\\.([a-z\\\\.]{2,6})([\\\\/\\\\w \\\\.-]*)*\\\\/?$/"""'], {}), "(\n '/^(https?:\\\\/\\\\/)?([\\\\da-z\\\\.-]+)\\\\.([a-z\\\\.]{2,6})([\\\\/\\\\w \\\\.-]*)*\\\\/?$/'\n )\n", (1128, 1216), False, 'import re\n'), ((3145, 316... |
import numpy as np
import tensorflow as tf
import tensorflow.contrib.distributions as tfd
from integrators import ODERK4, SDEEM
from kernels import OperatorKernel
from gpflow import transforms
from param import Param
float_type = tf.float64
jitter0 = 1e-6
class NPODE:
def __init__(self,Z0,U0,sn0,kern,jitter=jit... | [
"gpflow.transforms.Log1pe",
"kernels.OperatorKernel",
"numpy.asarray",
"tensorflow.reshape",
"integrators.SDEEM",
"tensorflow.eye",
"tensorflow.zeros_like",
"tensorflow.cholesky",
"tensorflow.transpose",
"tensorflow.matmul",
"tensorflow.shape",
"numpy.array",
"tensorflow.squeeze",
"tensorf... | [((2065, 2077), 'integrators.ODERK4', 'ODERK4', (['self'], {}), '(self)\n', (2071, 2077), False, 'from integrators import ODERK4, SDEEM\n'), ((2893, 2909), 'tensorflow.cholesky', 'tf.cholesky', (['Kzz'], {}), '(Kzz)\n', (2904, 2909), True, 'import tensorflow as tf\n'), ((2951, 2998), 'tensorflow.matrix_triangular_solve... |
"""
Some methods for kenetics.s
"""
import carla
import numpy as np
import math
def get_speed(vehicle):
"""
Get speed consider only 2D velocity.
"""
vel = vehicle.get_velocity()
return math.sqrt(vel.x ** 2 + vel.y ** 2) # + vel.z ** 2)
def set_vehicle_speed(vehicle, speed: float):
"""
... | [
"math.sqrt",
"numpy.array",
"numpy.sign",
"numpy.squeeze",
"numpy.dot",
"carla.Vector3D"
] | [((211, 245), 'math.sqrt', 'math.sqrt', (['(vel.x ** 2 + vel.y ** 2)'], {}), '(vel.x ** 2 + vel.y ** 2)\n', (220, 245), False, 'import math\n'), ((718, 751), 'numpy.array', 'np.array', (['[[speed], [0.0], [0.0]]'], {}), '([[speed], [0.0], [0.0]])\n', (726, 751), True, 'import numpy as np\n'), ((822, 854), 'numpy.dot', ... |
import MFRC522
import RPi.GPIO as GPIO
class SimpleMFRC522:
READER = None;
TAG = { 'id' : None, 'text' : ''};
KEY = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
def __init__(self):
self.READER = MFRC522.MFRC522()
def read(self):
tag = self.read_no_block()
while not tag:
... | [
"MFRC522.MFRC522"
] | [((211, 228), 'MFRC522.MFRC522', 'MFRC522.MFRC522', ([], {}), '()\n', (226, 228), False, 'import MFRC522\n')] |
import os
import glob
import json
import logging as lg
from pathlib import Path
from datetime import date, datetime
import yaml
import requests
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.dates import date2num, DateFormatter
import matplotlib.transforms ... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"mohfw_handler.mohfw_data_to_df",
"yaml.load",
"matplotlib.pyplot.axes",
"matplotlib.dates.date2num",
"os.path.join",
"logging.warning",
"mohfw_handler.get_mohfw_stats",
"jinja2.FileSystemLoader",
"jinja2.Environment",
"matplotlib.dates.DateFormat... | [((636, 776), 'logging.basicConfig', 'lg.basicConfig', ([], {'level': 'lg.DEBUG', 'format': '"""[%(asctime)s] [%(levelname)8s] %(filename)s - %(message)s"""', 'datefmt': '"""%d-%b-%Y %I:%M:%S %p"""'}), "(level=lg.DEBUG, format=\n '[%(asctime)s] [%(levelname)8s] %(filename)s - %(message)s', datefmt=\n '%d-%b-%Y %I... |
import requests
from requests.compat import urljoin
import json
import os
import datetime
# https://www.covid19api.dev/#intro
# creating a static dictionary for all the month in the 3 letter format. as this is the only
# sure way of getting it correct without having to do a lot of date parsing.
months = {
1: "jan... | [
"json.dump",
"json.load",
"datetime.datetime.today",
"json.loads",
"os.path.dirname",
"os.path.exists",
"requests.compat.urljoin",
"datetime.datetime.strptime",
"datetime.datetime.now"
] | [((4043, 4068), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (4066, 4068), False, 'import datetime\n'), ((1103, 1128), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1118, 1128), False, 'import os\n'), ((1218, 1230), 'json.load', 'json.load', (['f'], {}), '(f)\n', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 <NAME> <<EMAIL>>
__version__ = '0.2.5a'
__date__ = '2016-08-11'
__author__ = '<NAME> <<EMAIL>>'
__license__ = 'MIT'
import pprint
from hornet import *
from hornet.symbols import (
side, left, right, wing, segment, segments, section, sections,... | [
"hornet.symbols.point",
"hornet.symbols.section",
"hornet.symbols.segment",
"hornet.symbols.segments",
"hornet.symbols.side",
"pprint.pprint",
"hornet.symbols.sections",
"hornet.symbols.wing"
] | [((685, 701), 'hornet.symbols.segment', 'segment', (['left', '(1)'], {}), '(left, 1)\n', (692, 701), False, 'from hornet.symbols import side, left, right, wing, segment, segments, section, sections, point, Side, Id, S, Ss, W\n'), ((711, 727), 'hornet.symbols.segment', 'segment', (['left', '(2)'], {}), '(left, 2)\n', (7... |
import unittest
import random_util
class MyTestCase(unittest.TestCase):
def test_visualize_results(self):
column_width = 20
print("Generated id:".rjust(column_width, ' ') + random_util.generate_id())
print("Generated uuid:".rjust(column_width, ' ') + random_util.generate_uuid())
pr... | [
"unittest.main",
"random_util.generate_token",
"random_util.generate_uuid",
"random_util.generate_id"
] | [((433, 448), 'unittest.main', 'unittest.main', ([], {}), '()\n', (446, 448), False, 'import unittest\n'), ((195, 220), 'random_util.generate_id', 'random_util.generate_id', ([], {}), '()\n', (218, 220), False, 'import random_util\n'), ((281, 308), 'random_util.generate_uuid', 'random_util.generate_uuid', ([], {}), '()... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A common training and evaluation runner to allow for easy and consistent model creation and evalutation
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019, <NAME>"
__license__ = "Creative Commons Attribution-ShareAlike 4.0 Internationa... | [
"pandas.DataFrame",
"utility.batch_predict_proba",
"utility.Evaluator",
"sklearn.base.clone",
"utility.use_project_path",
"sklearn.externals.joblib.Parallel",
"utility.Evaluator.evaluate_classifier_fold",
"sklearn.externals.joblib.delayed",
"sklearn.model_selection.train_test_split",
"skopt.BayesS... | [((2308, 2385), 'utility.batch_predict', 'batch_predict', (['estimator', 'x_fold_test'], {'transformer': 'transformer', 'verbose': '(False)'}), '(estimator, x_fold_test, transformer=transformer, verbose=False)\n', (2321, 2385), False, 'from utility import batch_predict, batch_predict_proba, EvaluationFrame, Evaluator, ... |
from utime import ticks_ms
import network
import time
from umqtt.simple import MQTTClient
STATE_DISCONNECTED = 0
STATE_WLAN_CONNECTING = 1
STATE_WLAN_CONNECTED = 2
STATE_MQTT_CONNECTING = 3
STATE_MQTT_CONNECTED = 4
WLAN_CONNECTION_TIMEOUT_MS = 30 * 1000
MQTT_CONNECTION_TIMEOUT_MS ... | [
"umqtt.simple.MQTTClient",
"utime.ticks_ms",
"network.WLAN"
] | [((398, 426), 'network.WLAN', 'network.WLAN', (['network.STA_IF'], {}), '(network.STA_IF)\n', (410, 426), False, 'import network\n'), ((855, 922), 'umqtt.simple.MQTTClient', 'MQTTClient', (['mqttClientId', 'mqttServer', '(0)', 'mqttUsername', 'mqttPassword'], {}), '(mqttClientId, mqttServer, 0, mqttUsername, mqttPasswo... |
import cv2
import math
POINTS = []
class PointFilter:
def __init__(self, points):
self._points = points
def deletePoints(self, event, xCoordinate, yCoordinate, flags, params):
if event == cv2.EVENT_RBUTTONDOWN:
diff = list()
for point in self._points:
... | [
"math.sqrt",
"math.pow"
] | [((325, 360), 'math.pow', 'math.pow', (['(point[0] - xCoordinate)', '(2)'], {}), '(point[0] - xCoordinate, 2)\n', (333, 360), False, 'import math\n'), ((384, 419), 'math.pow', 'math.pow', (['(point[1] - yCoordinate)', '(2)'], {}), '(point[1] - yCoordinate, 2)\n', (392, 419), False, 'import math\n'), ((442, 460), 'math.... |
import numpy as np
from fluiddyn.clusters.legi import Calcul2 as Cluster
from critical_Ra_RB import Ra_c_RB as Ra_c_RB_tests
prandtl = 1.0
dim = 2
dt_max = 0.005
end_time = 30
nb_procs = 10
nx = 8
order = 10
stretch_factor = 0.0
Ra_vert = 1750
x_periodicity = False
z_periodicity = False
cluster = Cluster()
clu... | [
"fluiddyn.clusters.legi.Calcul2",
"numpy.log10",
"critical_Ra_RB.Ra_c_RB.items"
] | [((306, 315), 'fluiddyn.clusters.legi.Calcul2', 'Cluster', ([], {}), '()\n', (313, 315), True, 'from fluiddyn.clusters.legi import Calcul2 as Cluster\n'), ((718, 739), 'critical_Ra_RB.Ra_c_RB.items', 'Ra_c_RB_tests.items', ([], {}), '()\n', (737, 739), True, 'from critical_Ra_RB import Ra_c_RB as Ra_c_RB_tests\n'), ((8... |
#!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pandas as pd
from matplotlib import pyplot as plt
import pmagpy.pmag as pmag
import pmagpy.pmagplotlib as pmagplotlib
from pmag_env import set_env
import operator
... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"pmagpy.pmag.fshdev",
"matplotlib.pyplot.figure",
"matplotlib.get_backend",
"pmagpy.pmagplotlib.plot_init",
"matplotlib.pyplot.axvline",
"pmagpy.pmag.pseudo",
"pmagpy.pmag.get_dictitem",
"pmagpy.pmagplotlib.draw_figs",
"pmagpy.pmag.dotilt_V",
"pmag... | [((83, 107), 'matplotlib.get_backend', 'matplotlib.get_backend', ([], {}), '()\n', (105, 107), False, 'import matplotlib\n'), ((124, 147), 'matplotlib.use', 'matplotlib.use', (['"""TKAgg"""'], {}), "('TKAgg')\n", (138, 147), False, 'import matplotlib\n'), ((2632, 2662), 'pmagpy.pmag.get_named_arg', 'pmag.get_named_arg'... |
# coding=utf-8
import numpy as np
import reikna.cluda as cluda
from reikna.fft import FFT, FFTShift
import pyopencl.array as clarray
from pyopencl import clmath
from reikna.core import Computation, Transformation, Parameter, Annotation, Type
from reikna.algorithms import PureParallel
from matplotlib import cm
... | [
"numpy.load",
"numpy.set_printoptions",
"statistic_functions4.logg10",
"matplotlib.pyplot.clf",
"reikna.fft.FFTShift",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.ylim",
"time.clock",
"statistic_functions4.stat",
"matplotlib.pyplot.figure",
"numpy.reshape",
"reikna.cluda.any_api",
"reikna... | [((430, 467), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf'}), '(threshold=np.inf)\n', (449, 467), True, 'import numpy as np\n'), ((500, 515), 'reikna.cluda.any_api', 'cluda.any_api', ([], {}), '()\n', (513, 515), True, 'import reikna.cluda as cluda\n'), ((555, 579), 'numpy.load', 'np.loa... |
from bot.db.entities.Homework import Homework
class HomeworkManager:
def __init__(self, db):
self._db = db
def getAll(self):
cur = self._db.cursor()
cur.execute('SELECT * FROM Homework')
homeworks = []
for homework in cur.fetchall():
homeworks.append(Home... | [
"bot.db.entities.Homework.Homework"
] | [((316, 459), 'bot.db.entities.Homework.Homework', 'Homework', (['homework[1]', 'homework[2]', 'homework[3]', 'homework[4]', 'homework[5]', 'homework[6]', 'homework[7]', 'homework[8]', 'homework[9]', 'homework[10]'], {}), '(homework[1], homework[2], homework[3], homework[4], homework[5],\n homework[6], homework[7], ... |
import unittest
from atbash_cipher import AtbashCipher
test = AtbashCipher() #instantiate test caesar cipher class
class AtbashCipherEncryptTests(unittest.TestCase):
def test_empty_string(self):
self.assertMultiLineEqual(test.encrypt(''), '')
def test_string_with_only_spaces(self):
self.asser... | [
"unittest.main",
"atbash_cipher.AtbashCipher"
] | [((64, 78), 'atbash_cipher.AtbashCipher', 'AtbashCipher', ([], {}), '()\n', (76, 78), False, 'from atbash_cipher import AtbashCipher\n'), ((1465, 1480), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1478, 1480), False, 'import unittest\n'), ((1485, 1500), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1498... |
from tests.common import DummyPostData
from wtforms.fields import IntegerField
from wtforms.form import Form
class F(Form):
a = IntegerField()
b = IntegerField(default=48)
def test_integer_field():
form = F(DummyPostData(a=["v"], b=["-15"]))
assert form.a.data is None
assert form.a.raw_data == ... | [
"wtforms.fields.IntegerField",
"tests.common.DummyPostData"
] | [((135, 149), 'wtforms.fields.IntegerField', 'IntegerField', ([], {}), '()\n', (147, 149), False, 'from wtforms.fields import IntegerField\n'), ((158, 182), 'wtforms.fields.IntegerField', 'IntegerField', ([], {'default': '(48)'}), '(default=48)\n', (170, 182), False, 'from wtforms.fields import IntegerField\n'), ((224,... |
import os
import argparse
import numpy as np
import tensorflow as tf
import tensorflow.keras as K
from sklearn.metrics import classification_report
from dataset import FLIRDataset
def grid_search(train_labels: str,
test_labels: str,
output:str,
res:tuple=(120, 160)... | [
"argparse.ArgumentParser",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.applications.resnet_v2.ResNet50V2",
"dataset.FLIRDataset",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Input",
"os.path.join",
"numpy.concatenate",
"tensorflow.keras.layers.Flatten"
] | [((1006, 1063), 'dataset.FLIRDataset', 'FLIRDataset', (['train_labels'], {'res': 'res', 'batch_size': 'batch_size'}), '(train_labels, res=res, batch_size=batch_size)\n', (1017, 1063), False, 'from dataset import FLIRDataset\n'), ((1075, 1131), 'dataset.FLIRDataset', 'FLIRDataset', (['test_labels'], {'res': 'res', 'batc... |
"""
Module to read the query and other inputs
"""
from Bio import Entrez
from filter import filter_selector
def inputnow():
"""
Reads the inputs' values
:return: query
"""
# the email must be the user's individual/personal email (NOT an institutional email or a default email
# as this could l... | [
"filter.filter_selector"
] | [((763, 785), 'filter.filter_selector', 'filter_selector', (['query'], {}), '(query)\n', (778, 785), False, 'from filter import filter_selector\n')] |
import sys, re
from datetime import date
version = sys.argv[1]
release_date = date.today().strftime('%Y-%m-%d')
major, minor, patch = version.split('.')
def replace(file_path, pattern, replacement):
updated = re.sub(pattern, replacement, open(file_path).read())
with open(file_path, 'w') as f:
f.write... | [
"datetime.date.today"
] | [((79, 91), 'datetime.date.today', 'date.today', ([], {}), '()\n', (89, 91), False, 'from datetime import date\n')] |
from OpenGLCffi.GL import params
@params(api='gl', prms=['equation'])
def glReferencePlaneSGIX(equation):
pass
| [
"OpenGLCffi.GL.params"
] | [((34, 69), 'OpenGLCffi.GL.params', 'params', ([], {'api': '"""gl"""', 'prms': "['equation']"}), "(api='gl', prms=['equation'])\n", (40, 69), False, 'from OpenGLCffi.GL import params\n')] |
from .modules import DropBlock, SEModule, SKConv2d, BlurPool2d, SplitAttentionModule
import torch.nn as nn
import collections
class BasicOperation(nn.Sequential):
def __init__(self, in_channels, out_channels, stride, groups, bottleneck,
normalization, activation, dropblock, **kwargs):
... | [
"collections.OrderedDict",
"torch.nn.AvgPool2d",
"torch.nn.Conv2d"
] | [((11036, 11099), 'collections.OrderedDict', 'collections.OrderedDict', (['(m for m in modules if m[1] is not None)'], {}), '(m for m in modules if m[1] is not None)\n', (11059, 11099), False, 'import collections\n'), ((10257, 10375), 'torch.nn.Conv2d', 'nn.Conv2d', (['channels', 'channels'], {'kernel_size': 'kernel', ... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 4 09:33:16 2020
@author: jvergere
Ideas: Something similar to the Iridium Constellation:
66 Sats
781 km (7159 semimajor axis)
86.4 inclination
6 Orbit planes 30 degrees apart
11 in each plane
"""
import datetime as dt
import numpy as np
import os
#N... | [
"os.remove",
"numpy.argmax",
"os.path.exists",
"numpy.amax",
"datetime.datetime.strptime",
"comtypes.client.CreateObject"
] | [((433, 468), 'os.path.exists', 'os.path.exists', (['"""MaxOutageData.txt"""'], {}), "('MaxOutageData.txt')\n", (447, 468), False, 'import os\n'), ((763, 796), 'comtypes.client.CreateObject', 'CreateObject', (['"""STK12.Application"""'], {}), "('STK12.Application')\n", (775, 796), False, 'from comtypes.client import Cr... |
#####################################################
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
# Copyright 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | [
"os.open",
"csv.reader",
"retrograph.models.tokenization.convert_to_unicode",
"tensorflow.gfile.Open",
"os.path.join"
] | [((2736, 2766), 'tensorflow.gfile.Open', 'tf.gfile.Open', (['input_file', '"""r"""'], {}), "(input_file, 'r')\n", (2749, 2766), True, 'import tensorflow as tf\n'), ((2788, 2838), 'csv.reader', 'csv.reader', (['f'], {'delimiter': '"""\t"""', 'quotechar': 'quotechar'}), "(f, delimiter='\\t', quotechar=quotechar)\n", (279... |
"""
handle preprocessing and loading of data.
"""
import html
import os.path
import pandas as pd
import re
from nltk import word_tokenize, pos_tag
from nltk.corpus import stopwords, wordnet
from nltk.stem.wordnet import WordNetLemmatizer
class LoadData:
@classmethod
def preprocess_stocktwits_data(cls, fi... | [
"pandas.DataFrame",
"html.unescape",
"pandas.read_csv",
"nltk.pos_tag",
"nltk.corpus.wordnet.synsets",
"datetime.timedelta",
"nltk.corpus.stopwords.words",
"sklearn.externals.joblib.load",
"nltk.stem.wordnet.WordNetLemmatizer",
"re.sub",
"nltk.word_tokenize"
] | [((2575, 2594), 'nltk.stem.wordnet.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (2592, 2594), False, 'from nltk.stem.wordnet import WordNetLemmatizer\n'), ((4695, 4721), 'pandas.read_csv', 'pd.read_csv', (['file_location'], {}), '(file_location)\n', (4706, 4721), True, 'import pandas as pd\n'), ((5126, 52... |
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | [
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.CharField"
] | [((1897, 1943), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'null': '(True)', 'blank': '(True)'}), '(User, null=True, blank=True)\n', (1914, 1943), False, 'from django.db import models\n'), ((1956, 1987), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)'}), '(max_length=64... |
import unittest
# time complexity O(n**2)
# space complexity O(1)
def shell_sort(arr):
n = len(arr)
gap = n//2
while gap >= 1:
for start in range(gap):
gap_insertion_sort(arr, start, gap)
gap = gap//2
return arr
def gap_insertion_sort(arr, start, gap):
n = len(arr)
... | [
"unittest.main"
] | [((706, 721), 'unittest.main', 'unittest.main', ([], {}), '()\n', (719, 721), False, 'import unittest\n')] |
# -*- coding: utf-8 -*-
"""
test_parameter
~~~~~~~~~~~~~~~
Tests for `gagepy.parameter` class
:copyright: 2015 by <NAME>, see AUTHORS
:license: United States Geological Survey (USGS), see LICENSE file
"""
import pytest
import os
import numpy as np
from datetime import datetime
from gagepy.parame... | [
"numpy.array",
"datetime.datetime"
] | [((2211, 2237), 'datetime.datetime', 'datetime', (['(2015)', '(8)', '(5)', '(0)', '(0)'], {}), '(2015, 8, 5, 0, 0)\n', (2219, 2237), False, 'from datetime import datetime\n'), ((2271, 2297), 'datetime.datetime', 'datetime', (['(2015)', '(8)', '(1)', '(0)', '(0)'], {}), '(2015, 8, 1, 0, 0)\n', (2279, 2297), False, 'from... |
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import loader
from haitiwater.settings import PROJECT_VERSION, PROJECT_NAME
from ..utils.get_data import *
@login_required(login_url='/login/')
def index(request):
template = loader.get_template('c... | [
"django.contrib.auth.decorators.login_required",
"django.template.loader.get_template"
] | [((227, 262), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/login/"""'}), "(login_url='/login/')\n", (241, 262), False, 'from django.contrib.auth.decorators import login_required\n'), ((298, 335), 'django.template.loader.get_template', 'loader.get_template', (['"""consumers.... |
from datetime import date
import pandas as pd
from pyrich.record import Record
class Asset(Record):
def __init__(self, table: str) -> None:
super().__init__(table)
def record_current_asset(self, current_asset: float) -> None:
table = 'current_asset'
query = (f'SELECT date FROM {table... | [
"datetime.date.today"
] | [((467, 479), 'datetime.date.today', 'date.today', ([], {}), '()\n', (477, 479), False, 'from datetime import date\n')] |
import os, sys, shutil
import zipfile, subprocess
from serverdaemon.logsetup import setup_logging, logger, log_event
import boto3
from boto3.s3.transfer import S3Transfer, TransferConfig
REGION = "eu-west-1"
BUCKET_NAME = "directive-tiers.dg-api.com"
UE4_BUILDS_FOLDER = "ue4-builds"
INSTALL_FOLDER = r"c:\drift-serverd... | [
"subprocess.Popen",
"subprocess.check_call",
"zipfile.ZipFile",
"os.getpid",
"boto3.client",
"os.makedirs",
"serverdaemon.logsetup.setup_logging",
"serverdaemon.logsetup.log_event",
"os.path.dirname",
"serverdaemon.logsetup.logger.info",
"boto3.s3.transfer.S3Transfer",
"serverdaemon.logsetup.l... | [((699, 748), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'subprocess.PIPE'}), '(command, stdout=subprocess.PIPE)\n', (715, 748), False, 'import zipfile, subprocess\n'), ((1445, 1471), 'boto3.client', 'boto3.client', (['"""s3"""', 'REGION'], {}), "('s3', REGION)\n", (1457, 1471), False, 'import bot... |
from baselines.common.cmd_util import make_mujoco_env
from baselines.common import tf_util as U
from baselines import logger
from baselines.ppo1 import pposgd_simple
from cartpole.cartpole_sim import cartpole_policy
def train(env_id, num_timesteps, seed=0):
U.make_session(num_cpu=1).__enter__()
def policy_f... | [
"baselines.common.tf_util.make_session",
"baselines.ppo1.pposgd_simple.learn",
"baselines.common.cmd_util.make_mujoco_env",
"baselines.logger.configure",
"cartpole.cartpole_sim.cartpole_policy.CartPolePolicy"
] | [((531, 560), 'baselines.common.cmd_util.make_mujoco_env', 'make_mujoco_env', (['env_id', 'seed'], {}), '(env_id, seed)\n', (546, 560), False, 'from baselines.common.cmd_util import make_mujoco_env\n'), ((570, 808), 'baselines.ppo1.pposgd_simple.learn', 'pposgd_simple.learn', (['env', 'policy_fn'], {'max_timesteps': 'n... |
from collections import OrderedDict
class AutoFormSettings(object):
def __init__(self):
if not hasattr(self, "spec"):
raise RuntimeError("%s instance has no 'spec' attribute"
% self.__class__.__name__)
for attrname in self.spec.keys():
setatt... | [
"collections.OrderedDict"
] | [((394, 724), 'collections.OrderedDict', 'OrderedDict', (["[('north', {'type': 'bool', 'tooltip': 'Enable/disable wall to the north'}),\n ('south', {'type': 'bool', 'tooltip':\n 'Enable/disable wall to the south'}), ('east', {'type': 'bool',\n 'tooltip': 'Enable/disable wall to the east'}), ('west', {'type':\n... |
# encoding: utf-8
import time
import unittest
from timingsutil import Stopwatch
import logging_helper
logging = logging_helper.setup_logging()
class TestConfiguration(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_stopwatch(self):
stopwatch = Stopw... | [
"unittest.main",
"time.sleep",
"logging_helper.setup_logging",
"timingsutil.Stopwatch"
] | [((113, 143), 'logging_helper.setup_logging', 'logging_helper.setup_logging', ([], {}), '()\n', (141, 143), False, 'import logging_helper\n'), ((525, 540), 'unittest.main', 'unittest.main', ([], {}), '()\n', (538, 540), False, 'import unittest\n'), ((315, 326), 'timingsutil.Stopwatch', 'Stopwatch', ([], {}), '()\n', (3... |
# -*- coding: utf-8 -*-
"""
apx_data
mantém as informações sobre o dicionário de procedimento de aproximação
revision 0.2 2015/nov mlabru
pep8 style conventions
revision 0.1 2014/nov mlabru
initial release (Linux/Python)
"""
# < imports >---------------------------------------------------------------------------... | [
"PyQt5.QtCore.QFile",
"model.items.parser_utils.parse_root_element",
"control.events.events_basic.CQuit",
"model.items.parser_utils.parse_aproximacao",
"sys.exit",
"PyQt5.QtXml.QDomDocument",
"logging.getLogger",
"model.items.apx_new.CApxNEW"
] | [((6016, 6039), 'PyQt5.QtCore.QFile', 'QtCore.QFile', (['fs_apx_pn'], {}), '(fs_apx_pn)\n', (6028, 6039), False, 'from PyQt5 import QtCore\n'), ((6832, 6866), 'PyQt5.QtXml.QDomDocument', 'QtXml.QDomDocument', (['"""aproximacoes"""'], {}), "('aproximacoes')\n", (6850, 6866), False, 'from PyQt5 import QtXml\n'), ((7753, ... |
# Generated by Django 3.1.5 on 2021-01-18 03:51
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classes', '0003_auto_20210117_2058'),
]
operations = [
migrations.AlterField(
model_name='class',
... | [
"django.db.models.DecimalField"
] | [((363, 414), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'decimal_places': '(2)', 'max_digits': '(8)'}), '(decimal_places=2, max_digits=8)\n', (382, 414), False, 'from django.db import migrations, models\n')] |
#coding:utf-8
#
# id: bugs.core_6108
# title: Regression: FB3 throws "Datatypes are not comparable in expression" in procedure parameters
# decription:
# Confirmed bug on 4.0.0.1567; 3.0.5.33160.
# Works fine on 4.0.0.1573; 3.0.x is still affected
# ... | [
"pytest.mark.version",
"pytest.fail",
"firebird.qa.db_factory"
] | [((569, 614), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (579, 614), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((1224, 1252), 'pytest.mark.version', 'pytest.mark.version', (['""">=2.5"""'], {}), "('>=2.5... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_batchbald.ipynb (unless otherwise specified).
__all__ = ['compute_conditional_entropy', 'compute_entropy', 'CandidateBatch', 'get_batchbald_batch', 'get_bald_batch']
# Cell
from dataclasses import dataclass
from typing import List
import torch
import math
from tqdm.auto ... | [
"torch.logsumexp",
"torch.topk",
"torch.empty",
"toma.toma.execute.chunked",
"tqdm.auto.tqdm",
"torch.exp",
"batchbald_redux.joint_entropy.DynamicJointEntropy",
"torch.cuda.is_available",
"math.log",
"torch.sum",
"torch.log"
] | [((534, 568), 'torch.empty', 'torch.empty', (['N'], {'dtype': 'torch.double'}), '(N, dtype=torch.double)\n', (545, 568), False, 'import torch\n'), ((581, 635), 'tqdm.auto.tqdm', 'tqdm', ([], {'total': 'N', 'desc': '"""Conditional Entropy"""', 'leave': '(False)'}), "(total=N, desc='Conditional Entropy', leave=False)\n",... |
#/usr/bin/python
import re;
import subprocess;
cmd="\nfind . -name \"*nti21_cut.grd\"\n";
pipe=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE).stdout;
ntis=pipe.read().split();
pipe.close();
for nti in ntis:
jday=nti[nti.find(".A")+6:nti.find(".A")+9];
vdir=nti[nti.find("/")+1:nti.rfind("/")];
image="data... | [
"subprocess.Popen",
"re.search"
] | [((97, 154), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), '(cmd, shell=True, stdout=subprocess.PIPE)\n', (113, 154), False, 'import subprocess\n'), ((409, 466), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), '(... |
import re
import csv
import pandas as pd
f= open("data-errors.txt",'r',encoding="utf8")
fc = f.read()
fcbRegex = re.compile(r"line(\s\d+)")
clear = re.findall(fcbRegex,fc)
for i in clear:
print("lines",i)
arr=clear
print("array is",arr)
count = 1
reader = csv.reader(open('amazon_reviews_us_Watches_v1_00.tsv'... | [
"re.findall",
"re.compile"
] | [((116, 143), 're.compile', 're.compile', (['"""line(\\\\s\\\\d+)"""'], {}), "('line(\\\\s\\\\d+)')\n", (126, 143), False, 'import re\n'), ((152, 176), 're.findall', 're.findall', (['fcbRegex', 'fc'], {}), '(fcbRegex, fc)\n', (162, 176), False, 'import re\n')] |
# coding: utf-8
"""
Running a slave instance.
"""
import logging
import sys
import time
import traceback
import dill as pickle
import zmq
logger = logging.getLogger(__name__)
class ExceptionPicklingError(Exception):
"""Represent an error attempting to pickle the result of a task"""
class TaskSystemExit(Excepti... | [
"traceback.format_tb",
"dill.dumps",
"time.time",
"dill.loads",
"sys.exc_info",
"sys.exit",
"logging.getLogger",
"zmq.Context"
] | [((150, 177), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (167, 177), False, 'import logging\n'), ((3056, 3069), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (3067, 3069), False, 'import zmq\n'), ((2214, 2232), 'dill.loads', 'pickle.loads', (['data'], {}), '(data)\n', (2226, 2232), ... |
# -*- coding: utf-8 -*-
# @Time : 2020/2/12 15:47
# @Author : Chen
# @File : datasets.py
# @Software: PyCharm
import os, warnings
from mxnet.gluon.data import dataset, sampler
from mxnet import image
import numpy as np
class IdxSampler(sampler.Sampler):
"""Samples elements from [0, length) randomly without ... | [
"os.path.join",
"os.path.isdir",
"numpy.array",
"mxnet.image.imread",
"os.path.splitext",
"warnings.warn",
"os.path.expanduser",
"os.listdir",
"numpy.random.shuffle"
] | [((741, 767), 'numpy.random.shuffle', 'np.random.shuffle', (['indices'], {}), '(indices)\n', (758, 767), True, 'import numpy as np\n'), ((1879, 1903), 'os.path.expanduser', 'os.path.expanduser', (['root'], {}), '(root)\n', (1897, 1903), False, 'import os, warnings\n'), ((2991, 3035), 'mxnet.image.imread', 'image.imread... |
'''
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | [
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier",
"joblib.dump"
] | [((1347, 1379), 'pandas.read_csv', 'pd.read_csv', (['"""data/diabetes.csv"""'], {}), "('data/diabetes.csv')\n", (1358, 1379), True, 'import pandas as pd\n'), ((1463, 1487), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {}), '()\n', (1485, 1487), False, 'from sklearn.ensemble import RandomFor... |
#!/usr/bin/env python
from setuptools import setup
setup(
name='pyr',
version='0.4.1',
description='A nicer REPL for Python.',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/zain/pyr',
packages=['pyr'],
install_requires=['pygments'],
scripts=['bin/pyr'],
)
| [
"setuptools.setup"
] | [((53, 287), 'setuptools.setup', 'setup', ([], {'name': '"""pyr"""', 'version': '"""0.4.1"""', 'description': '"""A nicer REPL for Python."""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/zain/pyr"""', 'packages': "['pyr']", 'install_requires': "['pygments']", 'scripts': "['... |
#!/usr/bin/env python
import copy
import glob
import logging
import os
import re
import numpy as np
from astropy.io import fits
from scipy import interpolate, ndimage, optimize, signal
try:
from charis.image import Image
except:
from image import Image
log = logging.getLogger('main')
class PSFLets:
""... | [
"numpy.arctan2",
"numpy.sum",
"numpy.amin",
"astropy.io.fits.PrimaryHDU",
"numpy.ones",
"numpy.sin",
"numpy.arange",
"numpy.exp",
"scipy.optimize.minimize",
"numpy.meshgrid",
"scipy.signal.convolve2d",
"numpy.isfinite",
"numpy.linspace",
"scipy.ndimage.interpolation.spline_filter",
"re.s... | [((271, 296), 'logging.getLogger', 'logging.getLogger', (['"""main"""'], {}), "('main')\n", (288, 296), False, 'import logging\n'), ((12613, 12634), 'numpy.arctan2', 'np.arctan2', (['(1.926)', '(-1)'], {}), '(1.926, -1)\n', (12623, 12634), True, 'import numpy as np\n'), ((13936, 13947), 'numpy.zeros', 'np.zeros', (['n'... |
import unittest
import cap
class TestCap(unittest.TestCase):
def test_single_word(self):
text = 'python'
result = cap.cap_text(text)
self.assertEquals(result, 'Python')
def test_multiple_word(self):
text = 'python django'
result = cap.cap_text(text)
... | [
"unittest.main",
"cap.cap_text"
] | [((404, 419), 'unittest.main', 'unittest.main', ([], {}), '()\n', (417, 419), False, 'import unittest\n'), ((143, 161), 'cap.cap_text', 'cap.cap_text', (['text'], {}), '(text)\n', (155, 161), False, 'import cap\n'), ((298, 316), 'cap.cap_text', 'cap.cap_text', (['text'], {}), '(text)\n', (310, 316), False, 'import cap\... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Demo showing how km_dict and insegtannotator may be used together for
interactive segmentation.
@author: vand and abda
"""
import sys
import insegtannotator
import skimage.io
import skimage.data
import km_dict
import numpy as np
#%% EXAMPLE 1: glass fibres
## load... | [
"km_dict.build_km_tree",
"numpy.argmax",
"numpy.zeros",
"km_dict.dictprob_to_improb",
"km_dict.search_km_tree",
"numpy.max",
"insegtannotator.PyQt5.QtWidgets.QApplication",
"km_dict.improb_to_dictprob",
"sys.exit",
"insegtannotator.InSegtAnnotator"
] | [((753, 876), 'km_dict.build_km_tree', 'km_dict.build_km_tree', (['image_float', 'patch_size', 'branching_factor', 'number_training_patches', 'number_layers', 'normalization'], {}), '(image_float, patch_size, branching_factor,\n number_training_patches, number_layers, normalization)\n', (774, 876), False, 'import km... |
#! /usr/bin/python3
"""
Description
-----------
Class to communicate with Atlas Scientific OEM sensors in I2C mode.
Atlas Scientific i2c by GreenPonik
Source code is based on Atlas Scientific documentations:
https://www.atlas-scientific.com/files/EC_oem_datasheet.pdf
https://atlas-scientific.com/files/oem_pH_datashe... | [
"time.sleep"
] | [((3274, 3304), 'time.sleep', 'time.sleep', (['self._long_timeout'], {}), '(self._long_timeout)\n', (3284, 3304), False, 'import time\n'), ((7030, 7060), 'time.sleep', 'time.sleep', (['self._long_timeout'], {}), '(self._long_timeout)\n', (7040, 7060), False, 'import time\n'), ((7562, 7592), 'time.sleep', 'time.sleep', ... |
from datetime import datetime
import os
class core:
def __init__(self, environ = None, location = None):
self.response = None
if environ == None and location == None:
#If the environ and the location are None, no make anything.
self.response = """<h1>Petitio... | [
"os.remove",
"tools.main.main",
"tools.Utilities.buildRq",
"datetime.datetime.now",
"os.listdir"
] | [((1358, 1409), 'os.listdir', 'os.listdir', (["(self.environ['DOCUMENT_ROOT'] + 'logs/')"], {}), "(self.environ['DOCUMENT_ROOT'] + 'logs/')\n", (1368, 1409), False, 'import os\n'), ((1420, 1434), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1432, 1434), False, 'from datetime import datetime\n'), ((2572, ... |
from flask import Blueprint, request, Response, render_template
from model.roads import Roads
from pyldapi import ContainerRenderer
import conf
import ast
import folium
print(__name__)
routes = Blueprint('controller', __name__)
DEFAULT_ITEMS_PER_PAGE=50
@routes.route('/', strict_slashes=True)
def home():
return r... | [
"flask.Blueprint",
"conf.db_select",
"flask.request.values.get",
"pyldapi.ContainerRenderer",
"folium.Map",
"flask.render_template",
"folium.PolyLine",
"flask.Response",
"model.roads.Roads"
] | [((194, 227), 'flask.Blueprint', 'Blueprint', (['"""controller"""', '__name__'], {}), "('controller', __name__)\n", (203, 227), False, 'from flask import Blueprint, request, Response, render_template\n'), ((319, 347), 'flask.render_template', 'render_template', (['"""home.html"""'], {}), "('home.html')\n", (334, 347), ... |
"""
Prepared by Backend/Server Team - Sheldon, Martin, Brian, Sarah, Veronica.
"""
from django.urls import re_path
from .consumers import ChatConsumer
# Assign pattern to activate selected websocket
websocket_urlpatterns = [
re_path(r'^ws/chat/(?P<room_name>[^/]+)/$', ChatConsumer),
]
| [
"django.urls.re_path"
] | [((231, 287), 'django.urls.re_path', 're_path', (['"""^ws/chat/(?P<room_name>[^/]+)/$"""', 'ChatConsumer'], {}), "('^ws/chat/(?P<room_name>[^/]+)/$', ChatConsumer)\n", (238, 287), False, 'from django.urls import re_path\n')] |
import pytest
import common
import time
from common import client, volume_name # NOQA
from common import SIZE, DEV_PATH
from common import check_volume_data, get_self_host_id, get_volume_endpoint
from common import write_volume_random_data
from common import RETRY_COUNTS, RETRY_ITERVAL
@pytest.mark.coretest # NOQ... | [
"common.get_self_host_id",
"common.check_volume_data",
"common.k8s_delete_replica_pods_for_volume",
"common.client.create_volume",
"common.wait_for_volume_healthy",
"common.write_volume_random_data",
"common.wait_for_volume_detached",
"common.client.delete",
"common.wait_for_volume_delete",
"commo... | [((529, 624), 'common.client.create_volume', 'client.create_volume', ([], {'name': 'volume_name', 'size': 'size', 'numberOfReplicas': '(2)', 'baseImage': 'base_image'}), '(name=volume_name, size=size, numberOfReplicas=2,\n baseImage=base_image)\n', (549, 624), False, 'from common import client, volume_name\n'), ((66... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-02-20 06:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('landing', '0008_remove_featurescover_active'),
]
o... | [
"django.db.models.URLField",
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.migrations.DeleteModel",
"django.db.models.AutoField",
"django.db.models.BooleanField"
] | [((1299, 1371), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""presentation"""', 'name': '"""features_cover"""'}), "(model_name='presentation', name='features_cover')\n", (1321, 1371), False, 'from django.db import migrations, models\n'), ((1416, 1460), 'django.db.migrations.Delet... |
import argparse
import numpy as np
import matplotlib.pyplot as plt
from FAUSTPy import *
#######################################################
# set up command line arguments
#######################################################
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--faustfloat',
... | [
"numpy.absolute",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"numpy.fft.fft",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.log10"
] | [((244, 269), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (267, 269), False, 'import argparse\n'), ((1627, 1693), 'numpy.zeros', 'np.zeros', (['(dattorro.dsp.num_in, args.fs)'], {'dtype': 'dattorro.dsp.dtype'}), '((dattorro.dsp.num_in, args.fs), dtype=dattorro.dsp.dtype)\n', (1635, 1693), Tr... |
#!/usr/bin/python3
import os
import sys
import http.server
import socketserver
import socket
import shutil
from base64 import b64encode
from urllib.parse import quote
from os.path import basename, splitext, join, isfile
from collections import defaultdict
from subprocess import run
from distutils.dir_util import copy_... | [
"os.makedirs",
"os.path.basename",
"os.walk",
"collections.defaultdict",
"os.path.splitext",
"shutil.rmtree",
"os.path.join",
"os.chdir",
"distutils.dir_util.copy_tree"
] | [((447, 469), 'os.path.join', 'join', (['build_dir', '"""css"""'], {}), "(build_dir, 'css')\n", (451, 469), False, 'from os.path import basename, splitext, join, isfile\n'), ((483, 508), 'os.path.join', 'join', (['build_dir', '"""images"""'], {}), "(build_dir, 'images')\n", (487, 508), False, 'from os.path import basen... |
import os
import re
import uuid
import globals
from PIL import Image, ImageDraw, ImageFont
from utils.Asset import ImageAsset
SPACING = 5
back_regex = re.compile(r'back_([0-9]*)\.jpg')
BACK_PIC_UNIT_WIDTH, BACK_PIC_UNIT_HEIGHT = 140, 130
BACK_PIC_NUM_EACH_LINE = 5
def bg_image_gen(back_number, s):
def half_en_l... | [
"PIL.Image.new",
"utils.Asset.ImageAsset.get",
"os.path.getsize",
"os.path.exists",
"PIL.Image.open",
"sys.exc_info",
"utils.Asset.ImageAsset.image_raw",
"PIL.ImageDraw.Draw",
"os.path.join",
"os.access",
"re.compile"
] | [((153, 186), 're.compile', 're.compile', (['"""back_([0-9]*)\\\\.jpg"""'], {}), "('back_([0-9]*)\\\\.jpg')\n", (163, 186), False, 'import re\n'), ((461, 518), 'os.path.join', 'os.path.join', (['globals.staticpath', 'f"""bg/{back_number}.jpg"""'], {}), "(globals.staticpath, f'bg/{back_number}.jpg')\n", (473, 518), Fals... |
import numpy as np
from numpy import linalg as LA
class LDA():
def __init__(self, dim = 2):
self.dim = dim
self.matrixTransf = None
def fit_transform(self, X, labels):
positive = []
negative = []
for i in range(len(labels)):
if labels[i] == 1:
... | [
"numpy.mean",
"numpy.array",
"numpy.matmul",
"numpy.cov",
"numpy.linalg.pinv"
] | [((441, 459), 'numpy.array', 'np.array', (['positive'], {}), '(positive)\n', (449, 459), True, 'import numpy as np\n'), ((479, 497), 'numpy.array', 'np.array', (['negative'], {}), '(negative)\n', (487, 497), True, 'import numpy as np\n'), ((527, 552), 'numpy.mean', 'np.mean', (['positive'], {'axis': '(0)'}), '(positive... |
# Tweepy
# Copyright 2009-2010 <NAME>
# See LICENSE for details.
"""
Tweepy Twitter API library
"""
__version__ = '3.5.0'
__author__ = '<NAME>'
__license__ = 'MIT'
from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category
from tweepy.error import TweepError,... | [
"tweepy.api.API",
"tweepy.limit.RateLimitHandler"
] | [((647, 652), 'tweepy.api.API', 'API', ([], {}), '()\n', (650, 652), False, 'from tweepy.api import API\n'), ((1769, 1826), 'tweepy.limit.RateLimitHandler', 'RateLimitHandler', (['self.consumer_key', 'self.consumer_secret'], {}), '(self.consumer_key, self.consumer_secret)\n', (1785, 1826), False, 'from tweepy.limit imp... |
from datetime import timedelta
import numpy as np
import pandas as pd
import argparse
import torch
import json
import os
from add_csv import csv_to_sqlite, csv_to_json
from sqlnet.dbengine import DBEngine
from sqlova.utils.utils_wikisql import *
from train import construct_hyper_param, get_models
#### prediction ####... | [
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"pandas.read_csv",
"train.get_models",
"sqlnet.dbengine.DBEngine",
"train.construct_hyper_param",
"torch.no_grad"
] | [((364, 389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (387, 389), False, 'import argparse\n'), ((1007, 1036), 'train.construct_hyper_param', 'construct_hyper_param', (['parser'], {}), '(parser)\n', (1028, 1036), False, 'from train import construct_hyper_param, get_models\n'), ((1230, 129... |
import tensorflow as tf
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from PIL import Image
import Network
import dataset
from Network import BATCH_SIZE
from dataset import DataSet
def output_predict(depths, images, depths_discretized, depths_reconstructed, output_dir):
... | [
"numpy.load",
"tensorflow.gfile.Exists",
"numpy.argmax",
"tensorflow.logging.warning",
"dataset.DataSet.filename_to_input_image",
"tensorflow.logging.set_verbosity",
"tensorflow.ConfigProto",
"matplotlib.pyplot.figure",
"numpy.exp",
"tensorflow.nn.softmax",
"tensorflow.data.TextLineDataset",
"... | [((61, 82), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (75, 82), False, 'import matplotlib\n'), ((2575, 2644), 'tensorflow.nn.softmax_cross_entropy_with_logits', 'tf.nn.softmax_cross_entropy_with_logits', ([], {'labels': 'labels', 'logits': 'logits'}), '(labels=labels, logits=logits)\n', (261... |
# ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | [
"twitter.pants.targets.internal.InternalTarget.sort_targets",
"twitter.pants.base.build_invalidator.BuildInvalidator",
"twitter.pants.base.build_invalidator.CacheKeyGenerator.combine_cache_keys",
"pickle.dumps"
] | [((3070, 3155), 'twitter.pants.base.build_invalidator.CacheKeyGenerator.combine_cache_keys', 'CacheKeyGenerator.combine_cache_keys', (['[vt.cache_key for vt in versioned_targets]'], {}), '([vt.cache_key for vt in versioned_targets]\n )\n', (3106, 3155), False, 'from twitter.pants.base.build_invalidator import BuildI... |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | [
"functools.partial",
"json.dump",
"os.remove",
"json.load",
"json.loads",
"configman.value_sources.for_json.ValueSource.write",
"os.unlink",
"tempfile.gettempdir",
"configman.config_manager.Namespace",
"configman.datetime_util.datetime_from_ISO_string",
"os.path.isfile",
"configman.value_sourc... | [((2673, 2708), 'configman.config_manager.Namespace', 'config_manager.Namespace', ([], {'doc': '"""top"""'}), "(doc='top')\n", (2697, 2708), True, 'import configman.config_manager as config_manager\n'), ((2944, 2954), 'cStringIO.StringIO', 'StringIO', ([], {}), '()\n', (2952, 2954), False, 'from cStringIO import String... |