code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/python
import os
os.system("sudo apt-get update")
os.system("sudo apt-get install aircrack-ng")
os.system("sudo apt install ethtool")
os.system("sudo apt install rfkill") | [
"os.system"
] | [((29, 61), 'os.system', 'os.system', (['"""sudo apt-get update"""'], {}), "('sudo apt-get update')\n", (38, 61), False, 'import os\n'), ((62, 107), 'os.system', 'os.system', (['"""sudo apt-get install aircrack-ng"""'], {}), "('sudo apt-get install aircrack-ng')\n", (71, 107), False, 'import os\n'), ((108, 145), 'os.sy... |
import pickle
import numpy as np
import pytest
import pandas as pd
from copy import deepcopy
from veritastool.metrics.modelrates import *
from veritastool.model.model_container import ModelContainer
from veritastool.fairness.customer_marketing import CustomerMarketing
import sys
sys.path.append("veritastool/examples/cu... | [
"numpy.random.choice",
"veritastool.model.model_container.ModelContainer",
"pickle.load",
"numpy.array",
"pandas.DataFrame",
"veritastool.fairness.customer_marketing.CustomerMarketing",
"sys.path.append"
] | [((280, 346), 'sys.path.append', 'sys.path.append', (['"""veritastool/examples/customer_marketing_example"""'], {}), "('veritastool/examples/customer_marketing_example')\n", (295, 346), False, 'import sys\n'), ((505, 528), 'pickle.load', 'pickle.load', (['input_file'], {}), '(input_file)\n', (516, 528), False, 'import ... |
from library import api
from flask_restful import Resource
from flask_jwt import jwt_required
from library.models import Author, Book, Genre, User, \
Order, OrderItem, Review
from library.schemas import authors_schema, author_schema, \
book_schema, books_schema, \
genre_schema, genres_schema, \
user_sch... | [
"library.api.add_resource",
"flask_jwt.jwt_required"
] | [((680, 803), 'library.api.add_resource', 'api.add_resource', (['Pages', '"""/books"""', '"""/"""'], {'endpoint': '"""books"""', 'resource_class_args': "[Book, books_schema, book_schema, 'book']"}), "(Pages, '/books', '/', endpoint='books',\n resource_class_args=[Book, books_schema, book_schema, 'book'])\n", (696, 8... |
"""Treadmill console entry point.
"""
import logging
import logging.config
import click
import requests
# pylint complains about imports from treadmill not grouped, but import
# dependencies need to come first.
#
# pylint: disable=C0412
from treadmill import cli
# pylint complains "No value passed for parameter 'l... | [
"treadmill.cli.make_multi_command",
"click.Choice",
"logging.getLogger",
"requests.Session",
"click.option",
"treadmill.cli.init_logger"
] | [((535, 682), 'click.option', 'click.option', (['"""--dns-domain"""'], {'required': '(False)', 'envvar': '"""TREADMILL_DNS_DOMAIN"""', 'callback': 'cli.handle_context_opt', 'is_eager': '(True)', 'expose_value': '(False)'}), "('--dns-domain', required=False, envvar='TREADMILL_DNS_DOMAIN',\n callback=cli.handle_contex... |
import sys
import uuid
import os
import pandas as pd
import uuid
accession = sys.argv[1]
output_filename = sys.argv[2]
all_metadata_df = pd.read_csv("https://redu.ucsd.edu/dump", sep="\t")
dataset_df = all_metadata_df[all_metadata_df["ATTRIBUTE_DatasetAccession"] == accession]
sdrf_df = pd.DataFrame()
sdrf_df["sourc... | [
"pandas.DataFrame",
"os.path.basename",
"pandas.read_csv",
"uuid.uuid4"
] | [((139, 190), 'pandas.read_csv', 'pd.read_csv', (['"""https://redu.ucsd.edu/dump"""'], {'sep': '"""\t"""'}), "('https://redu.ucsd.edu/dump', sep='\\t')\n", (150, 190), True, 'import pandas as pd\n'), ((291, 305), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (303, 305), True, 'import pandas as pd\n'), ((972, 98... |
import sys
sys.path.append('./models')
from models.base import Session
from models.host.host import Host, HostType
session = Session()
# Test add new host
# host = Host('nombre', 'ip', 'descripcion', 'user', 'password', 1)
# session.add(host)
# session.commit()
# Test fetch all host
hosts = session.que... | [
"sys.path.append",
"models.base.Session"
] | [((12, 39), 'sys.path.append', 'sys.path.append', (['"""./models"""'], {}), "('./models')\n", (27, 39), False, 'import sys\n'), ((131, 140), 'models.base.Session', 'Session', ([], {}), '()\n', (138, 140), False, 'from models.base import Session\n')] |
import requests
from os import listdir, mkdir, rename
from os.path import isfile, isdir, join
from zipfile import ZipFile
def download_url(url, save_path, chunk_size=128):
r = requests.get(url, stream=True)
with open(save_path, "wb") as fd:
for chunk in r.iter_content(chunk_size=chunk_size):
... | [
"os.listdir",
"zipfile.ZipFile",
"os.path.join",
"requests.get",
"os.path.isdir",
"os.mkdir"
] | [((189, 219), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (201, 219), False, 'import requests\n'), ((432, 449), 'zipfile.ZipFile', 'ZipFile', (['zip_path'], {}), '(zip_path)\n', (439, 449), False, 'from zipfile import ZipFile\n'), ((1460, 1488), 'os.path.join', 'join', (['da... |
"""Example showing how to apply VaspInteractive calculators for different atoms
In the no-context (classic) mode, you need to manually finalize the VaspInteractive calculator
while in the context mode less coding is needed
"""
import numpy as np
import os
import tempfile
from ase.build import molecule
from ase.o... | [
"tempfile.TemporaryDirectory",
"vasp_interactive.VaspInteractive",
"ase.optimize.BFGS",
"ase.build.molecule"
] | [((464, 499), 'ase.build.molecule', 'molecule', (['"""CH4"""'], {'vacuum': '(5)', 'pbc': '(True)'}), "('CH4', vacuum=5, pbc=True)\n", (472, 499), False, 'from ase.build import molecule\n'), ((506, 542), 'ase.build.molecule', 'molecule', (['"""C2H4"""'], {'vacuum': '(5)', 'pbc': '(True)'}), "('C2H4', vacuum=5, pbc=True)... |
import copy
import numpy as np
import timeit
import torch
import torch.nn as nn
from torch.utils.data import BatchSampler, SubsetRandomSampler
import rl_sandbox.constants as c
from rl_sandbox.algorithms.cem.cem import CEMQ
from rl_sandbox.auxiliary_tasks.auxiliary_tasks import AuxiliaryTask
class GRAC:
def __i... | [
"rl_sandbox.auxiliary_tasks.auxiliary_tasks.AuxiliaryTask",
"numpy.mean",
"timeit.default_timer",
"torch.nn.utils.clip_grad_norm_",
"torch.max",
"torch.tensor",
"rl_sandbox.algorithms.cem.cem.CEMQ",
"torch.no_grad",
"torch.clamp",
"torch.cat",
"torch.device"
] | [((390, 405), 'rl_sandbox.auxiliary_tasks.auxiliary_tasks.AuxiliaryTask', 'AuxiliaryTask', ([], {}), '()\n', (403, 405), False, 'from rl_sandbox.auxiliary_tasks.auxiliary_tasks import AuxiliaryTask\n'), ((3331, 3686), 'rl_sandbox.algorithms.cem.cem.CEMQ', 'CEMQ', ([], {'cov_noise_init': 'self._cov_noise_init', 'cov_noi... |
from celery.task import task
from sorl.thumbnail import get_thumbnail
@task
def generate_thumbnail_lazy(*args, **kwargs):
get_thumbnail(*args, **kwargs)
| [
"sorl.thumbnail.get_thumbnail"
] | [((128, 158), 'sorl.thumbnail.get_thumbnail', 'get_thumbnail', (['*args'], {}), '(*args, **kwargs)\n', (141, 158), False, 'from sorl.thumbnail import get_thumbnail\n')] |
from __future__ import absolute_import, unicode_literals
from django.contrib import messages
from django.core.files.base import ContentFile
from django.db import transaction
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.template import RequestContext
f... | [
"django.utils.translation.ugettext_lazy",
"mayan.apps.documents.events.event_document_type_edited.commit",
"django.db.transaction.atomic",
"django.shortcuts.get_object_or_404",
"django.template.RequestContext",
"django.urls.reverse_lazy",
"mayan.apps.events.classes.EventType.all",
"mayan.apps.events.c... | [((3091, 3115), 'django.utils.translation.ugettext_lazy', '_', (['"""Available workflows"""'], {}), "('Available workflows')\n", (3092, 3115), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((3139, 3181), 'django.utils.translation.ugettext_lazy', '_', (['"""Workflows assigned this document type"""'... |
import pygame
from data.troops import *
from data.defenses import *
from data.attack_levels import *
import math
WIDTH = 800
HEIGHT = 600
state = 0
level = 0
totalDamageDone = 0
totalDamageTaken = 0
class Table:
def __init__(self,width,height):
self.width=width
self.height=height
self.ca... | [
"pygame.quit",
"pygame.time.delay",
"pygame.event.get",
"pygame.draw.line",
"pygame.display.set_mode",
"math.sqrt",
"pygame.mouse.get_pos",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.image.load",
"pygame.display.update"
] | [((1812, 1856), 'pygame.image.load', 'pygame.image.load', (['"""images/cardinfantry.png"""'], {}), "('images/cardinfantry.png')\n", (1829, 1856), False, 'import pygame\n'), ((1879, 1921), 'pygame.image.load', 'pygame.image.load', (['"""images/cardarcher.png"""'], {}), "('images/cardarcher.png')\n", (1896, 1921), False,... |
"""
Example: basic integration
Basic example using the vegas_wrapper helper
"""
from vegasflow.configflow import DTYPE
import time
import numpy as np
import tensorflow as tf
from vegasflow.vflow import vegas_wrapper
from vegasflow.plain import plain_wrapper
# MC integration setup
dim = 4
ncalls = np.int32(... | [
"numpy.sqrt",
"vegasflow.vflow.vegas_wrapper",
"numpy.int32",
"tensorflow.range",
"tensorflow.constant",
"tensorflow.square",
"tensorflow.cast",
"time.time",
"tensorflow.exp"
] | [((311, 329), 'numpy.int32', 'np.int32', (['(100000.0)'], {}), '(100000.0)\n', (319, 329), True, 'import numpy as np\n'), ((449, 478), 'tensorflow.constant', 'tf.constant', (['(0.1)'], {'dtype': 'DTYPE'}), '(0.1, dtype=DTYPE)\n', (460, 478), True, 'import tensorflow as tf\n'), ((490, 523), 'tensorflow.cast', 'tf.cast',... |
import functools
import getpass
import json
import click
from click_didyoumean import DYMMixin
from click_help_colors import HelpColorsGroup
api_key_option = click.option(
"--apiKey",
"api_key",
help="API key to use this time only",
)
def del_if_value_is_none(dict_):
"""Remove all elements with valu... | [
"click.option",
"json.dumps",
"click.style",
"getpass.getpass",
"functools.partial"
] | [((160, 233), 'click.option', 'click.option', (['"""--apiKey"""', '"""api_key"""'], {'help': '"""API key to use this time only"""'}), "('--apiKey', 'api_key', help='API key to use this time only')\n", (172, 233), False, 'import click\n'), ((1366, 1398), 'functools.partial', 'functools.partial', (['new_invoke', 'f'], {}... |
# License: Apache-2.
from typing import List, Union, Dict
import warnings
import numpy as np
import pandas as pd
import databricks.koalas as ks
from ._base_encoder import _BaseEncoder
from ..util import util
def clean_mapping(mapping: Dict[str, Dict[str, List[float]]]
) -> Dict[str, Dict[str, List[f... | [
"warnings.warn",
"pandas.concat",
"pandas.DataFrame",
"databricks.koalas.DataFrame"
] | [((3211, 3337), 'warnings.warn', 'warnings.warn', (['f"""`X` does not contain object columns:\n `{self.__class__.__name__}` is not needed"""'], {}), '(\n f"""`X` does not contain object columns:\n `{self.__class__.__name__}` is not needed"""\n )\n', (3224, 3337), False, 'import warni... |
import csv
# Each row in the pupils.csv file contains three elements.
# These are the indexes of the elements in each row.
GIVEN_NAME_INDEX = 0
SURNAME_INDEX = 1
BIRTHDATE_INDEX = 2
def main():
path = "E:/GitHub/2021-cs111-programming-with-functions/w11-functional-programming/teach-sort/pupils.csv"
# Call t... | [
"csv.reader"
] | [((2403, 2423), 'csv.reader', 'csv.reader', (['csv_file'], {}), '(csv_file)\n', (2413, 2423), False, 'import csv\n')] |
from copy import deepcopy
from aoc_utils import read_lines
class Bingo:
def __init__(self, board):
self.dim = len(board), len(board[0])
self.board = board
self.marked = []
self.dict = {}
self.last_draw = -1
for i in range(len(board)):
self.ma... | [
"aoc_utils.read_lines",
"copy.deepcopy"
] | [((1260, 1282), 'aoc_utils.read_lines', 'read_lines', (['"""day4.txt"""'], {}), "('day4.txt')\n", (1270, 1282), False, 'from aoc_utils import read_lines\n'), ((1689, 1700), 'copy.deepcopy', 'deepcopy', (['r'], {}), '(r)\n', (1697, 1700), False, 'from copy import deepcopy\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Importing modules
import os
import sys
import tqdm
import gc
import argparse
import pathlib
import copy
# This function iterates over the file with matching barcodes and sequencing runs, and creates a dictionary with matched barcodes and sample names
# Input: Path to ... | [
"copy.deepcopy",
"argparse.ArgumentParser",
"pathlib.PurePath",
"gc.collect",
"sys.exit",
"os.walk"
] | [((2643, 2660), 'os.walk', 'os.walk', (['dir_path'], {}), '(dir_path)\n', (2650, 2660), False, 'import os\n'), ((11780, 11823), 'copy.deepcopy', 'copy.deepcopy', (['empty_dictionary_zero_counts'], {}), '(empty_dictionary_zero_counts)\n', (11793, 11823), False, 'import copy\n'), ((20048, 20243), 'argparse.ArgumentParser... |
# Copyright 2015 Cloudera 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 in writing, so... | [
"ibis.expr.rules.shape_like",
"ibis.expr.datatypes.Category",
"ibis.expr.rules.isin",
"ibis.expr.signature.Argument",
"ibis.expr.datatypes.category.array_type"
] | [((957, 970), 'ibis.expr.signature.Argument', 'Arg', (['rlz.noop'], {}), '(rlz.noop)\n', (960, 970), True, 'from ibis.expr.signature import Argument as Arg\n'), ((985, 998), 'ibis.expr.signature.Argument', 'Arg', (['rlz.noop'], {}), '(rlz.noop)\n', (988, 998), True, 'from ibis.expr.signature import Argument as Arg\n'),... |
from tensorflow.keras.layers import Activation, Dropout
from tensorflow.keras.layers import Conv2D, Conv2DTranspose, MaxPooling2D
from tensorflow.keras.layers import Input, concatenate, BatchNormalization
from tensorflow.keras.models import Model
def conv_block(inputs, filters, activation, batch_norm):
hidden = C... | [
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.models.Model",... | [((1279, 1315), 'tensorflow.keras.layers.concatenate', 'concatenate', (['[hidden, layer]'], {'axis': '(3)'}), '([hidden, layer], axis=3)\n', (1290, 1315), False, 'from tensorflow.keras.layers import Input, concatenate, BatchNormalization\n'), ((1555, 1579), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'imag... |
# Generated by Django 3.1 on 2021-03-17 09:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('message_control', '0001_in... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey"
] | [((225, 282), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (256, 282), False, 'from django.db import migrations, models\n'), ((465, 605), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': '(1)', 'on... |
import json
import os
from requests.auth import HTTPBasicAuth
from moneywagon.core import (
Service, NoService, NoData, ServiceError, SkipThisService, currency_to_protocol,
decompile_scriptPubKey
)
from bitcoin import deserialize
import arrow
from bs4 import BeautifulSoup
import re
import hmac, hashlib, time... | [
"hmac.new",
"os.path.exists",
"random.choice",
"hashlib.md5",
"json.dumps",
"base64.b64decode",
"moneywagon.core.ServiceError",
"arrow.get",
"urllib.parse.urlencode",
"time.time",
"urllib.parse.quote_plus",
"os.path.expanduser",
"moneywagon.core.SkipThisService"
] | [((690, 731), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.moneywagon_state"""'], {}), "('~/.moneywagon_state')\n", (708, 731), False, 'import os\n'), ((743, 763), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (757, 763), False, 'import os\n'), ((5661, 5694), 'base64.b64decode', 'base64.b64dec... |
from synapseaware.isthmus import topological_thinning
from synapseaware.teaser import teaser
from synapseaware.connectome import wiring
prefix = 'Fib25'
label = 1
topological_thinning.TopologicalThinning(prefix, label)
teaser.TEASER(prefix, label)
wiring.GenerateSkeleton(prefix, label)
wiring.RefineSkeleton(pref... | [
"synapseaware.teaser.teaser.TEASER",
"synapseaware.connectome.wiring.RefineSkeleton",
"synapseaware.isthmus.topological_thinning.TopologicalThinning",
"synapseaware.connectome.wiring.GenerateSkeleton"
] | [((170, 225), 'synapseaware.isthmus.topological_thinning.TopologicalThinning', 'topological_thinning.TopologicalThinning', (['prefix', 'label'], {}), '(prefix, label)\n', (210, 225), False, 'from synapseaware.isthmus import topological_thinning\n'), ((226, 254), 'synapseaware.teaser.teaser.TEASER', 'teaser.TEASER', (['... |
import os
import numpy as np
from interface.camera_calibration import ModelImage
dir_path = os.path.dirname(os.path.realpath(__file__))
class RobertSquashCourtImage(ModelImage):
def __init__(self):
self.K = np.matrix([[-524.79644775, 0., 293.28320922],
[ 0., ... | [
"os.path.realpath",
"numpy.array",
"numpy.matrix",
"os.path.join"
] | [((111, 137), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (127, 137), False, 'import os\n'), ((223, 328), 'numpy.matrix', 'np.matrix', (['[[-524.79644775, 0.0, 293.28320922], [0.0, -523.37878418, 226.37976338], [\n 0.0, 0.0, 1.0]]'], {}), '([[-524.79644775, 0.0, 293.28320922], [0.0, -... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the compression manager."""
import unittest
from dfvfs.compression import decompressor
from dfvfs.compression import manager
from dfvfs.compression import zlib_decompressor
from dfvfs.lib import definitions
class TestDecompressor(decompressor.Decompressor):
"... | [
"unittest.main",
"dfvfs.compression.manager.CompressionManager.DeregisterDecompressor",
"dfvfs.compression.manager.CompressionManager.GetDecompressor",
"dfvfs.compression.manager.CompressionManager.RegisterDecompressor"
] | [((1985, 2000), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1998, 2000), False, 'import unittest\n'), ((1060, 1125), 'dfvfs.compression.manager.CompressionManager.RegisterDecompressor', 'manager.CompressionManager.RegisterDecompressor', (['TestDecompressor'], {}), '(TestDecompressor)\n', (1107, 1125), False, '... |
# -*- coding: utf-8 -*-
import os
import sys
import logging
import uuid
import time
import glob
import subprocess
from dotenv import load_dotenv
from s3 import get_s3, store_stream_s3, get_matching_s3_keys, get_object_to_file
load_dotenv()
BUCKET = os.environ.get("BUCKET")
PATH_DATA = os.environ.get("PATH_DATA", "./... | [
"os.path.exists",
"os.path.join",
"os.environ.get",
"dotenv.load_dotenv",
"glob.glob"
] | [((229, 242), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (240, 242), False, 'from dotenv import load_dotenv\n'), ((252, 276), 'os.environ.get', 'os.environ.get', (['"""BUCKET"""'], {}), "('BUCKET')\n", (266, 276), False, 'import os\n'), ((289, 326), 'os.environ.get', 'os.environ.get', (['"""PATH_DATA"""', '... |
import os
class Article():
def __init__(self,data_dir,xml_result_dir):
self.data_dir=data_dir
self.xml_result_dir=xml_result_dir
with open(os.path.join(xml_result_dir,'file_id_map_dict.txt'),'r',encoding='utf-8') as f:
self.file_id_map_xml_result=eval(f.readline())
... | [
"os.path.join"
] | [((1985, 2051), 'os.path.join', 'os.path.join', (['self.xml_result_dir', '"""word_id_map"""', "('other' + '.txt')"], {}), "(self.xml_result_dir, 'word_id_map', 'other' + '.txt')\n", (1997, 2051), False, 'import os\n'), ((174, 226), 'os.path.join', 'os.path.join', (['xml_result_dir', '"""file_id_map_dict.txt"""'], {}), ... |
import structlog
log = structlog.getLogger(__name__)
class AuthManager(object):
'''Manager responsible for authentication.
Manager uses API instance ``api`` for basic auth operations and
provides additional logic on top.
:param `opentaxii.auth.api.OpenTAXIIAuthAPI` api:
instance of Auth API... | [
"structlog.getLogger"
] | [((24, 53), 'structlog.getLogger', 'structlog.getLogger', (['__name__'], {}), '(__name__)\n', (43, 53), False, 'import structlog\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains base callbackManager class
"""
from __future__ import print_function, division, absolute_import
import logging
from tpDcc import dcc
from tpDcc.core import dcc as core_dcc
from tpDcc.abstract import callback
from tpDcc.dcc import callback as dc... | [
"logging.getLogger",
"tpDcc.core.dcc.callbacks",
"tpDcc.dcc.get_name",
"tpDcc.dcc.callback.Callback",
"tpDcc.libs.python.decorators.add_metaclass"
] | [((382, 413), 'logging.getLogger', 'logging.getLogger', (['"""tpDcc-core"""'], {}), "('tpDcc-core')\n", (399, 413), False, 'import logging\n'), ((417, 463), 'tpDcc.libs.python.decorators.add_metaclass', 'decorators.add_metaclass', (['decorators.Singleton'], {}), '(decorators.Singleton)\n', (441, 463), False, 'from tpDc... |
from django.db import models
from django.contrib.auth.models import User
from django.db.transaction import atomic
from django.conf import settings
from autoslug import AutoSlugField
from taggit.managers import TaggableManager
from categories.models import Category
from django.utils.timezone import now
from django.utils... | [
"django.utils.translation.ugettext_lazy"
] | [((1687, 1704), 'django.utils.translation.ugettext_lazy', '_', (['"""Bank Account"""'], {}), "('Bank Account')\n", (1688, 1704), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((1735, 1753), 'django.utils.translation.ugettext_lazy', '_', (['"""Bank Accounts"""'], {}), "('Bank Accounts')\n", (1736, ... |
"""Code to generate full mock LCs."""
import numpy as np
import kali
import kali.carma
import pandas as pd
import sys
from joblib import Parallel, delayed
sys.path.insert(0, '/home/mount/lsst_cadence')
from lsstlc import * # derived LSST lightcurve sub-class
def genLC(params, save_dir):
"""Generating simulated l... | [
"sys.path.insert",
"pandas.read_csv",
"joblib.Parallel",
"kali.carma.CARMATask",
"numpy.array",
"joblib.delayed"
] | [((155, 201), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/mount/lsst_cadence"""'], {}), "(0, '/home/mount/lsst_cadence')\n", (170, 201), False, 'import sys\n'), ((501, 527), 'kali.carma.CARMATask', 'kali.carma.CARMATask', (['(2)', '(1)'], {}), '(2, 1)\n', (521, 527), False, 'import kali\n'), ((575, 641), '... |
from pydantic import BaseModel
from icolos.core.workflow_steps.schrodinger.base import StepSchrodingerBase
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
from icolos.utils.enums.step_enums import StepFepPlusEnum
from typing import List
import time
import os
from ic... | [
"os.listdir",
"scipy.sparse.csgraph.shortest_path",
"os.path.join",
"time.sleep",
"icolos.utils.enums.step_enums.StepFepPlusEnum",
"numpy.zeros",
"scipy.sparse.csr_matrix"
] | [((369, 386), 'icolos.utils.enums.step_enums.StepFepPlusEnum', 'StepFepPlusEnum', ([], {}), '()\n', (384, 386), False, 'from icolos.utils.enums.step_enums import StepFepPlusEnum\n'), ((4798, 4830), 'numpy.zeros', 'np.zeros', (['(len_nodes, len_nodes)'], {}), '((len_nodes, len_nodes))\n', (4806, 4830), True, 'import num... |
"""
<NAME>
31/03/2022
"""
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/resultat", methods=["POST"])
def resultat():
result = request.form
nom = result["nom"]
nombre_1 = int(result["nombre_1"])
... | [
"flask.render_template",
"flask.Flask"
] | [((84, 99), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (89, 99), False, 'from flask import Flask, render_template, request\n'), ((141, 170), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (156, 170), False, 'from flask import Flask, render_template, request\... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
"pytest_mock.mocker.patch.object",
"pytest.mark.parametrize",
"pytest.raises",
"aws_encryption_sdk.materials_managers.caching.CachingCryptoMaterialsManager",
"aws_encryption_sdk.internal.str_ops.to_bytes",
"mock.MagicMock"
] | [((4663, 4758), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value, result"""', '((-1, False), (4, False), (5, False), (6, True))'], {}), "('value, result', ((-1, False), (4, False), (5, \n False), (6, True)))\n", (4686, 4758), False, 'import pytest\n'), ((5081, 5158), 'pytest.mark.parametrize', 'pyte... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
"bpy.props.BoolProperty",
"bpy.props.StringProperty",
"bpy.utils.unregister_module",
"bpy.types.INFO_MT_file_export.remove",
"imp.reload",
"bpy.props.FloatProperty",
"bpy.utils.register_module",
"bpy.path.ensure_ext",
"bpy.types.INFO_MT_file_export.append"
] | [((1728, 1777), 'bpy.props.StringProperty', 'StringProperty', ([], {'default': '"""*.h"""', 'options': "{'HIDDEN'}"}), "(default='*.h', options={'HIDDEN'})\n", (1742, 1777), False, 'from bpy.props import CollectionProperty, StringProperty, BoolProperty, FloatProperty\n'), ((1798, 1903), 'bpy.props.BoolProperty', 'BoolP... |
from scipy.linalg import toeplitz
import numpy as np
from cooltools.lib.numutils import LazyToeplitz
n = 100
m = 150
c = np.arange(1, n + 1)
r = np.r_[1, np.arange(-2, -m, -1)]
L = LazyToeplitz(c, r)
T = toeplitz(c, r)
def test_symmetric():
for si in [
slice(10, 20),
slice(0, 150),
slic... | [
"cooltools.lib.numutils.LazyToeplitz",
"numpy.allclose",
"scipy.linalg.toeplitz",
"numpy.arange"
] | [((123, 142), 'numpy.arange', 'np.arange', (['(1)', '(n + 1)'], {}), '(1, n + 1)\n', (132, 142), True, 'import numpy as np\n'), ((184, 202), 'cooltools.lib.numutils.LazyToeplitz', 'LazyToeplitz', (['c', 'r'], {}), '(c, r)\n', (196, 202), False, 'from cooltools.lib.numutils import LazyToeplitz\n'), ((207, 221), 'scipy.l... |
from django.db import migrations, transaction
class Migration(migrations.Migration):
dependencies = [
("App", "0007_categories_test_data"),
]
def generate_data(apps, schema_editor):
from App.models import Business_Image, Business
from django.shortcuts import get_object_or_404
... | [
"django.shortcuts.get_object_or_404",
"django.db.migrations.RunPython",
"django.db.transaction.atomic"
] | [((14979, 15014), 'django.db.migrations.RunPython', 'migrations.RunPython', (['generate_data'], {}), '(generate_data)\n', (14999, 15014), False, 'from django.db import migrations, transaction\n'), ((14653, 14673), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (14671, 14673), False, 'from djang... |
# Copyright 2015 Cloudera 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 in writing, so... | [
"os.path.exists",
"sqlalchemy.create_engine",
"os.strerror",
"sqlalchemy.Table"
] | [((2997, 3093), 'sqlalchemy.Table', 'sqlalchemy.Table', (['name', 'self.meta'], {'schema': '(schema or self.current_database)', 'autoload': 'autoload'}), '(name, self.meta, schema=schema or self.current_database,\n autoload=autoload)\n', (3013, 3093), False, 'import sqlalchemy\n'), ((3881, 3941), 'sqlalchemy.Table',... |
# Generated by Django 2.1.7 on 2019-02-19 01:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('redacted', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='redactedclientconfig',
name='cookies... | [
"django.db.models.BinaryField"
] | [((341, 370), 'django.db.models.BinaryField', 'models.BinaryField', ([], {'null': '(True)'}), '(null=True)\n', (359, 370), False, 'from django.db import migrations, models\n')] |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
"bpy.props.StringProperty",
"zipfile.ZipFile",
"bpy_extras.keyconfig_utils.keyconfig_test",
"webbrowser.open",
"bpy.utils.user_resource",
"addon_utils.module_bl_info",
"os.startfile",
"bpy.utils.refresh_script_paths",
"bpy.ops.wm.read_history",
"os.remove",
"bpy.props.BoolProperty",
"os.path.e... | [((1048, 1140), 'bpy.props.StringProperty', 'StringProperty', ([], {'name': '"""Context Attributes"""', 'description': '"""RNA context string"""', 'maxlen': '(1024)'}), "(name='Context Attributes', description='RNA context string',\n maxlen=1024)\n", (1062, 1140), False, 'from bpy.props import StringProperty, BoolPr... |
import io
import json
import re
async def c(WS, msg, options):
channels_URL = f"https://discord.com/channels/{msg['guild_id']}/{msg['channel_id']}/"
def get_ID(snow):
try:
if len(snow) < 17:
raise IndentationError
return int(snow)
except:
prin... | [
"json.dumps",
"re.search"
] | [((444, 576), 're.search', 're.search', (['(f"^https?://(www\\\\.)?discord(app)?\\\\.com/channels/{msg[\'guild_id\']}/{msg[\'channel_id\']}/"\n + \'\\\\d{17,19}$\')', 'snow'], {}), '(\n f"^https?://(www\\\\.)?discord(app)?\\\\.com/channels/{msg[\'guild_id\']}/{msg[\'channel_id\']}/"\n + \'\\\\d{17,19}$\', sn... |
#!/usr/bin/python3
import dbus
import dbus.mainloop.glib
from gap import Advertisement
from main_gatt import PCMonService
from util import find_adapter
from socket import gethostname
import array
from gi.repository import GObject # python3
BLUEZ_SERVICE_NAME = 'org.bluez'
LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.L... | [
"dbus.mainloop.glib.DBusGMainLoop",
"gap.Advertisement.__init__",
"dbus.SystemBus",
"dbus.Boolean",
"util.find_adapter",
"gi.repository.GObject.MainLoop",
"socket.gethostname"
] | [((1042, 1095), 'dbus.mainloop.glib.DBusGMainLoop', 'dbus.mainloop.glib.DBusGMainLoop', ([], {'set_as_default': '(True)'}), '(set_as_default=True)\n', (1074, 1095), False, 'import dbus\n'), ((1107, 1123), 'dbus.SystemBus', 'dbus.SystemBus', ([], {}), '()\n', (1121, 1123), False, 'import dbus\n'), ((1139, 1156), 'util.f... |
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
from math import pi
### falling_sphere.py
###
### Script to calculate the finite differences
### solution for the falling sphere in a viscous fluid
### (Stokes' law).
###
### Compared against analytical solution.
#####################
#### Paramet... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.exp",
"numpy.zeros",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((892, 904), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (900, 904), True, 'import numpy as np\n'), ((963, 975), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (971, 975), True, 'import numpy as np\n'), ((2416, 2450), 'numpy.linspace', 'np.linspace', (['(0)', '((nt - 1) * dt)', '(200)'], {}), '(0, (nt - 1) ... |
"""Mix-in classes for easy attribute setting and pretty representation
>>> class T(HasInitableAttributes, HasTypedAttributes, IsCallable):
... spam = str
... def __init__(self, eggs, ham = 'ham'): pass
...
>>> t = T('bacon'); t(ham = 'eggs'); t.spam += 'sausage'; t
__main__.T('bacon', ham = 'eggs', spam = 'sau... | [
"doctest.testmod",
"inspect.getargspec"
] | [((3946, 3955), 'doctest.testmod', 'testmod', ([], {}), '()\n', (3953, 3955), False, 'from doctest import testmod\n'), ((1054, 1079), 'inspect.getargspec', 'getargspec', (['self.__init__'], {}), '(self.__init__)\n', (1064, 1079), False, 'from inspect import getargspec\n')] |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import glob
import logging
import re
import subprocess
import tempfile
from datetime import datetime as dt
from string import Template
class TaskFailedException(Exception):
pass
class TempDirIsFileException(Exception):
pass
class Tas... | [
"subprocess.check_output",
"os.path.exists",
"string.Template",
"re.compile",
"datetime.datetime.now",
"os.path.isdir",
"os.mkdir",
"tempfile.NamedTemporaryFile",
"os.path.abspath",
"os.path.getmtime",
"glob.glob"
] | [((380, 418), 're.compile', 're.compile', (['"""\\\\$\\\\[([a-zA-Z0-9_]+)\\\\]"""'], {}), "('\\\\$\\\\[([a-zA-Z0-9_]+)\\\\]')\n", (390, 418), False, 'import re\n'), ((7627, 7699), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'dir': 'self.__dirname', 'delete': '(False)', 'mode': '"""wt"""'}), "(di... |
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import Iterable, Optional, Sequence
from moviepy.editor import (
CompositeVideoClip, TextClip, VideoFileClip, concatenate_videoclips,
)
from moviepy.video.tools.subtitles import SubtitlesClip
from video_composer.meta import Clip... | [
"logging.getLogger",
"moviepy.video.tools.subtitles.SubtitlesClip",
"moviepy.editor.CompositeVideoClip",
"video_composer.meta.Size",
"moviepy.editor.concatenate_videoclips",
"moviepy.editor.TextClip"
] | [((341, 368), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (358, 368), False, 'import logging\n'), ((3625, 3682), 'moviepy.video.tools.subtitles.SubtitlesClip', 'SubtitlesClip', (['subtitles_path', 'subtitle_text_clip_factory'], {}), '(subtitles_path, subtitle_text_clip_factory)\n', (36... |
#!/usr/bin/env python3
import json
import math
import numpy as np
import re
import sys
from terminaltables import AsciiTable
from termcolor import colored
from scipy.stats import ttest_ind
p_value_significance_threshold = 0.001
min_iterations = 10
min_runtime_ns = 59 * 1000 * 1000 * 1000
min_iterations_disabling_min_... | [
"numpy.mean",
"re.escape",
"termcolor.colored",
"numpy.array",
"terminaltables.AsciiTable",
"scipy.stats.ttest_ind",
"json.load",
"math.isnan"
] | [((13082, 13104), 'terminaltables.AsciiTable', 'AsciiTable', (['table_data'], {}), '(table_data)\n', (13092, 13104), False, 'from terminaltables import AsciiTable\n'), ((3995, 4018), 'terminaltables.AsciiTable', 'AsciiTable', (['table_lines'], {}), '(table_lines)\n', (4005, 4018), False, 'from terminaltables import Asc... |
import sys
import util
import timeline_year_country
import timeline_year_index
import timeline_year_individual
def run(year):
print("Creating timeline/" + year)
util.makedirs("../timeline/" + year)
timeline_year_index.run(year)
timeline_year_country.run(year)
timeline_year_individual.run... | [
"timeline_year_country.run",
"util.makedirs",
"timeline_year_individual.run",
"timeline_year_index.run"
] | [((178, 214), 'util.makedirs', 'util.makedirs', (["('../timeline/' + year)"], {}), "('../timeline/' + year)\n", (191, 214), False, 'import util\n'), ((220, 249), 'timeline_year_index.run', 'timeline_year_index.run', (['year'], {}), '(year)\n', (243, 249), False, 'import timeline_year_index\n'), ((255, 286), 'timeline_y... |
""" Tests for echop """
import os
from subprocess import run, getstatusoutput
from typing import List
PRG = './echop.py'
# --------------------------------------------------
def test_exists() -> None:
""" Program exists """
assert os.path.isfile(PRG)
# --------------------------------------------------
d... | [
"os.path.isfile",
"subprocess.run",
"subprocess.getstatusoutput"
] | [((244, 263), 'os.path.isfile', 'os.path.isfile', (['PRG'], {}), '(PRG)\n', (258, 263), False, 'import os\n'), ((819, 839), 'subprocess.getstatusoutput', 'getstatusoutput', (['PRG'], {}), '(PRG)\n', (834, 839), False, 'from subprocess import run, getstatusoutput\n'), ((1056, 1085), 'os.path.isfile', 'os.path.isfile', (... |
"""
Author: <NAME> <EMAIL>
Description:
Assumption: This file is only accessible for the codemaker!
The following file contains the implementation of setting up the target for the codemaker
"""
import random
from board import Board
class Setup(object):
def __init__(self):
self.color... | [
"random.choice",
"board.Board"
] | [((439, 446), 'board.Board', 'Board', ([], {}), '()\n', (444, 446), False, 'from board import Board\n'), ((459, 485), 'random.choice', 'random.choice', (['self.colors'], {}), '(self.colors)\n', (472, 485), False, 'import random\n'), ((498, 524), 'random.choice', 'random.choice', (['self.colors'], {}), '(self.colors)\n'... |
import torch
import torch.nn as nn
from CVAE_testbed.models.weight_init import weight_init
class CVAE(nn.Module):
def __init__(self, x_dim, c_dim, enc_layers, dec_layers):
super(CVAE, self).__init__()
self.xdim = x_dim
self.cdim = c_dim
self.enc_layer1 = enc_layers[0]
# en... | [
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.exp",
"torch.nn.BatchNorm1d",
"torch.randn_like",
"torch.nn.Linear",
"torch.cat"
] | [((1061, 1091), 'torch.nn.Sequential', 'nn.Sequential', (['*encoder_layers'], {}), '(*encoder_layers)\n', (1074, 1091), True, 'import torch.nn as nn\n'), ((1830, 1860), 'torch.nn.Sequential', 'nn.Sequential', (['*decoder_layers'], {}), '(*decoder_layers)\n', (1843, 1860), True, 'import torch.nn as nn\n'), ((1959, 1979)... |
"""
Lambda function backing cloudformation certificate resource
Post-minification, this module must be less than 4KiB.
"""
import time
import boto3
import hashlib
import json
import copy
import logging
from botocore.vendored import requests
l = logging.getLogger()
l.setLevel(logging.INFO)
def send(event):
l.i... | [
"logging.getLogger",
"boto3.client",
"json.dumps",
"time.sleep",
"copy.copy"
] | [((249, 268), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (266, 268), False, 'import logging\n'), ((467, 483), 'copy.copy', 'copy.copy', (['props'], {}), '(props)\n', (476, 483), False, 'import copy\n'), ((3426, 3467), 'copy.copy', 'copy.copy', (["event['OldResourceProperties']"], {}), "(event['OldResou... |
from za_id_number.za_id_number import (
SouthAfricanIdentityValidate,
SouthAfricanIdentityGenerate,
generate_random_id,
)
from za_id_number.constants import Gender, CitizenshipClass
import pytest
def test_generate_random_id():
test_id = generate_random_id()
assert SouthAfricanIdentityValidate(test... | [
"pytest.mark.parametrize",
"za_id_number.za_id_number.SouthAfricanIdentityGenerate",
"za_id_number.za_id_number.SouthAfricanIdentityValidate",
"za_id_number.za_id_number.generate_random_id"
] | [((565, 814), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input,expected"""', "[('m', Gender.MALE.value), (Gender.MALE, Gender.MALE.value), ('male',\n Gender.MALE.value), ('f', Gender.FEMALE.value), ('female', Gender.\n FEMALE.value), (Gender.FEMALE, Gender.FEMALE.value)]"], {}), "('test_inpu... |
import numpy as np
np.random.seed(9453)
from time_series_augmentation_toolkit import DN
import pickle
with open('labeldata.pkl','rb') as f:
data = pickle.load(f)
output = []
for d in data:
this_output = d.copy()
r = np.random.choice([3,5,10,15,20], size=4, p=[0.1,0.5,0.3,0.05,0.05])
this_... | [
"pickle.dump",
"numpy.random.choice",
"pickle.load",
"numpy.array",
"numpy.random.seed"
] | [((19, 39), 'numpy.random.seed', 'np.random.seed', (['(9453)'], {}), '(9453)\n', (33, 39), True, 'import numpy as np\n'), ((152, 166), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (163, 166), False, 'import pickle\n'), ((243, 318), 'numpy.random.choice', 'np.random.choice', (['[3, 5, 10, 15, 20]'], {'size': '(4)... |
#!/usr/bin/env python
import wx
import wx.lib.dialogs
#---------------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1)
b = wx.Button(self, -1, "Create and Show a Scr... | [
"wx.Button",
"wx.lib.dialogs.ScrolledMessageDialog",
"wx.Panel.__init__",
"os.path.basename"
] | [((229, 264), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent', '(-1)'], {}), '(self, parent, -1)\n', (246, 264), False, 'import wx\n'), ((278, 350), 'wx.Button', 'wx.Button', (['self', '(-1)', '"""Create and Show a ScrolledMessageDialog"""', '(50, 50)'], {}), "(self, -1, 'Create and Show a ScrolledMessageD... |
from marquez_airflow import DAG
from airflow.operators.postgres_operator import PostgresOperator
from airflow.operators.sensors import ExternalTaskSensor
from airflow.utils.dates import days_ago
default_args = {
'owner': 'datascience',
'depends_on_past': False,
'start_date': days_ago(1),
'email_on_fail... | [
"airflow.operators.sensors.ExternalTaskSensor",
"marquez_airflow.DAG",
"airflow.operators.postgres_operator.PostgresOperator",
"airflow.utils.dates.days_ago"
] | [((396, 555), 'marquez_airflow.DAG', 'DAG', (['"""etl_restaurants"""'], {'schedule_interval': '"""@hourly"""', 'catchup': '(False)', 'default_args': 'default_args', 'description': '"""Loads newly registered restaurants daily."""'}), "('etl_restaurants', schedule_interval='@hourly', catchup=False,\n default_args=defa... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dolores",
version="1.0.3",
author="<NAME>, <NAME>, DNE LLC",
author_email="<EMAIL>",
description="Dolores is a Python library for developers using GPT-3.",
long_description=long_descri... | [
"setuptools.find_packages"
] | [((495, 521), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (519, 521), False, 'import setuptools\n')] |
import builtins
import itertools
from typing import Any, AsyncIterable, Callable, Optional, TypeVar, overload
TSource = TypeVar("TSource")
TResult = TypeVar("TResult")
class AsyncSeq(AsyncIterable[TSource]):
def __init__(self, ai: AsyncIterable[TSource]):
self._ai = ai
async def repeat(value: TSource, ... | [
"builtins.range",
"itertools.repeat",
"typing.TypeVar"
] | [((121, 139), 'typing.TypeVar', 'TypeVar', (['"""TSource"""'], {}), "('TSource')\n", (128, 139), False, 'from typing import Any, AsyncIterable, Callable, Optional, TypeVar, overload\n'), ((150, 168), 'typing.TypeVar', 'TypeVar', (['"""TResult"""'], {}), "('TResult')\n", (157, 168), False, 'from typing import Any, Async... |
'''
Author: HaoZhang-Hoge<EMAIL>
Date: 2021-12-29 04:08:23
LastEditTime: 2022-03-26 07:54:58
LastEditors: Please set LastEditors
Description:
FilePath: /Aurora/type.py
'''
import math
num_region = 8 # MLC
region_add_bit = int(math.log2(num_region))
swap_region = 3 # SLC
print("The num_region is "+str(num... | [
"math.pow",
"math.log2"
] | [((679, 694), 'math.pow', 'math.pow', (['(10)', '(5)'], {}), '(10, 5)\n', (687, 694), False, 'import math\n'), ((709, 724), 'math.pow', 'math.pow', (['(10)', '(8)'], {}), '(10, 8)\n', (717, 724), False, 'import math\n'), ((235, 256), 'math.log2', 'math.log2', (['num_region'], {}), '(num_region)\n', (244, 256), False, '... |
# SdsViewProperty.py
#
# Copyright (C) 2018 OSIsoft, LLC. All rights reserved.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
# OSIsoft, LLC. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT
# THE PRIOR EXPRESS WRITTEN PERMISSION OF OSIsoft, LLC.
#
# RESTRICTED RIGHTS LEGEND
# Use, dupl... | [
"SdsView.fromDictionary"
] | [((1997, 2039), 'SdsView.fromDictionary', 'SdsView.fromDictionary', (["content['SdsView']"], {}), "(content['SdsView'])\n", (2019, 2039), False, 'import SdsView\n')] |
"""
Test module
Tests the functionalities contained in module
`chatette_qiu.cli.interactive_commands.show_command`.
"""
import pytest
from chatette_qiu.cli.interactive_commands.command_strategy import CommandStrategy
from chatette_qiu.cli.interactive_commands.show_command import ShowCommand
from test_command_strateg... | [
"pytest.fail",
"test_command_strategy.get_facade",
"chatette_qiu.cli.interactive_commands.show_command.ShowCommand"
] | [((368, 383), 'chatette_qiu.cli.interactive_commands.show_command.ShowCommand', 'ShowCommand', (['""""""'], {}), "('')\n", (379, 383), False, 'from chatette_qiu.cli.interactive_commands.show_command import ShowCommand\n'), ((475, 500), 'chatette_qiu.cli.interactive_commands.show_command.ShowCommand', 'ShowCommand', (['... |
import os
import math
import shutil
import torch
from utils import ensure_dir, Early_stopping
class BaseTrainer:
""" Base class for all trainer.
Note:
Modify if you need to change logging style, checkpoint naming, or something else.
"""
def __init__(self, model, loss, vocab, optimizer, epochs... | [
"torch.load",
"os.path.join",
"utils.Early_stopping",
"utils.ensure_dir",
"torch.save"
] | [((901, 921), 'utils.ensure_dir', 'ensure_dir', (['save_dir'], {}), '(save_dir)\n', (911, 921), False, 'from utils import ensure_dir, Early_stopping\n'), ((1011, 1037), 'utils.Early_stopping', 'Early_stopping', ([], {'patience': '(3)'}), '(patience=3)\n', (1025, 1037), False, 'from utils import ensure_dir, Early_stoppi... |
from vk_api.longpoll import VkLongPoll, VkEventType
import vk_api
import dialogflow_v2 as dialogflow
import random
import os
import logging
import logging.config
from dotenv import load_dotenv
load_dotenv()
VK_TOKEN = os.getenv('VK_TOKEN')
PROJECT_ID = os.getenv('PROJECT_ID')
GOOGLE_APPLICATION_CREDENTIALS = os.geten... | [
"logging.getLogger",
"dialogflow_v2.types.TextInput",
"os.getenv",
"vk_api.longpoll.VkLongPoll",
"dotenv.load_dotenv",
"vk_api.VkApi",
"dialogflow_v2.SessionsClient",
"dialogflow_v2.types.QueryInput",
"random.randint"
] | [((193, 206), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (204, 206), False, 'from dotenv import load_dotenv\n'), ((220, 241), 'os.getenv', 'os.getenv', (['"""VK_TOKEN"""'], {}), "('VK_TOKEN')\n", (229, 241), False, 'import os\n'), ((255, 278), 'os.getenv', 'os.getenv', (['"""PROJECT_ID"""'], {}), "('PROJECT... |
from __future__ import print_function, unicode_literals
import subprocess
import threading
import logging
import redis
# If you import config from suricate.configuration to check
# config['RUN_ON_MANAGER_HOST'] then ps_output() will block
# in case the manager is online. I temporarily define the
# parameter here, wai... | [
"subprocess.check_output",
"logging.getLogger",
"threading.Lock",
"Acspy.Util.ACSCorba.getManagerHost",
"redis.StrictRedis",
"logging.error"
] | [((387, 403), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (401, 403), False, 'import threading\n'), ((408, 427), 'redis.StrictRedis', 'redis.StrictRedis', ([], {}), '()\n', (425, 427), False, 'import redis\n'), ((562, 602), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'shell': '(True)'}), ... |
from _2_4_doualiste import list_all_elements
from _2_4_doualiste import list_reunion
def x_in_lists(*args):
"""Sa se scrie o functie care primeste ca parametru
un numar variabil de liste si un numar intreg x.
Sa se returneze o lista care sa contina elementele care apar de exact x ori
in listele prim... | [
"_2_4_doualiste.list_reunion",
"_2_4_doualiste.list_all_elements"
] | [((667, 703), '_2_4_doualiste.list_all_elements', 'list_all_elements', (['all_elements', 'lst'], {}), '(all_elements, lst)\n', (684, 703), False, 'from _2_4_doualiste import list_all_elements\n'), ((732, 768), '_2_4_doualiste.list_reunion', 'list_reunion', (['distinct_elements', 'lst'], {}), '(distinct_elements, lst)\n... |
from typing import Iterable, Optional, Tuple, FrozenSet
from pyramids.categorization import make_property_set, Category, Property
class PropertyInheritanceRule:
def __init__(self, category: Category, positive_additions: Iterable[Property],
negative_additions: Iterable[Property]):
self._... | [
"pyramids.categorization.make_property_set",
"pyramids.categorization.Category"
] | [((375, 412), 'pyramids.categorization.make_property_set', 'make_property_set', (['positive_additions'], {}), '(positive_additions)\n', (392, 412), False, 'from pyramids.categorization import make_property_set, Category, Property\n'), ((448, 485), 'pyramids.categorization.make_property_set', 'make_property_set', (['neg... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from glob import glob
from os.path import splitext, basename
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
setup... | [
"setuptools.find_packages",
"os.path.basename",
"glob.glob"
] | [((677, 697), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (690, 697), False, 'from setuptools import setup, find_packages\n'), ((784, 800), 'glob.glob', 'glob', (['"""src/*.py"""'], {}), "('src/*.py')\n", (788, 800), False, 'from glob import glob\n'), ((753, 767), 'os.path.basename', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
13b.py
~~~~~~
Advent of Code 2017 - Day 13: Packet Scanners
Part Two
Now, you need to pass through the firewall without being caught - easier
said than done.
You can't control the speed of the packet, but you can delay it any number
of... | [
"sys.stderr.write",
"itertools.count"
] | [((1563, 1570), 'itertools.count', 'count', ([], {}), '()\n', (1568, 1570), False, 'from itertools import count\n'), ((1912, 1955), 'sys.stderr.write', 'sys.stderr.write', (['"""reading from stdin...\n"""'], {}), "('reading from stdin...\\n')\n", (1928, 1955), False, 'import sys\n')] |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#
#met:
#
#
... | [
"datafinder_test.mocks.SimpleMock"
] | [((2701, 2734), 'datafinder_test.mocks.SimpleMock', 'SimpleMock', ([], {'state': 'ITEM_STATE_NULL'}), '(state=ITEM_STATE_NULL)\n', (2711, 2734), False, 'from datafinder_test.mocks import SimpleMock\n')] |
NO_ERROR = 0
MISTAKE = 1
FIXED_MISTAKE = 2
CHEAT = 3
ACROSS = 0
DOWN = 1
def make_hash(data):
try:
from hashlib import md5
m = md5()
except:
import md5
m = md5.new()
m.update(data)
return m.hexdigest()
class BinaryFile:
def __init__(self, filename=None):
if... | [
"md5",
"md5.new"
] | [((149, 154), 'md5', 'md5', ([], {}), '()\n', (152, 154), False, 'import md5\n'), ((198, 207), 'md5.new', 'md5.new', ([], {}), '()\n', (205, 207), False, 'import md5\n')] |
import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Output.Loading import StreamBankNSum
class TestStreamBankNSum(VariableUnitTest):
def test_StreamBankNSum(self):
z = self.z
np.testing.assert_array_almost_equal(
StreamBankNSum.StreamBankNSum_f(z.NYrs, z.DaysM... | [
"gwlfe.Output.Loading.StreamBankNSum.StreamBankNSum",
"gwlfe.Output.Loading.StreamBankNSum.StreamBankNSum_f"
] | [((273, 921), 'gwlfe.Output.Loading.StreamBankNSum.StreamBankNSum_f', 'StreamBankNSum.StreamBankNSum_f', (['z.NYrs', 'z.DaysMonth', 'z.Temp', 'z.InitSnow_0', 'z.Prec', 'z.NRur', 'z.NUrb', 'z.Area', 'z.CNI_0', 'z.AntMoist_0', 'z.Grow_0', 'z.CNP_0', 'z.Imper', 'z.ISRR', 'z.ISRA', 'z.CN', 'z.UnsatStor_0', 'z.KV', 'z.PcntE... |
import numpy as np
import torch
import torch.nn as nn
from ....ops.iou3d_nms import iou3d_nms_utils
class CenterTargetLayer(nn.Module):
def __init__(self, roi_sampler_cfg):
super().__init__()
self.roi_sampler_cfg = roi_sampler_cfg
def forward(self, batch_dict):
"""
Args:
... | [
"numpy.random.rand",
"torch.from_numpy",
"torch.min",
"torch.cat",
"numpy.round",
"numpy.random.permutation"
] | [((6891, 6927), 'torch.cat', 'torch.cat', (['(fg_inds, bg_inds)'], {'dim': '(0)'}), '((fg_inds, bg_inds), dim=0)\n', (6900, 6927), False, 'import torch\n'), ((4881, 4957), 'numpy.round', 'np.round', (['(self.roi_sampler_cfg.FG_RATIO * self.roi_sampler_cfg.ROI_PER_IMAGE)'], {}), '(self.roi_sampler_cfg.FG_RATIO * self.ro... |
# ---------- Bibliotecas ----------
from tkinter import *
from tkinter import messagebox # messagebox é a biblioteca de mensagem do tkinter.
from tkinter import ttk # ttk é a biblioteca gráfica do tkinter.
import psycopg2
# ---------- Objeto da janela principal ----------
janela = Tk()
# ---------- Widgets -... | [
"tkinter.ttk.Button"
] | [((765, 805), 'tkinter.ttk.Button', 'ttk.Button', (['baixo'], {'text': '"""Sair"""', 'width': '(20)'}), "(baixo, text='Sair', width=20)\n", (775, 805), False, 'from tkinter import ttk\n'), ((825, 870), 'tkinter.ttk.Button', 'ttk.Button', (['cima'], {'text': '"""Cadastrar"""', 'width': '(100)'}), "(cima, text='Cadastrar... |
import datetime
from unittest.mock import MagicMock
import pytest
from bloop.models import BaseModel, Column
from bloop.stream.coordinator import Coordinator
from bloop.stream.stream import Stream
from bloop.types import Integer, String
from bloop.util import ordered
from . import build_shards
@pytest.fixture
def ... | [
"bloop.stream.stream.Stream",
"unittest.mock.MagicMock",
"datetime.datetime.now",
"bloop.models.Column",
"bloop.util.ordered"
] | [((393, 420), 'unittest.mock.MagicMock', 'MagicMock', ([], {'spec': 'Coordinator'}), '(spec=Coordinator)\n', (402, 420), False, 'from unittest.mock import MagicMock\n'), ((485, 519), 'bloop.stream.stream.Stream', 'Stream', ([], {'model': 'Email', 'engine': 'engine'}), '(model=Email, engine=engine)\n', (491, 519), False... |
import math
class Solution:
def constructRectangle(self, area: int) -> List[int]:
W = int(math.sqrt(area))
while area % W:
W -= 1
return [area//W, W]
| [
"math.sqrt"
] | [((102, 117), 'math.sqrt', 'math.sqrt', (['area'], {}), '(area)\n', (111, 117), False, 'import math\n')] |
import csv
import os
import re
import sys
import pandas as pd
try:
import geocoder
except ImportError:
print("[ERROR] Unable to import Geocoder module: cant'run! Exit...")
sys.exit()
try:
import common_utils as cu
except ImportError:
print("[ERROR] Unable to import 'common_utils' module! Exit...")
... | [
"os.path.exists",
"pandas.read_csv",
"common_utils.FastWriter",
"sys.exit",
"re.sub",
"csv.reader",
"geocoder.komoot"
] | [((1439, 1454), 'common_utils.FastWriter', 'cu.FastWriter', ([], {}), '()\n', (1452, 1454), True, 'import common_utils as cu\n'), ((1459, 1488), 'os.path.exists', 'os.path.exists', (['"""./geo_db.db"""'], {}), "('./geo_db.db')\n", (1473, 1488), False, 'import os\n'), ((1525, 1588), 'pandas.read_csv', 'pd.read_csv', (['... |
from pymatgen.ext.matproj import MPRester
# Change "<APIKEY>" to the API key obtained from MP.
mpr = MPRester("<APIKEY>")
data = mpr.query(criteria={"pretty_formula": "Al2O3"},
properties=["final_energy", "band_gap"])
print(data)
import pandas as pd
df = pd.DataFrame(data) # Convert to DataFrame | [
"pandas.DataFrame",
"pymatgen.ext.matproj.MPRester"
] | [((101, 121), 'pymatgen.ext.matproj.MPRester', 'MPRester', (['"""<APIKEY>"""'], {}), "('<APIKEY>')\n", (109, 121), False, 'from pymatgen.ext.matproj import MPRester\n'), ((273, 291), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (285, 291), True, 'import pandas as pd\n')] |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import os
from astropy.table import Table, vstack
from collections import OrderedDict
## Import some helper functions, you can see their definitions by uncomenting the bash shell command
from desispec.workflow.exptable import default_obstypes_for_exptable
fr... | [
"astropy.table.Table",
"desispec.io.util.create_camword",
"desiutil.log.get_logger",
"numpy.array",
"numpy.ndarray",
"desispec.workflow.utils.pathjoin",
"desispec.workflow.exptable.default_obstypes_for_exptable",
"desispec.workflow.utils.define_variable_from_environment",
"desispec.io.util.differenc... | [((8941, 9040), 'desispec.workflow.utils.define_variable_from_environment', 'define_variable_from_environment', ([], {'env_name': '"""DESI_SPECTRO_REDUX"""', 'var_descr': '"""The specprod path"""'}), "(env_name='DESI_SPECTRO_REDUX', var_descr=\n 'The specprod path')\n", (8973, 9040), False, 'from desispec.workflow.u... |
from click_sub.click import parse_url_and_append_click
"""Case presents not valid parameters for creating subscription.
After test running subscriptions won't be created"""
used_click_for_subscription = parse_url_and_append_click()
case_2_first_subscription_params = {'partner': 'test',
... | [
"click_sub.click.parse_url_and_append_click"
] | [((206, 234), 'click_sub.click.parse_url_and_append_click', 'parse_url_and_append_click', ([], {}), '()\n', (232, 234), False, 'from click_sub.click import parse_url_and_append_click\n')] |
import requests
from urllib.error import HTTPError
import datetime as dt
from time import sleep
class CWBattle:
def __init__(self, response):
self.attack_type = response['attack_type']
self.front_id = response['front_id']
self.front_name = response['front_name']
self.competitor_id ... | [
"urllib.error.HTTPError",
"time.sleep",
"requests.get"
] | [((2989, 3025), 'requests.get', 'requests.get', (['cw_url'], {'params': 'payload'}), '(cw_url, params=payload)\n', (3001, 3025), False, 'import requests\n'), ((3056, 3066), 'time.sleep', 'sleep', (['(0.2)'], {}), '(0.2)\n', (3061, 3066), False, 'from time import sleep\n'), ((3563, 3599), 'requests.get', 'requests.get',... |
#!/usr/bin/env python3
# The `subprocess` module helps to start and
# control processes in an operating system
import subprocess
# The `call()` function/method
# This enables to call binaries/scripts etc.
# This returns a return code, which can be captured
# in a variable
subprocess.call("/usr/bin/terminator")
# The... | [
"subprocess.call"
] | [((276, 314), 'subprocess.call', 'subprocess.call', (['"""/usr/bin/terminator"""'], {}), "('/usr/bin/terminator')\n", (291, 314), False, 'import subprocess\n'), ((385, 418), 'subprocess.call', 'subprocess.call', (['"""/usr/bin/gedit"""'], {}), "('/usr/bin/gedit')\n", (400, 418), False, 'import subprocess\n')] |
import ajenti
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Ajenti VH - NGINX Support',
icon='globe',
dependencies=[
PluginDependency('vh'),
PluginDependency('services'),
#BinaryDependency('nginx'),
],
)
def init():
from ajenti.plugins.vh... | [
"ajenti.plugins.manager.blacklist.append",
"ajenti.plugins.vh.destroyed_configs.append"
] | [((350, 383), 'ajenti.plugins.vh.destroyed_configs.append', 'destroyed_configs.append', (['"""nginx"""'], {}), "('nginx')\n", (374, 383), False, 'from ajenti.plugins.vh import destroyed_configs\n'), ((572, 603), 'ajenti.plugins.manager.blacklist.append', 'manager.blacklist.append', (['Nginx'], {}), '(Nginx)\n', (596, 6... |
from typing import Dict, List
from qaz.managers import brew, npm
from qaz.modules.base import Module
class Bat(Module):
name = "bat"
# Configuration files
zshrc_file = "bat.zsh"
symlinks: Dict[str, str] = {}
# Other
vscode_extensions: List[str] = []
@classmethod
def install_action(... | [
"qaz.managers.npm.install_or_upgrade_package",
"qaz.managers.brew.install_or_upgrade_formula"
] | [((334, 372), 'qaz.managers.brew.install_or_upgrade_formula', 'brew.install_or_upgrade_formula', (['"""bat"""'], {}), "('bat')\n", (365, 372), False, 'from qaz.managers import brew, npm\n'), ((428, 466), 'qaz.managers.brew.install_or_upgrade_formula', 'brew.install_or_upgrade_formula', (['"""bat"""'], {}), "('bat')\n",... |
import os
import pandas as pd
# ASAN
def create_asan_csv():
asan_names = []
for subdir, dir, files in os.walk('D:/2.Data/ASAN/asan-test/biopsy/'):
for file in files:
asan_names.append(file)
df = pd.DataFrame(asan_names, columns=['image_name'])
df['diagnosis'] = None
for i, ... | [
"os.listdir",
"pandas.read_csv",
"pandas.DataFrame",
"pandas.concat",
"os.walk"
] | [((113, 156), 'os.walk', 'os.walk', (['"""D:/2.Data/ASAN/asan-test/biopsy/"""'], {}), "('D:/2.Data/ASAN/asan-test/biopsy/')\n", (120, 156), False, 'import os\n'), ((231, 279), 'pandas.DataFrame', 'pd.DataFrame', (['asan_names'], {'columns': "['image_name']"}), "(asan_names, columns=['image_name'])\n", (243, 279), True,... |
#!/usr/bin/env python
# coding=utf8
from datetime import timedelta
import json
import time
from itsdangerous import Signer
from six import b
import pytest
def json_dec(bs):
return json.loads(bs.decode('ascii'))
def split_cookie(app, rv):
signer = Signer(app.secret_key)
cookie_data = rv.headers['Set-C... | [
"six.b",
"time.sleep",
"pytest.raises",
"itsdangerous.Signer",
"datetime.timedelta"
] | [((262, 284), 'itsdangerous.Signer', 'Signer', (['app.secret_key'], {}), '(app.secret_key)\n', (268, 284), False, 'from itsdangerous import Signer\n'), ((3893, 3913), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(1)'}), '(seconds=1)\n', (3902, 3913), False, 'from datetime import timedelta\n'), ((4354, 4367), 't... |
"""
X86PageBranch - combiner for x86 kernel features:
=================================================
x86 kernel features includes:
* PTI (Page Table Isolation)
* IBPB (Indirect Branch Prediction Barrier)
* IBRS (Indirect Branch Restricted Speculation)
This combiner reads information from debugfs:
Exam... | [
"insights.core.plugins.combiner"
] | [((975, 1062), 'insights.core.plugins.combiner', 'combiner', (['X86PTIEnabled', 'X86IBPBEnabled', 'X86IBRSEnabled'], {'optional': '[X86RETPEnabled]'}), '(X86PTIEnabled, X86IBPBEnabled, X86IBRSEnabled, optional=[\n X86RETPEnabled])\n', (983, 1062), False, 'from insights.core.plugins import combiner\n')] |
from setuptools import setup
setup(
name='gribgrab',
version='0.1.0',
description='Dowload GFS/GDAS data from Nomads',
author='<NAME>',
author_email='<EMAIL>',
packages=['gribgrab'],
install_requires=['requests']
)
| [
"setuptools.setup"
] | [((30, 223), 'setuptools.setup', 'setup', ([], {'name': '"""gribgrab"""', 'version': '"""0.1.0"""', 'description': '"""Dowload GFS/GDAS data from Nomads"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['gribgrab']", 'install_requires': "['requests']"}), "(name='gribgrab', version='0.1.0', d... |
import sys
from contextlib import contextmanager
from io import StringIO
@contextmanager
def stdout_io(new_stdout=None):
old_stdout = sys.stdout
if new_stdout is None:
new_stdout = StringIO()
sys.stdout = new_stdout
yield new_stdout
sys.stdout = old_stdout
def get_output(request: str) ->... | [
"io.StringIO"
] | [((199, 209), 'io.StringIO', 'StringIO', ([], {}), '()\n', (207, 209), False, 'from io import StringIO\n')] |
from random import (choice, randint)
from string import (ascii_lowercase, ascii_uppercase, digits)
from re import search
def id_generator(size=10, chars = ascii_lowercase + ascii_uppercase + digits):
return ''.join(choice(chars) for _ in range(size))
def correctArgs(args):
if len(args) == 1:
return args[0]
... | [
"random.choice",
"random.randint",
"re.search"
] | [((218, 231), 'random.choice', 'choice', (['chars'], {}), '(chars)\n', (224, 231), False, 'from random import choice, randint\n'), ((1985, 2003), 'random.randint', 'randint', (['(1)', 'die[i]'], {}), '(1, die[i])\n', (1992, 2003), False, 'from random import choice, randint\n'), ((490, 510), 're.search', 'search', (['""... |
#! python3.7
from git import Repo
from threading import Thread
import os
import subprocess
project_dictionary = {}
def get_project_name(project_directory="D:\\Code"):
"""
:param project_directory: Project Directory
Build a dictionary of all projects - consisting of {Project Name : Project Directory Path... | [
"os.system",
"os.listdir",
"os.path.join",
"git.Repo"
] | [((418, 447), 'os.listdir', 'os.listdir', (['project_directory'], {}), '(project_directory)\n', (428, 447), False, 'import os\n'), ((1483, 1489), 'git.Repo', 'Repo', ([], {}), '()\n', (1487, 1489), False, 'from git import Repo\n'), ((514, 551), 'os.path.join', 'os.path.join', (['project_directory', 'name'], {}), '(proj... |
from platypus import NSGAII, NSGAIII, DTLZ2, Hypervolume, experiment, calculate, display
if __name__ == "__main__":
algorithms = [NSGAII, (NSGAIII, {"divisions_outer":12})]
problems = [DTLZ2(3)]
# run the experiment
results = experiment(algorithms, problems, nfe=10000, seeds=10)
# calculate the h... | [
"platypus.Hypervolume",
"platypus.display",
"platypus.experiment",
"platypus.DTLZ2",
"platypus.calculate"
] | [((244, 297), 'platypus.experiment', 'experiment', (['algorithms', 'problems'], {'nfe': '(10000)', 'seeds': '(10)'}), '(algorithms, problems, nfe=10000, seeds=10)\n', (254, 297), False, 'from platypus import NSGAII, NSGAIII, DTLZ2, Hypervolume, experiment, calculate, display\n'), ((351, 400), 'platypus.Hypervolume', 'H... |
import mock
import pytest
import app.worker
from app.worker import submit_ep, submit_bangumi
_re_run = 3
@pytest.mark.flaky(reruns=_re_run)
# @celery.task
def test_submit_bangumi():
with mock.patch("app.worker.dispatcher"):
submit_bangumi(2333, "url233")
app.worker.dispatcher.subject.assert_call... | [
"app.worker.submit_bangumi",
"pytest.mark.flaky",
"mock.patch",
"app.worker.submit_ep"
] | [((110, 143), 'pytest.mark.flaky', 'pytest.mark.flaky', ([], {'reruns': '_re_run'}), '(reruns=_re_run)\n', (127, 143), False, 'import pytest\n'), ((352, 385), 'pytest.mark.flaky', 'pytest.mark.flaky', ([], {'reruns': '_re_run'}), '(reruns=_re_run)\n', (369, 385), False, 'import pytest\n'), ((195, 230), 'mock.patch', 'm... |
from django.db import models
from django.utils import timezone
class Category(models.Model):
"""日記のカテゴリ"""
name = models.CharField('タイトル', max_length=255)
def __str__(self):
return self.name
class DiaryQuerySet(models.QuerySet):
def published(self):
return self.filter(created_at__l... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((124, 164), 'django.db.models.CharField', 'models.CharField', (['"""タイトル"""'], {'max_length': '(255)'}), "('タイトル', max_length=255)\n", (140, 164), False, 'from django.db import models\n'), ((393, 432), 'django.db.models.CharField', 'models.CharField', (['"""タイトル"""'], {'max_length': '(32)'}), "('タイトル', max_length=32)... |
#!/usr/bin/env python
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import os
import queue
import sys
import threading
# For json-encoded lines of text sent to the mod
QUEUE = queue.Queue()
CACHE = {"line": "no game data yet"}
def log(message):
f = open(os.path.expanduser("~/mod.log"), ... | [
"json.dumps",
"http.server.HTTPServer",
"threading.Thread",
"queue.Queue",
"os.path.expanduser"
] | [((203, 216), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (214, 216), False, 'import queue\n'), ((1131, 1162), 'http.server.HTTPServer', 'HTTPServer', (["('', port)", 'Handler'], {}), "(('', port), Handler)\n", (1141, 1162), False, 'from http.server import HTTPServer, BaseHTTPRequestHandler\n'), ((1382, 1413), 'thr... |
import inflection
from sqlalchemy import text, DDL, event
from sqlalchemy.dialects.postgresql import UUID, ENUM
from flaskplus.extensions import db
Col = db.Column
def get_enum_from_namedtuple(namedtuple_):
name = inflection.underscore(namedtuple_.__class__.__name__)
return ENUM(*namedtuple_._fields, name=na... | [
"sqlalchemy.text",
"sqlalchemy.event.listens_for",
"sqlalchemy.event.listen",
"sqlalchemy.dialects.postgresql.ENUM",
"inflection.underscore",
"flaskplus.extensions.db.DateTime"
] | [((1246, 1310), 'sqlalchemy.event.listens_for', 'event.listens_for', (['ModelBase', '"""instrument_class"""'], {'propagate': '(True)'}), "(ModelBase, 'instrument_class', propagate=True)\n", (1263, 1310), False, 'from sqlalchemy import text, DDL, event\n'), ((221, 274), 'inflection.underscore', 'inflection.underscore', ... |
"""Contains interfaces for package tools executor."""
import os
import sys
from enum import Enum
import click
from termcolor import colored
from punish.style import AbstractStyle
from pypans import __version__
from pypans.file import Template
from pypans.project import Line, Project, User # noqa: I100
class _Emoji(E... | [
"termcolor.colored",
"click.option",
"click.echo",
"pypans.project.Project",
"click.get_current_context",
"os.system",
"click.command"
] | [((5820, 5835), 'click.command', 'click.command', ([], {}), '()\n', (5833, 5835), False, 'import click\n'), ((5837, 6366), 'click.option', 'click.option', (['"""--start"""'], {'show_default': '(True)', 'is_flag': '(True)', 'help': 'f"""\n\n Starts python project composer:{Line.NEW}\n >>> Configure project packa... |
"""
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | [
"cloudcafe.compute.servers_api.models.servers.Server.deserialize"
] | [((6268, 6309), 'cloudcafe.compute.servers_api.models.servers.Server.deserialize', 'Server.deserialize', (['cls.server_xml', '"""xml"""'], {}), "(cls.server_xml, 'xml')\n", (6286, 6309), False, 'from cloudcafe.compute.servers_api.models.servers import Server\n'), ((8997, 9040), 'cloudcafe.compute.servers_api.models.ser... |
from HartreeParticleDSL.HartreeParticleDSLExceptions import RepeatedNameError, \
InvalidNameError
import HartreeParticleDSL.HartreeParticleDSL as HartreeParticleDSL
class variable_access():
'''
A class to handle variable accesses. Used whenever variab... | [
"HartreeParticleDSL.HartreeParticleDSLExceptions.RepeatedNameError",
"HartreeParticleDSL.HartreeParticleDSL.get_backend",
"HartreeParticleDSL.HartreeParticleDSLExceptions.InvalidNameError"
] | [((5372, 5444), 'HartreeParticleDSL.HartreeParticleDSLExceptions.RepeatedNameError', 'RepeatedNameError', (['f"""{var_name} is already defined in the current scope"""'], {}), "(f'{var_name} is already defined in the current scope')\n", (5389, 5444), False, 'from HartreeParticleDSL.HartreeParticleDSLExceptions import Re... |
import logging
from gehomesdk.erd.converters.abstract import ErdReadOnlyConverter
from gehomesdk.erd.converters.primitives import *
from gehomesdk.erd.values.laundry import ErdTumbleStatus
_LOGGER = logging.getLogger(__name__)
class TumbleStatusConverter(ErdReadOnlyConverter[ErdTumbleStatus]):
def erd_decode(sel... | [
"logging.getLogger"
] | [((201, 228), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (218, 228), False, 'import logging\n')] |
#!/usr/bin/env python3
import requests
import re
import timeit
import json
from bs4 import BeautifulSoup as bs
from getconf import *
# User input
size = '6.5'
use_early_link = True
early_link = 'https://caliroots.com/adidas-originals-tubular-nova-primeknit-s74917/p/53784'
def checkout(): # USA checkout
# TODO: G... | [
"bs4.BeautifulSoup",
"timeit.default_timer",
"requests.session",
"re.compile"
] | [((1381, 1403), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (1401, 1403), False, 'import timeit\n'), ((1415, 1433), 'requests.session', 'requests.session', ([], {}), '()\n', (1431, 1433), False, 'import requests\n'), ((2016, 2038), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', ... |