code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import abc from six import with_metaclass class Loop(with_metaclass(abc.ABCMeta, object)): @abc.abstractmethod def name(self): assert False @abc.abstractmethod def close(self): assert False @abc.abstractmethod def open(self): assert False @abc.abstractmethod ...
[ "six.with_metaclass" ]
[((55, 90), 'six.with_metaclass', 'with_metaclass', (['abc.ABCMeta', 'object'], {}), '(abc.ABCMeta, object)\n', (69, 90), False, 'from six import with_metaclass\n')]
from typing import Callable, List, Union import pandas_flavor as pf import pandas as pd from janitor.utils import deprecated_alias @pf.register_dataframe_method @deprecated_alias(new_column="new_column_name", agg_column="agg_column_name") def groupby_agg( df: pd.DataFrame, by: Union[List, Callable, str], ...
[ "janitor.utils.deprecated_alias" ]
[((165, 241), 'janitor.utils.deprecated_alias', 'deprecated_alias', ([], {'new_column': '"""new_column_name"""', 'agg_column': '"""agg_column_name"""'}), "(new_column='new_column_name', agg_column='agg_column_name')\n", (181, 241), False, 'from janitor.utils import deprecated_alias\n')]
import pytesseract import requests from PIL import Image from PIL import ImageFilter import io def process_image(url): image= _get_image(url) image.filter(ImageFilter.SHARPEN) return pytesseract.image_to_string(image) def _get_image(url): pattern_string = requests.get(url).content() return Ima...
[ "requests.get", "io.StringIO", "pytesseract.image_to_string" ]
[((200, 234), 'pytesseract.image_to_string', 'pytesseract.image_to_string', (['image'], {}), '(image)\n', (227, 234), False, 'import pytesseract\n'), ((328, 355), 'io.StringIO', 'io.StringIO', (['pattern_string'], {}), '(pattern_string)\n', (339, 355), False, 'import io\n'), ((278, 295), 'requests.get', 'requests.get',...
""" Created on 24 Mar 2021 @author: <NAME> (<EMAIL>) Modem ----- modem.generic.device-identifier : 3f07553c31ce11715037ac16c24ceddcfb6f7a0b modem.generic.manufacturer : QUALCOMM INCORPORATED modem.generic.model : QUECTEL Mobile Broadband Module modem.ge...
[ "collections.OrderedDict", "re.match", "scs_core.data.datum.Datum.int" ]
[((6658, 6671), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (6669, 6671), False, 'from collections import OrderedDict\n'), ((10057, 10070), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (10068, 10070), False, 'from collections import OrderedDict\n'), ((11482, 11500), 'scs_core.data.datum.D...
#!/home/moringaschool/Documents/django projects/insta-moringa/virtual/bin/python3.6 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
[ "django.core.management.execute_from_command_line" ]
[((151, 189), 'django.core.management.execute_from_command_line', 'management.execute_from_command_line', ([], {}), '()\n', (187, 189), False, 'from django.core import management\n')]
import sys import os import re, getopt key_list = [('A',), ('A#', 'Bb'), ('B', 'Cb'), ('C',), ('C#', 'Db'), ('D',), ('D#', 'Eb'), ('E',), ('F',), ('F#', 'Gb'), ('G',), ('G#', 'Ab')] sharp_flat = ['#', 'b'] sharp_flat_preferences = { 'A': '#', 'A#': 'b', 'Bb': 'b', 'B': '#', 'C': 'b', ...
[ "getopt.getopt", "os.path.basename", "sys.exit", "doctest.testmod", "re.compile" ]
[((510, 538), 're.compile', 're.compile', (['"""[ABCDEFG][#b]?"""'], {}), "('[ABCDEFG][#b]?')\n", (520, 538), False, 'import re, getopt\n'), ((3785, 3796), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (3793, 3796), False, 'import sys\n'), ((3754, 3780), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(_...
import logging import subprocess from typing import Optional from celery import Celery from celery.utils.log import get_logger from code_execution.code_execution import CodeExcution from utils import generate_random_file tmp_dir_path = '/worker/tmp' compiled_dir_path = '/worker/tmp/compiled_files' # Create the cel...
[ "utils.generate_random_file", "celery.Celery", "logging.debug", "code_execution.code_execution.CodeExcution.provide_code_execution_command", "code_execution.code_execution.CodeExcution.get_lang_extension", "logging.info", "celery.utils.log.get_logger", "code_execution.code_execution.CodeExcution.execu...
[((360, 463), 'celery.Celery', 'Celery', (['"""code-executions-tasks"""'], {'broker': '"""pyamqp://guest@rabbit//"""', 'backend': '"""amqp://guest@rabbit//"""'}), "('code-executions-tasks', broker='pyamqp://guest@rabbit//', backend=\n 'amqp://guest@rabbit//')\n", (366, 463), False, 'from celery import Celery\n'), ((...
#imports import haversine as hs import pandas as pd import numpy as np import random import time from concurrent import futures import grpc import databroker_pb2_grpc import databroker_pb2 port = 8061 class Databroker(databroker_pb2_grpc.DatabrokerServicer): def __init__(self): self.current_row = 0 ...
[ "pandas.DataFrame", "pandas.read_csv", "haversine.haversine", "time.sleep", "numpy.rad2deg", "databroker_pb2.Features", "concurrent.futures.ThreadPoolExecutor", "numpy.ndarray.tobytes" ]
[((3015, 3057), 'concurrent.futures.ThreadPoolExecutor', 'futures.ThreadPoolExecutor', ([], {'max_workers': '(10)'}), '(max_workers=10)\n', (3041, 3057), False, 'from concurrent import futures\n'), ((372, 409), 'pandas.read_csv', 'pd.read_csv', (['"""./data/no2_testset.csv"""'], {}), "('./data/no2_testset.csv')\n", (38...
import smart_imports smart_imports.all() INFINIT_PREMIUM_DESCRIPTION = 'Вечная подписка даёт вам все бонусы подписчика на всё время игры.' class PERMANENT_PURCHASE_TYPE(rels_django.DjangoEnum): description = rels.Column(unique=False) might_required = rels.Column(unique=False, single_type=False) level_...
[ "smart_imports.all" ]
[((23, 42), 'smart_imports.all', 'smart_imports.all', ([], {}), '()\n', (40, 42), False, 'import smart_imports\n')]
"""spasco - spaces to underscores ============================== Command line tool for replacing/removing whitespaces or other patterns of file- and directory names. """ # Copyright (c) 2021, <NAME>. # All rights reserved. Distributed under the MIT License. import argparse import configparser import fnmatch import logg...
[ "os.path.expanduser", "spasco.term_color.fmt", "logging.basicConfig", "os.getcwd", "os.path.isdir", "os.rename", "os.walk", "os.path.isfile", "os.path.relpath", "argparse.RawDescriptionHelpFormatter", "configparser.ConfigParser", "os.path.join", "os.listdir", "sys.exit", "os.path.split" ...
[((642, 665), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (655, 665), False, 'import os\n'), ((682, 716), 'os.path.join', 'os.path.join', (['base', '"""settings.ini"""'], {}), "(base, 'settings.ini')\n", (694, 716), False, 'import os\n'), ((771, 798), 'configparser.ConfigParser', 'configparser...
''' imports ''' # filesystem management import os # tensors and nn modules import torch # array handling import numpy as np # midi file import and parse from mido import MidiFile class MelodyDataset(torch.utils.data.Dataset): ''' dataset class for midi files ''' def __init__(self, dir_path: str, cache...
[ "numpy.pad", "numpy.zeros", "numpy.where", "os.path.join", "os.listdir", "numpy.concatenate" ]
[((5349, 5369), 'numpy.zeros', 'np.zeros', (['M.shape[1]'], {}), '(M.shape[1])\n', (5357, 5369), True, 'import numpy as np\n'), ((5430, 5446), 'numpy.where', 'np.where', (['(M != 0)'], {}), '(M != 0)\n', (5438, 5446), True, 'import numpy as np\n'), ((3972, 4001), 'numpy.zeros', 'np.zeros', (['(128)'], {'dtype': 'np.int...
## Copyright 2015-2019 <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 may obtain a copy of the License at ## http://www.apache.org/licenses/LICENSE-2.0 ## Unless required by applicable law or agreed to i...
[ "PyFlow.Core.PathsRegistry.PathsRegistry", "threading.Thread", "PyFlow.Core.NodeBase.NodePinsSuggestionsHelper" ]
[((1672, 1699), 'PyFlow.Core.NodeBase.NodePinsSuggestionsHelper', 'NodePinsSuggestionsHelper', ([], {}), '()\n', (1697, 1699), False, 'from PyFlow.Core.NodeBase import NodePinsSuggestionsHelper\n'), ((3609, 3672), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.onNext', 'args': '(self, args, kwargs)'}), '...
import re class Command: def __init__(self, name, register, jump_addr=None): self.name = name self.register = register self.jump_addr = jump_addr class Program: def __init__(self, commands, registers): self.commands = commands self.registers = registers self.i...
[ "re.split" ]
[((1575, 1609), 're.split', 're.split', (['"""([a-z]+) ([a|b])"""', 'line'], {}), "('([a-z]+) ([a|b])', line)\n", (1583, 1609), False, 'import re\n'), ((1941, 1989), 're.split', 're.split', (['"""([a-z]+) ([a|b]), ([+\\\\-0-9]+)"""', 'line'], {}), "('([a-z]+) ([a|b]), ([+\\\\-0-9]+)', line)\n", (1949, 1989), False, 'im...
# Generated by Django 3.0.5 on 2020-04-17 21:07 import uuid import django_fsm from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("paywall", "0001_initial"), ] operations = [ migrations.RemoveField(model_name="paymententry", name="payment",...
[ "django.db.migrations.RemoveField", "django_fsm.FSMField", "django.db.models.CharField" ]
[((255, 320), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""paymententry"""', 'name': '"""payment"""'}), "(model_name='paymententry', name='payment')\n", (277, 320), False, 'from django.db import migrations, models\n'), ((436, 503), 'django.db.models.CharField', 'models.CharField...
from feast.infra.offline_stores.contrib.postgres_offline_store.tests.data_source import ( PostgreSQLDataSourceCreator, ) from tests.integration.feature_repos.integration_test_repo_config import ( IntegrationTestRepoConfig, ) FULL_REPO_CONFIGS = [ IntegrationTestRepoConfig( provider="local", ...
[ "tests.integration.feature_repos.integration_test_repo_config.IntegrationTestRepoConfig" ]
[((260, 414), 'tests.integration.feature_repos.integration_test_repo_config.IntegrationTestRepoConfig', 'IntegrationTestRepoConfig', ([], {'provider': '"""local"""', 'offline_store_creator': 'PostgreSQLDataSourceCreator', 'online_store_creator': 'PostgreSQLDataSourceCreator'}), "(provider='local', offline_store_creator...
import random def utils_min_required(): responses = [ "Sorry, I need your opinion on a movie "\ "before I can give you quality recommendations.", "Sorry, I don't have enough information yet "\ "to make a good recommendation.", "I can't give a good recomme...
[ "random.choice", "random.uniform" ]
[((842, 866), 'random.choice', 'random.choice', (['responses'], {}), '(responses)\n', (855, 866), False, 'import random\n'), ((1715, 1739), 'random.choice', 'random.choice', (['responses'], {}), '(responses)\n', (1728, 1739), False, 'import random\n'), ((2359, 2383), 'random.choice', 'random.choice', (['responses'], {}...
import cv2 import math import imutils import numpy as np import warnings from sklearn.cluster import KMeans from skimage.morphology import * from skimage.util import * class OD_CV: def loadImage(self, filepath): return cv2.imread(filepath) def resizeImage(self, image, kar, width, height...
[ "cv2.GaussianBlur", "numpy.argmax", "cv2.getPerspectiveTransform", "cv2.arcLength", "cv2.approxPolyDP", "numpy.ones", "numpy.argmin", "numpy.histogram", "cv2.boxPoints", "cv2.rectangle", "imutils.resize", "cv2.erode", "cv2.minAreaRect", "numpy.unique", "cv2.warpPerspective", "numpy.zer...
[((245, 265), 'cv2.imread', 'cv2.imread', (['filepath'], {}), '(filepath)\n', (255, 265), False, 'import cv2\n'), ((519, 554), 'numpy.zeros', 'np.zeros', (['image.shape[:2]', 'np.uint8'], {}), '(image.shape[:2], np.uint8)\n', (527, 554), True, 'import numpy as np\n'), ((571, 625), 'cv2.drawContours', 'cv2.drawContours'...
import os import socket import subprocess from vimpdb import config from vimpdb import errors def get_eggs_paths(): import vim_bridge vimpdb_path = config.get_package_path(errors.ReturnCodeError()) vim_bridge_path = config.get_package_path(vim_bridge.bridged) return ( os.path.dirname(vimpdb_p...
[ "subprocess.Popen", "vimpdb.errors.ReturnCodeError", "vimpdb.config.get_package_path", "os.path.dirname", "os.path.exists", "subprocess.call", "vimpdb.config.logger.debug", "vimpdb.errors.RemoteUnavailable", "os.path.join" ]
[((231, 274), 'vimpdb.config.get_package_path', 'config.get_package_path', (['vim_bridge.bridged'], {}), '(vim_bridge.bridged)\n', (254, 274), False, 'from vimpdb import config\n'), ((183, 207), 'vimpdb.errors.ReturnCodeError', 'errors.ReturnCodeError', ([], {}), '()\n', (205, 207), False, 'from vimpdb import errors\n'...
from django.urls import path, include from rest_framework import routers from drf_file_management.views import FileAPIView router = routers.SimpleRouter() router.register(r'file', FileAPIView) app_name = 'drf_file_management' urlpatterns = router.urls
[ "rest_framework.routers.SimpleRouter" ]
[((134, 156), 'rest_framework.routers.SimpleRouter', 'routers.SimpleRouter', ([], {}), '()\n', (154, 156), False, 'from rest_framework import routers\n')]
# Generated by Django 2.2.1 on 2020-10-08 10:05 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('blog', '0004_auto_20201003_2247'), ] operations = [ migrations.AddField( model_name='channel', ...
[ "django.db.models.DateTimeField" ]
[((362, 418), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)', 'verbose_name': '"""修改时间"""'}), "(auto_now=True, verbose_name='修改时间')\n", (382, 418), False, 'from django.db import migrations, models\n'), ((542, 618), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'de...
from pyop3.api import AccessMode, ArgType, IterationRegion from pyop3.codegen.compiled import build_wrapper, get_c_function from pyop3.obj.kernel import Kernel from pyop3.obj.maps import IdentityMap from pyop3.obj.sets import AbstractSet from pyop3.utils import cached_property, debug_check_args def filter_args(args, ...
[ "pyop3.codegen.compiled.build_wrapper", "pyop3.utils.debug_check_args", "pyop3.codegen.compiled.get_c_function" ]
[((1659, 1686), 'pyop3.utils.debug_check_args', 'debug_check_args', (['validator'], {}), '(validator)\n', (1675, 1686), False, 'from pyop3.utils import cached_property, debug_check_args\n'), ((4875, 4979), 'pyop3.codegen.compiled.build_wrapper', 'build_wrapper', (['*key[:-2]'], {'iteration_region': 'self.iteration_regi...
"""Utilities for TFRecords """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import tensorflow as tf TFRECORDS_EXT = ".tfrecords" def tfrecord_name_and_json_name(output): output = normalize_tfrecords_path(output) json_output = outpu...
[ "tensorflow.train.BytesList", "json.dump", "tensorflow.py_function", "json.load", "tensorflow.data.TFRecordDataset", "tensorflow.train.Int64List", "tensorflow.reshape", "tensorflow.io.parse_single_example", "tensorflow.train.Features", "tensorflow.constant", "tensorflow.io.serialize_tensor", "...
[((2658, 2701), 'tensorflow.data.experimental.TFRecordWriter', 'tf.data.experimental.TFRecordWriter', (['output'], {}), '(output)\n', (2693, 2701), True, 'import tensorflow as tf\n'), ((3736, 3808), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['tfrecord'], {'num_parallel_reads': 'num_parallel_reads'}...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2021-04 from typing import Optional, List from PyQt5 import QtCore, QtWidgets, QtGui from PyQt5.QtCore import QVariant, QAbstractTableModel, pyqtSlot, QPoint, QTimer, Qt from PyQt5.QtGui import QKeySequence from PyQt5.QtWidgets import ...
[ "PyQt5.QtWidgets.QLabel", "PyQt5.QtCore.QVariant", "PyQt5.QtWidgets.QApplication.clipboard", "PyQt5.QtGui.QKeySequence", "PyQt5.QtGui.QColor", "PyQt5.QtWidgets.QMenu", "PyQt5.QtCore.QTimer.singleShot", "PyQt5.QtCore.QAbstractTableModel.__init__", "PyQt5.QtWidgets.QTableView", "PyQt5.QtWidgets.QVBo...
[((5175, 5191), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', (['QPoint'], {}), '(QPoint)\n', (5183, 5191), False, 'from PyQt5.QtCore import QVariant, QAbstractTableModel, pyqtSlot, QPoint, QTimer, Qt\n'), ((502, 539), 'PyQt5.QtWidgets.QWidget.__init__', 'QWidget.__init__', (['self'], {'parent': 'parent'}), '(self, parent=paren...
#!/usr/local/bin/python import spacy nlp = spacy.load('en') entityLs = ["ORG","PERSON","DATE","TIME","MONEY","PERCENT","FAC","GPE","NORP","WORK_OF_ART","QUANTITY","LOC","PRODUCT","EVENT","LAW","LANGUAGE","ORDINAL","CARDINAL"] def updateAlphaLs(text): alphaLs = [] doc = nlp(text) for token in doc: if(token...
[ "spacy.load" ]
[((44, 60), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (54, 60), False, 'import spacy\n')]
# Generated by Django 2.0 on 2019-05-21 06:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Summary', fields=[ ('summary_id', models.AutoField(prima...
[ "django.db.models.DateTimeField", "django.db.models.TextField", "django.db.models.AutoField" ]
[((298, 349), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (314, 349), False, 'from django.db import migrations, models\n'), ((386, 404), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (402, 404),...
import numpy as np import matplotlib.pyplot as plt from evaluation.results import packageResults from dissertation import datasetInfo from config.routes import getRecordedResultsRoute MINI_FONTSIZE=10 FONTSIZE = 14 * 4 / 3 NUMBER_FORMAT = "{:.0f}" interpolationResults = packageResults.interpolationResults.getDict...
[ "matplotlib.pyplot.ylim", "evaluation.results.packageResults.interpolationResults.getDictionary", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", "matplotlib.pyplot.close", "config.routes.getRecordedResultsRoute", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks...
[((277, 328), 'evaluation.results.packageResults.interpolationResults.getDictionary', 'packageResults.interpolationResults.getDictionary', ([], {}), '()\n', (326, 328), False, 'from evaluation.results import packageResults\n'), ((1607, 1633), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(4, 8)'}), '(figs...
import json from dataclasses import dataclass from typing import Optional @dataclass() class Event: source: str # One of constants.EVENT_SOURCE source_id: str # Unique ID from the source name: str _start_time: str = None _end_time = None _description = None # {'timezone': 'America/Denv...
[ "dataclasses.dataclass", "json.dumps" ]
[((77, 88), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (86, 88), False, 'from dataclasses import dataclass\n'), ((1345, 1360), 'json.dumps', 'json.dumps', (['obj'], {}), '(obj)\n', (1355, 1360), False, 'import json\n')]
import curses from curses import textpad def test_textpad(stdscr, insert_mode=False): ncols, nlines = 8, 3 uly, ulx = 3, 2 if insert_mode: mode = 'insert mode' else: mode = 'overwrite mode' stdscr.addstr(uly - 3, ulx, 'Use Ctrl-G to end editing (%s).' % mode) stdscr.addstr(uly ...
[ "curses.wrapper", "curses.textpad.Textbox", "curses.newwin", "curses.textpad.rectangle" ]
[((400, 438), 'curses.newwin', 'curses.newwin', (['nlines', 'ncols', 'uly', 'ulx'], {}), '(nlines, ncols, uly, ulx)\n', (413, 438), False, 'import curses\n'), ((443, 513), 'curses.textpad.rectangle', 'textpad.rectangle', (['stdscr', '(uly - 1)', '(ulx - 1)', '(uly + nlines)', '(ulx + ncols)'], {}), '(stdscr, uly - 1, u...
import pandas as pd import numpy as np def df_info(df: pd.DataFrame, return_info=False, shape=True, cols=True, info_prefix=''): """ Print a string to describe a df. """ info = info_prefix if shape: info = f'{info}Shape = {df.shape}' if cols: info = f'{info} , Cols = {df.columns.tol...
[ "pandas.date_range", "pandas.concat" ]
[((783, 820), 'pandas.concat', 'pd.concat', (['[time_range, data]'], {'axis': '(1)'}), '([time_range, data], axis=1)\n', (792, 820), True, 'import pandas as pd\n'), ((608, 644), 'pandas.date_range', 'pd.date_range', (['start', 'end'], {'freq': 'freq'}), '(start, end, freq=freq)\n', (621, 644), True, 'import pandas as p...
from django.core.exceptions import ObjectDoesNotExist from django.core.files.uploadedfile import UploadedFile from django.conf import settings from django.http import HttpResponse from rest_framework import generics from rest_framework.exceptions import NotFound from rest_framework.response import Response from rest_fr...
[ "django.http.HttpResponse", "heritages.models.Annotation.objects.all", "heritages.models.Multimedia.objects.get", "django.core.files.uploadedfile.UploadedFile", "heritages.models.Heritage.objects.all", "rest_framework.response.Response", "heritages.search.search_annotations", "heritages.models.Multime...
[((963, 985), 'heritages.models.Heritage.objects.all', 'Heritage.objects.all', ([], {}), '()\n', (983, 985), False, 'from heritages.models import Heritage, Multimedia, Annotation\n'), ((1427, 1449), 'heritages.models.Heritage.objects.all', 'Heritage.objects.all', ([], {}), '()\n', (1447, 1449), False, 'from heritages.m...
import glob import cv2 import numpy as np def globimgs(path, globs:list): """returns a list of files with path with globing with more than one extensions""" imgs = [] for i in globs: imgs.extend(glob.glob(path + i)) paths = [] for path in imgs: paths.append(path.replace("\\", "/")) return paths def scan...
[ "cv2.medianBlur", "cv2.threshold", "numpy.ones", "glob.glob", "cv2.normalize", "cv2.absdiff" ]
[((408, 439), 'cv2.medianBlur', 'cv2.medianBlur', (['dilated_img', '(15)'], {}), '(dilated_img, 15)\n', (422, 439), False, 'import cv2\n'), ((522, 625), 'cv2.normalize', 'cv2.normalize', (['diff_img', 'norm_img'], {'alpha': '(0)', 'beta': '(255)', 'norm_type': 'cv2.NORM_MINMAX', 'dtype': 'cv2.CV_8UC1'}), '(diff_img, no...
''' Created on 31 mar. 2020 @author: David ''' from sys import path path.append("/flash/userapp") from pyb import LED, Switch, Pin from uasyncio import get_event_loop, sleep_ms as ua_sleep_ms from uvacbot.io.esp8266 import Connection, Esp8266 class LedToggleConnection(Connection): async def onConnected(sel...
[ "sys.path.append", "pyb.LED", "uasyncio.sleep_ms", "uasyncio.get_event_loop", "pyb.Switch" ]
[((69, 98), 'sys.path.append', 'path.append', (['"""/flash/userapp"""'], {}), "('/flash/userapp')\n", (80, 98), False, 'from sys import path\n'), ((2052, 2060), 'pyb.Switch', 'Switch', ([], {}), '()\n', (2058, 2060), False, 'from pyb import LED, Switch, Pin\n'), ((2678, 2694), 'uasyncio.get_event_loop', 'get_event_loop...
from pathlib import Path DATA_DIR= Path(__file__).resolve().parent
[ "pathlib.Path" ]
[((38, 52), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (42, 52), False, 'from pathlib import Path\n')]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import template from django.conf import settings from django.urls import reverse_lazy from calls.models import CallCampaignStatus from local_groups.models import find_local_group_by_user from organizing_hub.models import OrganizingHubLoginAlert...
[ "django.template.Library", "django.urls.reverse_lazy", "organizing_hub.models.OrganizingHubLoginAlert.objects.filter", "logging.getLogger", "local_groups.models.find_local_group_by_user" ]
[((346, 373), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (363, 373), False, 'import logging\n'), ((386, 404), 'django.template.Library', 'template.Library', ([], {}), '()\n', (402, 404), False, 'from django import template\n'), ((1454, 1597), 'django.urls.reverse_lazy', 'reverse_lazy'...
#!/usr/bin/env python import getopt, sys, os import numpy as np import pyfits from pylab import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid.inset_locator import mark_inset #fname_ext = '/home/nbarbey/data/csh/output/ngc6946_c...
[ "pyfits.fitsopen", "matplotlib.pyplot.show", "mpl_toolkits.axes_grid.inset_locator.mark_inset", "matplotlib.pyplot.yticks", "numpy.isnan", "matplotlib.pyplot.figure", "mpl_toolkits.axes_grid.inset_locator.zoomed_inset_axes", "matplotlib.pyplot.xticks" ]
[((544, 565), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)', '[5, 4]'], {}), '(1, [5, 4])\n', (554, 565), True, 'import matplotlib.pyplot as plt\n'), ((842, 873), 'mpl_toolkits.axes_grid.inset_locator.zoomed_inset_axes', 'zoomed_inset_axes', (['ax', '(2)'], {'loc': '(3)'}), '(ax, 2, loc=3)\n', (859, 873), False, 'f...
# coding=utf-8 import logging from widen import settings import requests from index.models import * class WeiXinLogin(): def __init__(self, code, state): self.code = code self.state = state self.appid = settings.APP_ID self.appsecret = settings.APP_SECRET self.access_token ...
[ "logging.info", "requests.get" ]
[((1973, 2093), 'logging.info', 'logging.info', (["('access_token:%s ;openid:%s ;refresh_token:%s' % (self.access_token, self.\n openid, self.refresh_token))"], {}), "('access_token:%s ;openid:%s ;refresh_token:%s' % (self.\n access_token, self.openid, self.refresh_token))\n", (1985, 2093), False, 'import logging...
import unittest from nagplug import Plugin, Threshold, ArgumentParserError from nagplug import OK, WARNING, CRITICAL, UNKNOWN class TestParsing(unittest.TestCase): def test_parse(self): plugin = Plugin() plugin.add_arg('-e', '--test', action='store_true') args = plugin.parser.parse_args([...
[ "unittest.main", "nagplug.Plugin", "nagplug.Threshold" ]
[((6415, 6430), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6428, 6430), False, 'import unittest\n'), ((210, 218), 'nagplug.Plugin', 'Plugin', ([], {}), '()\n', (216, 218), False, 'from nagplug import Plugin, Threshold, ArgumentParserError\n'), ((423, 431), 'nagplug.Plugin', 'Plugin', ([], {}), '()\n', (429, 4...
from paypal_transactions_wrapper.exceptions import TransactionPropertyNotFound class Transaction: KEY_MAP = { "TIMESTAMP": "date", "TIMEZONE": "timezone", "TYPE": "type", "EMAIL": "costumer_email", "NAME": "costumer_name", "TRANSACTIONID": "id", "STATUS": "s...
[ "paypal_transactions_wrapper.exceptions.TransactionPropertyNotFound" ]
[((664, 720), 'paypal_transactions_wrapper.exceptions.TransactionPropertyNotFound', 'TransactionPropertyNotFound', (['"""%s property has not found"""'], {}), "('%s property has not found')\n", (691, 720), False, 'from paypal_transactions_wrapper.exceptions import TransactionPropertyNotFound\n')]
import socket import logging from threading import Thread from select import select from enum import Enum from prodj.core.clientlist import ClientList from prodj.core.vcdj import Vcdj from prodj.data.dataprovider import DataProvider from prodj.network.nfsclient import NfsClient from prodj.network.ip import guess_own_i...
[ "prodj.network.packets_dump.dump_status_packet", "logging.debug", "prodj.network.packets.StatusPacket.parse", "socket.socket", "prodj.core.vcdj.Vcdj", "prodj.core.clientlist.ClientList", "prodj.data.dataprovider.DataProvider", "prodj.network.packets.KeepAlivePacket.parse", "prodj.network.packets.Bea...
[((552, 568), 'prodj.core.clientlist.ClientList', 'ClientList', (['self'], {}), '(self)\n', (562, 568), False, 'from prodj.core.clientlist import ClientList\n'), ((585, 603), 'prodj.data.dataprovider.DataProvider', 'DataProvider', (['self'], {}), '(self)\n', (597, 603), False, 'from prodj.data.dataprovider import DataP...
import requests import bs4 import sqlite3 # Relevant API Documentation: # USPTO: https://developer.uspto.gov/ibd-api-docs/ # Google Maps: https://developers.google.com/maps/documentation/geocoding/intro USPTO_API = "https://developer.uspto.gov/ibd-api/v1/patent/application" MAPS_API = "https://maps.googleapis.com/maps...
[ "sqlite3.connect", "requests.get" ]
[((704, 756), 'requests.get', 'requests.get', (['MAPS_API'], {'params': "{'address': location}"}), "(MAPS_API, params={'address': location})\n", (716, 756), False, 'import requests\n'), ((2195, 2240), 'requests.get', 'requests.get', (['USPTO_API'], {'params': 'search_params'}), '(USPTO_API, params=search_params)\n', (2...
#! /usr/bin/env python import argparse import datetime import json import time import logging import pandas as pd import requests from pathlib import Path from retrying import retry AVAILABLE_CURRENCY_PAIRS = ['BTC_AMP', 'BTC_ARDR', 'BTC_BCH', 'BTC_BCN', 'BTC_BCY', 'BTC_BELA', 'BTC_BLK', ...
[ "pandas.DataFrame", "argparse.ArgumentParser", "json.loads", "pathlib.Path.home", "datetime.datetime.utcnow", "datetime.datetime.strptime", "datetime.timedelta", "requests.get", "retrying.retry", "logging.getLogger" ]
[((4672, 4748), 'retrying.retry', 'retry', ([], {'stop_max_attempt_number': '(7)', 'wait_random_min': '(1000)', 'wait_random_max': '(2000)'}), '(stop_max_attempt_number=7, wait_random_min=1000, wait_random_max=2000)\n', (4677, 4748), False, 'from retrying import retry\n'), ((5336, 5384), 'argparse.ArgumentParser', 'arg...
#!/usr/bin/env python # Relay node takes a list of topics and republish prepending /record namespace import rospy import rostopic import signal import sys QUEUE_SIZE=1000 #Make sure we don't miss points def signal_handler(sig,frame): print('Ctrl+c') sys.exit(0) signal.signal(signal.SIGINT,signal_handler) d...
[ "rostopic.get_topic_class", "rospy.Subscriber", "rospy.Publisher", "rospy.init_node", "rospy.spin", "signal.signal", "sys.exit" ]
[((274, 318), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal_handler'], {}), '(signal.SIGINT, signal_handler)\n', (287, 318), False, 'import signal\n'), ((406, 447), 'rospy.init_node', 'rospy.init_node', (['"""talker"""'], {'anonymous': '(True)'}), "('talker', anonymous=True)\n", (421, 447), False, 'impor...
""" .. codeauthor:: <NAME> <<EMAIL>> """ import abc import re from decimal import Decimal from typepy import RealNumber, String from .error import ParameterError, UnitNotFoundError _BASE_ATTRS = ("name", "regexp") _RE_NUMBER = re.compile(r"^[-\+]?[0-9\.]+$") def _get_unit_msg(text_units): return ", ".join(["...
[ "typepy.RealNumber", "typepy.String", "re.compile" ]
[((232, 264), 're.compile', 're.compile', (['"""^[-\\\\+]?[0-9\\\\.]+$"""'], {}), "('^[-\\\\+]?[0-9\\\\.]+$')\n", (242, 264), False, 'import re\n'), ((1352, 1378), 'typepy.RealNumber', 'RealNumber', (['readable_value'], {}), '(readable_value)\n', (1362, 1378), False, 'from typepy import RealNumber, String\n'), ((1714, ...
import matplotlib.pyplot as plt import time from matplotlib import animation def animate(U, timeSteps: int, postionSteps: int, timeStepSize: float): fig= plt.figure() ims = [] for i in range(timeSteps): im = plt.plot(postionSteps, U[:,i] , animated = True, color = 'red') ims.append(im...
[ "matplotlib.animation.ArtistAnimation", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ]
[((165, 177), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (175, 177), True, 'import matplotlib.pyplot as plt\n'), ((332, 409), 'matplotlib.animation.ArtistAnimation', 'animation.ArtistAnimation', (['fig', 'ims'], {'interval': '(10)', 'blit': '(True)', 'repeat_delay': '(500)'}), '(fig, ims, interval=10, ...
import unittest from decimal import Decimal from Broker import Broker from Portfolio import Account, Portfolio from tests.MockAuthenticator import MockAuthenticator, load_test_balance, \ load_test_positions class TestPortfolio(unittest.TestCase): def setUp(self): self.broker = Broker() self....
[ "unittest.main", "Broker.Broker", "decimal.Decimal", "tests.MockAuthenticator.load_test_positions", "Portfolio.Portfolio", "tests.MockAuthenticator.MockAuthenticator", "tests.MockAuthenticator.load_test_balance" ]
[((3462, 3477), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3475, 3477), False, 'import unittest\n'), ((298, 306), 'Broker.Broker', 'Broker', ([], {}), '()\n', (304, 306), False, 'from Broker import Broker\n'), ((391, 413), 'Portfolio.Portfolio', 'Portfolio', (['self.broker'], {}), '(self.broker)\n', (400, 413...
from django.contrib import admin from .models import Medicine, MedicineForm, Suggestion, Instruction, Company, Prescription, PrescribedMedicine, PatientHistory admin.site.register(Medicine) admin.site.register(MedicineForm) admin.site.register(Suggestion) admin.site.register(Instruction) admin.site.register(Company) a...
[ "django.contrib.admin.site.register" ]
[((161, 190), 'django.contrib.admin.site.register', 'admin.site.register', (['Medicine'], {}), '(Medicine)\n', (180, 190), False, 'from django.contrib import admin\n'), ((191, 224), 'django.contrib.admin.site.register', 'admin.site.register', (['MedicineForm'], {}), '(MedicineForm)\n', (210, 224), False, 'from django.c...
""" # Copyright 2022 Red Hat # # 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...
[ "unittest.mock.Mock", "cibyl.outputs.cli.ci.system.utils.sorting.jobs.SortJobsByName" ]
[((969, 975), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (973, 975), False, 'from unittest.mock import Mock\n'), ((1024, 1030), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (1028, 1030), False, 'from unittest.mock import Mock\n'), ((1085, 1101), 'cibyl.outputs.cli.ci.system.utils.sorting.jobs.SortJobsByName', '...
# rough copy of https://github.com/geohot/tinygrad/blob/master/examples/mnist_gan.py from simplegrad import Tensor, Device, Adam import numpy as np import itertools as it from torchvision.utils import make_grid, save_image import torch from abc import abstractmethod import os def leakyrelu(x, neg_slope=0.2): retu...
[ "numpy.random.uniform", "os.stat", "numpy.random.randn", "os.rename", "tempfile.gettempdir", "numpy.zeros", "gzip.decompress", "numpy.prod", "os.path.isfile", "numpy.random.randint", "requests.get", "simplegrad.Tensor", "os.path.join", "simplegrad.Adam", "torch.tensor" ]
[((1961, 1987), 'os.rename', 'os.rename', (["(fp + '.tmp')", 'fp'], {}), "(fp + '.tmp', fp)\n", (1970, 1987), False, 'import requests, tempfile, os\n'), ((2523, 2578), 'simplegrad.Adam', 'Adam', (['generator.params'], {'learning_rate': '(0.0002)', 'beta1': '(0.5)'}), '(generator.params, learning_rate=0.0002, beta1=0.5)...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt def save_figure(xs, file_path): plt.figure() plt.ylim([-2.0, 2.0]) plt.xlim([-2.0, 2.0])...
[ "matplotlib.pylab.savefig", "matplotlib.pylab.plot", "matplotlib.use", "matplotlib.pylab.xlim", "matplotlib.pylab.close", "matplotlib.pylab.ylim", "matplotlib.pylab.figure" ]
[((172, 193), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (186, 193), False, 'import matplotlib\n'), ((260, 272), 'matplotlib.pylab.figure', 'plt.figure', ([], {}), '()\n', (270, 272), True, 'import matplotlib.pylab as plt\n'), ((275, 296), 'matplotlib.pylab.ylim', 'plt.ylim', (['[-2.0, 2.0]']...
import flask from tensorflow import keras import pandas as pd from flask import request, jsonify from pandas.io.json import json_normalize app = flask.Flask(__name__) app.config["DEBUG"] = True @app.route('/api/prediction', methods=['POST']) def precict(): # Validate the request body contains JSON if reque...
[ "pandas.DataFrame", "tensorflow.keras.models.load_model", "pandas.io.json.json_normalize", "flask.Flask", "tensorflow.keras.optimizers.Nadam", "flask.request.get_json" ]
[((146, 167), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (157, 167), False, 'import flask\n'), ((397, 415), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (413, 415), False, 'from flask import request, jsonify\n'), ((436, 455), 'pandas.io.json.json_normalize', 'json_normalize', (...
from collections import Counter class Solution: def findAnagrams(self, word: str, substr: str): """O(n) time | O(1) space""" if not word or not substr: return [] l = 0 r = -1 seen = 0 ln = len(substr) counts = Counter(substr) counts = {char: -counts[c...
[ "collections.Counter" ]
[((271, 286), 'collections.Counter', 'Counter', (['substr'], {}), '(substr)\n', (278, 286), False, 'from collections import Counter\n')]
import random import speech_recognition as sr import datetime import calendar import time import webbrowser import wikipedia from gtts import gTTS import playsound import os import win10toast from bs4 import BeautifulSoup import requests import re import nltk from googletrans import Translator import sp...
[ "playsound.playsound", "os.remove", "speech_recognition.UnknownValueError", "time.ctime", "speech_recognition.RequestError", "sports.all_matches", "playsound.playsound.playsound", "nltk.download", "googletrans.Translator", "random.randint", "time.split", "gtts.gTTS", "webbrowser.get", "spe...
[((2039, 2062), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2060, 2062), False, 'import datetime\n'), ((2076, 2101), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (2099, 2101), False, 'import datetime\n'), ((2757, 2780), 'datetime.datetime.now', 'datetime.datetime.now'...
#!/usr/bin/env python import rospy import tf import time import serial import struct from geometry_msgs.msg import PointStamped from ros_decawave.msg import Tag, Anchor, AnchorArray, Acc class DecawaveDriver(object): """ docstring for DecawaveDriver """ def __init__(self): rospy.init_node('decawave...
[ "serial.Serial", "rospy.logwarn", "rospy.logerr", "ros_decawave.msg.AnchorArray", "rospy.Time.now", "ros_decawave.msg.Acc", "tf.TransformBroadcaster", "rospy.Publisher", "rospy.Rate", "time.sleep", "rospy.get_param", "rospy.loginfo", "rospy.is_shutdown", "rospy.init_node", "tf.transforma...
[((295, 346), 'rospy.init_node', 'rospy.init_node', (['"""decawave_driver"""'], {'anonymous': '(False)'}), "('decawave_driver', anonymous=False)\n", (310, 346), False, 'import rospy\n'), ((404, 443), 'rospy.get_param', 'rospy.get_param', (['"""port"""', '"""/dev/ttyACM0"""'], {}), "('port', '/dev/ttyACM0')\n", (419, 44...
from django.contrib import admin from . import models from .models import Notification from django.contrib.contenttypes.admin import GenericTabularInline # Register your models here. class NotificationAdmin(GenericTabularInline): model = models.Notification extra = 0 def get_queryset(self, request): ...
[ "django.contrib.admin.register" ]
[((405, 436), 'django.contrib.admin.register', 'admin.register', (['models.Template'], {}), '(models.Template)\n', (419, 436), False, 'from django.contrib import admin\n'), ((617, 655), 'django.contrib.admin.register', 'admin.register', (['models.DingDingMessage'], {}), '(models.DingDingMessage)\n', (631, 655), False, ...
import numpy as np import torch import math import ray import copy import networks import global_config def play_one_game(model, env_func, config, temperature, save=False, filename = ''): game_history = GameHistory() game = env_func(max_steps = config.max_moves, window_size = config.observation_shape[1]) ...
[ "ray.remote", "torch.tensor", "math.sqrt", "numpy.argmax", "torch.exp", "numpy.random.choice", "math.log", "torch.no_grad", "networks.support_to_scalar" ]
[((7362, 7387), 'ray.remote', 'ray.remote', (['play_one_game'], {}), '(play_one_game)\n', (7372, 7387), False, 'import ray\n'), ((518, 533), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (531, 533), False, 'import torch\n'), ((1616, 1639), 'numpy.argmax', 'np.argmax', (['visit_counts'], {}), '(visit_counts)\n', (...
import io import csv from smtplib import SMTPException from django.core.management.base import BaseCommand from django.core.mail import EmailMessage from django.conf import settings from bvc import utils class Command(BaseCommand): def handle(self, *args, **options): csvfile = io.StringIO() writ...
[ "bvc.utils.format_mail_subject", "io.StringIO", "smtplib.SMTPException", "csv.writer" ]
[((294, 307), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (305, 307), False, 'import io\n'), ((325, 344), 'csv.writer', 'csv.writer', (['csvfile'], {}), '(csvfile)\n', (335, 344), False, 'import csv\n'), ((433, 500), 'bvc.utils.format_mail_subject', 'utils.format_mail_subject', (['"""Démarrage de l\'application - m...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Example to show the new marker styles""" import matplotlib.pyplot as plt from sajou.plot.lines_mpl import Line2D fig = plt.figure(figsize=(12, 3)) ax = fig.add_subplot(111) markers = ['ap', 'an', 'psx', 'rsx', 'es', 'rex', 'rc'] for ix, mark in enumerate(markers): ...
[ "matplotlib.pyplot.figure", "sajou.plot.lines_mpl.Line2D", "matplotlib.pyplot.show" ]
[((169, 196), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 3)'}), '(figsize=(12, 3))\n', (179, 196), True, 'import matplotlib.pyplot as plt\n'), ((463, 473), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (471, 473), True, 'import matplotlib.pyplot as plt\n'), ((329, 388), 'sajou.plot.lines...
import numpy import sys import scipy from scipy.signal import find_peaks_cwt import matplotlib.pyplot as plt from headbang.params import DEFAULTS from headbang.util import find_closest openpose_install_path = "/home/sevagh/thirdparty-repos/openpose" openpose_dir = openpose_install_path sys.path.append(openpose_dir + ...
[ "matplotlib.pyplot.title", "numpy.abs", "numpy.nan_to_num", "numpy.isnan", "matplotlib.pyplot.figure", "numpy.arange", "sys.path.append", "pyopenpose.WrapperPython", "matplotlib.pyplot.show", "numpy.median", "numpy.asarray", "pyopenpose.VectorDatum", "matplotlib.pyplot.ylabel", "matplotlib...
[((289, 345), 'sys.path.append', 'sys.path.append', (["(openpose_dir + '/build/python/openpose')"], {}), "(openpose_dir + '/build/python/openpose')\n", (304, 345), False, 'import sys\n'), ((1059, 1077), 'pyopenpose.WrapperPython', 'op.WrapperPython', ([], {}), '()\n', (1075, 1077), True, 'import pyopenpose as op\n'), (...
import sys cmd_folder = "../../../vis" # nopep8 if cmd_folder not in sys.path: # nopep8 sys.path.insert(0, cmd_folder) from tile_mov import tile_movie from make_mov import make_all, get_particle_trajectories import pylab as plt import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable import matp...
[ "pylab.close", "scipy.signal.savgol_filter", "numpy.meshgrid", "pylab.rcParams.update", "numpy.zeros", "sys.path.insert", "make_mov.make_all", "numpy.rot90", "pylab.figure", "matplotlib.gridspec.GridSpec", "numpy.concatenate", "numpy.sqrt" ]
[((349, 458), 'pylab.rcParams.update', 'plt.rcParams.update', (["{'text.usetex': True, 'font.family': 'sans-serif', 'font.sans-serif': [\n 'Helvetica']}"], {}), "({'text.usetex': True, 'font.family': 'sans-serif',\n 'font.sans-serif': ['Helvetica']})\n", (368, 458), True, 'import pylab as plt\n'), ((94, 124), 'sy...
from autobot_helpers import boto3_helper, context_helper from botocore.exceptions import ClientError import traceback class Support: def __init__(self): self.client = boto3_helper.get_client('support') def refresh_checks(self): try: ta_checks = self.client.describe_trusted_adviso...
[ "traceback.print_exc", "autobot_helpers.context_helper.logger", "autobot_helpers.boto3_helper.get_client", "traceback.format_exc" ]
[((182, 216), 'autobot_helpers.boto3_helper.get_client', 'boto3_helper.get_client', (['"""support"""'], {}), "('support')\n", (205, 216), False, 'from autobot_helpers import boto3_helper, context_helper\n'), ((891, 913), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (911, 913), False, 'import traceb...
import logging import kitesettings from kiteconnect import KiteConnect logging.basicConfig(level=logging.DEBUG) kite = KiteConnect(kitesettings.API_KEY) # https://kite.zerodha.com/connect/login?v=4&API_KEY=Q8JPzjkt8ftXgqvmXa request_token = input("Request Token: ") data = kite.generate_session(request_token, kitese...
[ "kiteconnect.KiteConnect", "logging.basicConfig" ]
[((72, 112), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (91, 112), False, 'import logging\n'), ((121, 154), 'kiteconnect.KiteConnect', 'KiteConnect', (['kitesettings.API_KEY'], {}), '(kitesettings.API_KEY)\n', (132, 154), False, 'from kiteconnect import Ki...
from typing import Union from datetime import datetime from logging import Formatter, LogRecord class BalsaFormatter(Formatter): """ Format time in ISO 8601 """ def formatTime(self, record: LogRecord, datefmt: Union[str, None] = None) -> str: assert datefmt is None # static format t...
[ "datetime.datetime.fromtimestamp" ]
[((332, 370), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['record.created'], {}), '(record.created)\n', (354, 370), False, 'from datetime import datetime\n')]
''' @description: basic function for common @return : return value is all by jsondata ''' #-*- coding:utf-8 -*- import json from django.contrib.auth.hashers import make_password,check_password from django.contrib.auth import authenticate def checkUserLoginInfo(username,password): ''' @brief: basic function to...
[ "django.contrib.auth.hashers.make_password", "django.contrib.auth.hashers.check_password", "json.dumps" ]
[((967, 990), 'json.dumps', 'json.dumps', (['dict_Result'], {}), '(dict_Result)\n', (977, 990), False, 'import json\n'), ((1220, 1243), 'django.contrib.auth.hashers.make_password', 'make_password', (['password'], {}), '(password)\n', (1233, 1243), False, 'from django.contrib.auth.hashers import make_password, check_pas...
#!python # pylint: disable=redefined-outer-name,unexpected-keyword-arg """Script to detokenize text file""" from lang2sign.lang2gloss.tokenizers.en_asl import EnAslTokenizer if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( description="Detokenize text files" ) par...
[ "argparse.ArgumentParser", "lang2sign.lang2gloss.tokenizers.en_asl.EnAslTokenizer" ]
[((237, 297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Detokenize text files"""'}), "(description='Detokenize text files')\n", (260, 297), False, 'import argparse\n'), ((560, 576), 'lang2sign.lang2gloss.tokenizers.en_asl.EnAslTokenizer', 'EnAslTokenizer', ([], {}), '()\n', (574, 57...
import os from flask import Blueprint, render_template, redirect, url_for, send_from_directory import conf from . import manager from .forms import SimulationForm bp = Blueprint('web', __name__) @bp.route('/') def index(): return render_template('status.html') @bp.route('/start', methods=['GET', 'POST']) de...
[ "flask.Blueprint", "flask.url_for", "flask.render_template", "flask.send_from_directory", "os.path.join", "os.listdir" ]
[((171, 197), 'flask.Blueprint', 'Blueprint', (['"""web"""', '__name__'], {}), "('web', __name__)\n", (180, 197), False, 'from flask import Blueprint, render_template, redirect, url_for, send_from_directory\n'), ((240, 270), 'flask.render_template', 'render_template', (['"""status.html"""'], {}), "('status.html')\n", (...
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def default_conv(in_channels, out_channels, kernel_size, bias=True): return nn.Conv2d( in_channels, out_channels, kernel_size, padding=(kernel_size//2), bias=bias) class MeanShift(n...
[ "torch.eye", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.Tensor" ]
[((198, 288), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels', 'kernel_size'], {'padding': '(kernel_size // 2)', 'bias': 'bias'}), '(in_channels, out_channels, kernel_size, padding=kernel_size // 2,\n bias=bias)\n', (207, 288), True, 'import torch.nn as nn\n'), ((469, 490), 'torch.Tensor', 'torch.Ten...
# -*- coding: utf-8 -*- """Warning : this file has been generated, you shouldn't edit it""" from os import linesep from pyleecan.Classes.check import check_init_dict, check_var from pyleecan.Functions.save import save from pyleecan.Classes.frozen import FrozenClass from pyleecan.Methods.Machine.Magnet.comp_angle_open...
[ "pyleecan.Classes.check.check_init_dict", "pyleecan.Classes.Material.Material", "pyleecan.Classes.check.check_var" ]
[((5166, 5206), 'pyleecan.Classes.check.check_var', 'check_var', (['"""mat_type"""', 'value', '"""Material"""'], {}), "('mat_type', value, 'Material')\n", (5175, 5206), False, 'from pyleecan.Classes.check import check_init_dict, check_var\n'), ((5699, 5760), 'pyleecan.Classes.check.check_var', 'check_var', (['"""type_m...
from pathlib import Path import pytest from maggma.stores import JSONStore, MemoryStore from monty.serialization import dumpfn, loadfn from emmet.builders.materials.electronic_structure import ElectronicStructureBuilder from emmet.builders.vasp.materials import MaterialsBuilder @pytest.fixture(scope="session") def ...
[ "emmet.builders.materials.electronic_structure.ElectronicStructureBuilder", "pytest.fixture", "pathlib.Path", "maggma.stores.MemoryStore", "maggma.stores.JSONStore", "emmet.builders.vasp.materials.MaterialsBuilder" ]
[((284, 315), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (298, 315), False, 'import pytest\n'), ((452, 483), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (466, 483), False, 'import pytest\n'), ((354, 439), 'maggma.stores.J...
#!/usr/bin/env python """ Download needed raw data Author: <NAME> Copyright (c) 2021 - <NAME> License: See the LICENSE file. Date: 2021-02-05 """ import os import time import random import requests import tempfile import sys import zipfile import shutil import tarfile from tqdm import tqdm from parse_args import p...
[ "zipfile.is_zipfile", "tqdm.tqdm", "os.remove", "zipfile.ZipFile", "os.unlink", "tempfile.mkstemp", "os.makedirs", "tarfile.open", "parse_args.parse_io", "os.path.exists", "random.random", "requests.get", "shutil.move", "os.fdopen", "os.path.split", "os.path.join" ]
[((766, 784), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (782, 784), False, 'import tempfile\n'), ((1500, 1535), 'os.path.join', 'os.path.join', (['output_dir', 'file_name'], {}), '(output_dir, file_name)\n', (1512, 1535), False, 'import os\n'), ((2033, 2043), 'parse_args.parse_io', 'parse_io', ([], {}),...
import os from delphifmx import * class Child_Form(Form): def __init__(self, owner): self.child_heading = None self.result_text_heading = None self.result_text_label = None self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "child_window.pyfmx"))
[ "os.path.abspath" ]
[((255, 280), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (270, 280), False, 'import os\n')]
import setuptools import platform import sys import os THIS_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_DIR = 'mcell/utils/pybind11_test/build/' if platform.system() == 'Linux': # TODO: copy mcell library to the current directory pass elif platform.system() == 'Darwin': # pass elif 'Windows...
[ "platform.system", "os.path.abspath" ]
[((83, 108), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (98, 108), False, 'import os\n'), ((161, 178), 'platform.system', 'platform.system', ([], {}), '()\n', (176, 178), False, 'import platform\n'), ((261, 278), 'platform.system', 'platform.system', ([], {}), '()\n', (276, 278), False, '...
#!/usr/bin/env python import requests from jobs import AbstractJob from lxml import etree class Plex(AbstractJob): def __init__(self, conf): self.interval = conf['interval'] self.movies = conf['movies'] self.shows = conf['shows'] self.timeout = conf.get('timeout') def _parse...
[ "lxml.etree.fromstring", "requests.get" ]
[((355, 376), 'lxml.etree.fromstring', 'etree.fromstring', (['xml'], {}), '(xml)\n', (371, 376), False, 'from lxml import etree\n'), ((656, 677), 'lxml.etree.fromstring', 'etree.fromstring', (['xml'], {}), '(xml)\n', (672, 677), False, 'from lxml import etree\n'), ((1078, 1125), 'requests.get', 'requests.get', (['self....
from scipy import stats import scikit_posthocs as sp import numpy as np import pandas as pd import glob def friedman_test(dataframe): return stats.friedmanchisquare(*[row for index, row in dataframe.T.iterrows()]) def nemenyi_test(dataframe): nemenyi = sp.posthoc_nemenyi_friedman(dataframe) list_index=[] ...
[ "pandas.DataFrame", "scikit_posthocs.posthoc_nemenyi_friedman", "pandas.read_csv", "glob.glob" ]
[((263, 301), 'scikit_posthocs.posthoc_nemenyi_friedman', 'sp.posthoc_nemenyi_friedman', (['dataframe'], {}), '(dataframe)\n', (290, 301), True, 'import scikit_posthocs as sp\n'), ((481, 505), 'pandas.DataFrame', 'pd.DataFrame', (['list_index'], {}), '(list_index)\n', (493, 505), True, 'import pandas as pd\n'), ((552, ...
# Copyright 2020 Yalfoosh # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ "numpy.argmax", "numpy.square", "numpy.argmin", "numpy.around", "numpy.mean", "numpy.tile", "numpy.reshape", "numpy.eye", "numpy.delete", "numpy.vstack", "numpy.sqrt" ]
[((7922, 7943), 'numpy.reshape', 'np.reshape', (['start', '(-1)'], {}), '(start, -1)\n', (7932, 7943), True, 'import numpy as np\n'), ((8803, 8843), 'numpy.tile', 'np.tile', (['start'], {'reps': '(start.shape[0], 1)'}), '(start, reps=(start.shape[0], 1))\n', (8810, 8843), True, 'import numpy as np\n'), ((8911, 8937), '...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-08 14:52 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wapps', '0004_add_wapps_image'), ] operations = [ migrations.RemoveField( ...
[ "django.db.migrations.RemoveField" ]
[((286, 352), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""identitysettings"""', 'name': '"""logo"""'}), "(model_name='identitysettings', name='logo')\n", (308, 352), False, 'from django.db import migrations\n')]
#!/usr/bin/python3 # -*- coding: utf-8 -*- from helpers.gh_pages import main main()
[ "helpers.gh_pages.main" ]
[((78, 84), 'helpers.gh_pages.main', 'main', ([], {}), '()\n', (82, 84), False, 'from helpers.gh_pages import main\n')]
from selenium.webdriver.support.select import Select from Data.parameters import Data from reuse_func import GetData class click_on_home(): def __init__(self,driver): self.driver = driver def test_homeicon(self): self.p = GetData() self.driver.implicitly_wait(20) self.driver....
[ "reuse_func.GetData" ]
[((250, 259), 'reuse_func.GetData', 'GetData', ([], {}), '()\n', (257, 259), False, 'from reuse_func import GetData\n')]
import pytest from mugen import lists from mugen.lists import MugenList class Dummy(object): foo = 1 @pytest.fixture def mugen_list() -> MugenList: return MugenList([Dummy(), Dummy(), Dummy(), Dummy(), Dummy(), Dummy()]) @pytest.mark.parametrize("l, expected_foo", [ (mugen_list(), [1, 1, 1, 1, 1, 1])...
[ "pytest.mark.parametrize", "mugen.lists.flatten", "mugen.lists.MugenList" ]
[((400, 503), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""l, expected_l"""', '[([1, [2, 3], [[4, 5], [6, 7]]], [1, 2, 3, 4, 5, 6, 7])]'], {}), "('l, expected_l', [([1, [2, 3], [[4, 5], [6, 7]]], [\n 1, 2, 3, 4, 5, 6, 7])])\n", (423, 503), False, 'import pytest\n'), ((549, 565), 'mugen.lists.flatten',...
""" :Created: 13 July 2015 :Author: <NAME> """ import random from django.http import HttpResponseRedirect from django.urls import reverse from django.views.generic import TemplateView class HomeView(TemplateView): template_name = "home.html" class CategoryPageView(TemplateView): template_name = "catego...
[ "django.urls.reverse" ]
[((1323, 1342), 'django.urls.reverse', 'reverse', (['items_list'], {}), '(items_list)\n', (1330, 1342), False, 'from django.urls import reverse\n')]
from discord.ext import commands import discord import asyncio import youtube_dl import logging import math import random import heapq from urllib import request from ..video import Video from ..video import Setlist # TODO: abstract FFMPEG options into their own file? FFMPEG_BEFORE_OPTS = '-reconnect 1 -reconnect_stre...
[ "discord.ext.commands.command", "heapq.heappush", "math.ceil", "logging.warn", "discord.ext.commands.has_permissions", "discord.ext.commands.check", "discord.ext.commands.CommandError", "random.shuffle", "random.sample", "heapq.heappop", "logging.info", "discord.Game", "discord.FFmpegPCMAudi...
[((2398, 2432), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['stop']"}), "(aliases=['stop'])\n", (2414, 2432), False, 'from discord.ext import commands\n'), ((2438, 2459), 'discord.ext.commands.guild_only', 'commands.guild_only', ([], {}), '()\n', (2457, 2459), False, 'from discord.ext import ...
import matplotlib.pyplot as plt from multiprocessing import Pool, Manager, cpu_count from functools import partial import numpy as np from bs4 import BeautifulSoup from colour import Color import copy import math import re import time from consts import QWERTY, THUMBS, COORDS CACHE = {} def cleanhtml(raw_html): ...
[ "colour.Color", "functools.partial", "copy.deepcopy", "math.sqrt", "multiprocessing.Manager", "time.time", "numpy.arange", "multiprocessing.Pool", "bs4.BeautifulSoup", "matplotlib.pyplot.subplots", "re.sub", "multiprocessing.cpu_count" ]
[((328, 359), 'bs4.BeautifulSoup', 'BeautifulSoup', (['raw_html', '"""lxml"""'], {}), "(raw_html, 'lxml')\n", (341, 359), False, 'from bs4 import BeautifulSoup\n'), ((526, 558), 're.sub', 're.sub', (['"""[^а-я]+"""', '""""""', 'lowercase'], {}), "('[^а-я]+', '', lowercase)\n", (532, 558), False, 'import re\n'), ((1829,...
class remoteGet: def __init__(self, link, saveTo): self._link = link self._saveTo = saveTo def getFile(self): '''(NoneType) -> NoneType Retrieves file from set url to set local destination Raises CannotRetrieveFileException Returns NoneType ''' im...
[ "urllib.request.urlretrieve", "os.remove", "hashlib.md5" ]
[((1004, 1017), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (1015, 1017), False, 'import hashlib\n'), ((1195, 1208), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (1206, 1208), False, 'import hashlib\n'), ((1375, 1407), 'os.remove', 'os.remove', (["(self._saveTo + '.TMP')"], {}), "(self._saveTo + '.TMP')\n", (138...
""" sysinfo.py obtain system informations @author: K.Edeline """ import platform class SysInfo(): """ extend me """ def __init__(self): self.system = platform.system() self.node = platform.node() self.release = platform.release() self.version = platform.version() s...
[ "platform.processor", "platform.node", "platform.architecture", "platform.platform", "platform.version", "platform.system", "platform.release", "platform.machine" ]
[((181, 198), 'platform.system', 'platform.system', ([], {}), '()\n', (196, 198), False, 'import platform\n'), ((217, 232), 'platform.node', 'platform.node', ([], {}), '()\n', (230, 232), False, 'import platform\n'), ((254, 272), 'platform.release', 'platform.release', ([], {}), '()\n', (270, 272), False, 'import platf...
"""Interactions model""" # Django from django.db import models # Utils from tclothes.utils.baseModels import TClothesModel class InteractionsModel(TClothesModel): """Interactions interactions model.""" clothe = models.ForeignKey( 'clothes.ClothesModel', on_delete=models.CASCADE ) us...
[ "django.db.models.ForeignKey", "django.db.models.CharField" ]
[((224, 291), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""clothes.ClothesModel"""'], {'on_delete': 'models.CASCADE'}), "('clothes.ClothesModel', on_delete=models.CASCADE)\n", (241, 291), False, 'from django.db import models\n'), ((325, 382), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""users....
""" This module contains preprocessing code to prepare data for training and inference. Examples: $ python preprocess.py \ --config configs/baseline.yaml """ import argparse from collections import Counter import os from types import SimpleNamespace import pandas as pd import torch import torchtext from ...
[ "argparse.ArgumentParser", "torch.nn.utils.rnn.pad_sequence", "torch.utils.data.DataLoader", "pandas.read_csv", "yaml.parser.parse_args", "yaml.safe_load", "yaml.parser.add_argument", "os.path.join", "types.SimpleNamespace", "torch.tensor" ]
[((9022, 9047), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (9045, 9047), False, 'import argparse\n'), ((9052, 9178), 'yaml.parser.add_argument', 'parser.add_argument', (['"""--config"""'], {'type': 'str', 'help': '"""File path where the model configuration file is located."""', 'required': ...
import grinpy as gp import pytest class TestZeroForcing: def test_non_integral_value_for_k_raises_TypeError_in_is_k_forcing(self): with pytest.raises(TypeError): G = gp.star_graph(2) gp.is_k_forcing_vertex(G, 1, [1], 1.5) def test_0_value_for_k_raises_ValueError_in_is_k_forcin...
[ "grinpy.is_connected_zero_forcing_set", "grinpy.empty_graph", "grinpy.is_zero_forcing_set", "grinpy.is_zero_forcing_vertex", "grinpy.max_degree", "grinpy.connected_k_forcing_number", "grinpy.is_k_forcing_vertex", "grinpy.zero_forcing_number", "pytest.raises", "grinpy.is_total_zero_forcing_set", ...
[((511, 527), 'grinpy.star_graph', 'gp.star_graph', (['(2)'], {}), '(2)\n', (524, 527), True, 'import grinpy as gp\n'), ((660, 676), 'grinpy.star_graph', 'gp.star_graph', (['(2)'], {}), '(2)\n', (673, 676), True, 'import grinpy as gp\n'), ((813, 829), 'grinpy.star_graph', 'gp.star_graph', (['(2)'], {}), '(2)\n', (826, ...
import plotly.figure_factory as ff import plotly.graph_objects as go import pandas as pd import statistics dataframe = pd.read_csv("StudentsPerformance.csv") data_list = dataframe["reading score"].to_list() data_mean = statistics.mean(data_list) data_median = statistics.median(data_list) data_mode = statist...
[ "plotly.graph_objects.Scatter", "statistics.median", "pandas.read_csv", "statistics.stdev", "statistics.mean", "plotly.figure_factory.create_distplot", "statistics.mode" ]
[((125, 163), 'pandas.read_csv', 'pd.read_csv', (['"""StudentsPerformance.csv"""'], {}), "('StudentsPerformance.csv')\n", (136, 163), True, 'import pandas as pd\n'), ((229, 255), 'statistics.mean', 'statistics.mean', (['data_list'], {}), '(data_list)\n', (244, 255), False, 'import statistics\n'), ((271, 299), 'statisti...
#!/usr/bin/env python # source - https://github.com/whoenig/crazyflie_ros/commit/b048c1f2fd3ee34f899fa0e2f6c58a4885a39405#diff-970be3522034ff436332d391db26982a from __future__ import absolute_import, division, unicode_literals, print_function import rospy import crazyflie import uav_trajectory import time import tf #...
[ "uav_trajectory.Trajectory", "time.sleep", "rospy.loginfo", "rospy.init_node", "rospy.wait_for_service", "crazyflie.Crazyflie" ]
[((579, 613), 'rospy.init_node', 'rospy.init_node', (['"""test_high_level"""'], {}), "('test_high_level')\n", (594, 613), False, 'import rospy\n'), ((712, 748), 'crazyflie.Crazyflie', 'crazyflie.Crazyflie', (['"""/cf1"""', '"""world"""'], {}), "('/cf1', 'world')\n", (731, 748), False, 'import crazyflie\n'), ((753, 802)...
import json from flask import Flask, request, redirect, session import requests import json from urllib.parse import quote app = Flask(__name__) app.secret_key = "super secret key" # Authentication Steps, paramaters, and responses are defined at https://developer.spotify.com/web-api/authorization-guide/ # Visit this ...
[ "json.loads", "flask.redirect", "flask.Flask", "json.dumps", "urllib.parse.quote", "requests.get", "requests.put", "requests.post" ]
[((130, 145), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (135, 145), False, 'from flask import Flask, request, redirect, session\n'), ((1440, 1458), 'flask.redirect', 'redirect', (['auth_url'], {}), '(auth_url)\n', (1448, 1458), False, 'from flask import Flask, request, redirect, session\n'), ((1826, 1...
from django.conf.urls import patterns, include, url from rest_framework import routers from books.api import views as api_views from books import views router = routers.DefaultRouter() # TODO: Nest API endpoints # # from rest_framework_extensions.routers import ExtendedSimpleRouter router.register(r'books', api_vie...
[ "django.conf.urls.url", "rest_framework.routers.DefaultRouter", "django.conf.urls.include" ]
[((163, 186), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (184, 186), False, 'from rest_framework import routers\n'), ((540, 611), 'django.conf.urls.url', 'url', (['"""^api/search/external/(?P<q>[\\\\w ]+)/$"""', 'api_views.search_external'], {}), "('^api/search/external/(?P<q>[\\...
from flask import Flask , request , jsonify,render_template import util app=Flask(__name__) @app.route('/') def get_location_names(): response = util.get_location_names() print(response) #response.headers.add('Access-control-Allow-origin','*') return render_template('app.html',response=response) @app....
[ "flask.render_template", "util.get_estimateud_price", "flask.Flask", "util.get_location_names" ]
[((76, 91), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (81, 91), False, 'from flask import Flask, request, jsonify, render_template\n'), ((150, 175), 'util.get_location_names', 'util.get_location_names', ([], {}), '()\n', (173, 175), False, 'import util\n'), ((268, 314), 'flask.render_template', 'rende...
import numpy as np import pandas as pd def get_bootstrap_indices(data, cluster_by=None, seed=None, n_draws=1000): """Draw positional indices for the construction of bootstrap samples. Storing the positional indices instead of the full bootstrap samples saves a lot of memory for datasets with many variabl...
[ "numpy.random.randint", "numpy.random.seed" ]
[((646, 666), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (660, 666), True, 'import numpy as np\n'), ((750, 800), 'numpy.random.randint', 'np.random.randint', (['(0)', 'n_obs'], {'size': '(n_draws, n_obs)'}), '(0, n_obs, size=(n_draws, n_obs))\n', (767, 800), True, 'import numpy as np\n')]
import json import boto3 from environs import Env env = Env() AWS_ENDPOINT_URL = env('AWS_ENDPOINT_URL', None) SMTP_HOST = env('SMTP_HOST', None) EMAIL_ENABLED = env.bool('EMAIL_ENABLED', default=True) secrets_manager_client = boto3.client('secretsmanager', endpoint_url=AWS_ENDPOINT_URL) def fetch_db_secret(db_se...
[ "json.loads", "boto3.client", "environs.Env" ]
[((58, 63), 'environs.Env', 'Env', ([], {}), '()\n', (61, 63), False, 'from environs import Env\n'), ((231, 292), 'boto3.client', 'boto3.client', (['"""secretsmanager"""'], {'endpoint_url': 'AWS_ENDPOINT_URL'}), "('secretsmanager', endpoint_url=AWS_ENDPOINT_URL)\n", (243, 292), False, 'import boto3\n'), ((472, 508), 'j...
#!/usr/bin/env python3 import requests import json import sqlite3 import sense_hat import time from pushbullet_api import PushbulletAPI from climate_util import ClimateUtil # Monitor and notification class class MonitorNotifier: def __init__(self, databaseName): # Get sense hat access self.__sense...
[ "json.load", "sense_hat.SenseHat", "climate_util.ClimateUtil.getCalibratedTemp", "time.sleep", "sqlite3.connect", "pushbullet_api.PushbulletAPI", "climate_util.ClimateUtil.checkConnection" ]
[((323, 343), 'sense_hat.SenseHat', 'sense_hat.SenseHat', ([], {}), '()\n', (341, 343), False, 'import sense_hat\n'), ((785, 800), 'pushbullet_api.PushbulletAPI', 'PushbulletAPI', ([], {}), '()\n', (798, 800), False, 'from pushbullet_api import PushbulletAPI\n'), ((1086, 1115), 'sqlite3.connect', 'sqlite3.connect', (['...
import Tkinter as tk class StatusBar: def __init__(self, root, label): self.label = tk.StringVar() self.label.set(label) self.root = root self.initialize() def initialize(self): frame = tk.Frame(self.root, relief=tk.SUNKEN) label = tk.Label(frame, font=('arial'...
[ "Tkinter.Frame", "Tkinter.StringVar", "Tkinter.Label" ]
[((98, 112), 'Tkinter.StringVar', 'tk.StringVar', ([], {}), '()\n', (110, 112), True, 'import Tkinter as tk\n'), ((237, 274), 'Tkinter.Frame', 'tk.Frame', (['self.root'], {'relief': 'tk.SUNKEN'}), '(self.root, relief=tk.SUNKEN)\n', (245, 274), True, 'import Tkinter as tk\n'), ((291, 384), 'Tkinter.Label', 'tk.Label', (...
#!/usr/bin/env python3 """{PIPELINE_NAME} pipeline (version: {PIPELINE_VERSION}): creates pipeline-specific config files to given output directory and runs the pipeline (unless otherwise requested). """ # generic usage {PIPELINE_NAME} and {PIPELINE_VERSION} replaced while # printing usage #--- standard library imports...
[ "os.path.abspath", "readunits.get_samples_and_readunits_from_cfgfile", "os.path.dirname", "logging.StreamHandler", "os.path.exists", "sys.path.insert", "os.path.realpath", "os.symlink", "logging.Formatter", "pipelines.logger.setLevel", "pipelines.get_cluster_cfgfile", "pipelines.get_pipeline_v...
[((1270, 1298), 'os.path.dirname', 'os.path.dirname', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (1285, 1298), False, 'import os\n'), ((1309, 1346), 'os.path.join', 'os.path.join', (['PIPELINE_BASEDIR', '"""cfg"""'], {}), "(PIPELINE_BASEDIR, 'cfg')\n", (1321, 1346), False, 'import os\n'), ((1470, 1497), 'logging.getLogg...
# -*- coding: utf-8 -*- """ Unit Test On Grid description: This is the unit test for basic grid. content: - TestGrid - TestGrid8D author: Shin-Fu (<NAME> latest update: - 2019/05/10 - 2019/05/14 add TestGridDB - 2019/05/15 add test_case for DynamicBoundGridWithShortcuts """ import ...
[ "sys.path.append", "unittest.main", "graph.duality_graph.DualityGraph", "graph.gridDB.DynamicBoundGridWithShortcuts", "os.path.dirname", "graph.grid8d.EightDirectionGrid", "graph.grid.GridWithWeights", "graph.gridDB.DynamicBoundGrid" ]
[((409, 430), 'sys.path.append', 'sys.path.append', (['root'], {}), '(root)\n', (424, 430), False, 'import sys\n'), ((375, 400), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (390, 400), False, 'import os\n'), ((2459, 2485), 'unittest.main', 'unittest.main', ([], {'verbosity': '(1)'}), '(ver...
#!/usr/bin/env python # vim:ts=4:sts=4:sw=4:et # # Author: <NAME> # Date: 2018-07-13 22:46:34 +0100 (Fri, 13 Jul 2018) # # 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 # and optionally...
[ "sys.path.append", "harisekhon.utils.UnknownError", "os.path.dirname", "traceback.format_exc", "harisekhon.utils.plural", "bs4.BeautifulSoup", "harisekhon.utils.support_msg", "harisekhon.utils.isInt", "os.path.join", "sys.exit" ]
[((990, 1019), 'os.path.join', 'os.path.join', (['srcdir', '"""pylib"""'], {}), "(srcdir, 'pylib')\n", (1002, 1019), False, 'import os\n'), ((1020, 1043), 'sys.path.append', 'sys.path.append', (['libdir'], {}), '(libdir)\n', (1035, 1043), False, 'import sys\n'), ((954, 979), 'os.path.dirname', 'os.path.dirname', (['__f...
import os import random from os.path import splitext from urllib.parse import urlparse import requests from dotenv import load_dotenv def get_file_extension(link): link_path = urlparse(link).path extension = splitext(link_path)[-1] return extension def get_last_comic_num(): url = "https://xkcd.com/...
[ "os.remove", "random.randint", "dotenv.load_dotenv", "os.path.splitext", "requests.get", "requests.HTTPError", "requests.post", "os.getenv", "urllib.parse.urlparse" ]
[((348, 365), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (360, 365), False, 'import requests\n'), ((520, 537), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (532, 537), False, 'import requests\n'), ((761, 808), 'random.randint', 'random.randint', (['first_comic_num', 'last_comic_num'], {}), '...
# Register your models here. from django.contrib.admin import register, ModelAdmin from fitbox.consultas.models import Consulta @register(Consulta) class ConsultaAdmin(ModelAdmin): list_filter = ('paciente',) prepopulated_fields = {'slug': ('descricao', )}
[ "django.contrib.admin.register" ]
[((132, 150), 'django.contrib.admin.register', 'register', (['Consulta'], {}), '(Consulta)\n', (140, 150), False, 'from django.contrib.admin import register, ModelAdmin\n')]