code stringlengths 21 1.03M | apis list | extract_api stringlengths 74 8.23M |
|---|---|---|
from typing import List, Optional
import torch
from torch import nn
from labml_helpers.module import Module
class ConvBLock(Module):
def __init__(self,in_channels: int, out_channels: int, stride: int) -> None:
super().__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=3, str... | [
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.ReLU"
] | [((265, 342), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)'}), '(in_channels, out_channels, kernel_size=3, stride=stride, padding=1)\n', (274, 342), False, 'from torch import nn\n'), ((361, 389), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', ([... |
#!/usr/bin/env python3.9
# Copyright <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified or distributed
# ex... | [
"enum.auto",
"json.load",
"pathlib.Path"
] | [((1188, 1194), 'enum.auto', 'auto', ([], {}), '()\n', (1192, 1194), False, 'from enum import Enum, auto\n'), ((1216, 1222), 'enum.auto', 'auto', ([], {}), '()\n', (1220, 1222), False, 'from enum import Enum, auto\n'), ((1238, 1244), 'enum.auto', 'auto', ([], {}), '()\n', (1242, 1244), False, 'from enum import Enum, au... |
"""Build Certificate Signing Requests."""
from __future__ import annotations
from base64 import b64decode
from dataclasses import InitVar, dataclass
from functools import partial
from typing import ClassVar, Dict, Optional, Union
from cryptography import x509
from cryptography.hazmat._types import _PRIVATE_KEY_TYPES... | [
"autocsr.hsm.HsmFactory.from_hsm_info",
"cryptography.x509.CertificateSigningRequestBuilder",
"cryptography.hazmat.primitives.serialization.NoEncryption",
"autocsr.extensions.Extension.from_proto",
"functools.partial",
"pyasn1_modules.rfc2314.CertificationRequest",
"pyasn1.type.univ.BitString.fromOctetS... | [((3542, 3581), 'functools.partial', 'partial', (['hashes.BLAKE2b'], {'digest_size': '(64)'}), '(hashes.BLAKE2b, digest_size=64)\n', (3549, 3581), False, 'from functools import partial\n'), ((3609, 3648), 'functools.partial', 'partial', (['hashes.BLAKE2s'], {'digest_size': '(32)'}), '(hashes.BLAKE2s, digest_size=32)\n'... |
import glob
import codecs
import string, re, pickle, math
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize,sent_tokenize
import collections,operator
from nltk.corpus import stopwords
def data_preprocessing():
sample=input("Enter the sentence")
text=sample.split()
if len(text) >=3:... | [
"math.log",
"re.sub",
"pickle.load"
] | [((925, 944), 'pickle.load', 'pickle.load', (['infile'], {}), '(infile)\n', (936, 944), False, 'import string, re, pickle, math\n'), ((2410, 2429), 'pickle.load', 'pickle.load', (['infile'], {}), '(infile)\n', (2421, 2429), False, 'import string, re, pickle, math\n'), ((4144, 4163), 'pickle.load', 'pickle.load', (['inf... |
import numpy as np
from tensorflow.keras.models import load_model
from tensorflow.keras import Sequential
from tfkerassurgeon.operations import delete_layer
import os
import cv2 as cv
#load our trained model
model=load_model('best_accuracy_our_model_refined_2_50x50.h5')
print(model.summary())
print(len(... | [
"os.path.join",
"tensorflow.keras.models.load_model",
"os.listdir",
"tfkerassurgeon.operations.delete_layer",
"numpy.save",
"numpy.array"
] | [((224, 280), 'tensorflow.keras.models.load_model', 'load_model', (['"""best_accuracy_our_model_refined_2_50x50.h5"""'], {}), "('best_accuracy_our_model_refined_2_50x50.h5')\n", (234, 280), False, 'from tensorflow.keras.models import load_model\n'), ((443, 471), 'tfkerassurgeon.operations.delete_layer', 'delete_layer',... |
#!/usr/bin/env python
"""
Ipam CLI command line interfase
"""
import click
import urllib.request
from urllib.error import HTTPError
import json
class Ipam(object):
def __init__(self, url=None, debug=False):
self.url = url
self.debug = debug
if(self.debug):
print("Debug on")
... | [
"json.loads",
"click.argument",
"click.group",
"json.dumps",
"click.option"
] | [((5281, 5294), 'click.group', 'click.group', ([], {}), '()\n', (5292, 5294), False, 'import click\n'), ((5296, 5361), 'click.option', 'click.option', (['"""--url"""'], {'envvar': '"""IPAM_API_KEY"""', 'default': '"""blabl-url"""'}), "('--url', envvar='IPAM_API_KEY', default='blabl-url')\n", (5308, 5361), False, 'impor... |
import pygame
import parameters as p
import math
import numpy as np
import utils
# mainw_width, mainw_height = p.parameters["MAINW_WIDTH"], p.parameters["MAINW_HEIGHT"]
DEBUG = False
DEBUG_SWITCHED = False
def draw_grid(grid, surface, alphasurf):
global DEBUG_SWITCHED
global DEBUG
rdr = False
for x in... | [
"pygame.draw.rect",
"pygame.draw.lines",
"pygame.draw.line",
"pygame.transform.scale",
"pygame.Rect",
"utils.normalise"
] | [((2244, 2288), 'utils.normalise', 'utils.normalise', (['value', 'min_value', 'max_value'], {}), '(value, min_value, max_value)\n', (2259, 2288), False, 'import utils\n'), ((10278, 10341), 'pygame.draw.lines', 'pygame.draw.lines', (['surface', '(64, 64, 64, 255)', '(False)', 'points', '(1)'], {}), '(surface, (64, 64, 6... |
from PyQt5.QtWidgets import QTreeView
class DeselectableQTreeView(QTreeView):
def mousePressEvent(self, event):
self.selectionModel().clear()
QTreeView.mousePressEvent(self, event)
| [
"PyQt5.QtWidgets.QTreeView.mousePressEvent"
] | [((165, 203), 'PyQt5.QtWidgets.QTreeView.mousePressEvent', 'QTreeView.mousePressEvent', (['self', 'event'], {}), '(self, event)\n', (190, 203), False, 'from PyQt5.QtWidgets import QTreeView\n')] |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"qf_lib.common.utils.returns.drawdown_tms.drawdown_tms"
] | [((1547, 1592), 'qf_lib.common.utils.returns.drawdown_tms.drawdown_tms', 'drawdown_tms', (['input_data'], {'frequency': 'frequency'}), '(input_data, frequency=frequency)\n', (1559, 1592), False, 'from qf_lib.common.utils.returns.drawdown_tms import drawdown_tms\n')] |
import numpy as np
from reliapy._messages import *
from reliapy.math import *
from reliapy.transformation._optimization import Optimization
class FOSM(Optimization):
"""
``FOSM`` is a class implementing the First Order Second Moment method (FOSM).
**Input:**
* **limit_state_obj** (`object`)
... | [
"numpy.linalg.norm",
"numpy.diag",
"numpy.dot"
] | [((2590, 2602), 'numpy.diag', 'np.diag', (['std'], {}), '(std)\n', (2597, 2602), True, 'import numpy as np\n'), ((2897, 2914), 'numpy.linalg.norm', 'np.linalg.norm', (['y'], {}), '(y)\n', (2911, 2914), True, 'import numpy as np\n'), ((5372, 5390), 'numpy.linalg.norm', 'np.linalg.norm', (['gy'], {}), '(gy)\n', (5386, 53... |
import pickle
import config
import numpy as np
from collections import defaultdict
# Parameters
cohorts = ['backhed', 'ferretti', 'yassour', 'hmp']
event_types = ["no change", "modification", "replacement"]
modification_threshold = 100
replacement_threshold = 400
pickle_fname = '%s/pickles/dNdS_distributio... | [
"numpy.array",
"collections.defaultdict",
"numpy.mean"
] | [((856, 872), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (867, 872), False, 'from collections import defaultdict\n'), ((889, 905), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (900, 905), False, 'from collections import defaultdict\n'), ((923, 939), 'collections.defaultdi... |
import os
from os.path import isfile
from pathlib import Path
from typing import List, Tuple, Callable, Iterable
class FileProcessing:
"""
Class to support common file processing operations
"""
def __init__(self, file_paths: List[str] = None):
if file_paths is None:
file_paths = []... | [
"os.path.join",
"os.walk",
"os.listdir",
"pathlib.Path",
"os.path.isfile"
] | [((2505, 2533), 'os.path.isfile', 'os.path.isfile', (['path_to_file'], {}), '(path_to_file)\n', (2519, 2533), False, 'import os\n'), ((2761, 2795), 'os.path.join', 'os.path.join', (['start_path', 'end_path'], {}), '(start_path, end_path)\n', (2773, 2795), False, 'import os\n'), ((3574, 3594), 'os.walk', 'os.walk', (['p... |
from helpers.cli import cmdout
from helpers.report import report_in_progress_path
from helpers.report import make_test_result, make_suite_result, make_report
from lemoncheesecake.cli import main
from lemoncheesecake.reporting.backends.json_ import save_report_into_file
from lemoncheesecake.testtree import flatten_test... | [
"lemoncheesecake.cli.main",
"lemoncheesecake.cli.commands.diff.compute_diff",
"helpers.report.make_test_result",
"lemoncheesecake.reporting.backends.json_.save_report_into_file",
"helpers.cli.cmdout.assert_substrs_anywhere",
"lemoncheesecake.testtree.flatten_tests",
"helpers.cli.cmdout.get_lines"
] | [((1015, 1045), 'lemoncheesecake.cli.commands.diff.compute_diff', 'compute_diff', (['tests_1', 'tests_2'], {}), '(tests_1, tests_2)\n', (1027, 1045), False, 'from lemoncheesecake.cli.commands.diff import compute_diff\n'), ((1413, 1443), 'lemoncheesecake.cli.commands.diff.compute_diff', 'compute_diff', (['tests_1', 'tes... |
from vision.vision_helpers import VisionHelper
class LogoDetection:
def __init__(self):
self._vision = VisionHelper()
def detect_logos(self):
image = self._vision.get_vision_image()
logos = image.detect_logos()
response = "I see "
if len(logos) < 1:
respo... | [
"vision.vision_helpers.VisionHelper"
] | [((118, 132), 'vision.vision_helpers.VisionHelper', 'VisionHelper', ([], {}), '()\n', (130, 132), False, 'from vision.vision_helpers import VisionHelper\n')] |
#!/usr/bin/env python3
import sqlite3
import luigi
import pandas as pd
import time
import json
timestamp = time.strftime("%Y%m%d")
class ChinookData(luigi.Task):
"""
This class extend luigi task for
extracting ChinookData
Attributes
----------
local_target : str
input file target nam... | [
"json.loads",
"pandas.read_excel",
"sqlite3.connect",
"pandas.read_csv",
"pandas.concat",
"pandas.DataFrame",
"time.strftime"
] | [((108, 131), 'time.strftime', 'time.strftime', (['"""%Y%m%d"""'], {}), "('%Y%m%d')\n", (121, 131), False, 'import time\n'), ((1533, 1572), 'sqlite3.connect', 'sqlite3.connect', (['"""./sources/chinook.db"""'], {}), "('./sources/chinook.db')\n", (1548, 1572), False, 'import sqlite3\n'), ((3134, 3178), 'sqlite3.connect'... |
"""
Copyright 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | [
"struct.pack"
] | [((796, 821), 'struct.pack', 'struct.pack', (['""">h"""', 'number'], {}), "('>h', number)\n", (807, 821), False, 'import struct\n'), ((1041, 1066), 'struct.pack', 'struct.pack', (['""">i"""', 'number'], {}), "('>i', number)\n", (1052, 1066), False, 'import struct\n'), ((1287, 1312), 'struct.pack', 'struct.pack', (['"""... |
import numpy as np, matplotlib.pylab as plt, time
class lab2partA1():
def __init__(self):
self.sleep = 0.2
self.low = -20
self.up = 10
def initialize(self):
self.fig, self.ax = plt.subplots()
self.ax.set_xlabel(r"Parameter $a$")
self.ax.set_ylabel(r"$F(a... | [
"numpy.linspace",
"matplotlib.pylab.subplots",
"numpy.max",
"numpy.square",
"numpy.min",
"numpy.meshgrid",
"numpy.arange",
"time.sleep"
] | [((227, 241), 'matplotlib.pylab.subplots', 'plt.subplots', ([], {}), '()\n', (239, 241), True, 'import numpy as np, matplotlib.pylab as plt, time\n'), ((424, 457), 'numpy.arange', 'np.arange', (['self.low', 'self.up', '(0.1)'], {}), '(self.low, self.up, 0.1)\n', (433, 457), True, 'import numpy as np, matplotlib.pylab a... |
"""Project: Eskapade - A python-based package for data analysis.
Class: ValueCounter
Created: 2017/03/02
Description:
Algorithm to do value_counts() on single columns of a pandas
dataframe, or groupby().size() on multiple columns, both returned
as dictionaries. It is possible to do cleaning of these dict... | [
"eskapade.process_manager.service",
"numpy.dtype",
"eskapade.analysis.histogram_filling.HistogramFillerBase.finalize",
"eskapade.analysis.histogram_filling.HistogramFillerBase.__init__",
"collections.Counter",
"eskapade.analysis.histogram.Histogram",
"eskapade.analysis.histogram.ValueCounts",
"eskapad... | [((3710, 3754), 'eskapade.analysis.histogram_filling.HistogramFillerBase.__init__', 'HistogramFillerBase.__init__', (['self'], {}), '(self, **kwargs)\n', (3738, 3754), False, 'from eskapade.analysis.histogram_filling import HistogramFillerBase\n'), ((4889, 4925), 'eskapade.analysis.histogram_filling.HistogramFillerBase... |
import os
import sys
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ROOT_DIR)
from util import load_multi_object, load_single_object, parse_robot_type
import airobot as ar
import cv2
import time
import pybullet as p
import numpy as np
from options import make_parser
def encode_... | [
"os.path.join",
"os.listdir",
"os.path.abspath",
"os.mkdir",
"numpy.max",
"airobot.Robot",
"util.load_single_object",
"numpy.min",
"cv2.split",
"sys.path.append",
"util.load_multi_object",
"options.make_parser",
"cv2.merge",
"time.sleep",
"util.parse_robot_type"
] | [((92, 117), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (107, 117), False, 'import sys\n'), ((354, 366), 'numpy.min', 'np.min', (['dmap'], {}), '(dmap)\n', (360, 366), True, 'import numpy as np\n'), ((379, 391), 'numpy.max', 'np.max', (['dmap'], {}), '(dmap)\n', (385, 391), True, 'import ... |
# Zenora, a modern Python API wrapper for the Discord REST API
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitati... | [
"zenora.impl.mapper.ChannelMapper.map",
"unittest.main"
] | [((2111, 2126), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2124, 2126), False, 'import unittest\n'), ((1972, 2014), 'zenora.impl.mapper.ChannelMapper.map', 'ChannelMapper.map', (['self.response', 'self.app'], {}), '(self.response, self.app)\n', (1989, 2014), False, 'from zenora.impl.mapper import ChannelMappe... |
# 视图、函数、触发器的初始化模块
import pymysql
import traceback
# 作者:杨智麟
# 该视图为用户的番剧的详情信息查询提供便利
# 提供番剧的id,名称,制作公司,头图的信息
def create_view_detail_info(db):
cursor=db.cursor()
sql1="""
drop view if exists detail_info;
"""
sql2 = """
CREATE view detail_info as (
select bangumi_id, name,compa... | [
"traceback.print_exc",
"pymysql.connect"
] | [((4806, 4921), 'pymysql.connect', 'pymysql.connect', ([], {'host': '"""localhost"""', 'port': '(3306)', 'db': '"""yukiyu"""', 'user': '"""jhchen"""', 'password': '"""<PASSWORD>"""', 'charset': '"""utf8"""'}), "(host='localhost', port=3306, db='yukiyu', user='jhchen',\n password='<PASSWORD>', charset='utf8')\n", (48... |
from flask import Flask
import pickle
with open('models/input.pkl', 'rb') as picklefile:
cv = pickle.load(picklefile)
with open('models/answers.pkl', 'rb') as picklefile:
answers = pickle.load(picklefile)
with open('models/answers_vecs.pkl', 'rb') as picklefile:
answers_vecs = pickle.load(picklefile)... | [
"pickle.load",
"flask.Flask"
] | [((328, 343), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (333, 343), False, 'from flask import Flask\n'), ((99, 122), 'pickle.load', 'pickle.load', (['picklefile'], {}), '(picklefile)\n', (110, 122), False, 'import pickle\n'), ((191, 214), 'pickle.load', 'pickle.load', (['picklefile'], {}), '(picklefil... |
import glob
import cv2
import numpy as np
import math
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import pickle
class Tools:
@staticmethod
def get_image_from_dir(path, name_pattern):
# reading in images from directory
images = []
image_names = glob.glob(path + nam... | [
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.sum",
"math.ceil",
"cv2.imread",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.title",
"pickle.dump",
"glob.glob"
] | [((300, 330), 'glob.glob', 'glob.glob', (['(path + name_pattern)'], {}), '(path + name_pattern)\n', (309, 330), False, 'import glob\n'), ((812, 847), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'figsize': '(24, 9)'}), '(1, 2, figsize=(24, 9))\n', (824, 847), True, 'import matplotlib.pyplot as plt\n'... |
from collections import namedtuple, defaultdict
from PIL import Image
import pickle
from ca.grain_field import GrainField
from ca.grain import Grain, GrainType
def export_text(grain_field: GrainField, path_file='field.txt'):
"""
Export grain field to a text file
:param grain_field: GrainField object to ... | [
"pickle.Pickler",
"ca.grain_field.GrainField",
"pickle.Unpickler",
"PIL.Image.new",
"collections.defaultdict",
"PIL.Image.open"
] | [((1324, 1381), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(grain_field.width, grain_field.height)'], {}), "('RGB', (grain_field.width, grain_field.height))\n", (1333, 1381), False, 'from PIL import Image\n'), ((3037, 3062), 'ca.grain_field.GrainField', 'GrainField', (['width', 'height'], {}), '(width, height)\n', (... |
from frappe import _
def get_data():
return {
'fieldname':
'lease',
'transactions': [{
'label': _('Property & Unit'),
'items': ['Lease Rent Payment', "Lease Installment"]
}]
}
| [
"frappe._"
] | [((138, 158), 'frappe._', '_', (['"""Property & Unit"""'], {}), "('Property & Unit')\n", (139, 158), False, 'from frappe import _\n')] |
# -*- coding: utf-8 -*-
"""
Created on Wed May 03 11:26:21 2017
@author: <NAME>
https://github.com/bokeh/bokeh/issues/6096
"""
import pandas as pd
from bokeh.models import ColumnDataSource, CustomJS, TableColumn
from bokeh.layouts import row
import io
import base64
import graphs
class ImportData:
def __init... | [
"bokeh.layouts.row",
"pandas.read_csv",
"base64.b64decode",
"bokeh.models.ColumnDataSource",
"graphs.GraphPlot",
"bokeh.models.TableColumn"
] | [((358, 414), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', (["{'file_contents': [], 'file_name': []}"], {}), "({'file_contents': [], 'file_name': []})\n", (374, 414), False, 'from bokeh.models import ColumnDataSource, CustomJS, TableColumn\n'), ((4161, 4191), 'base64.b64decode', 'base64.b64decode', (['b64_conte... |
import pygame
import sys
import time
import random
from pygame.locals import *
pygame.init()
mainClock = pygame.time.Clock()
all_fonts = pygame.font.get_fonts()
basicFont = pygame.font.SysFont('arial', 20)
W = 550
H = 550
Surface = pygame.display.set_mode((W,H), 0, 32)
pygame.display.set_caption('Template')
BLACK =... | [
"pygame.time.Clock",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.font.SysFont",
"pygame.font.get_fonts",
"pygame.quit",
"pygame.display.flip",
"pygame.display.set_mode",
"pygame.event.get",
"pygame.Rect",
"sys.exit",
"random.randint",
"pygame.init"
] | [((80, 93), 'pygame.init', 'pygame.init', ([], {}), '()\n', (91, 93), False, 'import pygame\n'), ((106, 125), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (123, 125), False, 'import pygame\n'), ((138, 161), 'pygame.font.get_fonts', 'pygame.font.get_fonts', ([], {}), '()\n', (159, 161), False, 'import pyg... |
from .jogador import Jogador
from random import randint
class CPU(Jogador):
'''
Classe para instanciar objetos do tipo CPU.
A CPU é filha da superclasse Jogador.
'''
def __init__(self, nome=None, simbolo=None):
super().__init__(nome or "CPU", simbolo or "O")
self.a... | [
"random.randint"
] | [((652, 665), 'random.randint', 'randint', (['(0)', '(8)'], {}), '(0, 8)\n', (659, 665), False, 'from random import randint\n'), ((2000, 2033), 'random.randint', 'randint', (['(0)', 'tamanho_lista_jogadas'], {}), '(0, tamanho_lista_jogadas)\n', (2007, 2033), False, 'from random import randint\n')] |
"""Contains most of the methods that compose the ORIGIN software."""
import itertools
import logging
import warnings
from datetime import datetime
from functools import wraps
from time import time
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
import matplotlib.pyplot as plt
import numpy ... | [
"numpy.ones_like",
"mpdaf.obj.Image",
"numpy.sum",
"scipy.spatial.ConvexHull",
"numpy.log",
"photutils.make_source_mask",
"numpy.cumsum",
"scipy.ndimage.binary_dilation",
"numpy.nansum",
"datetime.datetime.now",
"numpy.clip",
"numpy.cos",
"numpy.unique",
"astropy.convolution.Gaussian2DKern... | [((215, 273), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'RuntimeWarning'}), "('ignore', category=RuntimeWarning)\n", (238, 273), False, 'import warnings\n'), ((1784, 1792), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (1789, 1792), False, 'from functools import wraps\n')... |
# coding: utf-8
"""
description: Statsmodels utility functions
author: <NAME>
"""
__all__ = [
'logit_evaluation_summary',
'summary',
'summary_to_latex'
]
import numpy as np
import pandas as pd
import statsmodels as sm
import re
def logit_evaluation_summary(results, labels, pos=1, neg=0):
fr... | [
"numpy.sum",
"re.search",
"statsmodels.iolib.summary2.summary_params",
"numpy.array",
"numpy.exp",
"re.sub"
] | [((790, 824), 'numpy.array', 'np.array', (['[0.1, 0.05, 0.01, 0.001]'], {}), '([0.1, 0.05, 0.01, 0.001])\n', (798, 824), True, 'import numpy as np\n'), ((1201, 1241), 'statsmodels.iolib.summary2.summary_params', 'sm.iolib.summary2.summary_params', (['result'], {}), '(result)\n', (1233, 1241), True, 'import statsmodels ... |
import streamlit as st
import pandas as pd
import numpy as np
URL_DADOS_FARM_TOGETHER = 'https://raw.githubusercontent.com/lucasHashi/maximizacao-de-utilidade-farm-together/master/dados_completos.json'
URL_DADOS_FINAL_FARM_TOGETHER = 'https://raw.githubusercontent.com/lucasHashi/maximizacao-de-utilidade-farm-together/... | [
"streamlit.write",
"streamlit.sidebar.slider",
"pandas.read_csv",
"streamlit.sidebar.selectbox",
"streamlit.sidebar.markdown",
"streamlit.title"
] | [((339, 386), 'streamlit.title', 'st.title', (['"""Hello Mundo, primeiro app Streamlit"""'], {}), "('Hello Mundo, primeiro app Streamlit')\n", (347, 386), True, 'import streamlit as st\n'), ((388, 427), 'streamlit.write', 'st.write', (['"""## Tabela final de recursos"""'], {}), "('## Tabela final de recursos')\n", (396... |
import tensorflow as tf
class MaskedSparseCategoricalCrossentropy(tf.keras.losses.Loss):
""" Computes the sparse categorical crossentropy masked
by the labels equal to 0.
"""
def __init__(self, from_logits: bool=False):
"""
Parameters
----------
from_logits : bool, optio... | [
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.cast",
"tensorflow.reduce_sum",
"tensorflow.argmax",
"tensorflow.not_equal",
"tensorflow.logical_and"
] | [((626, 718), 'tensorflow.keras.losses.SparseCategoricalCrossentropy', 'tf.keras.losses.SparseCategoricalCrossentropy', ([], {'from_logits': 'from_logits', 'reduction': '"""none"""'}), "(from_logits=from_logits,\n reduction='none')\n", (671, 718), True, 'import tensorflow as tf\n'), ((1372, 1395), 'tensorflow.not_eq... |
# mysite_login/urls.py
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from login import views
urlpatterns = [
path('login/', views.login),
path('register/', views.register),
path('logout/', views.logout),
path('confirm/', views.user_confirm),
path('... | [
"django.urls.path"
] | [((165, 192), 'django.urls.path', 'path', (['"""login/"""', 'views.login'], {}), "('login/', views.login)\n", (169, 192), False, 'from django.urls import path\n'), ((198, 231), 'django.urls.path', 'path', (['"""register/"""', 'views.register'], {}), "('register/', views.register)\n", (202, 231), False, 'from django.url... |
# encoding: utf-8
import json
import logging
import tornado
from tornado.websocket import WebSocketHandler
from tornado.web import RequestHandler
from pyquery import PyQuery
import db
class NotFound(RequestHandler):
"""
默认404页
"""
def get(self):
self.render('errors/404.html')
class BaseReq... | [
"db.Following.select",
"db.NoteHistorical.select",
"tornado.web.HTTPError",
"db.Movie.get",
"db.PhotoAlbumHistorical.select",
"db.User.get",
"db.Attachment.get",
"db.Comment.select",
"db.Follower.select",
"tornado.ioloop.IOLoop.current",
"db.MovieHistorical.select",
"db.MusicHistorical.select"... | [((1259, 1290), 'logging.debug', 'logging.debug', (['"""websocket open"""'], {}), "('websocket open')\n", (1272, 1290), False, 'import logging\n'), ((1371, 1403), 'logging.debug', 'logging.debug', (['"""websocket close"""'], {}), "('websocket close')\n", (1384, 1403), False, 'import logging\n'), ((1770, 1801), 'tornado... |
# Copyright 2021 MosaicML. All Rights Reserved.
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, TypeVar, Union, cast
if TYPE_CHECKING:
from yahp.types import JSON
T = TypeVar('T')
def ensure_tuple(x: Union[T, Tuple[T, ...], List[T], Dict[Any, T]]) -> Tuple[T, ...]:... | [
"typing.TypeVar"
] | [((220, 232), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (227, 232), False, 'from typing import TYPE_CHECKING, Any, Dict, List, Tuple, TypeVar, Union, cast\n'), ((926, 938), 'typing.TypeVar', 'TypeVar', (['"""K"""'], {}), "('K')\n", (933, 938), False, 'from typing import TYPE_CHECKING, Any, Dict, List, ... |
import json
import os
import requests
# http://dev.travisbell.com/play/v4_auth.html
ACCESS_TOKEN = os.environ["TMDB_ACCESS_TOKEN"]
API_KEY = os.environ["TMDB_API_KEY"]
NUMBER_ONES_LIST_ID = os.environ["TMDB_NUMBER_ONES_LIST_ID"]
ON_DECK_LIST_ID = os.environ["TMDB_ON_DECK_LIST_ID"]
WATCHED_LIST_ID = os.environ["TMDB_WA... | [
"json.dumps",
"requests.post",
"requests.get"
] | [((3305, 3339), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (3317, 3339), False, 'import requests\n'), ((3625, 3644), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (3635, 3644), False, 'import json\n'), ((3649, 3698), 'requests.post', 'requests.post', (... |
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from website.models import News,Programs
from django.conf import settings
import os
from PIL import Image
@receiver(post_save,sender=News,dispatch_uid='crop_imag_task')
def crop_image_task(sender,**kwargs):
obj = kwar... | [
"os.path.join",
"django.dispatch.receiver"
] | [((206, 269), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'News', 'dispatch_uid': '"""crop_imag_task"""'}), "(post_save, sender=News, dispatch_uid='crop_imag_task')\n", (214, 269), False, 'from django.dispatch import receiver\n'), ((607, 682), 'django.dispatch.receiver', 'receiver', (['post_save'... |
#!/usr/bin/env python3
import os
import time
import psutil
workdir = os.getcwd()
logfile = os.path.join(workdir, 'memlog.txt')
bytes_to_gigabytes = 1024 ** 3
time_limit = 86400
with open(logfile, 'w') as foo:
pass
sleep_time = 0
with open(logfile, 'a') as log:
header = '\t'.join(['#time', 'threads', 'lo... | [
"os.path.join",
"os.getcwd",
"psutil.cpu_percent",
"time.ctime",
"psutil.swap_memory",
"psutil.cpu_count",
"psutil.virtual_memory",
"time.sleep"
] | [((72, 83), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (81, 83), False, 'import os\n'), ((94, 129), 'os.path.join', 'os.path.join', (['workdir', '"""memlog.txt"""'], {}), "(workdir, 'memlog.txt')\n", (106, 129), False, 'import os\n'), ((614, 637), 'psutil.virtual_memory', 'psutil.virtual_memory', ([], {}), '()\n', (63... |
from sys import argv as argv_
from pathlib import Path
from typing import Optional, List, Type
from PyQt5.QtWidgets import QAbstractButton, QStackedWidget, QComboBox, QLineEdit, QTextEdit,\
QPlainTextEdit, QSpinBox, QDoubleSpinBox, QLabel, QProgressBar, QAbstractSlider
class QWidgetCodeGenerator:
"""
Hold... | [
"pathlib.Path"
] | [((7348, 7364), 'pathlib.Path', 'Path', (['input_file'], {}), '(input_file)\n', (7352, 7364), False, 'from pathlib import Path\n'), ((7591, 7608), 'pathlib.Path', 'Path', (['output_file'], {}), '(output_file)\n', (7595, 7608), False, 'from pathlib import Path\n')] |
'''
Created on 9 mars 2022
@author: slinux
'''
import datetime
import logging
class RVNpyRPC_JobsUtils():
'''
classdocs
'''
RPCconnexion = None
SATOSHIS_CONVERT = 100000000
def __init__(self,connexion, parent):
'''
Constructor
'''
#super().__init__(... | [
"logging.getLogger"
] | [((427, 455), 'logging.getLogger', 'logging.getLogger', (['"""wxRaven"""'], {}), "('wxRaven')\n", (444, 455), False, 'import logging\n')] |
import torch.nn as nn
from networks.ResidualBlocks import ResidualBlock2dTransposeConv
def make_res_block_data_generator(in_channels, out_channels, kernelsize, stride, padding, o_padding, dilation, a_val=1.0, b_val=1.0):
upsample = None;
if (kernelsize != 1 and stride != 1) or (in_channels != out_channels):... | [
"torch.nn.Sequential",
"networks.ResidualBlocks.ResidualBlock2dTransposeConv",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d"
] | [((1389, 1411), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1402, 1411), True, 'import torch.nn as nn\n'), ((2315, 2337), 'torch.nn.Sequential', 'nn.Sequential', (['*blocks'], {}), '(*blocks)\n', (2328, 2337), True, 'import torch.nn as nn\n'), ((860, 1056), 'networks.ResidualBlocks.Residu... |
# # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# # All trademark and other rights reserved by their respective owners
# # Copyright 2008-2021 Neongecko.com Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... | [
"setuptools.find_packages"
] | [((3079, 3116), 'setuptools.find_packages', 'find_packages', ([], {'include': "['neon_core*']"}), "(include=['neon_core*'])\n", (3092, 3116), False, 'from setuptools import setup, find_packages\n')] |
def CharUnique(S: str) -> bool:
"""
>>> CharUnique('deacidified')
False
>>> CharUnique('keraunoscopia')
False
>>> CharUnique('layout')
True
>>> CharUnique('brand')
True
>>> CharUnique('texture')
False
>>> CharUnique('ovalness')
False
>>> CharUnique('unglove')
True
"""
#for i scan ahe... | [
"doctest.testmod"
] | [((667, 684), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (682, 684), False, 'import doctest\n')] |
import multiprocessing as mp
import sys
import traceback
class Stage:
def __init__(self, name, size, optional_arg=None):
self.name = name
if size <= 0:
raise 'Size needs to be strictly positive'
self.queue = mp.Queue(size)
self.oqueue = None
self.optional_arg = ... | [
"multiprocessing.Process",
"multiprocessing.Queue",
"traceback.format_exc"
] | [((250, 264), 'multiprocessing.Queue', 'mp.Queue', (['size'], {}), '(size)\n', (258, 264), True, 'import multiprocessing as mp\n'), ((450, 557), 'multiprocessing.Process', 'mp.Process', ([], {'target': 'Stage.process__', 'args': '(self, self.name, self.queue, self.oqueue, self.optional_arg)'}), '(target=Stage.process__... |
from django.contrib import admin
# Register your models here.
from .models import Vuln, Tag, Vendor, Product, CVSS, Reference, NVD, NVDref, Author
admin.site.register(Vuln)
admin.site.register(Tag)
admin.site.register(Vendor)
admin.site.register(Product)
admin.site.register(CVSS)
admin.site.register(Reference)
admin.... | [
"django.contrib.admin.site.register"
] | [((149, 174), 'django.contrib.admin.site.register', 'admin.site.register', (['Vuln'], {}), '(Vuln)\n', (168, 174), False, 'from django.contrib import admin\n'), ((175, 199), 'django.contrib.admin.site.register', 'admin.site.register', (['Tag'], {}), '(Tag)\n', (194, 199), False, 'from django.contrib import admin\n'), (... |
import json
import os
data_folder_path = "data/Val/"
train_folder_name = "Train"
test_folder_name = "Test"
# Train folder exists
os.path.isdir(f"{data_folder_path}{train_folder_name}")
# Test folder exists
os.path.isdir(f"{data_folder_path}{test_folder_name}")
train = {}
for root,dirs,files in os.walk(data_folder_pa... | [
"os.walk",
"os.path.isdir",
"json.dumps"
] | [((131, 186), 'os.path.isdir', 'os.path.isdir', (['f"""{data_folder_path}{train_folder_name}"""'], {}), "(f'{data_folder_path}{train_folder_name}')\n", (144, 186), False, 'import os\n'), ((208, 262), 'os.path.isdir', 'os.path.isdir', (['f"""{data_folder_path}{test_folder_name}"""'], {}), "(f'{data_folder_path}{test_fol... |
import pytest
from conftest import TESTDATA, CollectionApiClient
pytestmark = [pytest.mark.django_db]
@pytest.mark.skip(reason="tika no longer outputs HTTP422 with a broken response format in 1.20")
def test_digest_with_broken_dependency(fakedata, taskmanager, client):
root_directory = fakedata.init()
mof1_... | [
"conftest.CollectionApiClient",
"pytest.mark.skip"
] | [((107, 207), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""tika no longer outputs HTTP422 with a broken response format in 1.20"""'}), "(reason=\n 'tika no longer outputs HTTP422 with a broken response format in 1.20')\n", (123, 207), False, 'import pytest\n'), ((580, 607), 'conftest.CollectionApiClie... |
from unittest import TestCase
from src.util.load_data import load_data
from src.year2021.day02 import follow_course, part_1, part_2, prepare_data
from test.decorators import sample
data = load_data(2021, 2)
@sample
class Test2021Day02Samples(TestCase):
horiz_pos: int
depth: int
aim: int
@classmet... | [
"src.year2021.day02.prepare_data",
"src.year2021.day02.follow_course",
"src.year2021.day02.part_1",
"src.year2021.day02.part_2",
"src.util.load_data.load_data"
] | [((191, 209), 'src.util.load_data.load_data', 'load_data', (['(2021)', '(2)'], {}), '(2021, 2)\n', (200, 209), False, 'from src.util.load_data import load_data\n'), ((381, 410), 'src.year2021.day02.prepare_data', 'prepare_data', (['data.samples[0]'], {}), '(data.samples[0])\n', (393, 410), False, 'from src.year2021.day... |
#!/usr/bin/python3
#//////////////////////////////////////
# counter.py
# Uses 7-segment LEDs to count up and down with presses of R and L.
#//////////////////////////////////////
import Adafruit_BBIO.GPIO as GPIO
import time
L_BUTTON = "P2_33"
R_BUTTON = "P1_29"
GPIO.setup(L_BUTTON, GPIO.IN)
GPIO.setup(R_BUTTON, GPIO... | [
"Adafruit_BBIO.GPIO.add_event_detect",
"time.sleep",
"Adafruit_BBIO.GPIO.setup"
] | [((265, 294), 'Adafruit_BBIO.GPIO.setup', 'GPIO.setup', (['L_BUTTON', 'GPIO.IN'], {}), '(L_BUTTON, GPIO.IN)\n', (275, 294), True, 'import Adafruit_BBIO.GPIO as GPIO\n'), ((295, 324), 'Adafruit_BBIO.GPIO.setup', 'GPIO.setup', (['R_BUTTON', 'GPIO.IN'], {}), '(R_BUTTON, GPIO.IN)\n', (305, 324), True, 'import Adafruit_BBIO... |
import abc
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
from tqdm import trange
from rec.coding.utils import CodingError
from rec.coding.samplers import Sampler, RejectionSampler, ImportanceSampler
tfl = tf.keras.layers
tfd = tfp.distributions
AUX_RATIO_POWER_LAW = -0.7864636765... | [
"tensorflow.concat",
"tensorflow.math.reduce_std",
"tqdm.trange",
"numpy.power",
"tensorflow.abs",
"rec.coding.utils.CodingError",
"tensorflow.TensorShape",
"tensorflow.rank",
"tensorflow.GradientTape",
"tensorflow.reshape",
"tensorflow.gather_nd",
"tensorflow.Variable",
"tensorflow.optimize... | [((503, 540), 'tensorflow.clip_by_value', 'tf.clip_by_value', (['x', '(1e-10)', '(1 - 1e-10)'], {}), '(x, 1e-10, 1 - 1e-10)\n', (519, 540), True, 'import tensorflow as tf\n'), ((4339, 4366), 'tensorflow.math.pow', 'tf.math.pow', (['coder.scale', '(2)'], {}), '(coder.scale, 2)\n', (4350, 4366), True, 'import tensorflow ... |
import tensorflow as tf
from ..bbox import overlap_point
def point(bbox_true, point_pred, regress_range = None, threshold = 0.0001):
overlaps = tf.transpose(overlap_point(bbox_true, point_pred, regress_range)) #(P, T)
max_area = tf.reduce_max(overlaps, axis = -1)
match = tf.where(tf.logical_and(threshold ... | [
"tensorflow.gather",
"tensorflow.shape",
"tensorflow.constant",
"tensorflow.argmax",
"tensorflow.reduce_max",
"tensorflow.where",
"tensorflow.logical_and"
] | [((239, 271), 'tensorflow.reduce_max', 'tf.reduce_max', (['overlaps'], {'axis': '(-1)'}), '(overlaps, axis=-1)\n', (252, 271), True, 'import tensorflow as tf\n'), ((490, 527), 'tensorflow.gather', 'tf.gather', (['overlaps', 'positive_indices'], {}), '(overlaps, positive_indices)\n', (499, 527), True, 'import tensorflow... |
#!/usr/bin/env python
# imports
from PIL import Image
from sys import argv
import re
import os
# constants
UPSCALE_RES = 2160
SCALE_MODE = Image.NEAREST
RUN_PATH = './'
EP_PATH = None
def main():
# check if dir exists
if not os.path.isdir(EP_PATH):
exit(f'path not found\n{EP_PATH}')
for file i... | [
"os.listdir",
"os.path.dirname",
"os.path.exists",
"re.search",
"os.path.isdir",
"PIL.Image.open",
"os.makedirs"
] | [((322, 341), 'os.listdir', 'os.listdir', (['EP_PATH'], {}), '(EP_PATH)\n', (332, 341), False, 'import os\n'), ((1618, 1638), 'os.listdir', 'os.listdir', (['RUN_PATH'], {}), '(RUN_PATH)\n', (1628, 1638), False, 'import os\n'), ((238, 260), 'os.path.isdir', 'os.path.isdir', (['EP_PATH'], {}), '(EP_PATH)\n', (251, 260), ... |
#! python
# IA 2020 II PAC, Tarea.
# Redes Neuronales Artificiales básicas para Reconocimiento de Patrones
# Perceptron, reconocimiento de numeros en 7 segmentos
# Video de referencia por Hackeando Tec
# https://www.youtube.com/watch?v=wOWmsDqYx5E
# Made by MilanDroid
# https://github.com/MilanDroid/
# Requirements... | [
"numpy.array",
"numpy.random.rand",
"numpy.dot"
] | [((2154, 2181), 'numpy.array', 'np.array', (['([None] * patrones)'], {}), '([None] * patrones)\n', (2162, 2181), True, 'import numpy as np\n'), ((1773, 1793), 'numpy.random.rand', 'np.random.rand', (['(1)', '(7)'], {}), '(1, 7)\n', (1787, 1793), True, 'import numpy as np\n'), ((1880, 1897), 'numpy.random.rand', 'np.ran... |
# -*- encoding: utf-8 -*-
# Module iatoggle
from numpy import *
def iatoggle(f, f1, f2, OPTION="GRAY"):
from ia870.iabinary import iabinary
from ia870.iasubm import iasubm
from ia870.iagray import iagray
from ia870.iaunion import iaunion
from ia870.iaintersec import iaintersec
from ia870.ianeg... | [
"ia870.iaintersec.iaintersec",
"ia870.iagray.iagray",
"ia870.ianeg.ianeg",
"ia870.iasubm.iasubm"
] | [((352, 365), 'ia870.iasubm.iasubm', 'iasubm', (['f', 'f1'], {}), '(f, f1)\n', (358, 365), False, 'from ia870.iasubm import iasubm\n'), ((365, 378), 'ia870.iasubm.iasubm', 'iasubm', (['f2', 'f'], {}), '(f2, f)\n', (371, 378), False, 'from ia870.iasubm import iasubm\n'), ((422, 431), 'ia870.iagray.iagray', 'iagray', (['... |
from src import log_debug
def comparison_operators_basics():
"""
Let's check on comparison operators in Python
:return:
"""
# ==, !=, >, <, <=, >=
log_debug(2 == 2)
log_debug(2 == 4)
log_debug("ABC" == "ABC")
log_debug(2.0 == 2)
log_debug(3 != 3)
log_debug(4 != 5)
l... | [
"src.log_debug"
] | [((175, 192), 'src.log_debug', 'log_debug', (['(2 == 2)'], {}), '(2 == 2)\n', (184, 192), False, 'from src import log_debug\n'), ((197, 214), 'src.log_debug', 'log_debug', (['(2 == 4)'], {}), '(2 == 4)\n', (206, 214), False, 'from src import log_debug\n'), ((219, 244), 'src.log_debug', 'log_debug', (["('ABC' == 'ABC')"... |
#!/usr/local/bin/python2.7
"""
Copyright (c) 2018 Verb Networks Pty Ltd <<EMAIL>>
Copyright (c) 2018 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistri... | [
"os.utime",
"ConfigParser.ConfigParser",
"io.BytesIO",
"os.path.dirname",
"config.Config",
"sys.path.insert",
"os.path.isfile",
"base64.b64decode",
"os.open"
] | [((1537, 1594), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/usr/local/opnsense/service/modules"""'], {}), "(0, '/usr/local/opnsense/service/modules')\n", (1552, 1594), False, 'import sys\n'), ((10094, 10140), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {'allow_no_value': '(True)'}), '(allow_n... |
from django.core.cache.backends.memcached import (
BaseMemcachedCache,
MemcachedCache as DjangoMemcachedCache,
PyLibMCCache as DjangoPyLibMCCache)
from django.utils.functional import cached_property
from functools import partial
from django.conf import settings
class ZippedMCMixin(object):
"""
Mix... | [
"functools.partial"
] | [((1238, 1296), 'functools.partial', 'partial', (['cache.add'], {'min_compress_len': 'self.min_compress_len'}), '(cache.add, min_compress_len=self.min_compress_len)\n', (1245, 1296), False, 'from functools import partial\n'), ((1317, 1375), 'functools.partial', 'partial', (['cache.set'], {'min_compress_len': 'self.min_... |
import json
import multiprocessing as mp
import socket
import time
import psutil
from asynch.common import encode_bytes, decode_bytes, MAX_SIZE
from multiprocess.socket.src.asynch.worker import Worker, thread as worker_thread
class GlobalState():
BEGINNING = 1
class GlobalProcess():
def __init__(self):
... | [
"multiprocess.socket.src.asynch.worker.Worker",
"json.dumps",
"multiprocessing.Process",
"multiprocessing.freeze_support",
"asynch.common.decode_bytes",
"time.time",
"socket.socket",
"psutil.cpu_count",
"time.sleep"
] | [((3797, 3816), 'multiprocessing.freeze_support', 'mp.freeze_support', ([], {}), '()\n', (3814, 3816), True, 'import multiprocessing as mp\n'), ((2127, 2138), 'time.time', 'time.time', ([], {}), '()\n', (2136, 2138), False, 'import time\n'), ((2575, 2593), 'psutil.cpu_count', 'psutil.cpu_count', ([], {}), '()\n', (2591... |
"""
Author: <NAME>
Date: 2020-2021
Description: Creates the GUI and allows the user to interact with the data (re-scraping the data or creating
the training data) or the deep learning model (making predictions).
"""
from PyTorchPredictor import Predictor
from Data import Data
from Window import Window
from tkinter im... | [
"Window.Window",
"Data.Data",
"PyTorchPredictor.Predictor",
"time.sleep"
] | [((373, 379), 'Data.Data', 'Data', ([], {}), '()\n', (377, 379), False, 'from Data import Data\n'), ((548, 559), 'PyTorchPredictor.Predictor', 'Predictor', ([], {}), '()\n', (557, 559), False, 'from PyTorchPredictor import Predictor\n'), ((2010, 2030), 'Window.Window', 'Window', (['tk', 'progress'], {}), '(tk, progress... |
from .IndicShaperData import IndicPosition, make_syllable_machine, syllabic_category_map
from .SyllabicShaper import SyllabicShaper
from collections import OrderedDict
myanmar_category_reassignments = {
0x002D: "GB",
0x00A0: "GB",
0x00D7: "GB",
0x1004: "Ra",
0x101B: "Ra",
0x1032: "A",
0x10... | [
"collections.OrderedDict"
] | [((1473, 2036), 'collections.OrderedDict', 'OrderedDict', ([], {'j': '"""ZWJ|ZWNJ"""', 'k': '"""(Ra As H)"""', 'c': '"""C|Ra"""', 'medial_group': '"""MY? As? MR? ((MW MH? | MH) As?)?"""', 'main_vowel_group': '"""(VPre VS?)* VAbv* VBlw* A* (DB As?)?"""', 'post_vowel_group': '"""VPst MH? As* VAbv* A* (DB As?)?"""', 'pwo_... |
#!/usr/bin/python3
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
from time import sleep
if __name__ == "__main__":
motor_driver = Adafruit_MotorHAT(addr=0x60)
left_motor = motor_driver.getMotor(1)
right_motor = motor_driver.getMotor(2)
left_motor.setSpeed(255)
right_motor.setSpeed(255... | [
"Adafruit_MotorHAT.Adafruit_MotorHAT",
"time.sleep"
] | [((155, 181), 'Adafruit_MotorHAT.Adafruit_MotorHAT', 'Adafruit_MotorHAT', ([], {'addr': '(96)'}), '(addr=96)\n', (172, 181), False, 'from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor\n'), ((415, 423), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (420, 423), False, 'from time import sleep\n'), ((575, 5... |
"""
Simple example using the sort and filter objects
"""
from modeltestSDK import Client
client = Client()
campaigns = client.campaign.get(filter_by=[
client.filter.campaign.name == "Campaign name",
client.filter.campaign.description == "Campaign description"],
sort_by=[client.sort.campaign.date.asc])
| [
"modeltestSDK.Client"
] | [((98, 106), 'modeltestSDK.Client', 'Client', ([], {}), '()\n', (104, 106), False, 'from modeltestSDK import Client\n')] |
from collections import OrderedDict
import numpy as np
import argparse
from common.constant import DATADIR
from common.functionutil import makedir, join_path_names, list_files_dir, basename, basename_filenoext, fileextension, \
str2bool, read_dictionary
from common.exceptionmanager import catch_error_exception
fr... | [
"common.functionutil.makedir",
"dataloaders.imagefilereader.ImageFileReader.write_image",
"argparse.ArgumentParser",
"imageoperators.maskoperator.MaskOperator.mask_image",
"numpy.power",
"common.functionutil.read_dictionary",
"imageoperators.imageoperator.MorphoFillHolesMask.compute",
"imageoperators.... | [((1955, 1990), 'common.functionutil.list_files_dir', 'list_files_dir', (['args.in_roimask_dir'], {}), '(args.in_roimask_dir)\n', (1969, 1990), False, 'from common.functionutil import makedir, join_path_names, list_files_dir, basename, basename_filenoext, fileextension, str2bool, read_dictionary\n'), ((2707, 2742), 'co... |
from django.contrib import admin
from .models import Buyer, Product, Pack, Cart, Order, StockKeepingUnit
admin.site.register(Buyer)
admin.site.register(Product)
admin.site.register(Pack)
admin.site.register(Cart)
admin.site.register(Order)
admin.site.register(StockKeepingUnit)
| [
"django.contrib.admin.site.register"
] | [((109, 135), 'django.contrib.admin.site.register', 'admin.site.register', (['Buyer'], {}), '(Buyer)\n', (128, 135), False, 'from django.contrib import admin\n'), ((137, 165), 'django.contrib.admin.site.register', 'admin.site.register', (['Product'], {}), '(Product)\n', (156, 165), False, 'from django.contrib import ad... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quant... | [
"numpy.genfromtxt",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.figure",
"numpy.where",
"sklearn.manifold.LocallyLinearEmbedding",
"quandl.Dataset",
"quandl.get",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.scatter",
"six.moves.urllib.request.urlopen",
"datetime.datetime",
"sklearn.covarianc... | [((2772, 2805), 'matplotlib.rcParams.update', 'rcParams.update', (["{'font.size': 8}"], {}), "({'font.size': 8})\n", (2787, 2805), False, 'from matplotlib import rcParams\n'), ((4190, 4210), 'datetime.datetime', 'datetime', (['(2017)', '(1)', '(1)'], {}), '(2017, 1, 1)\n', (4198, 4210), False, 'from datetime import dat... |
import numpy as np
import scipy as scipy
import lxmls.classifiers.linear_classifier as lc
import sys
from lxmls.distributions.gaussian import *
class MultinomialNaiveBayes(lc.LinearClassifier):
def __init__(self,xtype="gaussian"):
lc.LinearClassifier.__init__(self)
self.trained = False
se... | [
"lxmls.classifiers.linear_classifier.LinearClassifier.__init__",
"numpy.zeros",
"numpy.log",
"numpy.nonzero",
"numpy.unique"
] | [((246, 280), 'lxmls.classifiers.linear_classifier.LinearClassifier.__init__', 'lc.LinearClassifier.__init__', (['self'], {}), '(self)\n', (274, 280), True, 'import lxmls.classifiers.linear_classifier as lc\n'), ((640, 652), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (649, 652), True, 'import numpy as np\n'), (... |
from django.http.request import HttpRequest
from django.shortcuts import render
def venue(request: HttpRequest):
return render(request, "info/venue/index.html", {
'page_title': 'Venue',
})
def photos(request: HttpRequest):
return render(request, "info/photos/index.html", {
'page_title': ... | [
"django.shortcuts.render"
] | [((126, 191), 'django.shortcuts.render', 'render', (['request', '"""info/venue/index.html"""', "{'page_title': 'Venue'}"], {}), "(request, 'info/venue/index.html', {'page_title': 'Venue'})\n", (132, 191), False, 'from django.shortcuts import render\n'), ((254, 321), 'django.shortcuts.render', 'render', (['request', '""... |
import pandas as pd
import datetime
import time
def _parse_quotes(data):
"""Parse quotes from raw data.
Args:
data ([dict]): Raw data
Returns:
[pd.DataFrame]: Contains parsed quotes.
"""
timestamps = data["timestamp"]
ohlc = data["indicators"]["quote"][0]
volumes = ohlc["v... | [
"pandas.DataFrame",
"pandas.to_datetime",
"time.time"
] | [((571, 691), 'pandas.DataFrame', 'pd.DataFrame', (["{'Open': opens, 'High': highs, 'Low': lows, 'Close': closes, 'Adj Close':\n adjclose, 'Volume': volumes}"], {}), "({'Open': opens, 'High': highs, 'Low': lows, 'Close': closes,\n 'Adj Close': adjclose, 'Volume': volumes})\n", (583, 691), True, 'import pandas as ... |
from unittest import mock
import botocore
import pytest
from dashboard_generator import DashboardGenerator
@mock.patch('dashboard_generator.boto3')
def test_cloudwatch_list_metrics_ensure_paginator_operation_name_is_called_properly(mock_boto, env_variables):
DashboardGenerator()._cloudwatch_list_metrics()
a... | [
"pytest.raises",
"botocore.exceptions.ClientError",
"dashboard_generator.DashboardGenerator",
"unittest.mock.patch"
] | [((111, 150), 'unittest.mock.patch', 'mock.patch', (['"""dashboard_generator.boto3"""'], {}), "('dashboard_generator.boto3')\n", (121, 150), False, 'from unittest import mock\n'), ((463, 502), 'unittest.mock.patch', 'mock.patch', (['"""dashboard_generator.boto3"""'], {}), "('dashboard_generator.boto3')\n", (473, 502), ... |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(rc={"figure.figsize":(22,22)}) #seaborn figure size ını ayarlıyoruz
df=pd.read_csv("world-happiness-report.csv")
plt.title("Correlation Matrix")
sns.heatmap(df.corr(),annot=True,linewidths=.5)
plt.savefig("Correlation-heatmap.png") | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"seaborn.set"
] | [((75, 115), 'seaborn.set', 'sns.set', ([], {'rc': "{'figure.figsize': (22, 22)}"}), "(rc={'figure.figsize': (22, 22)})\n", (82, 115), True, 'import seaborn as sns\n'), ((155, 196), 'pandas.read_csv', 'pd.read_csv', (['"""world-happiness-report.csv"""'], {}), "('world-happiness-report.csv')\n", (166, 196), True, 'impor... |
"""
A wrapper around a 32-bit FORTRAN library, :ref:`fortran_lib32 <fortran-lib>`.
Example of a server that loads a 32-bit FORTRAN library, :ref:`fortran_lib32 <fortran-lib>`,
in a 32-bit Python interpreter to host the library. The corresponding :mod:`~.fortran64`
module can be executed by a 64-bit Python interpreter ... | [
"ctypes.c_int32",
"ctypes.c_int64",
"os.path.dirname",
"ctypes.byref",
"ctypes.c_float",
"ctypes.c_int8",
"ctypes.c_bool",
"ctypes.c_int16",
"ctypes.create_string_buffer",
"ctypes.c_double"
] | [((2936, 2952), 'ctypes.c_int8', 'ctypes.c_int8', (['a'], {}), '(a)\n', (2949, 2952), False, 'import ctypes\n'), ((2966, 2982), 'ctypes.c_int8', 'ctypes.c_int8', (['b'], {}), '(b)\n', (2979, 2982), False, 'import ctypes\n'), ((4124, 4141), 'ctypes.c_int16', 'ctypes.c_int16', (['a'], {}), '(a)\n', (4138, 4141), False, '... |
#!/usr/bin/python3
#coding=utf-8
from datetime import datetime
import itertools
import networkx as nx
import pickle
import math
from abstract_type import abstract_type
import sys
sys.path.append('..')
import insummer
from insummer.common_type import Question,Answer
from insummer.read_conf import config
from insummer.u... | [
"itertools.combinations",
"networkx.pagerank_scipy",
"datetime.datetime.now",
"pickle.load",
"abstract_type.abstract_type",
"networkx.Graph",
"insummer.query_expansion.entity_finder.NgramEntityFinder",
"insummer.util.NLP",
"sys.path.append",
"insummer.read_conf.config",
"pickle.dump"
] | [((180, 201), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (195, 201), False, 'import sys\n'), ((432, 466), 'insummer.read_conf.config', 'config', (['"""../../conf/question.conf"""'], {}), "('../../conf/question.conf')\n", (438, 466), False, 'from insummer.read_conf import config\n'), ((738, 74... |
from setuptools import setup, Extension
ext_mod = Extension("_rundec",
sources=["_rundec.cc", "CRunDec3/CRunDec.cpp"],
)
setup(name="rundec",
version="0.5.2",
author="<NAME>",
author_email="<EMAIL>",
url="https://github.com/DavidMStraub/rundec-python",
... | [
"setuptools.setup",
"setuptools.Extension"
] | [((51, 119), 'setuptools.Extension', 'Extension', (['"""_rundec"""'], {'sources': "['_rundec.cc', 'CRunDec3/CRunDec.cpp']"}), "('_rundec', sources=['_rundec.cc', 'CRunDec3/CRunDec.cpp'])\n", (60, 119), False, 'from setuptools import setup, Extension\n'), ((163, 701), 'setuptools.setup', 'setup', ([], {'name': '"""runde... |
import os
from netmiko import ConnectHandler
from getpass import getpass
# Code so automated tests will run properly
password = os.getenv("NETMIKO_PASSWORD") if os.getenv("NETMIKO_PASSWORD") else getpass()
my_device = {
"device_type": "cisco_ios",
"host": "cisco3.lasthop.io",
"username": "pyclass",
"p... | [
"netmiko.ConnectHandler",
"os.getenv",
"getpass.getpass"
] | [((162, 191), 'os.getenv', 'os.getenv', (['"""NETMIKO_PASSWORD"""'], {}), "('NETMIKO_PASSWORD')\n", (171, 191), False, 'import os\n'), ((129, 158), 'os.getenv', 'os.getenv', (['"""NETMIKO_PASSWORD"""'], {}), "('NETMIKO_PASSWORD')\n", (138, 158), False, 'import os\n'), ((197, 206), 'getpass.getpass', 'getpass', ([], {})... |
from typing import Callable, List, Union
import pytest
from ycbvideo import selectors
from ycbvideo.selectors import ListSelector, RangeSelector, SingleElementSelector, StarSelector
from ycbvideo.selectors import DataSelector, DataSynSelector
from ycbvideo.selectors import EmptySelectionError, MissingElementError
EL... | [
"ycbvideo.selectors.RangeSelector",
"ycbvideo.selectors.DataSelector",
"pytest.raises",
"ycbvideo.selectors.ListSelector",
"ycbvideo.selectors.SingleElementSelector",
"pytest.mark.parametrize",
"ycbvideo.selectors.DataSynSelector",
"ycbvideo.selectors.StarSelector"
] | [((1320, 1374), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "['sequence', 'frame']"], {}), "('kind', ['sequence', 'frame'])\n", (1343, 1374), False, 'import pytest\n'), ((2069, 2123), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""kind"""', "['sequence', 'frame']"], {}), "('kind',... |
"""Wrapper Class for Tensorboard's SummaryWriter."""
from torch.utils.tensorboard import SummaryWriter
class TensorboardWriter:
"""Wrapper Class for Tensorboard's SummaryWriter."""
def __init__(self, log_dir, targets):
"""
Initializes the Writer.
Parameters
----------
... | [
"torch.utils.tensorboard.SummaryWriter"
] | [((452, 482), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', ([], {'log_dir': 'log_dir'}), '(log_dir=log_dir)\n', (465, 482), False, 'from torch.utils.tensorboard import SummaryWriter\n')] |
import torch
import torch.nn as nn
from IOU import intersection_over_union
# loss created by me from scratch bass ese hi :)
class Loss(nn.Module):
def __init__(self, S=7, C=20, B=2):
super(Loss, self).__init__()
self.S = S
self.C = C
self.B = B
self.mse = nn.MSELo... | [
"torch.cat",
"torch.ones",
"IOU.intersection_over_union",
"torch.abs",
"torch.nn.MSELoss",
"torch.flatten"
] | [((3300, 3326), 'torch.ones', 'torch.ones', (['(10, 7, 7, 30)'], {}), '((10, 7, 7, 30))\n', (3310, 3326), False, 'import torch\n'), ((312, 339), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {'reduction': '"""sum"""'}), "(reduction='sum')\n", (322, 339), True, 'import torch.nn as nn\n'), ((3339, 3365), 'torch.ones', 'torch.on... |
#!/bin/python3
import pythfinder as pf
import json
from flask import Flask, abort, request, Blueprint, session, g
from uuid import uuid4 as uuid
from redis import Redis
from flask_cors import CORS
from werkzeug.exceptions import HTTPException
TIMEOUT = 14*24*60*60 # timeout in seconds; == 14 days
HTTP_METHODS = ['GET... | [
"flask.g.c.get_abilities",
"flask.g.c.delete_special",
"json.dumps",
"flask.request.args.get",
"flask.g.c.get_armor",
"flask.g.c.get_json",
"flask.g.c.add_spell",
"flask.g.c.delete_class",
"flask.g.c.add_equipment",
"flask.g.c.get_skills",
"flask.g.c.delete_trait",
"pythfinder.Character",
"f... | [((631, 694), 'redis.Redis', 'Redis', ([], {'host': '"""localhost"""', 'port': '(6379)', 'db': '(0)', 'decode_responses': '(True)'}), "(host='localhost', port=6379, db=0, decode_responses=True)\n", (636, 694), False, 'from redis import Redis\n'), ((709, 770), 'flask.Blueprint', 'Blueprint', (['"""pythfinder-flask"""', ... |
# https://www.hackerrank.com/challenges/np-transpose-and-flatten/problem
import numpy
N, M = map(int, input().split())
matrix = numpy.array([list(map(int, input().split())) for _ in range(N)])
print(numpy.transpose(matrix))
print(matrix.flatten())
| [
"numpy.transpose"
] | [((201, 224), 'numpy.transpose', 'numpy.transpose', (['matrix'], {}), '(matrix)\n', (216, 224), False, 'import numpy\n')] |
from flask import Flask, jsonify, request
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('number', type=float, required=True)
parser.add_argument('word', required=True)
class HelloWorld(Resource):
def get(self):
... | [
"flask_restful.Api",
"flask_restful.reqparse.RequestParser",
"flask.Flask"
] | [((100, 115), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (105, 115), False, 'from flask import Flask, jsonify, request\n'), ((122, 130), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (125, 130), False, 'from flask_restful import Resource, Api, reqparse\n'), ((141, 165), 'flask_restful.reqparse.... |
#!/usr/bin/env python
"""
Task 2.4 Boolean functions and the Boolean Fourier transform
"""
import numpy as np
import numpy.linalg as la
import matplotlib as mpl
import matplotlib.pyplot as plt
from itertools import chain, combinations
from functools import reduce
from matplotlib import rc
rc("text", usetex=True)
mpl.... | [
"numpy.vstack",
"numpy.where",
"functools.reduce",
"numpy.ones",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.unpackbits",
"numpy.array",
"numpy.dot",
"numpy.linspace",
"matplotlib.rc",
"numpy.linalg.lstsq",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.subplots",
"matplotli... | [((292, 315), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (294, 315), False, 'from matplotlib import rc\n'), ((2742, 2765), 'numpy.unpackbits', 'np.unpackbits', (['integers'], {}), '(integers)\n', (2755, 2765), True, 'import numpy as np\n'), ((2806, 2833), 'numpy.where', 'n... |
import unittest
from pylgrum.card import Card, Rank, Suit
from pylgrum.stack import CardStack
from pylgrum.errors import CardNotFoundError
def get_test_stack() -> CardStack:
"""Returns stack of 12 cards for reference by test cases."""
cs = CardStack()
# Note: tests below depend on the details of this deck... | [
"pylgrum.card.Card",
"pylgrum.card.Card.from_text",
"pylgrum.stack.CardStack",
"unittest.main"
] | [((250, 261), 'pylgrum.stack.CardStack', 'CardStack', ([], {}), '()\n', (259, 261), False, 'from pylgrum.stack import CardStack\n'), ((4775, 4790), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4788, 4790), False, 'import unittest\n'), ((332, 370), 'pylgrum.card.Card', 'Card', ([], {'rank': 'Rank.QUEEN', 'suit':... |
import os, sys
filepath = sys.argv[1]
idx = filepath.split('/')[-1].split('.')[0]
os.mkdir(idx)
split_num = 0
fout = open(idx + "/" + str(split_num) + ".jsonl", 'w+')
fp = open(filepath)
line = fp.readline()
i = 1
while len(line) > 0:
fout.write(line)
if i % 50000 == 0:
split_num += 1
fout =... | [
"os.mkdir"
] | [((83, 96), 'os.mkdir', 'os.mkdir', (['idx'], {}), '(idx)\n', (91, 96), False, 'import os, sys\n')] |
'''
Modelo de prueba para la red neuronal de regresión para el dataset de Boston.
'''
import pickle
from sklearn.metrics import mean_squared_error, mean_absolute_error
import numpy as np
# leer datos de prueba
x_test = np.loadtxt('xbostonTest.csv', delimiter=',')
y_test = np.loadtxt('ybostonTest.csv')
# cargar red ... | [
"sklearn.metrics.mean_squared_error",
"pickle.load",
"numpy.sqrt",
"numpy.var",
"numpy.loadtxt",
"sklearn.metrics.mean_absolute_error"
] | [((222, 266), 'numpy.loadtxt', 'np.loadtxt', (['"""xbostonTest.csv"""'], {'delimiter': '""","""'}), "('xbostonTest.csv', delimiter=',')\n", (232, 266), True, 'import numpy as np\n'), ((276, 305), 'numpy.loadtxt', 'np.loadtxt', (['"""ybostonTest.csv"""'], {}), "('ybostonTest.csv')\n", (286, 305), True, 'import numpy as ... |
from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..models.attach_decorator_data_json import AttachDecoratorDataJson
from ..models.attach_decorator_data_jws import AttachDecoratorDataJWS
from ..types import UNSET, Unset
T = TypeVar("T", bound="AttachDecoratorData")
@attr.s(auto_attrib... | [
"attr.s",
"attr.ib",
"typing.TypeVar"
] | [((257, 298), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""AttachDecoratorData"""'}), "('T', bound='AttachDecoratorData')\n", (264, 298), False, 'from typing import Any, Dict, List, Type, TypeVar, Union, cast\n'), ((302, 327), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)'}), '(auto_attribs=True)\n', (3... |
import collections
class Solution:
def maxWeight(self, edges: List[List[int]], weight: List[int]) -> int:
n = len(weight)
self.weight = weight
point_set = collections.defaultdict(set) # 记录和 i相连且编号大于i的所有点
for x,y in edges:
if x>y:
x,y = y,x
poin... | [
"collections.defaultdict"
] | [((183, 211), 'collections.defaultdict', 'collections.defaultdict', (['set'], {}), '(set)\n', (206, 211), False, 'import collections\n'), ((371, 400), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (394, 400), False, 'import collections\n'), ((446, 475), 'collections.defaultdict', 'co... |
import ray
from ray.serve.config import BackendConfig
def test_imported_backend(serve_instance):
client = serve_instance
config = BackendConfig(user_config="config", max_batch_size=2)
client.create_backend(
"imported",
"ray.serve.utils.MockImportedBackend",
"input_arg",
co... | [
"ray.serve.config.BackendConfig"
] | [((141, 194), 'ray.serve.config.BackendConfig', 'BackendConfig', ([], {'user_config': '"""config"""', 'max_batch_size': '(2)'}), "(user_config='config', max_batch_size=2)\n", (154, 194), False, 'from ray.serve.config import BackendConfig\n'), ((645, 684), 'ray.serve.config.BackendConfig', 'BackendConfig', ([], {'user_c... |
# RD DevWeb 03 de Setembro 2021
# Projeto de Agenda de Contatos
# OBJ academico. Praticar banco de dado MySQL junto a linguagem Python
import pymysql as psql
from time import sleep
from datetime import datetime as dt
# Meu pacotes
from BD import bd
from Class import my_class as mc
from Queries import queries
print('... | [
"BD.bd.conexao_bd",
"BD.bd.tabela_user",
"BD.bd.inserir_contato",
"Queries.queries.id_user",
"Class.my_class.Usuario",
"BD.bd.tabela_contatos",
"Queries.queries.config",
"time.sleep"
] | [((405, 415), 'time.sleep', 'sleep', (['(0.5)'], {}), '(0.5)\n', (410, 415), False, 'from time import sleep\n'), ((422, 437), 'BD.bd.conexao_bd', 'bd.conexao_bd', ([], {}), '()\n', (435, 437), False, 'from BD import bd\n'), ((438, 448), 'time.sleep', 'sleep', (['(0.5)'], {}), '(0.5)\n', (443, 448), False, 'from time im... |
import random
from nltk import word_tokenize
from collections import Counter
from operator import itemgetter
def dot(dictA, dictB):
# listA = list(dictA.values()) # Lukas: Transformation in Liste wird nicht benötigt
# listB = list(dictB.values())
# dotproduct = sum([x * y for (x,y) in zip(listA, listB)]... | [
"random.shuffle",
"collections.Counter",
"nltk.word_tokenize"
] | [((3583, 3592), 'collections.Counter', 'Counter', ([], {}), '()\n', (3590, 3592), False, 'from collections import Counter\n'), ((6895, 6929), 'random.shuffle', 'random.shuffle', (['self.instance_list'], {}), '(self.instance_list)\n', (6909, 6929), False, 'import random\n'), ((1197, 1216), 'nltk.word_tokenize', 'word_to... |
#!/usr/bin/env python3
import sys
import os
from logging import error
try:
import sqlitedict
except ImportError:
error('failed to import sqlitedict; try `pip3 install sqlitedict`')
raise
DEFAULT_INTERVAL = 10**6
DEFAULT_MAXERR = 100
def argparser():
from argparse import ArgumentParser
ap = A... | [
"logging.error",
"argparse.ArgumentParser",
"sqlitedict.SqliteDict"
] | [((319, 335), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (333, 335), False, 'from argparse import ArgumentParser\n'), ((124, 191), 'logging.error', 'error', (['"""failed to import sqlitedict; try `pip3 install sqlitedict`"""'], {}), "('failed to import sqlitedict; try `pip3 install sqlitedict`')\n",... |
"""
This module provides a Splunk search command that performs a web-ping.
"""
import os
import sys
from website_monitoring_app.search_command import SearchCommand
from web_ping import WebPing
path_to_mod_input_lib = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'modular_input.zip')
sys.path.insert(0, path... | [
"website_monitoring_app.search_command.SearchCommand.__init__",
"web_ping.WebPing.ping",
"os.path.abspath",
"sys.path.insert",
"modular_input.URLField"
] | [((297, 338), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path_to_mod_input_lib'], {}), '(0, path_to_mod_input_lib)\n', (312, 338), False, 'import sys\n'), ((248, 273), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (263, 273), False, 'import os\n'), ((595, 688), 'website_monitoring_app.s... |
import os, time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class Search:
def search_field(self, context):
WebDriverWait(context.browser, 30).until(EC.pre... | [
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"selenium.webdriver.support.ui.WebDriverWait"
] | [((314, 379), 'selenium.webdriver.support.expected_conditions.presence_of_element_located', 'EC.presence_of_element_located', (['(By.XPATH, "//*[@id=\'UserName\']")'], {}), '((By.XPATH, "//*[@id=\'UserName\']"))\n', (344, 379), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((545, 610), 's... |
import tqdm
import os
import urllib.request
from urllib.error import HTTPError
import xarray as xr
import numpy as np
import pandas as pd
from fire import Fire
from gribapi.errors import PrematureEndOfFileError
import pdb
import signal
class TimeoutException(Exception):
pass
def handler(signum, frame):
print(... | [
"xarray.open_dataset",
"fire.Fire",
"signal.signal",
"os.remove",
"os.path.exists",
"signal.alarm",
"numpy.array",
"numpy.arange",
"numpy.timedelta64",
"os.makedirs",
"tqdm.tqdm"
] | [((801, 848), 'numpy.arange', 'np.arange', (['(6)', '(48 + 6)', '(6)'], {'dtype': '"""timedelta64[h]"""'}), "(6, 48 + 6, 6, dtype='timedelta64[h]')\n", (810, 848), True, 'import numpy as np\n'), ((5094, 5104), 'fire.Fire', 'Fire', (['main'], {}), '(main)\n', (5098, 5104), False, 'from fire import Fire\n'), ((1177, 1198... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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 a... | [
"itertools.count"
] | [((7586, 7604), 'itertools.count', 'itertools.count', (['(0)'], {}), '(0)\n', (7601, 7604), False, 'import itertools\n')] |
"""Extensions to the 'distutils' for large or complex distributions"""
import os
import sys
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
import setuptools.version
from setuptools.extension import ... | [
"setuptools.compat.filterfalse",
"os.walk",
"distutils.core.Command.__init__",
"os.path.join",
"distutils.core.Command.reinitialize_command",
"distutils.util.convert_path",
"fnmatch.fnmatchcase",
"setuptools.dist._get_unpatched",
"os.environ.get"
] | [((3868, 3892), 'setuptools.dist._get_unpatched', '_get_unpatched', (['_Command'], {}), '(_Command)\n', (3882, 3892), False, 'from setuptools.dist import Distribution, Feature, _get_unpatched\n'), ((4693, 4705), 'os.walk', 'os.walk', (['dir'], {}), '(dir)\n', (4700, 4705), False, 'import os\n'), ((2130, 2156), 'setupto... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import (Brand,
Category,
Merchandise,
Inventory)
@admin.register(Brand)
class BrandAdmin(admin.ModelAdmin):
list_display = ('brand', 'in_st... | [
"django.contrib.admin.register"
] | [((227, 248), 'django.contrib.admin.register', 'admin.register', (['Brand'], {}), '(Brand)\n', (241, 248), False, 'from django.contrib import admin\n'), ((496, 520), 'django.contrib.admin.register', 'admin.register', (['Category'], {}), '(Category)\n', (510, 520), False, 'from django.contrib import admin\n'), ((774, 80... |
import MeshSync as ms
ctx = ms.Context()
mesh1 = ctx.addMesh("/pmsMesh")
mesh1.addVertex([0.0, 0.0, 0.0])
mesh1.addVertex([0.0, 0.0, 1.0])
mesh1.addVertex([1.0, 0.0, 1.0])
mesh1.addVertex([1.0, 0.0, 0.0])
mesh1.addUV([0.0, 0.0])
mesh1.addUV([0.0, 1.0])
mesh1.addUV([1.0, 1.0])
mesh1.addUV([1.0, 0.0])
mesh1.addCount... | [
"MeshSync.Context"
] | [((30, 42), 'MeshSync.Context', 'ms.Context', ([], {}), '()\n', (40, 42), True, 'import MeshSync as ms\n')] |
import logging
from decimal import Decimal as D
from zazi.core import json
from zazi.apps.loan.enums import PaymentPlatform, LoanTransactionType
from zazi.core import queue
#--------------
logger = logging.getLogger(__name__)
#--------------
def notify_successful_loan_disbursal_transaction(
loan_account,
... | [
"zazi.core.json.dumps",
"logging.getLogger"
] | [((203, 230), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (220, 230), False, 'import logging\n'), ((850, 1142), 'zazi.core.json.dumps', 'json.dumps', (["{'loan_account_id': loan_account.account_id, 'transaction': {\n 'transaction_type': LoanTransactionType.LOAN_DISBURSAL, 'amount':\... |
# Copyright (C) 2015-2021 by Vd.
# This file is part of Rocketgram, the modern Telegram bot framework.
# Rocketgram is released under the MIT License (see LICENSE).
from dataclasses import dataclass
@dataclass(frozen=True)
class InputMedia:
"""\
Represents InputMedia object:
https://core.telegram.org/bo... | [
"dataclasses.dataclass"
] | [((204, 226), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (213, 226), False, 'from dataclasses import dataclass\n')] |
"""
date: 2019/12/01
author: <EMAIL>
des: implements Deep Brief Network adopted in multi-modal feature fusion
"""
# -*- coding: utf-8 -*-
import torch
import sys
from torch.nn.parameter import Parameter
from torch.nn import functional as F
import torch.nn as nn
from torch.nn import init
import os
sys.path.append('..'... | [
"torch.device",
"torch.nn.init.constant_",
"sys.stdout.write",
"torch.nn.functional.sigmoid",
"torch.abs",
"torch.nn.Module.__init__",
"torch.nn.functional.linear",
"torch.no_grad",
"os.path.exists",
"sys.stdout.flush",
"sys.path.append",
"os.makedirs",
"torch.mean"
] | [((300, 321), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (315, 321), False, 'import sys\n'), ((799, 818), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (811, 818), False, 'import torch\n'), ((1013, 1039), 'torch.nn.init.constant_', 'init.constant_', (['self.bv', '(0)'], {}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.