code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import numpy as np import cv2 as cv import imageio import torch import torch.nn as nn import torch.nn.functional as F inputName = "../bin/outlow_000.exr" outputName1 = "../bin/outlow_001_warpedNumpy.exr" outputName2 = "../bin/outlow_001_warpedTorch.exr" flowName = "../bin/outlowf_000.exr" flowTest1 = "../bin/outlowf_0...
[ "numpy.clip", "torch.nn.functional.grid_sample", "numpy.uint8", "imageio.imwrite", "numpy.arange", "torch.unsqueeze", "torch.broadcast_tensors", "torch.from_numpy", "numpy.zeros", "imageio.imread", "numpy.float32", "torch.linspace" ]
[((1515, 1540), 'imageio.imread', 'imageio.imread', (['inputName'], {}), '(inputName)\n', (1529, 1540), False, 'import imageio\n'), ((1789, 1854), 'imageio.imwrite', 'imageio.imwrite', (['"""../bin/outlowf_000_t3.png"""', 'inputImage[:, :, 3]'], {}), "('../bin/outlowf_000_t3.png', inputImage[:, :, 3])\n", (1804, 1854),...
import arcade import arcade.gui from sgj.game_manager import GameManager from sgj.graphics.game_view import GameView from sgj.sounds.sounds import play_menu_theme class QuitButton(arcade.gui.UIFlatButton): def on_click(self, event: arcade.gui.UIOnClickEvent): arcade.exit() class StartView(arcade.View):...
[ "arcade.exit", "arcade.draw_text", "arcade.gui.UIManager", "sgj.game_manager.GameManager", "arcade.draw_rectangle_filled", "arcade.gui.UIAnchorWidget", "arcade.load_texture", "arcade.set_viewport", "arcade.set_background_color", "arcade.Sound", "arcade.start_render", "arcade.gui.UIFlatButton",...
[((275, 288), 'arcade.exit', 'arcade.exit', ([], {}), '()\n', (286, 288), False, 'import arcade\n'), ((415, 437), 'arcade.gui.UIManager', 'arcade.gui.UIManager', ([], {}), '()\n', (435, 437), False, 'import arcade\n'), ((477, 533), 'arcade.set_background_color', 'arcade.set_background_color', (['arcade.color.DARK_BLUE_...
import cv2 import os import numpy as np import av from torchvision.transforms import Compose, Resize, ToTensor from PIL import Image import matplotlib.pyplot as plt import torch from torch.utils.data import DataLoader from dataset import MaskDataset, get_img_files, get_img_files_eval from nets.MobileNetV2_unet import M...
[ "av.open", "dataset.MaskDataset", "torch.cuda.is_available", "os.path.exists", "nets.MobileNetV2_unet.MobileNetV2_unet", "cv2.addWeighted", "cv2.VideoWriter_fourcc", "torchvision.transforms.ToTensor", "numpy.abs", "cv2.warpAffine", "cv2.cvtColor", "torchvision.transforms.Resize", "cv2.getRot...
[((1816, 1862), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['(cX, cY)', '(-angle)', '(1.0)'], {}), '((cX, cY), -angle, 1.0)\n', (1839, 1862), False, 'import cv2\n'), ((1873, 1888), 'numpy.abs', 'np.abs', (['M[0, 0]'], {}), '(M[0, 0])\n', (1879, 1888), True, 'import numpy as np\n'), ((1899, 1914), 'numpy.abs...
#!/usr/bin/env python3 ###################################################################################################### # # Organization: <NAME> Leukemia AI Research # Repository: HIAS: Hospital Intelligent Automation System # # Author: <NAME> (<EMAIL>) # # Title: iotJumpWay MQTT IoT Agent # De...
[ "flask.Flask", "psutil.virtual_memory", "sys.exit", "Classes.MQTT.Application", "psutil.sensors_temperatures", "Classes.Helpers.Helpers", "Classes.Blockchain.Blockchain", "json.dumps", "psutil.cpu_percent", "threading.Timer", "Classes.ContextBroker.ContextBroker", "requests.get", "os.path.di...
[((19336, 19351), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (19341, 19351), False, 'from flask import Flask, request, Response\n'), ((20967, 21016), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'MQTT.signal_handler'], {}), '(signal.SIGINT, MQTT.signal_handler)\n', (20980, 21016), False, 'impor...
from datetime import datetime import os.path import functools import collections import copy import re import time import logging import numpy as np import tensorflow as tf from train_common import get_global_step, get_lr_and_max_steps, get_ops, run_op import prune_algorithm.prune_common as pc logging.basicConfig(l...
[ "logging.basicConfig", "tensorflow.app.flags.DEFINE_float", "tensorflow.device", "train_common.get_global_step", "train_common.get_lr_and_max_steps", "tensorflow.Graph", "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.run", "tensorflow.placeholder", "tensorflow.app.flags.DEFINE_string", "...
[((299, 339), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.ERROR'}), '(level=logging.ERROR)\n', (318, 339), False, 'import logging\n'), ((368, 484), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""train_dir"""', '"""/tmp/tmp_train"""', '"""Directory where to write even...
''' In this script we output a table that collects the exons associated with each peptide''' import glob import sys import os import csv base_dir = sys.argv[1] tcga_base_path = sys.argv[2] donor_file = sys.argv[3] data_dir = sys.argv[4] plot_dir=os.path.join(base_dir, "figures/") exon_back_table_path=os.path.join(pl...
[ "csv.writer", "os.path.join", "csv.reader" ]
[((249, 283), 'os.path.join', 'os.path.join', (['base_dir', '"""figures/"""'], {}), "(base_dir, 'figures/')\n", (261, 283), False, 'import os\n'), ((305, 360), 'os.path.join', 'os.path.join', (['plot_dir', '"""data/data_recurrence_plot.tsv"""'], {}), "(plot_dir, 'data/data_recurrence_plot.tsv')\n", (317, 360), False, '...
import os import subprocess import os.path from gql import gql, Client from gql.transport.requests import RequestsHTTPTransport working_dir = "/tmp/the-great-archiving" ORG = "cf-platform-eng" def run_command(cmd, dir=None): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, cw...
[ "subprocess.Popen", "os.environ.get", "gql.Client", "os.path.join", "os.path.isfile", "gql.transport.requests.RequestsHTTPTransport", "gql.gql" ]
[((236, 331), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'shell': '(True)', 'cwd': 'dir'}), '(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell\n =True, cwd=dir)\n', (252, 331), False, 'import subprocess\n'), ((618, 654), 'os.environ.get', 'o...
import os from avalon import io def get_avalon_database(): """Mongo database used in avalon's io. * Function is not used in pype 3.0 where was replaced with usage of AvalonMongoDB. """ if io._database is None: set_io_database() return io._database def set_io_database(): """Set ...
[ "avalon.io.install", "os.environ.get" ]
[((613, 625), 'avalon.io.install', 'io.install', ([], {}), '()\n', (623, 625), False, 'from avalon import io\n'), ((585, 608), 'os.environ.get', 'os.environ.get', (['key', '""""""'], {}), "(key, '')\n", (599, 608), False, 'import os\n')]
# encoding: utf-8 # author: vatsalya-gupta ''' Necessary import statements ''' import pandas as pd from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier from sklearn.preprocessing import LabelEncoder from sklearn.metrics import accuracy_score ''' Reading in the data u...
[ "sklearn.preprocessing.LabelEncoder", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.metrics.accuracy_score" ]
[((383, 421), 'pandas.read_csv', 'pd.read_csv', (['"""../data/car_cleaned.csv"""'], {}), "('../data/car_cleaned.csv')\n", (394, 421), True, 'import pandas as pd\n'), ((621, 635), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (633, 635), False, 'from sklearn.preprocessing import LabelEncoder\n'...
""" Django settings for the impart project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import environ...
[ "environ.Path", "environ.Env" ]
[((465, 478), 'environ.Env', 'environ.Env', ([], {}), '()\n', (476, 478), False, 'import environ\n'), ((339, 361), 'environ.Path', 'environ.Path', (['__file__'], {}), '(__file__)\n', (351, 361), False, 'import environ\n')]
#!/usr/bin/env python3 # NOTE: to run on command line # python3 -m unittest -v test_unittest_matrix_store ################################################################## # # # Copyright (C) 2014, Institute for Defense Analyses # # 485...
[ "os.path.dirname", "unittest.skip", "MyPyLARC.matrix_random_matrixID" ]
[((4870, 4891), 'unittest.skip', 'unittest.skip', (['"""hide"""'], {}), "('hide')\n", (4883, 4891), False, 'import unittest\n'), ((5264, 5285), 'unittest.skip', 'unittest.skip', (['"""hide"""'], {}), "('hide')\n", (5277, 5285), False, 'import unittest\n'), ((5726, 5747), 'unittest.skip', 'unittest.skip', (['"""hide"""'...
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from django.contrib import admin import secure_witness.views from secure_witness.views import saved urlpatterns = patterns('', #/admin/ url(r'^admin/', inc...
[ "django.conf.urls.include", "django.contrib.staticfiles.urls.staticfiles_urlpatterns", "django.conf.urls.url" ]
[((4588, 4613), 'django.contrib.staticfiles.urls.staticfiles_urlpatterns', 'staticfiles_urlpatterns', ([], {}), '()\n', (4611, 4613), False, 'from django.contrib.staticfiles.urls import staticfiles_urlpatterns\n'), ((954, 990), 'django.conf.urls.url', 'url', (['"""^saved/$"""', 'saved'], {'name': '"""saved"""'}), "('^s...
import os import streamlit.components.v1 as components _RELEASE = True if not _RELEASE: _component_func = components.declare_component( "st_codemirror_diff", url="http://localhost:3001", ) else: parent_dir = os.path.dirname(os.path.abspath(__file__)) build_dir = os.path.join(parent_dir...
[ "os.path.join", "streamlit.subheader", "streamlit.set_page_config", "os.path.abspath", "streamlit.components.v1.declare_component" ]
[((112, 191), 'streamlit.components.v1.declare_component', 'components.declare_component', (['"""st_codemirror_diff"""'], {'url': '"""http://localhost:3001"""'}), "('st_codemirror_diff', url='http://localhost:3001')\n", (140, 191), True, 'import streamlit.components.v1 as components\n'), ((297, 339), 'os.path.join', 'o...
import os, sys, subprocess def sort_files(fns, sorted_col, header=True): for fn in fns: sort_file(fn, sorted_col, header=header) return True def sort_file(fn, sorted_col, header=True): path, name = os.path.split(fn) sorted_fn = os.path.join(path, name.replace('tsv','sortBy.%s.tsv' % str(sorted...
[ "subprocess.call", "os.path.split" ]
[((220, 237), 'os.path.split', 'os.path.split', (['fn'], {}), '(fn)\n', (233, 237), False, 'import os, sys, subprocess\n'), ((444, 476), 'subprocess.call', 'subprocess.call', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (459, 476), False, 'import os, sys, subprocess\n')]
import setuptools with open("README.md") as f: long_description = f.read() setuptools.setup( name="cuss_inspect", version="1.0.1b", author="<NAME>", author_email="<EMAIL>, <EMAIL>,<EMAIL>", description="A basic and simple yet powerful Python library to detect toxicity/profanity of a review or list of reve...
[ "setuptools.find_packages" ]
[((477, 503), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (501, 503), False, 'import setuptools\n')]
from django.conf import settings from django.contrib import admin from django.urls import path, include from django.views.generic.base import TemplateView from django.conf.urls import include, url urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path('accounts/pr...
[ "django.conf.urls.include", "django.urls.path", "django.views.generic.base.TemplateView.as_view" ]
[((218, 249), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (222, 249), False, 'from django.urls import path, include\n'), ((273, 296), 'django.conf.urls.include', 'include', (['"""allauth.urls"""'], {}), "('allauth.urls')\n", (280, 296), False, 'from django.con...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: PostEstimation.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google....
[ "google.protobuf.symbol_database.Default", "google.protobuf.descriptor.FieldDescriptor", "google.protobuf.descriptor.MethodDescriptor", "google.protobuf.descriptor.FileDescriptor", "google.protobuf.reflection.GeneratedProtocolMessageType" ]
[((419, 445), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (443, 445), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((461, 1221), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""PostEstimation.proto""...
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team and 2021 Zilliz. # # 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 # # Unles...
[ "towhee.trainer.trainer.Trainer", "pathlib.Path", "towhee.trainer.callback.TrainerControl", "towhee.trainer.training_config.TrainingConfig", "unittest.main", "torchvision.models.resnet50" ]
[((1645, 1671), 'unittest.main', 'unittest.main', ([], {'verbosity': '(1)'}), '(verbosity=1)\n', (1658, 1671), False, 'import unittest\n'), ((1057, 1073), 'towhee.trainer.training_config.TrainingConfig', 'TrainingConfig', ([], {}), '()\n', (1071, 1073), False, 'from towhee.trainer.training_config import TrainingConfig\...
# Copyright (c) 2016 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
[ "collections.deque", "math.floor" ]
[((4345, 4355), 'collections.deque', 'deque', (['[0]'], {}), '([0])\n', (4350, 4355), False, 'from collections import deque\n'), ((3268, 3295), 'math.floor', 'math.floor', (['((child - 1) / 2)'], {}), '((child - 1) / 2)\n', (3278, 3295), False, 'import math\n'), ((2613, 2630), 'math.floor', 'math.floor', (['(n / 2)'], ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Jan 2018 hacer calib extrisneca con pymc3 @author: sebalander """ # %% # import glob import os import corner import time import seaborn as sns import scipy as sc import scipy.stats as sts import matplotlib.pyplot as plt from copy import deepcopy as dc imp...
[ "numpy.prod", "calibration.calibrator.errorCuadraticoImagen", "numpy.sqrt", "matplotlib.pyplot.ylabel", "numpy.polyfit", "numpy.log", "time.sleep", "numpy.array", "pymc3.sample", "sys.path.append", "numpy.arange", "calibration.calibrator.points2linearised", "numpy.save", "numpy.mean", "t...
[((549, 597), 'sys.path.append', 'sys.path.append', (['"""/home/sebalander/Code/sebaPhD"""'], {}), "('/home/sebalander/Code/sebaPhD')\n", (564, 597), False, 'import sys\n'), ((2996, 3008), 'numpy.sqrt', 'np.sqrt', (['pi2'], {}), '(pi2)\n', (3003, 3008), True, 'import numpy as np\n'), ((4852, 4875), 'numdifftools.Hessia...
import pyqtgraph as pg from pyqtgraph import GraphicsLayoutWidget from Utilities.IO import IOHelper from PyQt5.QtCore import * from PyQt5.QtWidgets import * from Utilities.Helper import settings from pathlib import Path import numpy as np from PIL import Image import datetime from queue import Queue from PyQt5 import Q...
[ "PIL.Image.fromarray", "pathlib.Path", "pyqtgraph.GraphicsLayout", "pyqtgraph.ImageItem", "numpy.log", "pyqtgraph.setConfigOptions", "PyQt5.QtGui.QDesktopWidget", "numpy.array", "numpy.zeros", "datetime.datetime.now", "Utilities.IO.IOHelper.get_config_setting", "pyqtgraph.GraphicsLayoutWidget"...
[((1552, 1593), 'pyqtgraph.GraphicsLayout', 'pg.GraphicsLayout', ([], {'border': '(100, 100, 100)'}), '(border=(100, 100, 100))\n', (1569, 1593), True, 'import pyqtgraph as pg\n'), ((1609, 1634), 'pyqtgraph.GraphicsLayoutWidget', 'pg.GraphicsLayoutWidget', ([], {}), '()\n', (1632, 1634), True, 'import pyqtgraph as pg\n...
import unittest from os.path import join from FadeMaxSize.findMax import find_max_file class MaxTest(unittest.TestCase): def test_v1(self): self.assertEqual(find_max_file(join('tests', 'test_folder')), { 'file': join('tests', 'test_folder', 'Firefox_Installer.test'), 'size': ...
[ "unittest.main", "os.path.join" ]
[((863, 878), 'unittest.main', 'unittest.main', ([], {}), '()\n', (876, 878), False, 'import unittest\n'), ((191, 219), 'os.path.join', 'join', (['"""tests"""', '"""test_folder"""'], {}), "('tests', 'test_folder')\n", (195, 219), False, 'from os.path import join\n'), ((244, 298), 'os.path.join', 'join', (['"""tests"""'...
# -*- coding: utf-8 -*- #import scrapy # class LianjiaSpider(scrapy.Spider): # name = 'lianjia' # allowed_domains = [''https://sy.lianjia.com/ershoufang/''] # start_urls = ['http://'https://sy.lianjia.com/ershoufang/'/'] # # def parse(self, response): # pass from scrapy import Request from scr...
[ "lianjiahouse.items.LianjiahouseItem", "scrapy.Request" ]
[((1335, 1353), 'lianjiahouse.items.LianjiahouseItem', 'LianjiahouseItem', ([], {}), '()\n', (1351, 1353), False, 'from lianjiahouse.items import LianjiahouseItem\n'), ((706, 750), 'scrapy.Request', 'Request', ([], {'url': 'start_url', 'headers': 'self.headers'}), '(url=start_url, headers=self.headers)\n', (713, 750), ...
# -*- coding: utf-8 -*- """ Created on Sat Feb 23 16:16:12 2019 @author: Nate """ from scipy import random import numpy as np import matplotlib.pyplot as plt a = 0 b = 1 N = 10000 xrand = random.uniform(a,b,N) to_plot = [] to_plot_scatter = [] def my_func(x): return(4/(1+x**2)) plotting3 = [] integral = ...
[ "numpy.zeros", "scipy.random.uniform", "numpy.full", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((194, 217), 'scipy.random.uniform', 'random.uniform', (['a', 'b', 'N'], {}), '(a, b, N)\n', (208, 217), False, 'from scipy import random\n'), ((567, 581), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (579, 581), True, 'import matplotlib.pyplot as plt\n'), ((886, 900), 'matplotlib.pyplot.subplots', ...
import mistune from mistune import InlineLexer, BlockLexer import re try: from .renderer_base import Block_Quote_Renderer, Header_Renderer from .renderer_math import MathInlineMixin, MathRendererMixin, MathBlockMixin except Exception: from renderer_base import Block_Quote_Renderer, Header_Renderer from ...
[ "mistune.Renderer.__init__", "mistune.BlockLexer.__init__", "re.compile" ]
[((729, 755), 're.compile', 're.compile', (['"""\\\\[[xX ]\\\\] """'], {}), "('\\\\[[xX ]\\\\] ')\n", (739, 755), False, 'import re\n'), ((1561, 1603), 'mistune.BlockLexer.__init__', 'BlockLexer.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (1580, 1603), False, 'from mistune import InlineLexer, Block...
from os import system system("pipenv install --dev")
[ "os.system" ]
[((23, 53), 'os.system', 'system', (['"""pipenv install --dev"""'], {}), "('pipenv install --dev')\n", (29, 53), False, 'from os import system\n')]
import re try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from .exc import TokenizerError KEYWORDS = ('LC_IDENTIFICATION', 'LC_CTYPE', 'LC_COLLATE', 'LC_TIME', 'LC_NUMERIC', 'LC_MONETARY', 'LC_MESSAGES', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', 'LC_TE...
[ "StringIO.StringIO", "re.compile" ]
[((483, 511), 're.compile', 're.compile', (['"""<U([0-9A-F]+)>"""'], {}), "('<U([0-9A-F]+)>')\n", (493, 511), False, 'import re\n'), ((762, 772), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (770, 772), False, 'from StringIO import StringIO\n'), ((1432, 1442), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (1...
import random import pkg_resources from .interface import Interface class Bullshit: """This class is used to control the game status.""" def __init__(self): self.running = False self.active_players = 0 def get_player_names(self,players): """Asks for the names of all players.""" ...
[ "pkg_resources.resource_filename", "random.randint" ]
[((2592, 2612), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (2606, 2612), False, 'import random\n'), ((4669, 4725), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""bullshit"""', '"""rules.txt"""'], {}), "('bullshit', 'rules.txt')\n", (4700, 4725), False, 'import pkg...
import liquepy as lq import numpy as np import eqsig import pysra import sfsimodels as sm class EqlinStockwellAnalysis(object): def __init__(self, soil_profile, in_sig, rus=None, wave_field='outcrop', store='surface', gibbs=0, t_inc=1.0, t_win=3.0, strain_at_incs=True, strain_ratio=0.9): """ Equi...
[ "numpy.clip", "numpy.sqrt", "pysra.motion.TimeSeriesMotion", "numpy.array", "pysra.propagation.LinearElasticCalculator", "numpy.arange", "numpy.mean", "liquepy.sra.sm_profile_to_pysra", "numpy.where", "numpy.linspace", "pysra.site.SoilType", "numpy.concatenate", "pysra.output.OutputLocation"...
[((12000, 12123), 'pysra.motion.TimeSeriesMotion', 'pysra.motion.TimeSeriesMotion', ([], {'filename': 'in_sig.label', 'description': 'None', 'time_step': 'in_sig.dt', 'accels': '(in_sig.values / 9.8)'}), '(filename=in_sig.label, description=None,\n time_step=in_sig.dt, accels=in_sig.values / 9.8)\n', (12029, 12123),...
from PIL import Image, ImageDraw, ImageFont import time import io from memelist import meme_images class OutputFile: def __init__(self, image, filetype): self.file = image self.filetype = filetype def add_text(image_name, text): try: chosen_image = meme_images[image_name.lower()] ...
[ "PIL.Image.open", "PIL.Image.new", "io.BytesIO", "PIL.ImageFont.truetype", "PIL.ImageDraw.Draw" ]
[((369, 410), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['chosen_image.font', '(60)'], {}), '(chosen_image.font, 60)\n', (387, 410), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((1048, 1102), 'PIL.Image.new', 'Image.new', (['"""RGBA"""', 'text_image_size', '(255, 255, 255, 0)'], {}), "('RGBA', text_...
import torch import torch.nn as nn import numpy as np import sys from sdf import SDF import pdb class SDFLoss(nn.Module): def __init__(self, right_faces, left_faces, grid_size=32, robustifier=None): super(SDFLoss, self).__init__() self.sdf = SDF() self.register_buffer('right_face', torch.t...
[ "torch.tensor", "sdf.SDF", "torch.no_grad", "torch.zeros", "torch.cat" ]
[((522, 537), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (535, 537), False, 'import torch\n'), ((264, 269), 'sdf.SDF', 'SDF', ([], {}), '()\n', (267, 269), False, 'from sdf import SDF\n'), ((629, 677), 'torch.zeros', 'torch.zeros', (['bs', '(2)', '(2)', '(3)'], {'device': 'vertices.device'}), '(bs, 2, 2, 3, de...
# Generated by Django 2.0.1 on 2019-08-09 17:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0017_remove_trip_route_trip_image'), ] operations = [ migrations.AlterField( model_name='plannedtrip', na...
[ "django.db.models.ImageField" ]
[((355, 434), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'help_text': '"""Imatge hero"""', 'upload_to': '"""plannedtrip"""'}), "(blank=True, help_text='Imatge hero', upload_to='plannedtrip')\n", (372, 434), False, 'from django.db import migrations, models\n'), ((569, 626), 'django.db.m...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
[ "rospy.logerr", "rospy.Subscriber", "rospy.init_node", "rospy.get_param", "rospy.get_time", "yaml.load", "cv_bridge.CvBridge", "light_classification.tl_classifier.TLClassifier", "tf.TransformListener", "rospy.spin", "rospy.Publisher", "rospy.loginfo" ]
[((1368, 1401), 'rospy.init_node', 'rospy.init_node', (['"""dummy_detector"""'], {}), "('dummy_detector')\n", (1383, 1401), False, 'import rospy\n'), ((1692, 1752), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_cb'], {}), "('/current_pose', PoseStamped, self.pose_cb)\n", (17...
import json, logging, os, re import click from igvtree.tree import TreeLevel, FilenamesTree def define_tree_levels(rules): return {level_name: TreeLevel(level_name, node_mappings) for level_name, node_mappings in rules.items()} @click.command() @click.option('--loglevel', default='INFO', help='level...
[ "logging.basicConfig", "logging.debug", "click.option", "click.File", "os.path.join", "igvtree.tree.TreeLevel", "igvtree.tree.FilenamesTree", "click.Path", "json.load", "click.command", "os.walk", "re.search" ]
[((249, 264), 'click.command', 'click.command', ([], {}), '()\n', (262, 264), False, 'import click\n'), ((266, 333), 'click.option', 'click.option', (['"""--loglevel"""'], {'default': '"""INFO"""', 'help': '"""level of logging"""'}), "('--loglevel', default='INFO', help='level of logging')\n", (278, 333), False, 'impor...
from django.shortcuts import render, redirect from ..forms import NewUserForm from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from django.views.decorators.http import require_http_methods, require_safe @require_ht...
[ "django.shortcuts.render", "django.contrib.auth.authenticate", "django.contrib.messages.error", "django.contrib.auth.login", "django.views.decorators.http.require_http_methods", "django.contrib.messages.info", "django.contrib.auth.forms.AuthenticationForm", "django.shortcuts.redirect", "django.contr...
[((310, 347), 'django.views.decorators.http.require_http_methods', 'require_http_methods', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (330, 347), False, 'from django.views.decorators.http import require_http_methods, require_safe\n'), ((836, 873), 'django.views.decorators.http.require_http_methods', 'require_htt...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a programmatic windows explorer behaviors implementation. A lots of useful recipe help you easily control file, directory, file name, select, rename, etc... ``file``, ``directory``, ``collection of files`` class """ from __future__ import print_function impo...
[ "filetool.meth.repr_data_size", "copy.deepcopy", "os.walk", "os.remove", "os.path.exists", "os.path.split", "os.path.isdir", "os.mkdir", "os.path.relpath", "os.path.getsize", "collections.OrderedDict", "os.rename", "os.path.getctime", "os.path.splitext", "filetool.printer.prt", "os.pat...
[((2116, 2139), 'os.path.isfile', 'os.path.isfile', (['abspath'], {}), '(abspath)\n', (2130, 2139), False, 'import os\n'), ((4346, 4373), 'os.path.split', 'os.path.split', (['self.abspath'], {}), '(self.abspath)\n', (4359, 4373), False, 'import os\n'), ((4417, 4448), 'os.path.splitext', 'os.path.splitext', (['self.base...
from copy import deepcopy from django.db import transaction from democracy.enums import InitialSectionType from democracy.models import SectionType def _copy_translations(new_obj, old_obj): for old_translation in old_obj.translations.all(): translation = deepcopy(old_translation) translation.pk...
[ "democracy.models.SectionType.objects.get", "copy.deepcopy" ]
[((939, 960), 'copy.deepcopy', 'deepcopy', (['old_hearing'], {}), '(old_hearing)\n', (947, 960), False, 'from copy import deepcopy\n'), ((1341, 1408), 'democracy.models.SectionType.objects.get', 'SectionType.objects.get', ([], {'identifier': 'InitialSectionType.CLOSURE_INFO'}), '(identifier=InitialSectionType.CLOSURE_I...
from flask_jwt_extended import create_access_token, get_jwt_identity from ..services.client_service import get_client class Auth: @staticmethod def authenticate_client(data): client_id = data.get('client_id', None) client_secret = data.get('client_secret', None) if not client_id or ...
[ "flask_jwt_extended.get_jwt_identity", "flask_jwt_extended.create_access_token" ]
[((857, 896), 'flask_jwt_extended.create_access_token', 'create_access_token', ([], {'identity': 'client_id'}), '(identity=client_id)\n', (876, 896), False, 'from flask_jwt_extended import create_access_token, get_jwt_identity\n'), ((1113, 1131), 'flask_jwt_extended.get_jwt_identity', 'get_jwt_identity', ([], {}), '()\...
import io from tqdm.auto import tqdm # custom progress bar import json import os from typing import List from thesis.config.datasets import S2orcConfig from thesis.config.execution import LogConfig from thesis.config.base import fingerprints from thesis.utils.cache import _caching, no_caching import logging def r...
[ "json.loads", "thesis.utils.cache._caching", "gzip.open", "os.path.join", "io.BufferedReader", "logging.info", "thesis.config.base.fingerprints" ]
[((7969, 8145), 'thesis.utils.cache._caching', '_caching', ([], {'dataset_config': 'dataset_config', 'meta_s2orc_single_file': 'meta_s2orc_single_file', 'pdfs_s2orc_single_file': 'pdfs_s2orc_single_file', 'function_name': '"""s2orc_chunk_read"""'}), "(dataset_config=dataset_config, meta_s2orc_single_file=\n meta_s2o...
import matplotlib.pyplot as plt import pysan.core as pysan_core import itertools, math import numpy as np import pandas as pd from sklearn import cluster import scipy def generate_sequences(count, length, alphabet): """ Generates a number of sequences of a given length, with elements uniformly distributed using a ...
[ "pysan.core.get_entropy", "matplotlib.pyplot.ylabel", "numpy.column_stack", "pysan.core.get_subsequences", "numpy.array", "pysan.core.plot_sequence", "sklearn.cluster.AgglomerativeClustering", "pysan.core.generate_sequence", "numpy.where", "matplotlib.pyplot.xlabel", "pysan.core.get_transitions"...
[((10410, 10439), 'numpy.zeros', 'np.zeros', (['(m, n)'], {'dtype': 'float'}), '((m, n), dtype=float)\n', (10418, 10439), True, 'import numpy as np\n'), ((10495, 10522), 'numpy.zeros', 'np.zeros', (['(m, n)'], {'dtype': 'str'}), '((m, n), dtype=str)\n', (10503, 10522), True, 'import numpy as np\n'), ((14171, 14202), 'p...
from image_to_ascii import image_to_ascii import cv2,os,numpy as np import concurrent.futures from threading import Thread from time import perf_counter,sleep as nap import argparse # may add sound later .\ class ascii_video : """ working of class extract image and yield convert into asc...
[ "numpy.copy", "os.path.exists", "argparse.ArgumentParser", "time.perf_counter", "cv2.putText", "numpy.zeros", "cv2.VideoCapture", "cv2.VideoWriter_fourcc", "cv2.cvtColor", "numpy.full", "threading.Thread" ]
[((7255, 7280), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (7278, 7280), False, 'import argparse\n'), ((1539, 1572), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.video_name'], {}), '(self.video_name)\n', (1555, 1572), False, 'import cv2, os, numpy as np\n'), ((2380, 2428), 'numpy.zeros',...
#!/usr/bin/python3 # -*- coding: utf-8 -*- #OLED import from oled_text import OledText, Layout32 from board import SCL, SDA import busio import time #DHT22 import import Adafruit_DHT from time import sleep #shutdown imports import RPi.GPIO as GPIO import os #shutdown #buttonPin = 21 #GPIO.setmode(GPIO.BCM) #GPIO.s...
[ "oled_text.Layout32.layout_2medium", "RPi.GPIO.cleanup", "RPi.GPIO.add_event_detect", "RPi.GPIO.setup", "busio.I2C", "oled_text.OledText", "time.sleep", "Adafruit_DHT.read_retry", "os.system" ]
[((444, 493), 'RPi.GPIO.setup', 'GPIO.setup', (['(21)', 'GPIO.IN'], {'pull_up_down': 'GPIO.PUD_UP'}), '(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)\n', (454, 493), True, 'import RPi.GPIO as GPIO\n'), ((753, 827), 'RPi.GPIO.add_event_detect', 'GPIO.add_event_detect', (['(21)', 'GPIO.RISING'], {'callback': 'Interrupt', 'bounc...
import logging import torch.multiprocessing as mp from functools import partial from tqdm import tqdm from kaggle_environments import make from agent import * log = logging.getLogger(__name__) def playGame(pnet, nnet, args, player): """ Executes one episode of a game. """ env = make( "hungry_...
[ "logging.getLogger", "torch.multiprocessing.Pool", "functools.partial", "kaggle_environments.make" ]
[((166, 193), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (183, 193), False, 'import logging\n'), ((298, 408), 'kaggle_environments.make', 'make', (['"""hungry_geese"""'], {'configuration': "{'rows': args.boardSize[0], 'columns': args.boardSize[1]}", 'debug': '(False)'}), "('hungry_gee...
import json import time from pathlib import Path import numpy as np import torch from sklearn.model_selection import train_test_split from .ingestion import ingest_session, EpisodeDataset from .models import FeatureExtractor1d, Model class EEGDrive: @staticmethod def ingest(data_path: str, output_dir: str) ...
[ "torch.manual_seed", "pathlib.Path", "sklearn.model_selection.train_test_split", "numpy.random.seed", "time.time", "json.dump" ]
[((1027, 1050), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1044, 1050), False, 'import torch\n'), ((1059, 1079), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1073, 1079), True, 'import numpy as np\n'), ((1592, 1661), 'sklearn.model_selection.train_test_split', 'train_t...
class game(): """class for game""" def gamerun(self): """normal game checks if player 1 or 2 have enough point to win the game""" import Player global player1score self.player1score = 0 global player2score self.player2score = 0 global dicerolls_listp1 ...
[ "Intelligence.Intelligence.takescores1", "Cheat.cheatclass.cheatingR", "Intelligence.Intelligence.takescores2", "Player.player.Player2nameR", "Dice.dice.Dicerolling", "Cheat.cheatclass.cheatF", "Dice.dice.rollGet", "Player.player.Player1nameR", "Histogram.Histogram.options", "Intelligence.Intellig...
[((3113, 3140), 'Dice.dice.Dicerolling', 'Dice.dice.Dicerolling', (['self'], {}), '(self)\n', (3134, 3140), False, 'import Dice\n'), ((3704, 3736), 'Cheat.cheatclass.cheatingR', 'Cheat.cheatclass.cheatingR', (['self'], {}), '(self)\n', (3730, 3736), False, 'import Cheat\n'), ((4121, 4150), 'Cheat.cheatclass.cheatF', 'C...
# -*- coding: utf-8 -*- """ Display current conditions from openweathermap.org. As of 2015-10-09, you need to signup for a free API key via http://openweathermap.org/register Once you signup, use the API key generated at signup to either: 1. set the `apikey` parameter directly 2. place the API key (and nothing els...
[ "datetime.datetime.utcfromtimestamp", "dateutil.tz.gettz", "dateutil.tz.tzutc", "requests.get", "json.load", "time.time", "os.path.expanduser" ]
[((4306, 4353), 'requests.get', 'requests.get', (['url'], {'timeout': 'self.request_timeout'}), '(url, timeout=self.request_timeout)\n', (4318, 4353), False, 'import requests\n'), ((3805, 3833), 'os.path.expanduser', 'expanduser', (['self.apikey_file'], {}), '(self.apikey_file)\n', (3815, 3833), False, 'from os.path im...
"""Test the HTML response from Pydap.""" from webtest import TestApp as App from webob import Request from webob.headers import ResponseHeaders from bs4 import BeautifulSoup from jinja2 import Environment, DictLoader from pydap.lib import walk, __version__ from pydap.handlers.lib import BaseHandler from pydap.tests.d...
[ "collections.OrderedDict", "jinja2.Environment", "pydap.lib.walk", "bs4.BeautifulSoup", "jinja2.DictLoader", "webob.headers.ResponseHeaders", "webob.Request.blank", "pydap.handlers.lib.BaseHandler" ]
[((1779, 1817), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"""html.parser"""'], {}), "(res.text, 'html.parser')\n", (1792, 1817), False, 'from bs4 import BeautifulSoup\n'), ((4722, 4757), 'jinja2.DictLoader', 'DictLoader', (["{'html.html': 'global'}"], {}), "({'html.html': 'global'})\n", (4732, 4757), False, ...
from dataduit.dataset.io.download.location.online.online import download_online from dataduit.dataset.io.download.location.online.tfd.tfd import information_tfd from dataduit.log.dataduit_logging import config_logger def download(config_dict): logger = config_logger(config_dict["meta"]["logging"], "download") ...
[ "dataduit.dataset.io.download.location.online.online.download_online", "dataduit.dataset.io.download.location.online.tfd.tfd.information_tfd", "dataduit.log.dataduit_logging.config_logger" ]
[((259, 316), 'dataduit.log.dataduit_logging.config_logger', 'config_logger', (["config_dict['meta']['logging']", '"""download"""'], {}), "(config_dict['meta']['logging'], 'download')\n", (272, 316), False, 'from dataduit.log.dataduit_logging import config_logger\n'), ((500, 557), 'dataduit.log.dataduit_logging.config_...
#!/usr/bin/env python import os import sys import django if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flow.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) """ python manage.py supervisor --daemonize py...
[ "os.environ.setdefault", "django.core.management.execute_from_command_line" ]
[((88, 152), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""flow.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'flow.settings')\n", (109, 152), False, 'import os\n'), ((230, 265), 'django.core.management.execute_from_command_line', 'execute_from_command_line', (['sys.argv'], {...
""" Solve a nonlinear variational problem with Firedrake. """ import firedrake as fe mesh = fe.UnitIntervalMesh(4) element = fe.FiniteElement("P", mesh.ufl_cell(), 1) V = fe.FunctionSpace(mesh, element) u = fe.Function(V) v = fe.TestFunction(V) bc = fe.DirichletBC(V, 0., "on_boundary") alpha = 1...
[ "firedrake.TestFunction", "firedrake.FunctionSpace", "firedrake.DirichletBC", "firedrake.SpatialCoordinate", "firedrake.NonlinearVariationalSolver", "firedrake.derivative", "firedrake.Function", "firedrake.UnitIntervalMesh" ]
[((98, 120), 'firedrake.UnitIntervalMesh', 'fe.UnitIntervalMesh', (['(4)'], {}), '(4)\n', (117, 120), True, 'import firedrake as fe\n'), ((183, 214), 'firedrake.FunctionSpace', 'fe.FunctionSpace', (['mesh', 'element'], {}), '(mesh, element)\n', (199, 214), True, 'import firedrake as fe\n'), ((222, 236), 'firedrake.Func...
# Generated by Django 3.1.12 on 2021-06-28 08:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('business_register', '0123_auto_20210622_1059'), ] operations = [ migrations.AlterField( model_name='vehicle', name=...
[ "django.db.models.PositiveSmallIntegerField", "django.db.models.CharField" ]
[((347, 447), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'default': '""""""', 'help_text': '"""brand"""', 'max_length': '(80)', 'verbose_name': '"""brand"""'}), "(blank=True, default='', help_text='brand', max_length=80,\n verbose_name='brand')\n", (363, 447), False, 'from django.db i...
#!/usr/bin/env python """ outline to create combination EUV/CHD maps using ML Algorithm 1. Select images 2. Apply pre-processing corrections a. Limb-Brightening b. Inter-Instrument Transformation 3. Coronal Hole Detection using ML Algorithm 4. Convert to Map 5. Combine Maps and Save to DB """ import os impor...
[ "chmap.maps.image2map.create_singles_maps_2", "chmap.maps.synchronic.synch_utils.select_synchronic_images", "numpy.log", "datetime.timedelta", "datetime.datetime", "numpy.where", "chmap.data.corrections.apply_lbc_iit.apply_ipp_2", "numpy.max", "numpy.linspace", "chmap.utilities.plotting.psi_plotti...
[((841, 880), 'datetime.datetime', 'datetime.datetime', (['(2011)', '(8)', '(16)', '(0)', '(0)', '(0)'], {}), '(2011, 8, 16, 0, 0, 0)\n', (858, 880), False, 'import datetime\n'), ((898, 937), 'datetime.datetime', 'datetime.datetime', (['(2011)', '(8)', '(18)', '(0)', '(0)', '(0)'], {}), '(2011, 8, 18, 0, 0, 0)\n', (915...
#!/usr/bin/env python3 from __future__ import print_function from itertools import combinations import sys if sys.version.startswith('2'): range = xrange def main(): combos = combinations(range(100, 1000), 2) product_strings = (str(x * y) for x, y in combos) palindromes = (int(s) for s in product_stri...
[ "sys.version.startswith" ]
[((110, 137), 'sys.version.startswith', 'sys.version.startswith', (['"""2"""'], {}), "('2')\n", (132, 137), False, 'import sys\n')]
# coding=utf-8 from setproctitle import setproctitle from utils import SensorConsumerBase import datetime import os import sys import json class Door(SensorConsumerBase): def __init__(self, redis_host, redis_port): SensorConsumerBase.__init__(self, redis_host=redis_host, redis_port=redis_port) s...
[ "datetime.datetime.utcnow", "setproctitle.setproctitle", "json.dumps", "datetime.datetime.now", "utils.SensorConsumerBase.__init__" ]
[((2758, 2783), 'setproctitle.setproctitle', 'setproctitle', (['"""door: run"""'], {}), "('door: run')\n", (2770, 2783), False, 'from setproctitle import setproctitle\n'), ((231, 310), 'utils.SensorConsumerBase.__init__', 'SensorConsumerBase.__init__', (['self'], {'redis_host': 'redis_host', 'redis_port': 'redis_port'}...
import json import pickle from abc import ABC, abstractmethod from threading import Lock from typing import Any import portalocker from .dicttree import NOTSET, query_tree, update_tree class NamespaceDriver(ABC): @abstractmethod def query(self, key: str) -> Any: pass @abstractmethod def key...
[ "pickle.dump", "threading.Lock", "portalocker.Lock", "pickle.load", "json.load", "json.dump" ]
[((3296, 3302), 'threading.Lock', 'Lock', ([], {}), '()\n', (3300, 3302), False, 'from threading import Lock\n'), ((2560, 2582), 'json.dump', 'json.dump', (['self.dct', 'f'], {}), '(self.dct, f)\n', (2569, 2582), False, 'import json\n'), ((2977, 3010), 'portalocker.Lock', 'portalocker.Lock', (['self.path', '"""wb"""'],...
import argparse import json import logging import _jsonnet import tqdm # These imports are needed for registry.lookup # noinspection PyUnresolvedReferences from src.datasets import yahoo_dataset, ag_news_dataset # noinspection PyUnresolvedReferences from src.models import han # noinspection PyUnresolvedReferences fr...
[ "logging.basicConfig", "logging.getLogger", "src.utils.registry.construct", "argparse.ArgumentParser", "tqdm.tqdm", "_jsonnet.evaluate_file", "src.utils.registry.lookup" ]
[((613, 634), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (632, 634), False, 'import logging\n'), ((644, 671), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (661, 671), False, 'import logging\n'), ((2098, 2123), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([...
from django.shortcuts import render, redirect from django.contrib import messages from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required def index(request): return render(request, 'egov_core/index.html') @login_required def dashboard(reques...
[ "django.shortcuts.render", "django.shortcuts.redirect", "django.contrib.messages.success" ]
[((243, 282), 'django.shortcuts.render', 'render', (['request', '"""egov_core/index.html"""'], {}), "(request, 'egov_core/index.html')\n", (249, 282), False, 'from django.shortcuts import render, redirect\n'), ((335, 383), 'django.shortcuts.render', 'render', (['request', '"""egov_core/egov-dashboard.html"""'], {}), "(...
#!D:\HttpRunnerManager-master\venv\Scripts\python3.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
[ "django.core.management.execute_from_command_line" ]
[((122, 160), 'django.core.management.execute_from_command_line', 'management.execute_from_command_line', ([], {}), '()\n', (158, 160), False, 'from django.core import management\n')]
import os import pytest from pathlib import Path from pydantic import ValidationError from BALSAMIC.utils.models import ( VCFAttributes, VarCallerFilter, QCModel, VarcallerAttribute, AnalysisModel, SampleInstanceModel, ReferenceUrlsModel, ReferenceMeta, UMIworkflowConfig, UMIParamsCommon, UMIParamsUMIextr...
[ "BALSAMIC.utils.models.UMIParamsCommon", "BALSAMIC.utils.models.SampleInstanceModel.parse_obj", "BALSAMIC.utils.models.VCFAttributes", "BALSAMIC.utils.models.ReferenceUrlsModel.parse_obj", "pathlib.Path", "os.urandom", "BALSAMIC.utils.models.AnalysisModel.parse_obj", "BALSAMIC.utils.models.UMIParamsTN...
[((1135, 1175), 'BALSAMIC.utils.models.ReferenceMeta.parse_obj', 'ReferenceMeta.parse_obj', (['reference_files'], {}), '(reference_files)\n', (1158, 1175), False, 'from BALSAMIC.utils.models import VCFAttributes, VarCallerFilter, QCModel, VarcallerAttribute, AnalysisModel, SampleInstanceModel, ReferenceUrlsModel, Refer...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.TbapiQueryAmountResponse import TbapiQueryAmountResponse class AlipayPcreditHuabeiPcreditamountQueryprocessorQueryResponse(AlipayResponse): def __init__(self): ...
[ "alipay.aop.api.domain.TbapiQueryAmountResponse.TbapiQueryAmountResponse.from_alipay_dict" ]
[((938, 986), 'alipay.aop.api.domain.TbapiQueryAmountResponse.TbapiQueryAmountResponse.from_alipay_dict', 'TbapiQueryAmountResponse.from_alipay_dict', (['value'], {}), '(value)\n', (979, 986), False, 'from alipay.aop.api.domain.TbapiQueryAmountResponse import TbapiQueryAmountResponse\n')]
from parlai.agents.programr.parser.template.nodes.base import TemplateNode from parlai.agents.programr.utils.logging.ylogger import YLogger from parlai.agents.programr.utils.text.text import TextUtils class TemplateWordNode(TemplateNode): def __init__(self, word): TemplateNode.__init__(self) self...
[ "parlai.agents.programr.parser.template.nodes.base.TemplateNode.__init__", "parlai.agents.programr.utils.text.text.TextUtils.html_escape" ]
[((280, 307), 'parlai.agents.programr.parser.template.nodes.base.TemplateNode.__init__', 'TemplateNode.__init__', (['self'], {}), '(self)\n', (301, 307), False, 'from parlai.agents.programr.parser.template.nodes.base import TemplateNode\n'), ((776, 808), 'parlai.agents.programr.utils.text.text.TextUtils.html_escape', '...
#!/usr/bin/env python """MangaFrameExtraction. Based on code created by 山田 祐雅 """ from enum import Enum from math import sqrt, atan, cos import collections import logging import os import attr import cv2 as cv from numpy import pi as CV_PI from typing import List, Union, Optional from cv import ( addWeighted as c...
[ "cv.convertScaleAbs", "cv.CreateImage", "cv.Threshold", "cv.imshow", "logging.debug", "cv.destroyWindow", "cv.addWeighted", "cv.Sobel", "math.sqrt", "cv.SaveImage", "cv.Smooth", "cv.CV_MAKE_TYPE", "cv2.waitKey", "math.atan", "attr.ib" ]
[((740, 758), 'attr.ib', 'attr.ib', ([], {'default': '(0)'}), '(default=0)\n', (747, 758), False, 'import attr\n'), ((771, 789), 'attr.ib', 'attr.ib', ([], {'default': '(0)'}), '(default=0)\n', (778, 789), False, 'import attr\n'), ((801, 819), 'attr.ib', 'attr.ib', ([], {'default': '(0)'}), '(default=0)\n', (808, 819),...
import os import argparse from os.path import exists from moviepy.editor import VideoFileClip from moviepy.tools import cvsecs, subprocess_call from moviepy.video.tools.cuts import FramesMatches def parse_arguments(): parser = argparse.ArgumentParser(description="Tail wag generation") parser.add_argument("vi...
[ "os.path.exists", "os.listdir", "argparse.ArgumentParser", "os.getenv", "moviepy.tools.subprocess_call", "moviepy.tools.cvsecs", "os.path.join", "os.getcwd", "os.path.basename", "os.mkdir", "moviepy.video.tools.cuts.FramesMatches.load", "moviepy.editor.VideoFileClip" ]
[((234, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Tail wag generation"""'}), "(description='Tail wag generation')\n", (257, 292), False, 'import argparse\n'), ((2267, 2291), 'os.getenv', 'os.getenv', (['"""MAGICK_PATH"""'], {}), "('MAGICK_PATH')\n", (2276, 2291), False, 'impor...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
[ "six.with_metaclass" ]
[((596, 646), 'six.with_metaclass', 'with_metaclass', (['CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(CaseInsensitiveEnumMeta, str, Enum)\n', (610, 646), False, 'from six import with_metaclass\n'), ((789, 839), 'six.with_metaclass', 'with_metaclass', (['CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(CaseInsensiti...
# import some data to play with from sklearn.metrics import accuracy_score from predict import * import pandas as pd import numpy as np from sklearn.model_selection import train_test_split, GridSearchCV X_D= pd.read_csv('dataset1.csv').as_matrix() Y = X_D[:,0] X = np.delete(X_D, 0, 1) #split test and train X_train, X_t...
[ "sklearn.model_selection.train_test_split", "numpy.delete", "sklearn.metrics.accuracy_score", "pandas.read_csv" ]
[((265, 285), 'numpy.delete', 'np.delete', (['X_D', '(0)', '(1)'], {}), '(X_D, 0, 1)\n', (274, 285), True, 'import numpy as np\n'), ((343, 409), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'stratify': 'Y', 'test_size': '(0.3)', 'random_state': '(42)'}), '(X, Y, stratify=Y, test_size=0....
from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import json from sentiment_mod import sentiment #consumer key, consumer secret, access token, access secret write your own code ckey="" csecret="" atoken="" asecret="" class listener(StreamListener): def on_dat...
[ "json.loads", "sentiment_mod.sentiment", "tweepy.OAuthHandler" ]
[((1037, 1064), 'tweepy.OAuthHandler', 'OAuthHandler', (['ckey', 'csecret'], {}), '(ckey, csecret)\n', (1049, 1064), False, 'from tweepy import OAuthHandler\n'), ((371, 387), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (381, 387), False, 'import json\n'), ((467, 483), 'sentiment_mod.sentiment', 'sentiment',...
"""Contains functions that are used in the dynamic location and creation of tabs and datatypes. Can be used both internally and externally. """ import os import json import pkg_resources import importlib import logging from PyQt5 import QtWidgets from meggie.utilities.uid import generate_uid from meggie.utilities.m...
[ "PyQt5.QtWidgets.QTextBrowser", "os.path.exists", "logging.getLogger", "os.listdir", "PyQt5.QtWidgets.QListWidget", "meggie.utilities.messaging.messagebox", "PyQt5.QtWidgets.QSpacerItem", "meggie.utilities.messaging.exc_messagebox", "meggie.utilities.uid.generate_uid", "pkg_resources.resource_file...
[((1489, 1550), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['source', '"""configuration.json"""'], {}), "(source, 'configuration.json')\n", (1520, 1550), False, 'import pkg_resources\n'), ((2250, 2302), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['source', '"""dat...
import logging import sys from os.path import isfile import numpy as np from phi import math from phi.field import Scene class SceneLog: def __init__(self, scene: Scene): self.scene = scene self._scalars = {} # name -> (frame, value) self._scalar_streams = {} root_logger = logg...
[ "logging.getLogger", "logging.StreamHandler", "logging.Formatter", "os.path.isfile", "numpy.array", "logging.FileHandler", "logging.Logger", "phi.math.mean" ]
[((316, 335), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (333, 335), False, 'import logging\n'), ((404, 440), 'logging.Logger', 'logging.Logger', (['"""vis"""', 'logging.DEBUG'], {}), "('vis', logging.DEBUG)\n", (418, 440), False, 'import logging\n'), ((490, 523), 'logging.StreamHandler', 'logging.Stre...
from mesa.datacollection import DataCollector from mesa import Model from mesa.time import RandomActivation from mesa_geo.geoagent import GeoAgent, AgentCreator from mesa_geo import GeoSpace import random class SchellingAgent(GeoAgent): """Schelling segregation agent.""" def __init__(self, unique_id, model, ...
[ "mesa.datacollection.DataCollector", "random.choice", "mesa_geo.geoagent.AgentCreator", "random.random", "mesa_geo.GeoSpace", "mesa.time.RandomActivation" ]
[((1859, 1881), 'mesa.time.RandomActivation', 'RandomActivation', (['self'], {}), '(self)\n', (1875, 1881), False, 'from mesa.time import RandomActivation\n'), ((1902, 1912), 'mesa_geo.GeoSpace', 'GeoSpace', ([], {}), '()\n', (1910, 1912), False, 'from mesa_geo import GeoSpace\n'), ((1966, 1999), 'mesa.datacollection.D...
import getopt,sys,os import librosa import math def usage(): print("Usage:") print("-h,--help \tDisplay this message") print("-f,--flac_file \t.flac file to read song information from") print("-o,--output_dir \tDirectory to save output files (output/song_name by default)") def main(): ...
[ "getopt.getopt", "math.ceil", "os.makedirs", "sys.exit", "librosa.load" ]
[((1514, 1549), 'librosa.load', 'librosa.load', (['song_file'], {'sr': 'song_sr'}), '(song_file, sr=song_sr)\n', (1526, 1549), False, 'import librosa\n'), ((1621, 1640), 'math.ceil', 'math.ceil', (['duration'], {}), '(duration)\n', (1630, 1640), False, 'import math\n'), ((1800, 1842), 'os.makedirs', 'os.makedirs', (['m...
"""Showcase what the output of pymunk.pyglet_util draw methods will look like. See pygame_util_demo.py for a comparison to pygame. """ __version__ = "$Id:$" __docformat__ = "reStructuredText" import sys import pyglet import pymunk from pymunk.vec2d import Vec2d import pymunk.pyglet_util from shapes_for_draw_d...
[ "pyglet.app.run", "pyglet.text.Label", "pyglet.image.get_buffer_manager", "pyglet.graphics.Batch", "pyglet.gl.glClearColor", "pymunk.Space", "pyglet.window.Window", "pymunk.pyglet_util.draw", "shapes_for_draw_demos.add_objects" ]
[((354, 384), 'pyglet.window.Window', 'pyglet.window.Window', (['(600)', '(600)'], {}), '(600, 600)\n', (374, 384), False, 'import pyglet\n'), ((393, 407), 'pymunk.Space', 'pymunk.Space', ([], {}), '()\n', (405, 407), False, 'import pymunk\n'), ((409, 427), 'shapes_for_draw_demos.add_objects', 'add_objects', (['space']...
from django.contrib import admin from django.contrib.admin import ModelAdmin as BaseModelAdmin from django.utils.translation import gettext_lazy as _ from apps.stores.models import Store from apps.stores.forms import StoreChangeForm, StoreCreationForm class StoreAdmin(BaseModelAdmin): ordering = ["action_date"] add...
[ "django.contrib.admin.site.register", "django.utils.translation.gettext_lazy" ]
[((1054, 1092), 'django.contrib.admin.site.register', 'admin.site.register', (['Store', 'StoreAdmin'], {}), '(Store, StoreAdmin)\n', (1073, 1092), False, 'from django.contrib import admin\n'), ((578, 601), 'django.utils.translation.gettext_lazy', '_', (['"""Amount Information"""'], {}), "('Amount Information')\n", (579...
from HumanChecker_model import HumanChecker import torch from torch.utils import data as DataUtil import config import h5py import pytorch_lightning as pl tr_p,val_p = 0.9,0.1 class original_data(DataUtil.Dataset): def __init__(self) -> None: super().__init__() with h5py.File('data/HumanChecker....
[ "torch.utils.data.random_split", "HumanChecker_model.HumanChecker", "torch.from_numpy", "h5py.File", "pytorch_lightning.Trainer", "torch.utils.data.DataLoader", "torch.cat" ]
[((913, 955), 'torch.utils.data.random_split', 'DataUtil.random_split', (['orig', '[trlen, vlen]'], {}), '(orig, [trlen, vlen])\n', (934, 955), True, 'from torch.utils import data as DataUtil\n'), ((963, 977), 'HumanChecker_model.HumanChecker', 'HumanChecker', ([], {}), '()\n', (975, 977), False, 'from HumanChecker_mod...
from colibris import app from colibris import persist def init(web_app, loop): # Add your coroutines to the loop here. pass def get_health(): # Determine whether your service is currently healthy. # Raise app.HealthException() in case of any problem. if not persist.connectivity_check(): ...
[ "colibris.persist.connectivity_check", "colibris.app.HealthException" ]
[((285, 313), 'colibris.persist.connectivity_check', 'persist.connectivity_check', ([], {}), '()\n', (311, 313), False, 'from colibris import persist\n'), ((329, 386), 'colibris.app.HealthException', 'app.HealthException', (['"""database connectivity check failed"""'], {}), "('database connectivity check failed')\n", (...
#!/usr/bin/python # ~~~~~============== HOW TO RUN ==============~~~~~ # 1) Configure things in CONFIGURATION section # 2) Change permissions: chmod +x client.py # 3) Run in loop: while true; do ./client.py; sleep 1; done from __future__ import print_function import sys import socket import json import time impo...
[ "socket.socket", "time.sleep", "pdb.set_trace", "adrconversion.buy_adr", "json.dump" ]
[((1022, 1071), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (1035, 1071), False, 'import socket\n'), ((1187, 1211), 'json.dump', 'json.dump', (['obj', 'exchange'], {}), '(obj, exchange)\n', (1196, 1211), False, 'import json\n'), ((2582, 260...
import time import os import re import datetime import math from PIL import Image from pathlib import Path def dms2dec(dms_str): """Return decimal representation of DMS """ dms_str = re.sub(r'\s', '', dms_str) sign = -1 if re.search('[swSW]', dms_str) else 1 numbers = list(filter(len, re.split('\D+'...
[ "datetime.datetime", "re.split", "PIL.Image.open", "os.stat", "pathlib.Path", "math.fabs", "re.sub", "time.localtime", "re.search" ]
[((193, 219), 're.sub', 're.sub', (['"""\\\\s"""', '""""""', 'dms_str'], {}), "('\\\\s', '', dms_str)\n", (199, 219), False, 'import re\n'), ((238, 266), 're.search', 're.search', (['"""[swSW]"""', 'dms_str'], {}), "('[swSW]', dms_str)\n", (247, 266), False, 'import re\n'), ((1228, 1249), 'PIL.Image.open', 'Image.open'...
# pylint: disable=too-many-lines """Coupon assignment API""" import logging from collections import defaultdict from datetime import timedelta from django.conf import settings from django.db import transaction from django.utils.functional import cached_property import ecommerce.api from ecommerce.mail_api import send...
[ "logging.getLogger", "ecommerce.models.BulkCouponAssignment.objects.exclude", "ecommerce.models.BulkCouponAssignment.objects.select_for_update", "mitxpro.utils.case_insensitive_equal", "sheets.api.get_authorized_pygsheets_client", "mitxpro.utils.item_at_index_or_none", "sheets.utils.AssignmentRowUpdate"...
[((1738, 1765), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1755, 1765), False, 'import logging\n'), ((13319, 13452), 'ecommerce.models.ProductCouponAssignment.objects.bulk_update', 'ProductCouponAssignment.objects.bulk_update', (['updated_assignments'], {'fields': "['message_status',...
#!/usr/bin/env python # coding: utf-8 # In[19]: # %load get_nextstrain_data.py ### https://github.com/tomasMasson/covid-19-Annotations-on-Structures.git #!/usr/bin/env python3 import json import requests from utils.sm_annotations import Annotation import matplotlib.colors as mcolors def parse_json(input_file): ...
[ "utils.sm_annotations.Annotation", "requests.get" ]
[((1673, 1690), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1685, 1690), False, 'import requests\n'), ((3208, 3220), 'utils.sm_annotations.Annotation', 'Annotation', ([], {}), '()\n', (3218, 3220), False, 'from utils.sm_annotations import Annotation\n')]
"""RNN pixelwise """ from typing import Optional, Union import argparse import ast import timm import torch import torchvision import segmentation_models_pytorch as smp from torch import nn from earthnet_models_pytorch.utils import str2bool Activations = {"relu": nn.ReLU, "leaky_relu": nn.LeakyReLU, "elu": nn....
[ "torch.nn.Sigmoid", "argparse.ArgumentParser", "torch.nn.Sequential", "torch.stack", "torch.nn.Linear", "torch.cat", "torch.nn.GRU" ]
[((1144, 1167), 'torch.nn.Sequential', 'nn.Sequential', (['*modules'], {}), '(*modules)\n', (1157, 1167), False, 'from torch import nn\n'), ((1110, 1131), 'torch.nn.Linear', 'nn.Linear', (['ninp', 'nout'], {}), '(ninp, nout)\n', (1119, 1131), False, 'from torch import nn\n'), ((2354, 2377), 'torch.nn.Sequential', 'nn.S...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Copyright (c) 2010-2020 <NAME> # This file is part of the extensive automation project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Ge...
[ "yaml.safe_dump", "ea.automateactions.serversystem.settings.save", "os.urandom", "ea.automateactions.serversystem.logger.error", "yaml.safe_load", "hashlib.sha512", "ea.automateactions.serversystem.settings.get_app_path", "ea.automateactions.serversystem.logger.debug" ]
[((3053, 3069), 'hashlib.sha512', 'hashlib.sha512', ([], {}), '()\n', (3067, 3069), False, 'import hashlib\n'), ((3244, 3260), 'hashlib.sha512', 'hashlib.sha512', ([], {}), '()\n', (3258, 3260), False, 'import hashlib\n'), ((4587, 4650), 'ea.automateactions.serversystem.logger.debug', 'logger.debug', (["('usersmanager ...
import discord from discord.ext import commands from discord.ext.commands import Bot from discord.voice_client import VoiceClient import asyncio from discord import client bot = commands.Bot(command_prefix="!") async def on_ready(): print ("Ready") @bot.command() async def join(ctx): channel = ...
[ "discord.ext.commands.Bot" ]
[((186, 218), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""!"""'}), "(command_prefix='!')\n", (198, 218), False, 'from discord.ext import commands\n')]
""" Welcome to UI Automation Challenge 3 For this challenge the focus is improving the assertion for an existing UI automation test. Rather than asserting on the DOM's state, update the the test below to do a visual check of the page. Once you've completed the sample check. Create your own example check. > Remember, ...
[ "python.challenge_3.pages.home_page.HomePage" ]
[((607, 619), 'python.challenge_3.pages.home_page.HomePage', 'HomePage', (['py'], {}), '(py)\n', (615, 619), False, 'from python.challenge_3.pages.home_page import HomePage\n')]
import speech_recognition class SoundRecorder: def __init__(self,Microphone=None): if Microphone == None: self.mic = speech_recognition.Microphone() else: # for predefined mic object self.mic = Microphone self.audio = None self.defaultfilename = 'Rec...
[ "speech_recognition.Recognizer", "speech_recognition.Microphone", "time.strftime" ]
[((147, 178), 'speech_recognition.Microphone', 'speech_recognition.Microphone', ([], {}), '()\n', (176, 178), False, 'import speech_recognition\n'), ((418, 449), 'speech_recognition.Microphone', 'speech_recognition.Microphone', ([], {}), '()\n', (447, 449), False, 'import speech_recognition\n'), ((940, 974), 'time.strf...
from tensorflow.keras.layers import Input from tensorflow.keras.layers import Conv2D from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.layers import Activation from tensorflow.keras.layers import MaxPooling2D from tensorflow.keras.layers import AveragePooling2D from tensorflow.keras.layers im...
[ "tensorflow.keras.layers.Input", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.initializers.glorot_uniform", "tensorflow.keras.models.Model", "tensorflow.keras.layers.BatchNormalization", "tensorflow.concat", "tensorflow.keras.layers.Dense", "tensorflow...
[((2160, 2204), 'tensorflow.concat', 'tf.concat', ([], {'values': '[branch1, branch2]', 'axis': '(3)'}), '(values=[branch1, branch2], axis=3)\n', (2169, 2204), True, 'import tensorflow as tf\n'), ((3556, 3600), 'tensorflow.concat', 'tf.concat', ([], {'values': '[branch1, branch2]', 'axis': '(3)'}), '(values=[branch1, b...
#!/usr/bin/env python '''Test RGB load using PyPNG. You should see the rgb.png image on a checkboard background. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_load from pyglet.image.codecs.png import PNGImageDecoder class TEST_PNG_RGB_LOAD(base_load.TestLoad): text...
[ "unittest.main", "pyglet.image.codecs.png.PNGImageDecoder" ]
[((355, 372), 'pyglet.image.codecs.png.PNGImageDecoder', 'PNGImageDecoder', ([], {}), '()\n', (370, 372), False, 'from pyglet.image.codecs.png import PNGImageDecoder\n'), ((405, 420), 'unittest.main', 'unittest.main', ([], {}), '()\n', (418, 420), False, 'import unittest\n')]
#!/usr/bin/env python3.7 # Copyright (c) 2020 PaddlePaddle 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 ...
[ "paddle.fluid.core.AnalysisConfig", "paddle.fluid.core.create_paddle_predictor" ]
[((900, 931), 'paddle.fluid.core.create_paddle_predictor', 'create_paddle_predictor', (['config'], {}), '(config)\n', (923, 931), False, 'from paddle.fluid.core import create_paddle_predictor\n'), ((1431, 1449), 'paddle.fluid.core.AnalysisConfig', 'AnalysisConfig', (['""""""'], {}), "('')\n", (1445, 1449), False, 'from...
#=============================================================================# # # # <NAME> # # CS 3150 # # ...
[ "math.sqrt", "matplotlib.pyplot.imshow", "cv2.threshold", "cv2.erode", "cv2.blur", "numpy.ones", "cv2.minEnclosingCircle", "cv2.morphologyEx", "cv2.split", "cv2.cvtColor", "matplotlib.colors.Normalize", "numpy.shape", "cv2.imread", "matplotlib.pyplot.show", "cv2.inRange", "cv2.bitwise_...
[((2869, 2894), 'cv2.imread', 'cv2.imread', (['"""./test2.jpg"""'], {}), "('./test2.jpg')\n", (2879, 2894), False, 'import cv2\n'), ((2983, 3020), 'cv2.cvtColor', 'cv2.cvtColor', (['wall', 'cv2.COLOR_BGR2RGB'], {}), '(wall, cv2.COLOR_BGR2RGB)\n', (2995, 3020), False, 'import cv2\n'), ((3083, 3121), 'cv2.cvtColor', 'cv2...
import aspose.slides as slides import aspose.pydrawing as drawing #ExStart:FillShapesPicture # The path to the documents directory. dataDir = "./examples/data/" outDir = "./examples/out/" # Instantiate Presentation class that represents the PPTX with slides.Presentation() as pres: # Get the first slide sld = ...
[ "aspose.slides.Presentation", "aspose.pydrawing.Bitmap" ]
[((253, 274), 'aspose.slides.Presentation', 'slides.Presentation', ([], {}), '()\n', (272, 274), True, 'import aspose.slides as slides\n'), ((703, 741), 'aspose.pydrawing.Bitmap', 'drawing.Bitmap', (["(dataDir + 'image2.jpg')"], {}), "(dataDir + 'image2.jpg')\n", (717, 741), True, 'import aspose.pydrawing as drawing\n'...
import numpy as np def R_P(take_off_angle, strike, dip, rake, az): """ Radiation pattern for P""" inc = np.deg2rad(take_off_angle) SR = Fault_geom_SR(dip, rake) QR = Fault_geom_QR(strike, dip, rake, az) PR = Fault_geom_PR(strike, dip, rake, az) RP = SR * (3 * np.cos(inc) ** 2 - 1) - QR * np.s...
[ "numpy.sin", "numpy.deg2rad", "numpy.cos" ]
[((114, 140), 'numpy.deg2rad', 'np.deg2rad', (['take_off_angle'], {}), '(take_off_angle)\n', (124, 140), True, 'import numpy as np\n'), ((467, 493), 'numpy.deg2rad', 'np.deg2rad', (['take_off_angle'], {}), '(take_off_angle)\n', (477, 493), True, 'import numpy as np\n'), ((830, 856), 'numpy.deg2rad', 'np.deg2rad', (['ta...
from django.db.models.query import QuerySet from systemtest.people.models import * from django.contrib.auth import get_user_model from django.utils.timezone import now def get_users_leads(): return get_user_model().objects.filter(groups__name="LEAD") def get_users_department(department__name: str, order_by: str...
[ "django.utils.timezone.now", "django.contrib.auth.get_user_model" ]
[((204, 220), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (218, 220), False, 'from django.contrib.auth import get_user_model\n'), ((352, 368), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (366, 368), False, 'from django.contrib.auth import get_user_model\n'), (...
#045_Pedra_papel_e_tesoura.py from time import sleep from random import randint print("Pedra, Papel ou Tesoura?") print('''[ 0 ] PEDRA [ 1 ] PAPEL [ 2 ] TESOURA''') lista = ["PEDRA", "PAPEL", "TESOURA"] c = randint(0, 2) j = int(input("Sua escolha: ")) sleep(1) print("JO") sleep(1) print("KEN") sleep(1) print("PO!!...
[ "random.randint", "time.sleep" ]
[((210, 223), 'random.randint', 'randint', (['(0)', '(2)'], {}), '(0, 2)\n', (217, 223), False, 'from random import randint\n'), ((257, 265), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (262, 265), False, 'from time import sleep\n'), ((278, 286), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (283, 286), False, 'fro...
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
[ "buildbot.data.types.DateTime", "buildbot.data.types.Integer", "twisted.python.log.msg", "twisted.internet.defer.returnValue", "buildbot.data.types.Boolean", "buildbot.data.types.String", "buildbot.data.resultspec.Filter" ]
[((3101, 3116), 'buildbot.data.types.Integer', 'types.Integer', ([], {}), '()\n', (3114, 3116), False, 'from buildbot.data import types\n'), ((3132, 3146), 'buildbot.data.types.String', 'types.String', ([], {}), '()\n', (3144, 3146), False, 'from buildbot.data import types\n'), ((3164, 3179), 'buildbot.data.types.Boole...
import torch import os import argparse import flair from flair.data import Corpus from flair.datasets import ColumnCorpus from flair.models import SequenceTagger from DataProcess import flair_pred2sample_pred from eval_tsd import evaluate parser = argparse.ArgumentParser(description='make predictions') parser.add_ar...
[ "os.path.join", "flair.datasets.ColumnCorpus", "argparse.ArgumentParser", "torch.device" ]
[((251, 306), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""make predictions"""'}), "(description='make predictions')\n", (274, 306), False, 'import argparse\n'), ((1039, 1061), 'torch.device', 'torch.device', (['args.gpu'], {}), '(args.gpu)\n', (1051, 1061), False, 'import torch\n'), (...
import random import json import gym from gym import spaces import pandas as pd import numpy as np MAX_ACCOUNT_BALANCE = 2147483647 MAX_NUM_SHARES = 2147483647 MAX_SHARE_PRICE = 5000 MAX_OPEN_POSITIONS = 5 MAX_STEPS = 20000 COMMISSION_FEE = 0.008 INITIAL_ACCOUNT_BALANCE = 10000 class StockTradingEnv(gym.Env): ...
[ "numpy.intersect1d", "random.uniform", "numpy.reshape", "numpy.floor", "gym.spaces.Box", "numpy.max", "numpy.array", "numpy.stack", "numpy.append", "numpy.sum", "numpy.isnan", "numpy.min", "pandas.isna", "numpy.nansum", "numpy.isinf", "numpy.zeros_like", "random.randint", "numpy.na...
[((867, 895), 'numpy.min', 'np.min', (['self.intersect_dates'], {}), '(self.intersect_dates)\n', (873, 895), True, 'import numpy as np\n'), ((920, 948), 'numpy.max', 'np.max', (['self.intersect_dates'], {}), '(self.intersect_dates)\n', (926, 948), True, 'import numpy as np\n'), ((1253, 1273), 'numpy.array', 'np.array',...
from Crypto.Random import get_random_bytes from Crypto.Cipher import AES from Crypto.Util import Counter from datalayer import DataLayer class EncryptionLayer(DataLayer): def __init__(self, datalayer, key): self._datalayer = datalayer self._key = key def _make_cipher(self, iv=None): "...
[ "Crypto.Cipher.AES.new", "Crypto.Random.get_random_bytes" ]
[((404, 424), 'Crypto.Random.get_random_bytes', 'get_random_bytes', (['(16)'], {}), '(16)\n', (420, 424), False, 'from Crypto.Random import get_random_bytes\n'), ((513, 558), 'Crypto.Cipher.AES.new', 'AES.new', (['self._key', 'AES.MODE_CTR'], {'counter': 'ctr'}), '(self._key, AES.MODE_CTR, counter=ctr)\n', (520, 558), ...
from sklearn.linear_model import Perceptron from deslib.des.knora_u import KNORAU from deslib.tests.examples_test import * from sklearn.utils.estimator_checks import check_estimator def test_check_estimator(): check_estimator(KNORAU) # Test the estimate competence method receiving n samples as input def test_e...
[ "deslib.des.knora_u.KNORAU", "sklearn.linear_model.Perceptron", "sklearn.utils.estimator_checks.check_estimator" ]
[((217, 240), 'sklearn.utils.estimator_checks.check_estimator', 'check_estimator', (['KNORAU'], {}), '(KNORAU)\n', (232, 240), False, 'from sklearn.utils.estimator_checks import check_estimator\n'), ((1262, 1274), 'sklearn.linear_model.Perceptron', 'Perceptron', ([], {}), '()\n', (1272, 1274), False, 'from sklearn.line...
import codecs bits = 486604799 p = '' # calculando a string do alvo para checarmos exp = bits >> 24 print(exp) mant = bits & 0xffffff print(mant) target = mant * (1 << (8 * (exp - 3))) print(target) target_hexstr = '%064x' % target print(target_hexstr) target_str = codecs.decode(target_hexstr, 'hex') nonce = 10000000...
[ "codecs.decode" ]
[((268, 303), 'codecs.decode', 'codecs.decode', (['target_hexstr', '"""hex"""'], {}), "(target_hexstr, 'hex')\n", (281, 303), False, 'import codecs\n')]
import string path = '../realdata/' ext = '.csv' #ext2 = '.csvv' for i in range(48): name = path + str(i) + ext #name2 = path + str(i) + ext2 with open(name, 'r') as f: data = f.read() data_mod = string.replace(data, '\r\n', '\n') with open(name, 'w') as g: g.write('id\tage\tco...
[ "string.replace" ]
[((225, 259), 'string.replace', 'string.replace', (['data', "'\\r\\n'", '"""\n"""'], {}), "(data, '\\r\\n', '\\n')\n", (239, 259), False, 'import string\n')]
import os from docutils.statemachine import ViewList from docutils.parsers.rst import Directive from docutils import nodes from sphinx.util import logging from sphinx.util.nodes import nested_parse_with_titles from sphinx.ext.autodoc import AutodocReporter from sphinx.errors import ExtensionError logger = logging.ge...
[ "sphinx.util.nodes.nested_parse_with_titles", "docutils.statemachine.ViewList", "sphinx.ext.autodoc.AutodocReporter", "os.path.join", "os.path.isfile", "sphinx.util.logging.getLogger", "docutils.nodes.paragraph" ]
[((310, 337), 'sphinx.util.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (327, 337), False, 'from sphinx.util import logging\n'), ((917, 927), 'docutils.statemachine.ViewList', 'ViewList', ([], {}), '()\n', (925, 927), False, 'from docutils.statemachine import ViewList\n'), ((939, 963), '...
import torch from torch import nn from onconet.models.inflate import inflate_model from onconet.models.blocks.factory import get_block import pdb MODEL_REGISTRY = {} STRIPPING_ERR = 'Trying to strip the model although last layer is not FC.' NO_MODEL_ERR = 'Model {} not in MODEL_REGISTRY! Available models are {} ' NO_...
[ "torch.optim.Adam", "torch.optim.SGD", "torch.nn.Dropout", "torch.optim.Adagrad", "torch.load", "torch.nn.Linear", "onconet.models.blocks.factory.get_block", "onconet.models.inflate.inflate_model", "torch.nn.Conv1d", "torch.rand" ]
[((8715, 8747), 'torch.rand', 'torch.rand', (['bs', 'channels', '*shape'], {}), '(bs, channels, *shape)\n', (8725, 8747), False, 'import torch\n'), ((1948, 1968), 'onconet.models.inflate.inflate_model', 'inflate_model', (['model'], {}), '(model)\n', (1961, 1968), False, 'from onconet.models.inflate import inflate_model...