code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import argparse
import os
from tqdm import tqdm
from couch import db
from jpeg import get_QTs, identify_quality
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='+')
parser.add_argument('--type', default='JpgImg')
parser.add_argument('--dataset')
args = parser.parse_args()
for filename in t... | [
"tqdm.tqdm",
"argparse.ArgumentParser",
"os.path.basename",
"couch.db.save",
"jpeg.identify_quality",
"jpeg.get_QTs"
] | [((124, 149), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (147, 149), False, 'import argparse\n'), ((319, 339), 'tqdm.tqdm', 'tqdm', (['args.filenames'], {}), '(args.filenames)\n', (323, 339), False, 'from tqdm import tqdm\n'), ((587, 600), 'couch.db.save', 'db.save', (['data'], {}), '(data)... |
#!/usr/bin/env python3
# Author: @haithamaouati
# Version:1.0
import argparse
import colorama
import os
import requests
import time
from colorama import Fore, Back, Style
colorama.init()
os.system('cls' if os.name == 'nt' else 'clear')
print('''\
_._ _,-'""`-._
(,-.`._,'( |\`-/|
... | [
"colorama.init",
"argparse.ArgumentParser",
"os.system",
"time.sleep",
"requests.get"
] | [((184, 199), 'colorama.init', 'colorama.init', ([], {}), '()\n', (197, 199), False, 'import colorama\n'), ((203, 251), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (212, 251), False, 'import os\n'), ((550, 575), 'argparse.ArgumentParser', 'ar... |
"""
Module for collection cog
"""
import math
import discord
from discord.ext import commands
from discord_slash import cog_ext, SlashContext
from discord_slash.utils.manage_commands import create_choice, create_option
from unsigned_bot import IMAGE_PATH
from unsigned_bot.constants import MAX_AMOUNT
from unsigned_bot... | [
"unsigned_bot.parsing.get_numbers_from_string",
"unsigned_bot.cogs.checks.valid_channel",
"discord.File",
"unsigned_bot.matching.get_similar_unsigs",
"discord_slash.utils.manage_commands.create_option",
"unsigned_bot.draw.delete_image_files",
"unsigned_bot.embedding.add_disclaimer",
"unsigned_bot.draw... | [((4911, 4959), 'unsigned_bot.log.logger.debug', 'logger.debug', (['f"""{CollectionCog.__name__} loaded"""'], {}), "(f'{CollectionCog.__name__} loaded')\n", (4923, 4959), False, 'from unsigned_bot.log import logger\n'), ((1635, 1699), 'unsigned_bot.matching.get_similar_unsigs', 'get_similar_unsigs', (['number', 'collec... |
import datetime
import logging
import tushare as ts
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tensorflow import keras
import tensorflow as tf
from ts.build_model import BuildModel
from ts.db_utils import get_daily_by_trade_date
from ts.simulation_history import SimulationHistory
fro... | [
"logging.debug",
"tensorflow.keras.models.load_model",
"tensorflow.train.RMSPropOptimizer",
"datetime.datetime.strptime",
"ts.st_history_data.x_train_col_index",
"numpy.array"
] | [((532, 588), 'logging.debug', 'logging.debug', (['"""index: %s, date: %s"""', 'index', "row['date']"], {}), "('index: %s, date: %s', index, row['date'])\n", (545, 588), False, 'import logging\n'), ((605, 665), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (["row['date']", '"""%Y-%m-%d %H:%M:%S"""'], {}),... |
import numpy as np
from tensorflow.keras.models import load_model
from buffer import (
ReplayBuffer,
build
)
class DQNAgent:
def __init__(self, alpha, gamma, n_actions, epsilon,
batch_size, input_dims, fc1_dims, fc2_dims, epsilon_dec=0.996,
epsilon_end=0.01,... | [
"tensorflow.keras.models.load_model",
"numpy.argmax",
"buffer.build",
"numpy.max",
"numpy.random.random",
"numpy.array",
"numpy.arange",
"numpy.random.choice",
"numpy.dot",
"buffer.ReplayBuffer"
] | [((717, 777), 'buffer.ReplayBuffer', 'ReplayBuffer', (['mem_size', 'input_dims', 'n_actions'], {'discrete': '(True)'}), '(mem_size, input_dims, n_actions, discrete=True)\n', (729, 777), False, 'from buffer import ReplayBuffer, build\n'), ((809, 864), 'buffer.build', 'build', (['alpha', 'n_actions', 'input_dims', 'fc1_d... |
from __future__ import print_function, division
from sympy.core.containers import Tuple
from sympy.core.core import C
from sympy.core.expr import Expr
from sympy.core.mul import Mul
from sympy.core.singleton import S
from sympy.core.sympify import sympify
from sympy.functions.elementary.piecewise import piecewise_fold... | [
"sympy.integrals.integrals._free_symbols",
"sympy.simplify.powsimp",
"sympy.integrals.integrals._as_dummy",
"sympy.concrete.summations.summation",
"sympy.core.expr.Expr.__new__",
"sympy.integrals.integrals._eval_subs",
"sympy.polys.roots",
"sympy.core.core.C.RisingFactorial",
"sympy.core.mul.Mul",
... | [((6090, 6115), 'sympy.integrals.integrals._process_limits', '_process_limits', (['*symbols'], {}), '(*symbols)\n', (6105, 6115), False, 'from sympy.integrals.integrals import _process_limits\n'), ((6406, 6438), 'sympy.core.expr.Expr.__new__', 'Expr.__new__', (['cls'], {}), '(cls, **assumptions)\n', (6418, 6438), False... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests the BigQuery collector."""
import unittest
import mock
from dftimewolf.lib import state
from dftimewolf.lib.collectors import bigquery
from dftimewolf import config
class BigQueryCollectorTest(unittest.TestCase):
"""Tests for the BigQuery collector."""
d... | [
"unittest.main",
"dftimewolf.lib.collectors.bigquery.BigQueryCollector",
"dftimewolf.lib.state.DFTimewolfState",
"mock.patch"
] | [((559, 601), 'mock.patch', 'mock.patch', (['"""google.cloud.bigquery.Client"""'], {}), "('google.cloud.bigquery.Client')\n", (569, 601), False, 'import mock\n'), ((1124, 1139), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1137, 1139), False, 'import unittest\n'), ((421, 457), 'dftimewolf.lib.state.DFTimewolfSt... |
#!/usr/bin/env python3
import re
import sys
import jwt
import requests
from Crypto.PublicKey import RSA
from Crypto.Util.number import inverse
def recover_d(n, e, p):
q = n // p
phi = (p - 1) * (q - 1)
return inverse(e, phi)
def main(url):
n = 161585030356555036503574383443349759802220513348577420... | [
"Crypto.PublicKey.RSA.construct",
"Crypto.Util.number.inverse",
"re.search"
] | [((225, 240), 'Crypto.Util.number.inverse', 'inverse', (['e', 'phi'], {}), '(e, phi)\n', (232, 240), False, 'from Crypto.Util.number import inverse\n'), ((1884, 1908), 'Crypto.PublicKey.RSA.construct', 'RSA.construct', (['(n, e, d)'], {}), '((n, e, d))\n', (1897, 1908), False, 'from Crypto.PublicKey import RSA\n'), ((2... |
from tornado import escape
from tornado.web import asynchronous
from tornado.options import options
from tornado.auth import TwitterMixin
from june.lib.decorators import require_user, require_system
from june.lib.handler import BaseHandler
from june.models import Social
class TwitterHandler(BaseHandler, TwitterMixin)... | [
"tornado.escape.json_decode",
"june.models.Social",
"tornado.escape.json_encode",
"tornado.escape.utf8"
] | [((1532, 1572), 'tornado.escape.json_encode', 'escape.json_encode', (["user['access_token']"], {}), "(user['access_token'])\n", (1550, 1572), False, 'from tornado import escape\n'), ((1591, 1666), 'june.models.Social', 'Social', ([], {'service': '"""twitter"""', 'user_id': 'self.current_user.id', 'token': 'access_token... |
#!/usr/bin python3.7
# -*- coding: utf-8 -*-
from pymongo.errors import DuplicateKeyError
from lib.mongoConnector import connect_to_mongodb, pop_offers_already_saved
from lib.queryBuilder import query_immo_offers, get_amount_of_pages
def get_offers_ids(immotype, total_pages, sort="asc"):
ids = []
if total_pa... | [
"lib.queryBuilder.query_immo_offers",
"lib.queryBuilder.get_amount_of_pages",
"lib.mongoConnector.connect_to_mongodb"
] | [((759, 779), 'lib.mongoConnector.connect_to_mongodb', 'connect_to_mongodb', ([], {}), '()\n', (777, 779), False, 'from lib.mongoConnector import connect_to_mongodb, pop_offers_already_saved\n'), ((413, 449), 'lib.queryBuilder.query_immo_offers', 'query_immo_offers', (['i', 'immotype', 'sort'], {}), '(i, immotype, sort... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import yaml
from metrics.instance_property import instance_property
from metrics.metrics_dicts import (
delta_metrics_dict,
eval_metrics... | [
"yaml.load",
"metrics.metrics_dicts.metrics_meta_dict.get"
] | [((2140, 2184), 'yaml.load', 'yaml.load', (['task.config_yaml', 'yaml.SafeLoader'], {}), '(task.config_yaml, yaml.SafeLoader)\n', (2149, 2184), False, 'import yaml\n'), ((470, 514), 'yaml.load', 'yaml.load', (['task.config_yaml', 'yaml.SafeLoader'], {}), '(task.config_yaml, yaml.SafeLoader)\n', (479, 514), False, 'impo... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"re.finditer",
"re.escape",
"re.findall",
"inspect.signature",
"collections.namedtuple",
"functools.reduce",
"typing.TypeVar"
] | [((829, 900), 'collections.namedtuple', 'collections.namedtuple', (['"""ProgramTask"""', "['program', 'inputs', 'outputs']"], {}), "('ProgramTask', ['program', 'inputs', 'outputs'])\n", (851, 900), False, 'import collections\n'), ((1516, 1543), 'typing.TypeVar', 'TypeVar', (['"""Regex"""', 'Type', 'str'], {}), "('Regex... |
import mysamplefunctions
variable = -5
print("variable is:", variable)
abs = mysamplefunctions.absolute(variable)
print ("absolute value is:", abs)
from mysamplefunctions import areatriangle
w = 5
h = 10
print("area is:", areatriangle(width=w, height=h) )
from mysamplefunctions import areacircle, summation
radius ... | [
"mysamplefunctions.absolute",
"mysamplefunctions.areacircle",
"mysamplefunctions.summation",
"mysamplefunctions.areatriangle"
] | [((78, 114), 'mysamplefunctions.absolute', 'mysamplefunctions.absolute', (['variable'], {}), '(variable)\n', (104, 114), False, 'import mysamplefunctions\n'), ((333, 351), 'mysamplefunctions.areacircle', 'areacircle', (['radius'], {}), '(radius)\n', (343, 351), False, 'from mysamplefunctions import areacircle, summatio... |
'''H5 data prep'''
## External modules.
import csv
import numpy as np
import os
import tables
## Internal modules.
from mml.config import dir_data_toread
from mml.config import dir_data_towrite
from mml.utils import makedir_safe
###############################################################################
## Cl... | [
"csv.reader",
"numpy.zeros",
"tables.Float32Atom",
"numpy.vstack",
"mml.utils.makedir_safe",
"numpy.array",
"tables.UInt8Atom",
"tables.open_file",
"os.path.join",
"numpy.concatenate"
] | [((368, 422), 'os.path.join', 'os.path.join', (['dir_data_toread', 'data_name', '"""adult.data"""'], {}), "(dir_data_toread, data_name, 'adult.data')\n", (380, 422), False, 'import os\n'), ((435, 489), 'os.path.join', 'os.path.join', (['dir_data_toread', 'data_name', '"""adult.test"""'], {}), "(dir_data_toread, data_na... |
# Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tensorflow.train.Int64List",
"tensorflow.image.resize_bilinear",
"tensorflow.multiply",
"tensorflow.one_hot",
"tensorflow.subtract",
"tensorflow.compat.v1.name_scope",
"tensorflow.cast",
"tensorflow.squeeze",
"preprocessing.preprocessing_factory.get_preprocessing",
"tensorflow.VarLenFeature",
"... | [((939, 1038), 'collections.namedtuple', 'collections.namedtuple', (['"""InputEndpoints"""', "['images', 'images_orig', 'labels', 'labels_one_hot']"], {}), "('InputEndpoints', ['images', 'images_orig', 'labels',\n 'labels_one_hot'])\n", (961, 1038), False, 'import collections\n'), ((1061, 1174), 'collections.namedtu... |
import board
import audioio
import audiobusio
import digitalio
import time
import array
import math
buf = bytearray(16000)
print(3)
time.sleep(1)
print(2)
time.sleep(1)
print(1)
time.sleep(1)
#print("recording", time.monotonic())
print("recording")
#trigger = digitalio.DigitalInOut(board.A1)
#trigger.switch_to_output... | [
"audioio.AudioOut",
"digitalio.DigitalInOut",
"audiobusio.PDMIn",
"time.sleep"
] | [((134, 147), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (144, 147), False, 'import time\n'), ((157, 170), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (167, 170), False, 'import time\n'), ((180, 193), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (190, 193), False, 'import time\n'), ((550, 594), ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import travel.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
... | [((264, 321), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (295, 321), False, 'from django.db import migrations, models\n'), ((7870, 7932), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '""... |
import sys
sys.path.insert(0, 'dependencies')
import boto3
import json
import os
import shutil
from glob import glob
from os.path import join
from sqlite3 import connect
S3 = boto3.client('s3')
BUCKET = os.environ['S3_BUCKET']
CAMPAIGN_TILES = 'campaign.mbtiles'
PATH = '/tmp'
def list_mbtiles(uuid):
mbtiles_fol... | [
"os.mkdir",
"boto3.client",
"os.path.isdir",
"sys.path.insert",
"json.dumps",
"sqlite3.connect",
"shutil.rmtree",
"os.path.join",
"shutil.copy"
] | [((11, 45), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""dependencies"""'], {}), "(0, 'dependencies')\n", (26, 45), False, 'import sys\n'), ((177, 195), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (189, 195), False, 'import boto3\n'), ((705, 736), 'shutil.copy', 'shutil.copy', (['mbtile', 'mer... |
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Union, List, Type
import os
from ruamel.yaml.scalarstring import DoubleQuotedScalarString
from kipoi_containers.singularityhelper import (
build_singularity_image,
update_existing_singularity_container,
push_new_singularit... | [
"kipoi_containers.singularityhelper.test_singularity_image",
"kipoi_containers.singularityhelper.push_new_singularity_image",
"kipoi_containers.zenodoclient.Client",
"kipoi_containers.singularityhelper.cleanup",
"pathlib.Path",
"kipoi_utils.external.torchvision.dataset_utils.check_integrity",
"kipoi_con... | [((849, 870), 'kipoi_containers.zenodoclient.Client', 'zenodoclient.Client', ([], {}), '()\n', (868, 870), False, 'from kipoi_containers import zenodoclient\n'), ((3520, 3704), 'kipoi_containers.singularityhelper.build_singularity_image', 'build_singularity_image', ([], {'name_of_docker_image': 'self.docker_image_name'... |
import unittest
import test
def provisioner(*args):
return test.scloud("provisioner", *args)
class TestProvisioner(unittest.TestCase):
def setUp(self):
# retrieve the selected tenant name
code, self.tname, _ = test.scloud("get", "tenant")
self.assertEqual(0, code)
self.asse... | [
"test.scloud",
"unittest.main"
] | [((66, 99), 'test.scloud', 'test.scloud', (['"""provisioner"""', '*args'], {}), "('provisioner', *args)\n", (77, 99), False, 'import test\n'), ((812, 827), 'unittest.main', 'unittest.main', ([], {}), '()\n', (825, 827), False, 'import unittest\n'), ((240, 268), 'test.scloud', 'test.scloud', (['"""get"""', '"""tenant"""... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os.path
from django.utils import six
from django.db import models
from django import template
from django.urls import (
NoReverseMatch,
reverse,
)
from django.utils.html import escape
from django.utils.safestring import mark_safe
from cru... | [
"django.template.Library",
"cruds.utils.get_fields",
"django.utils.html.escape"
] | [((349, 367), 'django.template.Library', 'template.Library', ([], {}), '()\n', (365, 367), False, 'from django import template\n'), ((2971, 3003), 'cruds.utils.get_fields', 'utils.get_fields', (['model', 'include'], {}), '(model, include)\n', (2987, 3003), False, 'from cruds import utils\n'), ((872, 885), 'django.utils... |
from ferris.core.ndb import Behavior
from app.behaviors.sanitize import Sanitize
class MailBehavior(Behavior):
sanitizer = Sanitize()
def before_put(self, instance):
instance.sender = self.sanitizer.sanitize_email(instance.sender)
instance.recipient = self.sanitizer.sanitize_email(instanc... | [
"app.behaviors.sanitize.Sanitize"
] | [((129, 139), 'app.behaviors.sanitize.Sanitize', 'Sanitize', ([], {}), '()\n', (137, 139), False, 'from app.behaviors.sanitize import Sanitize\n')] |
import numpy as np
import random as rd
import tensorflow as tf
from tensorflow import keras
class Brain():
def __init__(self,brain_spec, random = True, weights = None):
self.brain_spec = brain_spec
##INIT
#This is a new brai,
self.neurones = keras.Sequential()
for i in ... | [
"tensorflow.keras.layers.Dense",
"random.uniform",
"numpy.expand_dims",
"numpy.random.randint",
"numpy.array",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.Sequential"
] | [((284, 302), 'tensorflow.keras.Sequential', 'keras.Sequential', ([], {}), '()\n', (300, 302), False, 'from tensorflow import keras\n'), ((941, 982), 'tensorflow.keras.optimizers.Adam', 'keras.optimizers.Adam', ([], {'learning_rate': '(0.01)'}), '(learning_rate=0.01)\n', (962, 982), False, 'from tensorflow import keras... |
import time
from abc import abstractmethod
from typing import List
from alfi.models import LFM
import torch
import numpy as np
import gpytorch
from torch.utils.data.dataloader import DataLoader
from alfi.utilities.torch import is_cuda
from alfi.datasets import LFMDataset
class Trainer:
"""
An abstract LFM t... | [
"numpy.concatenate",
"numpy.empty",
"time.time",
"torch.utils.data.dataloader.DataLoader",
"torch.tensor"
] | [((1499, 1556), 'torch.utils.data.dataloader.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'batch_size', 'shuffle': '(False)'}), '(dataset, batch_size=batch_size, shuffle=False)\n', (1509, 1556), False, 'from torch.utils.data.dataloader import DataLoader\n'), ((3636, 3681), 'numpy.concatenate', 'np.concatenat... |
import aepp
from aepp import connector
from copy import deepcopy
import requests
from typing import IO, Union
import logging
class DataIngestion:
"""
Class that manages sending data via authenticated methods.
For Batch and Streaming messages.
"""
loggingEnabled = False
logger = None
def ... | [
"copy.deepcopy",
"requests.patch",
"logging.FileHandler",
"logging.StreamHandler",
"logging.Formatter",
"aepp.connector.AdobeRequest",
"logging.getLogger"
] | [((1592, 1651), 'aepp.connector.AdobeRequest', 'connector.AdobeRequest', ([], {'config_object': 'config', 'header': 'header'}), '(config_object=config, header=header)\n', (1614, 1651), False, 'from aepp import connector\n'), ((7985, 8006), 'copy.deepcopy', 'deepcopy', (['self.header'], {}), '(self.header)\n', (7993, 80... |
#!/usr/bin/env python
import os
import sys
import shutil
import subprocess
import conf
import options
from build_paper import build_paper
output_dir = conf.output_dir
build_dir = conf.build_dir
bib_dir = conf.bib_dir
pdf_dir = conf.pdf_dir
toc_conf = conf.toc_conf
proc_conf = conf.proc_conf
dirs = co... | [
"subprocess.Popen",
"options.mkdir_p",
"build_paper.build_paper",
"shutil.copy",
"os.path.join",
"options.dict2cfg"
] | [((1075, 1099), 'options.mkdir_p', 'options.mkdir_p', (['pdf_dir'], {}), '(pdf_dir)\n', (1090, 1099), False, 'import options\n'), ((1674, 1705), 'options.dict2cfg', 'options.dict2cfg', (['toc', 'toc_conf'], {}), '(toc, toc_conf)\n', (1690, 1705), False, 'import options\n'), ((393, 447), 'os.path.join', 'os.path.join', ... |
import pygame, time
import virtual_start_page
import two_players
def CreateGameWindow(width, height):
pygame.display.set_caption("Checkers !")
gamewindow = pygame.display.set_mode((width, height))
return gamewindow
def WriteText(text, text_pos_x, text_pos_y, text_size):
text_font = pygame.font.SysFont... | [
"pygame.quit",
"pygame.font.SysFont",
"pygame.draw.rect",
"pygame.display.set_mode",
"pygame.event.get",
"two_players.StartSinglePlayer",
"pygame.init",
"pygame.display.update",
"pygame.mouse.get_pos",
"pygame.display.set_caption"
] | [((1201, 1214), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1212, 1214), False, 'import pygame, time\n'), ((107, 147), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Checkers !"""'], {}), "('Checkers !')\n", (133, 147), False, 'import pygame, time\n'), ((165, 205), 'pygame.display.set_mode', 'py... |
import os
import torch
import pickle
import numpy as np
from lib import inteutil
from lib import posematcher
from lib.models import networkinte
from tqdm import tqdm
from TorchSUL import Model as M
from collections import defaultdict
if __name__=='__main__':
## step 1: match the poses
print('Matching poses ... | [
"numpy.stack",
"tqdm.tqdm",
"torch.from_numpy",
"os.makedirs",
"lib.models.networkinte.IntegrationNet",
"os.path.exists",
"lib.posematcher.PoseMatcher",
"collections.defaultdict",
"TorchSUL.Model.Saver",
"torch.zeros",
"torch.no_grad",
"lib.inteutil.InteDataset"
] | [((354, 473), 'lib.posematcher.PoseMatcher', 'posematcher.PoseMatcher', ([], {'top_down_path': '"""./mupots/pred/"""', 'btm_up_path': '"""./mupots/MUPOTS_Preds_btmup_transformed.pkl"""'}), "(top_down_path='./mupots/pred/', btm_up_path=\n './mupots/MUPOTS_Preds_btmup_transformed.pkl')\n", (377, 473), False, 'from lib... |
from django.contrib import admin
from .models import ResItem
admin.site.register(ResItem)
| [
"django.contrib.admin.site.register"
] | [((63, 91), 'django.contrib.admin.site.register', 'admin.site.register', (['ResItem'], {}), '(ResItem)\n', (82, 91), False, 'from django.contrib import admin\n')] |
import os
import sys
sys.path.append(os.path.join(os.getcwd(), '..'))
| [
"os.getcwd"
] | [((51, 62), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (60, 62), False, 'import os\n')] |
# coding=utf-8
"""以MNIST为例,使用slim.data
"""
import os
import tensorflow as tf
slim = tf.contrib.slim
def get_data(data_dir, num_samples, num_class, file_pattern='*.tfrecord'):
"""返回slim.data.Dataset
:param data_dir: tfrecord文件路径
:param num_samples: 样本数目
:param num_class: 类别数目
:param file_pattern... | [
"tensorflow.FixedLenFeature",
"tensorflow.train.batch",
"os.path.join",
"tensorflow.zeros"
] | [((2069, 2122), 'tensorflow.train.batch', 'tf.train.batch', (['[image, label]'], {'batch_size': 'BATCH_SIZE'}), '([image, label], batch_size=BATCH_SIZE)\n', (2083, 2122), True, 'import tensorflow as tf\n'), ((375, 411), 'os.path.join', 'os.path.join', (['data_dir', 'file_pattern'], {}), '(data_dir, file_pattern)\n', (3... |
#!/usr/bin/python
import os
import sys
import csv
import shutil
from io import StringIO
import unittest
sys.path.append(".")
from mock_helper import import_data
from annogesiclib.format_fixer import FormatFixer
class TestFormatFixer(unittest.TestCase):
def setUp(self):
self.fixer = FormatFixer()
... | [
"sys.path.append",
"unittest.main",
"os.mkdir",
"annogesiclib.format_fixer.FormatFixer",
"os.path.exists",
"mock_helper.import_data",
"shutil.rmtree",
"os.path.join"
] | [((105, 125), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (120, 125), False, 'import sys\n'), ((5938, 5953), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5951, 5953), False, 'import unittest\n'), ((299, 312), 'annogesiclib.format_fixer.FormatFixer', 'FormatFixer', ([], {}), '()\n', (310,... |
import numpy as np
from PIL import Image
from src.data.rand_augment import RandAugmentMC
import torchvision.transforms as transforms
def pad(x, border=4):
return np.pad(x, [(0, 0), (border, border), (border, border)], mode='reflect')
class RandomPadandCrop(object):
"""Crop randomly the image.
Args:
... | [
"numpy.pad",
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.Normalize",
"numpy.transpose",
"torchvision.transforms.RandomResizedCrop",
"numpy.random.randint",
"torchvision.transforms.Compose",
"torchvision.transforms.CenterCrop",
"torchvision.transforms.Resize",
"src.data.r... | [((168, 239), 'numpy.pad', 'np.pad', (['x', '[(0, 0), (border, border), (border, border)]'], {'mode': '"""reflect"""'}), "(x, [(0, 0), (border, border), (border, border)], mode='reflect')\n", (174, 239), True, 'import numpy as np\n'), ((3549, 3579), 'torchvision.transforms.Compose', 'transforms.Compose', (['transform_'... |
"""
Implement credentials lookup using the ~/.netrc(5) file.
"""
import base64
import binascii
from netrc import netrc
import os.path
from ddupdate.ddplugin import AuthPlugin, AuthError
class AuthNetrc(AuthPlugin):
"""Get credentials stored in the .netrc(5) file.
This is the original storage used before 0.7... | [
"netrc.netrc",
"ddupdate.ddplugin.AuthError",
"base64.b64decode"
] | [((1111, 1159), 'ddupdate.ddplugin.AuthError', 'AuthError', (["('No .netrc data found for ' + machine)"], {}), "('No .netrc data found for ' + machine)\n", (1120, 1159), False, 'from ddupdate.ddplugin import AuthPlugin, AuthError\n'), ((1202, 1247), 'ddupdate.ddplugin.AuthError', 'AuthError', (["('No password found for... |
from trackGits import *
import os
def installTest():
"""
Test installView with install function
"""
global __CONFIG_NAME, __SRC_DIR
conf = os.path.join(__SRC_DIR,__CONFIG_NAME)
if not isInstalled(conf):
installed = installView(conf,installer=install)
if not installed: return False
else: return True
els... | [
"os.path.join"
] | [((146, 184), 'os.path.join', 'os.path.join', (['__SRC_DIR', '__CONFIG_NAME'], {}), '(__SRC_DIR, __CONFIG_NAME)\n', (158, 184), False, 'import os\n'), ((428, 466), 'os.path.join', 'os.path.join', (['__SRC_DIR', '__CONFIG_NAME'], {}), '(__SRC_DIR, __CONFIG_NAME)\n', (440, 466), False, 'import os\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 13 14:13:10 2018
@author: antony
"""
import numpy as np
import pandas as pd
import sys
import matplotlib
from matplotlib.colors import Normalize
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import libplot
import matplo... | [
"numpy.abs",
"numpy.sum",
"numpy.ones",
"numpy.argsort",
"numpy.mean",
"libplot.setup",
"numpy.cumsum",
"numpy.max",
"matplotlib.transforms.blended_transform_factory",
"libplot.new_base_fig",
"numpy.sort",
"libplot.invisible_axes",
"numpy.min",
"numpy.random.permutation",
"numpy.concaten... | [((643, 695), 'numpy.concatenate', 'np.concatenate', (['(ranked_gene_list, ranked_gene_list)'], {}), '((ranked_gene_list, ranked_gene_list))\n', (657, 695), True, 'import numpy as np\n'), ((710, 763), 'numpy.concatenate', 'np.concatenate', (['(ranked_score, -ranked_score)'], {'axis': '(0)'}), '((ranked_score, -ranked_s... |
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import BatchSampler
import numpy as np
import torch
import os
from elbo_functions import deviance_upper_bound, elbo, KL_closed, minibatch_KLD_upper_bound, minibatch_KLD_upper_bound_iter
from model_test import MSE_... | [
"elbo_functions.minibatch_KLD_upper_bound_iter",
"torch.eye",
"torch.autograd.grad",
"numpy.empty",
"torch.cat",
"model_test.MSE_test_GPapprox",
"predict_HealthMNIST.variational_complete_gen",
"torch.device",
"torch.no_grad",
"os.path.join",
"predict_HealthMNIST.recon_complete_gen",
"torch.uti... | [((3853, 3869), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3861, 3869), True, 'import numpy as np\n'), ((3891, 3907), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3899, 3907), True, 'import numpy as np\n'), ((3927, 3943), 'numpy.empty', 'np.empty', (['(0, 1)'], {}), '((0, 1))\n', (3935, ... |
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution('foundations_rest_api').version
except DistributionNotFound:
__version__ = None | [
"pkg_resources.get_distribution"
] | [((88, 128), 'pkg_resources.get_distribution', 'get_distribution', (['"""foundations_rest_api"""'], {}), "('foundations_rest_api')\n", (104, 128), False, 'from pkg_resources import get_distribution, DistributionNotFound\n')] |
# Copyright 2019 Rackspace, US 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 w... | [
"openstack.load_balancer.v2.amphora.Amphora",
"openstack.load_balancer.v2.amphora.AmphoraFailover",
"openstack.load_balancer.v2.amphora.AmphoraConfig",
"uuid.uuid4"
] | [((696, 708), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (706, 708), False, 'import uuid\n'), ((717, 729), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (727, 729), False, 'import uuid\n'), ((744, 756), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (754, 756), False, 'import uuid\n'), ((770, 782), 'uuid.uuid4', 'uui... |
# coding: utf-8
from lxml import html
import requests
import pandas as pd
import config
# DATABASE THINGS
# this one is used by the database
import pymongo as pm
# connect to the database choosing the correct collection
mongo_db_url = config.mongo_db_url
mongo_client = pm.MongoClient(mongo_db_url)
db = mongo_client[... | [
"pymongo.MongoClient",
"requests.get",
"lxml.html.fromstring"
] | [((273, 301), 'pymongo.MongoClient', 'pm.MongoClient', (['mongo_db_url'], {}), '(mongo_db_url)\n', (287, 301), True, 'import pymongo as pm\n'), ((4412, 4433), 'requests.get', 'requests.get', (['fullURL'], {}), '(fullURL)\n', (4424, 4433), False, 'import requests\n'), ((4442, 4471), 'lxml.html.fromstring', 'html.fromstr... |
from urllib import parse
from typing import Optional
from logging import Logger
from lxml import etree
from aiohttp import ClientSession
from tenacity import retry
from tenacity import retry_if_exception_type, stop_after_attempt, wait_fixed
from infra.excepts.types import ReqSysAbnoramlError
from infra.asynchttp.resp i... | [
"infra.excepts.types.ReqSysAbnoramlError",
"tenacity.stop_after_attempt",
"tenacity.retry_if_exception_type",
"urllib.parse.urlencode",
"aiohttp.ClientSession",
"tenacity.wait_fixed",
"lxml.etree.tostring",
"lxml.etree.HTML"
] | [((912, 935), 'urllib.parse.urlencode', 'parse.urlencode', (['params'], {}), '(params)\n', (927, 935), False, 'from urllib import parse\n'), ((570, 591), 'tenacity.stop_after_attempt', 'stop_after_attempt', (['(3)'], {}), '(3)\n', (588, 591), False, 'from tenacity import retry_if_exception_type, stop_after_attempt, wai... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
import os
from os.path import relpath
from brainvisa.installer.bvi_utils.paths import Paths
FULLPATH = os.path.dirname(os.path.abspath(__file__))
ROOTPATH = "/" + relpath(FULLPATH + "/../.", "/")
def test_bvi_utils_Pa... | [
"os.path.abspath",
"os.path.relpath"
] | [((220, 245), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (235, 245), False, 'import os\n'), ((264, 296), 'os.path.relpath', 'relpath', (["(FULLPATH + '/../.')", '"""/"""'], {}), "(FULLPATH + '/../.', '/')\n", (271, 296), False, 'from os.path import relpath\n')] |
"""Handles the installation of downloaded modules."""
import os
import shutil
import tempfile
import zipfile
from _cloud import utils
def install(zipfile, metadata):
"""Install a module once it has been downloaded locally.
Takes the GitHub repo zipped up in a BytesIO, as well as all the metadata
about t... | [
"zipfile.extractall",
"zipfile.ZipFile",
"_cloud.utils.pick_site_dir",
"os.path.basename",
"tempfile.gettempdir",
"zipfile.namelist",
"shutil.move",
"os.path.join"
] | [((406, 430), 'zipfile.ZipFile', 'zipfile.ZipFile', (['zipfile'], {}), '(zipfile)\n', (421, 430), False, 'import zipfile\n'), ((448, 469), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (467, 469), False, 'import tempfile\n'), ((474, 504), 'zipfile.extractall', 'zipfile.extractall', (['extract_to'], {}... |
from __future__ import division
from __future__ import print_function
import sys
sys.path.append('..')
from joystick import JoyStick
from servo import ServoController
if __name__ == '__main__':
sc = ServoController(angle_range=80)
js = JoyStick()
while True:
# read serial
v = js.read()
... | [
"sys.path.append",
"servo.ServoController",
"joystick.JoyStick"
] | [((82, 103), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (97, 103), False, 'import sys\n'), ((205, 236), 'servo.ServoController', 'ServoController', ([], {'angle_range': '(80)'}), '(angle_range=80)\n', (220, 236), False, 'from servo import ServoController\n'), ((246, 256), 'joystick.JoyStick',... |
# Unix SMB/CIFS implementation.
# utility functions for provisioning a Samba4 server
# Copyright (C) <NAME> <<EMAIL>> 2007-2010
# Copyright (C) <NAME> <<EMAIL>> 2008-2009
# Copyright (C) <NAME> <<EMAIL>> 2008-2009
#
# Based on the original in EJS:
# Copyright (C) <NAME> <<EMAIL>> 2005
#
# This program is free softwar... | [
"samba.read_and_sub_file",
"samba.param.setup_dir"
] | [((1750, 1790), 'samba.read_and_sub_file', 'read_and_sub_file', (['ldif_path', 'subst_vars'], {}), '(ldif_path, subst_vars)\n', (1767, 1790), False, 'from samba import read_and_sub_file\n'), ((2101, 2141), 'samba.read_and_sub_file', 'read_and_sub_file', (['ldif_path', 'subst_vars'], {}), '(ldif_path, subst_vars)\n', (2... |
#!/bin/env python3
#
# Schooner - Simple Course Management System
# admin.insert.py / Add script owner as an Admin
# University of Turku / Faculty of Technology / Department of Computing
# <NAME> <<EMAIL>>
#
# 2021-08-13 Initial version.
#
# NOTE: Using Psycopg 3 (dev2) 2021-08-13
#
import os
import pwd
import syslog... | [
"psycopg.connect",
"os._exit",
"syslog.syslog",
"os.stat"
] | [((600, 648), 'psycopg.connect', 'psycopg.connect', (['"""dbname=schooner user=postgres"""'], {}), "('dbname=schooner user=postgres')\n", (615, 648), False, 'import psycopg\n'), ((427, 444), 'os.stat', 'os.stat', (['__file__'], {}), '(__file__)\n', (434, 444), False, 'import os\n'), ((1029, 1074), 'syslog.syslog', 'sys... |
__doc__ = r"""
>>> from formalchemy.tests import *
>>> FieldSet.default_renderers = original_renderers.copy()
# some low-level testing first
>>> fs = FieldSet(order1)
>>> fs._raw_fields()
[AttributeField(id), AttributeField(user_id), AttributeField(quantity), AttributeField(user)]
>>> fs.user.name
'user_id'
>>> fs ... | [
"doctest.testmod"
] | [((28095, 28112), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (28110, 28112), False, 'import doctest\n')] |
from setuptools import setup, find_packages
setup(name='pykl',
version='0.1.6',
packages=find_packages(),
author='pykl',
author_email='<EMAIL>',
description='kltool for python, toolset for web, http, cache, dht, xml, json and so on',
long_description=open('README.rst').read(),
... | [
"setuptools.find_packages"
] | [((102, 117), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (115, 117), False, 'from setuptools import setup, find_packages\n')] |
import re
import config
from datetime import datetime
from urllib2 import urlopen
from twilio.rest import TwilioRestClient
def validateStatus(site):
'''Return False to trigger the canary'''
return urlopen(site).getcode() == 200
def validateString(site):
p = re.compile(config.CHECK_STR)
return p.match(... | [
"datetime.datetime.now",
"urllib2.urlopen",
"twilio.rest.TwilioRestClient",
"re.compile"
] | [((272, 300), 're.compile', 're.compile', (['config.CHECK_STR'], {}), '(config.CHECK_STR)\n', (282, 300), False, 'import re\n'), ((807, 862), 'twilio.rest.TwilioRestClient', 'TwilioRestClient', (['config.ACCOUNT_SID', 'config.AUTH_TOKEN'], {}), '(config.ACCOUNT_SID, config.AUTH_TOKEN)\n', (823, 862), False, 'from twili... |
#!/usr/bin/env python3
import time
from http.server import HTTPServer, BaseHTTPRequestHandler
import requests
import json
from functools import reduce
import re
class Server(BaseHTTPRequestHandler):
def do_HEAD(self):
self.send_json({
'success': False,
'message': 'Wrong method, PO... | [
"time.asctime",
"http.server.HTTPServer",
"json.load",
"json.loads",
"json.dumps",
"functools.reduce",
"re.sub",
"re.compile"
] | [((5494, 5536), 'functools.reduce', 'reduce', (['paragraph_splitter', 'paragraphs', '[]'], {}), '(paragraph_splitter, paragraphs, [])\n', (5500, 5536), False, 'from functools import reduce\n'), ((7061, 7113), 'http.server.HTTPServer', 'HTTPServer', (["(config['host'], config['port'])", 'Server'], {}), "((config['host']... |
import os
import argparse
parser = argparse.ArgumentParser(description="Run attention2vec generation embeddings suite.")
parser.add_argument('--dataset', nargs='?', default='cora',
help='Input graph name for saving files')
args = parser.parse_args()
dataset = args.dataset
gamma = [10]
R = [0.5]
T... | [
"os.system",
"argparse.ArgumentParser"
] | [((36, 126), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run attention2vec generation embeddings suite."""'}), "(description=\n 'Run attention2vec generation embeddings suite.')\n", (59, 126), False, 'import argparse\n'), ((766, 780), 'os.system', 'os.system', (['cmd'], {}), '(cmd)... |
import random
def delete_random_character(s):
"""Returns s with a random character deleted"""
if s == "":
return s
pos = random.randint(0, len(s) - 1)
# print("Deleting", repr(s[pos]), "at", pos)
return s[:pos] + s[pos + 1:]
def insert_random_character(s):
"""Returns s with a random c... | [
"random.randint",
"random.randrange",
"random.choice"
] | [((1110, 1133), 'random.choice', 'random.choice', (['mutators'], {}), '(mutators)\n', (1123, 1133), False, 'import random\n'), ((404, 429), 'random.randrange', 'random.randrange', (['(32)', '(127)'], {}), '(32, 127)\n', (420, 429), False, 'import random\n'), ((741, 761), 'random.randint', 'random.randint', (['(0)', '(6... |
import logging
import re
import pystache
def init_logger():
logging.basicConfig(
format=
"%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(message)s",
level=logging.INFO,
)
def _convert_to_dict(obj) -> dict:
converted_obj = {}
if isinstance(obj, list):
for i... | [
"logging.basicConfig",
"pystache.parse",
"pystache.Renderer",
"re.sub",
"logging.getLogger"
] | [((67, 193), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(levelname)s - %(filename)s:%(lineno)s - %(message)s',\n level=logging.INFO)\n", (86, 193), False, 'import ... |
#!/usr/bin/env python
"""
Advent of Code 2020: Day 16
"""
import copy
from collections import defaultdict
import math
import itertools
import signal
import sys
from types import FrameType
from typing import List, Mapping
from pathlib import Path
DEBUG = False
ACTIVE = True
INACTIVE = False
# Common --------------... | [
"copy.copy",
"collections.defaultdict",
"pathlib.Path",
"itertools.product",
"signal.signal",
"sys.exit"
] | [((3140, 3173), 'collections.defaultdict', 'defaultdict', (['bool', 'expanded_state'], {}), '(bool, expanded_state)\n', (3151, 3173), False, 'from collections import defaultdict\n'), ((6576, 6587), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (6584, 6587), False, 'import sys\n'), ((6621, 6664), 'signal.signal', 'sig... |
#!/usr/bin/python
"""
Test oracle client
Author: <NAME>
Copyright (c) 2018 aeternity developers
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
THE SOFTWA... | [
"websocket.create_connection",
"epoch.Epoch",
"json.loads",
"json.dumps"
] | [((1248, 1255), 'epoch.Epoch', 'Epoch', ([], {}), '()\n', (1253, 1255), False, 'from epoch import Epoch\n'), ((2094, 2111), 'json.dumps', 'json.dumps', (['query'], {}), '(query)\n', (2104, 2111), False, 'import json\n'), ((2854, 2871), 'json.dumps', 'json.dumps', (['query'], {}), '(query)\n', (2864, 2871), False, 'impo... |
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup,find_packages
setup(
name="sopt",
version="0.0.6.1",
description="sopt:a simple python optimizer library",
long_description=
'''
sopt is a simple python optimizer library.Currentlly,it includes some stochastic optimization
al... | [
"setuptools.setup"
] | [((81, 1231), 'setuptools.setup', 'setup', ([], {'name': '"""sopt"""', 'version': '"""0.0.6.1"""', 'description': '"""sopt:a simple python optimizer library"""', 'long_description': '"""\n sopt is a simple python optimizer library.Currentlly,it includes some stochastic optimization\n algorithms,like Genetic Algor... |
import logging
from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.models import AccessControlList
from mayan.apps.document_states.classes import WorkflowAction
from .models import UserMailer
from .permissions import permission_user_mailer_use
__all__ = ('EmailAction',)
logger = ... | [
"django.utils.translation.ugettext_lazy",
"logging.getLogger"
] | [((320, 352), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (337, 352), False, 'import logging\n'), ((3751, 3766), 'django.utils.translation.ugettext_lazy', '_', (['"""Send email"""'], {}), "('Send email')\n", (3752, 3766), True, 'from django.utils.translation import ugettex... |
from django.shortcuts import render, redirect
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView
from django.contrib.auth.models import User
from wiki.models import Page
from wiki.forms import PageForm
class PageListView(Li... | [
"django.shortcuts.render",
"django.contrib.auth.models.User.objects.get",
"django.shortcuts.redirect",
"wiki.forms.PageForm"
] | [((510, 556), 'django.shortcuts.render', 'render', (['request', '"""list.html"""', "{'pages': pages}"], {}), "(request, 'list.html', {'pages': pages})\n", (516, 556), False, 'from django.shortcuts import render, redirect\n'), ((846, 890), 'django.shortcuts.render', 'render', (['request', '"""page.html"""', "{'page': pa... |
#from django.conf import settings
from django.conf.urls.static import static
from django import views
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import path, include
from django.utils import decorators
from blog import settings #from .settings import local
import c... | [
"django.conf.urls.static.static",
"django.urls.path"
] | [((3553, 3614), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (3559, 3614), False, 'from django.conf.urls.static import static\n'), ((1055, 1086), 'django.urls.path', 'path', (['"""admin/"""', ... |
from builtins import super
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
# from django.core.checks import messages
from django.shortcuts import render, get_object_or_404
from django.urls import reverse_lazy
from d... | [
"reviews.forms.ReviewForm",
"location.models.Location.objects.all",
"django.utils.decorators.method_decorator",
"builtins.super",
"django.urls.reverse_lazy",
"django.shortcuts.get_object_or_404",
"company.models.Company.published.all",
"pprint.pprint",
"django.shortcuts.render",
"django.contrib.me... | [((2175, 2245), 'django.utils.decorators.method_decorator', 'method_decorator', (['[login_required, employer_required]'], {'name': '"""dispatch"""'}), "([login_required, employer_required], name='dispatch')\n", (2191, 2245), False, 'from django.utils.decorators import method_decorator\n'), ((1022, 1045), 'company.model... |
# coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ReplaceStringRegexRequest(objec... | [
"six.iteritems"
] | [((4485, 4518), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (4498, 4518), False, 'import six\n')] |
"""
WebObs class
"""
from astropy.table import Table
from astropy import units as u
from astropy.coordinates import SkyCoord
import numpy as np
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
import os
import io
import wget
import requests
class WebObs(object):
"""
Class for AAVSO web observati... | [
"matplotlib.pyplot.title",
"os.remove",
"astropy.table.Table",
"matplotlib.pyplot.show",
"numpy.polyfit",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.scatter",
"os.path.exists",
"matplotlib.pyplot.vlines",
"wget.download",
"requests.get",
"numpy.linspace",
"bs4.BeautifulSoup",
"matplotlib.... | [((647, 654), 'astropy.table.Table', 'Table', ([], {}), '()\n', (652, 654), False, 'from astropy.table import Table\n'), ((675, 690), 'bs4.BeautifulSoup', 'BeautifulSoup', ([], {}), '()\n', (688, 690), False, 'from bs4 import BeautifulSoup\n'), ((1024, 1055), 'os.path.exists', 'os.path.exists', (['self.fileoutput'], {}... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 25 13:52:02 2018
@author: sunka
"""
import pandas as pd
dataframe = pd.read_csv('concrete.csv')
print(dataframe)
df1 = dataframe.iloc[:,1:]
df2 = dataframe.iloc[:,:8]
from sklearn import preprocessing
df1 = preprocessing.normalize(df1)
df2 =... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.hist",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"sklearn.metrics.r2_score",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.normalize",
"sklearn.metrics.mean_squared_error"
] | [((127, 154), 'pandas.read_csv', 'pd.read_csv', (['"""concrete.csv"""'], {}), "('concrete.csv')\n", (138, 154), True, 'import pandas as pd\n'), ((283, 311), 'sklearn.preprocessing.normalize', 'preprocessing.normalize', (['df1'], {}), '(df1)\n', (306, 311), False, 'from sklearn import preprocessing\n'), ((321, 349), 'sk... |
from core.differential_geometry import DifferentialGeometry
from core.distribution1d import Distribution1D
from core.light_sample import LightSample
from core.ray import Ray
from core.shape import Shape
from maths.config import infinity_max_f
from maths.normal import Normal
from maths.point3d import Point3d
fro... | [
"core.differential_geometry.DifferentialGeometry",
"core.distribution1d.Distribution1D"
] | [((970, 996), 'core.distribution1d.Distribution1D', 'Distribution1D', (['self.areas'], {}), '(self.areas)\n', (984, 996), False, 'from core.distribution1d import Distribution1D\n'), ((1395, 1417), 'core.differential_geometry.DifferentialGeometry', 'DifferentialGeometry', ([], {}), '()\n', (1415, 1417), False, 'from cor... |
from .models import MemberProfile
import io
import csv
TOKEN_NAME = 'names'
def get_some_objects(list):
return MemberProfile.objects.filter(pk__in=list)
def parse_token_data(request_post):
f = io.StringIO(request_post[TOKEN_NAME])
reader = csv.reader(f, delimiter=',')
user_ids = []
for row in ... | [
"io.StringIO",
"csv.reader"
] | [((207, 244), 'io.StringIO', 'io.StringIO', (['request_post[TOKEN_NAME]'], {}), '(request_post[TOKEN_NAME])\n', (218, 244), False, 'import io\n'), ((258, 286), 'csv.reader', 'csv.reader', (['f'], {'delimiter': '""","""'}), "(f, delimiter=',')\n", (268, 286), False, 'import csv\n')] |
from tsx.db import get_session
import logging
import sys
import argparse
import csv
from tqdm import tqdm
log = logging.getLogger(__name__)
def main():
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(asctime)-15s %(name)s %(levelname)-8s %(message)s')
parser = argparse.ArgumentParser(descripti... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"tsx.db.get_session",
"csv.DictReader",
"logging.getLogger"
] | [((113, 140), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (130, 140), False, 'import logging\n'), ((155, 280), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': '"""%(asctime)-15s %(name)s %(levelname)-8s %(message)s"""'}), "... |
"""Torch Module for Topology Adaptive Graph Convolutional layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import torch as th
from torch import nn
from .... import function as fn
class TAGConv(nn.Module):
r"""Topology Adaptive Graph Convolutional layer from paper `Topology
Adaptive Graph... | [
"torch.nn.init.xavier_normal_",
"torch.cat",
"torch.nn.Linear",
"torch.nn.init.calculate_gain",
"torch.reshape"
] | [((1582, 1639), 'torch.nn.Linear', 'nn.Linear', (['(in_feats * (self._k + 1))', 'out_feats'], {'bias': 'bias'}), '(in_feats * (self._k + 1), out_feats, bias=bias)\n', (1591, 1639), False, 'from torch import nn\n'), ((1770, 1800), 'torch.nn.init.calculate_gain', 'nn.init.calculate_gain', (['"""relu"""'], {}), "('relu')\... |
import sys
sys.path.append('../core')
import argparse
import torch
import cv2
import numpy as np
from viz import sim3_visualization
from lietorch import SO3, SE3, Sim3
from networks.sim3_net import Sim3Net
def normalize_images(images):
images = images[:, :, [2,1,0]]
mean = torch.as_tensor([0.485, 0.456, 0.40... | [
"sys.path.append",
"numpy.stack",
"numpy.load",
"argparse.ArgumentParser",
"lietorch.SE3.Identity",
"lietorch.Sim3.Identity",
"torch.load",
"viz.sim3_visualization",
"cv2.imread",
"networks.sim3_net.Sim3Net",
"numpy.array",
"numpy.tile",
"torch.rand",
"torch.as_tensor",
"torch.no_grad",
... | [((11, 37), 'sys.path.append', 'sys.path.append', (['"""../core"""'], {}), "('../core')\n", (26, 37), False, 'import sys\n'), ((1469, 1484), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1482, 1484), False, 'import torch\n'), ((285, 345), 'torch.as_tensor', 'torch.as_tensor', (['[0.485, 0.456, 0.406]'], {'device... |
import numpy as np
import matplotlib.cm as cm
import matplotlib.pylab as plt
def generate_colors(count):
cm = plt.get_cmap('gist_rainbow')
return np.array([cm(1. * i / count) for i in range(count)]).astype(float)
def get_q_color(id, ant_num):
from PyQt4 import QtGui
r, g, b = get_color(id, ant_num)
... | [
"PyQt4.QtGui.QColor",
"matplotlib.cm",
"numpy.linspace",
"matplotlib.pylab.get_cmap"
] | [((116, 144), 'matplotlib.pylab.get_cmap', 'plt.get_cmap', (['"""gist_rainbow"""'], {}), "('gist_rainbow')\n", (128, 144), True, 'import matplotlib.pylab as plt\n'), ((331, 352), 'PyQt4.QtGui.QColor', 'QtGui.QColor', (['r', 'g', 'b'], {}), '(r, g, b)\n', (343, 352), False, 'from PyQt4 import QtGui\n'), ((407, 433), 'nu... |
from django.db import models
class FullName(models.Model):
full_name = models.CharField(verbose_name='ФИО', max_length=256)
def __str__(self):
return self.full_name
class Meta:
verbose_name = 'ФИО'
verbose_name_plural = 'ФИО'
| [
"django.db.models.CharField"
] | [((77, 129), 'django.db.models.CharField', 'models.CharField', ([], {'verbose_name': '"""ФИО"""', 'max_length': '(256)'}), "(verbose_name='ФИО', max_length=256)\n", (93, 129), False, 'from django.db import models\n')] |
from cffconvert import BibtexObject
import unittest
import os
import ruamel.yaml as yaml
from test.contracts.BibtexObject import Contract
class BibtexObjectTest(Contract, unittest.TestCase):
def setUp(self):
fixture = os.path.join(os.path.dirname(__file__), "CITATION.cff")
with open(fixture, "r")... | [
"os.path.dirname",
"cffconvert.BibtexObject",
"ruamel.yaml.safe_load"
] | [((246, 271), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (261, 271), False, 'import os\n'), ((382, 404), 'ruamel.yaml.safe_load', 'yaml.safe_load', (['cffstr'], {}), '(cffstr)\n', (396, 404), True, 'import ruamel.yaml as yaml\n'), ((427, 474), 'cffconvert.BibtexObject', 'BibtexObject', ([... |
from nltk.corpus import stopwords
import requests
import re
import nltk
nltk.download('stopwords')
WIKI_API_URL = "https://en.wikipedia.org/w/api.php"
inputTitleRepr = './ShortReprLists'
def retrieveCategoryFromJson(pages):
categories = []
for k, v in pages.items():
for cat in v['categories']:
... | [
"nltk.download",
"requests.Session"
] | [((72, 98), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (85, 98), False, 'import nltk\n'), ((2693, 2711), 'requests.Session', 'requests.Session', ([], {}), '()\n', (2709, 2711), False, 'import requests\n')] |
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class RecordRelatedTab:
def __init__(self, app):
self.app = app
def expand_Show_more_actions_dropdown_on_record_page(self):
driv... | [
"selenium.webdriver.support.expected_conditions.element_to_be_clickable",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((510, 566), 'selenium.webdriver.support.expected_conditions.element_to_be_clickable', 'EC.element_to_be_clickable', (['(By.XPATH, dropdown_locator)'], {}), '((By.XPATH, dropdown_locator))\n', (536, 566), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((1465, 1564), 'selenium.webdriver.su... |
# <NAME>
# CS1400 - LW2 XL
# Assignment #11
from modules.orbian import Orbian
from time import sleep
from random import randint
from random import shuffle # Hint hint
def main():
print("WELCOME TO ORBIAN FAMILY")
print()
family = []
input("Hit Enter to Create the First Four Orbians")
for i in ... | [
"random.shuffle",
"modules.orbian.Orbian",
"random.randint",
"time.sleep"
] | [((3890, 3906), 'random.shuffle', 'shuffle', (['famList'], {}), '(famList)\n', (3897, 3906), False, 'from random import shuffle\n'), ((489, 502), 'random.randint', 'randint', (['(2)', '(5)'], {}), '(2, 5)\n', (496, 502), False, 'from random import randint\n'), ((524, 537), 'random.randint', 'randint', (['(3)', '(8)'], ... |
from PIL import Image
from src.utils import int_clamp
from PIL import UnidentifiedImageError
import tkinter.messagebox as messagebox
def safe_open_image(filename, corner_creator):
image = None
try:
if filename is not None and filename != "":
image = PILCollageImage(filename, corner_creator... | [
"src.utils.int_clamp",
"PIL.Image.open"
] | [((1784, 1891), 'src.utils.int_clamp', 'int_clamp', (['((new_borders[2] - new_borders[0]) / self.scale_value)'], {'min_val': '(1)', 'max_val': 'self._image_size[0]'}), '((new_borders[2] - new_borders[0]) / self.scale_value, min_val=1,\n max_val=self._image_size[0])\n', (1793, 1891), False, 'from src.utils import int... |
from django.test import SimpleTestCase
from django.urls import reverse , resolve
from article.views import *
class TestUrls(SimpleTestCase):
def test_articles_url_is_resolved(self):
url = reverse('mumbles-api-articles:articles')
self.assertEquals(resolve(url).func,articles)
def test_artic... | [
"django.urls.reverse",
"django.urls.resolve"
] | [((206, 246), 'django.urls.reverse', 'reverse', (['"""mumbles-api-articles:articles"""'], {}), "('mumbles-api-articles:articles')\n", (213, 246), False, 'from django.urls import reverse, resolve\n'), ((369, 415), 'django.urls.reverse', 'reverse', (['"""mumbles-api-articles:create-article"""'], {}), "('mumbles-api-artic... |
from game.field import FieldXO
from game.player import Player, Bot
class Game:
__field__: FieldXO = None
__status__: bool = False
__active_player__: Player
def __init__(self, player_x_id: str, player_o_id: str):
self.__playerX__ = self.__create_player(player_x_id, 'X')
self.__playerO... | [
"game.field.FieldXO",
"game.player.Bot",
"game.player.Player"
] | [((908, 917), 'game.field.FieldXO', 'FieldXO', ([], {}), '()\n', (915, 917), False, 'from game.field import FieldXO\n'), ((552, 580), 'game.player.Bot', 'Bot', ([], {'player_type': 'player_type'}), '(player_type=player_type)\n', (555, 580), False, 'from game.player import Player, Bot\n'), ((614, 666), 'game.player.Play... |
import numpy as np
from SOM import SOM
data = np.loadtxt('Data/output.txt', delimiter=';', usecols=range(40))
###SOM
som = SOM(10, 10) # initialize the SOM
som.fit(data, 10000, decay='hill')
# som = SOM(10, 10) # initialize the SOM
# som.load('Data/SOM')
targets = np.loadtxt('Data/target.txt', dtype='int')
targ... | [
"SOM.SOM",
"numpy.loadtxt"
] | [((126, 137), 'SOM.SOM', 'SOM', (['(10)', '(10)'], {}), '(10, 10)\n', (129, 137), False, 'from SOM import SOM\n'), ((272, 314), 'numpy.loadtxt', 'np.loadtxt', (['"""Data/target.txt"""'], {'dtype': '"""int"""'}), "('Data/target.txt', dtype='int')\n", (282, 314), True, 'import numpy as np\n')] |
'''
##### DO Not Touch your face ver.0.2
### Medical Imaging & Intelligent Reality Lab (MI2RL) @ Asan Medical Center(AMC)
# MI2RL website : https://www.mi2rl.co/
# AMC : http://www.amc.seoul.kr/asan/main.do
### Developer
# <NAME> : <EMAIL>
# <NAME> : <EMAIL>
# <NAME> : <EMAIL>
# <NAME> : <EMAIL>
# <NAME> : <EMAIL>
... | [
"PyQt5.QtWidgets.QApplication",
"gui_viewer.GUIViewer"
] | [((731, 763), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (753, 763), False, 'from PyQt5 import QtWidgets\n'), ((778, 789), 'gui_viewer.GUIViewer', 'GUIViewer', ([], {}), '()\n', (787, 789), False, 'from gui_viewer import GUIViewer\n')] |
import subprocess
import sys
import json
import datetime
import urllib.parse
import sys
def main():
files_by_date = {}
bucket = sys.argv[1]
days_to_keep = int(sys.argv[2])
print(f"Looking for binaries to delete older than {days_to_keep} days")
files_lines = execute_cli(f"b2 ls --long --versions {b... | [
"datetime.datetime.strptime",
"subprocess.Popen",
"datetime.datetime.utcnow"
] | [((892, 953), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'shell': '(True)', 'stdout': 'subprocess.PIPE'}), '(command, shell=True, stdout=subprocess.PIPE)\n', (908, 953), False, 'import subprocess\n'), ((473, 521), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['parts[2]', '"""%Y-%m-%d"""'], {... |
# Copyright 2010 New Relic, 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 writ... | [
"newrelic.core.attribute.process_user_attribute",
"time.time",
"newrelic.core.attribute.check_name_is_string",
"newrelic.core.attribute.check_name_length",
"logging.getLogger",
"re.compile"
] | [((822, 849), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (839, 849), False, 'import logging\n'), ((882, 913), 're.compile', 're.compile', (['"""^[a-zA-Z0-9:_ ]+$"""'], {}), "('^[a-zA-Z0-9:_ ]+$')\n", (892, 913), False, 'import re\n'), ((1558, 1584), 'newrelic.core.attribute.check_name... |
from .tractography import Tractography
from .trackvis import tractography_from_trackvis_file, tractography_to_trackvis_file
from warnings import warn
import numpy
__all__ = [
'Tractography',
'tractography_from_trackvis_file', 'tractography_to_trackvis_file',
'tractography_from_files',
'tractography_fr... | [
"warnings.warn",
"numpy.ones",
"numpy.eye"
] | [((688, 798), 'warnings.warn', 'warn', (['"""VTK support not installed in this python distribution, VTK files will not be read or written"""'], {}), "(\n 'VTK support not installed in this python distribution, VTK files will not be read or written'\n )\n", (692, 798), False, 'from warnings import warn\n'), ((1992... |
import os
from setuptools import find_packages, setup
def read_requirements():
ret = []
fname = os.path.join(os.path.dirname(__file__), "requirements.txt")
with open(fname, "r") as f:
for line in f:
line = line.strip()
if line and not line.startswith("#"):
... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((120, 145), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (135, 145), False, 'import os\n'), ((1383, 1398), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1396, 1398), False, 'from setuptools import find_packages, setup\n')] |
from django.contrib import admin
from temp_tribes.models import Tribe
class TribeAdmin(admin.ModelAdmin):
list_display = ('name', 'slug', 'creator', 'created', 'deleted')
admin.site.register(Tribe, TribeAdmin)
| [
"django.contrib.admin.site.register"
] | [((179, 217), 'django.contrib.admin.site.register', 'admin.site.register', (['Tribe', 'TribeAdmin'], {}), '(Tribe, TribeAdmin)\n', (198, 217), False, 'from django.contrib import admin\n')] |
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from app.models import ResourceLink
def index(request):
links = ResourceLink.objects.all()
return render(request, "links/index.html", context={
"links": links
})
def link(request, url_extension):
# L... | [
"app.models.ResourceLink.objects.all",
"app.models.ResourceLink.objects.get",
"django.http.HttpResponse",
"app.models.ResourceLink.objects.filter",
"django.shortcuts.render",
"django.http.HttpResponseRedirect"
] | [((164, 190), 'app.models.ResourceLink.objects.all', 'ResourceLink.objects.all', ([], {}), '()\n', (188, 190), False, 'from app.models import ResourceLink\n'), ((202, 263), 'django.shortcuts.render', 'render', (['request', '"""links/index.html"""'], {'context': "{'links': links}"}), "(request, 'links/index.html', conte... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-06 20:14
from __future__ import unicode_literals
import uuid
from django.db import migrations, models
def gen_uuid(apps, schema_editor):
"""Generate unique UUID values"""
Profile = apps.get_model('profiles', 'Profile')
for profile in Profil... | [
"django.db.migrations.RunPython",
"uuid.uuid4"
] | [((363, 375), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (373, 375), False, 'import uuid\n'), ((541, 611), 'django.db.migrations.RunPython', 'migrations.RunPython', (['gen_uuid'], {'reverse_code': 'migrations.RunPython.noop'}), '(gen_uuid, reverse_code=migrations.RunPython.noop)\n', (561, 611), False, 'from django.d... |
import pdb
import binascii
import os
from flask import g
from werkzeug.security import generate_password_hash, check_password_hash
from . import db
from .utils import timestamp
class User(db.Model):
"""The User model
Attributes:
__tablename__ (str): Table name for user model in database
id (S... | [
"werkzeug.security.check_password_hash",
"os.urandom",
"werkzeug.security.generate_password_hash"
] | [((2217, 2249), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (2239, 2249), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((2619, 2668), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password_h... |
from trodesnetwork import socket
from enum import Enum, auto
__all__ = ['CurrentScaling', 'GlobalStimulationSettings', 'StimulationCommand',
'TrodesHardware', 'TrodesInfoRequester', 'TrodesAnnotationRequester',
'TrodesAcquisitionRequester', 'TrodesEventSubscriber',
'TrodesAcquisitionS... | [
"enum.auto",
"trodesnetwork.socket.ServiceConsumer",
"trodesnetwork.socket.SourceSubscriber"
] | [((407, 413), 'enum.auto', 'auto', ([], {}), '()\n', (411, 413), False, 'from enum import Enum, auto\n'), ((428, 434), 'enum.auto', 'auto', ([], {}), '()\n', (432, 434), False, 'from enum import Enum, auto\n'), ((449, 455), 'enum.auto', 'auto', ([], {}), '()\n', (453, 455), False, 'from enum import Enum, auto\n'), ((47... |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | [
"io.BytesIO",
"requests.Session",
"struct.unpack",
"struct.calcsize",
"logging.getLogger"
] | [((884, 911), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (901, 911), False, 'import logging\n'), ((1067, 1085), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1083, 1085), False, 'import requests\n'), ((4962, 4971), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (4969, 4971), ... |
from django import forms
from .models import Project,Rate,Profile,DESIGN_CHOICES,USABILITY_CHOICES,CONTENT_CHOICES
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class GreazeRegistrationForm(UserCreationForm):
class Meta:
model = User
fields = ['f... | [
"django.forms.Select",
"django.forms.URLInput",
"django.forms.TextInput",
"django.forms.FileInput",
"django.forms.Textarea"
] | [((1421, 1508), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'class': 'form-control', 'placeholder': 'Project Title...'}"}), "(attrs={'class': 'form-control', 'placeholder':\n 'Project Title...'})\n", (1436, 1508), False, 'from django import forms\n'), ((1523, 1630), 'django.forms.TextInput', 'forms... |
# encoding: utf-8
__author__ = "<NAME>"
# Taken and adapted from: https://github.com/wdika/NeMo/blob/main/tests/core/test_optimizers_schedulers.py
import math
import os
import random
import shutil
from abc import ABC
import numpy as np
import omegaconf
import pytest
import pytorch_lightning as pl
import torch
import... | [
"pytorch_lightning.Trainer",
"mridc.core.optim.lr_scheduler.register_scheduler",
"torch.randn",
"mridc.core.optim.optimizers.register_optimizer",
"mridc.core.optim.lr_scheduler.WarmupHoldPolicy",
"pytest.mark.run_only_on",
"mridc.core.optim.lr_scheduler.WarmupPolicy",
"mridc.core.optim.lr_scheduler.Sq... | [((32233, 32263), 'pytest.mark.run_only_on', 'pytest.mark.run_only_on', (['"""CPU"""'], {}), "('CPU')\n", (32256, 32263), False, 'import pytest\n'), ((35520, 35550), 'pytest.mark.run_only_on', 'pytest.mark.run_only_on', (['"""CPU"""'], {}), "('CPU')\n", (35543, 35550), False, 'import pytest\n'), ((977, 998), 'torch.nn.... |
from __future__ import print_function, absolute_import, division, unicode_literals
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accomp... | [
"server_common.channel_access.ChannelAccess.caget"
] | [((2955, 2994), 'server_common.channel_access.ChannelAccess.caget', 'ChannelAccess.caget', (['pv'], {'as_string': '(True)'}), '(pv, as_string=True)\n', (2974, 2994), False, 'from server_common.channel_access import ChannelAccess\n')] |
#!/usr/bin/python
import csv
import os
def find_headers(lines) :
host_headers = ['host']
for line in lines :
if(line.count("State") > 0 and line.count("rank-1") > 0) :
t = line.split(",")
host_headers.append(t[7])
return host_headers
def print_data(file_name) :
f = open... | [
"csv.writer",
"os.listdir"
] | [((1682, 1709), 'os.listdir', 'os.listdir', (['"""./dump_files/"""'], {}), "('./dump_files/')\n", (1692, 1709), False, 'import os\n'), ((1446, 1465), 'csv.writer', 'csv.writer', (['csvFile'], {}), '(csvFile)\n', (1456, 1465), False, 'import csv\n'), ((1593, 1612), 'csv.writer', 'csv.writer', (['csvFile'], {}), '(csvFil... |
#!/usr/bin/env python3
# Author: <NAME>
# INFO521 Homeword 3 Problem 6
import numpy as np
import matplotlib.pyplot as plt
# --------------------------------------------------
def true_function(x):
"""$t = 5x+x^2-0.5x^3$"""
return (5 * x) + x**2 - (0.5 * x**3)
# --------------------------------------------... | [
"numpy.random.uniform",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.power",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.dot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.sav... | [((571, 603), 'numpy.random.uniform', 'np.random.uniform', (['xmin', 'xmax', 'N'], {}), '(xmin, xmax, N)\n', (588, 603), True, 'import numpy as np\n'), ((1166, 1192), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'N'], {}), '(xmin, xmax, N)\n', (1177, 1192), True, 'import numpy as np\n'), ((1258, 1271), 'matplotli... |
import sys
sys.path.append('../')
from matplotlib import figure
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import os
from tqdm import tqdm
from models import model
### Config folders
config_data = pd.read_csv('config.csv', sep=',', header=None, index_col=0)
figures_path = config_data.l... | [
"sys.path.append",
"matplotlib.pyplot.xlim",
"pandas.DataFrame",
"seaborn.catplot",
"argparse.ArgumentParser",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subpl... | [((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((231, 291), 'pandas.read_csv', 'pd.read_csv', (['"""config.csv"""'], {'sep': '""","""', 'header': 'None', 'index_col': '(0)'}), "('config.csv', sep=',', header=None, index_col=0)\n", (242, 291), True, ... |
"""
webcam_train
Developer: <NAME>, <NAME>
Version: 0.1.0
Release Date: 2017-09-30
"""
import numpy as np
import cv2
import tensorflow as tf
import sys
from kwin import *
import time
import webcam
import dataset
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
#################################################... | [
"os.mkdir",
"os.path.exists",
"webcam.record_avi",
"dataset.train_data_path",
"retrain.do_train"
] | [((898, 916), 'retrain.do_train', 'retrain.do_train', ([], {}), '()\n', (914, 916), False, 'import retrain\n'), ((712, 777), 'webcam.record_avi', 'webcam.record_avi', ([], {'target_name': 'target_name', 'target_dir': 'target_dir'}), '(target_name=target_name, target_dir=target_dir)\n', (729, 777), False, 'import webcam... |
from django.contrib.auth import get_user_model
from django.contrib import admin
# Register your models here.
from .models import Post, Link
User = get_user_model()
class LinkInline(admin.StackedInline):
model = Link
extra = 0
# readonly_fields = ['url',]
fields = ['url']
class PostAdmin(admin.ModelA... | [
"django.contrib.auth.get_user_model",
"django.contrib.admin.site.register"
] | [((149, 165), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (163, 165), False, 'from django.contrib.auth import get_user_model\n'), ((462, 498), 'django.contrib.admin.site.register', 'admin.site.register', (['Post', 'PostAdmin'], {}), '(Post, PostAdmin)\n', (481, 498), False, 'from django.co... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# @Author: <NAME>
#
# app/comm/psql_wrapper.py
#
# PostgresqlWrapper that wraps postgres connection
# and also allows for our unit and integration tests to more
# easily mock it.
#
import psycopg2
from functools import wraps
class PostgresqlWrapper:
"""All... | [
"functools.wraps",
"psycopg2.connect"
] | [((667, 682), 'functools.wraps', 'wraps', (['function'], {}), '(function)\n', (672, 682), False, 'from functools import wraps\n'), ((752, 794), 'psycopg2.connect', 'psycopg2.connect', ([], {}), '(**self.params_postgresql)\n', (768, 794), False, 'import psycopg2\n')] |
import csv
from sklearn import tree
class tree_classifier():
classes_dict = {0: 'going_left',
1: 'going_right',
2: 'falling',
3: 'just_sitting',
4: 'just_standing',
5: 'just_lying',
6: 'sitting... | [
"csv.reader",
"sklearn.tree.DecisionTreeClassifier"
] | [((1763, 1804), 'sklearn.tree.DecisionTreeClassifier', 'tree.DecisionTreeClassifier', ([], {'max_depth': '(10)'}), '(max_depth=10)\n', (1790, 1804), False, 'from sklearn import tree\n'), ((2145, 2176), 'csv.reader', 'csv.reader', (['tsv'], {'quotechar': '"""\t"""'}), "(tsv, quotechar='\\t')\n", (2155, 2176), False, 'im... |
from CoolProp.CoolProp import get_fluid_param_string
lines = open('KunzWagner2012_TableA7.txt','r').read()
template = """{{"Name1" : "{Name1:s}",
"Name2" : "{Name2:s}",
"CAS1" : "{CAS1:s}",
"CAS2" : "{CAS2:s}",
"d" : {d:s},
"t" : {t:s},
"n" : {n:s},
"eta" : {eta:s},
"epsilon" : {epsilon:s},
"beta": {beta:s},
"gamma":... | [
"CoolProp.CoolProp.get_fluid_param_string"
] | [((1054, 1090), 'CoolProp.CoolProp.get_fluid_param_string', 'get_fluid_param_string', (['name1', '"""CAS"""'], {}), "(name1, 'CAS')\n", (1076, 1090), False, 'from CoolProp.CoolProp import get_fluid_param_string\n'), ((1101, 1137), 'CoolProp.CoolProp.get_fluid_param_string', 'get_fluid_param_string', (['name2', '"""CAS"... |