code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import numpy as np vector = np.array([5, 10, 15, 20]) equal_to_ten = (vector == 10) print(equal_to_ten) matrix = np.array([[10, 25, 30], [45, 50, 55], [60, 65, 70]]) equal_to_25 = (matrix[:, 1]) == 25 print(equal_to_25) ##Lire le dataset world_alcohol.csv dans la variable world_alcohol world_alcohol = np.genf...
[ "numpy.array", "numpy.genfromtxt" ]
[((29, 54), 'numpy.array', 'np.array', (['[5, 10, 15, 20]'], {}), '([5, 10, 15, 20])\n', (37, 54), True, 'import numpy as np\n'), ((118, 170), 'numpy.array', 'np.array', (['[[10, 25, 30], [45, 50, 55], [60, 65, 70]]'], {}), '([[10, 25, 30], [45, 50, 55], [60, 65, 70]])\n', (126, 170), True, 'import numpy as np\n'), ((3...
# Copyright 2021 Google # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
[ "cirq.equal_up_to_global_phase", "cirq.SWAP", "cirq.CNOT", "cirq.H", "cirq.LineQubit.range", "cirq.Circuit", "cirq.PhasedXZGate", "cirq.Y", "cirq_google.SycamoreGate", "cirq.X", "numpy.all" ]
[((676, 699), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)'], {}), '(2)\n', (696, 699), False, 'import cirq\n'), ((1893, 1943), 'cirq.equal_up_to_global_phase', 'cirq.equal_up_to_global_phase', (['actual_u', 'desired_u'], {}), '(actual_u, desired_u)\n', (1922, 1943), False, 'import cirq\n'), ((2118, 2145), 'n...
from RecoEgamma.EgammaElectronProducers.gsfElectrons_cfi import ecalDrivenGsfElectrons lowPtGsfElectronsPreRegression = ecalDrivenGsfElectrons.clone(gsfElectronCoresTag = "lowPtGsfElectronCores") from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toModify(lowPtGsfElectronsPreRegression,ctfTracksTag =...
[ "RecoEgamma.EgammaElectronProducers.gsfElectrons_cfi.ecalDrivenGsfElectrons.clone", "Configuration.Eras.Modifier_fastSim_cff.fastSim.toModify" ]
[((121, 194), 'RecoEgamma.EgammaElectronProducers.gsfElectrons_cfi.ecalDrivenGsfElectrons.clone', 'ecalDrivenGsfElectrons.clone', ([], {'gsfElectronCoresTag': '"""lowPtGsfElectronCores"""'}), "(gsfElectronCoresTag='lowPtGsfElectronCores')\n", (149, 194), False, 'from RecoEgamma.EgammaElectronProducers.gsfElectrons_cfi ...
# Generated by Django 3.0.5 on 2020-07-08 20:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('programs', '0003_program_total_lines'), ] operations = [ migrations.AlterField( model_name='program', name='finish_d...
[ "django.db.models.DateField" ]
[((344, 371), 'django.db.models.DateField', 'models.DateField', ([], {'null': '(True)'}), '(null=True)\n', (360, 371), False, 'from django.db import migrations, models\n'), ((498, 516), 'django.db.models.DateField', 'models.DateField', ([], {}), '()\n', (514, 516), False, 'from django.db import migrations, models\n')]
### # Python http post example. # # License - MIT. ### import os # pip install requests. import requests # pip install lxml # pip install beautifulsoup4 from bs4 import BeautifulSoup # login github class. class login_github(): # { # Initialization function. def __init__(self): # { # Chromium c...
[ "bs4.BeautifulSoup", "requests.Session", "requests.get" ]
[((683, 701), 'requests.Session', 'requests.Session', ([], {}), '()\n', (699, 701), False, 'import requests\n'), ((1030, 1087), 'requests.get', 'requests.get', ([], {'url': 'self._login_page', 'headers': 'self._headers'}), '(url=self._login_page, headers=self._headers)\n', (1042, 1087), False, 'import requests\n'), ((1...
from yattag import Doc from .CollectionEffort import CollectionEffort from .MeasureCompact import MeasureCompact from .NetInformation import NetInformation from .SimpleContent import CollectionDescriptionText, PassCount class BiologicalHabitatCollectionInformation: """ Allows for the reporting of b...
[ "yattag.Doc" ]
[((6591, 6596), 'yattag.Doc', 'Doc', ([], {}), '()\n', (6594, 6596), False, 'from yattag import Doc\n')]
"""title https://adventofcode.com/2021/day/23 """ from heapq import heappush, heappop import itertools entry_finder = {} # mapping of tasks to entries REMOVED = '<removed-task>' # placeholder for a removed task counter = itertools.count() # unique sequence count def add_task(pq, task, priori...
[ "heapq.heappush", "itertools.count", "heapq.heappop" ]
[((244, 261), 'itertools.count', 'itertools.count', ([], {}), '()\n', (259, 261), False, 'import itertools\n'), ((543, 562), 'heapq.heappush', 'heappush', (['pq', 'entry'], {}), '(pq, entry)\n', (551, 562), False, 'from heapq import heappush, heappop\n'), ((856, 867), 'heapq.heappop', 'heappop', (['pq'], {}), '(pq)\n',...
''' REST API for processing free-text diagnosis statements into either: (1) OWL class expressions (2) FHIR Condition Resources (3) SNOMED CT Expressions (4) Raw concept relationship graphs ''' from flask import Flask, request import api from transformers.transform import FhirConditionTransformer, Snom...
[ "flask.request.args.get", "flask.Flask", "api.process", "transformers.transform.DefaultTransformer", "transformers.transform.FhirConditionTransformer", "transformers.transform.SnomedExpressionTransformer", "transformers.transform.OwlTransformer" ]
[((387, 402), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (392, 402), False, 'from flask import Flask, request\n'), ((432, 448), 'transformers.transform.OwlTransformer', 'OwlTransformer', ([], {}), '()\n', (446, 448), False, 'from transformers.transform import FhirConditionTransformer, SnomedExpressionT...
from pyimagesearch.centroidtracker import CentroidTracker from pyimagesearch.trackableobject import TrackableObject from imutils.video import VideoStream from imutils.video import FPS import numpy as np import argparse import imutils import time import dlib import cv2 ap = argparse.ArgumentParser() ap.add_argument("-...
[ "time.sleep", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "numpy.arange", "imutils.video.VideoStream", "argparse.ArgumentParser", "dlib.rectangle", "cv2.line", "cv2.dnn.readNetFromCaffe", "cv2.VideoWriter", "imutils.video.FPS", "cv2.VideoWriter_fourcc", "cv2.waitKey", "cv2.dnn....
[((276, 301), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (299, 301), False, 'import argparse\n'), ((1220, 1277), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (["args['prototxt']", "args['model']"], {}), "(args['prototxt'], args['model'])\n", (1244, 1277), False, 'import cv2\n'), ...
#!/usr/bin/python from config.utils import * from elementals import Prompter from function_context import SourceContext, BinaryContext, IslandContext import os import sys import argparse import logging from collections import defaultdict def recordManualAnchors(library_config, knowledge_conf...
[ "os.path.exists", "argparse.ArgumentParser", "os.path.join", "elementals.Prompter", "collections.defaultdict" ]
[((1607, 1624), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1618, 1624), False, 'from collections import defaultdict\n'), ((4715, 4882), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'f"""Enables the user to manually defined matches, acting as manual anchors, late...
import logging import os import time import requests from lxml import etree import urllib.parse import json import schedule from colorama import Fore,init def getICBCNews()->tuple: logging.debug('Getting icbc news...') url = 'https://www.icbc.com.cn/ICBC/纪念币专区/default.htm' re = requests.get(url) htm...
[ "logging.basicConfig", "requests.post", "logging.debug", "os.getenv", "schedule.run_pending", "win10toast.ToastNotifier", "schedule.run_all", "requests.get", "time.sleep", "os.path.isfile", "schedule.every", "json.load", "os.system", "logging.info", "yagmail.SMTP", "json.dump", "sche...
[((188, 225), 'logging.debug', 'logging.debug', (['"""Getting icbc news..."""'], {}), "('Getting icbc news...')\n", (201, 225), False, 'import logging\n'), ((295, 312), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (307, 312), False, 'import requests\n'), ((366, 418), 'logging.info', 'logging.info', (['f"""...
# -*- coding: utf-8 -*- """ 东方财富网:流通股东爬虫(已废弃) """ import scrapy import json import time from crawl import db from crawl import helper from crawl.models.Stock import Stock from crawl.models.CirculationShareholder import CirculationShareholder class CirculationShareholdersSpider(scrapy.Spider): name = "circulatio...
[ "crawl.models.CirculationShareholder.CirculationShareholder.query", "crawl.models.CirculationShareholder.CirculationShareholder", "crawl.db.session.close", "crawl.models.Stock.Stock.query", "time.localtime" ]
[((795, 813), 'crawl.db.session.close', 'db.session.close', ([], {}), '()\n', (811, 813), False, 'from crawl import db\n'), ((4028, 4082), 'crawl.models.CirculationShareholder.CirculationShareholder', 'CirculationShareholder', ([], {}), '(**circulation_shareholder_data)\n', (4050, 4082), False, 'from crawl.models.Circu...
""" Testing for textpipe doc.py """ import pytest import random import spacy from textpipe.doc import Doc TEXT_1 = """<p><b>Text mining</b>, also referred to as <i><b>text data mining</b></i>, roughly equivalent to <b>text analytics</b>, is the process of deriving high-quality <a href="/wiki/Information" title="Infor...
[ "textpipe.doc.Doc", "spacy.blank", "pytest.raises", "random.choice" ]
[((1816, 1833), 'spacy.blank', 'spacy.blank', (['"""nl"""'], {}), "('nl')\n", (1827, 1833), False, 'import spacy\n'), ((1892, 1903), 'textpipe.doc.Doc', 'Doc', (['TEXT_1'], {}), '(TEXT_1)\n', (1895, 1903), False, 'from textpipe.doc import Doc\n'), ((1912, 1923), 'textpipe.doc.Doc', 'Doc', (['TEXT_2'], {}), '(TEXT_2)\n'...
from django.template import Library from taggit.models import Tag from ..models import Article, Category register = Library() @register.inclusion_tag('article/tags/recent_articles.html') def get_recent_articles(number=5): articles = Article.published.all()[:number] return {'articles': articles,} @register....
[ "taggit.models.Tag.objects.all", "django.template.Library" ]
[((119, 128), 'django.template.Library', 'Library', ([], {}), '()\n', (126, 128), False, 'from django.template import Library\n'), ((707, 724), 'taggit.models.Tag.objects.all', 'Tag.objects.all', ([], {}), '()\n', (722, 724), False, 'from taggit.models import Tag\n')]
from datetime import datetime from django.db import models from django.contrib import admin from django.contrib.auth.models import AbstractUser from django.conf import settings from django_fsm import FSMField, transition from django.utils.html import format_html from django.utils.safestring import mark_safe from djang...
[ "django_fsm.transition", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.FileField", "django.db.models.BooleanField", "django.utils.translation.ugettext", "django.utils.html.format_html", "django.db.models.SmallIntegerField", "django_fsm.FSMField", "django.db.models....
[((848, 892), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'unique': '(True)'}), '(max_length=20, unique=True)\n', (864, 892), False, 'from django.db import models\n'), ((906, 939), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)'}), '(default=True)\n', ...
# -*- coding: utf-8 -*- """ Module defines DataDog exporter class. """ from datadog import initialize, statsd from twindb_backup.exporter.base_exporter import ( BaseExporter, ExportCategory, ExportMeasureType, ) from twindb_backup.exporter.exceptions import DataDogExporterError class DataDogExporter(Bas...
[ "twindb_backup.exporter.exceptions.DataDogExporterError", "datadog.initialize", "datadog.statsd.gauge" ]
[((575, 596), 'datadog.initialize', 'initialize', ([], {}), '(**options)\n', (585, 596), False, 'from datadog import initialize, statsd\n'), ((1319, 1350), 'datadog.statsd.gauge', 'statsd.gauge', (['metric_name', 'data'], {}), '(metric_name, data)\n', (1331, 1350), False, 'from datadog import initialize, statsd\n'), ((...
from src.utils.config import CONFIG from discord.ext.commands import MemberConverter from random import sample, random async def kick_person(user): await user.move_to(None) async def random_kick(bot, ctx, user): prob = random() if user is not None: if prob <= 0.5: await ctx.send(f'โช...
[ "random.random", "discord.ext.commands.MemberConverter" ]
[((231, 239), 'random.random', 'random', ([], {}), '()\n', (237, 239), False, 'from random import sample, random\n'), ((1114, 1131), 'discord.ext.commands.MemberConverter', 'MemberConverter', ([], {}), '()\n', (1129, 1131), False, 'from discord.ext.commands import MemberConverter\n')]
from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.builtin import Command from TgBot.loader import dp from TgBot.utils.misc import rate_limit from TgBot.utils import chat_emails_keyboard from TgBot.states.watch import WatchGmail from loader import gmail_API, psqldb from...
[ "TgBot.utils.misc.rate_limit", "loader.gmail_API.make_user_creds", "aiogram.dispatcher.filters.builtin.Command", "re.match", "TgBot.utils.chat_emails_keyboard", "aiogram.types.ReplyKeyboardRemove", "loader.gmail_API.start_watch", "loader.psqldb.get_gmail_creds", "loader.psqldb.email_watched", "loa...
[((355, 377), 'TgBot.utils.misc.rate_limit', 'rate_limit', (['(5)', '"""watch"""'], {}), "(5, 'watch')\n", (365, 377), False, 'from TgBot.utils.misc import rate_limit\n'), ((841, 881), 'TgBot.loader.dp.message_handler', 'dp.message_handler', ([], {'state': 'WatchGmail.Add'}), '(state=WatchGmail.Add)\n', (859, 881), Fal...
#!/bin/python3 #Utilities for downloading and parsing Final Fantasy 14 Loadstone content #Copyright <NAME> 2016 BSD 3 clause license import requests from bs4 import BeautifulSoup import re def loastone_login(): print('http://na.finalfantasyxiv.com/lodestone/account/login/') #Get a page from the Loadstone # retur...
[ "bs4.BeautifulSoup", "requests.get", "re.compile" ]
[((682, 716), 'requests.get', 'requests.get', (['url'], {'cookies': 'cookies'}), '(url, cookies=cookies)\n', (694, 716), False, 'import requests\n'), ((823, 866), 'bs4.BeautifulSoup', 'BeautifulSoup', (['raw_page.text', '"""html.parser"""'], {}), "(raw_page.text, 'html.parser')\n", (836, 866), False, 'from bs4 import B...
from typing import List from queue import Queue import logging import os import os.path from entity_info import EntityInfo, EntityType class LocalFileCollector: """ This class is used to collect all paths that are need to be backed up. """ def __init__(self, source_list: List[str], queue_size: int ...
[ "logging.getLogger", "os.path.isabs", "os.path.islink", "os.path.join", "os.path.isfile", "os.path.isdir", "entity_info.EntityInfo", "os.path.commonpath", "queue.Queue", "os.walk" ]
[((1261, 1278), 'queue.Queue', 'Queue', (['queue_size'], {}), '(queue_size)\n', (1266, 1278), False, 'from queue import Queue\n'), ((1303, 1345), 'logging.getLogger', 'logging.getLogger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (1320, 1345), False, 'import logging\n'), ((1373, 1404), 'os.path....
from setuptools import setup setup( name='voice-commander', version='0.0.2a', packages=['voice_commander'], install_requires=['fuzzywuzzy', 'fuzzywuzzy[speedup]', 'keyboard', 'easygui', 'pyaudio', 'SpeechRecognition'], url='https://github.com/spyoungtech/voice-commander', license='MIT', aut...
[ "setuptools.setup" ]
[((30, 425), 'setuptools.setup', 'setup', ([], {'name': '"""voice-commander"""', 'version': '"""0.0.2a"""', 'packages': "['voice_commander']", 'install_requires': "['fuzzywuzzy', 'fuzzywuzzy[speedup]', 'keyboard', 'easygui', 'pyaudio',\n 'SpeechRecognition']", 'url': '"""https://github.com/spyoungtech/voice-commande...
from model.BBCluster import CustomSentenceTransformer, OptimCluster, euclid_dist from experiments.treccar_run import prepare_cluster_data_train_only, prepare_cluster_data2, get_trec_dat, \ get_paratext_dict from util.Data import InputTRECCARExample import numpy as np import torch import torch.nn as nn from torch im...
[ "torch.nn.Tanh", "sentence_transformers.models.Transformer", "transformers.get_constant_schedule_with_warmup", "sentence_transformers.util.batch_to_device", "torch.from_numpy", "numpy.array", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter", "torch.nn.Sigmoid", "numpy.mean", "t...
[((960, 975), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (971, 975), False, 'import random\n'), ((976, 997), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (993, 997), False, 'import torch\n'), ((998, 1016), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1012, 1016),...
import os from django.core.files import File from django.test import TestCase from django.contrib.auth import get_user_model from django.conf import settings from sme_management.models import * def create_sample_sme(org_name='Andela', address='Ikorodu Rd'): """Create and return sample sme.""" return SME.obj...
[ "os.path.exists", "django.contrib.auth.get_user_model", "django.core.files.File", "os.remove" ]
[((981, 991), 'django.core.files.File', 'File', (['file'], {}), '(file)\n', (985, 991), False, 'from django.core.files import File\n'), ((3296, 3312), 'os.remove', 'os.remove', (['fpath'], {}), '(fpath)\n', (3305, 3312), False, 'import os\n'), ((3321, 3381), 'os.remove', 'os.remove', (['(settings.BASE_DIR + sme_project...
import requests import requests.exceptions import requests_mock from tieronepointfive.enums import State, Transition from tieronepointfive.state_machine import StateMachineTick from tieronepointfive.evaluation_helpers import HttpHelper from ..mock_config import MockConfig google = 'https://www.google.com' b...
[ "tieronepointfive.evaluation_helpers.HttpHelper", "requests_mock.Mocker", "tieronepointfive.state_machine.StateMachineTick.create_completed", "tieronepointfive.state_machine.StateMachineTick" ]
[((927, 945), 'tieronepointfive.evaluation_helpers.HttpHelper', 'HttpHelper', (['config'], {}), '(config)\n', (937, 945), False, 'from tieronepointfive.evaluation_helpers import HttpHelper\n'), ((964, 1006), 'tieronepointfive.state_machine.StateMachineTick', 'StateMachineTick', (['State.CONNECTION_WORKING'], {}), '(Sta...
# Copyright 2019 Red Hat, 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...
[ "glance.version.version_info.version_string" ]
[((2106, 2135), 'glance.version.version_info.version_string', 'version_info.version_string', ([], {}), '()\n', (2133, 2135), False, 'from glance.version import version_info\n'), ((932, 961), 'glance.version.version_info.version_string', 'version_info.version_string', ([], {}), '()\n', (959, 961), False, 'from glance.ve...
''' Instructor control script for Project 5- Text Adventure Beta @author: acbart @requires: pedal @title: Project 5- Text Adventure- Control Script @version: 4/4/2019 10:29am ''' __version__ = 1 from pedal.assertions.organizers import phase, postcondition, precondition from pedal.assertions.setup import resolve_all f...
[ "pedal.sandbox.commands.call", "pedal.sandbox.commands.run", "pedal.assertions.organizers.phase", "pedal.assertions.setup.resolve_all", "cisc108.assertions._validate_type", "pedal.sandbox.commands.evaluate" ]
[((713, 718), 'pedal.sandbox.commands.run', 'run', ([], {}), '()\n', (716, 718), False, 'from pedal.sandbox.commands import evaluate, call, run\n'), ((3099, 3157), 'pedal.assertions.organizers.phase', 'phase', (['"""make_world_components"""'], {'after': '"""win_and_lose_paths"""'}), "('make_world_components', after='wi...
import csv import pandas as pd import numpy as np import os import sys root_dir = os.path.dirname(__file__) sys.path.insert(0, root_dir + '/../..') class ETL: def __init__(self): self.data = None def load_data(self, path): self.data = pd.read_csv(path) return self
[ "os.path.dirname", "sys.path.insert", "pandas.read_csv" ]
[((83, 108), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (98, 108), False, 'import os\n'), ((109, 148), 'sys.path.insert', 'sys.path.insert', (['(0)', "(root_dir + '/../..')"], {}), "(0, root_dir + '/../..')\n", (124, 148), False, 'import sys\n'), ((262, 279), 'pandas.read_csv', 'pd.read_c...
""" Tornado server utilities - LoggingApplication: a base Application class with logging and metrics - RequestHandler: a base request handler with helpers Dependencies: - metrics - servicelog See tests/test_tornadoutil.py for usage example. """ import json import datetime import uuid import httplib # for httplib.r...
[ "servicelog.log", "json.JSONEncoder.default", "metrics.configure", "json.dumps", "uuid.uuid1", "httplib.responses.get", "metrics.timeit" ]
[((948, 989), 'metrics.configure', 'metrics.configure', ([], {'prefix': 'self.service_id'}), '(prefix=self.service_id)\n', (965, 989), False, 'import metrics\n'), ((2262, 2284), 'servicelog.log', 'servicelog.log', (['packet'], {}), '(packet)\n', (2276, 2284), False, 'import servicelog\n'), ((3290, 3322), 'json.dumps', ...
# Copyright (c) 2022 Exograd SAS. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
[ "typing.TypeVar" ]
[((869, 936), 'typing.TypeVar', 'TypeVar', (['"""FieldType"""', 'str', 'datetime.datetime', 'int', 'bool', 'dict', 'list'], {}), "('FieldType', str, datetime.datetime, int, bool, dict, list)\n", (876, 936), False, 'from typing import Any, Dict, List, Optional, TypeVar, Type\n')]
# -*- coding: utf-8 -*- import logging from collections import defaultdict from dplace_app.models import Language, ISOCode, Society, LanguageFamily from util import delete_all def xd_to_language(items, languoids): delete_all(Language) delete_all(LanguageFamily) delete_all(ISOCode) glottolog = {l['i...
[ "dplace_app.models.LanguageFamily.objects.create", "logging.warning", "dplace_app.models.ISOCode.objects.create", "util.delete_all", "collections.defaultdict", "dplace_app.models.Society.objects.all", "dplace_app.models.Language.objects.create" ]
[((222, 242), 'util.delete_all', 'delete_all', (['Language'], {}), '(Language)\n', (232, 242), False, 'from util import delete_all\n'), ((247, 273), 'util.delete_all', 'delete_all', (['LanguageFamily'], {}), '(LanguageFamily)\n', (257, 273), False, 'from util import delete_all\n'), ((278, 297), 'util.delete_all', 'dele...
""" contains several utilities for error handling allows for storing "chained error information" without copying the entire traceback object. Note: module is currently not used / within a later refactoring the following error-Approach will be implemented: - bellow-flow level errors are never ignored / rather: throw ...
[ "yaml.safe_dump" ]
[((2969, 2988), 'yaml.safe_dump', 'yaml.safe_dump', (['res'], {}), '(res)\n', (2983, 2988), False, 'import yaml\n')]
import os import app.database.seed.seed_helper as helper from app.translation.deserializer import Deserializer from app.extensions import db real_madrid = { 'name': '<NAME>', 'players': helper.read_csv_file(os.path.join(os.path.dirname(__file__), 'players.csv')), } team = Deserializer().deserialize_team(rea...
[ "os.path.dirname", "app.translation.deserializer.Deserializer", "app.extensions.db.session.add" ]
[((330, 350), 'app.extensions.db.session.add', 'db.session.add', (['team'], {}), '(team)\n', (344, 350), False, 'from app.extensions import db\n'), ((285, 299), 'app.translation.deserializer.Deserializer', 'Deserializer', ([], {}), '()\n', (297, 299), False, 'from app.translation.deserializer import Deserializer\n'), (...
import solver.algorithms as alg import numpy as np def problem4(t0, tf, NA0, NB0, tauA, tauB, n, returnlist=False): """Uses Euler's method to model the solution to a radioactive decay problem where dNA/dt = -NA/tauA and dNB/dt = NA/tauA - NB/tauB. Args: t0 (float): Start time tf (float): End t...
[ "numpy.array", "solver.algorithms.euler" ]
[((985, 1005), 'numpy.array', 'np.array', (['[NA0, NB0]'], {}), '([NA0, NB0])\n', (993, 1005), True, 'import numpy as np\n'), ((1014, 1063), 'numpy.array', 'np.array', (['[[-1 / tauA, 0], [1 / tauA, -1 / tauB]]'], {}), '([[-1 / tauA, 0], [1 / tauA, -1 / tauB]])\n', (1022, 1063), True, 'import numpy as np\n'), ((1178, 1...
# This example shows how a space can be modelled with loops. import exhaust def generate_numbers(state: exhaust.State): numbers = [] for _ in range(5): numbers.append(state.randint(1, 5)) return numbers for numbers in exhaust.space(generate_numbers): print(numbers) # Output: # [1, 1, 1, 1, 1...
[ "exhaust.space" ]
[((241, 272), 'exhaust.space', 'exhaust.space', (['generate_numbers'], {}), '(generate_numbers)\n', (254, 272), False, 'import exhaust\n')]
from datetime import datetime, timedelta from hamcrest.core.base_matcher import BaseMatcher class WithinDatetimeMatcher(BaseMatcher): def __init__(self, lower_limit_datetime: datetime, upper_limit_datetime: datetime): self.__lowerLimit = lower_limit_datetime self.__upperLimit = upper_limit_datet...
[ "datetime.timedelta", "datetime.datetime.utcnow" ]
[((611, 628), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (626, 628), False, 'from datetime import datetime, timedelta\n'), ((631, 652), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(10)'}), '(seconds=10)\n', (640, 652), False, 'from datetime import datetime, timedelta\n'), ((662, 679), 'da...
import requests from bs4 import BeautifulSoup import pickle import re, datetime # 뉴스 중복 확인 def duplication_check(new_news, saved_news_list): if new_news in saved_news_list: return False else: saved_news_list.append(new_news) return True # 기사 날짜, 시간 표현 (시간정보가 '~전'인 경우) def get_released_time1(current_ti...
[ "pickle.dump", "re.compile", "pickle.load", "requests.get", "bs4.BeautifulSoup", "datetime.datetime.today", "datetime.timedelta" ]
[((1866, 1883), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1878, 1883), False, 'import requests\n'), ((1922, 1947), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (1945, 1947), False, 'import re, datetime\n'), ((1972, 2003), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"...
""" File name: extracted_features_gridsearch.py Author: <NAME> Date created: 29.04.2019 """ import numpy as np import sys import os import yaml import pickle import pandas as pd import pandas.core.indexes sys.modules['pandas.indexes'] = pandas.core.indexes import json import time import keras import tensorflow as t...
[ "helper.model.compile", "sklearn.metrics.roc_auc_score", "sklearn.model_selection.ParameterGrid", "os.path.exists", "tensorflow.Session", "yaml.add_constructor", "keras.layers.concatenate", "keras.models.Model", "keras.callbacks.EarlyStopping", "keras.backend.clear_session", "tensorflow.ConfigPr...
[((1166, 1182), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (1180, 1182), True, 'import tensorflow as tf\n'), ((1587, 1622), 'yaml.add_constructor', 'yaml.add_constructor', (['"""!join"""', 'join'], {}), "('!join', join)\n", (1607, 1622), False, 'import yaml\n'), ((2523, 2555), 'multimodal_prediction_...
# Generated by Django 2.1.1 on 2018-09-20 07:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('FootageManager', '0002_footage_length'), ] operations = [ migrations.AddField( model_name='footage', name='staticpat...
[ "django.db.models.CharField" ]
[((342, 414), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(200)', 'verbose_name': '"""static_path"""'}), "(default='', max_length=200, verbose_name='static_path')\n", (358, 414), False, 'from django.db import migrations, models\n')]
import pandas as pd import json import numpy as np #DEFINITIONS NAMESPACE = "it.gov.daf.dataset.opendata" def getData(path): if (path.lower().endswith((".json", ".geojson"))): with open(path) as data_file: dataJson = json.load(data_file) return pd.io.json.json_normalize(dataJson, sep='...
[ "json.load", "numpy.dtype", "pandas.io.json.json_normalize", "pandas.read_csv" ]
[((279, 325), 'pandas.io.json.json_normalize', 'pd.io.json.json_normalize', (['dataJson'], {'sep': '""".|."""'}), "(dataJson, sep='.|.')\n", (304, 325), True, 'import pandas as pd\n'), ((991, 1004), 'numpy.dtype', 'np.dtype', (['"""O"""'], {}), "('O')\n", (999, 1004), True, 'import numpy as np\n'), ((1024, 1043), 'nump...
import redis redis_client = redis.StrictRedis(host="127.0.0.1", port=6379) input("")
[ "redis.StrictRedis" ]
[((29, 75), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""127.0.0.1"""', 'port': '(6379)'}), "(host='127.0.0.1', port=6379)\n", (46, 75), False, 'import redis\n')]
import logging import random from abc import abstractmethod from pycoin.serialize import b2h from cert_issuer import tx_utils from cert_issuer.errors import InsufficientFundsError from cert_issuer.signer import FinalizableSigner # Estimate fees assuming worst case 3 inputs ESTIMATE_NUM_INPUTS = 3 # Estimate fees as...
[ "random.shuffle", "logging.info", "cert_issuer.tx_utils.get_byte_count", "pycoin.serialize.b2h", "cert_issuer.tx_utils.create_trx", "cert_issuer.signer.FinalizableSigner", "cert_issuer.tx_utils.verify_transaction", "cert_issuer.tx_utils.calculate_tx_fee", "cert_issuer.tx_utils.prepare_tx_for_signing...
[((1124, 1196), 'cert_issuer.tx_utils.calculate_tx_fee', 'tx_utils.calculate_tx_fee', (['tx_cost_constants', 'num_inputs', 'V2_NUM_OUTPUTS'], {}), '(tx_cost_constants, num_inputs, V2_NUM_OUTPUTS)\n', (1149, 1196), False, 'from cert_issuer import tx_utils\n'), ((1424, 1494), 'cert_issuer.tx_utils.create_trx', 'tx_utils....
import pytest import numpy as np from csgo.analytics.distance import ( bombsite_distance, point_distance, polygon_area, area_distance, ) from csgo.analytics.coords import Encoder class TestCSGOAnalytics: """Class to test CSGO analytics""" def test_bombsite_distance(self): """Test bo...
[ "csgo.analytics.distance.area_distance", "csgo.analytics.distance.polygon_area", "pytest.raises", "csgo.analytics.distance.point_distance", "csgo.analytics.coords.Encoder", "csgo.analytics.distance.bombsite_distance" ]
[((2150, 2159), 'csgo.analytics.coords.Encoder', 'Encoder', ([], {}), '()\n', (2157, 2159), False, 'from csgo.analytics.coords import Encoder\n'), ((364, 392), 'csgo.analytics.distance.bombsite_distance', 'bombsite_distance', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (381, 392), False, 'from csgo.analytics.distance import ...
# coding: utf-8 import logging import re from itertools import chain from textwrap import TextWrapper from django.core import mail from django.test import TestCase as DjangoTestCase from django.views import debug from six import string_types from six.moves.urllib.parse import urlparse, urlunparse from threadlocals.th...
[ "logging.getLogger", "threadlocals.threadlocals.set_thread_variable", "re.compile", "logging.Formatter", "textwrap.TextWrapper", "six.moves.urllib.parse.urlparse", "six.moves.urllib.parse.urlunparse" ]
[((487, 519), 'logging.Formatter', 'logging.Formatter', (['"""%(message)s"""'], {}), "('%(message)s')\n", (504, 519), False, 'import logging\n'), ((529, 556), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (546, 556), False, 'import logging\n'), ((574, 599), 're.compile', 're.compile', ([...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: networking/v1alpha3/service_dependency.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from googl...
[ "google.protobuf.descriptor_pb2.MessageOptions", "google.protobuf.symbol_database.Default", "google.protobuf.descriptor.FieldDescriptor", "google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper", "google.protobuf.descriptor.EnumValueDescriptor", "google.protobuf.descriptor_pb2.FileOptions" ]
[((566, 592), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (590, 592), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2141, 2188), 'google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper', 'enum_type_wrapper.EnumTypeWrapper', (['_CONFIGSCOPE...
# -*- coding: utf-8 -*- """ Created on Fri Jan 29 14:37:54 2021 @author: Ham """ import more_itertools as mit import io STDIN_SIO = io.StringIO(""" abcd """.strip()) def partition_mit(s: str) -> list: # Copied from: https://stackoverflow.com/questions/4904430/find-all-list-permutations-of-split...
[ "more_itertools.partitions" ]
[((375, 392), 'more_itertools.partitions', 'mit.partitions', (['s'], {}), '(s)\n', (389, 392), True, 'import more_itertools as mit\n')]
"""A extrem simple Packet Encoder for the BasicPacketEncodingLayer""" from PiCN.Layers.PacketEncodingLayer.Encoder import BasicEncoder from PiCN.Packets import Packet, Content, Interest, Name, Nack, NackReason, UnknownPacket class SimpleStringEncoder(BasicEncoder): """An extreme simple Packet Encoder for the Basi...
[ "PiCN.Packets.UnknownPacket", "PiCN.Packets.Name" ]
[((2228, 2234), 'PiCN.Packets.Name', 'Name', ([], {}), '()\n', (2232, 2234), False, 'from PiCN.Packets import Packet, Content, Interest, Name, Nack, NackReason, UnknownPacket\n'), ((2419, 2425), 'PiCN.Packets.Name', 'Name', ([], {}), '()\n', (2423, 2425), False, 'from PiCN.Packets import Packet, Content, Interest, Name...
from Task import Task from Helper import Cli class CliExecute(Task): def __init__(self, logMethod, parent, params): super().__init__("CLI Execute", parent, params, logMethod, None) def Run(self): parameters = self.params['Parameters'] cwd = self.params['CWD'] cli = Cli(parame...
[ "Helper.Cli" ]
[((310, 346), 'Helper.Cli', 'Cli', (['parameters', 'cwd', 'self.logMethod'], {}), '(parameters, cwd, self.logMethod)\n', (313, 346), False, 'from Helper import Cli\n')]
import airflow from airflow import DAG from airflow.operators.bash_operator import BashOperator from datetime import datetime, timedelta schedule_interval = timedelta(days=2) default_args = { 'owner': '<NAME>', 'depends_on_past': False, 'start_date': datetime.now() - schedule_interval, 'email': ['<EMA...
[ "datetime.datetime.now", "datetime.timedelta", "airflow.operators.bash_operator.BashOperator", "airflow.DAG" ]
[((158, 175), 'datetime.timedelta', 'timedelta', ([], {'days': '(2)'}), '(days=2)\n', (167, 175), False, 'from datetime import datetime, timedelta\n'), ((455, 583), 'airflow.DAG', 'DAG', (['"""scheduler"""'], {'default_args': 'default_args', 'description': '"""DAG for the Spark Batch Job"""', 'schedule_interval': 'sche...
import logging logger = logging.getLogger(__name__) # Pump rate in mL/s (4.3 L/min) _PUMP_RATE_ML_PER_SEC = 4300.0 / 60.0 # Default amount of water to add to the plant (in mL) when pump manager detects # low soil moisture. DEFAULT_PUMP_AMOUNT = 200 class Pump(object): """Wrapper for a Seaflo 12V water pump."""...
[ "logging.getLogger" ]
[((25, 52), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (42, 52), False, 'import logging\n')]
from setuptools import setup, find_packages setup(name='dune.common', namespace_packages=['dune'], version='2.4', description='Python package accompanying the DUNE project', url='http://www.dune-project.org', author='<NAME>', author_email='<EMAIL>', license='BSD', packag...
[ "setuptools.setup" ]
[((45, 400), 'setuptools.setup', 'setup', ([], {'name': '"""dune.common"""', 'namespace_packages': "['dune']", 'version': '"""2.4"""', 'description': '"""Python package accompanying the DUNE project"""', 'url': '"""http://www.dune-project.org"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"...
from unittest import TestCase from inlinestyler.utils import inline_css class TestUtils(TestCase): def setUp(self): self.the_document = '<html><head><style>.turn_red{ color: red; }</style></head><body><p class="turn_red">This text should be red.</p></body></html>' def test_inline_css(self): ...
[ "inlinestyler.utils.inline_css" ]
[((495, 524), 'inlinestyler.utils.inline_css', 'inline_css', (['self.the_document'], {}), '(self.the_document)\n', (505, 524), False, 'from inlinestyler.utils import inline_css\n')]
import datetime import app.helpers.helpers from app.controllers.api import record as record_api from app.helpers import helpers class TestRecord: def get_record(self, records, type_): for record in records: if record["type"] == type_: return record def test_list_no_Record...
[ "app.controllers.api.record.get_serial_resource", "datetime.timedelta", "app.helpers.helpers.soa_time_set", "datetime.datetime.now" ]
[((14870, 14915), 'app.controllers.api.record.get_serial_resource', 'record_api.get_serial_resource', (['"""company.com"""'], {}), "('company.com')\n", (14900, 14915), True, 'from app.controllers.api import record as record_api\n'), ((14937, 14959), 'app.helpers.helpers.soa_time_set', 'helpers.soa_time_set', ([], {}), ...
import sympy as simp from sympy import sin, pi import pandas as pd from labtool_ex2 import Project from uncertainties import ufloat if __name__ == "__main__": gm = { "P1": r"P_1", "PR": r"P_R", "theoPR": r"P_R", "U1": r"U_1", "U2": r"U_2", "I1": r"I_1", "I2":...
[ "uncertainties.ufloat", "labtool_ex2.Project" ]
[((1250, 1315), 'labtool_ex2.Project', 'Project', (['"""Trafo"""'], {'global_variables': 'gv', 'global_mapping': 'gm', 'font': '(13)'}), "('Trafo', global_variables=gv, global_mapping=gm, font=13)\n", (1257, 1315), False, 'from labtool_ex2 import Project\n'), ((6348, 6363), 'uncertainties.ufloat', 'ufloat', (['(68)', '...
""" Reference: https://matheusfacure.github.io/python-causality-handbook/11-Propensity-Score.html# """ import numpy as np import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.neighbors import NearestNeighbors import seaborn as sns from matplotlib import pyplot as plt from causalinference...
[ "numpy.mean", "causalinference.CausalModel", "sklearn.linear_model.LogisticRegression", "seaborn.boxplot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((2070, 2116), 'seaborn.boxplot', 'sns.boxplot', ([], {'x': '"""age"""', 'y': '"""pscore"""', 'data': 'data_ps'}), "(x='age', y='pscore', data=data_ps)\n", (2081, 2116), True, 'import seaborn as sns\n'), ((2121, 2154), 'matplotlib.pyplot.title', 'plt.title', (['"""Confounding Evidence"""'], {}), "('Confounding Evidenc...
import subprocess import os def download_task_model(task): m_path = os.path.join('/home/ubuntu/s3', "model_log_final", task, "logs/model.permanent-ckpt") dirs, fname = os.path.split(m_path) dst_dir = dirs.replace('/home/ubuntu/s3', "s3://taskonomy-unpacked-oregon") ...
[ "os.path.join", "subprocess.call", "os.path.split" ]
[((72, 161), 'os.path.join', 'os.path.join', (['"""/home/ubuntu/s3"""', '"""model_log_final"""', 'task', '"""logs/model.permanent-ckpt"""'], {}), "('/home/ubuntu/s3', 'model_log_final', task,\n 'logs/model.permanent-ckpt')\n", (84, 161), False, 'import os\n'), ((214, 235), 'os.path.split', 'os.path.split', (['m_path...
import base64 import hashlib import inspect import logging import os import random import string import sys import textwrap import re import uuid import warnings from datetime import datetime from secrets import token_bytes from time import sleep from urllib.parse import urlencode, quote_plus, unquote_plus from d...
[ "logging.getLogger", "logging.StreamHandler", "re.compile", "base64.b64encode", "time.sleep", "random.choices", "textwrap.wrap", "base64.decodebytes", "osbot_utils.fluent.Fluent_Dict.Fluent_Dict", "urllib.parse.quote_plus", "inspect.getmembers", "dotenv.load_dotenv", "logging.FileHandler", ...
[((738, 770), 'base64.decodebytes', 'base64.decodebytes', (['bytes_base64'], {}), '(bytes_base64)\n', (756, 770), False, 'import base64\n'), ((3201, 3214), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (3212, 3214), False, 'from dotenv import load_dotenv\n'), ((3462, 3481), 'osbot_utils.fluent.Fluent_List.Flue...
#coding=utf-8 ''' Created on 2015-9-24 @author: Devuser ''' from doraemon.project.models import Project class ProjectLeftNavBar(object): ''' classdocs ''' def __init__(self,request,projectid): self.request=request # self.dashboard_href='/project/'+str(projectid)+'/dashboard' s...
[ "doraemon.project.models.Project.objects.get" ]
[((803, 833), 'doraemon.project.models.Project.objects.get', 'Project.objects.get', (['projectid'], {}), '(projectid)\n', (822, 833), False, 'from doraemon.project.models import Project\n')]
#By @Joel_Noob from pyrogram import Client, filters from config import Config @Client.on_message( filters.private & filters.command("broadcast") & filters.user(Config.ADMINS) & filters.reply ) async def broadcast_(c, m): await c.start_broadcast( broadcast_message=m.reply_to_message, admin...
[ "pyrogram.filters.command", "pyrogram.filters.user" ]
[((162, 189), 'pyrogram.filters.user', 'filters.user', (['Config.ADMINS'], {}), '(Config.ADMINS)\n', (174, 189), False, 'from pyrogram import Client, filters\n'), ((127, 155), 'pyrogram.filters.command', 'filters.command', (['"""broadcast"""'], {}), "('broadcast')\n", (142, 155), False, 'from pyrogram import Client, fi...
import numpy as np import theano import theano.tensor as tensor from utils import _p, numpy_floatX from utils import ortho_weight, uniform_weight, zero_bias """ Encoder using LSTM Recurrent Neural Network. """ def param_init_encoder(options, params, prefix='lstm_encoder'): n_x = options['n_x'] n_h = opt...
[ "utils.zero_bias", "utils.ortho_weight", "numpy.ones", "utils.uniform_weight", "utils._p", "theano.tensor.tanh", "utils.numpy_floatX", "theano.tensor.dot" ]
[((826, 844), 'utils.zero_bias', 'zero_bias', (['(4 * n_h)'], {}), '(4 * n_h)\n', (835, 844), False, 'from utils import ortho_weight, uniform_weight, zero_bias\n'), ((553, 568), 'utils._p', '_p', (['prefix', '"""W"""'], {}), "(prefix, 'W')\n", (555, 568), False, 'from utils import _p, numpy_floatX\n'), ((771, 786), 'ut...
# coding=utf-8 from plugins.auth.crypto.algo_base import BaseAlgorithm from pbkdf2 import crypt __author__ = '<NAME>' class PBKDF2Algo(BaseAlgorithm): def check(self, hash, value, salt=None): return hash == self.hash(value, hash) def hash(self, value, salt=None): return crypt( ...
[ "pbkdf2.crypt" ]
[((301, 340), 'pbkdf2.crypt', 'crypt', (['value'], {'salt': 'salt', 'iterations': '(400)'}), '(value, salt=salt, iterations=400)\n', (306, 340), False, 'from pbkdf2 import crypt\n')]
import numpy as np import statistics as stat treshold = 3 def removeFalseData(input_data): while(1): try: input_data.remove(False) except ValueError: break return(input_data) def removeNegatives(input_data): processed_data = [] for val in input_d...
[ "statistics.median", "numpy.mean", "numpy.std" ]
[((528, 551), 'statistics.median', 'stat.median', (['input_data'], {}), '(input_data)\n', (539, 551), True, 'import statistics as stat\n'), ((563, 582), 'numpy.mean', 'np.mean', (['input_data'], {}), '(input_data)\n', (570, 582), True, 'import numpy as np\n'), ((596, 614), 'numpy.std', 'np.std', (['input_data'], {}), '...
import encoding from torch import nn import torch class FCN(nn.Module): """ wrapper around encnet module, putting it into terms similar to psp/psanet for convenience """ def __init__(self, pretrained=True): super(FCN, self).__init__() self.model = encoding.models.get_model('FCN_ResNet50...
[ "encoding.models.get_model", "torch.rand" ]
[((281, 350), 'encoding.models.get_model', 'encoding.models.get_model', (['"""FCN_ResNet50s_ADE"""'], {'pretrained': 'pretrained'}), "('FCN_ResNet50s_ADE', pretrained=pretrained)\n", (306, 350), False, 'import encoding\n'), ((558, 591), 'torch.rand', 'torch.rand', ([], {'size': '(1, 3, 473, 473)'}), '(size=(1, 3, 473, ...
# Для решения этой задачи необходимо установить библиотеку openpyxl и создать скрипт со следующем содержанием: # Запустите скрипт и в качестве ответа введите то, что он выведет. import openpyxl wb = openpyxl.load_workbook('inputs/input12.xlsx') sh = wb.active nmin = sh.cell(row=7, column=2).value for rownum in range(...
[ "openpyxl.load_workbook" ]
[((201, 246), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['"""inputs/input12.xlsx"""'], {}), "('inputs/input12.xlsx')\n", (223, 246), False, 'import openpyxl\n')]
from os.path import join as pjoin from .utils import save_dict_to_json_file, load_dict_from_json_file class Status(object): def __init__(self, trainer=None, starting_epoch=0, starting_update=0): self.current_epoch = starting_epoch self.current_update = starting_update self.current_update_...
[ "os.path.join" ]
[((1604, 1633), 'os.path.join', 'pjoin', (['savedir', '"""status.json"""'], {}), "(savedir, 'status.json')\n", (1609, 1633), True, 'from os.path import join as pjoin\n'), ((1718, 1747), 'os.path.join', 'pjoin', (['loaddir', '"""status.json"""'], {}), "(loaddir, 'status.json')\n", (1723, 1747), True, 'from os.path impor...
"""URL Configuration""" from django.contrib import admin from django.urls import path, include from django.conf import settings from django.views.generic import TemplateView from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('', include(('apps.users.urls', 'use...
[ "django.conf.urls.static.static", "django.urls.path", "django.urls.include" ]
[((451, 512), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (457, 512), False, 'from django.conf.urls.static import static\n'), ((242, 273), 'django.urls.path', 'path', (['"""admin/"""', 'admin...
'''We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime. What is the largest n-digit pandigital prime that exists?''' import itertools import functools def pandigital_generator(n): perms = itertools.pe...
[ "functools.reduce" ]
[((382, 429), 'functools.reduce', 'functools.reduce', (['(lambda x, y: x * 10 + y)', 'perm'], {}), '(lambda x, y: x * 10 + y, perm)\n', (398, 429), False, 'import functools\n')]
""" Client creation action. ~~~~~~~~~~~~~~~~~~~~~~~ """ from .action import Action from .action import ActionExecutionException from .action import InvalidActionConfigurationException from .utils import get_user_roles from .utils import InvalidUserResponse from .utils import process_user_roles import requests import ...
[ "urllib.parse.quote" ]
[((8061, 8096), 'urllib.parse.quote', 'urllib.parse.quote', (['self.realm_name'], {}), '(self.realm_name)\n', (8079, 8096), False, 'import urllib\n'), ((8114, 8145), 'urllib.parse.quote', 'urllib.parse.quote', (['client_uuid'], {}), '(client_uuid)\n', (8132, 8145), False, 'import urllib\n'), ((8163, 8192), 'urllib.pars...
from yuuhpizzakebab import app, admin_required, login_required from .models import Pizza, Topping from flask import render_template, session, redirect, url_for, request, flash @app.route('/pizzas') def list_pizzas(): """Shows a list of pizzas.""" return render_template('pizza/pizzas.html', ...
[ "flask.request.args.get", "flask.flash", "yuuhpizzakebab.app.route", "flask.request.form.getlist", "flask.url_for" ]
[((180, 200), 'yuuhpizzakebab.app.route', 'app.route', (['"""/pizzas"""'], {}), "('/pizzas')\n", (189, 200), False, 'from yuuhpizzakebab import app, admin_required, login_required\n'), ((424, 475), 'yuuhpizzakebab.app.route', 'app.route', (['"""/pizza/create"""'], {'methods': "['GET', 'POST']"}), "('/pizza/create', met...
# External module dependencies from dataclasses import dataclass, field from typing import Any, ParamSpec, Callable, Tuple, List, Dict, Set from pathlib import Path import hashlib import json import yaml # Internal module dependencies from . import dataspec ############################################################...
[ "pathlib.Path", "yaml.dump", "yaml.safe_load", "dataclasses.field", "typing.ParamSpec" ]
[((1758, 1772), 'typing.ParamSpec', 'ParamSpec', (['"""P"""'], {}), "('P')\n", (1767, 1772), False, 'from typing import Any, ParamSpec, Callable, Tuple, List, Dict, Set\n'), ((640, 667), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (645, 667), False, 'from dataclasses imp...
#!/usr/bin/env python # coding:utf-8 """ @version: 3.4.4 @author: linfeng @file: crawl_video.py @time: 2019/3/16 16:04 """ import os import re import requests from multiprocessing import Process from urllib.parse import urlparse from base_crawl import BaseCrawl class CrawlVideo(Process, BaseCrawl): def __init...
[ "urllib.parse.urlparse", "multiprocessing.Process.__init__", "os.path.join", "requests.get", "re.sub", "base_crawl.BaseCrawl.__init__" ]
[((557, 579), 'multiprocessing.Process.__init__', 'Process.__init__', (['self'], {}), '(self)\n', (573, 579), False, 'from multiprocessing import Process\n'), ((588, 616), 'base_crawl.BaseCrawl.__init__', 'BaseCrawl.__init__', (['self', 'id'], {}), '(self, id)\n', (606, 616), False, 'from base_crawl import BaseCrawl\n'...
import parser from coretypes import * def dopen(fname): contents = open(fname).read() return parser.parse_extern(contents) def dshape(o): if isinstance(o, str): return parser.parse(o) elif isinstance(o, DataShape): return o else: raise TypeError('Cannot create dshape from o...
[ "parser.parse_extern", "parser.parse" ]
[((102, 131), 'parser.parse_extern', 'parser.parse_extern', (['contents'], {}), '(contents)\n', (121, 131), False, 'import parser\n'), ((190, 205), 'parser.parse', 'parser.parse', (['o'], {}), '(o)\n', (202, 205), False, 'import parser\n')]
# -*- coding: utf-8 -*- import signal from pyMagician import pyMagician signal.signal(signal.SIGINT, signal.SIG_DFL) magician = pyMagician(port='/dev/cu.usbmodem0121') if magician.connect(): print('- success connect') print('- read_version') print(magician.read_version()) for n in range(3): ...
[ "signal.signal", "pyMagician.pyMagician" ]
[((75, 119), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal.SIG_DFL'], {}), '(signal.SIGINT, signal.SIG_DFL)\n', (88, 119), False, 'import signal\n'), ((132, 171), 'pyMagician.pyMagician', 'pyMagician', ([], {'port': '"""/dev/cu.usbmodem0121"""'}), "(port='/dev/cu.usbmodem0121')\n", (142, 171), False, 'fr...
from bokeh.plotting import figure, output_file, show from Backtest.main.Utils.AssetBrackets import AssetBrackets class StratVisual: def __init__(self, resultsDict): self.resultsDict = resultsDict self.A = AssetBrackets() def periodReturns(self): brackets = self.A.getBrackets() ...
[ "Backtest.main.Utils.AssetBrackets.AssetBrackets", "bokeh.plotting.show", "bokeh.plotting.figure", "bokeh.plotting.output_file" ]
[((227, 242), 'Backtest.main.Utils.AssetBrackets.AssetBrackets', 'AssetBrackets', ([], {}), '()\n', (240, 242), False, 'from Backtest.main.Utils.AssetBrackets import AssetBrackets\n'), ((355, 395), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(1000)', 'plot_height': '(700)'}), '(plot_width=1000, plot_height=...
from functools import wraps import flask from flask import current_app as cap from .builders.builder import Builder from .config import DEFAULT_BUILDERS, set_default_config class ResponseBuilder: def __init__(self, app=None, builders=None): """ :param app: :param builders: """ ...
[ "flask.make_response", "flask.current_app.config.get", "flask.request.headers.get", "functools.wraps" ]
[((2277, 2318), 'flask.make_response', 'flask.make_response', (["b''", 'status', 'headers'], {}), "(b'', status, headers)\n", (2296, 2318), False, 'import flask\n'), ((5184, 5195), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (5189, 5195), False, 'from functools import wraps\n'), ((5807, 5817), 'functools.wr...
from django.shortcuts import render, get_object_or_404, redirect from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView from .models import EventListing from django.contrib.auth.models import User from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestM...
[ "django.shortcuts.render", "events.forms.EventCreateView", "django.urls.reverse", "django.shortcuts.get_object_or_404", "events.forms.EventUpdateForm", "django.contrib.messages.success" ]
[((890, 954), 'django.shortcuts.render', 'render', (['request', '"""events/eventlisting_form.html"""', "{'form': form}"], {}), "(request, 'events/eventlisting_form.html', {'form': form})\n", (896, 954), False, 'from django.shortcuts import render, get_object_or_404, redirect\n'), ((1002, 1040), 'django.shortcuts.get_ob...
import datetime from unittest import mock import pytest from h_matchers import Any from h.tasks import indexer class FakeSettingsService: def __init__(self): self._data = {} def get(self, key): return self._data.get(key) def put(self, key, value): self._data[key] = value clas...
[ "unittest.mock.Mock", "datetime.datetime.utcnow", "h.tasks.indexer.add_annotation", "h.tasks.indexer.reindex_user_annotations", "pytest.mark.usefixtures", "h_matchers.Any", "pytest.fixture", "datetime.timedelta", "h.tasks.indexer.delete_annotation" ]
[((6377, 6420), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""settings_service"""'], {}), "('settings_service')\n", (6400, 6420), False, 'import pytest\n'), ((6424, 6452), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (6438, 6452), False, 'import pytest\n'), ((6530, ...
# from __future__ import division, absolute_import from __future__ import print_function, unicode_literals import webbrowser import random from kivy.app import App from kivy.clock import Clock from kivy.uix.popup import Popup from kivy.uix.button import Button from kivy.core.window import Window from kivy.core.text i...
[ "os.listdir", "random.shuffle", "webbrowser.open", "sys.quit", "kivy.core.window.Window.bind", "model.load_models", "kivy.core.audio.SoundLoader.load", "cv2.imshow", "kivy.app.App.get_running_app", "cv2.destroyAllWindows", "cv2.VideoCapture", "kivy.clock.Clock.schedule_once", "kivy.utils.get...
[((1019, 1048), 'kivy.utils.get_color_from_hex', 'get_color_from_hex', (['"""#300000"""'], {}), "('#300000')\n", (1037, 1048), False, 'from kivy.utils import get_color_from_hex\n'), ((1701, 1721), 'kivy.properties.ObjectProperty', 'ObjectProperty', (['None'], {}), '(None)\n', (1715, 1721), False, 'from kivy.properties ...
from http.server import HTTPServer, BaseHTTPRequestHandler from json import dumps as toJSON from json import loads as formatJSON class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header('Content-type', 'application/json') self.send_...
[ "json.dumps", "http.server.HTTPServer" ]
[((2523, 2578), 'http.server.HTTPServer', 'HTTPServer', (["('0.0.0.0', 8080)", 'SimpleHTTPRequestHandler'], {}), "(('0.0.0.0', 8080), SimpleHTTPRequestHandler)\n", (2533, 2578), False, 'from http.server import HTTPServer, BaseHTTPRequestHandler\n'), ((2453, 2468), 'json.dumps', 'toJSON', (['db_dump'], {}), '(db_dump)\n...
from inspect import currentframe __all__ = ["add_props_to_ns", "add_classprops_to_ns", "classproperty", "props_as_dict"] def prop_getsetdel(property_name, prefix="_", read_only=False, deletable=False): internal_attr = prefix + property_name def prop_getter(internal_attr): def getter_func(self): ...
[ "inspect.currentframe" ]
[((1908, 1922), 'inspect.currentframe', 'currentframe', ([], {}), '()\n', (1920, 1922), False, 'from inspect import currentframe\n'), ((2221, 2235), 'inspect.currentframe', 'currentframe', ([], {}), '()\n', (2233, 2235), False, 'from inspect import currentframe\n')]
# coding: utf-8 """ Sematext Cloud API API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. # noqa: E501 OpenAPI spec version: v3 ...
[ "six.iteritems" ]
[((5875, 5908), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (5888, 5908), False, 'import six\n')]
""" Root PlotPlayer Package contains all the data structures, modules and classes used by the PlotPlayer project. Public Modules: * plotplayer - Contains the PlotPlayer interface and functionality; this is the most common entry point for most usages Subpackages: * helpers - Contains various modules containi...
[ "matplotlib.use" ]
[((576, 599), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (590, 599), False, 'import matplotlib\n')]
from copy import copy import json import os import re from pprint import pprint as print from typing import Union import networkx as nx import numpy as np from dpath.util import get from matplotlib import pyplot as plt def md_to_dict(text, order, n=0, max_depth=100): try: maxh = max([x.count("#") for x i...
[ "pprint.pprint", "json.dump" ]
[((10819, 10846), 'json.dump', 'json.dump', (['dic', 'f'], {'indent': '(1)'}), '(dic, f, indent=1)\n', (10828, 10846), False, 'import json\n'), ((4858, 4885), 'pprint.pprint', 'print', (["(parent + ' | ' + val)"], {}), "(parent + ' | ' + val)\n", (4863, 4885), True, 'from pprint import pprint as print\n')]
""" This script contains several car-following control models for flow-controlled vehicles. Controllers can have their output delayed by some duration. Each controller includes functions get_accel(self, env) -> acc - using the current state of the world and existing parameters, uses the control mod...
[ "numpy.abs", "flow.controllers.base_controller.BaseController.__init__", "collections.deque", "numpy.sqrt", "math.cos" ]
[((1966, 2022), 'flow.controllers.base_controller.BaseController.__init__', 'BaseController.__init__', (['self', 'veh_id', 'controller_params'], {}), '(self, veh_id, controller_params)\n', (1989, 2022), False, 'from flow.controllers.base_controller import BaseController\n'), ((2237, 2256), 'collections.deque', 'collect...
from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import redirect, render from django.urls import reverse_lazy from django.views import View from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView from bookstore.news.forms import ArticleForm, ArticleComme...
[ "django.shortcuts.render", "bookstore.news.forms.ArticleForm", "django.shortcuts.redirect", "django.db.models.signals.pre_save.connect", "bookstore.news.forms.ArticleCommentForm", "django.urls.reverse_lazy", "django.db.models.signals.pre_save.disconnect" ]
[((891, 911), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""news"""'], {}), "('news')\n", (903, 911), False, 'from django.urls import reverse_lazy\n'), ((2266, 2286), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""news"""'], {}), "('news')\n", (2278, 2286), False, 'from django.urls import reverse_lazy\n'), ((102...
""" Unchanged from https://github.com/hughsalimbeni/DGPs_with_IWVI/blob/master/tests/test_gp_layer.py """ import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.FATAL) import gpflow from dgps_with_iwvi.layers import GPLayer from dgps_with_iwvi.models import DGP_VI def test_gp_layer(): ...
[ "gpflow.kernels.Matern52", "gpflow.settings.get_settings", "numpy.testing.assert_allclose", "tensorflow.logging.set_verbosity", "gpflow.settings.temp_settings", "numpy.linspace", "numpy.random.randn", "gpflow.models.SVGP", "numpy.random.seed", "numpy.cos", "gpflow.kernels.RBF", "numpy.sin", ...
[((152, 194), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.FATAL'], {}), '(tf.logging.FATAL)\n', (176, 194), True, 'import tensorflow as tf\n'), ((359, 376), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (373, 376), True, 'import numpy as np\n'), ((596, 640), 'gpflow.ke...
import mne raw = mne.io.read_raw_fif('raw.fif', preload=True) # load data raw.info['bads'] = ['MEG 2443', 'EEG 053'] # mark bad channels raw.filter(l_freq=None, h_freq=40.0) # low-pass filter data # Extract epochs and save them: picks = mne.pick_types(raw.info, meg=True, eeg=True, eog=True, ...
[ "mne.minimum_norm.make_inverse_operator", "mne.morph_data", "mne.find_events", "mne.pick_types", "mne.io.read_raw_fif", "mne.minimum_norm.apply_inverse", "mne.Epochs", "mne.read_forward_solution", "mne.compute_covariance" ]
[((19, 63), 'mne.io.read_raw_fif', 'mne.io.read_raw_fif', (['"""raw.fif"""'], {'preload': '(True)'}), "('raw.fif', preload=True)\n", (38, 63), False, 'import mne\n'), ((248, 318), 'mne.pick_types', 'mne.pick_types', (['raw.info'], {'meg': '(True)', 'eeg': '(True)', 'eog': '(True)', 'exclude': '"""bads"""'}), "(raw.info...
""" The script that creates the neural network architecture based on the concept.txt. The script uses command-line arguments for specifying the structure of the network and the hyperparameters for the training. use -> User:~$ python Additive_Network --help for the usage information of this module ...
[ "tensorflow.shape", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.nn.softmax", "tensorflow.zeros_initializer", "tensorflow.cast", "tensorflow.app.run", "tensorflow.Graph", "tensorflow.pow", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.nn.softmax_cros...
[((603, 645), 'os.path.join', 'os.path.join', (['base_data_path', '"""MNIST_data"""'], {}), "(base_data_path, 'MNIST_data')\n", (615, 645), False, 'import os\n'), ((1176, 1186), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1184, 1186), True, 'import tensorflow as tf\n'), ((4257, 4313), 'tensorflow.examples.tutori...
"""A collection of function for doing my project.""" import time import random #Background Introduction def Intro(): print("Hello, how are you doing after the long journey? ") time.sleep(2) print("You are now at Pallet Town,Kanto.") time.sleep(2) print("A place where is abounded with amazing...
[ "random.choice", "time.sleep" ]
[((192, 205), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (202, 205), False, 'import time\n'), ((257, 270), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (267, 270), False, 'import time\n'), ((355, 368), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (365, 368), False, 'import time\n'), ((444, 457), ...
from django.conf.urls import include from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path urlpatterns = [ path("", include("changelogs.urls")), path("admin/", admin.site.urls), path("accounts/", include("django.contrib.auth.urls")), path("log...
[ "django.conf.urls.include", "django.contrib.auth.views.LoginView.as_view", "django.urls.path", "django.contrib.auth.views.LogoutView.as_view" ]
[((214, 245), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (218, 245), False, 'from django.urls import path\n'), ((181, 207), 'django.conf.urls.include', 'include', (['"""changelogs.urls"""'], {}), "('changelogs.urls')\n", (188, 207), False, 'from django.conf.u...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import re import tensorflow as tf import tensorflow_hub as hub from rasa_nlu.featurizers import Featurizer class UniversalSentenceEncoderFeaturizer(Featurizer): "...
[ "re.split", "tensorflow_hub.Module", "re.compile", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.tables_initializer" ]
[((757, 781), 're.compile', 're.compile', (['"""([#()!><])"""'], {}), "('([#()!><])')\n", (767, 781), False, 'import re\n'), ((935, 961), 'tensorflow_hub.Module', 'hub.Module', (['self.TFHUB_URL'], {}), '(self.TFHUB_URL)\n', (945, 961), True, 'import tensorflow_hub as hub\n'), ((1053, 1092), 'tensorflow.placeholder', '...
import pandas as pd import numpy as np from automl_pn.utils.models import models_list, MODELS_STR_TO_OBJECT from automl_pn.utils.metrics import score_func, higher_better from automl_pn.utils.preprocessor import Preprocessor from sklearn.model_selection import train_test_split from joblib import Parallel, delayed cla...
[ "joblib.Parallel", "joblib.delayed", "sklearn.model_selection.train_test_split", "automl_pn.utils.preprocessor.Preprocessor" ]
[((2227, 2252), 'automl_pn.utils.preprocessor.Preprocessor', 'Preprocessor', (['fill_method'], {}), '(fill_method)\n', (2239, 2252), False, 'from automl_pn.utils.preprocessor import Preprocessor\n'), ((3831, 3926), 'joblib.Parallel', 'Parallel', ([], {'n_jobs': 'self._n_jobs', 'verbose': 'verb', 'pre_dispatch': '"""all...
#!/usr/bin/python3 #-*- coding: utf-8 -*- from PyQt5.QtWidgets import QApplication from Main.SFA_main import SFA_window import sys if __name__ == "__main__": app = QApplication(sys.argv) window = SFA_window() window.show() sys.exit(app.exec_())
[ "Main.SFA_main.SFA_window", "PyQt5.QtWidgets.QApplication" ]
[((170, 192), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (182, 192), False, 'from PyQt5.QtWidgets import QApplication\n'), ((206, 218), 'Main.SFA_main.SFA_window', 'SFA_window', ([], {}), '()\n', (216, 218), False, 'from Main.SFA_main import SFA_window\n')]
__author__ = 'Jason' import itertools from Graph import * from GraphStatistics import * def get_cliques(graph, k, proc_pool): persons = [] for idx in graph.dictionary: persons.append(idx) cliques = [] combinations = itertools.combinations(persons, k) arg = [] for comb ...
[ "itertools.combinations" ]
[((257, 291), 'itertools.combinations', 'itertools.combinations', (['persons', 'k'], {}), '(persons, k)\n', (279, 291), False, 'import itertools\n')]
# Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[ "requests.post", "argparse.ArgumentParser" ]
[((598, 623), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (621, 623), False, 'import argparse\n'), ((1442, 1517), 'requests.post', 'requests.post', (['post_message_url'], {'json': 'payload', 'headers': 'header', 'verify': '(False)'}), '(post_message_url, json=payload, headers=header, verify=...
# -*- coding: utf-8 -*- from django.db import models from django.utils import timezone from django.conf import settings class Category(models.Model): """ Each blog post belongs to a pre-defined category. Categories are set up on the admin panel """ name = models.CharField(max_length=100) def __unico...
[ "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.IntegerField", "django.utils.timezone.now", "django.db.models.ImageField", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((271, 303), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (287, 303), False, 'from django.db import models\n'), ((775, 839), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'related_name': '"""blog"""'}), "(settings.AUTH_USER...
import pytest from lib.durak.draw_pile import DrawPile @pytest.fixture def cards(): return ["10D", "10C", "2S", "5C", "8D", "2C"] @pytest.fixture def mocked_draw_cards(cards, get_draw_pile_cards): return get_draw_pile_cards(cards) @pytest.fixture def default_parameters(): return { "drawn_card...
[ "lib.durak.draw_pile.DrawPile" ]
[((463, 493), 'lib.durak.draw_pile.DrawPile', 'DrawPile', ([], {}), '(**default_parameters)\n', (471, 493), False, 'from lib.durak.draw_pile import DrawPile\n'), ((890, 906), 'lib.durak.draw_pile.DrawPile', 'DrawPile', ([], {}), '(**args)\n', (898, 906), False, 'from lib.durak.draw_pile import DrawPile\n'), ((1313, 132...
from datetime import datetime from email.policy import default from flask import current_app from api.extensions import db, Base class Issue(db.Model): """ This model holds information about an Issue """ __tablename__ = "issue" id = db.Column(db.Integer, primary_key=True) title =...
[ "api.extensions.db.Column", "api.extensions.db.String", "api.extensions.db.ForeignKey" ]
[((268, 307), 'api.extensions.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (277, 307), False, 'from api.extensions import db, Base\n'), ((1368, 1389), 'api.extensions.db.Column', 'db.Column', (['db.Integer'], {}), '(db.Integer)\n', (1377, 1389), False, 'from ...
def valentine_tellings(): import random valentine = [ "\033[1;36m" "All of How I met your Mother" "\nFlirts in One thread" "\033[0m" "\n\n" "I think you fell from heaven," "\nbecause you look like an angel." "\n\n\n" "I thought you must have injured yourself" "\nwhen you fell from heaven,...
[ "random.choice" ]
[((450, 474), 'random.choice', 'random.choice', (['valentine'], {}), '(valentine)\n', (463, 474), False, 'import random\n')]
from flask_restful import marshal, abort, Resource from app.models import Schedule2 from app.apiv2.decorators import permission_sudo from app.apiv2.marshal import tasking_schedule_fields class MobiusTaskApi(Resource): method_decorators = [permission_sudo] def get(self, schedule_id): """ Peek at a sc...
[ "flask_restful.marshal", "app.models.Schedule2.query.get_or_404", "flask_restful.abort" ]
[((343, 382), 'app.models.Schedule2.query.get_or_404', 'Schedule2.query.get_or_404', (['schedule_id'], {}), '(schedule_id)\n', (369, 382), False, 'from app.models import Schedule2\n'), ((399, 434), 'flask_restful.marshal', 'marshal', (['s', 'tasking_schedule_fields'], {}), '(s, tasking_schedule_fields)\n', (406, 434), ...
import os, sys def main(): path = sys.argv[1] for round_id in range(1, len(os.listdir(path))+1): acc_path = os.path.join(path, str(round_id)) if os.path.isdir(acc_path): if os.path.exists(os.path.join(acc_path, "accuracy.json")): with open(os.path.join(acc_path, "acc...
[ "os.listdir", "os.path.isdir", "os.path.join" ]
[((170, 193), 'os.path.isdir', 'os.path.isdir', (['acc_path'], {}), '(acc_path)\n', (183, 193), False, 'import os, sys\n'), ((84, 100), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (94, 100), False, 'import os, sys\n'), ((225, 264), 'os.path.join', 'os.path.join', (['acc_path', '"""accuracy.json"""'], {}), "...