code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import datetime as dt from flask import Flask, jsonify engine = create_engine("sqlite:///Resources/hawaii.sqlite") Base = automap_base() Base.prepare(engi...
[ "sqlalchemy.func.avg", "flask.Flask", "datetime.date", "sqlalchemy.orm.Session", "flask.jsonify", "sqlalchemy.func.min", "datetime.timedelta", "sqlalchemy.create_engine", "sqlalchemy.ext.automap.automap_base", "sqlalchemy.func.max" ]
[((230, 280), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///Resources/hawaii.sqlite"""'], {}), "('sqlite:///Resources/hawaii.sqlite')\n", (243, 280), False, 'from sqlalchemy import create_engine, func\n'), ((288, 302), 'sqlalchemy.ext.automap.automap_base', 'automap_base', ([], {}), '()\n', (300, 302), F...
from django.shortcuts import render, redirect from django.views.generic import TemplateView, ListView, CreateView from django.core.files.storage import FileSystemStorage from django.urls import reverse_lazy from django.core.files import File from .forms import BookForm from .models import Book # Load libraries import ...
[ "django.core.files.storage.FileSystemStorage", "django.core.files.File", "os.getcwd", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.metrics.accuracy_score", "sklearn.tree.DecisionTreeClassifier", "six.StringIO", "sklearn.tree.export_graphviz", "os.path.splitext", "djang...
[((3114, 3153), 'django.shortcuts.render', 'render', (['request', '"""upload.html"""', 'context'], {}), "(request, 'upload.html', context)\n", (3120, 3153), False, 'from django.shortcuts import render, redirect\n'), ((766, 777), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (775, 777), False, 'import os\n'), ((1154, 1190...
#!/usr/bin/python36 print("content-type: text/html") print("") import cgi import subprocess as sp form = cgi.FieldStorage() user_name = form.getvalue('user_name') lv_size = form.getvalue('lv_size') print(user_name) print(lv_size) output=sp.getstatusoutput("sudo ansible-playbook ostaas.yml --extra-vars='user_name={...
[ "cgi.FieldStorage" ]
[((109, 127), 'cgi.FieldStorage', 'cgi.FieldStorage', ([], {}), '()\n', (125, 127), False, 'import cgi\n')]
import tensorflow as tf from tensorflow.python.keras.preprocessing import image as kp_image # Keras is only used to load VGG19 model as a high level API to TensorFlow from keras.applications.vgg19 import VGG19 from keras.models import Model from keras import backend as K # pillow is used for loading and saving ima...
[ "tensorflow.clip_by_value", "tensorflow.reshape", "keras.models.Model", "numpy.clip", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.global_variables_initializer", "keras.backend.set_session", "tensorflow.Session", "keras.applications.vgg19.VGG19", "tensorflow.keras.applications.vgg19.p...
[((1538, 1561), 'PIL.Image.open', 'Image.open', (['path_to_img'], {}), '(path_to_img)\n', (1548, 1561), False, 'from PIL import Image\n'), ((1728, 1754), 'tensorflow.python.keras.preprocessing.image.img_to_array', 'kp_image.img_to_array', (['img'], {}), '(img)\n', (1749, 1754), True, 'from tensorflow.python.keras.prepr...
from __future__ import annotations import tkinter as tk from typing import Callable from src.graphics import utils from src.graphics.interfaces import Panel from src.timer import Clock class PanelStyle: """ This class holds the immutable style properties of the TextPanel """ def __init__(self, width: int, ...
[ "src.graphics.utils.calc_arc_extent", "tkinter.Canvas", "src.graphics.utils.draw_circle" ]
[((1033, 1155), 'tkinter.Canvas', 'tk.Canvas', (['self.root'], {'width': 'self.style.width', 'height': 'self.style.height', 'bg': 'self.style.bg_colour', 'highlightthickness': '(0)'}), '(self.root, width=self.style.width, height=self.style.height, bg=\n self.style.bg_colour, highlightthickness=0)\n', (1042, 1155), T...
import dynet as dy import numpy as np import moire from moire import Expression __all__ = [ 'zeros', 'ones', 'full', 'normal', 'bernoulli', 'uniform', 'gumbel', 'zeros_like', 'ones_like', 'full_like', 'normal_like', 'bernoulli_like', 'uniform_like', 'gumbel_like', 'eye', 'diagonal', 'where', ] def z...
[ "numpy.full", "numpy.random.uniform", "numpy.random.gumbel", "dynet.inputTensor", "dynet.cmult", "numpy.zeros", "numpy.ones", "numpy.random.normal", "numpy.eye" ]
[((375, 421), 'numpy.zeros', 'np.zeros', (['(*dim, batch_size)'], {'dtype': 'np.float32'}), '((*dim, batch_size), dtype=np.float32)\n', (383, 421), True, 'import numpy as np\n'), ((433, 492), 'dynet.inputTensor', 'dy.inputTensor', (['a'], {'batched': '(True)', 'device': 'moire.config.device'}), '(a, batched=True, devic...
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli...
[ "nemo.core.classes.typecheck", "torch.zeros_like", "nemo.core.neural_types.LossType" ]
[((1779, 1790), 'nemo.core.classes.typecheck', 'typecheck', ([], {}), '()\n', (1788, 1790), False, 'from nemo.core.classes import Loss, typecheck\n'), ((1899, 1926), 'torch.zeros_like', 'torch.zeros_like', (['values[0]'], {}), '(values[0])\n', (1915, 1926), False, 'import torch\n'), ((1222, 1232), 'nemo.core.neural_typ...
import urllib.request from bs4 import BeautifulSoup def get_go(): url = "https://www.mohfw.gov.in/" uClient = urllib.request.urlopen(url) page_html = uClient.read() uClient.close() page_soup = BeautifulSoup(page_html,"html.parser") news = page_soup.find_all('div',class_ = 'update-box') ...
[ "bs4.BeautifulSoup" ]
[((217, 256), 'bs4.BeautifulSoup', 'BeautifulSoup', (['page_html', '"""html.parser"""'], {}), "(page_html, 'html.parser')\n", (230, 256), False, 'from bs4 import BeautifulSoup\n')]
# -*- coding: utf-8 -*- import glob import os import re import sys import logging from boto3.session import Session from botocore.exceptions import ClientError from argparse import ArgumentParser TEMPLATES = [ "/scripts/ec2.yml", ] logger = logging.getLogger() formatter = '%(levelname)s : %(asctime)s : %(message...
[ "os.chmod", "argparse.ArgumentParser", "logging.basicConfig", "os.getcwd", "boto3.session.Session", "re.sub", "logging.getLogger" ]
[((248, 267), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (265, 267), False, 'import logging\n'), ((324, 381), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'formatter'}), '(level=logging.INFO, format=formatter)\n', (343, 381), False, 'import logging\n'), ((613, ...
import glob from collections import namedtuple import dateutil.parser import numpy as np import pandas as pd import pymzml import config import lcms.utils as utils def create_spectrum_and_peak_tables(msrun_list, experiment_id): ''' fills the Spectrum table and for each spectrum the Peak table :param ms...
[ "pandas.DataFrame", "pymzml.run.Reader", "collections.namedtuple", "lcms.utils.append_to_experiment" ]
[((393, 634), 'collections.namedtuple', 'namedtuple', (['"""spectrum"""', "('experiment_id ' + 'spectrum_id ' + 'total_ion_current ' +\n 'time_passed_since_start ' + 'ms_level ' + 'highest_observed_mz ' +\n 'lowest_observed_mz ' + 'scan_window_upper_limit ' +\n 'scan_window_lower_limit')"], {}), "('spectrum', ...
from setuptools import setup, find_packages ver = "0.4" setup( name = 'dirutil', version = ver, description = 'High level directory utilities', keywords = ['dir', 'directory', 'workdir', 'tempdir'], author = '<NAME>', author_email = '<EMAIL>', packages = fin...
[ "setuptools.find_packages" ]
[((317, 332), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (330, 332), False, 'from setuptools import setup, find_packages\n')]
from collections import deque import random import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam class DYNAgent: def __init__(self, state_size, action_size): self.state_size = state_size self.action_...
[ "keras.models.Sequential", "keras.layers.Dense", "keras.optimizers.Adam", "collections.deque" ]
[((361, 379), 'collections.deque', 'deque', ([], {'maxlen': '(2000)'}), '(maxlen=2000)\n', (366, 379), False, 'from collections import deque\n'), ((633, 645), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (643, 645), False, 'from keras.models import Sequential\n'), ((664, 719), 'keras.layers.Dense', 'Dense...
#!/usr/bin/env python3 """Test suite for pandas-marc.""" from pandas_marc import MARCDataFrame def test_instantiate_marcdataframe(dataframe): kwargs = { 'dataframe': dataframe, 'occurrence_delimiter': '|', 'subfield_delimiter': '‡' } mdf = MARCDataFrame(**kwargs) for key, val...
[ "pandas_marc.MARCDataFrame" ]
[((280, 303), 'pandas_marc.MARCDataFrame', 'MARCDataFrame', ([], {}), '(**kwargs)\n', (293, 303), False, 'from pandas_marc import MARCDataFrame\n'), ((470, 494), 'pandas_marc.MARCDataFrame', 'MARCDataFrame', (['dataframe'], {}), '(dataframe)\n', (483, 494), False, 'from pandas_marc import MARCDataFrame\n'), ((853, 903)...
import argparse from tangotest.tangotools import create_vnv_test if __name__ == '__main__': parser = argparse.ArgumentParser(description='Prepare tests for uploading to the V&V platform.') parser.add_argument('tests_path', help='The path to the directory with test files') parser.add_argument('ns_package_p...
[ "argparse.ArgumentParser" ]
[((107, 199), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Prepare tests for uploading to the V&V platform."""'}), "(description=\n 'Prepare tests for uploading to the V&V platform.')\n", (130, 199), False, 'import argparse\n')]
# from scripts import tabledef # from scripts import forms # from scripts import helpers from flask import Flask, redirect, url_for, render_template, request, session import json import sys import os # import stripe import pandas as pd from werkzeug.utils import secure_filename from sklearn.preprocessing import Polynom...
[ "pandas.DataFrame", "io.StringIO", "tkinter.Tk.close", "sklearn.feature_extraction.text.CountVectorizer", "pdfminer.converter.TextConverter", "sklearn.metrics.pairwise.cosine_similarity", "pandas.read_csv", "os.path.dirname", "flask.Flask", "pdfminer.layout.LAParams", "tkinter.filedialog.askopen...
[((996, 1011), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1001, 1011), False, 'from flask import Flask, redirect, url_for, render_template, request, session\n'), ((1581, 1606), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1596, 1606), False, 'import os\n'), ((1624, 1671),...
from uuid import uuid4 def generate_player_data(event_name, rating): return { "id": str(uuid4()), "response-queue": "{}-response-queue".format(str(uuid4())), "event-name": event_name, "detail": { "rating": rating, "content": {} } }
[ "uuid.uuid4" ]
[((102, 109), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (107, 109), False, 'from uuid import uuid4\n'), ((169, 176), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (174, 176), False, 'from uuid import uuid4\n')]
"""Tests for the variant of MT2 by <NAME>.""" from typing import Optional, Union import numpy import pytest from .common import mt2_lester, mt2_tombs def test_simple_example(): computed_val = mt2_tombs(100, 410, 20, 150, -210, -300, -200, 280, 100, 100) assert computed_val == pytest.approx(412.628) def t...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.errstate", "numpy.array", "numpy.testing.assert_allclose", "pytest.approx" ]
[((880, 901), 'numpy.random.seed', 'numpy.random.seed', (['(42)'], {}), '(42)\n', (897, 901), False, 'import numpy\n'), ((1918, 1983), 'numpy.array', 'numpy.array', (['(100, 410, 20, 150, -210, -300, -200, 280, 100, 100)'], {}), '((100, 410, 20, 150, -210, -300, -200, 280, 100, 100))\n', (1929, 1983), False, 'import nu...
from datetime import datetime pessoa = dict() anohoje = datetime.now().year pessoa['nome'] = str(input('Informe o nome: ')).strip().title() nasc = int(input('Informe o ano de nascimento: ')) pessoa['idade'] = anohoje - nasc pessoa['ctps'] = int(input('Informe a CTPS (0 se não tiver): ')) if pessoa['ctps'] !=...
[ "datetime.datetime.now" ]
[((58, 72), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (70, 72), False, 'from datetime import datetime\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # dicomgui.py """Main app file that convert DICOM data via a wxPython GUI dialog.""" # Copyright (c) 2018-2020 <NAME> # Copyright (c) 2009-2017 <NAME> # Copyright (c) 2009 <NAME> # This file is part of dicompyler, released under a BSD license. # See the file license.txt ...
[ "wx.Dialog.__init__", "os.walk", "wx.CallAfter", "os.path.isfile", "os.path.join", "numpy.round", "pyDcmConverter.guiutil.get_icon", "wx.SystemSettings.GetFont", "os.path.dirname", "numpy.transpose", "numpy.max", "wx.DirDialog", "wx.GetApp", "nibabel.Nifti1Image", "threading.Thread", "...
[((592, 617), 'logging.getLogger', 'getLogger', (['"""DcmConverter"""'], {}), "('DcmConverter')\n", (601, 617), False, 'from logging import getLogger, DEBUG, INFO\n'), ((628, 697), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'wx.wxPyDeprecationWarning'}), "('ignore', category=w...
import os from os import listdir from argparse import ArgumentParser from os.path import isdir,join middle = '├' pipe = '│' last = '└' scale = 2 def traverse(path, parents='', depth=0, isLast=True): tree = [(path, parents, depth, isLast)] realPath = join(parents,path) files = listdir(realPath) ...
[ "os.listdir", "os.path.isdir", "os.path.join", "argparse.ArgumentParser" ]
[((1288, 1341), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""list a folder as a tree"""'}), "(description='list a folder as a tree')\n", (1302, 1341), False, 'from argparse import ArgumentParser\n'), ((267, 286), 'os.path.join', 'join', (['parents', 'path'], {}), '(parents, path)\n', (271, 286)...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # 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 requ...
[ "keystone.common.logging.StreamHandler", "keystone.openstack.common.cfg.IntOpt", "os.path.join", "keystone.common.logging.WatchedFileHandler", "os.path.exists", "keystone.openstack.common.cfg.BoolOpt", "keystone.openstack.common.cfg.StrOpt", "keystone.common.logging.SysLogHandler", "keystone.common....
[((741, 779), 'gettext.install', 'gettext.install', (['"""keystone"""'], {'unicode': '(1)'}), "('keystone', unicode=1)\n", (756, 779), False, 'import gettext\n'), ((1533, 1589), 'keystone.common.logging.Formatter', 'logging.Formatter', (['conf.log_format', 'conf.log_date_format'], {}), '(conf.log_format, conf.log_date_...
from datetime import datetime, timedelta import pytz from bcrypt_hash import BcryptHash import pytest from src.users import Users from src.events import Events from src.stores import MemoryStore from src.session import Session def test_login_user(): store = MemoryStore() users = Users(store) params = {} ...
[ "src.session.Session", "bcrypt_hash.BcryptHash", "src.stores.MemoryStore", "src.users.Users", "pytest.raises", "datetime.timedelta", "pytz.timezone", "src.events.Events" ]
[((264, 277), 'src.stores.MemoryStore', 'MemoryStore', ([], {}), '()\n', (275, 277), False, 'from src.stores import MemoryStore\n'), ((290, 302), 'src.users.Users', 'Users', (['store'], {}), '(store)\n', (295, 302), False, 'from src.users import Users\n'), ((369, 395), 'src.session.Session', 'Session', (['params', 'sto...
# Copyright 2017 The TensorFlow Authors. 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 applica...
[ "tensorflow.python.platform.test.main", "tensorflow.python.framework.ops.Graph", "tensorflow.python.client.session.Session", "numpy.log", "tensorflow.python.ops.nn_ops.softplus", "numpy.float32", "tensorflow.contrib.learn.python.learn.estimators.head_test._assert_no_variables", "tensorflow.contrib.dis...
[((4270, 4281), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (4279, 4281), False, 'from tensorflow.python.platform import test\n'), ((2756, 2854), 'tensorflow.contrib.distributions.python.ops.estimator.estimator_head_distribution_regression', 'estimator_lib.estimator_head_distribution_regressi...
# Copyright (c) 2012-2016 Seafile Ltd. import logging from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.authentication import SessionAuthentication from seaserv import ccnet_api from seahub.api2.permissions import IsProVersion...
[ "seahub.api2.utils.api_error", "seahub.base.accounts.User.objects.get", "seahub.utils.is_valid_email", "seahub.profile.models.Profile.objects.add_or_update", "seaserv.ccnet_api.get_org_by_id", "seahub.base.templatetags.seahub_tags.email2nickname", "rest_framework.response.Response", "seahub.profile.mo...
[((720, 747), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (737, 747), False, 'import logging\n'), ((790, 832), 'seahub.profile.models.Profile.objects.get_profile_by_user', 'Profile.objects.get_profile_by_user', (['email'], {}), '(email)\n', (825, 832), False, 'from seahub.profile.model...
import logging import os from enum import Enum from imageai.Prediction.Custom import CustomImagePrediction # Show only errors in console logging.getLogger("tensorflow").setLevel(logging.ERROR) class MovesEnum(int, Enum): ROCK = 0 PAPER = 1 SCISSORS = 2 class ModelTypeEnum(Enum): """ An helper ...
[ "os.getcwd", "os.path.join", "logging.getLogger", "imageai.Prediction.Custom.CustomImagePrediction" ]
[((139, 170), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (156, 170), False, 'import logging\n'), ((1322, 1333), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1331, 1333), False, 'import os\n'), ((1442, 1465), 'imageai.Prediction.Custom.CustomImagePrediction', 'CustomImagePr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Exercise 18: Cows And Bulls Create a program that will play the “cows and bulls” game with the user. The game works like this: Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every digit that the user guessed correctly in the correct pl...
[ "random.randint" ]
[((1056, 1082), 'random.randint', 'random.randint', (['(1000)', '(9999)'], {}), '(1000, 9999)\n', (1070, 1082), False, 'import random\n')]
''' Created on Apr 12, 2013 @author: <NAME> ''' from lxml import etree from StringIO import StringIO from screensketch.screenspec import model class XMLReader(object): def __init__(self, input_data): self.input_data = input_data self.retval = None; def __parseComponent(self, node, parent): items = node.item...
[ "screensketch.screenspec.model.ScreenSpec", "screensketch.screenspec.model.StaticValue", "lxml.etree.fromstring", "screensketch.screenspec.model.Screen" ]
[((2820, 2838), 'screensketch.screenspec.model.ScreenSpec', 'model.ScreenSpec', ([], {}), '()\n', (2836, 2838), False, 'from screensketch.screenspec import model\n'), ((2939, 2972), 'lxml.etree.fromstring', 'etree.fromstring', (['self.input_data'], {}), '(self.input_data)\n', (2955, 2972), False, 'from lxml import etre...
from discord.ext import commands import discord import datetime class OnError(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_command_error(self, ctx, error): ignore = (commands.CommandNotFound, discord.NotFound, discord.Forbidden) if ...
[ "discord.Embed", "discord.ext.commands.Cog.listener", "datetime.timedelta", "datetime.datetime.now", "datetime.datetime.timestamp" ]
[((153, 176), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (174, 176), False, 'from discord.ext import commands\n'), ((383, 424), 'discord.Embed', 'discord.Embed', ([], {'color': 'self.bot.embed_color'}), '(color=self.bot.embed_color)\n', (396, 424), False, 'import discord\n'), ((1833...
def main() -> None: """ >>> from collections import deque >>> queue = deque(["Python", "Java", "C"]) >>> len(queue) 3 >>> queue deque(['Python', 'Java', 'C']) >>> queue.popleft() 'Python' >>> queue.popleft() 'Java' >>> queue.clear() >>> len(queue) 0 >>> queue ...
[ "doctest.testmod" ]
[((519, 528), 'doctest.testmod', 'testmod', ([], {}), '()\n', (526, 528), False, 'from doctest import testmod\n')]
#!/usr/bin/env python3 from typing import List, Dict from datetime import date, datetime from calendar import monthrange import os from typing import TypeVar, Tuple from benedict import benedict from Events import Event from CalendarErrors import BreakoutError, MainError from Prompt import prompt_user_date, parse_use...
[ "Prompt.parse_user_date", "Prompt.prompt_user_time", "os.system", "datetime.date.today", "datetime.date", "benedict.benedict", "Events.Event", "Prompt.prompt_user_date", "calendar.monthrange", "typing.TypeVar" ]
[((565, 601), 'typing.TypeVar', 'TypeVar', (['"""DateTypes"""', 'date', 'datetime'], {}), "('DateTypes', date, datetime)\n", (572, 601), False, 'from typing import TypeVar, Tuple\n'), ((2975, 2985), 'benedict.benedict', 'benedict', ([], {}), '()\n', (2983, 2985), False, 'from benedict import benedict\n'), ((3001, 3013)...
import numpy as np import gym from random import randint from metaworld.benchmarks import ML1 class ReachML1Env(gym.Env): def __init__(self, max_episode_steps=150,out_of_distribution=False, n_train_tasks=50, n_test_tasks=10, **kwargs): super(ReachML1Env, self).__init__() self.train_env = ML1.get_t...
[ "metaworld.benchmarks.ML1.get_train_tasks", "metaworld.benchmarks.ML1.get_test_tasks", "numpy.array" ]
[((311, 383), 'metaworld.benchmarks.ML1.get_train_tasks', 'ML1.get_train_tasks', (['"""reach-v1"""'], {'out_of_distribution': 'out_of_distribution'}), "('reach-v1', out_of_distribution=out_of_distribution)\n", (330, 383), False, 'from metaworld.benchmarks import ML1\n'), ((408, 479), 'metaworld.benchmarks.ML1.get_test_...
# --- Day 20: Infinite Elves and Infinite Houses --- # # To keep the Elves busy, Santa has them deliver some presents by hand, door-to-door. He sends them down a street with # infinite houses numbered sequentially: 1, 2, 3, 4, 5, and so on. # # Each Elf is assigned a number, too, and delivers presents to houses based o...
[ "math.sqrt" ]
[((1895, 1902), 'math.sqrt', 'sqrt', (['n'], {}), '(n)\n', (1899, 1902), False, 'from math import sqrt\n'), ((2085, 2092), 'math.sqrt', 'sqrt', (['n'], {}), '(n)\n', (2089, 2092), False, 'from math import sqrt\n')]
# partymoder xbmc add-on # Copyright 2017 aerth <<EMAIL>> # Released under the terms of the MIT License import xbmc xbmc.executebuiltin('xbmc.PlayerControl(Partymode(music)', True) xbmc.executebuiltin('xbmc.PlayerControl(repeatall)', True) xbmc.executebuiltin("Action(Fullscreen)", True)
[ "xbmc.executebuiltin" ]
[((119, 183), 'xbmc.executebuiltin', 'xbmc.executebuiltin', (['"""xbmc.PlayerControl(Partymode(music)"""', '(True)'], {}), "('xbmc.PlayerControl(Partymode(music)', True)\n", (138, 183), False, 'import xbmc\n'), ((184, 242), 'xbmc.executebuiltin', 'xbmc.executebuiltin', (['"""xbmc.PlayerControl(repeatall)"""', '(True)']...
from django.contrib import admin from blog.models import Post, BlogComment, Category # Register your models here. admin.site.register((BlogComment,)) # it must be in tupple formate admin.site.register(Category) @admin.register(Post) class PostAdmin(admin.ModelAdmin): class Media: js = ("tinyInject.js",)
[ "django.contrib.admin.register", "django.contrib.admin.site.register" ]
[((115, 150), 'django.contrib.admin.site.register', 'admin.site.register', (['(BlogComment,)'], {}), '((BlogComment,))\n', (134, 150), False, 'from django.contrib import admin\n'), ((182, 211), 'django.contrib.admin.site.register', 'admin.site.register', (['Category'], {}), '(Category)\n', (201, 211), False, 'from djan...
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2018 <NAME> (<EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights ...
[ "sys.stdout.buffer.write", "socket.socket", "argparse.ArgumentParser", "sys.exit" ]
[((1400, 1416), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1414, 1416), False, 'from argparse import ArgumentParser\n'), ((2055, 2070), 'socket.socket', 'socket.socket', ([], {}), '()\n', (2068, 2070), False, 'import socket\n'), ((3345, 3352), 'sys.exit', 'exit', (['(0)'], {}), '(0)\n', (3349, 3352...
# -*- coding: utf-8 -*- from collections import OrderedDict, defaultdict from shardingpy.api.algorithm.sharding.values import ListShardingValue, RangeShardingValue from shardingpy.constant import ShardingOperator from shardingpy.exception import UnsupportedOperationException from shardingpy.parsing.parser.expressionpa...
[ "shardingpy.api.algorithm.sharding.values.ListShardingValue", "shardingpy.util.extype.Range", "collections.defaultdict", "shardingpy.parsing.parser.expressionparser.SQLNumberExpression", "shardingpy.util.strutil.equals_ignore_case", "shardingpy.exception.UnsupportedOperationException", "collections.Orde...
[((1253, 1266), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1264, 1266), False, 'from collections import OrderedDict, defaultdict\n'), ((2938, 2955), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2949, 2955), False, 'from collections import OrderedDict, defaultdict\n'), ((709, ...
import re import logging from dataclasses import dataclass, field from typing import List, Optional import torch import torch.nn as nn from transformers import BertPreTrainedModel from src.model.decoder import Decoder from src.model.encoders.bert import _BertEncoder from src.model.encoders.ca_mtl_base import CaMtlBas...
[ "src.model.encoders.bert._BertEncoder", "src.model.encoders.ca_mtl_base.CaMtlBaseEncoder", "torch.full_like", "torch.unique", "torch.stack", "torch.nn.ModuleList", "torch.zeros_like", "src.model.encoders.ca_mtl_large.CaMtlLargeEncoder", "src.model.decoder.Decoder", "dataclasses.field", "torch.ze...
[((401, 428), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (418, 428), False, 'import logging\n'), ((600, 786), 'dataclasses.field', 'field', ([], {'metadata': "{'help':\n 'Path to pretrained model or model identifier from: CA-MTL-base, CA-MTL-large, bert-base-cased bert-base-uncased...
import os from colorama import Fore, init # Current file directory details file = os.path.realpath(__file__) filedir = os.path.dirname(file) parentdir = os.path.dirname(filedir) # Initialise colors for terminal init() # Print out header print(Fore.CYAN + '-' * 13 + Fore.RESET) print('Call Server') print(Fore.CYAN + ...
[ "colorama.init", "os.path.realpath", "os.path.dirname" ]
[((83, 109), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (99, 109), False, 'import os\n'), ((120, 141), 'os.path.dirname', 'os.path.dirname', (['file'], {}), '(file)\n', (135, 141), False, 'import os\n'), ((154, 178), 'os.path.dirname', 'os.path.dirname', (['filedir'], {}), '(filedir)\n'...
import unittest from filter import Filter from differ import Differ from guess_combinator import GuessCombinator class TestGuessCombinator(unittest.TestCase): def test_it_exists(self): self.assertNotEqual(GuessCombinator(), None) def test_it_returns_a_best_guess(self): # solution_unknown corpus = ["...
[ "unittest.main", "guess_combinator.GuessCombinator", "guess_combinator.GuessCombinator.process" ]
[((574, 589), 'unittest.main', 'unittest.main', ([], {}), '()\n', (587, 589), False, 'import unittest\n'), ((214, 231), 'guess_combinator.GuessCombinator', 'GuessCombinator', ([], {}), '()\n', (229, 231), False, 'from guess_combinator import GuessCombinator\n'), ((487, 526), 'guess_combinator.GuessCombinator.process', ...
# Copyright Contributors to the Tapqir project. # SPDX-License-Identifier: Apache-2.0 """ hmm ^^^ """ import math from typing import Union import torch import torch.distributions.constraints as constraints from pyro.distributions.hmm import _logmatmulexp from pyro.ops.indexing import Vindex from pyroapi import distr...
[ "torch.eye", "torch.broadcast_tensors", "torch.cat", "torch.full", "pyroapi.pyro.param", "tapqir.distributions.util.expand_offtarget", "torch.ones", "tapqir.distributions.util.probs_m", "torch.distributions.constraints.greater_than", "tapqir.distributions.util.probs_theta", "pyroapi.handlers.mas...
[((2289, 2311), 'tapqir.distributions.util.expand_offtarget', 'expand_offtarget', (['init'], {}), '(init)\n', (2305, 2311), False, 'from tapqir.distributions.util import expand_offtarget, probs_m, probs_theta\n'), ((2509, 2532), 'tapqir.distributions.util.expand_offtarget', 'expand_offtarget', (['trans'], {}), '(trans)...
# imports # ------- import re from werkzeug.routing import BaseConverter from werkzeug.exceptions import NotFound # helpers # ------- MODELS = dict() def class_registry(cls): """ Function for dynamically getting class registry dictionary from specified model. """ try: return dict(cls._s...
[ "flask.has_app_context", "re.findall" ]
[((648, 665), 'flask.has_app_context', 'has_app_context', ([], {}), '()\n', (663, 665), False, 'from flask import current_app, has_app_context\n'), ((1173, 1217), 're.findall', 're.findall', (['"""([A-Z][0-9a-z]+)"""', 'cls.__name__'], {}), "('([A-Z][0-9a-z]+)', cls.__name__)\n", (1183, 1217), False, 'import re\n')]
import os import json import torch from transformers import GPT2LMHeadModel, GPT2Tokenizer, AutoTokenizer, GPT2Config PATH = './models' OUTPUT_PATH = './output/' if __name__ == '__main__': #tokenizer = AutoTokenizer.from_pretrained("./models") # add the EOS token as PAD token to avoid warnings #tokenize...
[ "torch.zeros", "os.path.join" ]
[((608, 645), 'torch.zeros', 'torch.zeros', (['(10, 1)'], {'dtype': 'torch.int'}), '((10, 1), dtype=torch.int)\n', (619, 645), False, 'import torch\n'), ((795, 835), 'os.path.join', 'os.path.join', (['OUTPUT_PATH', 'f"""{file}.txt"""'], {}), "(OUTPUT_PATH, f'{file}.txt')\n", (807, 835), False, 'import os\n'), ((474, 50...
#Copyright 2013 <NAME> # #This program is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your option) any later version. # #This program is distributed in the hope that it ...
[ "AppKit.NSEvent.otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_", "Quartz.CFRunLoopAddSource", "Quartz.CGEventGetIntegerValueField", "time.sleep", "Quartz.CGEventCreateKeyboardEvent", "Quartz.CFRunLoopGetCurrent", "Quartz.CFRunLoopRunInMode", "Quartz.CGEve...
[((5226, 5445), 'AppKit.NSEvent.otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_', 'NSEvent.otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_', (['NSSystemDefined', '(0, 0)', '(2560 if down else 2816)', '(0)', '(0)', '(0)', '(8)', ...
""" Hypothesis strategies for generating Axiom-related data. """ from epsilon.extime import Time from hypothesis import strategies as st from hypothesis.extra.datetime import datetimes from axiom.attributes import LARGEST_NEGATIVE, LARGEST_POSITIVE def axiomText(*a, **kw): """ Strategy for generating Axiom-...
[ "hypothesis.strategies.characters", "hypothesis.strategies.integers", "hypothesis.extra.datetime.datetimes" ]
[((1298, 1349), 'hypothesis.strategies.integers', 'st.integers', ([], {'min_value': 'minValue', 'max_value': 'maxValue'}), '(min_value=minValue, max_value=maxValue)\n', (1309, 1349), True, 'from hypothesis import strategies as st\n'), ((1495, 1528), 'hypothesis.extra.datetime.datetimes', 'datetimes', (['*a'], {'timezon...
# importing the required libraries import pyautogui, time # delay to switch windows time.sleep(10) # content you want to spam with f = open("idoc.pub_green-lantern-movie-script.txt", 'r') # loop to spam for word in f: # fetch and type each word from the file pyautogui.write(word) # press enter to send the ...
[ "pyautogui.press", "pyautogui.write", "time.sleep" ]
[((85, 99), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (95, 99), False, 'import pyautogui, time\n'), ((268, 289), 'pyautogui.write', 'pyautogui.write', (['word'], {}), '(word)\n', (283, 289), False, 'import pyautogui, time\n'), ((332, 356), 'pyautogui.press', 'pyautogui.press', (['"""enter"""'], {}), "('ente...
import tensorflow as tf @tf.function def tensor_scatter_nd_ops_by_name(segment_name, tensor, indices, updates, name=None): """Scatter operation chosen by name that pick tensor_scatter_nd functions. Args: segment_name (str): Operation to update scattered updates. Either 'sum' or 'min' etc. ten...
[ "tensorflow.tensor_scatter_nd_min", "tensorflow.tensor_scatter_nd_add", "tensorflow.tensor_scatter_nd_max" ]
[((709, 770), 'tensorflow.tensor_scatter_nd_add', 'tf.tensor_scatter_nd_add', (['tensor', 'indices', 'updates'], {'name': 'name'}), '(tensor, indices, updates, name=name)\n', (733, 770), True, 'import tensorflow as tf\n'), ((849, 910), 'tensorflow.tensor_scatter_nd_max', 'tf.tensor_scatter_nd_max', (['tensor', 'indices...
# Utility functions to access azure data storage import json, os from azure.storage.blob import BlockBlobService, PublicAccess def load_text_file(containerName, blobName, accountName, accountKey): ''' load the file specified from azure block blob storage. if the file is not found return an empty dictiona...
[ "azure.storage.blob.BlockBlobService", "json.loads" ]
[((755, 821), 'azure.storage.blob.BlockBlobService', 'BlockBlobService', ([], {'account_name': 'accountName', 'account_key': 'accountKey'}), '(account_name=accountName, account_key=accountKey)\n', (771, 821), False, 'from azure.storage.blob import BlockBlobService, PublicAccess\n'), ((1696, 1762), 'azure.storage.blob.B...
from curses.textpad import rectangle import curses ORIGIN_Y, ORIGIN_X = 5,2 class EditorManager: def __init__(self,std_scr): self.std_scr = std_scr self.height, self.width = self.std_scr.getmaxyx() self.origin_y, self.origin_x = 5, 2 self.canvas_height, self.canvas_width = self.h...
[ "curses.color_pair", "curses.textpad.rectangle", "curses.init_pair" ]
[((453, 512), 'curses.init_pair', 'curses.init_pair', (['(2)', 'curses.COLOR_GREEN', 'curses.COLOR_BLACK'], {}), '(2, curses.COLOR_GREEN, curses.COLOR_BLACK)\n', (469, 512), False, 'import curses\n'), ((1027, 1132), 'curses.textpad.rectangle', 'rectangle', (['self.std_scr', '(self.origin_y - 1)', '(self.origin_x - 1)',...
from metaphor.common.cli import cli_main from .extractor import TableauExtractor if __name__ == "__main__": cli_main("Tableau metadata extractor", TableauExtractor)
[ "metaphor.common.cli.cli_main" ]
[((114, 170), 'metaphor.common.cli.cli_main', 'cli_main', (['"""Tableau metadata extractor"""', 'TableauExtractor'], {}), "('Tableau metadata extractor', TableauExtractor)\n", (122, 170), False, 'from metaphor.common.cli import cli_main\n')]
#!/usr/bin/env python import re import sys import decimal from mt940m_v2 import ParseMT940 D = decimal.Decimal # read and concatenate entire MT940 contents and add '-ABN' to make sure the last record is captured if len(sys.argv)== 2: argf = sys.argv[1] else: print('please provide a valid MT940 file') exit...
[ "mt940m_v2.ParseMT940.conv_amount_str", "mt940m_v2.ParseMT940.transaction_date_conversion", "re.finditer", "mt940m_v2.ParseMT940.code86", "mt940m_v2.ParseMT940.write_qif_record", "re.match", "re.search", "re.compile" ]
[((589, 637), 're.compile', 're.compile', (['"""(?P<record>:\\\\d\\\\d.??:.*?(?=-ABN))"""'], {}), "('(?P<record>:\\\\d\\\\d.??:.*?(?=-ABN))')\n", (599, 637), False, 'import re\n'), ((724, 787), 're.compile', 're.compile', (['""":(?P<num>\\\\d\\\\d).??:(?P<field>.*?(?=:\\\\d\\\\d.??:))"""'], {}), "(':(?P<num>\\\\d\\\\d)...
import sys import os import Labyrinth import time import threading class Agent: num = 0 x = 0 y = 0 labyrinth = None callback = None def __init__(self, x, y, labyrinth, callback): self.num = time.time()*1000 self.x = x self.y = y self.labyrinth = labyrinth ...
[ "threading.Thread", "sys.exit", "time.time" ]
[((425, 462), 'threading.Thread', 'threading.Thread', ([], {'target': 'self.explore'}), '(target=self.explore)\n', (441, 462), False, 'import threading\n'), ((225, 236), 'time.time', 'time.time', ([], {}), '()\n', (234, 236), False, 'import time\n'), ((621, 631), 'sys.exit', 'sys.exit', ([], {}), '()\n', (629, 631), Fa...
# MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
[ "problem_instance.Problem" ]
[((641, 695), 'problem_instance.Problem', 'Problem', ([], {'fixture_order_raw': 'fixture_order_raw'}), '(fixture_order_raw=fixture_order_raw, **kwargs)\n', (648, 695), False, 'from problem_instance import Problem\n')]
# # Configurações da aplicação # import os from os.path import abspath DEBUG = True SECRET_KEY = 'a secret key' # diretório base basedir = os.path.abspath(os.path.dirname(__name__)) # diretório base da aplicação BASE_DIR = basedir # connection string: mysql://usuario:senha@host/nomedobanco SQLALCHEMY_DATABASE_URI ...
[ "os.path.dirname" ]
[((158, 183), 'os.path.dirname', 'os.path.dirname', (['__name__'], {}), '(__name__)\n', (173, 183), False, 'import os\n')]
from rest_framework import serializers, status from django_redis import get_redis_connection from rest_framework_jwt.settings import api_settings import logging import re from .models import User from .utils import get_user_by_account from celery_tasks.email.tasks import send_verify_email logger = logging.getLogger('...
[ "celery_tasks.email.tasks.send_verify_email.delay", "re.match", "rest_framework.serializers.CharField", "django_redis.get_redis_connection", "logging.getLogger", "rest_framework.serializers.ValidationError" ]
[((301, 328), 'logging.getLogger', 'logging.getLogger', (['"""django"""'], {}), "('django')\n", (318, 328), False, 'import logging\n'), ((433, 541), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'label': '"""确认密码"""', 'required': '(True)', 'allow_null': '(False)', 'allow_blank': '(False)', 'wri...
import os from flask import Flask from MrLing import ling_blueprint from MrBasicWff import wff_blueprint app = Flask(__name__) app.config['SECRET_KEY'] = 'random string' app.debug = True app.register_blueprint(ling_blueprint) app.register_blueprint(wff_blueprint) @app.route("/") def home(): return '<p><a href="/...
[ "flask.Flask", "os.getenv" ]
[((112, 127), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (117, 127), False, 'from flask import Flask\n'), ((442, 465), 'os.getenv', 'os.getenv', (['"""PORT"""', '(5000)'], {}), "('PORT', 5000)\n", (451, 465), False, 'import os\n')]
# Copyright (c) 2018 <NAME> # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from phylanx import Phylanx import numpy as np @Phylanx def foo(x, y): return [x, y] x = np.array([1, 2]) y = np.array([3, 4]) ...
[ "numpy.array" ]
[((282, 298), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (290, 298), True, 'import numpy as np\n'), ((303, 319), 'numpy.array', 'np.array', (['[3, 4]'], {}), '([3, 4])\n', (311, 319), True, 'import numpy as np\n')]
from datetime import timedelta from django.core.management import call_command from django.test import TestCase from django.utils import timezone from django_future.jobs import schedule_job from django_future.models import ScheduledJob class RunScheduledJobsCommandTest(TestCase): def setUp(self): self.s...
[ "django.utils.timezone.now", "django.core.management.call_command", "datetime.timedelta", "django_future.models.ScheduledJob.objects.filter", "django_future.models.ScheduledJob.objects.count", "django_future.jobs.schedule_job" ]
[((870, 902), 'django.core.management.call_command', 'call_command', (['"""runscheduledjobs"""'], {}), "('runscheduledjobs')\n", (882, 902), False, 'from django.core.management import call_command\n'), ((1419, 1457), 'django.core.management.call_command', 'call_command', (['"""runscheduledjobs"""', '"""-d"""'], {}), "(...
# Copyright 2020 Open Climate Tech Contributors # # 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...
[ "tensorflow.reshape", "os.path.join", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.callbacks.EarlyStopping", "logging.error", "tensorflow.one_hot", "logging.warning", "tensorflow.cast", "tensorflow.keras.optimizers.Adam", "datetime.datetime.now", "firecam.lib.tf_helper.loadModel", ...
[((1733, 1795), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['example_proto', 'feature_description'], {}), '(example_proto, feature_description)\n', (1759, 1795), True, 'import tensorflow as tf\n'), ((1808, 1902), 'tensorflow.image.decode_jpeg', 'tf.image.decode_jpeg', (["example['image/encoded...
# Generated by Django 3.0.9 on 2020-08-23 12:27 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('home', '0007_auto_20200823_1340'), ] operations = [ migrations.DeleteModel( name='addPost', ), ]
[ "django.db.migrations.DeleteModel" ]
[((224, 262), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""addPost"""'}), "(name='addPost')\n", (246, 262), False, 'from django.db import migrations\n')]
SI = lambda : input() from collections import Counter n = int(input()) a = SI() b = SI() def solve(n,a,b): d = Counter(a)+Counter(b) for i in d: if(d[i]&1): print(-1) return xa = d[a]//2 newa = [] newb = [] for i in range(n): if(a[i]!=b[i]): newa.append((a[i],i)) newb.append((b[i],i)) a,b = new...
[ "collections.Counter" ]
[((114, 124), 'collections.Counter', 'Counter', (['a'], {}), '(a)\n', (121, 124), False, 'from collections import Counter\n'), ((125, 135), 'collections.Counter', 'Counter', (['b'], {}), '(b)\n', (132, 135), False, 'from collections import Counter\n')]
import datetime import discord import pytz from necrobot.botbase import server, discordutil from necrobot.database import matchdb, racedb from necrobot.util import console, timestr, writechannel, strutil, rtmputil from necrobot.botbase.necrobot import Necrobot from necrobot.gsheet.matchgsheetinfo import MatchGSheetIn...
[ "discord.ChannelPermissions", "necrobot.database.matchdb.delete_match", "necrobot.match.match.Match", "necrobot.util.rtmputil.kadgar_link", "datetime.datetime.utcnow", "necrobot.database.matchdb.get_raw_match_data", "necrobot.race.raceinfo.RaceInfo", "necrobot.botbase.server.client.delete_channel", ...
[((2289, 2342), 'necrobot.match.match.Match', 'Match', (['*args'], {'commit_fn': 'matchdb.write_match'}), '(*args, commit_fn=matchdb.write_match, **kwargs)\n', (2294, 2342), False, 'from necrobot.match.match import Match\n'), ((9727, 9786), 'necrobot.match.matchroom.MatchRoom', 'MatchRoom', ([], {'match_discord_channel...
import os import os.path from keras.layers import Dense, Flatten, Conv1D, Reshape from keras.optimizers import Nadam from keras.models import Sequential from keras.models import load_model from keras.regularizers import l2 from keras import backend as K from keras.losses import mean_squared_error from sljassbot.playe...
[ "keras.models.load_model", "keras.regularizers.l2", "os.path.exists", "keras.layers.Flatten", "keras.layers.Conv1D", "keras.optimizers.Nadam", "keras.layers.Dense", "keras.models.Sequential", "keras.layers.Reshape", "keras.backend.cast" ]
[((2311, 2337), 'os.path.exists', 'os.path.exists', (['model_path'], {}), '(model_path)\n', (2325, 2337), False, 'import os\n'), ((686, 720), 'keras.backend.cast', 'K.cast', (['use_linear_term', '"""float32"""'], {}), "(use_linear_term, 'float32')\n", (692, 720), True, 'from keras import backend as K\n'), ((2439, 2461)...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import formats from django.utils import timezone # Create your models here. class ConventionManager(models.Manager): def next(self): """ The upcoming event """ next_convention = self.exclude(en...
[ "django.db.models.TextField", "django.db.models.CharField", "django.utils.timezone.now", "django.utils.formats.date_format", "django.utils.timezone.timedelta", "django.db.models.DateTimeField", "django.utils.translation.ugettext_lazy" ]
[((493, 525), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (509, 525), False, 'from django.db import models\n'), ((544, 562), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (560, 562), False, 'from django.db import models\n'), ((584, 602), '...
#!/usr/bin/env python import time from random import choice from string import ascii_lowercase from amqp import connect_get_channel_declare_exchange_and_return_channel, EXCHANGE_NAME APPS = ["foo", "bar", "infrastructure"] LEVELS = ["debug", "info", "warn", "error"] def publish_cyclically(): channel = connect_g...
[ "random.choice", "amqp.connect_get_channel_declare_exchange_and_return_channel", "time.sleep" ]
[((311, 368), 'amqp.connect_get_channel_declare_exchange_and_return_channel', 'connect_get_channel_declare_exchange_and_return_channel', ([], {}), '()\n', (366, 368), False, 'from amqp import connect_get_channel_declare_exchange_and_return_channel, EXCHANGE_NAME\n'), ((858, 871), 'time.sleep', 'time.sleep', (['(1)'], {...
import discord from discord.ext import commands from discord.ext import * from discord.ext.commands import * import asyncio class help(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def help(self, ctx): embed = discord.Embed( title="KEKW Bot...
[ "discord.Color.dark_gold", "discord.ext.commands.command" ]
[((209, 227), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (225, 227), False, 'from discord.ext import commands\n'), ((553, 578), 'discord.Color.dark_gold', 'discord.Color.dark_gold', ([], {}), '()\n', (576, 578), False, 'import discord\n')]
# @author: <NAME> # email: <EMAIL> # -2 # fetch data from kafka producer # doing computation using spark streaming # store back to kafka producer in another topic import argparse import json import logging import atexit from pyspark import SparkContext from pyspark.streaming import StreamingContext from pyspark.stream...
[ "argparse.ArgumentParser", "logging.basicConfig", "pyspark.SparkContext", "pyspark.streaming.kafka.KafkaUtils.createDirectStream", "kafka.KafkaProducer", "json.dumps", "pyspark.streaming.StreamingContext", "logging.getLogger" ]
[((2318, 2343), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2341, 2343), False, 'import argparse\n'), ((643, 686), 'kafka.KafkaProducer', 'KafkaProducer', ([], {'bootrap_servers': 'kafka_broker'}), '(bootrap_servers=kafka_broker)\n', (656, 686), False, 'from kafka import KafkaProducer\n'), ...
import scrapy from news_spider.items import WallstreetcnItem from news_spider.utils.common import get_category_by_name class WallstreetcnSpider(scrapy.Spider): name = 'wallstreetcn' allowed_domains = ['https://api.wallstcn.com'] start_urls = ['https://api.wallstcn.com/apiv1/content/information-flow?chann...
[ "news_spider.items.WallstreetcnItem", "news_spider.utils.common.get_category_by_name" ]
[((389, 415), 'news_spider.utils.common.get_category_by_name', 'get_category_by_name', (['name'], {}), '(name)\n', (409, 415), False, 'from news_spider.utils.common import get_category_by_name\n'), ((578, 596), 'news_spider.items.WallstreetcnItem', 'WallstreetcnItem', ([], {}), '()\n', (594, 596), False, 'from news_spi...
from django.http import HttpResponse from django.template import loader from .models import * from django.conf import settings from django.shortcuts import redirect from utils import dataLayerPDF from utils import dprint from utils import modelUtils import pandas as pd from django.contrib.auth import authenticate, log...
[ "django.http.HttpResponse", "django.shortcuts.redirect", "utils.modelUtils.saveUserProfileFields", "utils.dataLayerPDF.addText", "datetime.datetime.now", "django.contrib.auth.logout", "django.contrib.auth.authenticate", "utils.modelUtils.addFieldsToProfile", "django.contrib.auth.login", "utils.mod...
[((4341, 4371), 'django.views.decorators.http.require_http_methods', 'require_http_methods', (["['POST']"], {}), "(['POST'])\n", (4361, 4371), False, 'from django.views.decorators.http import require_http_methods\n'), ((589, 627), 'django.template.loader.get_template', 'loader.get_template', (['"""base_intro.html"""'],...
#!/usr/bin/python # Copyright (C) 2012, <NAME> <<EMAIL>> # http://aravindavk.in # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
[ "fontforge.open" ]
[((805, 835), 'fontforge.open', 'fontforge.open', (['"""../Gubbi.sfd"""'], {}), "('../Gubbi.sfd')\n", (819, 835), False, 'import fontforge\n')]
import typing import random import uuid from pydantic import BaseModel, Field class URL(BaseModel): """ FastAPI uses pydantic to validate and represent data. Maybe dive deeper in it. """ id: int = Field(..., title="ID of URL") full_url: str = Field(..., title="Full URL") short_url_code: ...
[ "uuid.uuid4", "pydantic.Field", "random.choice" ]
[((221, 250), 'pydantic.Field', 'Field', (['...'], {'title': '"""ID of URL"""'}), "(..., title='ID of URL')\n", (226, 250), False, 'from pydantic import BaseModel, Field\n'), ((271, 299), 'pydantic.Field', 'Field', (['...'], {'title': '"""Full URL"""'}), "(..., title='Full URL')\n", (276, 299), False, 'from pydantic im...
#!/usr/bin/env python3 ################################################################ # <NAME> Personality Type Tweets Natural Language Processing # By <NAME> # Project can be found at: # https://www.inertia7.com/projects/109 & # https://www.inertia7.com/projects/110 ###############################################...
[ "os.getcwd", "sklearn.model_selection.train_test_split", "pandas.read_csv", "os.path.isfile", "numpy.array", "sys.exit" ]
[((615, 626), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (624, 626), False, 'import sys, os\n'), ((1048, 1075), 'numpy.array', 'np.array', (["['type', 'posts']"], {}), "(['type', 'posts'])\n", (1056, 1075), True, 'import numpy as np\n'), ((1616, 1642), 'os.path.isfile', 'os.path.isfile', (['token_data'], {}), '(token_...
# -*- coding: utf-8 -*- import os import time import tensorflow as tf from config import FLAGS from model import build_graph from preprocess import train_data_iterator, test_data_helper def train(): with tf.Session() as sess: # initialization graph = build_graph(top_k=1) saver = tf.train...
[ "preprocess.train_data_iterator", "tensorflow.train.Coordinator", "tensorflow.train.Saver", "model.build_graph", "tensorflow.global_variables_initializer", "tensorflow.Session", "time.time", "tensorflow.train.start_queue_runners", "tensorflow.summary.FileWriter", "tensorflow.train.latest_checkpoin...
[((212, 224), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (222, 224), True, 'import tensorflow as tf\n'), ((275, 295), 'model.build_graph', 'build_graph', ([], {'top_k': '(1)'}), '(top_k=1)\n', (286, 295), False, 'from model import build_graph\n'), ((312, 328), 'tensorflow.train.Saver', 'tf.train.Saver', ([],...
#!/usr/bin/env python3 import bitstring from compression import huffman simple = b"122333" simple_codes = { "1": "11", "2": "10", "3": "0" } simple_tree = bitstring.Bits("0b00100110001100110010100110011") simple_compressed = bitstring.Bits("0x498cca67d0") lorem = (b"Lorem ipsum dolor sit amet, consectet...
[ "compression.huffman.Node.from_data", "compression.huffman.decompress", "compression.huffman.Node.from_binary", "bitstring.Bits", "compression.huffman.compress" ]
[((170, 219), 'bitstring.Bits', 'bitstring.Bits', (['"""0b00100110001100110010100110011"""'], {}), "('0b00100110001100110010100110011')\n", (184, 219), False, 'import bitstring\n'), ((240, 270), 'bitstring.Bits', 'bitstring.Bits', (['"""0x498cca67d0"""'], {}), "('0x498cca67d0')\n", (254, 270), False, 'import bitstring\...
from deep_rl import register_trainer from deep_rl.core import AbstractTrainer from deep_rl.core import MetricContext from deep_rl.configuration import configuration from environments.gym_house.goal import GoalImageCache import os import torch import numpy as np from torch.utils.data import Dataset,DataLoader from model...
[ "torch.utils.data.DataLoader", "torch.load", "torch.nn.functional.mse_loss", "models.AuxiliaryBigGoalHouseModel", "deep_rl.configuration.configuration.get", "os.path.isfile", "deep_rl.core.MetricContext", "torch.device", "deep_rl.register_trainer", "os.path.join" ]
[((1861, 1905), 'deep_rl.register_trainer', 'register_trainer', ([], {'save': '(True)', 'saving_period': '(1)'}), '(save=True, saving_period=1)\n', (1877, 1905), False, 'from deep_rl import register_trainer\n'), ((2114, 2134), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (2126, 2134), False, 'imp...
import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash_extensions import Download def create_actions_tab(projname, vername): return [ dbc.Row( dbc.Col(html.H2("Actions")), ), dbc.Row( dbc.Col(html.H4(...
[ "dash_bootstrap_components.Label", "dash_bootstrap_components.Input", "dash_html_components.H2", "dash_extensions.Download", "dash_html_components.Div", "dash_bootstrap_components.CardHeader", "dash_bootstrap_components.Button", "dash_html_components.H4", "dash_bootstrap_components.Checklist", "da...
[((243, 261), 'dash_html_components.H2', 'html.H2', (['"""Actions"""'], {}), "('Actions')\n", (250, 261), True, 'import dash_html_components as html\n'), ((312, 345), 'dash_html_components.H4', 'html.H4', (['"""Project: - Version: - """'], {}), "('Project: - Version: - ')\n", (319, 345), True, 'import dash_html_compone...
from view.runnable.Runnable import Runnable class showMultiPlayerBoard(Runnable): def __init__(self,vue, sec): Runnable.__init__(self,vue) self.sec = sec def run(self): self.vue.showMultiPlayerBoard(self.sec)
[ "view.runnable.Runnable.Runnable.__init__" ]
[((125, 153), 'view.runnable.Runnable.Runnable.__init__', 'Runnable.__init__', (['self', 'vue'], {}), '(self, vue)\n', (142, 153), False, 'from view.runnable.Runnable import Runnable\n')]
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import requests import time import warnings from .auth import HMACAuth from .compat import imap from .compat import quote from .compat impor...
[ "requests.session", "warnings.warn", "json.dumps", "time.sleep" ]
[((1553, 1571), 'requests.session', 'requests.session', ([], {}), '()\n', (1569, 1571), False, 'import requests\n'), ((3852, 3887), 'warnings.warn', 'warnings.warn', (['message', 'UserWarning'], {}), '(message, UserWarning)\n', (3865, 3887), False, 'import warnings\n'), ((12120, 12181), 'json.dumps', 'json.dumps', (['o...
from setuptools import setup, find_packages, Extension setup(name='aquila_stlfr', version='1.1', description='assembly and variant calling for stlfr and hybrid assembler for linked-reads', author='XinZhou', author_email='<EMAIL>', packages=['bin',], entry_points={'console_scripts':[...
[ "setuptools.setup" ]
[((56, 877), 'setuptools.setup', 'setup', ([], {'name': '"""aquila_stlfr"""', 'version': '"""1.1"""', 'description': '"""assembly and variant calling for stlfr and hybrid assembler for linked-reads"""', 'author': '"""XinZhou"""', 'author_email': '"""<EMAIL>"""', 'packages': "['bin']", 'entry_points': "{'console_scripts...
from typing import Callable, Union import rx from rx.core import Observable, typing from rx.disposable import SingleAssignmentDisposable, SerialDisposable from rx.internal.utils import is_future def catch_handler(source: Observable, handler: Callable[[Exception, Observable], Observable]) -> Observable: def subsc...
[ "rx.disposable.SingleAssignmentDisposable", "rx.catch", "rx.from_future", "rx.core.Observable", "rx.disposable.SerialDisposable", "rx.internal.utils.is_future" ]
[((1150, 1171), 'rx.core.Observable', 'Observable', (['subscribe'], {}), '(subscribe)\n', (1160, 1171), False, 'from rx.core import Observable, typing\n'), ((365, 393), 'rx.disposable.SingleAssignmentDisposable', 'SingleAssignmentDisposable', ([], {}), '()\n', (391, 393), False, 'from rx.disposable import SingleAssignm...
# -*- coding: utf-8 -*- ''' This file is part of PyMbs. PyMbs is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PyMbs is distributed i...
[ "PyMbs.Symbolics.cos", "PyMbs.Symbolics.sin" ]
[((3328, 3341), 'PyMbs.Symbolics.cos', 'cos', (['phi_BP_1'], {}), '(phi_BP_1)\n', (3331, 3341), False, 'from PyMbs.Symbolics import Matrix, cos, sin\n'), ((3345, 3358), 'PyMbs.Symbolics.sin', 'sin', (['phi_BP_1'], {}), '(phi_BP_1)\n', (3348, 3358), False, 'from PyMbs.Symbolics import Matrix, cos, sin\n'), ((3406, 3419)...
#!/usr/bin/python # -*- coding: utf-8 -*- """ <NAME> ISIR - CNRS / Sorbonne Université 02/2018 This file allows to build worlds TODO : replace this file by a .json loader and code worlds in .json """ # WARNING : don't fo (from round_bot_py import round_bot_model) here to avoid mutual imports ! impo...
[ "gym_round_bot.envs.round_bot_model.Block.tex_coords", "os.path.dirname", "gym_round_bot.envs.round_bot_model.BoundingBoxBlock" ]
[((2911, 2967), 'gym_round_bot.envs.round_bot_model.Block.tex_coords', 'round_bot_model.Block.tex_coords', (['(1, 0)', '(0, 1)', '(0, 0)'], {}), '((1, 0), (0, 1), (0, 0))\n', (2943, 2967), False, 'from gym_round_bot.envs import round_bot_model\n'), ((2979, 3035), 'gym_round_bot.envs.round_bot_model.Block.tex_coords', '...
import os, sys sys.path.append(os.getcwd()) from PyQt5.QtWidgets import QApplication from src.view.widgets.buttons_cch import ButtonsCCHView from src.controller.base import Base class ButtonsCCHController: def __init__(self, force_show=False): print('C botoes') self.view = ButtonsCCHView() self.view.bt_confi...
[ "os.getcwd", "PyQt5.QtWidgets.QApplication", "src.view.widgets.buttons_cch.ButtonsCCHView" ]
[((31, 42), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (40, 42), False, 'import os, sys\n'), ((576, 598), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (588, 598), False, 'from PyQt5.QtWidgets import QApplication\n'), ((282, 298), 'src.view.widgets.buttons_cch.ButtonsCCHView', 'Bu...
#!/usr/bin/python3 from sys import argv import os import math import urllib.request import random import os.path import sqlite3 URL_TEMPLATE = "https://c.tile.openstreetmap.org/%d/%d/%d.png" BBOX = None # [lon_min, lat_min, lon_max, lat_max] or None for whole world ZOOM_MAX = 7 LAYERTYPE = "baselayer" # "baselayer" ...
[ "random.randint", "math.radians", "math.tan", "sqlite3.connect", "math.cos" ]
[((434, 455), 'math.radians', 'math.radians', (['lat_deg'], {}), '(lat_deg)\n', (446, 455), False, 'import math\n'), ((711, 731), 'random.randint', 'random.randint', (['(1)', '(4)'], {}), '(1, 4)\n', (725, 731), False, 'import random\n'), ((1562, 1581), 'sqlite3.connect', 'sqlite3.connect', (['db'], {}), '(db)\n', (157...
text_dir='VCTK-Corpus/txt/' wav_dir='VCTK-Corpus/wav48/' train_txt='VCTK-Corpus/training.txt' val_txt='VCTK-Corpus/validation.txt' eval_txt='VCTK-Corpus/evaluation.txt' import os all_set=[] train_set=[] val_set=[] eval_set=[] spks=os.listdir(text_dir) spks.sort() for spk in spks: if spk in ['p360', 'p361', 'p3...
[ "os.path.join", "os.listdir", "os.path.basename" ]
[((236, 256), 'os.listdir', 'os.listdir', (['text_dir'], {}), '(text_dir)\n', (246, 256), False, 'import os\n'), ((395, 422), 'os.path.join', 'os.path.join', (['text_dir', 'spk'], {}), '(text_dir, spk)\n', (407, 422), False, 'import os\n'), ((432, 451), 'os.listdir', 'os.listdir', (['spk_dir'], {}), '(spk_dir)\n', (442...
import unittest from aviation_weather import Pressure from aviation_weather.exceptions import PressureDecodeError class TestPressure(unittest.TestCase): """Unit tests for aviation_weather.components.pressure.Pressure""" def _test_valid(self, raw, indicator, value): p = Pressure(raw) self.asse...
[ "aviation_weather.Pressure" ]
[((289, 302), 'aviation_weather.Pressure', 'Pressure', (['raw'], {}), '(raw)\n', (297, 302), False, 'from aviation_weather import Pressure\n'), ((683, 699), 'aviation_weather.Pressure', 'Pressure', (['"""3000"""'], {}), "('3000')\n", (691, 699), False, 'from aviation_weather import Pressure\n')]
from itertools import cycle import random import sys import pygame from pygame.locals import * FPS = 30 SCREENWIDTH = 512 SCREENHEIGHT = 512 # amount by which base can maximum shift to left PIPEGAPSIZE = 100 # gap between upper and lower part of pipe PIPEHEIGHT = 300 PIPEWIDTH = 50 BASEY = SCREENHEIGHT ...
[ "pygame.draw.ellipse", "pygame.quit", "random.randint", "pygame.font.SysFont", "pygame.event.get", "pygame.display.set_mode", "pygame.draw.rect", "pygame.Rect", "pygame.init", "pygame.display.update", "pygame.display.set_caption", "pygame.time.Clock", "sys.exit" ]
[((1471, 1484), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1482, 1484), False, 'import pygame\n'), ((1500, 1519), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (1517, 1519), False, 'import pygame\n'), ((1533, 1585), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(SCREENWIDTH, SCREENHEIGHT)...
from django.shortcuts import render, get_object_or_404 from .models import About,Appointment,Doctor,Report,Service,History from django.http import HttpResponse,HttpResponseRedirect from django.shortcuts import redirect from django.contrib.auth.decorators import login_required # Create your views here. def home(request)...
[ "django.shortcuts.render", "django.shortcuts.get_object_or_404", "django.shortcuts.redirect" ]
[((334, 367), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', '{}'], {}), "(request, 'index.html', {})\n", (340, 367), False, 'from django.shortcuts import render, get_object_or_404\n'), ((454, 492), 'django.shortcuts.render', 'render', (['request', '"""about.html"""', 'context'], {}), "(request, ...
"""Basic test configuration""" from unittest.mock import MagicMock from pytest import fixture from elasticsearch_dsl.connections import add_connection @fixture def mock_client(dummy_response): """Returns elasticsearch mock client""" client = MagicMock() client.search.return_value = dummy_response ad...
[ "pytest.fixture", "unittest.mock.MagicMock", "elasticsearch_dsl.connections.add_connection" ]
[((369, 399), 'pytest.fixture', 'fixture', ([], {'name': '"""dummy_response"""'}), "(name='dummy_response')\n", (376, 399), False, 'from pytest import fixture\n'), ((254, 265), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (263, 265), False, 'from unittest.mock import MagicMock\n'), ((318, 348), 'elasticsea...
from __future__ import print_function import csv import numpy as np import re import Spectrum #import matplotlib.pyplot as plt def ReadCSVRef(filename): with open(filename) as csvfile: reader = csv.reader(csvfile, delimiter=',') headers = list(filter(None, next(reader))) data = [] f...
[ "csv.reader", "numpy.shape", "re.findall", "numpy.array", "numpy.interp", "Spectrum.CLSpectrum" ]
[((383, 397), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (391, 397), True, 'import numpy as np\n'), ((207, 241), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""","""'}), "(csvfile, delimiter=',')\n", (217, 241), False, 'import csv\n'), ((1620, 1657), 'Spectrum.CLSpectrum', 'Spectrum.CLSpectrum',...
"""Class containing the generic markdown engine used by evenniq_wiki.""" from bs4 import BeautifulSoup from markdown import Markdown class MarkdownEngine(Markdown): """A special markdown engine for the evennia_wiki. This pre-loads some common extensions and allows some inner processing. """ def __...
[ "bs4.BeautifulSoup" ]
[((981, 1015), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (994, 1015), False, 'from bs4 import BeautifulSoup\n')]
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_roster.ipynb (unless otherwise specified). __all__ = ['ShiftProperties', 'Shift', 'Roster'] # Cell from dataclasses import dataclass from datetime import datetime, timedelta, date, time from ics import Calendar, Event import re from typing import Optional from zoneinfo i...
[ "ics.Event", "zoneinfo.ZoneInfo", "ics.Calendar", "re.compile" ]
[((783, 817), 're.compile', 're.compile', (['"""MO|DI|MI|DO|FR|SA|SO"""'], {}), "('MO|DI|MI|DO|FR|SA|SO')\n", (793, 817), False, 'import re\n'), ((832, 852), 're.compile', 're.compile', (['"""\\\\d{2}"""'], {}), "('\\\\d{2}')\n", (842, 852), False, 'import re\n'), ((1858, 1868), 'ics.Calendar', 'Calendar', ([], {}), '(...
import sys import discord from discord.ext import tasks import base.command_base as base import base.DiscordSend as Sendtool import base.ColorPrint as CPrint import base.time_check as CTime import os import collections as cl from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta ...
[ "datetime.datetime.strftime", "datetime.datetime.today", "command.voice_log.chart.makeTimeList", "base.ColorPrint.error_print", "os.getcwd", "base.DiscordSend.Send_ChannelID", "os.rename", "os.path.exists", "dateutil.relativedelta.relativedelta", "sys._getframe", "json.dumps", "base.time_check...
[((1703, 1719), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (1717, 1719), False, 'from datetime import datetime, timedelta\n'), ((1805, 1838), 'datetime.datetime.strftime', 'datetime.strftime', (['filetime', '"""%m"""'], {}), "(filetime, '%m')\n", (1822, 1838), False, 'from datetime import datetime, ...
""" This module exports the 'Hand' class, 'PlayerHand' and 'DealerHand' subclasses, and related methods. """ import time draw_delay = 1 # The pause in seconds between drawn card actions twenty_one = 21 # Ideal score value for both players class Hand: """ A class defining the properties and methods of a han...
[ "time.sleep" ]
[((15691, 15713), 'time.sleep', 'time.sleep', (['draw_delay'], {}), '(draw_delay)\n', (15701, 15713), False, 'import time\n'), ((14469, 14491), 'time.sleep', 'time.sleep', (['draw_delay'], {}), '(draw_delay)\n', (14479, 14491), False, 'import time\n'), ((14841, 14863), 'time.sleep', 'time.sleep', (['draw_delay'], {}), ...
from utils import create_input_files """ To create files that contain all images stored in h5py format and captions stored in json files. Minimum word frequencies to be used as cut-off for removing rare words to be specifiied here. """ if __name__ == '__main__': create_input_files(dataset='coco', ...
[ "utils.create_input_files" ]
[((269, 500), 'utils.create_input_files', 'create_input_files', ([], {'dataset': '"""coco"""', 'karpathy_json_path': '"""path_to___dataset_coco.json"""', 'image_folder': '"""path_to__mscoco_folder"""', 'captions_per_image': '(5)', 'min_word_freq': '(5)', 'output_folder': '"""folder_for_processed_data"""', 'max_len': '(...
import pandas as pd class TableManager: def __init__(self,table_file): self.master_table=pd.read_csv(table_file).sort_values("Info",ascending=False) def get_filtered_table(self,low_freq,high_freq,delta_freq,target): low_freq=float(low_freq) high_freq=float(high_freq) delta_freq...
[ "pandas.read_csv" ]
[((102, 125), 'pandas.read_csv', 'pd.read_csv', (['table_file'], {}), '(table_file)\n', (113, 125), True, 'import pandas as pd\n')]
# -*- coding: utf-8 -*- # @Time : 2022/3/8 14:38 # @Author : jiaopaner import sys sys.path.insert(0, './') import torch from collections import OrderedDict from craft import CRAFT def copyStateDict(state_dict): if list(state_dict.keys())[0].startswith("module"): start_idx = 1 else: start_id...
[ "torch.load", "sys.path.insert", "torch.randn", "craft.CRAFT", "collections.OrderedDict", "torch.onnx.export" ]
[((86, 110), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./"""'], {}), "(0, './')\n", (101, 110), False, 'import sys\n'), ((347, 360), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (358, 360), False, 'from collections import OrderedDict\n'), ((544, 551), 'craft.CRAFT', 'CRAFT', ([], {}), '()\n', (5...
from cloudinary.models import CloudinaryField from django.contrib.auth import get_user_model from django.db import models # Create your models here. from MetioTube.core.validators import validate_image UserModel = get_user_model() class Profile(models.Model): username = models.CharField( max_length=30 ...
[ "django.db.models.TextField", "django.db.models.OneToOneField", "django.db.models.ManyToManyField", "django.db.models.CharField", "django.contrib.auth.get_user_model", "cloudinary.models.CloudinaryField" ]
[((216, 232), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (230, 232), False, 'from django.contrib.auth import get_user_model\n'), ((279, 310), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(30)'}), '(max_length=30)\n', (295, 310), False, 'from django.db import mode...
import warnings from datetime import datetime import numpy as np import xarray as xr import pytest import ecco_v4_py from .test_common import all_mds_datadirs, get_test_ds @pytest.mark.parametrize("mytype",['xda','nparr','list','single']) def test_extract_dates(mytype): dints = [[1991,8,9,13,10,15],[1992,10,20,...
[ "numpy.datetime64", "ecco_v4_py.extract_yyyy_mm_dd_hh_mm_ss_from_datetime64", "datetime.datetime", "ecco_v4_py.get_llc_grid", "numpy.array", "pytest.mark.parametrize", "numpy.all" ]
[((176, 245), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mytype"""', "['xda', 'nparr', 'list', 'single']"], {}), "('mytype', ['xda', 'nparr', 'list', 'single'])\n", (199, 245), False, 'import pytest\n'), ((469, 507), 'numpy.array', 'np.array', (['dates'], {'dtype': '"""datetime64[s]"""'}), "(dates, dty...
"""The laundrify integration.""" from __future__ import annotations from laundrify_aio import LaundrifyAPI from laundrify_aio.exceptions import ApiConnectionException, UnauthorizedException from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ACCESS_TOKEN, Platform from homeassist...
[ "homeassistant.exceptions.ConfigEntryAuthFailed", "homeassistant.exceptions.ConfigEntryNotReady", "laundrify_aio.LaundrifyAPI", "homeassistant.helpers.aiohttp_client.async_get_clientsession" ]
[((786, 815), 'homeassistant.helpers.aiohttp_client.async_get_clientsession', 'async_get_clientsession', (['hass'], {}), '(hass)\n', (809, 815), False, 'from homeassistant.helpers.aiohttp_client import async_get_clientsession\n'), ((833, 885), 'laundrify_aio.LaundrifyAPI', 'LaundrifyAPI', (['entry.data[CONF_ACCESS_TOKE...
# Copyright 2017 <NAME> # # Licensed under the MIT License. If the LICENSE file is missing, you # can find the MIT license terms here: https://opensource.org/licenses/MIT from flask import Flask, render_template from config import config def create_app(config_name): app = Flask(__name__) app.config.from_objec...
[ "flask.Flask" ]
[((279, 294), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (284, 294), False, 'from flask import Flask, render_template\n')]