code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# Django from django.urls import path from django.views.generic import TemplateView # Local from . import views urlpatterns = [ # Root path('', views.index, name='index',), # Footer path('about/', TemplateView.as_view(template_name='app/pages/about.html'), name='about',), path('faq/', TemplateVie...
[ "django.views.generic.TemplateView.as_view", "django.urls.path" ]
[((145, 180), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (149, 180), False, 'from django.urls import path\n'), ((704, 741), 'django.urls.path', 'path', (['"""join"""', 'views.join'], {'name': '"""join"""'}), "('join', views.join, name='join')\n...
import logging import argparse import blink.main_dense as main_dense logger = logging.getLogger(__name__) class EntityLinker: def __init__(self, model_path, logger=None): self.logger = logger self.models_path = model_path self.config = { "test_entities": None, ...
[ "argparse.Namespace", "blink.main_dense.run", "blink.main_dense.load_models", "logging.getLogger" ]
[((79, 106), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (96, 106), False, 'import logging\n'), ((1107, 1140), 'argparse.Namespace', 'argparse.Namespace', ([], {}), '(**self.config)\n', (1125, 1140), False, 'import argparse\n'), ((1164, 1217), 'blink.main_dense.load_models', 'main_dens...
from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from enumfields.drf.serializers import EnumSupportSerializerMixin from rest_framework.fields import SerializerMethodField from rest_framework.serializers import ( ModelSerializer ) from sorl_thumbnail_serialize...
[ "campaigns.models.CampaignPartyRelation.objects.get", "django.contrib.contenttypes.models.ContentType.objects.get", "rest_framework.fields.SerializerMethodField", "django.contrib.auth.get_user_model", "campaigns.models.CampaignEnrollmentRequest.objects.filter", "team.serializers.TeamListSerializer", "so...
[((549, 565), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (563, 565), False, 'from django.contrib.auth import get_user_model\n'), ((922, 945), 'rest_framework.fields.SerializerMethodField', 'SerializerMethodField', ([], {}), '()\n', (943, 945), False, 'from rest_framework.fields import Ser...
import coffeewhale import time def main(): test_func() @coffeewhale.on_except def test_func(): print('start sleeping') time.sleep(1) print('after sleep') raise Exception() # coffeewhale.notify(url="<KEY>", # result='hello world!') if __name__ == "__main__": main()
[ "time.sleep" ]
[((135, 148), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (145, 148), False, 'import time\n')]
# coding=utf-8 # pylint: disable-msg=E1101,W0612 from datetime import datetime, timedelta import operator from itertools import product, starmap from numpy import nan, inf import numpy as np import pandas as pd from pandas import (Index, Series, DataFrame, isnull, bdate_range, NaT, date_range, ti...
[ "numpy.abs", "operator.add", "operator.pow", "numpy.isnan", "pandas.DatetimeIndex", "numpy.arange", "numpy.float64", "pandas.bdate_range", "pandas.DataFrame", "pandas.offsets.Minute", "numpy.random.randn", "pandas.tseries.index.Timestamp", "pandas.util.testing.rands_array", "datetime.timed...
[((834, 853), 'numpy.random.randn', 'np.random.randn', (['(10)'], {}), '(10)\n', (849, 853), True, 'import numpy as np\n'), ((870, 889), 'numpy.random.randn', 'np.random.randn', (['(10)'], {}), '(10)\n', (885, 889), True, 'import numpy as np\n'), ((934, 959), 'pandas.core.nanops.nangt', 'nanops.nangt', (['left', 'right...
#!/usr/bin/env python3 # Send DHT22 sensor data periodically to AWS IoT and process actuation commands received. import time import datetime import ssl import json import paho.mqtt.client as mqtt import dht22 import pigpio import RPi.GPIO as GPIO # TODO: Change this to the name of our Raspberry Pi, also known as our...
[ "RPi.GPIO.setmode", "RPi.GPIO.setup", "json.dumps", "time.sleep", "paho.mqtt.client.Client", "RPi.GPIO.output", "datetime.datetime.now", "pigpio.pi" ]
[((1451, 1482), 'paho.mqtt.client.Client', 'mqtt.Client', (["(deviceName + '_sr')"], {}), "(deviceName + '_sr')\n", (1462, 1482), True, 'import paho.mqtt.client as mqtt\n'), ((2697, 2719), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (2709, 2719), True, 'import RPi.GPIO as GPIO\n'), ((2804, 2...
# Generated by Django 2.2.2 on 2019-07-18 19:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('weblog', '0011_auto_20190718_1829'), ] operations = [ migrations.AddField( model_name='userdetail', name='phone', ...
[ "django.db.models.CharField" ]
[((336, 390), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(15)', 'null': '(True)'}), '(blank=True, max_length=15, null=True)\n', (352, 390), False, 'from django.db import migrations, models\n')]
import torch import torch.nn as nn from src.network import Conv2d class MCNN(nn.Module): def __init__(self, bn=False): super(MCNN, self).__init__() self.branch1 = nn.Sequential(Conv2d(1, 16, 9, same_padding=True, bn=bn), nn.MaxPool2d(2), ...
[ "torch.nn.MaxPool2d", "src.network.Conv2d", "torch.cat" ]
[((2169, 2199), 'torch.cat', 'torch.cat', (['(x1, x2, x3, x4)', '(1)'], {}), '((x1, x2, x3, x4), 1)\n', (2178, 2199), False, 'import torch\n'), ((201, 243), 'src.network.Conv2d', 'Conv2d', (['(1)', '(16)', '(9)'], {'same_padding': '(True)', 'bn': 'bn'}), '(1, 16, 9, same_padding=True, bn=bn)\n', (207, 243), False, 'fro...
import argparse import multiprocessing import random import shutil from datetime import datetime from functools import partial from pathlib import Path import chainer import chainer.functions as F import chainer.links as L import cupy import numpy as np from chainer import iterators, optimizers, serializers from chain...
[ "numpy.random.seed", "argparse.ArgumentParser", "modified_updater.ModifiedUpdater", "augmentation.flip", "numpy.mean", "numpy.random.randint", "chainer.iterators.SerialIterator", "augmentation.random_rotate", "shutil.rmtree", "resnet.ResNet50", "chainer.training.extensions.LogReport", "modifie...
[((1560, 1613), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""training mnist"""'}), "(description='training mnist')\n", (1583, 1613), False, 'import argparse\n'), ((2759, 2773), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2771, 2773), False, 'from datetime import datetim...
#!/usr/bin/python3 import sys import os import shutil import csv import zipfile import pandas as pd import glob infile = sys.argv[1] outfile = sys.argv[2] # remove holding_folder if it exists, and create new folder # use 'rm -r /holding_folder/* in shell script instead?' holding_path = '/media/secure_volume/holding_...
[ "pandas.DataFrame", "os.mkdir", "zipfile.ZipFile", "os.path.isdir", "pandas.read_csv", "glob.glob", "pandas.read_table", "shutil.rmtree", "os.listdir" ]
[((331, 358), 'os.path.isdir', 'os.path.isdir', (['holding_path'], {}), '(holding_path)\n', (344, 358), False, 'import os\n'), ((392, 414), 'os.mkdir', 'os.mkdir', (['holding_path'], {}), '(holding_path)\n', (400, 414), False, 'import os\n'), ((364, 391), 'shutil.rmtree', 'shutil.rmtree', (['holding_path'], {}), '(hold...
#!/usr/bin/env python # coding=utf-8 # vim:ts=4:sts=4:sw=4:et # # Author: <NAME> # Date: 2019-02-26 18:30:53 +0000 (Tue, 26 Feb 2019) # # https://github.com/harisekhon/nagios-plugins # # License: see accompanying Hari Sekhon LICENSE file # # If you're using my code you're welcome to connect with me on LinkedIn #...
[ "sys.path.append", "os.path.dirname", "traceback.format_exc", "os.path.join", "sys.exit" ]
[((798, 827), 'os.path.join', 'os.path.join', (['srcdir', '"""pylib"""'], {}), "(srcdir, 'pylib')\n", (810, 827), False, 'import os\n'), ((828, 851), 'sys.path.append', 'sys.path.append', (['libdir'], {}), '(libdir)\n', (843, 851), False, 'import sys\n'), ((762, 787), 'os.path.dirname', 'os.path.dirname', (['__file__']...
import os import json __author__ = '<NAME> <<EMAIL>>' class JSONStorage: """ File storage for a dictionary. """ file = '' # file name of storage file data = None # data dict indent = ' ' # indent prefix for pretty printing json files def __init__(self, path, name): """ ...
[ "json.dump", "json.load", "os.path.join", "os.makedirs" ]
[((528, 560), 'os.makedirs', 'os.makedirs', (['path'], {'exist_ok': '(True)'}), '(path, exist_ok=True)\n', (539, 560), False, 'import os\n'), ((598, 622), 'os.path.join', 'os.path.join', (['path', 'name'], {}), '(path, name)\n', (610, 622), False, 'import os\n'), ((963, 1013), 'json.dump', 'json.dump', (['self.data', '...
from django.core.management.base import BaseCommand from django.contrib.admin.models import LogEntry def clear_old_admin_logs(): logs = LogEntry.objects.all() for i in range(2000, len(logs)): logs[i].delete() class Command(BaseCommand): def handle(self, *args, **options): clear_old_admi...
[ "django.contrib.admin.models.LogEntry.objects.all" ]
[((142, 164), 'django.contrib.admin.models.LogEntry.objects.all', 'LogEntry.objects.all', ([], {}), '()\n', (162, 164), False, 'from django.contrib.admin.models import LogEntry\n')]
#!/usr/bin/env python # # Copyright (c) 2018 SAP SE # 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 # # ...
[ "sqlalchemy.MetaData", "argparse.ArgumentParser", "logging.basicConfig", "sqlalchemy.and_", "sqlalchemy.select", "datetime.datetime.utcnow", "sqlalchemy.ext.declarative.declarative_base", "sqlalchemy.Table", "configparser.SafeConfigParser", "sqlalchemy.create_engine", "sys.exit", "sqlalchemy.o...
[((1047, 1074), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1064, 1074), False, 'import logging\n'), ((1075, 1151), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)-15s %(message)s"""'}), "(level=logging.INFO, format='%(asctime)-15s...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import * from builtins import object READS_LOCATION = 'genest...
[ "future.standard_library.install_aliases" ]
[((210, 244), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (242, 244), False, 'from future import standard_library\n')]
from optparse import OptionParser import os,sys import itertools import re def readSrc(src_dir): lines=[] for root, dirs, files in os.walk(src_dir): for file in files: if file.endswith(".cpp"): lines+=["New_file "+ file] lines_file = open(os.path.join(root, ...
[ "os.mkdir", "os.path.abspath", "re.split", "os.path.join", "optparse.OptionParser", "os.getcwd", "os.path.isdir", "os.walk", "os.path.exists", "re.escape", "os.path.expandvars", "re.findall", "sys.stderr.write", "os.path.expanduser", "sys.exit" ]
[((141, 157), 'os.walk', 'os.walk', (['src_dir'], {}), '(src_dir)\n', (148, 157), False, 'import os, sys\n'), ((6467, 6502), 'os.path.join', 'os.path.join', (['result_dir', '"""run.log"""'], {}), "(result_dir, 'run.log')\n", (6479, 6502), False, 'import os, sys\n'), ((6547, 6585), 'os.path.join', 'os.path.join', (['res...
from importlib.resources import path import sys import os import shutil from git import Repo from subprocess import call from git import RemoteProgress import git from tqdm import tqdm from pathlib import Path dir_path = (os.path.expanduser('~/Documents') + "\server") os.chdir(dir_path) gitaddress = str("https://gith...
[ "tqdm.tqdm", "os.path.join", "os.unlink", "os.path.isdir", "os.system", "os.path.isfile", "os.path.islink", "os.chdir", "shutil.rmtree", "os.path.expanduser", "os.listdir" ]
[((271, 289), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (279, 289), False, 'import os\n'), ((611, 644), 'os.system', 'os.system', (['"""del /F /S /Q /A .git"""'], {}), "('del /F /S /Q /A .git')\n", (620, 644), False, 'import os\n'), ((645, 678), 'os.system', 'os.system', (['"""del /F /S /Q /A .git"""'...
import time import socket import random from subprocess import run, PIPE test_dir = '"/Users/oliver/Google Drive/Cambridge/CST_II/project/testing/gtspeed"' def test_git(): with open('test_strings.txt') as f: for line in f: p = run(['gitmaildir_cli', 'deliver', '--dir='+test_dir], stdout=PIPE, ...
[ "subprocess.run", "socket.gethostname", "random.random", "time.time" ]
[((253, 356), 'subprocess.run', 'run', (["['gitmaildir_cli', 'deliver', '--dir=' + test_dir]"], {'stdout': 'PIPE', 'input': 'line', 'encoding': '"""ascii"""'}), "(['gitmaildir_cli', 'deliver', '--dir=' + test_dir], stdout=PIPE, input=\n line, encoding='ascii')\n", (256, 356), False, 'from subprocess import run, PIPE...
#Program to plot a point from cg_algorithms.circle_algorithms import circle_algorithms from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import sys import math import time def init(): glClearColor(0.0, 0.0, 0.0, 0.0) gluOrtho2D(-250.0, 250.0, -250.0, 250.0) def plot_points(): g...
[ "cg_algorithms.circle_algorithms.circle_algorithms" ]
[((411, 438), 'cg_algorithms.circle_algorithms.circle_algorithms', 'circle_algorithms', (['(60)', '(0)', '(0)'], {}), '(60, 0, 0)\n', (428, 438), False, 'from cg_algorithms.circle_algorithms import circle_algorithms\n'), ((478, 506), 'cg_algorithms.circle_algorithms.circle_algorithms', 'circle_algorithms', (['(100)', '...
import requests from collections import OrderedDict from django.utils.http import urlencode from allauth.socialaccount.providers.core.oauth2.client import ( OAuth2Client, OAuth2Error, ) class WeixinOAuth2Client(OAuth2Client): def get_redirect_url(self, authorization_url, extra_params): params =...
[ "collections.OrderedDict", "allauth.socialaccount.providers.core.oauth2.client.OAuth2Error", "requests.request", "django.utils.http.urlencode" ]
[((613, 626), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (624, 626), False, 'from collections import OrderedDict\n'), ((1333, 1406), 'requests.request', 'requests.request', (['self.access_token_method', 'url'], {'params': 'params', 'data': 'data'}), '(self.access_token_method, url, params=params, data=...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindelec.architecture.get_activation", "mindelec.architecture.LinearBlock" ]
[((1205, 1231), 'mindelec.architecture.get_activation', 'get_activation', (['activation'], {}), '(activation)\n', (1219, 1231), False, 'from mindelec.architecture import get_activation, LinearBlock\n'), ((1251, 1287), 'mindelec.architecture.LinearBlock', 'LinearBlock', (['input_dim', 'hidden_layer'], {}), '(input_dim, ...
from corehq.sql_db.connections import get_db_alias_or_none, ICDS_UCR_CITUS_ENGINE_ID def get_icds_ucr_citus_db_alias(): return get_db_alias_or_none(ICDS_UCR_CITUS_ENGINE_ID)
[ "corehq.sql_db.connections.get_db_alias_or_none" ]
[((133, 179), 'corehq.sql_db.connections.get_db_alias_or_none', 'get_db_alias_or_none', (['ICDS_UCR_CITUS_ENGINE_ID'], {}), '(ICDS_UCR_CITUS_ENGINE_ID)\n', (153, 179), False, 'from corehq.sql_db.connections import get_db_alias_or_none, ICDS_UCR_CITUS_ENGINE_ID\n')]
from django.db.models import Q from .base import EntityType TYPE_VIDEO = "video" class VideoEntity(EntityType): name = TYPE_VIDEO @classmethod def filter_date_lte(cls, qs, dt): return qs.filter(publication_date__lte=dt) @classmethod def filter_date_gte(cls, qs, dt): return qs.f...
[ "django.db.models.Q" ]
[((767, 797), 'django.db.models.Q', 'Q', ([], {'tags__name__icontains': 'query'}), '(tags__name__icontains=query)\n', (768, 797), False, 'from django.db.models import Q\n'), ((682, 706), 'django.db.models.Q', 'Q', ([], {'name__icontains': 'query'}), '(name__icontains=query)\n', (683, 706), False, 'from django.db.models...
import os import matplotlib.pyplot as plt import seaborn as sns from sklearn.metrics import plot_confusion_matrix # Univariate visualization def univariate_plot(data, path, save = True): ''' Plot the data univariately. ''' for col in data.columns: plt.figure(figsize = (10, 8)) ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "sklearn.metrics.plot_confusion_matrix", "seaborn.displot", "os.path.join", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "seaborn.countplot", "seaborn.pairplot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.p...
[((704, 730), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(h, w)'}), '(figsize=(h, w))\n', (714, 730), True, 'import matplotlib.pyplot as plt\n'), ((737, 777), 'seaborn.pairplot', 'sns.pairplot', ([], {'data': 'data', 'palette': 'palette'}), '(data=data, palette=palette)\n', (749, 777), True, 'import se...
#!/usr/bin/env python ########################################################################### ## File : cmsHarvest.py ## Authors : <NAME> (<EMAIL>) ## <NAME> (<EMAIL>) ## <NAME> (<EMAIL>) ## Last change: 20100308 ## ## Purpose : Main program to run all kinds of harvesting. ## ...
[ "optparse.IndentedHelpFormatter.format_usage", "logging.Formatter", "datetime.datetime.utcnow", "six.iteritems", "builtins.range", "os.path.join", "os.path.normpath", "traceback.format_exc", "copy.deepcopy", "Configuration.PyReleaseValidation.ConfigBuilder.ConfigBuilder", "logging.StreamHandler"...
[((18398, 18421), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (18419, 18421), False, 'import logging\n'), ((18553, 18585), 'logging.Formatter', 'logging.Formatter', (['"""%(message)s"""'], {}), "('%(message)s')\n", (18570, 18585), False, 'import logging\n'), ((18651, 18670), 'logging.getLogger',...
#!/usr/bin/env python """Interactive control for the car""" import time import io import pygame import pygame.font import picamera import configuration import helpers.motor_driver as motor_driver_helper import helpers.image as image_helper UP = LEFT = DOWN = RIGHT = ACCELERATE = DECELERATE = False def get_keys(): ...
[ "helpers.motor_driver.set_forward_mode", "pygame.event.get", "helpers.motor_driver.change_pwm_duty_cycle", "helpers.motor_driver.set_right_mode", "helpers.motor_driver.set_left_mode", "helpers.motor_driver.get_pwm_imstance", "helpers.motor_driver.set_idle_mode", "pygame.font.Font", "helpers.motor_dr...
[((839, 857), 'pygame.event.get', 'pygame.event.get', ([], {}), '()\n', (855, 857), False, 'import pygame\n'), ((1400, 1419), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (1417, 1419), False, 'import pygame\n'), ((3605, 3618), 'pygame.init', 'pygame.init', ([], {}), '()\n', (3616, 3618), False, 'import p...
import random from time import sleep print('=+'*30) print(' JOGO DA MEGA SENA ') print('=+'*30) quant=(int(input('Quantos jogos você quer sortear? : '))) lista=[] jogos=[] cont=tot=0 l=0 while tot<= quant-1: cont = 0 while True: numeros = random.randint(1, 60) ...
[ "random.randint", "time.sleep" ]
[((600, 608), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (605, 608), False, 'from time import sleep\n'), ((293, 314), 'random.randint', 'random.randint', (['(1)', '(60)'], {}), '(1, 60)\n', (307, 314), False, 'import random\n')]
"""Support for Xiaomi Yeelight WiFi color bulb.""" from __future__ import annotations import asyncio import logging import voluptuous as vol from yeelight import BulbException from yeelight.aio import AsyncBulb from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry, ConfigEntryNotReady from homeassistan...
[ "voluptuous.Exclusive", "voluptuous.Optional", "voluptuous.Any", "voluptuous.All", "voluptuous.Required", "homeassistant.config_entries.ConfigEntryNotReady", "yeelight.aio.AsyncBulb", "logging.getLogger" ]
[((1420, 1447), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1437, 1447), False, 'import logging\n'), ((1490, 1525), 'voluptuous.Optional', 'vol.Optional', (['ATTR_COUNT'], {'default': '(0)'}), '(ATTR_COUNT, default=0)\n', (1502, 1525), True, 'import voluptuous as vol\n'), ((1548, 1597...
import os import subprocess import georinex as gr import datetime # For naming Rinex files alphabet = 'abcdefghijklmnopqrstuvwx' def convert_T01_to_dat(fullfile): os.system('runpkr00.exe -d "{}"'.format(fullfile)) def convert_dat_to_rinex(fullfile): os.system('teqc.exe -tr d "{}" > "{}"'.format(fullfile.repl...
[ "georinex.gettime", "georinex.rinexheader" ]
[((492, 518), 'georinex.rinexheader', 'gr.rinexheader', (['rinex_file'], {}), '(rinex_file)\n', (506, 518), True, 'import georinex as gr\n'), ((540, 562), 'georinex.gettime', 'gr.gettime', (['rinex_file'], {}), '(rinex_file)\n', (550, 562), True, 'import georinex as gr\n')]
from dataclasses import dataclass import os import logging import json from functools import lru_cache import cv2 import numpy as np import app from util import cvimage as Image logger = logging.getLogger(__name__) net_file = app.cache_path / 'ark_material.onnx' index_file = app.cache_path / 'index_itemid_relation....
[ "json.dump", "json.load", "os.path.join", "os.stat", "app.extra_items_path.joinpath", "os.path.basename", "os.path.dirname", "os.path.exists", "time.strftime", "cv2.dnn.readNetFromONNX", "time.time", "numpy.array", "os.path.getmtime", "requests.get", "datetime.datetime.fromtimestamp", ...
[((190, 217), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (207, 217), False, 'import logging\n'), ((614, 626), 'functools.lru_cache', 'lru_cache', (['(1)'], {}), '(1)\n', (623, 626), False, 'from functools import lru_cache\n'), ((789, 801), 'functools.lru_cache', 'lru_cache', (['(1)'],...
import copy import logging import time import numpy as np import torch import wandb from torch import nn from .utils import transform_list_to_tensor from ....core.robustness.robust_aggregation import RobustAggregator, is_weight_param from ....utils.logging import logger def test( model, device, test_lo...
[ "wandb.log", "torch.ones_like", "copy.deepcopy", "numpy.random.seed", "torch.where", "torch.nn.CrossEntropyLoss", "time.time", "logging.info", "torch.max", "torch.no_grad" ]
[((1748, 1763), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1761, 1763), False, 'import torch\n'), ((6728, 6773), 'logging.info', 'logging.info', (["('add_model. index = %d' % index)"], {}), "('add_model. index = %d' % index)\n", (6740, 6773), False, 'import logging\n'), ((7276, 7287), 'time.time', 'time.time'...
import os, ConfigParser, time, sys sys.path.insert(0, os.path.join(os.getcwd(), "Jinja2-2.3-py2.5.egg")) import jinja2 _config = ConfigParser.SafeConfigParser() _config.read("config.ini") def version(wantInt=True): import commands, re v=re.findall("\(varnish-(.*?)(?: |\))", commands.getoutput("/usr/sbin/va...
[ "ConfigParser.SafeConfigParser", "subprocess.Popen", "os.getcwd", "models.VarnishBackend.select", "jinja2.loaders.FileSystemLoader", "models.VarnishCond.select", "commands.getoutput" ]
[((134, 165), 'ConfigParser.SafeConfigParser', 'ConfigParser.SafeConfigParser', ([], {}), '()\n', (163, 165), False, 'import os, ConfigParser, time, sys\n'), ((68, 79), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (77, 79), False, 'import os, ConfigParser, time, sys\n'), ((1471, 1519), 'commands.getoutput', 'commands.ge...
#!/usr/bin/python # -*- coding: utf-8 -*- from commands.base import CommandBase from py_utils.emu_utils import run, error, input_with_options, UNINSTALL_PATH class Uninstall(CommandBase): def __init__(self): super().__init__() self.name = 'uninstall' self.description = '👋 Uninstalls emu' @staticmeth...
[ "py_utils.emu_utils.error", "py_utils.emu_utils.input_with_options", "py_utils.emu_utils.run" ]
[((453, 480), 'py_utils.emu_utils.run', 'run', (["['sh', UNINSTALL_PATH]"], {}), "(['sh', UNINSTALL_PATH])\n", (456, 480), False, 'from py_utils.emu_utils import run, error, input_with_options, UNINSTALL_PATH\n'), ((497, 523), 'py_utils.emu_utils.error', 'error', (['"""Not uninstalling!"""'], {}), "('Not uninstalling!'...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ from pathlib imp...
[ "pathlib.Path" ]
[((406, 420), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (410, 420), False, 'from pathlib import Path\n')]
import unittest from tensorboardX.crc32c import _crc32c, _crc32c_native, crc32c class CRC32CTest(unittest.TestCase): def test_crc32c(self): data = b'abcd' assert crc32c(data) == 0x92c80a31 def test_crc32c_python(self): data = b'abcd' assert _crc32c(data) == 0x92c80a31 def...
[ "tensorboardX.crc32c._crc32c", "tensorboardX.crc32c._crc32c_native", "tensorboardX.crc32c.crc32c" ]
[((184, 196), 'tensorboardX.crc32c.crc32c', 'crc32c', (['data'], {}), '(data)\n', (190, 196), False, 'from tensorboardX.crc32c import _crc32c, _crc32c_native, crc32c\n'), ((284, 297), 'tensorboardX.crc32c._crc32c', '_crc32c', (['data'], {}), '(data)\n', (291, 297), False, 'from tensorboardX.crc32c import _crc32c, _crc3...
""" """ import psutil def get_virtual_memory(): print(psutil.cpu_count()) return psutil.virtual_memory().percent mem = get_virtual_memory() print(mem) # nested function def print_test_logs(msg): def logger(): print(f'Logging memory data {msg}') def test(): print('a') ...
[ "psutil.virtual_memory", "psutil.cpu_count" ]
[((61, 79), 'psutil.cpu_count', 'psutil.cpu_count', ([], {}), '()\n', (77, 79), False, 'import psutil\n'), ((92, 115), 'psutil.virtual_memory', 'psutil.virtual_memory', ([], {}), '()\n', (113, 115), False, 'import psutil\n')]
#!/usr/bin/python from Solution import Solution obj = Solution() #A = "23" #A = "" A = "238" out = obj.letterCombinations(A) print(out)
[ "Solution.Solution" ]
[((55, 65), 'Solution.Solution', 'Solution', ([], {}), '()\n', (63, 65), False, 'from Solution import Solution\n')]
import subprocess from threading import Timer import signal #from pprint import pprint import sys import random import time import os from probes.base_probe import Base_Probe from core import utils import logging logger = logging.getLogger(__name__) class Probe_Sar(Base_Probe): """SAR probe. Obtains information abou...
[ "core.utils.get_anywhere", "core.utils.run_anywhere", "core.utils.stop_anywhere", "core.utils.get_ip", "logging.getLogger" ]
[((223, 250), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (240, 250), False, 'import logging\n'), ((1211, 1272), 'core.utils.run_anywhere', 'utils.run_anywhere', (['target', '"""sar"""', 'cmd_args', 'None', 'None', '(True)'], {}), "(target, 'sar', cmd_args, None, None, True)\n", (1229,...
# Copyright 2015, A10 Networks # # 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 agr...
[ "neutronclient.neutron.client.Client", "a10_neutron_lbaas.vthunder.keystone.KeystoneFromConfig", "uuid.uuid4", "a10_neutron_lbaas.a10_exceptions.NetworksNotFoundError", "novaclient.client.Client", "a10_neutron_lbaas.a10_exceptions.IdentifierUnspecifiedError", "glanceclient.client.Client", "a10_neutron...
[((966, 996), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (986, 996), False, 'import pprint\n'), ((1005, 1032), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1022, 1032), False, 'import logging\n'), ((3850, 3909), 'a10_neutron_lbaas.vthunder....
import json import pytest import eternal.card @pytest.fixture def json_doorbot(): card_info = json.loads("""{"SetNumber":3, "EternalID":2, "Name":"<NAME>", "CardText":"", "Cost":0, "Influence":"{F}", "Attack":0...
[ "pytest.raises", "json.loads" ]
[((102, 694), 'json.loads', 'json.loads', (['"""{"SetNumber":3,\n "EternalID":2,\n "Name":"<NAME>",\n "CardText":"",\n "Cost":0,\n "Influence":"{F}",\n "Attack":0,\n "Health":3,\n "Rarity":"Co...
import os import redis import hashlib import time import urllib.parse as urlparse from app.schemas.schemas import TrackEvent from app.utils.constants import REDIS_SS_DELIMITER class RedisClient: def __init__(self): endpoint_url = os.environ.get("REDIS_URL", "redis://127.0.0.1:6379") url = urlpar...
[ "os.environ.get", "redis.StrictRedis", "urllib.parse.urlparse", "time.time" ]
[((246, 299), 'os.environ.get', 'os.environ.get', (['"""REDIS_URL"""', '"""redis://127.0.0.1:6379"""'], {}), "('REDIS_URL', 'redis://127.0.0.1:6379')\n", (260, 299), False, 'import os\n'), ((314, 345), 'urllib.parse.urlparse', 'urlparse.urlparse', (['endpoint_url'], {}), '(endpoint_url)\n', (331, 345), True, 'import ur...
import numpy as np import h5py import pandas as pd from svhn_io import load_svhn from keras_uncertainty.utils import classifier_calibration_curve, classifier_calibration_error EPSILON = 1e-10 def load_hdf5_data(filename): inp = h5py.File(filename, "r") preds = inp["preds"][...] inp.close() return p...
[ "pandas.DataFrame", "h5py.File", "numpy.argmax", "keras_uncertainty.utils.classifier_calibration_curve", "numpy.max", "keras_uncertainty.utils.classifier_calibration_error", "svhn_io.load_svhn" ]
[((235, 259), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (244, 259), False, 'import h5py\n'), ((741, 752), 'svhn_io.load_svhn', 'load_svhn', ([], {}), '()\n', (750, 752), False, 'from svhn_io import load_svhn\n'), ((873, 896), 'numpy.max', 'np.max', (['y_probs'], {'axis': '(1)'}), '(y...
import numpy as np import sys import gpflow import VFF from time import time from config import * dim = sys.argv[1] rep = sys.argv[2] print('vff: dimension {}, replicate {}'.format(dim, r)) # data data = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0)) # full_gp def prodkern(dim): return gpflow.kernels.Pro...
[ "gpflow.likelihoods.Gaussian", "numpy.ones", "time.time", "numpy.arange", "gpflow.gpr.GPR", "gpflow.kernels.Matern32" ]
[((469, 523), 'gpflow.gpr.GPR', 'gpflow.gpr.GPR', (["data['Xtrain']", "data['Ytrain']"], {'kern': 'k'}), "(data['Xtrain'], data['Ytrain'], kern=k)\n", (483, 523), False, 'import gpflow\n'), ((323, 392), 'gpflow.kernels.Matern32', 'gpflow.kernels.Matern32', (['(1)'], {'active_dims': '[i]', 'lengthscales': 'lengthscale'}...
import torch.utils.data as data import os import os.path from numpy.random import randint from ops.io import load_proposal_file from transforms import * from ops.utils import temporal_iou class SSNInstance: def __init__( self, start_frame, end_frame, video_frame_count, fps...
[ "ops.io.load_proposal_file", "numpy.random.randint", "ops.utils.temporal_iou" ]
[((7277, 7311), 'ops.io.load_proposal_file', 'load_proposal_file', (['self.prop_file'], {}), '(self.prop_file)\n', (7295, 7311), False, 'from ops.io import load_proposal_file\n'), ((1017, 1102), 'ops.utils.temporal_iou', 'temporal_iou', (['(self.start_frame, self.end_frame)', '(gt.start_frame, gt.end_frame)'], {}), '((...
#!/usr/bin/env python import uuid from construct import Container class SMAPI_Request(object): ''' Implentation of a ICUV Request ''' def __init__(self, function_name, target_identifier, authenticated_userid=b"", password=b"", additional_parameters=b""): self._function_n...
[ "construct.Container" ]
[((1221, 1702), 'construct.Container', 'Container', ([], {'input_length': 'self._input_length', 'function_name_length': 'self._function_name_length', 'function_name': 'self._function_name', 'authenticated_userid_length': 'self._authenticated_userid_length', 'authenticated_userid': 'self._authenticated_userid', 'passwor...
import logging import json from typing import List, Type, Union from keras.models import Model from keras.layers.merge import Concatenate from keras.layers import ( Dense, LSTM, Bidirectional, Embedding, Input, Dropout, TimeDistributed ) import delft.sequenceLabelling.wrapper from delft.utilities.layers impor...
[ "delft.utilities.layers.ChainCRF", "delft.sequenceLabelling.models.get_model", "keras.layers.Dropout", "keras.layers.LSTM", "keras.models.Model", "keras.layers.merge.Concatenate", "keras.layers.Dense", "keras.layers.Embedding", "keras.layers.Input", "logging.getLogger" ]
[((561, 588), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (578, 588), False, 'import logging\n'), ((1278, 1299), 'keras.layers.merge.Concatenate', 'Concatenate', ([], {}), '(**kwargs)\n', (1289, 1299), False, 'from keras.layers.merge import Concatenate\n'), ((2224, 2361), 'keras.layers...
""" This module contains common reusable functions. """ from traceback import print_stack from configparser import ConfigParser from SupportLibraries.ui_helpers import UIHelpers class BaseHelpers(UIHelpers): """ This class includes basic reusable base_helpers. """ def __init__(self, driver): ...
[ "configparser.ConfigParser", "traceback.print_stack" ]
[((648, 662), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (660, 662), False, 'from configparser import ConfigParser\n'), ((814, 827), 'traceback.print_stack', 'print_stack', ([], {}), '()\n', (825, 827), False, 'from traceback import print_stack\n')]
# Copyright (c) 2020, <NAME> # License: MIT License from pathlib import Path from time import perf_counter import ezdxf from ezdxf.render.forms import sphere from ezdxf.addons import MengerSponge from ezdxf.addons.pycsg import CSG DIR = Path('~/Desktop/Outbox').expanduser() doc = ezdxf.new() doc.layers.new('sponge',...
[ "ezdxf.addons.pycsg.CSG", "time.perf_counter", "ezdxf.addons.MengerSponge", "ezdxf.new", "pathlib.Path", "ezdxf.render.forms.sphere" ]
[((284, 295), 'ezdxf.new', 'ezdxf.new', ([], {}), '()\n', (293, 295), False, 'import ezdxf\n'), ((593, 607), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (605, 607), False, 'from time import perf_counter\n'), ((674, 688), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (686, 688), False, 'from time imp...
"""Central data class and associated.""" # --- import -------------------------------------------------------------------------------------- import collections import operator import functools import warnings import numpy as np import h5py import scipy from scipy.interpolate import griddata, interp1d from .._gr...
[ "numpy.kaiser", "numpy.sum", "numpy.nan_to_num", "numpy.empty", "numpy.isnan", "numpy.around", "scipy.interpolate.interp1d", "numpy.prod", "numpy.nanmean", "numpy.full", "numpy.meshgrid", "numpy.isfinite", "scipy.ndimage.interpolation.zoom", "numpy.linspace", "numpy.trapz", "numpy.resu...
[((4139, 4165), 'numpy.array', 'np.array', (['value'], {'dtype': '"""S"""'}), "(value, dtype='S')\n", (4147, 4165), True, 'import numpy as np\n'), ((5409, 5451), 'functools.reduce', 'functools.reduce', (['operator.mul', 'self.shape'], {}), '(operator.mul, self.shape)\n', (5425, 5451), False, 'import functools\n'), ((63...
from . import git import os from .utils import errordie, mkpath, msg def _trim(lines): stripped = [line.strip() for line in lines] return [line for line in stripped if line and not line.startswith('#')] def _git_destname(repository): git_folder = repository.rsplit('/', 1)[1] if git_folder.endswith('...
[ "os.path.join", "os.path.exists" ]
[((1164, 1202), 'os.path.join', 'os.path.join', (['group_folder', 'git_folder'], {}), '(group_folder, git_folder)\n', (1176, 1202), False, 'import os\n'), ((1214, 1241), 'os.path.exists', 'os.path.exists', (['destination'], {}), '(destination)\n', (1228, 1241), False, 'import os\n'), ((1607, 1645), 'os.path.join', 'os....
# Plot polynomial regression on 1d problem # Based on https://github.com/probml/pmtk3/blob/master/demos/linregPolyVsDegree.m import numpy as np import matplotlib.pyplot as plt from pyprobml_utils import save_fig from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression fr...
[ "pyprobml_utils.save_fig", "matplotlib.pyplot.show", "numpy.random.seed", "numpy.empty", "sklearn.preprocessing.MinMaxScaler", "numpy.square", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.PolynomialFeatures", "numpy.max", "numpy.arange", "numpy.array", "numpy.linspace", "n...
[((974, 1009), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(-1, 1)'}), '(feature_range=(-1, 1))\n', (986, 1009), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((1119, 1138), 'numpy.arange', 'np.arange', (['(1)', '(21)', '(1)'], {}), '(1, 21, 1)\n', (1128, 1138), True, 'im...
from _socket import timeout from urllib.error import URLError from pytube import YouTube from pytube.exceptions import RegexMatchError from old_code.Stream import Stream import time import tools as tools class YoutubeVideo(object): # todo (2): subtitles conn_errors = 0 def __init__(self, url, score=0, ...
[ "time.sleep", "pytube.YouTube", "tools.get_clean_string" ]
[((3578, 3612), 'tools.get_clean_string', 'tools.get_clean_string', (['self.title'], {}), '(self.title)\n', (3600, 3612), True, 'import tools as tools\n'), ((1373, 1385), 'pytube.YouTube', 'YouTube', (['url'], {}), '(url)\n', (1380, 1385), False, 'from pytube import YouTube\n'), ((2860, 2873), 'time.sleep', 'time.sleep...
from .conf import Configuration, parse_config, read_config from .model import OpenAmundsen, Model from . import constants, errors, terrain # Get version (method as used by matplotlib: https://github.com/matplotlib/matplotlib/blob/bcc1ce8461f5b6e874baaaa02ef776d0243a4abe/lib/matplotlib/__init__.py#L133-L151) def __get...
[ "setuptools_scm.get_version", "pathlib.Path" ]
[((609, 715), 'setuptools_scm.get_version', 'setuptools_scm.get_version', ([], {'root': 'root', 'version_scheme': '"""post-release"""', 'fallback_version': '"""0.0.0+UNKNOWN"""'}), "(root=root, version_scheme='post-release',\n fallback_version='0.0.0+UNKNOWN')\n", (635, 715), False, 'import setuptools_scm\n'), ((469...
#!/usr/bin/env python3 from snipsTools import SnipsConfigParser from hermes_python.hermes import Hermes # imported to get type check and IDE completion from hermes_python.ontology.dialogue.intent import IntentMessage CONFIG_INI = "config.ini" # If this skill is supposed to run on the satellite, # please get this mq...
[ "hermes_python.hermes.Hermes", "snipsTools.SnipsConfigParser.read_configuration_file" ]
[((790, 843), 'snipsTools.SnipsConfigParser.read_configuration_file', 'SnipsConfigParser.read_configuration_file', (['CONFIG_INI'], {}), '(CONFIG_INI)\n', (831, 843), False, 'from snipsTools import SnipsConfigParser\n'), ((2740, 2757), 'hermes_python.hermes.Hermes', 'Hermes', (['MQTT_ADDR'], {}), '(MQTT_ADDR)\n', (2746...
from web3 import Web3 from brownie import Contract from brownie.convert import to_bytes from brownie.network import accounts from brownie.network.account import Account from brownie import ( Wei, Contract, # Registry, # RegistryController, License, LicenseController, Policy,...
[ "scripts.util.s2b32" ]
[((1411, 1429), 'scripts.util.s2b32', 's2b32', (['ORACLE_NAME'], {}), '(ORACLE_NAME)\n', (1416, 1429), False, 'from scripts.util import get_account, encode_function_data, s2b32, deployGifModule, deployGifService\n'), ((2395, 2414), 'scripts.util.s2b32', 's2b32', (['PRODUCT_NAME'], {}), '(PRODUCT_NAME)\n', (2400, 2414),...
from django.test import TestCase from dojo.tools.acunetix.parser import AcunetixParser from dojo.models import Test class TestAcunetixParser(TestCase): def test_parse_without_file(self): parser = AcunetixParser() findings = parser.get_findings(None, Test()) self.assertEqual(0, len(findings...
[ "dojo.tools.acunetix.parser.AcunetixParser", "dojo.models.Test" ]
[((210, 226), 'dojo.tools.acunetix.parser.AcunetixParser', 'AcunetixParser', ([], {}), '()\n', (224, 226), False, 'from dojo.tools.acunetix.parser import AcunetixParser\n'), ((462, 478), 'dojo.tools.acunetix.parser.AcunetixParser', 'AcunetixParser', ([], {}), '()\n', (476, 478), False, 'from dojo.tools.acunetix.parser ...
from __future__ import unicode_literals from django.db import models import re import json # import nlp try: import Queue as Q #python version < 3.0 except ImportError: import queue as Q #python3.* class wordBlock(): def __init__(self, start, end, kind): self.start = start; self.end = en...
[ "django.db.models.DateTimeField", "django.db.models.TextField", "django.db.models.IntegerField", "json.loads" ]
[((597, 625), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (613, 625), False, 'from django.db import models\n'), ((646, 674), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (662, 674), False, 'from django.db import models\...
from dataclasses import dataclass from debussy_concert.core.config.movement_parameters.base import MovementParametersBase @dataclass(frozen=True) class BigQueryDataPartitioning: partitioning_type: str gcs_partition_schema: str partition_field: str destination_partition: str @dataclass(frozen=True) c...
[ "dataclasses.dataclass" ]
[((125, 147), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (134, 147), False, 'from dataclasses import dataclass\n'), ((296, 318), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (305, 318), False, 'from dataclasses import dataclass\n'), ((415...
import socket def is_connected_to_internet(host="8.8.8.8", port=53, timeout=3): """ Host: 8.8.8.8 (google-public-dns-a.google.com) OpenPort: 53/tcp Service: domain (DNS/TCP) """ try: socket.setdefaulttimeout(timeout) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: ...
[ "socket.setdefaulttimeout", "socket.socket" ]
[((217, 250), 'socket.setdefaulttimeout', 'socket.setdefaulttimeout', (['timeout'], {}), '(timeout)\n', (241, 250), False, 'import socket\n'), ((264, 313), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (277, 313), False, 'import socket\n')]
import psycopg2 import psycopg2.extras import os url = os.getenv('DATABASE_URL') def connection(url): conn = psycopg2.connect(url) return conn def init_db(): con = connection(url) return con def create_tables(): conn = connection(url) curr = conn.cursor() queries = tables() for qu...
[ "os.getenv", "psycopg2.connect" ]
[((56, 81), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (65, 81), False, 'import os\n'), ((116, 137), 'psycopg2.connect', 'psycopg2.connect', (['url'], {}), '(url)\n', (132, 137), False, 'import psycopg2\n')]
import pandas as pd import numpy as np import pickle from keras.preprocessing.text import Tokenizer from keras.preprocessing import sequence from keras.models import Sequential from keras.layers.embeddings import Embedding from keras.layers.convolutional import Conv1D from keras.layers.convolutional import MaxPooling1D...
[ "keras.layers.embeddings.Embedding", "numpy.random.seed", "keras.preprocessing.sequence.pad_sequences", "keras.layers.LSTM", "keras.layers.Flatten", "keras.layers.convolutional.MaxPooling1D", "keras.preprocessing.text.Tokenizer", "numpy.array", "numpy.arange", "keras.callbacks.EarlyStopping", "k...
[((572, 589), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (586, 589), True, 'import numpy as np\n'), ((605, 662), 'pandas.read_pickle', 'pd.read_pickle', (['"""data/pickles/train_after_preprocess.pkl"""'], {}), "('data/pickles/train_after_preprocess.pkl')\n", (619, 662), True, 'import pandas as pd\n'...
from flask import request from flask_restful import Resource from models.category import CategoryModel from schemas.category import CategorySchema category_schema = CategorySchema() category_list_schema = CategorySchema(many=True) class Category(Resource): @classmethod def get(cls, name: str): cate...
[ "flask.request.args.get", "schemas.category.CategorySchema", "models.category.CategoryModel.find_by_name", "models.category.CategoryModel.find_all" ]
[((167, 183), 'schemas.category.CategorySchema', 'CategorySchema', ([], {}), '()\n', (181, 183), False, 'from schemas.category import CategorySchema\n'), ((207, 232), 'schemas.category.CategorySchema', 'CategorySchema', ([], {'many': '(True)'}), '(many=True)\n', (221, 232), False, 'from schemas.category import Category...
# -*- coding: utf-8 -*- import datetime import json import logging import subprocess from email.mime.text import MIMEText from smtplib import SMTP from smtplib import SMTPException from socket import error from jira.client import JIRA from jira.exceptions import JIRAError from staticconf.loader import yaml_loader from...
[ "logging.exception", "subprocess.Popen", "smtplib.SMTP", "email.mime.text.MIMEText", "util.EAException", "logging.warning", "json.dumps", "util.pretty_ts", "jira.client.JIRA", "logging.info", "datetime.timedelta", "staticconf.loader.yaml_loader", "datetime.datetime.now" ]
[((5357, 5371), 'email.mime.text.MIMEText', 'MIMEText', (['body'], {}), '(body)\n', (5365, 5371), False, 'from email.mime.text import MIMEText\n'), ((5907, 5960), 'logging.info', 'logging.info', (["('Sent email to %s' % self.rule['email'])"], {}), "('Sent email to %s' % self.rule['email'])\n", (5919, 5960), False, 'imp...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\restaurants\restaurant_commands.py # Compiled at: 2018-08-28 03:56:41 # Size of source mod 2**32: 29...
[ "restaurants.restaurant_tuning.get_restaurant_zone_director", "server_commands.argument_helpers.get_optional_target", "services.get_active_sim", "services.get_instance_manager", "restaurants.restaurant_utils.get_waitstaff_situation", "server_commands.argument_helpers.TunableInstanceParam", "sims4.protoc...
[((1548, 1589), 'server_commands.argument_helpers.get_optional_target', 'get_optional_target', (['opt_sim', '_connection'], {}), '(opt_sim, _connection)\n', (1567, 1589), False, 'from server_commands.argument_helpers import TunableInstanceParam, OptionalTargetParam, get_optional_target\n'), ((1826, 1856), 'restaurants....
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup(name="frappymongocontent", version="1.0.0", description="Store Implementation for Content in MongoDB", long_description=long_description, long_description_content_type="text/markdown", ...
[ "setuptools.setup" ]
[((99, 519), 'setuptools.setup', 'setup', ([], {'name': '"""frappymongocontent"""', 'version': '"""1.0.0"""', 'description': '"""Store Implementation for Content in MongoDB"""', 'long_description': 'long_description', 'long_description_content_type': '"""text/markdown"""', 'url': '"""https://github.com/ilfrich/frappy-p...
#!/usr/bin/env python3 import unittest import os import shutil from src.data.VideoItem import VideoItem from src.data.MetaDataItem import MetaDataItem from src.executor.FaceBlurrer import FaceBlurrer from numpy.testing import assert_array_equal, assert_raises class TestAnonymizationExecutor(unittest.TestCase): TE...
[ "unittest.main", "os.mkdir", "os.getcwd", "os.path.exists", "shutil.rmtree", "os.path.join" ]
[((509, 542), 'os.path.join', 'os.path.join', (['TEST_DIR', 'TEST_FILE'], {}), '(TEST_DIR, TEST_FILE)\n', (521, 542), False, 'import os\n'), ((1636, 1651), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1649, 1651), False, 'import unittest\n'), ((342, 353), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (351, 353), ...
# Copyright (C) 2019 Intel Corporation # # 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 wri...
[ "tensorflow.contrib.slim.conv2d", "tensorflow.contrib.slim.arg_scope", "tensorflow.squeeze", "tensorflow.contrib.rnn.stack_bidirectional_dynamic_rnn", "tensorflow.contrib.slim.dropout", "tensorflow.reshape", "tensorflow.contrib.slim.fully_connected", "tensorflow.variable_scope", "tensorflow.contrib....
[((1098, 1125), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""shadow"""'], {}), "('shadow')\n", (1115, 1125), True, 'import tensorflow as tf\n'), ((5154, 5185), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""LSTMLayers"""'], {}), "('LSTMLayers')\n", (5171, 5185), True, 'import tensorflow as tf\n'), (...
import json from pyquery import PyQuery from scylla.database import ProxyIP from .base_provider import BaseProvider class ProxyScraperProvider(BaseProvider): def urls(self) -> [str]: return ['https://raw.githubusercontent.com/sunny9577/proxy-scraper/master/proxies.json'] def parse(self, document: ...
[ "scylla.database.ProxyIP", "json.load" ]
[((429, 444), 'json.load', 'json.load', (['text'], {}), '(text)\n', (438, 444), False, 'import json\n'), ((604, 651), 'scylla.database.ProxyIP', 'ProxyIP', ([], {'ip': "ip_port['ip']", 'port': "ip_port['port']"}), "(ip=ip_port['ip'], port=ip_port['port'])\n", (611, 651), False, 'from scylla.database import ProxyIP\n')]
""" bank.accounts ~~~~~~~~~~~~~ This module contains code for managing accounts. """ from .cards import Card from .exceptions import InsufficientBalance, AccountError, ExceedsLimit import time, datetime class Account: """ Base class for accounts, handles balances & transactions. :param account_id: Unique...
[ "datetime.date.today", "time.time" ]
[((937, 958), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (956, 958), False, 'import time, datetime\n'), ((3244, 3265), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (3263, 3265), False, 'import time, datetime\n'), ((4437, 4458), 'datetime.date.today', 'datetime.date.today', ([], {...
# ***** 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...
[ "HTMLTreeParser.HTMLTreeBuilder", "logging.StreamHandler", "cElementTree.Element", "time.clock", "logging.Formatter", "elementtree.ElementTree.tostring", "cElementTree.XMLParser", "cElementTree.TreeBuilder", "sys.exit", "logging.getLogger", "re.compile" ]
[((1784, 1821), 'logging.getLogger', 'logging.getLogger', (['"""koXMLTreeService"""'], {}), "('koXMLTreeService')\n", (1801, 1821), False, 'import logging\n'), ((4853, 4877), 'cElementTree.Element', 'Element', (['tagName', 'tag[2]'], {}), '(tagName, tag[2])\n', (4860, 4877), False, 'from cElementTree import TreeBuilder...
# -*- coding: utf-8 -*- from flask import request, current_app from domain.models import Image, Document from validation.base_validators import ParameterizedValidator import repo class CanCreateFacilityValidator(ParameterizedValidator): def validate(self, f, *args, **kwargs): user_id = repo.get_user_id_f...
[ "flask.request.form.get", "repo.can_user_create_facility", "repo.can_user_edit_facility", "repo.get_user_id_for_user", "flask.current_app.db_session.query" ]
[((302, 352), 'repo.get_user_id_for_user', 'repo.get_user_id_for_user', ([], {'cookies': 'request.cookies'}), '(cookies=request.cookies)\n', (327, 352), False, 'import repo\n'), ((1480, 1530), 'repo.get_user_id_for_user', 'repo.get_user_id_for_user', ([], {'cookies': 'request.cookies'}), '(cookies=request.cookies)\n', ...
from numpy.linalg import norm from numpy import dot def cosine_sim(vec1, vec2): """Calculates the cosine similarity between two vectors Args: vec1 (list of float): A vector vec2 (list of float): A vector Returns: The cosine similarity between the two input vectors ...
[ "numpy.dot", "numpy.linalg.norm" ]
[((338, 353), 'numpy.dot', 'dot', (['vec1', 'vec2'], {}), '(vec1, vec2)\n', (341, 353), False, 'from numpy import dot\n'), ((357, 367), 'numpy.linalg.norm', 'norm', (['vec1'], {}), '(vec1)\n', (361, 367), False, 'from numpy.linalg import norm\n'), ((370, 380), 'numpy.linalg.norm', 'norm', (['vec2'], {}), '(vec2)\n', (3...
import cv2 import numpy as np from elements.yolo import OBJ_DETECTION Object_classes = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', ...
[ "cv2.waitKey", "cv2.imshow", "cv2.VideoCapture", "elements.yolo.OBJ_DETECTION", "cv2.rectangle", "numpy.random.rand", "cv2.destroyAllWindows", "cv2.getWindowProperty", "cv2.namedWindow" ]
[((1145, 1196), 'elements.yolo.OBJ_DETECTION', 'OBJ_DETECTION', (['"""weights/yolov5s.pt"""', 'Object_classes'], {}), "('weights/yolov5s.pt', Object_classes)\n", (1158, 1196), False, 'from elements.yolo import OBJ_DETECTION\n'), ((2131, 2165), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""1627775013.mp4"""'], {}), "('1...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 26 12:25:25 2018 Toy datasets. @author: jlsuarezdiaz """ import numpy as np import pandas as pd from six.moves import xrange from sklearn.preprocessing import LabelEncoder import seaborn as sns import matplotlib.pyplot as plt from sklearn.datasets...
[ "sklearn.datasets.load_iris", "sklearn.datasets.load_digits", "numpy.isin", "numpy.abs", "numpy.random.seed", "numpy.empty", "numpy.mean", "numpy.random.randint", "numpy.sin", "numpy.random.randn", "sklearn.preprocessing.LabelEncoder", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", ...
[((393, 422), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(12, 9)'}), '(figsize=(12, 9))\n', (405, 422), True, 'import matplotlib.pyplot as plt\n'), ((431, 448), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (439, 448), True, 'import matplotlib.pyplot as plt\n'), ((453,...
""" Module wich contains the EditMenu class and some functions linked to this menu """ import wx import sys import os from api.api_pyflakes import main as CheckPySyntax from Utils.voice_synthese import my_speak class EditMenu(wx.Menu): """Inits a instance of a wx.Menu to create a Theme menu and his butt...
[ "os.getcwd", "Utils.voice_synthese.my_speak", "wx.Menu.__init__" ]
[((571, 601), 'wx.Menu.__init__', 'wx.Menu.__init__', (['self', '"""Edit"""'], {}), "(self, 'Edit')\n", (587, 601), False, 'import wx\n'), ((2705, 2716), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2714, 2716), False, 'import os\n'), ((3756, 3767), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3765, 3767), False, 'impo...
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # 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 appli...
[ "json.load", "json.loads", "argparse.ArgumentParser", "dlbs.utils.DictUtils.dump_json_to_file", "collections.defaultdict", "dlbs.processor.Processor" ]
[((2678, 2696), 'json.loads', 'json.loads', (['params'], {}), '(params)\n', (2688, 2696), False, 'import json\n'), ((3731, 3754), 'collections.defaultdict', 'defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (3742, 3754), False, 'from collections import defaultdict\n'), ((5945, 6019), 'dlbs.utils.DictUtils.dump_j...
from flask import render_template import app.charts as charts from . import app @app.route("/") def search(): return render_template('search.html', title='Search') @app.route("/dashboard") def hello(): _dashboard = charts.dashboard.create_charts() return render_template('base.html', ...
[ "app.charts.dashboard.create_charts", "flask.render_template" ]
[((124, 170), 'flask.render_template', 'render_template', (['"""search.html"""'], {'title': '"""Search"""'}), "('search.html', title='Search')\n", (139, 170), False, 'from flask import render_template\n'), ((227, 259), 'app.charts.dashboard.create_charts', 'charts.dashboard.create_charts', ([], {}), '()\n', (257, 259),...
import tempfile import os import requests from tqdm import tqdm from rich import print as rprint from felicette.constants import band_tag_map workdir = os.path.join(os.path.expanduser("~"), "felicette-data") def check_sat_path(id): data_path = os.path.join(workdir, id) if not os.path.exists(data_path): ...
[ "os.path.join", "os.makedirs", "os.path.exists", "rich.print", "requests.get", "os.path.expanduser" ]
[((167, 190), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (185, 190), False, 'import os\n'), ((252, 277), 'os.path.join', 'os.path.join', (['workdir', 'id'], {}), '(workdir, id)\n', (264, 277), False, 'import os\n'), ((432, 457), 'os.path.join', 'os.path.join', (['workdir', 'id'], {}), '(w...
from amcp_pylib.core import Command, command_syntax @command_syntax('MIXER [video_channel:int]{-[layer:int]|-0} KEYER {[keyer:0,1]|0}') def MIXER_KEYER(command: Command) -> Command: """ Replaces layer n+1's alpha with the R (red) channel of layer n, and hides the RGB channels of layer n. If keyer equals 1...
[ "amcp_pylib.core.command_syntax" ]
[((55, 142), 'amcp_pylib.core.command_syntax', 'command_syntax', (['"""MIXER [video_channel:int]{-[layer:int]|-0} KEYER {[keyer:0,1]|0}"""'], {}), "(\n 'MIXER [video_channel:int]{-[layer:int]|-0} KEYER {[keyer:0,1]|0}')\n", (69, 142), False, 'from amcp_pylib.core import Command, command_syntax\n'), ((533, 850), 'amc...
# Generated by Django 2.1.3 on 2018-11-25 09:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('decaptcha', '0001_initial'), ] operations = [ migrations.AlterField( model_name='captcharecord', name='hashkey', ...
[ "django.db.models.CharField" ]
[((335, 391), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'verbose_name': '"""Hashkey"""'}), "(max_length=255, verbose_name='Hashkey')\n", (351, 391), False, 'from django.db import migrations, models\n')]
import re try: from setuptools import setup except ImportError: from distutils.core import setup version = '' with open('schematec/__init__.py', 'r') as fd: regex = re.compile(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]') for line in fd: m = regex.match(line) if m: version = m....
[ "re.compile", "distutils.core.setup" ]
[((348, 984), 'distutils.core.setup', 'setup', ([], {'name': '"""schematec"""', 'packages': "['schematec']", 'package_data': "{'': ['LICENSE']}", 'version': 'version', 'description': '"""Set of tools that makes input data validation easier"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https...
def plot_history(hist): import matplotlib.pyplot as plt plt.figure() plt.xlabel('Epoch') plt.ylabel('Mean Squared Error') plt.plot(hist['epoch'], hist['mean_squared_error'], label='Train Error') plt.plot(hist['epoch'], hist['val_mean_squared_error'], label = 'Val ...
[ "prepare_and_scale_data.prepare_and_scale_data", "pandas.DataFrame", "get_compiled_model.get_compiled_model", "matplotlib.pyplot.show", "create_tensorpad_path.create_tensorpad_path", "matplotlib.pyplot.plot", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.legend", "tensorflow.data.Da...
[((68, 80), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (78, 80), True, 'import matplotlib.pyplot as plt\n'), ((86, 105), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Epoch"""'], {}), "('Epoch')\n", (96, 105), True, 'import matplotlib.pyplot as plt\n'), ((111, 143), 'matplotlib.pyplot.ylabel', 'plt.y...
import asyncio import logging logger = logging.getLogger(__name__) def compute_user_level(user_xp): power = 1 while user_xp >= 2 ** power: power = power + 1 return power class XPAggregator: def __init__(self, redis, levels): self.redis = redis self.levels = levels async...
[ "asyncio.gather", "logging.getLogger" ]
[((40, 67), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (57, 67), False, 'import logging\n'), ((631, 659), 'asyncio.gather', 'asyncio.gather', (['*level_tasks'], {}), '(*level_tasks)\n', (645, 659), False, 'import asyncio\n')]
# global import torch from typing import Union, Optional, Tuple, List def roll(x: torch.Tensor, shift: Union[int, Tuple[int]], axis: Union[int, Tuple[int]]=None)\ -> torch.Tensor: return torch.roll(x, shift, axis) # noinspection PyShadowingBuiltins def flip(x: torch.Tensor, axis: Optional[Union[i...
[ "torch.flip", "torch.roll" ]
[((198, 224), 'torch.roll', 'torch.roll', (['x', 'shift', 'axis'], {}), '(x, shift, axis)\n', (208, 224), False, 'import torch\n'), ((761, 784), 'torch.flip', 'torch.flip', (['x', 'new_axis'], {}), '(x, new_axis)\n', (771, 784), False, 'import torch\n')]
# Copyright 2018 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/LICE...
[ "htmap.utils.timeout_to_seconds", "htmap.utils.wait_for_path_to_exist", "pytest.raises", "pathlib.Path", "datetime.timedelta", "pytest.mark.parametrize" ]
[((905, 948), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""timeout"""', '[0, -1]'], {}), "('timeout', [0, -1])\n", (928, 948), False, 'import pytest\n'), ((853, 867), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (857, 867), False, 'from pathlib import Path\n'), ((873, 901), 'htmap.utils.wa...
import hashlib import logging import time from typing import Tuple logger = logging.getLogger(__name__) _startup_time = int(time.time()) logger.info("Startup time: %s", _startup_time) def gen_hash(key: Tuple[str, ...]) -> str: return hashlib.sha256(str(key + (_startup_time,)).encode("utf-8")).hexdigest()
[ "logging.getLogger", "time.time" ]
[((77, 104), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (94, 104), False, 'import logging\n'), ((126, 137), 'time.time', 'time.time', ([], {}), '()\n', (135, 137), False, 'import time\n')]
import torch import torch.nn as nn from torch.autograd import Variable from torch import autograd import time as t import os from itertools import chain from torchvision import utils from .spectral_normalization import SpectralNorm class WassersteinLoss(torch.nn.Module): def forward(self, x , target): loss...
[ "torch.nn.MSELoss", "torch.nn.ReLU", "torch.nn.ConvTranspose2d", "torch.nn.BCEWithLogitsLoss", "torch.nn.BCELoss", "torch.nn.Tanh", "torch.autograd.Variable", "torch.nn.Conv2d", "torch.FloatTensor", "torch.save", "torch.nn.BatchNorm2d", "torch.Tensor", "torch.nn.LeakyReLU", "torch.nn.Sigmo...
[((1175, 1184), 'torch.nn.Tanh', 'nn.Tanh', ([], {}), '()\n', (1182, 1184), True, 'import torch.nn as nn\n'), ((3587, 3629), 'torch.autograd.Variable', 'Variable', (['interpolated'], {'requires_grad': '(True)'}), '(interpolated, requires_grad=True)\n', (3595, 3629), False, 'from torch.autograd import Variable\n'), ((51...
""" Util functions for SMPL @@batch_skew @@batch_rodrigues @@batch_lrotmin @@batch_global_rigid_transformation """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf def batch_skew(vec, batch_size=None): """ vec is N x 3, batc...
[ "tensorflow.ones", "tensorflow.range", "tensorflow.sin", "tensorflow.reshape", "tensorflow.pad", "tensorflow.eye", "tensorflow.constant", "tensorflow.div", "tensorflow.stack", "tensorflow.matmul", "tensorflow.tile", "tensorflow.concat", "tensorflow.zeros", "tensorflow.name_scope", "tenso...
[((408, 449), 'tensorflow.name_scope', 'tf.name_scope', (['"""batch_skew"""'], {'values': '[vec]'}), "('batch_skew', values=[vec])\n", (421, 449), True, 'import tensorflow as tf\n'), ((549, 580), 'tensorflow.constant', 'tf.constant', (['[1, 2, 3, 5, 6, 7]'], {}), '([1, 2, 3, 5, 6, 7])\n', (560, 580), True, 'import tens...
#!/usr/bin/env python import sys import os # source: https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py # Take a sysroot directory and turn all the absolute symlinks and turn them into # relative ones such that the sysroot is usable within another system. if len(sys.argv) != 2...
[ "os.path.abspath", "os.unlink", "os.readlink", "os.walk", "os.path.islink", "os.path.relpath", "os.symlink", "os.path.join", "sys.exit" ]
[((422, 445), 'os.path.abspath', 'os.path.abspath', (['topdir'], {}), '(topdir)\n', (437, 445), False, 'import os\n'), ((807, 822), 'os.walk', 'os.walk', (['topdir'], {}), '(topdir)\n', (814, 822), False, 'import os\n'), ((379, 390), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (387, 390), False, 'import sys\n'), ((...
from fastapi import FastAPI import pickle from SatImages import SatImage import uvicorn def load_models(): """ load the models from disk and put them in a dictionary Returns: dict: loaded models """ models = { "knn": pickle.load(open("./model_weights/clf.bin", 'rb')) } p...
[ "uvicorn.run", "fastapi.FastAPI" ]
[((623, 632), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (630, 632), False, 'from fastapi import FastAPI\n'), ((957, 1002), 'uvicorn.run', 'uvicorn.run', (['app'], {'host': '"""127.0.0.1"""', 'port': '(8000)'}), "(app, host='127.0.0.1', port=8000)\n", (968, 1002), False, 'import uvicorn\n')]
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('Contacts/', views.Contacts.as_view(), name='contact'), path('Profile/', views.profile.as_view(), name='profile'), ]
[ "django.urls.path" ]
[((71, 106), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (75, 106), False, 'from django.urls import path\n')]
# Copyright 2020 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
[ "google.cloud.bigquery.Client", "flask.Flask", "os.environ.get", "random.random", "concurrent.futures.ThreadPoolExecutor", "datetime.datetime.now", "logging.getLogger" ]
[((842, 869), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (859, 869), False, 'import logging\n'), ((877, 892), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (882, 892), False, 'from flask import Flask, request\n'), ((927, 944), 'google.cloud.bigquery.Client', 'bigquery.Cl...
from dataclasses import dataclass from typing import ClassVar from datalabs.features.features import Features, Value from datalabs.tasks.base import register_task, TaskTemplate, TaskType @register_task(TaskType.kg_prediction) @dataclass class KGPrediction(TaskTemplate): task: TaskType = TaskType.kg_prediction ...
[ "datalabs.features.features.Value", "datalabs.tasks.base.register_task" ]
[((191, 228), 'datalabs.tasks.base.register_task', 'register_task', (['TaskType.kg_prediction'], {}), '(TaskType.kg_prediction)\n', (204, 228), False, 'from datalabs.tasks.base import register_task, TaskTemplate, TaskType\n'), ((1034, 1081), 'datalabs.tasks.base.register_task', 'register_task', (['TaskType.kg_link_tail...
""" this python file is written orientated by the TUIO spezification https://www.tuio.org/?specification It supports only 2D Object|Blob|Cursor Profile | --------------------- | | | Object Cursor Blob """ from pythonosc.osc_message_builder import OscMess...
[ "pythonosc.osc_message_builder.OscMessageBuilder" ]
[((1417, 1455), 'pythonosc.osc_message_builder.OscMessageBuilder', 'OscMessageBuilder', ([], {'address': 'TUIO_OBJECT'}), '(address=TUIO_OBJECT)\n', (1434, 1455), False, 'from pythonosc.osc_message_builder import OscMessageBuilder\n'), ((2463, 2501), 'pythonosc.osc_message_builder.OscMessageBuilder', 'OscMessageBuilder...
import sys import time import forward_messages import helpers try: import config except (ImportError, ModuleNotFoundError): print( "config.py not found. Rename config.example.py to config.py after configuration." ) sys.exit(1) def main(): if config.forward_user: forward_messages....
[ "helpers.write_data", "helpers.load_data", "time.time", "forward_messages.forward", "sys.exit", "helpers.initialize_reddit" ]
[((363, 390), 'helpers.initialize_reddit', 'helpers.initialize_reddit', ([], {}), '()\n', (388, 390), False, 'import helpers\n'), ((461, 487), 'helpers.load_data', 'helpers.load_data', (['"""stats"""'], {}), "('stats')\n", (478, 487), False, 'import helpers\n'), ((755, 789), 'helpers.write_data', 'helpers.write_data', ...
#!/usr/bin/env python import curses import curses.textpad import time from plugin_utils import * class TerminalFrontend: ''' Text based curses terminal frontend for the bot. ''' def __init__(self, stdscr=None): ''' Initialize the frontend. :param stdscr: The curses main window, if one exists. ''' ...
[ "curses.initscr", "curses.endwin" ]
[((406, 422), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (420, 422), False, 'import curses\n'), ((4229, 4244), 'curses.endwin', 'curses.endwin', ([], {}), '()\n', (4242, 4244), False, 'import curses\n')]
# -*- coding: utf-8 -*- # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from typing import Union import h5py import os import traceback from h5grove.encoders import orjson_encode from h5grove.models import LinkResolution from h5grove.utils import NotFoundError from...
[ "h5py.File", "notebook.utils.url_path_join", "h5grove.encoders.orjson_encode", "os.path.exists", "tornado.httpclient.HTTPError", "traceback.format_exc" ]
[((1763, 1805), 'notebook.utils.url_path_join', 'url_path_join', (['self.notebook_dir', 'relfpath'], {}), '(self.notebook_dir, relfpath)\n', (1776, 1805), False, 'from notebook.utils import url_path_join\n'), ((1591, 1611), 'tornado.httpclient.HTTPError', 'HTTPError', (['code', 'msg'], {}), '(code, msg)\n', (1600, 1611...
#!/usr/bin/env python3 """Entropy and information theory related calculations. **Author: <NAME>** """ ######################## Imports ######################## import numpy as np import stp ######################## Helper functions ######################## def _eps_filter(x): """ Checks if the value is wi...
[ "numpy.full", "stp.rand_p", "numpy.log", "stp.self_assembly_transition_matrix", "numpy.zeros", "stp.get_stationary_distribution", "numpy.isclose", "stp.complete_path_space", "numpy.array", "numpy.arange", "numpy.vstack", "numpy.dot", "stp.step", "numpy.unique" ]
[((2633, 2663), 'numpy.log', 'np.log', (['(p_filtered / q[p != 0])'], {}), '(p_filtered / q[p != 0])\n', (2639, 2663), True, 'import numpy as np\n'), ((2676, 2705), 'numpy.dot', 'np.dot', (['p_filtered', 'log_ratio'], {}), '(p_filtered, log_ratio)\n', (2682, 2705), True, 'import numpy as np\n'), ((4922, 4971), 'stp.get...
from src.modules.helper.get_county_pop import get_county_pop from typing import Union def calc_county_per_capita_rate( county_name_clean: str, total_over_period: Union[int, float], _round=True, num_of_people: int = 100000, ): """ Calculates a rate per 100,000 people for a specific county Args...
[ "src.modules.helper.get_county_pop.get_county_pop" ]
[((756, 789), 'src.modules.helper.get_county_pop.get_county_pop', 'get_county_pop', (['county_name_clean'], {}), '(county_name_clean)\n', (770, 789), False, 'from src.modules.helper.get_county_pop import get_county_pop\n')]
import setuptools version = int(setuptools.__version__.split('.')[0]) assert version > 30, "tensorpack installation requires setuptools > 30" from setuptools import setup import os import shutil import sys # setup metainfo CURRENT_DIR = os.path.dirname(__file__) libinfo_py = os.path.join(CURRENT_DIR, 'tensorpack/libin...
[ "pypandoc.convert_file", "setuptools.setup", "os.path.dirname", "setuptools.__version__.split", "os.path.join" ]
[((238, 263), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (253, 263), False, 'import os\n'), ((277, 327), 'os.path.join', 'os.path.join', (['CURRENT_DIR', '"""tensorpack/libinfo.py"""'], {}), "(CURRENT_DIR, 'tensorpack/libinfo.py')\n", (289, 327), False, 'import os\n'), ((589, 634), 'os.pa...