code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-19 14:00
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lifts', '0001_initial'),
]
operations = [
... | [
"django.db.models.FloatField",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((420, 513), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (436, 513), False, 'from django.db import migrations, models\... |
"""Rfs Module.
Uncompleted/Cancelled RFS Journal Implementation (Journal 2).
"""
from datetime import datetime
import numpy as np
from baseStation import Transmitter
from helpers import CoordinateConverter
from snapshot import *
class RfsAnalog:
def __init__(self, n_of_cell_per_ec, n_of_ec, n_of_ue_per_ec, tr... | [
"datetime.datetime.now",
"numpy.sqrt",
"baseStation.Transmitter"
] | [((2787, 2844), 'baseStation.Transmitter', 'Transmitter', (['CoordinateConverter.GRID_WIDTH', 'BSType.MACRO'], {}), '(CoordinateConverter.GRID_WIDTH, BSType.MACRO)\n', (2798, 2844), False, 'from baseStation import Transmitter\n'), ((2909, 2966), 'baseStation.Transmitter', 'Transmitter', (['CoordinateConverter.GRID_WIDT... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Review(models.Model):
comment = models.CharField(max_length=1000)
conversation = models.IntegerField()
title = models.CharField(max_length=100)
style = models.IntegerField()
satisfaction = models.IntegerField()
wo... | [
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((134, 167), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1000)'}), '(max_length=1000)\n', (150, 167), False, 'from django.db import models\n'), ((184, 205), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (203, 205), False, 'from django.db import models\n'), ((215,... |
# coding=utf-8
"""
Generates Project Structure
"""
import logging
import os
from os import path
import pickle
import shutil
import subprocess
import tempfile
import toposort
from pgdumplib import directory, toc
from pg_lifecycle import common
LOGGER = logging.getLogger(__name__)
class Generate:
"""Generate Pr... | [
"logging.getLogger",
"os.path.exists",
"pickle.dump",
"os.makedirs",
"pgdumplib.directory.Reader",
"os.path.join",
"pg_lifecycle.common.PATHS.values",
"os.path.dirname",
"os.rmdir",
"tempfile.gettempdir",
"os.unlink",
"os.getpid",
"shutil.rmtree",
"os.path.abspath",
"toposort.toposort_fl... | [((256, 283), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'import logging\n'), ((597, 623), 'os.path.abspath', 'path.abspath', (['args.dest[0]'], {}), '(args.dest[0])\n', (609, 623), False, 'from os import path\n'), ((1069, 1101), 'pgdumplib.directory.Reader', 'direc... |
import torch
from torch import nn
from torchvision.models.resnet import resnet50
from torchvision import transforms as T
class Encoder(nn.Module):
def __init__(self):
super().__init__()
self.model = nn.Sequential(
nn.Conv2d(in_channels=3, out_channels=64, kernel_size=3, stride=2, paddi... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Tanh",
"torchvision.models.resnet.resnet50",
"torch.stack",
"torch.nn.init.xavier_normal_",
"torch.nn.Conv2d",
"torch.nn.Upsample",
"torchvision.transforms.Resize",
"torch.cat"
] | [((1869, 1892), 'torch.cat', 'torch.cat', (['(ip, emb)', '(1)'], {}), '((ip, emb), 1)\n', (1878, 1892), False, 'import torch\n'), ((3237, 3337), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(1256)', 'out_channels': 'depth_after_fusion', 'kernel_size': '(1)', 'stride': '(1)', 'padding': '(0)'}), '(in_channels=1... |
import os
import gc
import xnas.core.checkpoint as checkpoint
import xnas.core.config as config
import xnas.core.logging as logging
import xnas.core.meters as meters
from xnas.core.builders import build_space
from xnas.core.config import cfg
from xnas.core.trainer import setup_env, test_epoch
from xnas.datasets.loader... | [
"xnas.core.builders.build_space",
"xnas.core.trainer.test_epoch",
"xnas.core.config.load_cfg_fom_args",
"xnas.core.config.cfg.defrost",
"os.path.join",
"xnas.core.checkpoint.save_checkpoint",
"xnas.datasets.loader._construct_loader",
"xnas.core.config.assert_and_infer_cfg",
"gc.collect",
"xnas.cor... | [((531, 557), 'xnas.core.config.load_cfg_fom_args', 'config.load_cfg_fom_args', ([], {}), '()\n', (555, 557), True, 'import xnas.core.config as config\n'), ((558, 587), 'xnas.core.config.assert_and_infer_cfg', 'config.assert_and_infer_cfg', ([], {}), '()\n', (585, 587), True, 'import xnas.core.config as config\n'), ((5... |
import json
import collections
import pandas as pd
from .node_information.provider_nodes import ProviderNodes
from autoscalingsim.utils.metric.metric_categories.size import Size
from autoscalingsim.utils.metric.metric_categories.numeric import Numeric
from autoscalingsim.utils.price import PricePerUnitTime
from autos... | [
"autoscalingsim.utils.price.PricePerUnitTime",
"autoscalingsim.utils.metric.metric_categories.size.Size.to_metric",
"pandas.Timedelta",
"autoscalingsim.utils.error_check.ErrorChecker.key_check_and_load",
"autoscalingsim.utils.metric.metric_categories.numeric.Numeric.to_metric",
"autoscalingsim.utils.credi... | [((643, 655), 'json.load', 'json.load', (['f'], {}), '(f)\n', (652, 655), False, 'import json\n'), ((736, 810), 'autoscalingsim.utils.error_check.ErrorChecker.key_check_and_load', 'ErrorChecker.key_check_and_load', (['"""provider"""', 'provider_config', 'cls.__name__'], {}), "('provider', provider_config, cls.__name__)... |
import ssl
import datetime
ssl.match_hostname = lambda cert, hostname: True
class MQTTClient():
def __init__(self,client):
#super(MQTTClient, self).__init__(cname,**kwargs)
self.client = client
self.broker_host = "192.168.1.4"
self.port = 8883
self.topic_data = "Trafficlight/durati... | [
"datetime.datetime.now"
] | [((602, 625), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (623, 625), False, 'import datetime\n'), ((801, 824), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (822, 824), False, 'import datetime\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-02-15 21:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediane', '0022_auto_20180215_2155'),
]
operations = [
migrations.AlterFiel... | [
"django.db.models.TextField"
] | [((406, 535), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'help_text': '"""the consensus(es) computed for the given dataset and job\'s distance"""', 'null': '(True)'}), '(blank=True, help_text=\n "the consensus(es) computed for the given dataset and job\'s distance",\n null=True)\n'... |
import json
import logging
from base64 import b64encode
import pandas as pd
from lal.classifiers.base_classifier import FolderBasedDataClassifier
class ImageObjectClassifier(FolderBasedDataClassifier):
logger = logging.getLogger(__name__)
def __init__(self, folder, queries_df, config):
"""
... | [
"logging.getLogger",
"pandas.Series",
"json.loads",
"json.dumps",
"pandas.notnull"
] | [((219, 246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (236, 246), False, 'import logging\n'), ((1273, 1299), 'json.dumps', 'json.dumps', (['cleaned_labels'], {}), '(cleaned_labels)\n', (1283, 1299), False, 'import json\n'), ((1498, 1515), 'json.loads', 'json.loads', (['label'], {})... |
from django.shortcuts import render
from .forms import SuperForm
# Create your views here.
# For form function
def index(request):
# if information is entered
if(request.method =="POST"):
superForm = SuperForm(request.POST)
# so info has to be entered
if superForm.is_valid():
... | [
"django.shortcuts.render"
] | [((654, 699), 'django.shortcuts.render', 'render', (['request', '"""SuperHeroApp/thankyou.html"""'], {}), "(request, 'SuperHeroApp/thankyou.html')\n", (660, 699), False, 'from django.shortcuts import render\n'), ((762, 806), 'django.shortcuts.render', 'render', (['request', '"""SuperHeroApp/welcome.html"""'], {}), "(re... |
from osbot_aws.apis.Lambda import Lambda
from gw_bot.api.Slack_Commands_Helper import Slack_Commands_Helper
from gw_bot.api.commands.Maps_Commands import Maps_Commands
from osbot_utils.utils import Misc
def use_command_class(slack_event, params, target_class):
channel = Misc.get_value(s... | [
"gw_bot.api.Slack_Commands_Helper.Slack_Commands_Helper",
"osbot_aws.apis.Lambda.Lambda",
"osbot_utils.utils.Misc.get_value"
] | [((304, 342), 'osbot_utils.utils.Misc.get_value', 'Misc.get_value', (['slack_event', '"""channel"""'], {}), "(slack_event, 'channel')\n", (318, 342), False, 'from osbot_utils.utils import Misc\n'), ((366, 401), 'osbot_utils.utils.Misc.get_value', 'Misc.get_value', (['slack_event', '"""user"""'], {}), "(slack_event, 'us... |
import game as game_
import estest
from esp import Record, Group
def test_read(plugin):
with plugin.open() as fd:
while True:
rec = Record.read_from(fd)
if rec is None: break
#print "=== %s: size %s ===" % (rec, rec.record_size())
flag_list = ... | [
"esp.Record.read_from",
"game.Skyrim"
] | [((719, 733), 'game.Skyrim', 'game_.Skyrim', ([], {}), '()\n', (731, 733), True, 'import game as game_\n'), ((168, 188), 'esp.Record.read_from', 'Record.read_from', (['fd'], {}), '(fd)\n', (184, 188), False, 'from esp import Record, Group\n')] |
#
# Copyright 2021 Budapest Quantum Computing Group
#
# 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... | [
"piquasso.Config",
"piquasso.Q",
"numpy.sqrt",
"piquasso.PureFockSimulator",
"piquasso.Program",
"piquasso.ParticleNumberMeasurement",
"piquasso.StateVector"
] | [((963, 988), 'piquasso.PureFockSimulator', 'pq.PureFockSimulator', ([], {'d': '(3)'}), '(d=3)\n', (983, 988), True, 'import piquasso as pq\n'), ((2096, 2121), 'piquasso.PureFockSimulator', 'pq.PureFockSimulator', ([], {'d': '(3)'}), '(d=3)\n', (2116, 2121), True, 'import piquasso as pq\n'), ((3086, 3105), 'piquasso.Co... |
import time
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Layer
from tensorflow.python.keras.utils import tf_utils
from common import utils
from common.ops import ops as custom_ops
from common.ops import transformation
from common.ops.em_routing import em_... | [
"tensorflow.tile",
"numpy.prod",
"numpy.sqrt",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"tensorflow.nn.moments",
"tensorflow.split",
"tensorflow.multiply",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Dense",
"common.utils.k... | [((22707, 22749), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['inputs', 'axis'], {'keepdims': '(True)'}), '(inputs, axis, keepdims=True)\n', (22720, 22749), True, 'import tensorflow as tf\n'), ((22786, 22799), 'tensorflow.square', 'tf.square', (['x1'], {}), '(x1)\n', (22795, 22799), True, 'import tensorflow as tf\n'), ... |
from sqlalchemy import *
import sqlalchemy.schema
import uuid
from sqlalchemy.sql import select
from migrate import *
import migrate.changeset
from migrate.changeset.constraint import ForeignKeyConstraint, PrimaryKeyConstraint
metadata = MetaData()
def make_uuid():
return unicode(uuid.uuid4())
## Tables and col... | [
"migrate.changeset.constraint.ForeignKeyConstraint",
"sqlalchemy.sql.select",
"uuid.uuid4"
] | [((288, 300), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (298, 300), False, 'import uuid\n'), ((4529, 4627), 'migrate.changeset.constraint.ForeignKeyConstraint', 'ForeignKeyConstraint', (['constraint.columns', 'foreign_key_cols'], {'name': 'constraint.name', 'table': 'table'}), '(constraint.columns, foreign_key_cols... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | [
"pulumi.getter",
"warnings.warn",
"pulumi.ResourceOptions",
"pulumi.get"
] | [((6860, 6898), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""authorizationKey"""'}), "(name='authorizationKey')\n", (6873, 6898), False, 'import pulumi\n'), ((7082, 7126), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""authorizationUseStatus"""'}), "(name='authorizationUseStatus')\n", (7095, 7126), False, '... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow_model_optimization.python.core.quantization.keras.quantize_emulate_wrapper.QuantizeEmulateWrapper",
"tensorflow_model_optimization.python.core.quantization.keras.quantize_annotate.QuantizeAnnotate",
"tensorflow.python.keras.models.clone_model"
] | [((7241, 7345), 'tensorflow.python.keras.models.clone_model', 'keras.models.clone_model', (['model_copy'], {'input_tensors': 'None', 'clone_function': '_add_quant_emulate_wrapper'}), '(model_copy, input_tensors=None, clone_function=\n _add_quant_emulate_wrapper)\n', (7265, 7345), False, 'from tensorflow.python impor... |
import itertools
#from tqdm import tqdm
from collections import Counter
#from arrs import *
import numpy as np
#import random
import math
#import ctypes
from sympy import primefactors, sieve
from sympy.ntheory import qs
from tqdm import tqdm
sieve._reset() # this line for doctest only
sieve.extend_to_no(40_000)
pri... | [
"tqdm.tqdm",
"sympy.sieve._reset",
"itertools.combinations",
"sympy.sieve.extend_to_no",
"itertools.permutations"
] | [((246, 260), 'sympy.sieve._reset', 'sieve._reset', ([], {}), '()\n', (258, 260), False, 'from sympy import primefactors, sieve\n'), ((290, 315), 'sympy.sieve.extend_to_no', 'sieve.extend_to_no', (['(40000)'], {}), '(40000)\n', (308, 315), False, 'from sympy import primefactors, sieve\n'), ((1165, 1194), 'itertools.per... |
import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connections[0]
self.safe_create_table(
conn,
"test", "create table test (data varchar(10))",
... | [
"warnings.catch_warnings",
"warnings.filterwarnings"
] | [((1028, 1064), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {'record': '(True)'}), '(record=True)\n', (1051, 1064), False, 'import warnings\n'), ((1085, 1118), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""always"""'], {}), "('always')\n", (1108, 1118), False, 'import warnings\n')] |
from lib.base import JamBase
class IrcAccount(JamBase):
def __init__(self,
server,
nickname,
username,
password,
hostname='-',
servername='-',
realname='JamBot'):
JamBase.__init__(self)... | [
"lib.base.JamBase.__init__"
] | [((298, 320), 'lib.base.JamBase.__init__', 'JamBase.__init__', (['self'], {}), '(self)\n', (314, 320), False, 'from lib.base import JamBase\n')] |
from transliterate import to_cyrillic,to_latin
import telebot
TOKEN='<KEY>'
bot = telebot.TeleBot(TOKEN, parse_mode=None) # You can set parse_mode by default. HTML or MARKDOWN
@bot.message_handler(commands=['start'])
def send_welcome(message):
javob = "<NAME>,<NAME>"
javob +="\n Matn kiriting: "
bot.reply_... | [
"transliterate.to_latin",
"transliterate.to_cyrillic",
"telebot.TeleBot"
] | [((82, 121), 'telebot.TeleBot', 'telebot.TeleBot', (['TOKEN'], {'parse_mode': 'None'}), '(TOKEN, parse_mode=None)\n', (97, 121), False, 'import telebot\n'), ((455, 471), 'transliterate.to_cyrillic', 'to_cyrillic', (['mgj'], {}), '(mgj)\n', (466, 471), False, 'from transliterate import to_cyrillic, to_latin\n'), ((494, ... |
"""Heuristic push policy.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from robovat.envs.push import heuristic_push_sampler
from robovat.policies import policy
class HeuristicPushPolicy(policy.Policy):
"""Heuristic push policy."""
def __in... | [
"robovat.envs.push.heuristic_push_sampler.HeuristicPushSampler"
] | [((622, 899), 'robovat.envs.push.heuristic_push_sampler.HeuristicPushSampler', 'heuristic_push_sampler.HeuristicPushSampler', ([], {'cspace_low': 'config.ACTION.CSPACE.LOW', 'cspace_high': 'config.ACTION.CSPACE.HIGH', 'translation_x': 'config.ACTION.MOTION.TRANSLATION_X', 'translation_y': 'config.ACTION.MOTION.TRANSLAT... |
from fastapi import APIRouter, Depends, HTTPException
from db.crud import get_db
import schemas
from sqlalchemy.orm import Session
from db import crud, models
from verify import get_current_user
router = APIRouter()
@router.post('/', response_model=schemas.Comment)
async def email_subscribe(comment: schemas.Comment... | [
"fastapi.HTTPException",
"fastapi.Depends",
"fastapi.APIRouter",
"db.crud.create_comment",
"db.crud.get_place_by_id"
] | [((206, 217), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (215, 217), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((340, 355), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (347, 355), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((377, 402), 'fastapi... |
# This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) <NAME>.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import os
from lxml import etree, objectify
from ...util import... | [
"lxml.objectify.parse",
"lxml.etree.ElementNamespaceClassLookup",
"lxml.etree.parse",
"lxml.objectify.makeparser"
] | [((645, 680), 'lxml.etree.ElementNamespaceClassLookup', 'etree.ElementNamespaceClassLookup', ([], {}), '()\n', (678, 680), False, 'from lxml import etree, objectify\n'), ((926, 985), 'lxml.objectify.makeparser', 'objectify.makeparser', ([], {'remove_comments': '(True)', 'no_network': '(True)'}), '(remove_comments=True,... |
"""Download the data from dropbox links.
Example:
Import statement::
from src.data_loading import get_data
"""
import os
import shutil
import requests
import zipfile
from tqdm import tqdm
from src.utils import timeit
from src.constants import (
OCEAN_PATH,
ATMOS_PATH,
DATA_PATH,
FIGURE_DA... | [
"os.path.exists",
"zipfile.ZipFile",
"os.path.join",
"os.path.splitext",
"requests.get",
"os.mkdir",
"shutil.rmtree",
"os.remove"
] | [((664, 689), 'os.path.join', 'os.path.join', (['direc', 'name'], {}), '(direc, name)\n', (676, 689), False, 'import os\n'), ((744, 774), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (756, 774), False, 'import requests\n'), ((1103, 1124), 'os.remove', 'os.remove', (['write_pa... |
#!/usr/bin/env python3
"""scapy-dhcp-listener.py
Listen for DHCP packets using scapy to learn when LAN
hosts request IP addresses from DHCP Servers.
Copyright (C) 2018 <NAME>
https://jcutrer.com/python/scapy-dhcp-listener
License Dual MIT, 0BSD
Extended by jkulawik, 2020
"""
from __future__ import print_function
fro... | [
"inspect.getsourcefile",
"scapy.layers.l2.getmacbyip",
"datetime.date.today",
"sc_utils.mac_vendor.get_str"
] | [((1535, 1560), 'inspect.getsourcefile', 'getsourcefile', (['(lambda : 0)'], {}), '(lambda : 0)\n', (1548, 1560), False, 'from inspect import getsourcefile\n'), ((1627, 1639), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1637, 1639), False, 'from datetime import date\n'), ((3939, 3966), 'sc_utils.mac_vendor.... |
from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from . import login_manager
from datetime import datetime, date
@login_manager.user_loader
def load_user(userName):
return User.query.get(str(userName))
class User(UserMixin, db.Model):
... | [
"werkzeug.security.generate_password_hash",
"werkzeug.security.check_password_hash"
] | [((1127, 1159), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (1149, 1159), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((1217, 1269), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.secured_pa... |
# The MIT License (MIT)
#
# Copyright (c) 2018 <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, me... | [
"ctypes.c_int",
"six.itervalues",
"six.iteritems",
"six.with_metaclass"
] | [((7053, 7089), 'six.with_metaclass', 'six.with_metaclass', (['_EnumerationMeta'], {}), '(_EnumerationMeta)\n', (7071, 7089), False, 'import six\n'), ((6073, 6099), 'six.iteritems', 'six.iteritems', (['enum_values'], {}), '(enum_values)\n', (6086, 6099), False, 'import six\n'), ((6554, 6580), 'six.iteritems', 'six.iter... |
# Undergraduate Student: <NAME>
# Professor: <NAME>
# Federal University of Uberlândia - UFU, Fluid Mechanics Laboratory - MFLab, Block 5P, Uberlândia, MG, Brazil
# Third exercise: Fibonacci sequence - by a common loop
import numpy as np
import time
n = int(input("Enter the n indices: "))
Fbn=0 # Value of the first... | [
"numpy.array",
"time.time"
] | [((648, 659), 'time.time', 'time.time', ([], {}), '()\n', (657, 659), False, 'import time\n'), ((971, 987), 'numpy.array', 'np.array', (['[0, 1]'], {}), '([0, 1])\n', (979, 987), True, 'import numpy as np\n'), ((1167, 1178), 'time.time', 'time.time', ([], {}), '()\n', (1176, 1178), False, 'import time\n'), ((735, 746),... |
#!/usr/bin/env python3
import pandas as pd
import sys
# *****************************************************************************
# Main
# *****************************************************************************
if __name__ == "__main__":
# ------------------------------------------------------... | [
"pandas.read_csv",
"sys.exit"
] | [((911, 972), 'pandas.read_csv', 'pd.read_csv', (['pathFileDaphne'], {'sep': '""" """', 'skiprows': '(1)', 'header': 'None'}), "(pathFileDaphne, sep=' ', skiprows=1, header=None)\n", (922, 972), True, 'import pandas as pd\n'), ((992, 1042), 'pandas.read_csv', 'pd.read_csv', (['pathFileMonetDB'], {'sep': '""","""', 'hea... |
with open("pokemon_list.txt", "r") as f:
pokemon_lista = f.readlines()
pokemon_lista = [elemento.strip('\n') for elemento in pokemon_lista]
import data as d
def validate(name, p_l = pokemon_lista, mensaje = d.validacion_pokemon()):
if name =='codigo-cero':
name = 'type-null'
while name not in ... | [
"data.validacion_pokemon"
] | [((217, 239), 'data.validacion_pokemon', 'd.validacion_pokemon', ([], {}), '()\n', (237, 239), True, 'import data as d\n')] |
import os
import glob
import sys
from random import randint
import tensorflow as tf
import util
import pandas as pd
import modelctc1
import json
import ast
import numpy as np
def convert_word(indices, codes, shape):
words = []
word = []
i = 0
j=0
for index in indices:
if i!=index[0]:
... | [
"modelctc1.model",
"tensorflow.Session",
"tensorflow.train.Saver",
"util.dataset",
"tensorflow.train.get_checkpoint_state",
"tensorflow.ConfigProto"
] | [((656, 705), 'tensorflow.train.get_checkpoint_state', 'tf.train.get_checkpoint_state', (['"""./checkpoint_10/"""'], {}), "('./checkpoint_10/')\n", (685, 705), True, 'import tensorflow as tf\n'), ((2416, 2439), 'modelctc1.model', 'modelctc1.model', (['config'], {}), '(config)\n', (2431, 2439), False, 'import modelctc1\... |
import os
GITHUB_PAT = os.environ.get('GITHUB_PAT', None)
| [
"os.environ.get"
] | [((25, 59), 'os.environ.get', 'os.environ.get', (['"""GITHUB_PAT"""', 'None'], {}), "('GITHUB_PAT', None)\n", (39, 59), False, 'import os\n')] |
#
# Copyright (c) 2020 it-eXperts IT-Dienstleistungs GmbH.
#
# This file is part of tagger
# (see https://github.com/IT-EXPERTS-AT/tagger).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional informatio... | [
"configparser.ConfigParser",
"taggercore.model.Tag",
"pathlib.Path",
"typer.Typer",
"taggercli.commands.exceptions.IllegalInputError",
"rich.console.Console",
"typer.prompt",
"taggercli.config.TAGGER_PATH.joinpath",
"taggercli.config.Config"
] | [((1227, 1240), 'typer.Typer', 'typer.Typer', ([], {}), '()\n', (1238, 1240), False, 'import typer\n'), ((1252, 1261), 'rich.console.Console', 'Console', ([], {}), '()\n', (1259, 1261), False, 'from rich.console import Console\n'), ((2449, 2476), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n... |
import sys
import os
from os.path import expanduser
from PyQt5.QtWidgets import *
from PyQt5.QtMultimedia import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
import time
scriptDir = os.path.dirname(os.path.realpath(__file__))
SCREEN,_ = loadUiType(os.path.join(os... | [
"os.path.realpath",
"os.path.dirname",
"os.path.expanduser",
"time.sleep"
] | [((254, 280), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (270, 280), False, 'import os\n'), ((318, 343), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (333, 343), False, 'import os\n'), ((393, 418), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(... |
from pyautd3 import Pyautd
ctl = Pyautd()
#ctl.open("127.0.0.1")
ctl.add_device([0,0,0], [0,0,0])
ctl.focal_point([0,0,0])
ctl.stop() | [
"pyautd3.Pyautd"
] | [((35, 43), 'pyautd3.Pyautd', 'Pyautd', ([], {}), '()\n', (41, 43), False, 'from pyautd3 import Pyautd\n')] |
"""
Module contain classes for checking raids commands successful conditions
"""
from datetime import datetime
from typing import Optional
from discord.ext.commands import Context
from core.command_gates.common import log_gate_check_failed, log_raid_gate_check_failed
from core.command_gates.gate import CommandsGate
f... | [
"core.users_interactor.senders.UsersSender.send_user_wrong_raid_places",
"core.commands.registration_controller.RegistrationController.register_captain",
"core.guild_managers.raids_keeper.RaidsKeeper.get_raids_by_captain_name",
"core.guild_managers.raids_keeper.RaidsKeeper.has_raid_with_raid_item",
"core.us... | [((6437, 6483), 'core.guild_managers.raids_keeper.RaidsKeeper.has_raid_with_raid_item', 'RaidsKeeper.has_raid_with_raid_item', (['raid_item'], {}), '(raid_item)\n', (6472, 6483), False, 'from core.guild_managers.raids_keeper import RaidsKeeper\n'), ((7571, 7632), 'core.guild_managers.raids_keeper.RaidsKeeper.get_captai... |
# import numpy as np
import jax.numpy as np
from jax import jacfwd
from jax.ops import index_update
def C_b_v(angles):
"""
:param angles: Euler angles, np.ndarray, shape: (3,1)
:return: transition matrix from b-frame to v-frame, np.ndarray, shape: (3,3)
"""
phi, theta, psi = angles.flatten()
... | [
"jax.numpy.zeros",
"jax.numpy.cos",
"jax.jacfwd",
"jax.numpy.tan",
"jax.ops.index_update",
"jax.numpy.array",
"jax.numpy.sin",
"jax.numpy.identity"
] | [((9210, 9230), 'jax.jacfwd', 'jacfwd', (['f'], {'argnums': '(0)'}), '(f, argnums=0)\n', (9216, 9230), False, 'from jax import jacfwd\n'), ((9341, 9361), 'jax.jacfwd', 'jacfwd', (['f'], {'argnums': '(1)'}), '(f, argnums=1)\n', (9347, 9361), False, 'from jax import jacfwd\n'), ((9472, 9492), 'jax.jacfwd', 'jacfwd', (['h... |
__author__ = '<NAME>'
__email__ = '<EMAIL>'
from os.path import join, dirname
__version__ = open(join(dirname(__file__), 'VERSION')).read().strip()
__all__ = ['Experiment', 'compress', 'decompress',
'attribute', 'attribute_as_str', 'attributes']
from .experiment import (Experiment, compress, decompress,
... | [
"os.path.dirname"
] | [((102, 119), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (109, 119), False, 'from os.path import join, dirname\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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... | [
"workspaceclient.common.utils.remove_empty_from_dict"
] | [((948, 1056), 'workspaceclient.common.utils.remove_empty_from_dict', 'utils.remove_empty_from_dict', (["{'user_name': name, 'user_email': email, 'marker': marker, 'limit': limit}"], {}), "({'user_name': name, 'user_email': email,\n 'marker': marker, 'limit': limit})\n", (976, 1056), False, 'from workspaceclient.com... |
# Copyright Buildbot Team Members
#
# 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, dist... | [
"random.Random",
"hashlib.new"
] | [((1588, 1604), 'hashlib.new', 'new_hash', (['"""sha1"""'], {}), "('sha1')\n", (1596, 1604), True, 'from hashlib import new as new_hash\n'), ((1805, 1824), 'random.Random', 'Random', (['hashed_seed'], {}), '(hashed_seed)\n', (1811, 1824), False, 'from random import Random\n')] |
import numpy as np
import helper
import tensorflow as tf
from tensorflow.python.layers.core import Dense
from datetime import datetime
# Build the Neural Network
# Components necessary to build a Sequence-to-Sequence model by implementing the following functions below:
#
# - model_inputs
# - process_decoder_input
# -... | [
"tensorflow.shape",
"numpy.equal",
"tensorflow.truncated_normal_initializer",
"tensorflow.contrib.seq2seq.BasicDecoder",
"tensorflow.Graph",
"tensorflow.nn.embedding_lookup",
"tensorflow.contrib.seq2seq.sequence_loss",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.nn.dynamic_rnn",
... | [((13606, 13630), 'helper.load_preprocess', 'helper.load_preprocess', ([], {}), '()\n', (13628, 13630), False, 'import helper\n'), ((13728, 13738), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (13736, 13738), True, 'import tensorflow as tf\n'), ((15813, 15861), 'tensorflow.summary.FileWriter', 'tf.summary.FileWrit... |
import os
import json
import shutil
import tempfile
import contextlib
import functools
from collections import OrderedDict
import numpy as np
import h5py
from quilted.h5blockstore import H5BlockStore
@contextlib.contextmanager
def autocleaned_tmpdir():
tmpdir = tempfile.mkdtemp()
yield tmpdir
shutil.rmtr... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"sys.argv.append",
"functools.wraps",
"h5py.File",
"numpy.array",
"tempfile.mkdtemp",
"shutil.rmtree",
"json.load",
"quilted.h5blockstore.H5BlockStore",
"nose.run"
] | [((269, 287), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (285, 287), False, 'import tempfile\n'), ((309, 330), 'shutil.rmtree', 'shutil.rmtree', (['tmpdir'], {}), '(tmpdir)\n', (322, 330), False, 'import shutil\n'), ((370, 388), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (385, 388), Fals... |
from src.abstract.ExchangeClientWrapper import ExchangeClientWrapper
from binance.client import Client
import pandas as pd
from binance.exceptions import BinanceAPIException
import time
import requests
import json
class BinanceClientWrapper(ExchangeClientWrapper):
@staticmethod
def createInstance(api_key, api... | [
"binance.client.Client",
"json.loads",
"requests.get",
"time.sleep",
"pandas.concat",
"pandas.DataFrame",
"time.time",
"pandas.to_datetime"
] | [((354, 381), 'binance.client.Client', 'Client', (['api_key', 'api_secret'], {}), '(api_key, api_secret)\n', (360, 381), False, 'from binance.client import Client\n'), ((1871, 1885), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1883, 1885), True, 'import pandas as pd\n'), ((3013, 3057), 'pandas.to_datetime', ... |
import os
from datetime import datetime
import json
import pandas as pd
from typing import List
import uvicorn
from fastapi import FastAPI, Request
from fastapi.encoders import jsonable_encoder
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse, Response
from fastapi.templati... | [
"retrieve_definition.retrieve_definition",
"fastapi.FastAPI",
"uvicorn.run",
"viz_leitner.leitner_bar",
"fastapi.templating.Jinja2Templates",
"fastapi.responses.HTMLResponse",
"fastapi.encoders.jsonable_encoder",
"fastapi.responses.Response",
"autogenerate_decks.autogenerate"
] | [((605, 614), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (612, 614), False, 'from fastapi import FastAPI, Request\n'), ((812, 850), 'fastapi.templating.Jinja2Templates', 'Jinja2Templates', ([], {'directory': '"""templates"""'}), "(directory='templates')\n", (827, 850), False, 'from fastapi.templating import Jinja2... |
from sqlite_utils import Database
db = Database("bird_database.db")
# This creates a "birds" table if one does not already exist:
db["birds"].insert_all([
{"id": 1, "age": 4, "name": "Buzzy"},
{"id": 2, "age": 2, "name": "Chirpy"}
], pk="id")
| [
"sqlite_utils.Database"
] | [((41, 69), 'sqlite_utils.Database', 'Database', (['"""bird_database.db"""'], {}), "('bird_database.db')\n", (49, 69), False, 'from sqlite_utils import Database\n')] |
from django.test import TestCase
from devnotes.models import Devnote
class DevnoteTestCases(TestCase):
def setUp(self):
Devnote.objects.create(name='testnote',
description='testnote description')
def test_retrieve_note(self):
"""retrieve the testnote... | [
"devnotes.models.Devnote.objects.order_by",
"devnotes.models.Devnote.objects.all",
"devnotes.models.Devnote.objects.create"
] | [((133, 208), 'devnotes.models.Devnote.objects.create', 'Devnote.objects.create', ([], {'name': '"""testnote"""', 'description': '"""testnote description"""'}), "(name='testnote', description='testnote description')\n", (155, 208), False, 'from devnotes.models import Devnote\n'), ((505, 578), 'devnotes.models.Devnote.o... |
import numpy as np
from numba import njit
@njit(cache=True)
def calculate_goodness_of_fit(table):
n = table.shape[0]
m = table.sum()
row_sum = table.sum(axis=0).astype(np.float64)
col_sum = table.sum(axis=1).astype(np.float64)
e = np.dot(col_sum.reshape(n, 1), row_sum.reshape(1, 2)) / m
s = np... | [
"numpy.random.choice",
"numpy.zeros_like",
"numba.njit",
"numpy.arange"
] | [((45, 61), 'numba.njit', 'njit', ([], {'cache': '(True)'}), '(cache=True)\n', (49, 61), False, 'from numba import njit\n'), ((376, 392), 'numba.njit', 'njit', ([], {'cache': '(True)'}), '(cache=True)\n', (380, 392), False, 'from numba import njit\n'), ((645, 661), 'numba.njit', 'njit', ([], {'cache': '(True)'}), '(cac... |
import numpy as np
def trust_region_solver(M, g, d_max, max_iter=2000, stepsize=1.0e-3):
"""Solves trust region problem with gradient descent
maximize 1/2 * x^T M x + g^T x
s.t. |x|_2 <= d_max
initialize x = g / |g| * d_max
"""
x = g / np.linalg.norm(g) * d_max
for _ in range(max_iter):
... | [
"numpy.linalg.norm"
] | [((261, 278), 'numpy.linalg.norm', 'np.linalg.norm', (['g'], {}), '(g)\n', (275, 278), True, 'import numpy as np\n'), ((429, 446), 'numpy.linalg.norm', 'np.linalg.norm', (['x'], {}), '(x)\n', (443, 446), True, 'import numpy as np\n')] |
__all__ = ['export_fits']
import sys
import copy
import shutil
import pathlib
from datetime import datetime, timedelta
import numpy as np
import h5py
from astropy.io import fits
import sunpy.coordinates as coords
from eispac.core.eisfitresult import EISFitResult
from eispac.core.save_fit import lineid_to_name
# funct... | [
"astropy.io.fits.PrimaryHDU",
"pathlib.Path",
"astropy.io.fits.HDUList",
"astropy.io.fits.Column",
"copy.deepcopy",
"astropy.io.fits.Header",
"astropy.io.fits.BinTableHDU.from_columns",
"eispac.core.save_fit.lineid_to_name"
] | [((2698, 2743), 'eispac.core.save_fit.lineid_to_name', 'lineid_to_name', (["fit_result.fit['line_ids'][0]"], {}), "(fit_result.fit['line_ids'][0])\n", (2712, 2743), False, 'from eispac.core.save_fit import lineid_to_name\n'), ((3282, 3325), 'copy.deepcopy', 'copy.deepcopy', (["fit_result.meta['mod_index']"], {}), "(fit... |
# blender modules
import bpy
# addon modules
from . import base
from .. import edit_helpers
class XRAY_PT_edit_helper_object(base.XRayPanel):
bl_context = 'object'
bl_label = base.build_label('Edit Helper')
@classmethod
def poll(cls, context):
return edit_helpers.base.get_object_helper(conte... | [
"bpy.utils.unregister_class",
"bpy.utils.register_class"
] | [((492, 544), 'bpy.utils.register_class', 'bpy.utils.register_class', (['XRAY_PT_edit_helper_object'], {}), '(XRAY_PT_edit_helper_object)\n', (516, 544), False, 'import bpy\n'), ((569, 623), 'bpy.utils.unregister_class', 'bpy.utils.unregister_class', (['XRAY_PT_edit_helper_object'], {}), '(XRAY_PT_edit_helper_object)\n... |
"""
Models for the REST interface
"""
from typing import Any, Dict, List, Optional, Tuple, Union
from pydantic import BaseConfig, BaseModel, constr, validator, Schema
from .common_models import KeywordSet, Molecule, ObjectId
from .gridoptimization import GridOptimizationInput
from .model_utils import json_encoders
fr... | [
"pydantic.constr",
"pydantic.Schema",
"pydantic.validator"
] | [((1843, 1863), 'pydantic.constr', 'constr', ([], {'regex': '"""null"""'}), "(regex='null')\n", (1849, 1863), False, 'from pydantic import BaseConfig, BaseModel, constr, validator, Schema\n'), ((3102, 3167), 'pydantic.Schema', 'Schema', (['...'], {'description': '"""The ID\'s of the records to be computed"""'}), '(...,... |
# Librerias Future
from __future__ import unicode_literals
# Librerias Django
from django.shortcuts import HttpResponse, render
def IndexEasy(request):
return render(request, 'base/index.html')
| [
"django.shortcuts.render"
] | [((166, 200), 'django.shortcuts.render', 'render', (['request', '"""base/index.html"""'], {}), "(request, 'base/index.html')\n", (172, 200), False, 'from django.shortcuts import HttpResponse, render\n')] |
from tkinter import *
from tkinter import messagebox
import tkinter.font as tkFont
import os
path = os.path.expanduser("~/")
host = ""
port = ""
try:
file = open(path + "clientConfig.config", "r")
file.readline()
host = file.readline().replace("ip:", "").replace("\n", "")
port = file.readline().repla... | [
"tkinter.messagebox.showwarning",
"tkinter.messagebox.showinfo",
"os.path.expanduser"
] | [((101, 125), 'os.path.expanduser', 'os.path.expanduser', (['"""~/"""'], {}), "('~/')\n", (119, 125), False, 'import os\n'), ((3611, 3701), 'tkinter.messagebox.showinfo', 'messagebox.showinfo', ([], {'title': '"""Failure - IM"""', 'message': '"""IP e Porta devem ser preenchidos"""'}), "(title='Failure - IM', message=\n... |
import re
from collections import defaultdict, namedtuple
from pathlib import Path
from openpecha.formatters.layers import AnnType, SubText
from openpecha.utils import load_yaml
INFO = "[INFO] {}"
class Serialize(object):
"""
This class is used when serializing the .opf into anything else (Markdown, TEI, et... | [
"re.split",
"pathlib.Path",
"openpecha.utils.load_yaml",
"collections.defaultdict",
"re.search"
] | [((832, 846), 'pathlib.Path', 'Path', (['opf_path'], {}), '(opf_path)\n', (836, 846), False, 'from pathlib import Path\n'), ((2914, 2931), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (2925, 2931), False, 'from collections import defaultdict, namedtuple\n'), ((5708, 5724), 'collections.defaultd... |
# Generated by Django 2.1.12 on 2020-02-29 17:34
import ckeditor.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Person',
fields=[
(... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((326, 419), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (342, 419), False, 'from django.db import migrations, models\... |
#!/usr/bin/env python
import math
import os
import pathlib
import statistics
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
# Some matplotlib config first:
mpl.use('Agg') # avoid the need for an X server
mpl.rcParams['axes.spines.right'] = False # no right spine
mpl.rcParams['axes.spines.top'] =... | [
"matplotlib.pyplot.savefig",
"math.ceil",
"os.makedirs",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"pathlib.Path",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.rc",
"matplotlib.pyplot.scatter",
"sys.exit",
"matplotlib.pyplot.ylim",
... | [((180, 194), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (187, 194), True, 'import matplotlib as mpl\n'), ((342, 372), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {}), "('font', **{'size': 11})\n", (348, 372), True, 'import matplotlib as mpl\n'), ((2902, 2919), 'matplotlib.pyplot.ylim', 'plt.ylim', ... |
#! /usr/bin/env python3
def readExtsFile(path):
exts = []
with open(path, 'r') as f:
for l in f.readlines():
ext = l.strip()
if ext.startswith('#'):
continue
if len(ext):
exts.append(ext)
return exts
if __name__ == "__main__":
... | [
"reg.Registry",
"sys.path.insert",
"xml.etree.ElementTree.parse",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"os.path.realpath",
"platform.system"
] | [((500, 530), 'os.path.join', 'path.join', (['rootDir', '"""registry"""'], {}), "(rootDir, 'registry')\n", (509, 530), False, 'from os import path\n'), ((535, 561), 'sys.path.insert', 'sys.path.insert', (['(0)', 'regDir'], {}), '(0, regDir)\n', (550, 561), False, 'import sys\n'), ((631, 697), 'argparse.ArgumentParser',... |
import pygame
from pygame.locals import *
import random
import time
from . import ai as ai_paddle
class Pong(object):
def __init__(self, width, height):
self.ai = None
self.ball_rect = None
pygame.init()
pygame.mixer.init()
pygame.display.set_caption("Pong - ve... | [
"pygame.init",
"pygame.display.set_mode",
"pygame.mixer.Sound",
"pygame.Rect",
"pygame.font.SysFont",
"time.sleep",
"pygame.key.get_pressed",
"pygame.draw.rect",
"pygame.font.init",
"pygame.display.set_caption",
"pygame.mixer.init",
"random.randint"
] | [((231, 244), 'pygame.init', 'pygame.init', ([], {}), '()\n', (242, 244), False, 'import pygame\n'), ((254, 273), 'pygame.mixer.init', 'pygame.mixer.init', ([], {}), '()\n', (271, 273), False, 'import pygame\n'), ((283, 331), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Pong - version 2.0"""'], {})... |
"""
meffil_functions.py
===================
Contains a few R functions that interact with meffil and minfi.
"""
import rpy2.robjects as robjects
def load_detection_p_values_beadnum(qc_list, n_cores):
"""Return list of detection p-value matrix and bead number matrix.
Parameters
----------
qc_list
... | [
"rpy2.robjects.r",
"rpy2.robjects.packages.importr"
] | [((4094, 4123), 'rpy2.robjects.r', 'robjects.r', (['"""library(meffil)"""'], {}), "('library(meffil)')\n", (4104, 4123), True, 'import rpy2.robjects as robjects\n'), ((4391, 4420), 'rpy2.robjects.r', 'robjects.r', (['"""library(meffil)"""'], {}), "('library(meffil)')\n", (4401, 4420), True, 'import rpy2.robjects as rob... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: http://www.oidview.com/mibs/0/SNMPv2-MIB.html
from typing import Iterator
# pip install pysnmp
from pysnmp.hlapi import nextCmd, SnmpEngine, CommunityData, UdpTransportTarget, ContextData, ObjectType, ObjectIdentity
def get_iterato... | [
"pysnmp.hlapi.CommunityData",
"pysnmp.hlapi.UdpTransportTarget",
"pysnmp.hlapi.ContextData",
"pysnmp.hlapi.SnmpEngine",
"pysnmp.hlapi.ObjectIdentity"
] | [((460, 472), 'pysnmp.hlapi.SnmpEngine', 'SnmpEngine', ([], {}), '()\n', (470, 472), False, 'from pysnmp.hlapi import nextCmd, SnmpEngine, CommunityData, UdpTransportTarget, ContextData, ObjectType, ObjectIdentity\n'), ((482, 517), 'pysnmp.hlapi.CommunityData', 'CommunityData', (['community'], {'mpModel': '(0)'}), '(co... |
'''
DLRM Facebookresearch Debloating
author: sjoon-oh @ Github
source: dlrm/dlrm_s_pytorch.py
'''
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
# miscellaneous
import builtins
import datetime
import json
import sys
import time
# data generation
import dlrm_data a... | [
"torch.cuda.device_count",
"torch.cuda.synchronize",
"numpy.array",
"torch.cuda.is_available",
"sys.exit",
"torch.set_printoptions",
"argparse.ArgumentParser",
"numpy.asarray",
"numpy.random.seed",
"numpy.fromstring",
"numpy.round",
"argparse.ArgumentTypeError",
"torch.save",
"time.time",
... | [((711, 722), 'time.time', 'time.time', ([], {}), '()\n', (720, 722), False, 'import time\n'), ((3571, 3662), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train Deep Learning Recommendation Model (DLRM)"""'}), "(description=\n 'Train Deep Learning Recommendation Model (DLRM)')\n", (... |
"""
SIDER dataset loader.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import shutil
import deepchem as dc
def load_sider(featurizer='ECFP', split='index'):
current_dir = os.path.dirname(os.path.realpath(__file__))
... | [
"deepchem.splits.RandomSplitter",
"deepchem.data.CSVLoader",
"deepchem.feat.ConvMolFeaturizer",
"os.path.join",
"os.path.realpath",
"deepchem.splits.ScaffoldSplitter",
"deepchem.feat.CircularFingerprint",
"deepchem.trans.BalancingTransformer",
"deepchem.utils.save.load_from_disk",
"deepchem.splits... | [((399, 442), 'os.path.join', 'os.path.join', (['current_dir', '"""./sider.csv.gz"""'], {}), "(current_dir, './sider.csv.gz')\n", (411, 442), False, 'import os\n'), ((462, 504), 'deepchem.utils.save.load_from_disk', 'dc.utils.save.load_from_disk', (['dataset_file'], {}), '(dataset_file)\n', (490, 504), True, 'import de... |
"""Generate a similarity matrix (doc-term score matrix) based on textacy.representation.Vectorizer.
refer also to fast-scores fast_scores.py and gen_model.py (sklearn.feature_extraction.text.TfidfVectorizer).
originally docterm_scores.py.
"""
from typing import Dict, Iterable, List, Optional, Union
import numpy as np
... | [
"itertools.chain",
"psutil.virtual_memory",
"logzero.logger.warning",
"logzero.logger.error"
] | [((3089, 3139), 'logzero.logger.warning', 'logger.warning', (['"""memory required: %s"""', 'require_ram'], {}), "('memory required: %s', require_ram)\n", (3103, 3139), False, 'from logzero import logger\n'), ((3203, 3312), 'logzero.logger.warning', 'logger.warning', (['"""You\'ll likely to encounter memory problem, suc... |
import unittest
import sys
class TestWhitening(unittest.TestCase):
def test_native_backends_installed(self):
if sys.platform == "win32":
import os
cur_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(
os.readlink(__file__))
... | [
"os.path.dirname",
"os.path.islink",
"os.path.join",
"os.readlink"
] | [((196, 221), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (211, 221), False, 'import os\n'), ((354, 426), 'os.path.join', 'os.path.join', (['cur_dir', '""".."""', '"""src"""', '"""urh"""', '"""dev"""', '"""native"""', '"""lib"""', '"""win"""'], {}), "(cur_dir, '..', 'src', 'urh', 'dev', 'n... |
from datetime import timedelta
from django.core.management import call_command
from jcasts.users.factories import UserFactory
class TestNewEpisodesEmails:
def test_command(self, db, mocker):
yes = UserFactory(send_email_notifications=True)
UserFactory(send_email_notifications=False)
Use... | [
"datetime.timedelta",
"django.core.management.call_command",
"jcasts.users.factories.UserFactory"
] | [((214, 256), 'jcasts.users.factories.UserFactory', 'UserFactory', ([], {'send_email_notifications': '(True)'}), '(send_email_notifications=True)\n', (225, 256), False, 'from jcasts.users.factories import UserFactory\n'), ((265, 308), 'jcasts.users.factories.UserFactory', 'UserFactory', ([], {'send_email_notifications'... |
import sys
PY2 = sys.version_info < (3,)
if PY2:
# Python 2 is not happy with our package having the same name, we need dynamic import
import importlib
try:
# try old sklearn first, we are on python 2
sklearn_ft_base = importlib.import_module("sklearn.feature_selection.base")
except Im... | [
"sklearn.utils.validation.check_X_y",
"sklearn.utils.validation.check_array",
"importlib.import_module",
"inspect.getmro"
] | [((481, 520), 'importlib.import_module', 'importlib.import_module', (['"""sklearn.base"""'], {}), "('sklearn.base')\n", (504, 520), False, 'import importlib\n'), ((249, 306), 'importlib.import_module', 'importlib.import_module', (['"""sklearn.feature_selection.base"""'], {}), "('sklearn.feature_selection.base')\n", (27... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import argparse
MONTHS = {
1: 'january',
2: 'february',
3: 'march',
4: 'april',
5: 'may',
6: 'june',
7: 'july',
8: 'august',
9: 'september',
10: 'october',
11: 'november',
12: 'decem... | [
"bs4.BeautifulSoup",
"requests.get",
"argparse.ArgumentParser"
] | [((1772, 1828), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""onthisday fetcher"""'}), "(description='onthisday fetcher')\n", (1795, 1828), False, 'import argparse\n'), ((1335, 1368), 'bs4.BeautifulSoup', 'BeautifulSoup', (['req', '"""html.parser"""'], {}), "(req, 'html.parser')\n", (13... |
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from PIL import Image
import matplotlib.cm as Pltcolormap
from . import utils
class GradCAM:
"""
Gradient-weighted Class Activation Mapping (Grad-CAM)
Get a coarse heatmap of activation highlighting import... | [
"numpy.uint8",
"PIL.Image.fromarray",
"numpy.asarray",
"torch.autograd.Variable",
"matplotlib.cm.get_cmap",
"torch.clamp"
] | [((1738, 1758), 'torch.autograd.Variable', 'Variable', (['img_tensor'], {}), '(img_tensor)\n', (1746, 1758), False, 'from torch.autograd import Variable\n'), ((4300, 4315), 'numpy.asarray', 'np.asarray', (['pil'], {}), '(pil)\n', (4310, 4315), True, 'import numpy as np\n'), ((4381, 4408), 'matplotlib.cm.get_cmap', 'Plt... |
import argparse
import json
import multiprocessing
import os
from pybdv.metadata import get_data_path
from mobie.import_data import import_traces
from mobie.metadata import add_to_image_dict, have_dataset
from mobie.tables import compute_trace_default_table
# TODO make cluster tools task so this can be safely run o... | [
"pybdv.metadata.get_data_path",
"json.loads",
"mobie.metadata.add_to_image_dict",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.join",
"multiprocessing.cpu_count",
"mobie.tables.compute_trace_default_table",
"mobie.metadata.have_dataset",
"mobie.import_data.import_traces"
] | [((518, 545), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (543, 545), False, 'import multiprocessing\n'), ((2004, 2036), 'os.path.join', 'os.path.join', (['root', 'dataset_name'], {}), '(root, dataset_name)\n', (2016, 2036), False, 'import os\n'), ((2098, 2170), 'os.path.join', 'os.path.... |
from Pong import Pong
if __name__ == "__main__":
Pong((5, 5), 7, 20).run()
| [
"Pong.Pong"
] | [((54, 73), 'Pong.Pong', 'Pong', (['(5, 5)', '(7)', '(20)'], {}), '((5, 5), 7, 20)\n', (58, 73), False, 'from Pong import Pong\n')] |
""" Setup scripts for reuse. """
from setuptools import setup, find_packages
setup(
name="py-reuse",
version="0.0.3",
description="Collection of useful python functions",
url="https://github.com/vra/reuse",
author="<NAME>",
author_email="<EMAIL>",
packages=find_packages()
)
| [
"setuptools.find_packages"
] | [((287, 302), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (300, 302), False, 'from setuptools import setup, find_packages\n')] |
# # Conditional Execution
# Whilst any quantum process can be created by performing "pure" operations delaying all measurements to the end, this is not always practical and can greatly increase the resource requirements. It is much more convenient to alternate quantum gates and measurements, especially if we can use t... | [
"pytket.circuit.CircBox",
"pytket.passes.DecomposeBoxes",
"pytket.circuit.Bit",
"pytket.program.Program",
"pytket.extensions.qiskit.AerBackend",
"pytket.passes.RebaseTket",
"pytket.extensions.qiskit.tk_to_qiskit",
"pytket.circuit.Qubit",
"pytket.Circuit"
] | [((2364, 2373), 'pytket.Circuit', 'Circuit', ([], {}), '()\n', (2371, 2373), False, 'from pytket import Circuit\n'), ((3389, 3402), 'pytket.Circuit', 'Circuit', (['(2)', '(1)'], {}), '(2, 1)\n', (3396, 3402), False, 'from pytket import Circuit\n'), ((3488, 3506), 'pytket.circuit.CircBox', 'CircBox', (['checked_x'], {})... |
#
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | [
"commoncode.hash.sha1",
"os.path.dirname",
"commoncode.hash.md5",
"commoncode.hash.b64sha1"
] | [((1668, 1693), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1683, 1693), False, 'import os\n'), ((2113, 2128), 'commoncode.hash.sha1', 'sha1', (['test_file'], {}), '(test_file)\n', (2117, 2128), False, 'from commoncode.hash import sha1\n'), ((2275, 2289), 'commoncode.hash.md5', 'md5', (['... |
"""
persistor factory
"""
from dimstore.providers.persistor.flatfile_persistor import FlatFilePersistor
from dimstore.providers.persistor.ibm_object_storage_persistor import IBMObjectStoragePersistor
from dimstore.providers.persistor.waston_knowledge_catalog_persistor import WastonKnowlegeCatalogPersistor
class Pe... | [
"dimstore.providers.persistor.waston_knowledge_catalog_persistor.WastonKnowlegeCatalogPersistor",
"dimstore.providers.persistor.flatfile_persistor.FlatFilePersistor",
"dimstore.providers.persistor.ibm_object_storage_persistor.IBMObjectStoragePersistor"
] | [((523, 589), 'dimstore.providers.persistor.flatfile_persistor.FlatFilePersistor', 'FlatFilePersistor', (["self.config['persistor_providers']['flat_file']"], {}), "(self.config['persistor_providers']['flat_file'])\n", (540, 589), False, 'from dimstore.providers.persistor.flatfile_persistor import FlatFilePersistor\n'),... |
# -*- coding: utf-8 -*-
import numpy as np
import sys
class LabelPath:
def __init__(self, label_inds, labels):
self._labels = labels
self._label_num = len(label_inds)
self._label_inds = label_inds
self._hit_count = 0.0
self._label2rank = dict()
for label_ind in lab... | [
"numpy.argsort",
"numpy.array"
] | [((1613, 1634), 'numpy.array', 'np.array', (['index2label'], {}), '(index2label)\n', (1621, 1634), True, 'import numpy as np\n'), ((1923, 1941), 'numpy.argsort', 'np.argsort', (['scores'], {}), '(scores)\n', (1933, 1941), True, 'import numpy as np\n')] |
import torch
import torch.nn as nn
from .utils import _calc_padding, _unpack_from_convolution, _pack_for_convolution
class GraphAndConv(nn.Module):
def __init__(self, input_dim, output_dim, conv_kernel_size, intermediate_dim=None):
super(GraphAndConv, self).__init__()
if intermediate_dim is None:
... | [
"torch.cat",
"torch.einsum",
"torch.nn.Conv1d",
"torch.nn.Linear"
] | [((381, 423), 'torch.nn.Linear', 'nn.Linear', (['(2 * input_dim)', 'intermediate_dim'], {}), '(2 * input_dim, intermediate_dim)\n', (390, 423), True, 'import torch.nn as nn\n'), ((495, 569), 'torch.nn.Conv1d', 'nn.Conv1d', (['intermediate_dim', 'output_dim', 'conv_kernel_size'], {'padding': 'padding'}), '(intermediate_... |
"""
File: custom_nets.py
Author: Nrupatunga
Email: <EMAIL>
Github: https://github.com/nrupatunga
Description: network architecture for fast image filters
"""
import torch
import torch.nn as nn
#from torchsummary import summary
from fast_image_filters.basic_blocks import ConvBlock
class temp_FIF_enhance(nn.Module):
... | [
"fast_image_filters.basic_blocks.ConvBlock",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.zeros_",
"torch.nn.Conv2d",
"torch.cat"
] | [((529, 560), 'fast_image_filters.basic_blocks.ConvBlock', 'ConvBlock', (['(3)', 'nbLayers', '(3)', '(1)', '(1)'], {}), '(3, nbLayers, 3, 1, 1)\n', (538, 560), False, 'from fast_image_filters.basic_blocks import ConvBlock\n'), ((574, 612), 'fast_image_filters.basic_blocks.ConvBlock', 'ConvBlock', (['nbLayers', 'nbLayer... |
from __future__ import annotations
from .abs import abs_val
def abs_min(x: list[int]) -> int:
"""
>>> abs_min([0,5,1,11])
0
>>> abs_min([3,-10,-2])
-2
>>> abs_min([])
Traceback (most recent call last):
...
ValueError: abs_min() arg is an empty sequence
"""
if len(x) ==... | [
"doctest.testmod"
] | [((605, 634), 'doctest.testmod', 'doctest.testmod', ([], {'verbose': '(True)'}), '(verbose=True)\n', (620, 634), False, 'import doctest\n')] |
# -*- coding: utf-8 -*-
## @package som_cm.som
#
# Implementation of SOM.
# @author tody
# @date 2015/08/14
import os
import numpy as np
import matplotlib.pyplot as plt
from som_cm.np.norm import normVectors
## SOM parameter.
class SOMParam:
# @param h image grid size.
# @param L0... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.text",
"numpy.random.rand",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"numpy.argmin",
"numpy.meshgrid",
"som_cm.np.norm.normVectors",
"numpy.arange"
] | [((2326, 2345), 'numpy.zeros', 'np.zeros', (['(h, w, 3)'], {}), '((h, w, 3))\n', (2334, 2345), True, 'import numpy as np\n'), ((2774, 2794), 'numpy.random.rand', 'np.random.rand', (['h', '(3)'], {}), '(h, 3)\n', (2788, 2794), True, 'import numpy as np\n'), ((3128, 3140), 'numpy.arange', 'np.arange', (['h'], {}), '(h)\n... |
import os
from setuptools import setup, find_packages
from sentry_mailagain import __version__, __author__
def read(fname):
try:
with open(os.path.join(os.path.dirname(__file__), fname)) as fobj:
return fobj.read()
except IOError:
return ''
install_requires = read('requirements.... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((665, 680), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (678, 680), False, 'from setuptools import setup, find_packages\n'), ((167, 192), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (182, 192), False, 'import os\n')] |
# Imports
import os
try:
_fldr = input("Folder name: ")
_path = os.getcwd()
os.mkdir(_fldr)
print("Sucessfuly created a new folder!")
os.startfile(_path)
except OSError as error:
print("Couldn't able to create folder...")
| [
"os.startfile",
"os.mkdir",
"os.getcwd"
] | [((80, 91), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (89, 91), False, 'import os\n'), ((97, 112), 'os.mkdir', 'os.mkdir', (['_fldr'], {}), '(_fldr)\n', (105, 112), False, 'import os\n'), ((165, 184), 'os.startfile', 'os.startfile', (['_path'], {}), '(_path)\n', (177, 184), False, 'import os\n')] |
import unittest
import numpy.testing as testing
import numpy as np
import healpy as hp
from numpy import random
import healsparse
class GetSetTestCase(unittest.TestCase):
def test_getitem_single(self):
"""
Test __getitem__ single value
"""
random.seed(12345)
nside_coverag... | [
"numpy.testing.assert_array_almost_equal",
"numpy.ones",
"healsparse.HealSparseMap",
"numpy.testing.assert_equal",
"numpy.random.random",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_almost_equal",
"healsparse.HealSparseMap.make_empty",
"numpy.array",
"numpy.zeros",
"numpy.random.se... | [((13788, 13803), 'unittest.main', 'unittest.main', ([], {}), '()\n', (13801, 13803), False, 'import unittest\n'), ((279, 297), 'numpy.random.seed', 'random.seed', (['(12345)'], {}), '(12345)\n', (290, 297), False, 'from numpy import random\n'), ((446, 470), 'numpy.random.random', 'random.random', ([], {'size': '(5000)... |
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: © 2014 The glucometerutils Authors
# SPDX-License-Identifier: MIT
"""Tests for the LifeScan OneTouch Ultra Easy driver."""
# pylint: disable=protected-access,missing-docstring
from absl.testing import absltest
from glucometerutils.drivers import otultraeasy
class... | [
"glucometerutils.drivers.otultraeasy._make_packet"
] | [((470, 526), 'glucometerutils.drivers.otultraeasy._make_packet', 'otultraeasy._make_packet', (["b''", '(False)', '(False)', '(False)', '(True)'], {}), "(b'', False, False, False, True)\n", (494, 526), False, 'from glucometerutils.drivers import otultraeasy\n'), ((678, 743), 'glucometerutils.drivers.otultraeasy._make_p... |
'''
uix.relativelayout tests
========================
'''
import unittest
from kivy.base import EventLoop
from kivy.input.motionevent import MotionEvent
from kivy.uix.relativelayout import RelativeLayout
# https://gist.github.com/tito/f111b6916aa6a4ed0851
# subclass for touch event in unit test
class UTMotionEvent(... | [
"kivy.uix.relativelayout.RelativeLayout",
"kivy.base.EventLoop.ensure_window",
"kivy.base.EventLoop.post_dispatch_input",
"kivy.base.EventLoop.window.add_widget"
] | [((635, 660), 'kivy.base.EventLoop.ensure_window', 'EventLoop.ensure_window', ([], {}), '()\n', (658, 660), False, 'from kivy.base import EventLoop\n'), ((674, 690), 'kivy.uix.relativelayout.RelativeLayout', 'RelativeLayout', ([], {}), '()\n', (688, 690), False, 'from kivy.uix.relativelayout import RelativeLayout\n'), ... |
import numpy as np
import matplotlib.pyplot as plt
def m2d( m=1.0, a=1.0, b=1.0 ):
return( a * np.power( m, b ) )
def get_v( mmin=0.0, mmax=0.1, minc=0.1,
alpha=40.0, beta=0.230, gamma=1/2,
rho_0=1.0, rho=1.0 ):
m_l = np.arange( mmin, mmax+minc, minc )
v_l = np.zeros( m_l.shape )... | [
"numpy.power",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1105, 1141), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(8, 6.5)'}), '(1, 1, figsize=(8, 6.5))\n', (1117, 1141), True, 'import matplotlib.pyplot as plt\n'), ((1623, 1633), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1631, 1633), True, 'import matplotlib.pyplot as plt\n')... |
import numpy as np
n1 = np.array([10,20])
n2 = np.array([30,40])
print("Sum of n1 and n2:-")
new = np.sum([n1,n2])
print(new)
print("Sum of n1 and n2 row wise :-")
new_2 = np.sum([n1,n2],axis = 0) #axis = 0 (Row / Vertically adding), axis = 1 (Colunm / horizontally adding).
print(new_2)
#Basic adding,substracting,m... | [
"numpy.array",
"numpy.mean",
"numpy.sum",
"numpy.std"
] | [((25, 43), 'numpy.array', 'np.array', (['[10, 20]'], {}), '([10, 20])\n', (33, 43), True, 'import numpy as np\n'), ((48, 66), 'numpy.array', 'np.array', (['[30, 40]'], {}), '([30, 40])\n', (56, 66), True, 'import numpy as np\n'), ((101, 117), 'numpy.sum', 'np.sum', (['[n1, n2]'], {}), '([n1, n2])\n', (107, 117), True,... |
import importlib
def create_storage(app):
"""
Load specified storage and return the object.
"""
if 'STORAGE' not in app.config:
raise Exception("Missing STORAGE config key")
storage = importlib.import_module('.' + app.config['STORAGE'], __name__)
return storage.create_storage(app)
| [
"importlib.import_module"
] | [((215, 277), 'importlib.import_module', 'importlib.import_module', (["('.' + app.config['STORAGE'])", '__name__'], {}), "('.' + app.config['STORAGE'], __name__)\n", (238, 277), False, 'import importlib\n')] |
"""HorizontalShift layer for Hocrox."""
import cv2
from hocrox.utils import Layer
class HorizontalShift(Layer):
"""HorizontalShift layer shifts the image horizontally.
Here is an example code to use the HorizontalShift layer in a model.
```python
from hocrox.model import Model
from hocrox.layer... | [
"cv2.resize"
] | [((2720, 2760), 'cv2.resize', 'cv2.resize', (['img', '(w, h)', 'cv2.INTER_CUBIC'], {}), '(img, (w, h), cv2.INTER_CUBIC)\n', (2730, 2760), False, 'import cv2\n')] |
#!/usr/bin/env python3
'''
MIT License
Copyright (c) 2017 <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,... | [
"string.Template",
"fileinput.input"
] | [((1864, 2183), 'string.Template', 'Template', (['"""const char* toString($typename value);\n\nstd::ostream& operator<<(std::ostream& out, $typename value);\n\nconst char* toString($typename value) {\n switch (value) {\n$case\n }\n return "";\n}\n\nstd::ostream& operator<<(std::ostream& out, $typename value) {\n ou... |
# Copyright 2020 Open Climate Tech Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"math.ceil",
"numpy.asarray",
"os.path.splitext",
"numpy.subtract",
"os.path.join",
"pathlib.PurePath",
"numpy.array"
] | [((1653, 1703), 'math.ceil', 'math.ceil', (['(flexSize / (segmentSize / overlapRatio))'], {}), '(flexSize / (segmentSize / overlapRatio))\n', (1662, 1703), False, 'import math\n'), ((6639, 6676), 'numpy.asarray', 'np.asarray', (['imgOrig'], {'dtype': 'np.float32'}), '(imgOrig, dtype=np.float32)\n', (6649, 6676), True, ... |
from fn_jira.components.jira_common import *
from fn_jira.components.resilient_common import merge_two_dicts
import logging
import unittest
class TestJira(unittest.TestCase):
url = None
def setUp(self):
self.baseDict = {
'url': 'https://<JIRA>',
'user': '<USER>',
'... | [
"logging.getLogger",
"fn_jira.components.resilient_common.merge_two_dicts"
] | [((480, 507), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (497, 507), False, 'import logging\n'), ((1467, 1509), 'fn_jira.components.resilient_common.merge_two_dicts', 'merge_two_dicts', (['self.baseDict', 'createDict'], {}), '(self.baseDict, createDict)\n', (1482, 1509), False, 'from ... |
# File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function
from stripe import util
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
f... | [
"stripe.api_resources.abstract.custom_method",
"stripe.util.populate_headers"
] | [((378, 419), 'stripe.api_resources.abstract.custom_method', 'custom_method', (['"""submit"""'], {'http_verb': '"""post"""'}), "('submit', http_verb='post')\n", (391, 419), False, 'from stripe.api_resources.abstract import custom_method\n'), ((672, 710), 'stripe.util.populate_headers', 'util.populate_headers', (['idemp... |
import os
import json
from pathlib import Path
from myparser.data_cleaner import DataCleaner
from myparser.docx_parser import DocxParser
from myparser.excel_parser import ExcelParser
from myparser.pdf_parser import PdfParser
from myparser.utils import convert_df_to_json
from myparser.my_logger import get_logger
lo... | [
"myparser.pdf_parser.PdfParser",
"pathlib.Path",
"myparser.utils.convert_df_to_json",
"myparser.my_logger.get_logger",
"myparser.excel_parser.ExcelParser",
"os.mkdir",
"myparser.docx_parser.DocxParser",
"myparser.data_cleaner.DataCleaner",
"json.dump"
] | [((327, 347), 'myparser.my_logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (337, 347), False, 'from myparser.my_logger import get_logger\n'), ((423, 434), 'myparser.pdf_parser.PdfParser', 'PdfParser', ([], {}), '()\n', (432, 434), False, 'from myparser.pdf_parser import PdfParser\n'), ((463, 476),... |
import inspect as inspect_
from heapq import heapify
from random import sample, random
_node_init_func = None
_node_cls = None
_null = None
_left_attr = 'left'
_right_attr = 'right'
_value_attr = 'value'
class Node(object):
"""Represents a binary tree node."""
def __init__(self, value):
self.__setat... | [
"inspect.isclass",
"random.random",
"heapq.heapify"
] | [((9646, 9674), 'inspect.isclass', 'inspect_.isclass', (['node_class'], {}), '(node_class)\n', (9662, 9674), True, 'import inspect as inspect_\n'), ((12650, 12666), 'heapq.heapify', 'heapify', (['negated'], {}), '(negated)\n', (12657, 12666), False, 'from heapq import heapify\n'), ((12735, 12750), 'heapq.heapify', 'hea... |
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtWidgets import (QWidget, QCheckBox, QLineEdit, QGroupBox, QVBoxLayout, QLabel)
from PyQt5.uic import loadUi
from msc import ES2Collection, ES2ValueType
from msc import ES2Transform, ES2Color, Vector3, Quaternion
class ClickableLabel(QLabel):
mousePressed = pyq... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.pyqtSignal",
"PyQt5.uic.loadUi",
"msc.ES2Transform",
"msc.Quaternion",
"PyQt5.QtWidgets.QGroupBox",
"PyQt5.QtWidgets.QVBoxLayout",
"msc.Vector3",
"PyQt5.QtWidgets.QCheckBox",
"PyQt5.QtWidgets.QLineEdit",
"msc.ES2Color"
] | [((317, 342), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['"""QMouseEvent"""'], {}), "('QMouseEvent')\n", (327, 342), False, 'from PyQt5.QtCore import Qt, pyqtSignal\n'), ((536, 569), 'PyQt5.uic.loadUi', 'loadUi', (['"""gui/EditWidget.ui"""', 'self'], {}), "('gui/EditWidget.ui', self)\n", (542, 569), False, 'from PyQt5.... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import re
import numpy as np
import pandas as pd
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from nltk.stem import PorterStemmer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.preproc... | [
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"gensim.models.doc2vec.TaggedDocument",
"numpy.asarray",
"nltk.stem.PorterStemmer",
"gensim.models.doc2vec.Doc2Vec",
"matplotlib.pyplot.savefig",
"sklearn.model_selection.tra... | [((451, 489), 'pandas.read_csv', 'pd.read_csv', (['"""../data/pr-newswire.csv"""'], {}), "('../data/pr-newswire.csv')\n", (462, 489), True, 'import pandas as pd\n'), ((1295, 1342), 'gensim.models.doc2vec.Doc2Vec', 'Doc2Vec', ([], {'vector_size': '(40)', 'min_count': '(2)', 'epochs': '(30)'}), '(vector_size=40, min_coun... |
import http.client
import json
import subprocess
import os
tempDir = os.getenv('XDG_RUNTIME_DIR', '.')
conn = http.client.HTTPConnection('localhost', 8888)
params = """{
"level": "debug",
"media": "image/png",
"input_type": "text"
}"""
def getCaptcha():
conn.request("POST", "/v1/captcha", body=params)
respon... | [
"subprocess.Popen",
"json.loads",
"json.dumps",
"os.getenv"
] | [((70, 103), 'os.getenv', 'os.getenv', (['"""XDG_RUNTIME_DIR"""', '"""."""'], {}), "('XDG_RUNTIME_DIR', '.')\n", (79, 103), False, 'import os\n'), ((415, 438), 'json.loads', 'json.loads', (['responseStr'], {}), '(responseStr)\n', (425, 438), False, 'import json\n'), ((744, 816), 'subprocess.Popen', 'subprocess.Popen', ... |
import pygame
from media.paths import button_font
class Button:
def __init__(self, **kwargs):
"""
Creates a new Button istance for UI.
Accepted Parameters: screen, x, y, width, height, text, padding, command.
"""
self.screen = kwargs.get('screen')
self.x = kwargs... | [
"pygame.mouse.get_pressed",
"pygame.Surface",
"pygame.mouse.get_pos",
"pygame.Color",
"pygame.font.Font"
] | [((1053, 1076), 'pygame.Color', 'pygame.Color', (['"""#4948D9"""'], {}), "('#4948D9')\n", (1065, 1076), False, 'import pygame\n'), ((1153, 1194), 'pygame.Surface', 'pygame.Surface', (['(self.width, self.height)'], {}), '((self.width, self.height))\n', (1167, 1194), False, 'import pygame\n'), ((1364, 1418), 'pygame.Surf... |