code
stringlengths
20
1.04M
apis
list
extract_api
stringlengths
75
9.94M
""" 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...