code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import json
from pathlib import Path
import typer
def get_skill_config(name=None):
app_dir = Path(typer.get_app_dir('skills-cli', force_posix=True))
config_file = app_dir / 'config.json'
if not app_dir.exists():
typer.echo('Creating default configuration')
app_dir.mkdir(parents=True)
... | [
"typer.Exit",
"typer.secho",
"typer.echo",
"typer.get_app_dir"
] | [((105, 154), 'typer.get_app_dir', 'typer.get_app_dir', (['"""skills-cli"""'], {'force_posix': '(True)'}), "('skills-cli', force_posix=True)\n", (122, 154), False, 'import typer\n'), ((236, 280), 'typer.echo', 'typer.echo', (['"""Creating default configuration"""'], {}), "('Creating default configuration')\n", (246, 28... |
import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
class TestClass:
def test_import(self):
import superpoint
def test_DeepFNet(self):
from deepFEPE.models.DeepFNet import main
main()
def test_ErrorEstimators(self):
from deepF... | [
"yaml.load",
"os.path.dirname",
"deepFEPE.utils.loader.dataLoader",
"torch.cuda.is_available",
"deepFEPE.models.ErrorEstimators.main",
"logging.info"
] | [((258, 264), 'deepFEPE.models.ErrorEstimators.main', 'main', ([], {}), '()\n', (262, 264), False, 'from deepFEPE.models.ErrorEstimators import main\n'), ((367, 373), 'deepFEPE.models.ErrorEstimators.main', 'main', ([], {}), '()\n', (371, 373), False, 'from deepFEPE.models.ErrorEstimators import main\n'), ((557, 600), ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# the inclusion of the tests module is not meant to offer best practices for
# testing in general, but rather to support the `find_packages` example in
# setup.py that excludes installing the "tests" p... | [
"src.color_log.clog.log.error",
"src.color_log.clog.log.debug",
"src.color_log.clog.log.warn",
"unittest.main",
"src.color_log.clog.log.critical",
"src.color_log.clog.log.info",
"os.path.abspath"
] | [((1244, 1259), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1257, 1259), False, 'import unittest\n'), ((963, 990), 'src.color_log.clog.log.debug', 'log.debug', (['"""这是 DEBUG 日志,白色"""'], {}), "('这是 DEBUG 日志,白色')\n", (972, 990), False, 'from src.color_log.clog import log\n'), ((999, 1024), 'src.color_log.clog.l... |
"""
Implement the algorithm `Learning to Assign Credit in Input-Driven Environment'
"""
from core.algorithms.base_algo import BaseAlgo
from torch import optim
from itertools import chain
import torch
import random
import torch.nn as nn
class LacieAlgo(BaseAlgo):
"""
Base class for LACIE algorithm. Su... | [
"torch.nn.CrossEntropyLoss",
"torch.nn.init.constant_",
"torch.nn.L1Loss",
"torch.sin",
"torch.cos",
"torch.flip",
"torch.bmm",
"torch.arange",
"torch.nn.GRU",
"torch.nn.init.kaiming_normal_",
"random.randint",
"torch.nn.Embedding",
"torch.ones_like",
"torch.nn.LeakyReLU",
"torch.clamp",... | [((3847, 3865), 'torch.nn.Softmax', 'nn.Softmax', ([], {'dim': '(-1)'}), '(dim=-1)\n', (3857, 3865), True, 'import torch.nn as nn\n'), ((3893, 3914), 'torch.nn.LogSoftmax', 'nn.LogSoftmax', ([], {'dim': '(-1)'}), '(dim=-1)\n', (3906, 3914), True, 'import torch.nn as nn\n'), ((3944, 3965), 'torch.nn.CrossEntropyLoss', '... |
from behave import given, then
from hamcrest import (
assert_that, instance_of
)
from pyticketswitch import Client
from pyticketswitch.exceptions import AuthenticationError
@given('an API client with valid credentials')
def given_an_api_client_with_valid_credentials(context):
client = Client('demo', 'demopass... | [
"behave.given",
"behave.then",
"hamcrest.instance_of",
"pyticketswitch.Client"
] | [((180, 225), 'behave.given', 'given', (['"""an API client with valid credentials"""'], {}), "('an API client with valid credentials')\n", (185, 225), False, 'from behave import given, then\n'), ((419, 466), 'behave.given', 'given', (['"""an API client with invalid credentials"""'], {}), "('an API client with invalid c... |
from django.http.response import Http404
from django.views.generic import DetailView, ListView, UpdateView, CreateView,DeleteView
from .models import Invoice, InvoiceItem, Receipt,ReceiptLine,Month,Year
from contact.models import Customer
from .forms import (InvoiceForm, InvoiceItemForm, InvoiceItemFormSet,ReceiptForm,... | [
"django.shortcuts.render",
"num2words.num2words",
"django.db.models.Subquery",
"pytz.utc.localize",
"contact.models.Customer.objects.filter",
"tablib.Dataset",
"django.db.transaction.atomic",
"openpyxl.load_workbook",
"django.db.models.F",
"contact.models.Customer.objects.order_by",
"approval.mo... | [((11644, 11664), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (11662, 11664), False, 'from django.db import transaction\n'), ((11792, 11812), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (11810, 11812), False, 'from django.db import transaction\n'), ((14210, 14230)... |
# -*- coding: utf-8 -*-
import os
import uuid
import mock
import requests
from flaky import flaky
from nose import SkipTest
from depot._compat import PY2, unicode_text
S3Storage = None
FILE_CONTENT = b'HELLO WORLD'
@flaky
class TestS3FileStorage(object):
@classmethod
def setupClass(self):
# Travis ... | [
"depot.io.boto3.S3Storage",
"mock.patch",
"requests.get",
"nose.SkipTest",
"uuid.uuid1",
"depot._compat.unicode_text",
"os.getpid",
"botocore.exceptions.ClientError"
] | [((1265, 1306), 'depot.io.boto3.S3Storage', 'S3Storage', (['*self.cred'], {'bucket': 'self.bucket'}), '(*self.cred, bucket=self.bucket)\n', (1274, 1306), False, 'from depot.io.boto3 import S3Storage\n'), ((4467, 4488), 'depot.io.boto3.S3Storage', 'S3Storage', (['*self.cred'], {}), '(*self.cred)\n', (4476, 4488), False,... |
import argparse
import json
import logging
import numpy as np
import warnings
import pandas as pd
from sklearn.model_selection import KFold
from interprete.src.models.available_models import MODELS
from interprete.src.struct_probing.code_augs import available_augs, CodeAugmentation
from interprete.src.utils import Se... | [
"logging.getLogger",
"numpy.unique",
"argparse.ArgumentParser",
"interprete.src.utils.Setup.get_aug_path",
"numpy.array",
"interprete.src.struct_probing.code_augs.available_augs.keys",
"warnings.warn",
"sklearn.model_selection.KFold",
"logging.info",
"json.dump",
"interprete.src.models.available... | [((383, 419), 'logging.getLogger', 'logging.getLogger', (['"""save_embeddings"""'], {}), "('save_embeddings')\n", (400, 419), False, 'import logging\n'), ((1023, 1063), 'logging.info', 'logging.info', (['f"""start {args.insert_bug}"""'], {}), "(f'start {args.insert_bug}')\n", (1035, 1063), False, 'import logging\n'), (... |
import unittest
from accelergy import helper_functions as hf
class TestHelperFunctions(unittest.TestCase):
def test_oneD_linear_interpolation(self):
""" linear interpolation on one hardware attribute """
# Rough estimation of simple ripple carry adder: E_adder = E_full_adder * bitwidth + E_misc
... | [
"unittest.main",
"accelergy.helper_functions.oneD_quadratic_interpolation",
"accelergy.helper_functions.oneD_linear_interpolation"
] | [((1791, 1806), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1804, 1806), False, 'import unittest\n'), ((674, 794), 'accelergy.helper_functions.oneD_linear_interpolation', 'hf.oneD_linear_interpolation', (['bitwidth_desired', "[{'x': bitwidth_0, 'y': energy_0}, {'x': bitwidth_1, 'y': energy_1}]"], {}), "(bitwid... |
"""Unit tests for q0101.py."""
import unittest
from src.q0101 import (is_all_unique_str as is_unique,
is_all_unique_dict as is_unique_dict,
is_all_unique_set as is_unique_set)
class TestUniqueness(unittest.TestCase):
"""Tests for string, dictionary, and set implemen... | [
"unittest.main",
"src.q0101.is_all_unique_dict",
"src.q0101.is_all_unique_str",
"src.q0101.is_all_unique_set"
] | [((1103, 1118), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1116, 1118), False, 'import unittest\n'), ((380, 393), 'src.q0101.is_all_unique_str', 'is_unique', (['""""""'], {}), "('')\n", (389, 393), True, 'from src.q0101 import is_all_unique_str as is_unique, is_all_unique_dict as is_unique_dict, is_all_unique... |
import os, imdb
def set_home_directory():
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
# Movie name should be in the following format: 'Name (YYYY) *'
os.system('cls')
set_home_directory()
def turn_red(skk): return ('\033[91m{}\033[00m'.format(skk))
def turn_gr... | [
"os.path.join",
"os.getcwd",
"os.chdir",
"os.path.dirname",
"imdb.IMDb",
"os.path.abspath",
"os.system"
] | [((206, 222), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (215, 222), False, 'import os, imdb\n'), ((691, 702), 'imdb.IMDb', 'imdb.IMDb', ([], {}), '()\n', (700, 702), False, 'import os, imdb\n'), ((57, 82), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (72, 82), False, 'impo... |
# STEP4: TSR FINDING ALGORITHM from Rocky which I have modified slightly
from collections import defaultdict
def run_step_four(step_three_file, window_size, chromosome_sizes, output_filename):
fi = open(step_three_file, 'r')
DDCHRSIZE = chromosome_sizes
id_to_process = '1'
lines_to_process = []
... | [
"collections.defaultdict"
] | [((532, 549), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (543, 549), False, 'from collections import defaultdict\n')] |
#!/bin/python
#
# CONTACT LIST
# ============
#
# This executable produces a contact list of users who shared an access point
# for at least 10 minutes.
#
# The program took about 2 hours and 30 minutes to complete in a table with 90k
# userids and 13 million sessions. The warehouse was hosted in a server running
# wit... | [
"sqlalchemy.create_engine",
"logging.info",
"__init__.resolve_args",
"argparse.ArgumentParser"
] | [((1986, 2015), 'sqlalchemy.create_engine', 'create_engine', (['args.wifi_conn'], {}), '(args.wifi_conn)\n', (1999, 2015), False, 'from sqlalchemy import create_engine\n'), ((2020, 2062), 'logging.info', 'logging.info', (['"""Creating the contact list."""'], {}), "('Creating the contact list.')\n", (2032, 2062), False,... |
import datetime
from aiogram import types
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from data.config import admins, logch, logch2
from loader import dp, bot
from filters import IsPrivate, IsBan
from keyboards.default import main_menu
from utils.sqlite impo... | [
"utils.sqlite.newuser",
"datetime.datetime.fromtimestamp",
"utils.sqlite.isUser",
"utils.sqlite.get_voucher",
"utils.sqlite.clear_firstname",
"filters.IsPrivate",
"keyboards.default.main_menu",
"filters.IsBan",
"loader.bot.send_message",
"datetime.datetime.now",
"utils.messages.startmsg",
"uti... | [((602, 609), 'filters.IsBan', 'IsBan', ([], {}), '()\n', (607, 609), False, 'from filters import IsPrivate, IsBan\n'), ((611, 622), 'filters.IsPrivate', 'IsPrivate', ([], {}), '()\n', (620, 622), False, 'from filters import IsPrivate, IsBan\n'), ((862, 869), 'filters.IsBan', 'IsBan', ([], {}), '()\n', (867, 869), Fals... |
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import loader
from task.const import ROLE_STORE, ROLE_APP, NUM_ROLE_STORE
from task.models import Task, Hist
from rusel.base.views import BaseListView, BaseDetailView, BaseGr... | [
"store.models.Params.objects.create",
"task.models.Hist.objects.create",
"store.models.Entry.get_new_value",
"datetime.datetime.now",
"store.forms.ParamsForm",
"django.contrib.auth.decorators.login_required",
"store.get_info.get_info",
"store.models.Params.objects.filter",
"django.template.loader.ge... | [((3233, 3274), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""account:login"""'}), "(login_url='account:login')\n", (3247, 3274), False, 'from django.contrib.auth.decorators import login_required\n'), ((3863, 3903), 'django.template.loader.get_template', 'loader.get_template'... |
import hashlib
import os
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.http.respons... | [
"django.http.response.HttpResponseRedirect",
"django.contrib.messages.error",
"isi_mip.invitation.models.Invitation.objects.get",
"os.urandom",
"django.contrib.auth.login",
"django.core.urlresolvers.reverse",
"django.utils.timezone.now",
"django.contrib.messages.success",
"django.contrib.auth.models... | [((1335, 1433), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ([], {'username': "form.data['username']", 'email': "form.data['email']", 'is_active': '(True)'}), "(username=form.data['username'], email=form.data['email'\n ], is_active=True)\n", (1354, 1433), False, 'from django.contrib.auth... |
from setuptools import setup
setup(
name='integration-portal',
version='0.1',
packages=['portalsdk'],
url='www.4cgroup.co.za',
license='MIT',
author='<NAME>',
author_email='',
description=''
)
| [
"setuptools.setup"
] | [((30, 200), 'setuptools.setup', 'setup', ([], {'name': '"""integration-portal"""', 'version': '"""0.1"""', 'packages': "['portalsdk']", 'url': '"""www.4cgroup.co.za"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '""""""', 'description': '""""""'}), "(name='integration-portal', version='0.1', pa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 15:47:00 2021
@author: yusheng
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
FILE = "./train/restarted_agent_00_net_"
ftype = np.float32
W = np.fromfile(FILE +"weights.raw", dtype=ftype) | [
"numpy.fromfile"
] | [((239, 285), 'numpy.fromfile', 'np.fromfile', (["(FILE + 'weights.raw')"], {'dtype': 'ftype'}), "(FILE + 'weights.raw', dtype=ftype)\n", (250, 285), True, 'import numpy as np\n')] |
"""Apply Data PreProcessing
Applys pre processing to data.
.. helpdoc::
Apply a pre-processing data model to a part of a data parition, this will make the data look like the processed data to test in a model.
"""
"""
<widgetXML>
<name>Apply Data PreProcessing</name>
<icon>default.png</icon>
<tags... | [
"libraries.RedRCaret.signalClasses.CaretData.CaretData",
"redRGUI.base.commitButton"
] | [((1884, 1976), 'redRGUI.base.commitButton', 'redRGUI.base.commitButton', (['self.bottomAreaRight', '"""Commit"""'], {'callback': 'self.commitFunction'}), "(self.bottomAreaRight, 'Commit', callback=self.\n commitFunction)\n", (1909, 1976), False, 'import redRGUI, signals\n'), ((3056, 3167), 'libraries.RedRCaret.sign... |
import numpy as np
class HMM:
def __init__(self, A=None, B=None, pi=None):
self.A = A
self.B = B
self.pi = pi
def forward(self, O, detailed=False):
alpha = self.pi*self.B[:, O[0]]
if detailed:
print("alpha: {}".format(alpha))
for t in range(1, len(O))... | [
"numpy.ones",
"numpy.argmax",
"numpy.max",
"numpy.sum",
"numpy.matmul"
] | [((423, 436), 'numpy.sum', 'np.sum', (['alpha'], {}), '(alpha)\n', (429, 436), True, 'import numpy as np\n'), ((488, 510), 'numpy.ones', 'np.ones', (['self.pi.shape'], {}), '(self.pi.shape)\n', (495, 510), True, 'import numpy as np\n'), ((651, 691), 'numpy.sum', 'np.sum', (['(self.pi * self.B[:, O[0]] * beta)'], {}), '... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from collections import defaultdict
import json
from odoo import api, fields, models, _, SUPERUSER_ID
from odoo.exceptio... | [
"odoo.fields.Many2one"
] | [((502, 572), 'odoo.fields.Many2one', 'fields.Many2one', (['"""mrp.workcenter"""'], {'required': '(False)', 'ondelete': '"""set null"""'}), "('mrp.workcenter', required=False, ondelete='set null')\n", (517, 572), False, 'from odoo import api, fields, models, _, SUPERUSER_ID\n')] |
import os
import unittest
import logging
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
#
# SegmentCrossSectionArea
#
class SegmentCrossSectionArea(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.... | [
"slicer.util.childWidgetVariables",
"numpy.count_nonzero",
"numpy.array",
"vtk.vtkGeneralTransform",
"vtk.vtkFloatArray",
"logging.info",
"slicer.util.arrayFromTableColumn",
"slicer.mrmlScene.AddNewNodeByClass",
"slicer.mrmlScene.AddNode",
"traceback.print_exc",
"SampleData.SampleDataLogic",
"... | [((1523, 1557), 'slicer.util.VTKObservationMixin.__init__', 'VTKObservationMixin.__init__', (['self'], {}), '(self)\n', (1551, 1557), False, 'from slicer.util import VTKObservationMixin\n'), ((2015, 2057), 'slicer.util.childWidgetVariables', 'slicer.util.childWidgetVariables', (['uiWidget'], {}), '(uiWidget)\n', (2047,... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, Harvard Medical School"
__license__ = "MIT"
import numpy as np
import tensorflow as tf
from ast import literal_eval
class switch(object):
"""Switch statement for Python, based on recipe from Python Cookbook."""
def __init__(self, value):
self.val... | [
"tensorflow.initializers.random_normal",
"tensorflow.initializers.orthogonal",
"numpy.linspace",
"tensorflow.initializers.random_uniform",
"tensorflow.initializers.variance_scaling"
] | [((1421, 1447), 'numpy.linspace', 'np.linspace', (['(0.25)', '(0.99)', '(4)'], {}), '(0.25, 0.99, 4)\n', (1432, 1447), True, 'import numpy as np\n'), ((2203, 2281), 'tensorflow.initializers.random_normal', 'tf.initializers.random_normal', (['init_center', 'init_range'], {'seed': 'seed', 'dtype': 'dtype'}), '(init_cente... |
from colorama import init,Back
import random
import string
def random_char(y):
return ''.join(random.choice(string.ascii_lowercase) for x in range(y))
def checkinput(wrd,guess):
strout=''
for idx,i in enumerate(guess):
if wrd[idx]==i:
strout=strout + Back.GREEN + ' ' + i + ' '+ Back.B... | [
"random.choice",
"colorama.init"
] | [((547, 567), 'colorama.init', 'init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (551, 567), False, 'from colorama import init, Back\n'), ((100, 137), 'random.choice', 'random.choice', (['string.ascii_lowercase'], {}), '(string.ascii_lowercase)\n', (113, 137), False, 'import random\n')] |
import socket
"""
Socket for communication with bridge to Arduino
"""
class Bridge(object):
OK = 0
DISCONNEXION = 1
QUIT = 2
ERROR = 3
def __init__(self):
self.my_socket = None
self.host = 'nb-arnault4'
self.port = 5000
self.message = 0
def connect(self):
... | [
"socket.socket"
] | [((436, 485), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (449, 485), False, 'import socket\n')] |
'''
default
'''
import argparse
import logging
from srtsync.srt import SRT
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser()
parser.add_argument(
'--file', type=str, nargs='+',
help='files to sync'
)
parser.add_argument(
... | [
"logging.basicConfig",
"srtsync.srt.SRT",
"logging.info",
"argparse.ArgumentParser"
] | [((109, 149), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (128, 149), False, 'import logging\n'), ((164, 189), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (187, 189), False, 'import argparse\n'), ((616, 653), 'logging.info', 'log... |
__author__ = 'JPaschoal'
__version__ = '1.0.1'
__email__ = '<EMAIL>'
__date__ = '17/05/2021'
'''
Dados n e n sequências de números inteiros não nulos, cada qual seguida por um 0, calcular a soma dos números
pares de cada sequência.
'''
#-----------------------------------------------------------
import time
def ... | [
"time.sleep"
] | [((444, 459), 'time.sleep', 'time.sleep', (['(1.0)'], {}), '(1.0)\n', (454, 459), False, 'import time\n')] |
import asyncio
import itertools
from typing import Optional, Dict, Any, Union, List
import logging
import websockets
import json
from web3 import Web3
from .subscription import Subscription
from .methods import RPCMethod
from .contract import DeployedContract
from .types import Wei, Address, HexString
from .transport ... | [
"logging.getLogger",
"json.loads",
"asyncio.Queue",
"json.dumps",
"itertools.count",
"web3.Web3.toHex",
"asyncio.get_event_loop"
] | [((627, 668), 'logging.getLogger', 'logging.getLogger', (['"""async_web3.AsyncWeb3"""'], {}), "('async_web3.AsyncWeb3')\n", (644, 668), False, 'import logging\n'), ((783, 801), 'itertools.count', 'itertools.count', (['(1)'], {}), '(1)\n', (798, 801), False, 'import itertools\n'), ((5041, 5056), 'asyncio.Queue', 'asynci... |
# Copyright 2019 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tensorflow.compat.v1.name_scope",
"tensorflow.math.log",
"tensorflow.math.sqrt",
"tensorflow.where",
"tensorflow.ones_like",
"tensorflow.convert_to_tensor",
"tensorflow.zeros"
] | [((3348, 3497), 'tensorflow.compat.v1.name_scope', 'tf.compat.v1.name_scope', (['name'], {'default_name': '"""option_price"""', 'values': '[forwards, strikes, volatilities, expiries, discount_factors, is_call_options]'}), "(name, default_name='option_price', values=[forwards,\n strikes, volatilities, expiries, disco... |
import sc2, sys
from __init__ import run_ladder_game
from sc2 import Race, Difficulty
from sc2.player import Bot, Computer, Human
import random
# Load bot
from additionalpylons import MyBot
bot = Bot(Race.Protoss, MyBot())
#bot = Bot(Race.Random, ExampleBot())
#allmaps = ['AutomatonLE', 'CyberForestLE'... | [
"random.choice",
"additionalpylons.MyBot",
"__init__.run_ladder_game",
"sc2.player.Human"
] | [((568, 659), 'random.choice', 'random.choice', (['[Difficulty.CheatInsane, Difficulty.CheatMoney, Difficulty.CheatVision]'], {}), '([Difficulty.CheatInsane, Difficulty.CheatMoney, Difficulty.\n CheatVision])\n', (581, 659), False, 'import random\n'), ((768, 834), 'random.choice', 'random.choice', (['[Race.Zerg, Rac... |
import unittest
from ebadge import EBadge
class TestEBadge(unittest.TestCase):
def testA(self):
a = EBadge()
self.assertEqual(a.funcA(), 1)
def test_exec(self):
import subprocess
ans = subprocess.check_output(["python", "-m","ebadge"])
ans = ans.decode('utf8').strip()
... | [
"subprocess.check_output",
"ebadge.EBadge"
] | [((114, 122), 'ebadge.EBadge', 'EBadge', ([], {}), '()\n', (120, 122), False, 'from ebadge import EBadge\n'), ((228, 279), 'subprocess.check_output', 'subprocess.check_output', (["['python', '-m', 'ebadge']"], {}), "(['python', '-m', 'ebadge'])\n", (251, 279), False, 'import subprocess\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
"""Basic tests for the ``rs3`` module"""
import logging
import os
from tempfile import NamedTemporaryFile
import pytest
import discoursegraphs as dg
from discoursegraphs.corpora import pcc
from discoursegraphs.readwrite.rst.rs3 import RS3FileW... | [
"discoursegraphs.readwrite.rst.rs3.RSTGraph",
"discoursegraphs.readwrite.tree.t",
"discoursegraphs.readwrite.rst.rs3.RS3FileWriter",
"discoursegraphs.readwrite.rst.rs3.rs3graph.get_rst_spans",
"os.path.join",
"discoursegraphs.readwrite.rst.rs3.rs3graph.get_edus",
"discoursegraphs.select_edges_by",
"di... | [((432, 473), 'os.path.join', 'os.path.join', (['dg.DATA_ROOT_DIR', '"""rs3tree"""'], {}), "(dg.DATA_ROOT_DIR, 'rs3tree')\n", (444, 473), False, 'import os\n'), ((554, 580), 'discoursegraphs.read_rs3', 'dg.read_rs3', (['RS3_TEST_FILE'], {}), '(RS3_TEST_FILE)\n', (565, 580), True, 'import discoursegraphs as dg\n'), ((77... |
import lyfe
from flask import Flask, render_template, request
app = Flask(__name__)
song_names = []
@app.route('/search', methods=['GET', 'POST'])
def lyr():
global song_names
song_names, list_names = lyfe.run(request.form['song'])
return render_template("search.html", song_name=list_names)
@app.route('/... | [
"lyfe.run",
"flask.render_template",
"lyfe.fetch_lyrics",
"flask.Flask"
] | [((69, 84), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (74, 84), False, 'from flask import Flask, render_template, request\n'), ((211, 241), 'lyfe.run', 'lyfe.run', (["request.form['song']"], {}), "(request.form['song'])\n", (219, 241), False, 'import lyfe\n'), ((253, 305), 'flask.render_template', 're... |
from lxml import etree
def create_property_node(parentNode, key, value):
if value.startswith('"'):
propertyNode = etree.SubElement(parentNode, "Property", id=key, value=value.strip('"'), type="str")
else:
propertyNode = etree.SubElement(parentNode, "Property", id=key, value=value, type="num")
... | [
"lxml.etree.Element",
"lxml.etree.parse",
"lxml.etree.SubElement",
"lxml.etree.tostring"
] | [((475, 539), 'lxml.etree.Element', 'etree.Element', (['"""bngexperimental"""'], {'version': '"""1.1"""', 'name': 'model_name'}), "('bngexperimental', version='1.1', name=model_name)\n", (488, 539), False, 'from lxml import etree\n'), ((886, 930), 'lxml.etree.SubElement', 'etree.SubElement', (['root', '"""ListOfCompart... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
import numpy as np
import cv2
try:
import skimage.io
except ImportError:
pass
def ensure_float01(img, dtype=np.float32, copy=True):
""" Ensure that an image is encoded using a float p... | [
"cv2.imwrite",
"warnings.catch_warnings",
"xdoctest.doctest_module",
"cv2.cvtColor",
"cv2.__dict__.keys",
"warnings.simplefilter",
"cv2.imread"
] | [((6601, 6634), 'xdoctest.doctest_module', 'xdoctest.doctest_module', (['__file__'], {}), '(__file__)\n', (6624, 6634), False, 'import xdoctest\n'), ((2468, 2500), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'code'], {'dst': 'dst'}), '(img, code, dst=dst)\n', (2480, 2500), False, 'import cv2\n'), ((6443, 6468), 'cv2.imwri... |
import tensorflow as tf
from tensorflow.keras.layers import Activation, SpatialDropout1D, Lambda, UpSampling2D, AveragePooling2D
from tensorflow.keras.layers import Conv1D, BatchNormalization, LayerNormalization
class ResidualBlock(tf.keras.layers.Layer):
""" Code taken from keras-tcn implementation on available... | [
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.backend.name_scope",
"tensorflow.shape",
"tensorflow.keras.layers.SpatialDropout1D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.image.resize_with_crop_or_pad",
"tensorflow.keras.layers.Conv2D... | [((6346, 6374), 'tensorflow.keras.layers.add', 'tf.keras.layers.add', (['[x2, x]'], {}), '([x2, x])\n', (6365, 6374), True, 'import tensorflow as tf\n'), ((7719, 7751), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', (['repetitions'], {}), '(repetitions)\n', (7738, 7751), True, 'import tensorflow as tf\n'), ((976... |
from typing import Any, Dict, List, Sequence
import tanjun
from helpers.responses import Responses
from hikari.events.message_events import GuildMessageCreateEvent
from hikari.snowflakes import Snowflake
from loguru import logger
from tanjun import Client, Component
component: Component = Component(name="Roles")
@c... | [
"helpers.responses.Responses.ExpandUser",
"tanjun.inject",
"tanjun.Component"
] | [((292, 315), 'tanjun.Component', 'Component', ([], {'name': '"""Roles"""'}), "(name='Roles')\n", (301, 315), False, 'from tanjun import Client, Component\n'), ((453, 479), 'tanjun.inject', 'tanjun.inject', ([], {'type': 'Client'}), '(type=Client)\n', (466, 479), False, 'import tanjun\n'), ((510, 544), 'tanjun.inject',... |
import pytest
from metaspace.tests.utils import sm
def test_get_all_projects(sm):
projects = sm.projects.get_all_projects()
assert len(projects) > 0
def test_get_my_projects(sm):
projects = sm.projects.get_my_projects()
assert len(projects) > 0
assert all(p['currentUserRole'] for p in project... | [
"metaspace.tests.utils.sm.projects.get_project",
"metaspace.tests.utils.sm.projects.get_all_projects",
"metaspace.tests.utils.sm.projects.remove_project_external_link",
"metaspace.tests.utils.sm.projects.add_project_external_link",
"metaspace.tests.utils.sm.projects.get_my_projects"
] | [((100, 130), 'metaspace.tests.utils.sm.projects.get_all_projects', 'sm.projects.get_all_projects', ([], {}), '()\n', (128, 130), False, 'from metaspace.tests.utils import sm\n'), ((208, 237), 'metaspace.tests.utils.sm.projects.get_my_projects', 'sm.projects.get_my_projects', ([], {}), '()\n', (235, 237), False, 'from ... |
import rospy
from std_msgs.msg import String
from skeleton_markers.msg import Skeleton
import numpy as np
class SkeletonAngles():
def __init__(self):
self.pub = rospy.Publisher ('skeleton_angles', String, queue_size=10)
self.names = ['head', 'neck', 'torso', 'left_shoulder', 'left_elbow', 'left_ha... | [
"rospy.Subscriber",
"numpy.cross",
"rospy.init_node",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"numpy.arctan2",
"rospy.spin",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"rospy.Publisher"
] | [((175, 232), 'rospy.Publisher', 'rospy.Publisher', (['"""skeleton_angles"""', 'String'], {'queue_size': '(10)'}), "('skeleton_angles', String, queue_size=10)\n", (190, 232), False, 'import rospy\n'), ((656, 669), 'numpy.zeros', 'np.zeros', (['[8]'], {}), '([8])\n', (664, 669), True, 'import numpy as np\n'), ((739, 772... |
import os
from setuptools import setup, find_packages
from pycsvjson.pycsvjson import __version__ as VERSION
def read(fname):
try:
with open(os.path.join(os.path.dirname(__file__), fname)) as fh:
return fh.read()
except IOError:
return ''
requirements = read('REQUIREMENTS').splitl... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((694, 726), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests']"}), "(exclude=['tests'])\n", (707, 726), False, 'from setuptools import setup, find_packages\n'), ((168, 193), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (183, 193), False, 'import os\n')] |
import logging
log = logging.getLogger(__name__)
class PersonDetectorBase:
def initialize(self):
pass
def name(self):
return "Error - Base PersonDetector class, not for direct use"
class FakeFixedPersonDetector(PersonDetectorBase):
def initialize(self):
pass
def name(self):... | [
"logging.getLogger"
] | [((21, 48), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (38, 48), False, 'import logging\n')] |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/data/news/news_article.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.EnumValueDescriptor"
] | [((506, 532), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (530, 532), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1552, 1646), 'google.protobuf.descriptor.EnumValueDescriptor', '_descriptor.EnumValueDescriptor', ([], {'name': '"""UNSET"""', ... |
#!/usr/bin/env python
# Taken from:
# https://github.com/castorini/anserini/blob/master/src/main/python/trec-covid/index_cord19.py
import os
import shutil
import tarfile
import requests
import argparse
from bs4 import BeautifulSoup
from tqdm import tqdm
from pathlib import Path
from urllib.request import urlretrieve
... | [
"os.path.exists",
"tarfile.open",
"argparse.ArgumentParser",
"pathlib.Path",
"indexing.process_cord.get_parser",
"urllib.request.urlretrieve",
"indexing.process_cord.main",
"os.path.join",
"requests.get",
"indexing.preprocessing.fix_dates.fix_dates",
"bs4.BeautifulSoup",
"shutil.rmtree"
] | [((1057, 1101), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (1080, 1101), False, 'import argparse\n'), ((1944, 1987), 'indexing.process_cord.get_parser', 'get_indexing_parser', (['parser'], {'requires': '(False)'}), '(parser, requires=False)\n', (19... |
"""
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | [
"unittest.main"
] | [((4567, 4582), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4580, 4582), False, 'import unittest\n')] |
import Image
import os
p = "./atlas/"
d = "../Resources/fonts/"
def generate_fnt(name):
fonts = []
for f in os.listdir(p):
if f.startswith("%s_" % name):
fonts.append(Image.open(p + f))
h = fonts[0].size[1]
gap = 1
x = gap
img = Image.new("RGBA", (x + sum(map(lambda m: m.si... | [
"Image.open",
"os.listdir"
] | [((118, 131), 'os.listdir', 'os.listdir', (['p'], {}), '(p)\n', (128, 131), False, 'import os\n'), ((197, 214), 'Image.open', 'Image.open', (['(p + f)'], {}), '(p + f)\n', (207, 214), False, 'import Image\n')] |
# Učitajte sliku pomoću prethodno spomenutih metoda i promijenite vrijednost piksela na 0.
# Navedeno napravite za piksele u redku: 100 i stupac: 100, 101 i 102.
# Stvorite prozor za prikaz slike pomoću funkcije cv.namedWindow("Naslov", cv.WINDOW_FREERATIO) raširite sliku i vizualno pronađite 3 crna piksela.
import ... | [
"cv2.imshow",
"os.path.dirname",
"sys.exit",
"cv2.waitKey",
"cv2.namedWindow"
] | [((597, 642), 'cv2.namedWindow', 'cv.namedWindow', (['"""Python"""', 'cv.WINDOW_FREERATIO'], {}), "('Python', cv.WINDOW_FREERATIO)\n", (611, 642), True, 'import cv2 as cv\n'), ((643, 669), 'cv2.imshow', 'cv.imshow', (['"""Python"""', 'slika'], {}), "('Python', slika)\n", (652, 669), True, 'import cv2 as cv\n'), ((670, ... |
# Copyright 2021 The Private Cardinality Estimation Framework Authors
#
# 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 b... | [
"numpy.random.default_rng"
] | [((1878, 1907), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': '(1)'}), '(seed=1)\n', (1899, 1907), True, 'import numpy as np\n')] |
"""
These are borrowed from SciPy and used under their license:
Copyright (c) 2001, 2002 Enthought, Inc.
All rights reserved.
Copyright (c) 2003-2012 SciPy Developers.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condi... | [
"numpy.isscalar",
"numpy.ndim"
] | [((1858, 1872), 'numpy.isscalar', 'np.isscalar', (['x'], {}), '(x)\n', (1869, 1872), True, 'import numpy as np\n'), ((2629, 2646), 'numpy.isscalar', 'np.isscalar', (['t[0]'], {}), '(t[0])\n', (2640, 2646), True, 'import numpy as np\n'), ((2448, 2458), 'numpy.ndim', 'np.ndim', (['M'], {}), '(M)\n', (2455, 2458), True, '... |
from pathlib import Path
import re
# ref: https://extendsclass.com/regex/e6adb72
empty_classdef = (
r"(?P<indent1> ?)class\s*(?P<class>\s*.+\s*):(?P<LF>\r?\n)(?P<indent2> +)''\r?\n"
)
re_classdef = re.compile(empty_classdef, flags=re.MULTILINE)
repl_classdef = r"\g<indent1>class \g<class>:\g<LF>\g<indent2>def __i... | [
"pathlib.Path",
"re.compile"
] | [((204, 250), 're.compile', 're.compile', (['empty_classdef'], {'flags': 're.MULTILINE'}), '(empty_classdef, flags=re.MULTILINE)\n', (214, 250), False, 'import re\n'), ((1008, 1041), 'pathlib.Path', 'Path', (['"""./micropython-stubs/stubs"""'], {}), "('./micropython-stubs/stubs')\n", (1012, 1041), False, 'from pathlib ... |
from itertools import combinations
import numpy as np
import time
def friend_numbers_exhaustive_count(count_till_number):
friend_numbers_cnt = 0
for pair in combinations(np.arange(1,count_till_number),2):
str_1 = str(pair[0])
str_2 = str(pair[1])
# print(str_1, str_2)
if np.any(... | [
"numpy.any",
"time.time",
"numpy.arange"
] | [((439, 450), 'time.time', 'time.time', ([], {}), '()\n', (448, 450), False, 'import time\n'), ((501, 512), 'time.time', 'time.time', ([], {}), '()\n', (510, 512), False, 'import time\n'), ((179, 210), 'numpy.arange', 'np.arange', (['(1)', 'count_till_number'], {}), '(1, count_till_number)\n', (188, 210), True, 'import... |
import os
from django.core.cache import cache
from django.db.models.signals import (
pre_delete, post_save, post_delete, m2m_changed
)
from django.dispatch import receiver
from projects.models import (
ProjectAttributeFile,
Attribute,
DataRetentionPlan,
AttributeValueChoice,
FieldSetAttribute,... | [
"django.dispatch.receiver",
"django.core.cache.cache.delete"
] | [((802, 867), 'django.dispatch.receiver', 'receiver', (['[post_save, post_delete, m2m_changed]'], {'sender': 'Attribute'}), '([post_save, post_delete, m2m_changed], sender=Attribute)\n', (810, 867), False, 'from django.dispatch import receiver\n'), ((869, 942), 'django.dispatch.receiver', 'receiver', (['[post_save, pos... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found,"
"could not convert markdown README to RST")
read_md = lambda f... | [
"pypandoc.convert",
"distutils.core.setup"
] | [((1411, 1426), 'distutils.core.setup', 'setup', ([], {}), '(**config)\n', (1416, 1426), False, 'from distutils.core import setup\n'), ((158, 175), 'pypandoc.convert', 'convert', (['f', '"""rst"""'], {}), "(f, 'rst')\n", (165, 175), False, 'from pypandoc import convert\n')] |
from django.http import HttpResponseRedirect
from django.urls import reverse, reverse_lazy
from django.views.generic import CreateView, DetailView, ListView, UpdateView, DeleteView
from sheets.models import CostRecord
class CostDetailView(DetailView):
model = CostRecord
class CostListView(ListView):
model ... | [
"django.urls.reverse",
"sheets.models.CostRecord.objects.filter",
"django.urls.reverse_lazy"
] | [((1245, 1277), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""sheets:cost-list"""'], {}), "('sheets:cost-list')\n", (1257, 1277), False, 'from django.urls import reverse, reverse_lazy\n'), ((377, 475), 'sheets.models.CostRecord.objects.filter', 'CostRecord.objects.filter', ([], {'project': 'self.request.user.curren... |
########################################################
# <NAME> - drigols #
# Last update: 17/12/2021 #
########################################################
from collections import Counter
simplelist = [7, 8, 9, 2, 10, 9, 9, 9, 9, 4, 5, 6, 1, 5, 6, 7, 8,... | [
"collections.Counter"
] | [((336, 355), 'collections.Counter', 'Counter', (['simplelist'], {}), '(simplelist)\n', (343, 355), False, 'from collections import Counter\n')] |
"""
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, distri... | [
"world.definitions.chardefs.get_random_occupation",
"evennia.utils.create.create_object",
"random.randint",
"evennia.prototypes.spawner.spawn"
] | [((1899, 1926), 'random.randint', 'random.randint', (['(1)', 'die_type'], {}), '(1, die_type)\n', (1913, 1926), False, 'import random\n'), ((4326, 4349), 'world.definitions.chardefs.get_random_occupation', 'get_random_occupation', ([], {}), '()\n', (4347, 4349), False, 'from world.definitions.chardefs import get_random... |
import numpy as N
from traits.api import (HasTraits, Array, Range, Instance, Enum)
from traitsui.api import View, Item
from chaco.api import (ArrayPlotData, Plot, PlotLabel, ColorMapper, gray, pink,
jet)
from chaco.default_colormaps import fix
from enable.api import ComponentEditor
from AwesomeColorMaps import awes... | [
"traits.api.Instance",
"traits.api.Enum",
"chaco.api.ArrayPlotData",
"traits.api.Array",
"chaco.api.Plot",
"numpy.array",
"numpy.zeros",
"traits.api.Range",
"chaco.default_colormaps.fix",
"enable.api.ComponentEditor",
"numpy.rot90",
"chaco.api.PlotLabel",
"chaco.api.ColorMapper.from_segment_... | [((805, 866), 'chaco.api.ColorMapper.from_segment_map', 'ColorMapper.from_segment_map', (['_bone_data'], {'range': 'rng'}), '(_bone_data, range=rng, **traits)\n', (833, 866), False, 'from chaco.api import ArrayPlotData, Plot, PlotLabel, ColorMapper, gray, pink, jet\n'), ((911, 918), 'traits.api.Array', 'Array', ([], {}... |
'''
Define a simple neural net in Keras that recognizes MNIST handwritten digits
'''
from __future__ import print_function
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.optimizers import SGD
from keras.utils import np_u... | [
"keras.layers.core.Activation",
"keras.datasets.mnist.load_data",
"keras.models.Sequential",
"keras.utils.np_utils.to_categorical",
"keras.optimizers.SGD",
"numpy.random.seed",
"keras.layers.core.Dense"
] | [((325, 345), 'numpy.random.seed', 'np.random.seed', (['(1671)'], {}), '(1671)\n', (339, 345), True, 'import numpy as np\n'), ((441, 446), 'keras.optimizers.SGD', 'SGD', ([], {}), '()\n', (444, 446), False, 'from keras.optimizers import SGD\n'), ((525, 542), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {})... |
## What is Lambda : anonymous function or function without name
## Usecase is you can pass a function as an argument, quick function
# def double(num):
# x = num + num
# return x
# print(double(6))
# lambda num: num + num
# x = lambda a : a + 10
# print(x(5))
#Example 2
# my_list = [1, 5, 4, 6, 8, 11, 3... | [
"pandas.DataFrame"
] | [((562, 711), 'pandas.DataFrame', 'pd.DataFrame', (["{'Name': ['Luke', 'Gina', 'Sam', 'Emma'], 'Status': ['Father', 'Mother',\n 'Son', 'Daughter'], 'Birthyear': [1976, 1984, 2013, 2016]}"], {}), "({'Name': ['Luke', 'Gina', 'Sam', 'Emma'], 'Status': ['Father',\n 'Mother', 'Son', 'Daughter'], 'Birthyear': [1976, 19... |
import enum
import random
from typing import Dict, Iterable, List, Tuple, Optional, NamedTuple
from emoji import descriptions, spec_parser
from emoji.core import Emoji, Gender, Modifier
from syllables import count_syllables
def _load_resources() -> Tuple[Dict[Emoji, str], List[Modifier]]:
"""Loads emojis and des... | [
"emoji.descriptions.load_descriptions_for_emojis",
"random.choice",
"enum.auto",
"syllables.count_syllables",
"emoji.spec_parser.load_emoji_and_modifiers"
] | [((363, 401), 'emoji.spec_parser.load_emoji_and_modifiers', 'spec_parser.load_emoji_and_modifiers', ([], {}), '()\n', (399, 401), False, 'from emoji import descriptions, spec_parser\n'), ((3516, 3527), 'enum.auto', 'enum.auto', ([], {}), '()\n', (3525, 3527), False, 'import enum\n'), ((3543, 3554), 'enum.auto', 'enum.a... |
import os
import http.cookiejar
import datetime
from datetime import datetime
import requests
import time
import mutagen
from mutagen import *
from mutagen.easyid3 import EasyID3
from mutagen.flac import FLAC
import json
from tqdm import tqdm
from pydub import AudioSegment
from pathlib import Path
import ... | [
"os.path.exists",
"json.loads",
"datetime.datetime.fromtimestamp",
"mutagen.File",
"urllib.parse.urlparse",
"os.makedirs",
"mutagen.flac.FLAC",
"tqdm.tqdm",
"os.path.isfile",
"re.sub",
"pydub.AudioSegment.from_wav",
"os.remove"
] | [((1397, 1413), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (1407, 1413), False, 'import json\n'), ((1466, 1519), 're.sub', 're.sub', (['"""\\\\<|\\\\>|\\\\:|"|\\\\/|\\\\|\\\\||\\\\?|\\\\*"""', '""""""', 'title'], {}), '(\'\\\\<|\\\\>|\\\\:|"|\\\\/|\\\\|\\\\||\\\\?|\\\\*\', \'\', title)\n', (1472, 1519), Fa... |
"""Unit tests for Coptic NLP"""
import io, re, os, sys
from collections import defaultdict
from six import iterkeys
script_dir = os.path.dirname(os.path.realpath(__file__)) + os.sep
data_dir = script_dir + "data" + os.sep
lib_dir = script_dir + "lib" + os.sep
from coptic_nlp import nlp_coptic
from lib.stacked_tokeni... | [
"io.open",
"os.path.realpath",
"lib.stacked_tokenizer.StackedTokenizer",
"sys.stderr.write",
"collections.defaultdict",
"re.sub",
"six.iterkeys",
"coptic_nlp.nlp_coptic"
] | [((2808, 2835), 're.sub', 're.sub', (['"""\\\\t+"""', '"""\t"""', 'lines'], {}), "('\\\\t+', '\\t', lines)\n", (2814, 2835), False, 'import io, re, os, sys\n'), ((147, 173), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (163, 173), False, 'import io, re, os, sys\n'), ((436, 453), 'collecti... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
# Command line :
# python -m benchmark.AP1.explore
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as... | [
"matplotlib.pyplot.hist",
"matplotlib.pyplot.savefig",
"os.makedirs",
"matplotlib.pyplot.ylabel",
"visual.set_plot_config",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.path.join",
"matplotlib.pyplot.clf",
"numpy.min",
"numpy.max",
"numpy.linspace",
"visual.likelihood.plot_param... | [((361, 378), 'visual.set_plot_config', 'set_plot_config', ([], {}), '()\n', (376, 378), False, 'from visual import set_plot_config\n'), ((580, 631), 'os.path.join', 'os.path.join', (['SAVING_DIR', 'BENCHMARK_NAME', '"""explore"""'], {}), "(SAVING_DIR, BENCHMARK_NAME, 'explore')\n", (592, 631), False, 'import os\n'), (... |
import copy
def parse_lines(input_text):
action = input_text.split(" ")[0]
amount = int(input_text.split(" ")[1])
return [action, amount, 0]
def run_game(input_file):
acc = 0
index = 0
curr = input_file[index]
curr[2] += 1
while curr[2] <= 1 and index < len(input_file):
actio... | [
"copy.deepcopy"
] | [((1041, 1066), 'copy.deepcopy', 'copy.deepcopy', (['input_file'], {}), '(input_file)\n', (1054, 1066), False, 'import copy\n')] |
#!/usr/bin/python3
"""
Offers support for WS2812 LED LEDs via the hardware SPI MOSI
"""
import time
import datetime
from ws2812 import *
from izaber import initialize, config
from PIL import Image, ImageFilter, ImageFont, ImageDraw
if __name__ == "__main__":
spi = spidev.SpiDev()
spi.open(1,0)
LEDS ... | [
"PIL.Image.new",
"PIL.ImageFont.truetype",
"time.sleep",
"datetime.datetime.now",
"PIL.ImageDraw.Draw"
] | [((668, 720), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['"""fonts/notalot/notalot25.ttf"""', '(8)'], {}), "('fonts/notalot/notalot25.ttf', 8)\n", (686, 720), False, 'from PIL import Image, ImageFilter, ImageFont, ImageDraw\n'), ((793, 816), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (81... |
import discord
import random, os, time
import colorama, datetime, requests
from discord import Embed, File
from discord.ext import commands
from colorama import Fore
from colorama import init
init()
class Stock(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
... | [
"discord.ext.commands.Cog.listener",
"discord.ext.commands.has_role",
"discord.Embed",
"discord.ext.commands.command",
"colorama.init"
] | [((199, 205), 'colorama.init', 'init', ([], {}), '()\n', (203, 205), False, 'from colorama import init\n'), ((294, 317), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (315, 317), False, 'from discord.ext import commands\n'), ((428, 451), 'discord.ext.commands.Cog.listener', 'commands.C... |
import re
from . import dun_string_reader as dsr
subsection_types = {'tspan' : ['dun', 'tspan' ],
'states' : ['dun', 'states' ],
'params' : ['dun', 'params' ],
'rxns' : ['dun', 'rxn... | [
"re.sub",
"re.findall"
] | [((2428, 2483), 're.sub', 're.sub', (['pattern', 'replace_shorthand', 'element'], {'flags': 're.M'}), '(pattern, replace_shorthand, element, flags=re.M)\n', (2434, 2483), False, 'import re\n'), ((4111, 4168), 're.findall', 're.findall', (['"""([^$?]*)([$?])([^$?]*)"""', 'element'], {'flags': 're.S'}), "('([^$?]*)([$?])... |
'''
Created on July 05, 2015
@author: <NAME><<EMAIL>>
'''
import argparse
from urllib.parse import unquote
from compose_corpus import DocumentCorpus
def rename_corpus_with_map(corpus, mapping):
for i, document in enumerate(corpus._documents):
index = document[1].rsplit("_",2)[-1]
corpus._document... | [
"argparse.FileType",
"compose_corpus.DocumentCorpus",
"argparse.ArgumentParser"
] | [((421, 446), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (444, 446), False, 'import argparse\n'), ((1141, 1157), 'compose_corpus.DocumentCorpus', 'DocumentCorpus', ([], {}), '()\n', (1155, 1157), False, 'from compose_corpus import DocumentCorpus\n'), ((622, 666), 'argparse.FileType', 'argpa... |
# coding:utf-8
import hashlib
import json
import socketserver
import pickle
import threading
import random
import time
from binascii import Error
import zlib
import db
from blockchain import Blockchain
from p2p import constant
from p2p.kbucketset import KBucketSet
from p2p.nearestnodes import KNearestNodesUtil
from ... | [
"p2p.kbucketset.KBucketSet",
"pickle.dumps",
"p2p.packet.FoundNeighbors",
"time.sleep",
"db.get_block_height",
"random.getrandbits",
"p2p.packet.Store",
"p2p.packet.Ping",
"db.write_unconfirmed_tx_to_db",
"p2p.packet.FindNeighbors",
"threading.Lock",
"p2p.packet.Pong",
"json.dumps",
"zlib.... | [((8696, 8751), 'socketserver.UDPServer.__init__', 'socketserver.UDPServer.__init__', (['self', 'address', 'handler'], {}), '(self, address, handler)\n', (8727, 8751), False, 'import socketserver\n'), ((8772, 8788), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (8786, 8788), False, 'import threading\n'), ((9089... |
import os
from experiments.experiments import ModelSelectionExperiment
from nilmlab.lab import TimeSeriesLength
dirname = os.path.dirname(__file__)
single_building_exp_checkpoint = os.path.join(dirname, '../results/cv1h.csv')
exp = ModelSelectionExperiment(cv=5)
exp.set_ts_len(TimeSeriesLength.WINDOW_1_HOUR)
exp.set... | [
"os.path.dirname",
"os.path.join",
"experiments.experiments.ModelSelectionExperiment"
] | [((124, 149), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (139, 149), False, 'import os\n'), ((183, 227), 'os.path.join', 'os.path.join', (['dirname', '"""../results/cv1h.csv"""'], {}), "(dirname, '../results/cv1h.csv')\n", (195, 227), False, 'import os\n'), ((235, 265), 'experiments.exper... |
"""Handles Firehose API requests, invokes method and returns response."""
import json
from moto.core.responses import BaseResponse
from .models import firehose_backends
class FirehoseResponse(BaseResponse):
"""Handler for Firehose requests and responses."""
@property
def firehose_backend(self):
... | [
"json.dumps"
] | [((1335, 1389), 'json.dumps', 'json.dumps', (["{'DeliveryStreamARN': delivery_stream_arn}"], {}), "({'DeliveryStreamARN': delivery_stream_arn})\n", (1345, 1389), False, 'import json\n'), ((1673, 1687), 'json.dumps', 'json.dumps', (['{}'], {}), '({})\n', (1683, 1687), False, 'import json\n'), ((2047, 2065), 'json.dumps'... |
#(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
Runs Minimap2 and parses its output
"""
import os
import re
import sys
from collections import namedtuple, defaultdict
import subprocess
import logging
import multiprocessing
import ctypes
import abru... | [
"logging.getLogger",
"abruijn.fasta_parser.read_fasta_dict",
"abruijn.utils.which",
"collections.namedtuple",
"os.path.exists",
"re.compile",
"os.rename",
"multiprocessing.Value",
"os.environ.copy",
"multiprocessing.Lock",
"os.remove"
] | [((418, 437), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (435, 437), False, 'import logging\n'), ((484, 665), 'collections.namedtuple', 'namedtuple', (['"""Alignment"""', "['qry_id', 'trg_id', 'qry_start', 'qry_end', 'qry_sign', 'qry_len',\n 'trg_start', 'trg_end', 'trg_sign', 'trg_len', 'qry_seq', ... |
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.contrib.contenttypes.fields import GenericRelation
from comment.models import Comment
class Post(models.Model):
author = models.ForeignKey(get_user_model(),on_delete=models.CASCADE, related_name... | [
"django.contrib.auth.get_user_model",
"django.db.models.TextField",
"django.db.models.DateTimeField",
"django.db.models.URLField",
"django.db.models.CharField",
"django.contrib.contenttypes.fields.GenericRelation"
] | [((341, 359), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (357, 359), False, 'from django.db import models\n'), ((374, 413), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (394, 413), False, 'from django.db import models\n'), ... |
########################################################################################
#Created by <NAME> #
#Purpose:Was cleaning my laptop and had more than 300+ files in my downloads folder #
# decided to write a simple program(which took me 2 w... | [
"tkinter.filedialog.askdirectory",
"os.listdir",
"platform.node",
"winutils.copy",
"webbrowser.open",
"os.getcwd",
"os.chdir",
"winutils.move",
"tkinter.Tk",
"os.mkdir"
] | [((968, 975), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (973, 975), True, 'import tkinter as tk\n'), ((1229, 1240), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1238, 1240), False, 'import os\n'), ((1258, 1284), 'os.listdir', 'os.listdir', (['initial_folder'], {}), '(initial_folder)\n', (1268, 1284), False, 'import os\n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Includes the EPrime data source class."""
# TODO(janmtl): Provide an interface that deuglifies the _0 and channels in this
# interface
import pandas as pd
import io
import numpy as np
from data_source import DataSource
from schema import Schema, Or
from utils import me... | [
"schema.Schema",
"pandas.DataFrame.from_dict",
"io.open",
"schema.Or",
"utils.merge_and_rename_columns"
] | [((3729, 3747), 'schema.Schema', 'Schema', (['{str: str}'], {}), '({str: str})\n', (3735, 3747), False, 'from schema import Schema, Or\n'), ((869, 923), 'io.open', 'io.open', (["file_paths['samples']", '"""r"""'], {'encoding': '"""utf-16"""'}), "(file_paths['samples'], 'r', encoding='utf-16')\n", (876, 923), False, 'im... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = '<NAME>'
from utils import data_loader as data_loader
from models import mining_invariants as mi
para = {
'path':'../../Data/BGL_data/', # directory for input data
'log_file_name':'BGL_MERGED.log', # filename for log data file
'log_e... | [
"models.mining_invariants.invariant_search",
"models.mining_invariants.deepia_evaluate",
"utils.data_loader.deepia_preprocess_data",
"models.mining_invariants.estimate_invar_spce",
"utils.data_loader.deepia_data_loader"
] | [((1303, 1339), 'utils.data_loader.deepia_data_loader', 'data_loader.deepia_data_loader', (['para'], {}), '(para)\n', (1333, 1339), True, 'from utils import data_loader as data_loader\n'), ((1362, 1432), 'utils.data_loader.deepia_preprocess_data', 'data_loader.deepia_preprocess_data', (['para', 'raw_data', 'event_mappi... |
""" Module containing classes that interfaces neural network policies
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
from aizynthfinder.chem import RetroReaction
from aizynthfinder.utils.models import load_model
from aizynthfinder.context.collection impo... | [
"aizynthfinder.utils.models.load_model",
"numpy.argsort",
"aizynthfinder.chem.RetroReaction",
"numpy.argmin",
"numpy.cumsum",
"pandas.read_hdf"
] | [((4164, 4219), 'aizynthfinder.utils.models.load_model', 'load_model', (['source', 'key', 'self._config.use_remote_models'], {}), '(source, key, self._config.use_remote_models)\n', (4174, 4219), False, 'from aizynthfinder.utils.models import load_model\n'), ((4332, 4366), 'pandas.read_hdf', 'pd.read_hdf', (['templatefi... |
import os
import matplotlib.pyplot as plt
import numpy as np
def load_data(fpath=''):
if len(fpath) == 0:
fpaths = ['data/BF_CTU.csv', 'data/BF_V.csv', 'data/BF_OU.csv']
else:
fpaths = fpath
honest_data = []
dishonest_data = []
for fpath in fpaths:
header = True
f... | [
"matplotlib.pyplot.grid",
"numpy.argsort",
"numpy.array",
"numpy.linalg.norm",
"numpy.arange",
"numpy.mean",
"os.path.exists",
"numpy.where",
"matplotlib.pyplot.xlabel",
"numpy.dot",
"matplotlib.pyplot.ylim",
"numpy.abs",
"numpy.ceil",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca"... | [((2210, 2236), 'numpy.arange', 'np.arange', (['(50)', '(100)'], {'step': '(1)'}), '(50, 100, step=1)\n', (2219, 2236), True, 'import numpy as np\n'), ((3192, 3229), 'numpy.array', 'np.array', (['hdata_train'], {'dtype': 'np.float'}), '(hdata_train, dtype=np.float)\n', (3200, 3229), True, 'import numpy as np\n'), ((324... |
from django.db import models
from django.db.models.fields.related import ForeignKey
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class Type(models.Model):
name = models.CharField(max_length=125)
class Meta:
verb... | [
"django.utils.translation.ugettext_lazy",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.fields.related.ForeignKey",
"django.db.models.CharField"
] | [((254, 286), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(125)'}), '(max_length=125)\n', (270, 286), False, 'from django.db import models\n'), ((568, 600), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (584, 600), False, 'from django.d... |
from abc import abstractmethod
from numpy import eye, shape
from numpy.linalg import pinv
class Kernel(object):
def __init__(self):
pass
@abstractmethod
def kernel(self, X, Y=None):
raise NotImplementedError()
@staticmethod
def centering_matrix(n):
"""
Returns th... | [
"numpy.shape",
"numpy.eye"
] | [((383, 389), 'numpy.eye', 'eye', (['n'], {}), '(n)\n', (386, 389), False, 'from numpy import eye, shape\n'), ((569, 577), 'numpy.shape', 'shape', (['K'], {}), '(K)\n', (574, 577), False, 'from numpy import eye, shape\n'), ((593, 599), 'numpy.eye', 'eye', (['n'], {}), '(n)\n', (596, 599), False, 'from numpy import eye,... |
# -*- coding: UTF-8 -*-
import tornado.web
import json
from qcinfo import D, gtimg, sina
class DailyLineHandler(tornado.web.RequestHandler):
def get(self):
code = self.get_argument("code")
if code is None or code == '':
self.write('')
self.write(D.quotes(code, type="d").to_json... | [
"qcinfo.D.company_info_async",
"qcinfo.gtimg.daily_lately_async",
"qcinfo.D.quotes",
"qcinfo.sina.quotes_async"
] | [((1204, 1235), 'qcinfo.gtimg.daily_lately_async', 'gtimg.daily_lately_async', (['query'], {}), '(query)\n', (1228, 1235), False, 'from qcinfo import D, gtimg, sina\n'), ((1045, 1071), 'qcinfo.D.company_info_async', 'D.company_info_async', (['code'], {}), '(code)\n', (1065, 1071), False, 'from qcinfo import D, gtimg, s... |
from aoc20201205a import seats
def aoc(data):
next = 0
for seat in sorted(seats(data)):
if seat == next:
return seat - 1
next = seat + 2
| [
"aoc20201205a.seats"
] | [((84, 95), 'aoc20201205a.seats', 'seats', (['data'], {}), '(data)\n', (89, 95), False, 'from aoc20201205a import seats\n')] |
#!/usr/bin/env python3
import unittest
import torch
from torch.distributions import Distribution
from Lgpytorch.distributions import MultitaskMultivariateNormal, MultivariateNormal
from Lgpytorch.likelihoods import SoftmaxLikelihood
from Lgpytorch.test.base_likelihood_test_case import BaseLikelihoodTestCase
class ... | [
"torch.is_tensor",
"torch.tensor",
"Lgpytorch.likelihoods.SoftmaxLikelihood",
"torch.Size",
"torch.randn"
] | [((452, 466), 'torch.Size', 'torch.Size', (['[]'], {}), '([])\n', (462, 466), False, 'import torch\n'), ((484, 515), 'torch.randn', 'torch.randn', (['*batch_shape', '(5)', '(6)'], {}), '(*batch_shape, 5, 6)\n', (495, 515), False, 'import torch\n'), ((566, 580), 'torch.Size', 'torch.Size', (['[]'], {}), '([])\n', (576, ... |
#==================================================
import socket
import multiprocessing
#============== L2ST CLASS ==============
class L2SocketTool:
#============== L2ST ATTRIBUTES ==============
l2stBuffer = None
l2stLock = None
l2stNetInterface = None
#l2sfnshtBuffer = Shared Multiprocessing List
#l2sfn... | [
"socket.htons",
"socket.socket"
] | [((944, 992), 'socket.socket', 'socket.socket', (['socket.AF_PACKET', 'socket.SOCK_RAW'], {}), '(socket.AF_PACKET, socket.SOCK_RAW)\n', (957, 992), False, 'import socket\n'), ((706, 721), 'socket.htons', 'socket.htons', (['(3)'], {}), '(3)\n', (718, 721), False, 'import socket\n')] |
import random
def hp_count(race_name):
if race_name == 'human':
return 200
elif race_name == 'orc':
return 400
elif race_name == 'elf':
return 150
elif race_name == 'undead':
return 175
else:
return 200
def hit_power_count(class_name):
if class_name == '... | [
"random.random"
] | [((1417, 1432), 'random.random', 'random.random', ([], {}), '()\n', (1430, 1432), False, 'import random\n'), ((1692, 1707), 'random.random', 'random.random', ([], {}), '()\n', (1705, 1707), False, 'import random\n')] |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
import timeit
from collections import defaultdict, Counter
from typing import List, Set
from maro.data_lib import BinaryReader
from maro.simulator.scenarios.vm_scheduling import PostponeAction, AllocateAction
from maro.simulat... | [
"maro.data_lib.BinaryReader",
"common.IlpPmCapacity",
"collections.Counter",
"maro.simulator.scenarios.vm_scheduling.PostponeAction",
"maro.simulator.scenarios.vm_scheduling.AllocateAction",
"collections.defaultdict",
"vm_scheduling_ilp.VmSchedulingILP",
"common.IlpVmInfo"
] | [((949, 958), 'collections.Counter', 'Counter', ([], {}), '()\n', (956, 958), False, 'from collections import defaultdict, Counter\n'), ((1083, 1185), 'vm_scheduling_ilp.VmSchedulingILP', 'VmSchedulingILP', ([], {'config': 'ilp_config', 'pm_capacity': 'pm_capacity', 'logger': 'ilp_logger', 'log_path': 'log_path'}), '(c... |
# vim:fileencoding=UTF-8
#
# Copyright © 2015, 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 with modifications
# and the "Commons Clause" Condition, (the "License"); you may not
# use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# https://raw.githubu... | [
"django.http.HttpResponseRedirect",
"django.conf.urls.include"
] | [((1835, 1859), 'django.conf.urls.include', 'include', (['"""durak_ws.urls"""'], {}), "('durak_ws.urls')\n", (1842, 1859), False, 'from django.conf.urls import include, url\n'), ((1919, 1989), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (["(settings.STATIC_URL + 'durak/images/favicon.ico')"], {}), "(set... |
"""
Copyright 2017 Brocade Communications Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | [
"logging.getLogger",
"os.path.exists",
"logging.basicConfig",
"asyncore.dispatcher.__init__",
"os.getenv",
"argparse.ArgumentParser",
"timeit.default_timer",
"logging.config.dictConfig",
"asyncore.loop",
"collector_handler.CollectorHandler"
] | [((1557, 1593), 'logging.getLogger', 'logging.getLogger', (['"""CollectorServer"""'], {}), "('CollectorServer')\n", (1574, 1593), False, 'import logging\n'), ((1125, 1149), 'os.getenv', 'os.getenv', (['env_key', 'None'], {}), '(env_key, None)\n', (1134, 1149), False, 'import os\n'), ((1244, 1264), 'os.path.exists', 'os... |
#!/usr/bin/python3
import asyncio
import os
import re
import aiohttp
from github_stats import Stats
################################################################################
# Helper Functions
################################################################################
def generate_outpu... | [
"aiohttp.ClientSession",
"os.getenv",
"os.path.isdir",
"os.mkdir",
"re.sub",
"github_stats.Stats"
] | [((962, 1004), 're.sub', 're.sub', (['"""{{ name }}"""', '(await s.name)', 'output'], {}), "('{{ name }}', await s.name, output)\n", (968, 1004), False, 'import re\n'), ((1019, 1075), 're.sub', 're.sub', (['"""{{ stars }}"""', 'f"""{await s.stargazers:,}"""', 'output'], {}), "('{{ stars }}', f'{await s.stargazers:,}', ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
# Copyright 1998-2018 by authors (see AUTHORS.txt)
#
# This file is part of LuxCoreRender.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | [
"logging.getLogger",
"pyluxcoretools.renderfarm.renderfarmjobsingleimage.RenderFarmJobSingleImage",
"PySide.QtGui.QApplication.desktop",
"pyluxcoretools.utils.uiloghandler.AddUILogHandler",
"pyluxcore.Init",
"pyluxcore.SetLogHandler",
"pyluxcore.Version",
"pyluxcoretools.renderfarm.renderfarm.RenderFa... | [((1401, 1466), 'logging.getLogger', 'logging.getLogger', (["(loghandler.loggerName + '.luxcorenetconsoleui')"], {}), "(loghandler.loggerName + '.luxcorenetconsoleui')\n", (1418, 1466), False, 'import logging\n'), ((6574, 6602), 'PySide.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (659... |
import pytest
import logging
from ocs_ci.framework import config
from ocs_ci.framework.pytest_customization.marks import (
polarion_id,
pre_upgrade,
skipif_aws_i3,
skipif_bm,
skipif_external_mode,
skipif_bmpsi,
skipif_ibm_power,
)
from ocs_ci.framework.testlib import (
ignore_leftovers,... | [
"logging.getLogger",
"ocs_ci.ocs.resources.storage_cluster.osd_encryption_verification",
"ocs_ci.ocs.cluster.CephCluster",
"ocs_ci.framework.testlib.skipif_ocs_version",
"ocs_ci.framework.config.ENV_DATA.get",
"ocs_ci.ocs.resources.storage_cluster.add_capacity",
"ocs_ci.ocs.resources.storage_cluster.get... | [((847, 874), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (864, 874), False, 'import logging\n'), ((2631, 2654), 'ocs_ci.framework.pytest_customization.marks.polarion_id', 'polarion_id', (['"""OCS-1191"""'], {}), "('OCS-1191')\n", (2642, 2654), False, 'from ocs_ci.framework.pytest_cust... |
# Generated by Django 2.1.2 on 2019-01-30 16:23
from django.db import migrations, models
import django.db.models.deletion
import mrp_system.models
class Migration(migrations.Migration):
dependencies = [
('mrp_system', '0072_auto_20190130_1515'),
]
operations = [
migrations.CreateModel(
... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.DecimalField"
] | [((985, 1086), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': '(2)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""mrp_system.Vendor"""'}), "(default=2, on_delete=django.db.models.deletion.CASCADE,\n to='mrp_system.Vendor')\n", (1002, 1086), False, 'from django.db import migration... |
import tweepy
import os
from utilities.time_management import *
from utilities.config import *
import django
os.environ["DJANGO_SETTINGS_MODULE"] = "portal.settings"
django.setup()
from details.models import Entities, Topic
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ... | [
"django.setup",
"details.models.Entities.objects.filter",
"details.models.Topic.objects.get",
"tweepy.API",
"tweepy.OAuthHandler"
] | [((166, 180), 'django.setup', 'django.setup', ([], {}), '()\n', (178, 180), False, 'import django\n'), ((233, 283), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (['CONSUMER_KEY', 'CONSUMER_SECRET'], {}), '(CONSUMER_KEY, CONSUMER_SECRET)\n', (252, 283), False, 'import tweepy\n'), ((700, 716), 'tweepy.API', 'tweepy.API'... |
import json
import logging
import queue
import threading
import time
from queue import Queue
import sched, datetime
from django.db.models import Max
from background_job.models import DjangoJob, JobExecHistory
from background_job.utils import get_max_job_version, log_job_history, log_action
logger = logging.getLogge... | [
"logging.getLogger",
"background_job.utils.log_job_history",
"background_job.utils.log_action",
"time.sleep",
"datetime.datetime.now",
"background_job.models.DjangoJob.objects.filter",
"sched.scheduler",
"django.db.models.Max",
"background_job.utils.get_max_job_version"
] | [((304, 323), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (321, 323), False, 'import logging\n'), ((611, 649), 'sched.scheduler', 'sched.scheduler', (['time.time', 'time.sleep'], {}), '(time.time, time.sleep)\n', (626, 649), False, 'import sched, datetime\n'), ((968, 989), 'background_job.utils.get_max_... |
import os
from buildbot.plugins import worker
from buildbot.plugins import reporters
def setup_global_config(c):
####### PROJECT IDENTITY
c['title'] = "Natural Intelligence"
c['titleURL'] = "http://www.naturalint.com/"
c['buildbotURL'] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
... | [
"os.environ.get",
"buildbot.plugins.worker.Worker"
] | [((255, 315), 'os.environ.get', 'os.environ.get', (['"""BUILDBOT_WEB_URL"""', '"""http://localhost:8010/"""'], {}), "('BUILDBOT_WEB_URL', 'http://localhost:8010/')\n", (269, 315), False, 'import os\n'), ((833, 867), 'buildbot.plugins.worker.Worker', 'worker.Worker', (['"""build-npm"""', '"""pass"""'], {}), "('build-npm... |
"""Methods used to create systems from job statepoint."""
import mbuild as mb
from mbuild.lib.molecules.water import WaterSPC
from reproducibility_project.src.molecules.methane_ua import MethaneUA
from reproducibility_project.src.molecules.pentane_ua import PentaneUA
def construct_system(sp, scale=1.0):
"""Const... | [
"reproducibility_project.src.molecules.pentane_ua.PentaneUA",
"mbuild.Box",
"mbuild.lib.molecules.water.WaterSPC",
"reproducibility_project.src.molecules.methane_ua.MethaneUA",
"mbuild.fill_box"
] | [((1658, 1695), 'mbuild.Box', 'mb.Box', (["([sp['box_L_liq'] * scale] * 3)"], {}), "([sp['box_L_liq'] * scale] * 3)\n", (1664, 1695), True, 'import mbuild as mb\n'), ((1717, 1792), 'mbuild.fill_box', 'mb.fill_box', ([], {'compound': '[molecule]', 'n_compounds': "[sp['N_liquid']]", 'box': 'liq_box'}), "(compound=[molecu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import nibabel as nb
import numpy as np
import image_funcs as imf
import vis_funcs as vf
def main():
SHOW_WINDOW = True
SHOW_AXES = True
COMP_ACT_SEED = True
SEED_OFFSET = 25
data_dir = os.environ.get('OneDrive') + r'\data\dti_navigation... | [
"numpy.identity",
"image_funcs.coil_transform_matrix",
"vis_funcs.add_line",
"image_funcs.load_mks",
"image_funcs.load_image",
"numpy.hstack",
"numpy.cross",
"vis_funcs.add_marker",
"os.environ.get",
"os.path.join",
"image_funcs.grid_offset",
"image_funcs.create_grid",
"image_funcs.mri2inv",... | [((634, 685), 'os.path.join', 'os.path.join', (['data_dir', "(filenames['MKSS'] + '.mkss')"], {}), "(data_dir, filenames['MKSS'] + '.mkss')\n", (646, 685), False, 'import os\n'), ((706, 759), 'os.path.join', 'os.path.join', (['data_dir', "(filenames['HEADSIM'] + '.stl')"], {}), "(data_dir, filenames['HEADSIM'] + '.stl'... |
from labelserver.printer import Printer, LabelType, Job
from labelserver.transports import TCPTransport
import labelserver.utils
import time
import yaml
class CognitiveLbt42Printer(Printer):
default_config = {
"job_delay": 1,
"port": 9100
}
def __init__(self, id, config):
super(Cog... | [
"labelserver.transports.TCPTransport",
"time.sleep"
] | [((455, 513), 'labelserver.transports.TCPTransport', 'TCPTransport', (["self.config['hostname']", "self.config['port']"], {}), "(self.config['hostname'], self.config['port'])\n", (467, 513), False, 'from labelserver.transports import TCPTransport\n'), ((734, 770), 'time.sleep', 'time.sleep', (["self.config['job_delay']... |
# Generated by Django 2.2.11 on 2020-05-26 10:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('database', '0006_auto_20200522_1329'),
]
operations = [
migrations.CreateModel(
name='DateFiel... | [
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((375, 543), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'auto_created': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'parent_link': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'to': '"""database.Field"""'}), "(auto_created=True, on_delete=django.db.models.deletion\n ... |
import pandas as pd
import numpy as np
import glob
import sys
import re
from astropy.cosmology import Planck15 as cosmo
import rate_functions as functions ### Mike's code
import astropy.units as u
import scipy
#---------------------------------------------------------------... | [
"numpy.log10",
"astropy.cosmology.Planck15.H",
"astropy.cosmology.Planck15.lookback_time",
"numpy.where",
"numpy.sum",
"numpy.linspace",
"rate_functions.metal_disp_z",
"pandas.read_hdf",
"numpy.random.uniform",
"pandas.DataFrame",
"re.findall",
"rate_functions.sfr_z",
"astropy.cosmology.Plan... | [((8212, 8234), 'glob.glob', 'glob.glob', (['COSMIC_path'], {}), '(COSMIC_path)\n', (8221, 8234), False, 'import glob\n'), ((8344, 8373), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'columns'}), '(columns=columns)\n', (8356, 8373), True, 'import pandas as pd\n'), ((8958, 9013), 'numpy.linspace', 'np.linspace',... |
"""
Classes for Bayesian optimization
Created on Jul 9, 2019
@author: <NAME> (<EMAIL>)
Copyright 2019 Xilinx, Inc.
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 ... | [
"opentuner.search.differentialevolution.DifferentialEvolutionAlt",
"numpy.prod",
"opentuner.search.evolutionarytechniques.UniformGreedyMutation",
"scipy.stats.norm.pdf",
"math.isinf",
"opentuner.search.evolutionarytechniques.NormalGreedyMutation",
"opentuner.search.simplextechniques.RandomNelderMead",
... | [((5352, 5369), 'numpy.prod', 'numpy.prod', (['probs'], {}), '(probs)\n', (5362, 5369), False, 'import numpy\n'), ((5707, 5729), 'math.isinf', 'math.isinf', (['expec_impr'], {}), '(expec_impr)\n', (5717, 5729), False, 'import math\n'), ((5733, 5755), 'math.isnan', 'math.isnan', (['expec_impr'], {}), '(expec_impr)\n', (... |