code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# simple script for img capture # takes 1 arg: filename (.jpg) import sys from picamera import PiCamera from time import sleep # create instance camera = PiCamera() # Takes a string, ie. 'img.jpg' def capture(filename): # camera needs time to adjust brightness # this is the shortest delay sleep(0.15)...
[ "picamera.PiCamera", "time.sleep" ]
[((155, 165), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (163, 165), False, 'from picamera import PiCamera\n'), ((309, 320), 'time.sleep', 'sleep', (['(0.15)'], {}), '(0.15)\n', (314, 320), False, 'from time import sleep\n')]
from django.contrib.auth import get_user_model from rest_framework import serializers from knox.models import AuthToken User = get_user_model() username_field = User.USERNAME_FIELD if hasattr(User, 'USERNAME_FIELD') else 'username' class UserSerializer(serializers.ModelSerializer): class Meta: model = Us...
[ "django.contrib.auth.get_user_model" ]
[((127, 143), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (141, 143), False, 'from django.contrib.auth import get_user_model\n')]
from tensorflow import keras from pathlib import Path import numpy as np from training.image_adapter import ImageAdapter import cv2 from training.model.model_creator import define_composite_model class ModelSerializer: model_names = ['d_model_A', "d_model_B", "g_model_AtoB", "g_model_BtoA"] base_path = './tra...
[ "cv2.imwrite", "numpy.hstack", "training.image_adapter.ImageAdapter", "pathlib.Path", "tensorflow.keras.models.load_model", "training.model.model_creator.define_composite_model" ]
[((1214, 1328), 'training.model.model_creator.define_composite_model', 'define_composite_model', (["models['g_model_AtoB']", "models['d_model_B']", "models['g_model_BtoA']", 'self.image_shape'], {}), "(models['g_model_AtoB'], models['d_model_B'], models[\n 'g_model_BtoA'], self.image_shape)\n", (1236, 1328), False, ...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
[ "six.iteritems" ]
[((9179, 9208), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9188, 9208), False, 'from six import iteritems\n')]
import re text = input() pattern = r"(^|(?<=\s))-?\d+(\.\d+)?($|(?=\s))" matched_text = [el.group() for el in re.finditer(pattern, text)] print(*matched_text)
[ "re.finditer" ]
[((111, 137), 're.finditer', 're.finditer', (['pattern', 'text'], {}), '(pattern, text)\n', (122, 137), False, 'import re\n')]
# -*- coding: utf-8 -*- import struct import hexdump import uuid import os class RawStruct(object): """Helper class used as a parent class for most filesystem structures. Args: data (bytes): Byte array to initialize structure with. filename (str): A file to read the data from. offset...
[ "os.path.getsize", "struct.unpack", "hexdump.hexdump" ]
[((1270, 1295), 'os.path.getsize', 'os.path.getsize', (['filename'], {}), '(filename)\n', (1285, 1295), False, 'import os\n'), ((7434, 7461), 'hexdump.hexdump', 'hexdump.hexdump', (['self._data'], {}), '(self._data)\n', (7449, 7461), False, 'import hexdump\n'), ((3152, 3208), 'struct.unpack', 'struct.unpack', (['format...
import os train_percentage = 0.9 val_percentage = 0.1 rootPath = r'/home/jian/Documents/dataset/hand_detection/vocLabels' totalFile = open(os.path.join(rootPath, 'totalLabels.txt')) trainFile = open(os.path.join(rootPath, 'trainLabels.txt'), 'w+') evalFile = open(os.path.join(rootPath, 'evalLabels.txt'), 'w+') index ...
[ "os.path.join" ]
[((140, 181), 'os.path.join', 'os.path.join', (['rootPath', '"""totalLabels.txt"""'], {}), "(rootPath, 'totalLabels.txt')\n", (152, 181), False, 'import os\n'), ((200, 241), 'os.path.join', 'os.path.join', (['rootPath', '"""trainLabels.txt"""'], {}), "(rootPath, 'trainLabels.txt')\n", (212, 241), False, 'import os\n'),...
""" Description: Jobs Controller """ import logging import ast from datetime import datetime, date from django.utils import timezone from django.db.models import Q from core.general import settings from core.general.exceptions import SIDException class JobController(): """ Jobs Controller """ ...
[ "logging.debug", "datetime.datetime.today", "logging.error", "core.controller.logcontroller.LogController", "core.connectors.email.SIDEmail", "django.utils.timezone.now", "core.connectors.file.mapper.Mapper", "core.models.coreproxy.JobsProxy.objects.filter", "core.connectors.awss3.reader.Reader", ...
[((1220, 1260), 'core.services.sidsettings.SidSettingsService', 'SidSettingsService', ([], {'user_id': 'self.user_id'}), '(user_id=self.user_id)\n', (1238, 1260), False, 'from core.services.sidsettings import SidSettingsService\n'), ((1602, 1639), 'core.controller.cachecontroller.CacheController', 'CacheController', ([...
from app import __metadata__ as meta from configparser import ConfigParser, ExtendedInterpolation from pathlib import Path from shutil import copy import os import io import logging log = logging.getLogger(__name__) APP = meta.APP_NAME ''' This component is responsible for configuration management. If this is the fir...
[ "logging.getLogger", "configparser.ConfigParser", "pathlib.Path", "pathlib.Path.home", "os.environ.get", "os.environ.items", "os.path.dirname", "io.StringIO", "configparser.ExtendedInterpolation" ]
[((188, 215), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (205, 215), False, 'import logging\n'), ((746, 760), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (758, 760), False, 'from configparser import ConfigParser, ExtendedInterpolation\n'), ((1502, 1527), 'os.path.di...
""" _speech_transcriber.py Copyright 1999-present 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 applicab...
[ "json.loads", "json.dumps", "uuid.uuid4", "nls._core.NlsCore", "threading.Condition" ]
[((4691, 4712), 'threading.Condition', 'threading.Condition', ([], {}), '()\n', (4710, 4712), False, 'import threading\n'), ((9357, 9611), 'nls._core.NlsCore', 'NlsCore', ([], {'url': 'self.__url', 'akid': 'self.__akid', 'aksecret': 'self.__aksecret', 'token': 'self.__token', 'on_open': 'self.__tr_core_on_open', 'on_me...
# implementing RNN and LSTM # %% import pandas as pd import numpy as np import nltk import sklearn import matplotlib.pyplot as plt import re import tqdm twitter_df = pd.read_csv('twitter_train.csv') twitter_df = twitter_df.fillna('0') twitter_df_test = pd.read_csv('twitter_test.csv') twitter_df_test = twitter_df_tes...
[ "pandas.read_csv", "tensorflow.keras.preprocessing.sequence.pad_sequences", "re.compile", "matplotlib.pyplot.ylabel", "tensorflow.keras.callbacks.EarlyStopping", "tensorflow.keras.layers.Dense", "gensim.models.word2vec.Word2Vec", "nltk.TweetTokenizer", "nltk.corpus.stopwords.words", "tensorflow.ke...
[((168, 200), 'pandas.read_csv', 'pd.read_csv', (['"""twitter_train.csv"""'], {}), "('twitter_train.csv')\n", (179, 200), True, 'import pandas as pd\n'), ((256, 287), 'pandas.read_csv', 'pd.read_csv', (['"""twitter_test.csv"""'], {}), "('twitter_test.csv')\n", (267, 287), True, 'import pandas as pd\n'), ((1030, 1049), ...
import numpy as np import pandas as pd from itertools import islice import multiprocessing from multiprocessing.pool import ThreadPool, Pool N_CPUS = multiprocessing.cpu_count() def batch_generator(iterable, n=1): if hasattr(iterable, '__len__'): # https://stackoverflow.com/questions/8290397/how-to-split...
[ "itertools.islice", "multiprocessing.cpu_count", "numpy.array_split", "numpy.concatenate", "pandas.concat" ]
[((151, 178), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (176, 178), False, 'import multiprocessing\n'), ((1786, 1818), 'numpy.array_split', 'np.array_split', (['df', 'n_partitions'], {}), '(df, n_partitions)\n', (1800, 1818), True, 'import numpy as np\n'), ((1927, 1953), 'pandas.concat...
from __future__ import absolute_import, print_function, division import warnings import numpy as np import astropy.units as u __all__ = ["_get_x_in_wavenumbers", "_test_valid_x_range"] def _get_x_in_wavenumbers(in_x): """ Convert input x to wavenumber given x has units. Otherwise, assume x is in wavene...
[ "numpy.any", "astropy.units.spectral", "warnings.warn", "astropy.units.Quantity", "numpy.atleast_1d" ]
[((606, 625), 'numpy.atleast_1d', 'np.atleast_1d', (['in_x'], {}), '(in_x)\n', (619, 625), True, 'import numpy as np\n'), ((743, 829), 'warnings.warn', 'warnings.warn', (['"""x has no units, assuming x units are inverse microns"""', 'UserWarning'], {}), "('x has no units, assuming x units are inverse microns',\n Use...
import argparse import os import platform import subprocess import helpers.device_serial_id as device_id from helpers.custom_ci import custom_input, custom_print # Detect OS is_windows = False is_linux = False if platform.system() == 'Windows': is_windows = True if platform.system() == 'Linux': is_linux = Tru...
[ "subprocess.getoutput", "helpers.device_serial_id.init", "argparse.ArgumentParser", "helpers.custom_ci.custom_print", "datetime.datetime.now", "helpers.custom_ci.custom_input", "platform.system", "os.path.basename", "os.system" ]
[((215, 232), 'platform.system', 'platform.system', ([], {}), '()\n', (230, 232), False, 'import platform\n'), ((272, 289), 'platform.system', 'platform.system', ([], {}), '()\n', (287, 289), False, 'import platform\n'), ((343, 413), 'helpers.custom_ci.custom_print', 'custom_print', (['""">>> I am in restore_whatsapp.k...
#!/usr/bin/env python import rospy from flexbe_core import EventState, Logger class DaguInitialState(EventState): ''' Etat initial du Dagu. Il avance. -- detectedID int id de l'élément détecté. ># detectedIDInput int id de l'élément détecté. #> linkedState int...
[ "flexbe_core.Logger.loginfo" ]
[((1126, 1151), 'flexbe_core.Logger.loginfo', 'Logger.loginfo', (['"""DEFAULT"""'], {}), "('DEFAULT')\n", (1140, 1151), False, 'from flexbe_core import EventState, Logger\n'), ((1229, 1251), 'flexbe_core.Logger.loginfo', 'Logger.loginfo', (['"""STOP"""'], {}), "('STOP')\n", (1243, 1251), False, 'from flexbe_core import...
from pathlib import Path from unittest import TestCase from unittest.mock import patch, Mock from requests.exceptions import HTTPError from requests import Session from test.test_account import TestAccount from gphotos.LocalData import LocalData import test.test_setup as ts photos_root = Path("photos") original_get =...
[ "test.test_setup.SetupDbAndCredentials", "unittest.mock.Mock", "pathlib.Path", "gphotos.LocalData.LocalData", "unittest.mock.patch.object" ]
[((291, 305), 'pathlib.Path', 'Path', (['"""photos"""'], {}), "('photos')\n", (295, 305), False, 'from pathlib import Path\n'), ((718, 759), 'unittest.mock.patch.object', 'patch.object', (['Session', '"""get"""', 'patched_get'], {}), "(Session, 'get', patched_get)\n", (730, 759), False, 'from unittest.mock import patch...
#! /usr/bin/python """ Provides the Gen class, along with functions for iterating over output linearizations given a particular tree input. """ from itertools import permutations def gen_strings(tree, null_phon = {}, spaces = False): null_phon = {t.lower() for t in null_phon} terminals = {t.label[0].lower() f...
[ "itertools.permutations" ]
[((415, 438), 'itertools.permutations', 'permutations', (['terminals'], {}), '(terminals)\n', (427, 438), False, 'from itertools import permutations\n')]
# -*- coding: utf-8 -*- # # Dell EMC OpenManage Ansible Modules # Version 2.1.3 # Copyright (C) 2019-2020 Dell Inc. or its subsidiaries. All Rights Reserved. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # from __future__ import (absolute_import, division, print_functio...
[ "pytest.mark.parametrize", "io.StringIO", "json.dumps", "pytest.raises" ]
[((1460, 1510), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""sub_param"""', '[sub_param1]'], {}), "('sub_param', [sub_param1])\n", (1483, 1510), False, 'import pytest\n'), ((2723, 2817), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""sub_param"""', "[{'in': in1, 'out': out1}, {'in': in2, 'ou...
# coding=utf-8 # Filename: h5tree.py """ Print the HDF5 file structure. Usage: h5tree FILE h5tree (-h | --help) h5tree --version Options: FILE Input file. -h --help Show this screen. """ from __future__ import division, absolute_import, print_function import tables from km3pipe.tools imp...
[ "km3pipe.tools.deprecated", "tables.open_file", "docopt.docopt" ]
[((602, 617), 'km3pipe.tools.deprecated', 'deprecated', (['MSG'], {}), '(MSG)\n', (612, 617), False, 'from km3pipe.tools import deprecated\n'), ((800, 815), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (806, 815), False, 'from docopt import docopt\n'), ((647, 671), 'tables.open_file', 'tables.open_file'...
""" Specific Models =============== """ ########################################## # Introduction # ^^^^^^^^^^^^ # From the algorithm preseneted in “`ABESS algorithm: details <https://abess.readthedocs.io/en/latest/auto_gallery/1-glm/plot_a2_abess_algorithm_details.html>`__”, # one of the bottleneck in algorithm is th...
[ "abess.linear.LogisticRegression", "abess.datasets.make_glm_data", "numpy.random.seed", "numpy.nonzero", "abess.linear.LinearRegression", "time.time" ]
[((2194, 2211), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (2208, 2211), True, 'import numpy as np\n'), ((2219, 2273), 'abess.datasets.make_glm_data', 'make_glm_data', ([], {'n': '(10000)', 'p': '(100)', 'k': '(10)', 'family': '"""gaussian"""'}), "(n=10000, p=100, k=10, family='gaussian')\n", (2232,...
from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.urls import reverse import django.utils.timezone as timezone from mptt.models import MPTTModel, TreeForeignKey from users.models import CustomUser class Bubble(models.Model): id = models.AutoFi...
[ "django.contrib.auth.get_user_model", "django.db.models.TextField", "django.db.models.ForeignKey", "mptt.models.TreeForeignKey", "django.db.models.AutoField", "django.db.models.SmallIntegerField", "django.urls.reverse", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((307, 341), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (323, 341), False, 'from django.db import models\n'), ((354, 386), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (370, 386), False, 'from djan...
#!usr/bin/python # -*- coding:utf8 -*- # 合并pdf import os from PyPDF2 import PdfFileReader, PdfFileWriter work_path = 'C:/Users/Clarence/Desktop/PythonPractice/utils/pdf/mergepdf/' # 合并同一文件夹下的pdf文件 flst = [] # 获得pdf文件路径 for root, dirs, files in os.walk(work_path): flst = files flst = [work_path + f for f in flst...
[ "PyPDF2.PdfFileWriter", "os.walk" ]
[((248, 266), 'os.walk', 'os.walk', (['work_path'], {}), '(work_path)\n', (255, 266), False, 'import os\n'), ((332, 347), 'PyPDF2.PdfFileWriter', 'PdfFileWriter', ([], {}), '()\n', (345, 347), False, 'from PyPDF2 import PdfFileReader, PdfFileWriter\n'), ((746, 764), 'os.walk', 'os.walk', (['work_path'], {}), '(work_pat...
""" Chat views module """ import json from django.shortcuts import render, redirect, HttpResponseRedirect, HttpResponse, get_object_or_404 from django.http import Http404 from django.utils.safestring import mark_safe from django.core.files.base import ContentFile from django.forms import modelformset_factory from in...
[ "django.shortcuts.render", "django.forms.modelformset_factory", "django.shortcuts.HttpResponse", "django.shortcuts.get_object_or_404", "json.dumps", "index.forms.CropAvatarForm", "django.shortcuts.redirect", "django.http.Http404" ]
[((2587, 2596), 'django.http.Http404', 'Http404', ([], {}), '()\n', (2594, 2596), False, 'from django.http import Http404\n'), ((3069, 3078), 'django.http.Http404', 'Http404', ([], {}), '()\n', (3076, 3078), False, 'from django.http import Http404\n'), ((3624, 3633), 'django.http.Http404', 'Http404', ([], {}), '()\n', ...
#!/usr/bin/env python2 #*************************************************************************** # # Copyright (c) 2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: #...
[ "mavros_test_common_uav0.MavrosTestCommon", "rospy.init_node", "gazebo_msgs.msg.ModelStates", "numpy.array", "rospy.Rate", "numpy.linalg.norm", "subprocess.Popen", "geometry_msgs.msg.Quaternion", "os.system", "rospy.Subscriber", "mavros_test_common_uav1.MavrosTestCommon", "math.radians", "ro...
[((13152, 13196), 'rospy.init_node', 'rospy.init_node', (['"""test_node"""'], {'anonymous': '(True)'}), "('test_node', anonymous=True)\n", (13167, 13196), False, 'import rospy\n'), ((2850, 2863), 'geometry_msgs.msg.PoseStamped', 'PoseStamped', ([], {}), '()\n', (2861, 2863), False, 'from geometry_msgs.msg import PoseSt...
# Copyright 2020 <NAME>, University of Pittsburgh # # 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...
[ "tensorflow.unstack", "numpy.minimum", "numpy.squeeze", "numpy.stack", "numpy.split", "tensorflow.maximum", "numpy.maximum", "tensorflow.minimum", "tensorflow.stack" ]
[((1133, 1157), 'tensorflow.unstack', 'tf.unstack', (['box'], {'axis': '(-1)'}), '(box, axis=-1)\n', (1143, 1157), True, 'import tensorflow as tf\n'), ((1167, 1222), 'tensorflow.stack', 'tf.stack', (['[ymin, 1.0 - xmax, ymax, 1.0 - xmin]'], {'axis': '(-1)'}), '([ymin, 1.0 - xmax, ymax, 1.0 - xmin], axis=-1)\n', (1175, ...
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import c3.experiment import c3.optimizers.c1 import c3.libraries.fidelities as fid import os from c3.optimizers.c1 import C1 import c3.libraries.algorithms as algorithms import c3.libraries.fidelities as fidelities import examples.single_qubit_b...
[ "os.path.join", "c3.optimizers.c1.C1", "numpy.append", "numpy.linspace", "c3.libraries.fidelities.unitary_infid", "numpy.cos", "numpy.sin", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend" ]
[((1389, 1407), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (1401, 1407), True, 'import matplotlib.pyplot as plt\n'), ((1468, 1521), 'numpy.linspace', 'np.linspace', (['(0.0)', '(dt * pop_t.shape[1])', 'pop_t.shape[1]'], {}), '(0.0, dt * pop_t.shape[1], pop_t.shape[1])\n', (1479, 152...
# -*- coding: UTF-8 -*- import os, sys try: import ConfigParser except ImportError: import configparser as ConfigParser import filecmp import random import shutil import tempfile import time import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import win32com.c...
[ "active_directory.Path", "random.choice", "win32net.NetGetDCName", "configparser.ConfigParser", "active_directory.find_computer", "active_directory.search_ex", "active_directory.find_user", "active_directory.AD", "active_directory.search", "active_directory.find", "unittest.main", "active_dire...
[((374, 401), 'configparser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (399, 401), True, 'import configparser as ConfigParser\n'), ((8216, 8231), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8229, 8231), False, 'import unittest\n'), ((1768, 1805), 'active_directory.AD_object', 'active_directo...
from tkinter import * from PIL import Image, ImageTk window = Tk() window.maxsize(800,550) #window.minsize(750,500) mpage = Canvas(window,width=780,height=300, ) mpage.grid(columnspan=3) # logo logo = Image.open('kuku_logo.png') logo = logo.resize((300,250)) logo = ImageTk.PhotoImage(logo) logo_label = L...
[ "PIL.Image.open", "PIL.ImageTk.PhotoImage" ]
[((213, 240), 'PIL.Image.open', 'Image.open', (['"""kuku_logo.png"""'], {}), "('kuku_logo.png')\n", (223, 240), False, 'from PIL import Image, ImageTk\n'), ((280, 304), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['logo'], {}), '(logo)\n', (298, 304), False, 'from PIL import Image, ImageTk\n')]
from duckql.functions.string_agg import StringAgg from duckql.properties.property import Property from duckql.structures.cast_operator import CastOperator def test_simple(): my_function = StringAgg( property=Property(name='transactions.amount'), separator=', ', alias='amounts' ) a...
[ "duckql.properties.property.Property" ]
[((222, 258), 'duckql.properties.property.Property', 'Property', ([], {'name': '"""transactions.amount"""'}), "(name='transactions.amount')\n", (230, 258), False, 'from duckql.properties.property import Property\n'), ((501, 537), 'duckql.properties.property.Property', 'Property', ([], {'name': '"""transactions.amount""...
# -*- coding: utf-8 -*- """ Created on Sun Jul 26 00:32:31 2020 @author: <NAME> based on code by <NAME> """ import numpy as np from sklearn.cross_decomposition import PLSRegression # OSC # nicomp is the number of internal components, ncomp is the number of # components to remove (ncomp=1 recommended) class OSC: ...
[ "numpy.identity", "numpy.mean", "numpy.sum", "numpy.zeros", "numpy.linalg.norm", "numpy.linalg.svd", "sklearn.cross_decomposition.PLSRegression" ]
[((1299, 1333), 'numpy.zeros', 'np.zeros', (['(X.shape[1], self.ncomp)'], {}), '((X.shape[1], self.ncomp))\n', (1307, 1333), True, 'import numpy as np\n'), ((1349, 1383), 'numpy.zeros', 'np.zeros', (['(X.shape[1], self.ncomp)'], {}), '((X.shape[1], self.ncomp))\n', (1357, 1383), True, 'import numpy as np\n'), ((1447, 1...
# 5 import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from keras.layers import Dropout import numpy as np # sinusoidal position encoding def get_3d_sincos_pos_embed(embed_dim, grid_size, cls_token=False): grid_h = np.arange(grid_size) grid_w = np.arange(grid_size) gri...
[ "tensorflow.keras.layers.Conv3D", "tensorflow.meshgrid", "tensorflow.transpose", "tensorflow.keras.layers.GlobalAvgPool1D", "tensorflow.keras.layers.Dense", "numpy.einsum", "numpy.sin", "tensorflow.cast", "numpy.arange", "numpy.reshape", "tensorflow.keras.layers.MultiHeadAttention", "numpy.con...
[((258, 278), 'numpy.arange', 'np.arange', (['grid_size'], {}), '(grid_size)\n', (267, 278), True, 'import numpy as np\n'), ((292, 312), 'numpy.arange', 'np.arange', (['grid_size'], {}), '(grid_size)\n', (301, 312), True, 'import numpy as np\n'), ((326, 346), 'numpy.arange', 'np.arange', (['grid_size'], {}), '(grid_siz...
# -*- coding: utf-8 -*- """ Created on Mon Jan 3 10:45:39 2022 @author: dgbli """ import numpy as np import matplotlib.pyplot as plt def return_true(n): x = [] for i in range(n): if i%2==0: x.append(i) x.append(i+1) else: x.append(None) ...
[ "numpy.random.rand", "matplotlib.pyplot.subplots" ]
[((914, 928), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (926, 928), True, 'import matplotlib.pyplot as plt\n'), ((2072, 2090), 'numpy.random.rand', 'np.random.rand', (['(25)'], {}), '(25)\n', (2086, 2090), True, 'import numpy as np\n'), ((2106, 2124), 'numpy.random.rand', 'np.random.rand', (['(25)...
from secml.optim.optimizers.tests import COptimizerTestCases from secml.array import CArray from secml.optim.optimizers import COptimizerPGDLS from secml.optim.constraints import CConstraintBox, CConstraintL1 class TestCOptimizerPGDLSDiscrete(COptimizerTestCases): """Unittests for COptimizerPGDLS in discrete spa...
[ "secml.optim.optimizers.tests.COptimizerTestCases.main", "secml.optim.constraints.CConstraintBox", "secml.optim.constraints.CConstraintL1", "secml.array.CArray" ]
[((7426, 7452), 'secml.optim.optimizers.tests.COptimizerTestCases.main', 'COptimizerTestCases.main', ([], {}), '()\n', (7450, 7452), False, 'from secml.optim.optimizers.tests import COptimizerTestCases\n'), ((726, 753), 'secml.optim.constraints.CConstraintBox', 'CConstraintBox', ([], {'lb': '(-1)', 'ub': '(1)'}), '(lb=...
from rethinkdb import r from rethinkdb.errors import RqlRuntimeError from tests.common import as_db_and_table from tests.common import assertEqual from tests.common import assertEqUnordered from tests.functional.common import MockTest from rethinkdb_mock import util class TestGet(MockTest): @staticmethod def...
[ "rethinkdb_mock.util.cat", "rethinkdb.r.json", "tests.common.as_db_and_table", "rethinkdb.r.db", "rethinkdb.r.row.merge", "tests.common.assertEqUnordered", "tests.common.assertEqual", "rethinkdb.r.error" ]
[((464, 500), 'tests.common.as_db_and_table', 'as_db_and_table', (['"""x"""', '"""people"""', 'data'], {}), "('x', 'people', data)\n", (479, 500), False, 'from tests.common import as_db_and_table\n'), ((617, 669), 'tests.common.assertEqual', 'assertEqual', (["{'id': 'bob-id', 'name': 'bob'}", 'result'], {}), "({'id': '...
import numpy as np from skimage import feature from sklearn import preprocessing class LBP: def __init__(self, p, r): self.p = p self.r = r def getVecLength(self): return 2**self.p def getFeature(self, imgMat): feat = feature.local_binary_pattern( ...
[ "numpy.append", "numpy.array", "sklearn.preprocessing.normalize", "skimage.feature.hog", "numpy.load", "numpy.float32", "numpy.save", "skimage.feature.local_binary_pattern" ]
[((2895, 2930), 'numpy.append', 'np.append', (['featHog', 'featLbp'], {'axis': '(1)'}), '(featHog, featLbp, axis=1)\n', (2904, 2930), True, 'import numpy as np\n'), ((280, 350), 'skimage.feature.local_binary_pattern', 'feature.local_binary_pattern', (['imgMat', 'self.p', 'self.r'], {'method': '"""uniform"""'}), "(imgMa...
#-*- coding: utf-8 -*- # <EMAIL> r"""针对TubeLink做一些仿真验证。 """ gl_bcnDuration = 8000 # 信标周期的长度 gl_packedAckDelay = 2 # 延迟查收ack的信标周期间隔数量 gl_evtCollisionDelay = 3 # 冲突之后的上行事件消息在 [1, gl_evtCollisionDelay] 个信标周期后再次发送 gl_emergCollisionDelay = 2 gl_totalSlots = 128 # 一个信标周期里所有的时间槽数量 gl_slotDuration = gl...
[ "simple_logger.get_logger", "random.randint" ]
[((1207, 1219), 'simple_logger.get_logger', 'get_logger', ([], {}), '()\n', (1217, 1219), False, 'from simple_logger import get_logger\n'), ((6423, 6450), 'random.randint', 'randint', (['(0)', 'gl_nodeInitSpan'], {}), '(0, gl_nodeInitSpan)\n', (6430, 6450), False, 'from random import randint\n'), ((9558, 9585), 'random...
import sys import os from platform import python_version # https://github.com/willmcgugan/rich from rich.console import Console from rich.theme import Theme import pydbhub.dbhub as dbhub if __name__ == '__main__': custom_theme = Theme({ "info": "green", "warning": "yellow", "error": "bold...
[ "rich.theme.Theme", "rich.console.Console", "os.path.dirname", "sys.exit", "platform.python_version" ]
[((236, 302), 'rich.theme.Theme', 'Theme', (["{'info': 'green', 'warning': 'yellow', 'error': 'bold red'}"], {}), "({'info': 'green', 'warning': 'yellow', 'error': 'bold red'})\n", (241, 302), False, 'from rich.theme import Theme\n'), ((347, 374), 'rich.console.Console', 'Console', ([], {'theme': 'custom_theme'}), '(th...
import pytest from practice_atcoder.book_algorithm_solution.chapter5.frog1 import question # AtCoder Educational DP Contest A - Frog1. class Test(object): @pytest.mark.parametrize("n,hn,expect", [ ("4", "10 30 40 20", "30"), ("2", "10 10", "0"), ("6", "30 10 60 10 60 50", "40") ]) ...
[ "pytest.mark.parametrize", "practice_atcoder.book_algorithm_solution.chapter5.frog1.question" ]
[((163, 290), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n,hn,expect"""', "[('4', '10 30 40 20', '30'), ('2', '10 10', '0'), ('6', '30 10 60 10 60 50',\n '40')]"], {}), "('n,hn,expect', [('4', '10 30 40 20', '30'), ('2',\n '10 10', '0'), ('6', '30 10 60 10 60 50', '40')])\n", (186, 290), False, '...
from django import forms class LoginForm(forms.Form): username = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'})) password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control'}))
[ "django.forms.PasswordInput", "django.forms.TextInput" ]
[((94, 142), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'class': 'form-control'}"}), "(attrs={'class': 'form-control'})\n", (109, 142), False, 'from django import forms\n'), ((182, 234), 'django.forms.PasswordInput', 'forms.PasswordInput', ([], {'attrs': "{'class': 'form-control'}"}), "(attrs={'class...
import sys from PyQt5 import uic, QtCore from PyQt5.QtCore import Qt, QObject, pyqtSignal from PyQt5.QtWidgets import (QWidget, QApplication, QGridLayout, QMainWindow, QTableWidgetItem, QLabel, QPushButton, QLineEdit, QSpinBox, QMessageBox) import AutomatonGenerator class MW(QMainWindow, AutomatonGen...
[ "PyQt5.QtWidgets.QApplication" ]
[((3405, 3427), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (3417, 3427), False, 'from PyQt5.QtWidgets import QWidget, QApplication, QGridLayout, QMainWindow, QTableWidgetItem, QLabel, QPushButton, QLineEdit, QSpinBox, QMessageBox\n')]
"""Lambda function to copy a binary from CarbonBlack into the BiAlert input S3 bucket.""" # Expects the following environment variables: # CARBON_BLACK_URL: URL of the CarbonBlack server. # ENCRYPTED_CARBON_BLACK_API_TOKEN: API token, encrypted with KMS. # TARGET_S3_BUCKET: Name of the S3 bucket in which to save ...
[ "logging.getLogger", "json.loads", "logging.StreamHandler", "boto3.client", "base64.b64decode", "boto3.resource" ]
[((640, 659), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (657, 659), False, 'import logging\n'), ((1218, 1244), 'boto3.client', 'boto3.client', (['"""cloudwatch"""'], {}), "('cloudwatch')\n", (1230, 1244), False, 'import boto3\n'), ((730, 753), 'logging.StreamHandler', 'logging.StreamHandler', ([], {})...
from db import db class ProductoModel(db.Model): __tablename__="t_producto" id=db.Column("prod_id",db.Integer,primary_key=True) desc=db.Column("prod_des",db.String(50)) # Se crea la realcion de uno a muchos cat_id = db.Column(db.Integer, db.ForeignKey('t_categoria.cat_id'), nullable=False)...
[ "db.db.session.commit", "db.db.relationship", "db.db.ForeignKey", "db.db.Column", "db.db.String", "db.db.session.add" ]
[((88, 138), 'db.db.Column', 'db.Column', (['"""prod_id"""', 'db.Integer'], {'primary_key': '(True)'}), "('prod_id', db.Integer, primary_key=True)\n", (97, 138), False, 'from db import db\n'), ((337, 370), 'db.db.relationship', 'db.relationship', (['"""CategoriaModel"""'], {}), "('CategoriaModel')\n", (352, 370), False...
from typing import List from uuid import UUID from fastapi import APIRouter, Depends, HTTPException, Response, status from app.api.dependencies import get_api_key, get_db from app.db.database import MSSQLConnection from app.schemas.security import SecurityLoginResponse, SecurityResponseBase from app.services.exceptio...
[ "fastapi.HTTPException", "fastapi.APIRouter", "app.services.security.SecurityService", "fastapi.Depends" ]
[((461, 472), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (470, 472), False, 'from fastapi import APIRouter, Depends, HTTPException, Response, status\n'), ((833, 848), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (840, 848), False, 'from fastapi import APIRouter, Depends, HTTPException, Respons...
#!/usr/bin/env """ Read in two extracted light curves (interest band and reference band), split into segments, compute the power spectra per band and cross spectrum of each segment, averages cross spectrum of all the segments, and computes frequency lags between the two bands. Example call: python simple_cross_spectra...
[ "numpy.sqrt", "astropy.table.Table", "scipy.fftpack.fftfreq", "numpy.arctan2", "scipy.fftpack.fft", "astropy.io.fits.open", "numpy.int8", "numpy.mean", "argparse.ArgumentParser", "numpy.where", "numpy.subtract", "numpy.real", "subprocess.call", "numpy.abs", "numpy.conj", "argparse.Argu...
[((1664, 1699), 'argparse.ArgumentTypeError', 'argparse.ArgumentTypeError', (['message'], {}), '(message)\n', (1690, 1699), False, 'import argparse\n'), ((2358, 2370), 'numpy.int8', 'np.int8', (['ext'], {}), '(ext)\n', (2365, 2370), True, 'import numpy as np\n'), ((4602, 4628), 'numpy.sum', 'np.sum', (['(power * df)'],...
import unittest from contextlib import contextmanager from numba import njit from numba.core import errors, cpu, utils, typing from numba.core.descriptors import TargetDescriptor from numba.core.dispatcher import TargetConfigurationStack from numba.core.retarget import BasicRetarget from numba.core.extending import ov...
[ "numba.core.cpu.CPUContext", "numba.core.extending.overload", "numba.core.dispatcher.TargetConfigurationStack.switch_target", "numba.core.typing.Context", "numba.njit" ]
[((2907, 2951), 'numba.njit', 'njit', (['*args'], {'_target': 'CUSTOM_TARGET'}), '(*args, _target=CUSTOM_TARGET, **kwargs)\n', (2911, 2951), False, 'from numba import njit\n'), ((1481, 1535), 'numba.core.cpu.CPUContext', 'cpu.CPUContext', (['self.typing_context', 'self._target_name'], {}), '(self.typing_context, self._...
from shutil import copy2 from os import path, remove from random import randint import argparse class WorkspaceReader: def __init__(self, fname): self.maven_jars = [] self.java_libraries = [] module_name = 'tmp'+str(randint(1000,9999)) new_name = path.join(path.dirname(__file__), m...
[ "argparse.ArgumentParser", "shutil.copy2", "os.path.isfile", "os.path.dirname", "random.randint", "os.remove" ]
[((3437, 3537), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Merge generated bazel workspaces for maven dependencies."""'}), "(description=\n 'Merge generated bazel workspaces for maven dependencies.')\n", (3460, 3537), False, 'import argparse\n'), ((4171, 4200), 'os.path.isfile', '...
class Solution(object): def findMaxConsecutiveOnes(self, nums): """ :type nums: List[int] :rtype: int """ import itertools maxcount = 0 for bit, group in itertools.groupby(nums): if bit == 1: maxcount = max(maxcoun...
[ "itertools.groupby" ]
[((232, 255), 'itertools.groupby', 'itertools.groupby', (['nums'], {}), '(nums)\n', (249, 255), False, 'import itertools\n')]
import streamlit as st import numpy as np import pandas as pd from sklearn.datasets import load_iris from .generic import Tool iris = pd.DataFrame(load_iris()["data"]) df = pd.DataFrame( np.random.randn(50, 20), columns=('col %d' % i for i in range(20))) # st.dataframe(df) # Same as st.write(df) class Da...
[ "sklearn.datasets.load_iris", "streamlit.checkbox", "pandas.read_csv", "streamlit.write", "numpy.random.randn" ]
[((194, 217), 'numpy.random.randn', 'np.random.randn', (['(50)', '(20)'], {}), '(50, 20)\n', (209, 217), True, 'import numpy as np\n'), ((150, 161), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (159, 161), False, 'from sklearn.datasets import load_iris\n'), ((1000, 1034), 'streamlit.checkbox', 'st.check...
import gensim.models.keyedvectors as word2vec class Synonyms: def __init__(self, fasttext_model_path: str): print(f'Loading fasttext model: {fasttext_model_path}') self.model = word2vec.KeyedVectors.load_word2vec_format(fasttext_model_path) print(f'Finished loading fasttext model: {fasttex...
[ "gensim.models.keyedvectors.KeyedVectors.load_word2vec_format" ]
[((199, 262), 'gensim.models.keyedvectors.KeyedVectors.load_word2vec_format', 'word2vec.KeyedVectors.load_word2vec_format', (['fasttext_model_path'], {}), '(fasttext_model_path)\n', (241, 262), True, 'import gensim.models.keyedvectors as word2vec\n')]
''' Copyright 2017-present, Airbnb Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
[ "stream_alert.rule_processor.pre_parsers.StreamPreParsers.pre_parse_sns", "stream_alert.rule_processor.pre_parsers.StreamPreParsers.pre_parse_s3", "base64.b64encode", "stream_alert.rule_processor.pre_parsers.StreamPreParsers.read_s3_file", "stream_alert.rule_processor.pre_parsers.StreamPreParsers.pre_parse_...
[((742, 751), 'moto.mock_s3', 'mock_s3', ([], {}), '()\n', (749, 751), False, 'from moto import mock_s3\n'), ((926, 972), 'stream_alert.rule_processor.pre_parsers.StreamPreParsers.pre_parse_kinesis', 'StreamPreParsers.pre_parse_kinesis', (['raw_record'], {}), '(raw_record)\n', (960, 972), False, 'from stream_alert.rule...
# Copyright (c) FlowTorch Development Team. All Rights Reserved # SPDX-License-Identifier: MIT from typing import Optional, Tuple import torch import torch.distributions.constraints as constraints import flowtorch import flowtorch.params from flowtorch.utils import clamp_preserve_gradients class AffineAutoregressi...
[ "flowtorch.params.DenseAutoregressive", "torch.exp", "flowtorch.utils.clamp_preserve_gradients", "torch.zeros_like", "torch.Size" ]
[((469, 507), 'flowtorch.params.DenseAutoregressive', 'flowtorch.params.DenseAutoregressive', ([], {}), '()\n', (505, 507), False, 'import flowtorch\n'), ((1313, 1403), 'flowtorch.utils.clamp_preserve_gradients', 'clamp_preserve_gradients', (['log_scale', 'self.log_scale_min_clip', 'self.log_scale_max_clip'], {}), '(lo...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'lp2ctrlui.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, Qt...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QMenu", "PyQt5.QtGui.QIcon", "PyQt5.QtGui.QFont", "PyQt5.QtWidgets.QPlainTextEdit", "PyQt5.QtWidgets.QToolBar", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtWidgets.QAction", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QGridLayout", "PyQt5.QtWidg...
[((499, 512), 'PyQt5.QtGui.QIcon', 'QtGui.QIcon', ([], {}), '()\n', (510, 512), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((680, 709), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (697, 709), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((800, 837), 'P...
#!/usr/bin/python3 """ 一些基础的类和函数 注意, import关系需要能够拓扑排序(不要相互调用). """ # 加载不应该被COPY的包 import io2 as io import deap from deap import algorithms, base, creator, gp, tools from prettytable import PrettyTable # COPY # import copy import random import warnings import sys import pdb import inspect import shu...
[ "numpy.hstack", "pandas.value_counts", "numpy.array", "numpy.nanmean", "numpy.mean", "numpy.full_like", "inspect.isclass", "scipy.stats.kurtosis", "numpy.ix_", "numpy.stack", "numpy.dot", "numpy.linalg.lstsq", "numpy.isinf", "deap.gp.PrimitiveTree", "prettytable.PrettyTable", "numpy.ab...
[((2907, 2932), 'numpy.full_like', 'np.full_like', (['arr', 'np.nan'], {}), '(arr, np.nan)\n', (2919, 2932), True, 'import numpy as np\n'), ((4449, 4473), 'numpy.stack', 'np.stack', (['ret'], {'axis': 'axis'}), '(ret, axis=axis)\n', (4457, 4473), True, 'import numpy as np\n'), ((4984, 5008), 'numpy.stack', 'np.stack', ...
"""Unit tests for reward factory. """ from datetime import datetime import unittest from parameterized import parameterized from stock_trading_backend.simulation import create_reward from stock_trading_backend.simulation.constant_reward import ConstantReward from stock_trading_backend.simulation.net_worth_ratio_rewa...
[ "datetime.datetime", "stock_trading_backend.simulation.create_reward", "parameterized.parameterized.expand" ]
[((524, 715), 'parameterized.parameterized.expand', 'parameterized.expand', (["[({'name': 'constant_reward'}, ConstantReward), ({'name':\n 'net_worth_ratio_reward'}, NetWorthRatioReward), ({'name':\n 'sharpe_ratio_reward'}, SharpeRatioReward)]"], {}), "([({'name': 'constant_reward'}, ConstantReward), ({\n 'nam...
import argparse from rename import RandomRename import logging def main(): parser = argparse.ArgumentParser(description='Randomly rename files') parser.add_argument('-e', '--ext', help='extension type(s) of file(s) that need renaming') parser.add_argument('-p ', '--pre', help='prefix to add to each filena...
[ "rename.RandomRename", "argparse.ArgumentParser" ]
[((90, 150), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Randomly rename files"""'}), "(description='Randomly rename files')\n", (113, 150), False, 'import argparse\n'), ((984, 1045), 'rename.RandomRename', 'RandomRename', (['paths'], {'prefixes': 'prefixes', 'extensions': 'extensions...
import joblib import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from sklearn.metrics import roc_auc_score from db import get_data random_seed = ...
[ "db.get_data", "sklearn.model_selection.train_test_split", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.roc_auc_score", "sklearn.linear_model.LogisticRegression", "pandas.DataFrame", "joblib.dump" ]
[((384, 403), 'db.get_data', 'get_data', (['"""WEEK_00"""'], {}), "('WEEK_00')\n", (392, 403), False, 'from db import get_data\n'), ((569, 617), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'random_state': 'random_seed'}), '(X, y, random_state=random_seed)\n', (585, 617), False, 'from s...
from typing import Optional, Union import numpy as np from scipy.spatial import cKDTree import bbknn from scipy.sparse import csr_matrix import scanpy as sc from numpy.testing import assert_array_equal, assert_array_compare import operator import numpy as np from anndata import AnnData from sklearn.utils import che...
[ "bbknn.trimming", "numpy.copy", "bbknn.query_tree", "numpy.shape", "numpy.unique", "bbknn.create_tree", "numpy.argsort", "numpy.testing.assert_array_compare", "scanpy.tl.umap", "scanpy.pl.umap", "scipy.sparse.csr_matrix", "numpy.arange", "bbknn.compute_connectivities_umap" ]
[((1148, 1169), 'numpy.unique', 'np.unique', (['batch_list'], {}), '(batch_list)\n', (1157, 1169), True, 'import numpy as np\n'), ((5800, 5833), 'numpy.argsort', 'np.argsort', (['knn_distances'], {'axis': '(1)'}), '(knn_distances, axis=1)\n', (5810, 5833), True, 'import numpy as np\n'), ((6100, 6288), 'bbknn.compute_co...
import scann from argparse import ArgumentParser from pl_bolts.models.self_supervised import SimCLR from pl_bolts.models.self_supervised.resnets import resnet18 from pl_bolts.models.self_supervised.simclr.transforms import SimCLREvalDataTransform, SimCLRTrainDataTransform from pathlib import Path import torch import os...
[ "matplotlib.pyplot.ylabel", "pl_bolts.models.self_supervised.SimCLR", "pl_bolts.models.self_supervised.simclr.transforms.SimCLREvalDataTransform", "numpy.linalg.norm", "os.remove", "os.path.exists", "seaborn.set", "argparse.ArgumentParser", "pathlib.Path", "torch.unsqueeze", "matplotlib.pyplot.x...
[((868, 881), 'tqdm.tqdm', 'tqdm', (['dataset'], {}), '(dataset)\n', (872, 881), False, 'from tqdm import tqdm\n'), ((1226, 1251), 'os.path.exists', 'os.path.exists', (['"""data.h5"""'], {}), "('data.h5')\n", (1240, 1251), False, 'import os\n'), ((1285, 1310), 'h5py.File', 'h5py.File', (['"""data.h5"""', '"""w"""'], {}...
import ctypes import os from ctypes import wintypes from collections import namedtuple from PySide2.QtWidgets import QApplication def get_process_hwnds(): # https://stackoverflow.com/questions/37501191/how-to-get-windows-window-names-with-ctypes-in-python user32 = ctypes.WinDLL('user32', use_last_erro...
[ "ctypes.WinError", "ctypes.byref", "ctypes.POINTER", "collections.namedtuple", "ctypes.wintypes.DWORD", "ctypes.create_unicode_buffer", "ctypes.get_last_error", "ctypes.WINFUNCTYPE", "ctypes.WinDLL", "os.getpid" ]
[((283, 327), 'ctypes.WinDLL', 'ctypes.WinDLL', (['"""user32"""'], {'use_last_error': '(True)'}), "('user32', use_last_error=True)\n", (296, 327), False, 'import ctypes\n'), ((645, 683), 'collections.namedtuple', 'namedtuple', (['"""WindowInfo"""', '"""title hwnd"""'], {}), "('WindowInfo', 'title hwnd')\n", (655, 683),...
import argparse import numpy as np import models.ensemble as e import utils.load as l import utils.metrics as m import utils.wrapper as w def get_arguments(): """Gets arguments from the command line. Returns: A parser with the input arguments. """ # Creates the ArgumentParser parser =...
[ "argparse.ArgumentParser", "utils.wrapper.optimize_umda", "numpy.random.seed", "models.ensemble.boolean_classifiers", "utils.load.load_candidates" ]
[((321, 448), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""Optimizes a boolean-based ensemble using Univariate Marginal Distribution Algorithm."""'}), "(usage=\n 'Optimizes a boolean-based ensemble using Univariate Marginal Distribution Algorithm.'\n )\n", (344, 448), False, 'import ar...
import re QUOTE_FIRS_OPEN = '&laquo;' QUOTE_FIRS_CLOSE = '&raquo;' QUOTE_CRAWSE_OPEN = '&bdquo;' QUOTE_CRAWSE_CLOSE = '&ldquo;' RE_QO = re.compile('&(l|r)aquo;') DOMAINS = [ "ru", "ру", "ком", "орг", "уа", "ua", "uk", "co", "fr", "com", "net", "edu", "gov", "org...
[ "re.compile" ]
[((137, 162), 're.compile', 're.compile', (['"""&(l|r)aquo;"""'], {}), "('&(l|r)aquo;')\n", (147, 162), False, 'import re\n')]
""" SGDP Optimizer Implementation copied from https://github.com/clovaai/AdamP/blob/master/adamp/sgdp.py Paper: `Slowing Down the Weight Norm Increase in Momentum-based Optimizers` - https://arxiv.org/abs/2006.08217 Code: https://github.com/clovaai/AdamP Copyright (c) 2020-present NAVER Corp. MIT license """ import ...
[ "torch.no_grad", "torch.zeros_like", "torch.enable_grad" ]
[((876, 891), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (889, 891), False, 'import torch\n'), ((995, 1014), 'torch.enable_grad', 'torch.enable_grad', ([], {}), '()\n', (1012, 1014), False, 'import torch\n'), ((1551, 1570), 'torch.zeros_like', 'torch.zeros_like', (['p'], {}), '(p)\n', (1567, 1570), False, 'imp...
import os import glob from unet3d.data import write_data_to_file, open_data_file from unet3d.generator import get_training_and_validation_generators from unet3d.model import siam3dunet_model from unet3d.model import testnet_model from unet3d.training import load_old_model, train_model from skimage.io import imsave, im...
[ "os.path.exists", "unet3d.data.write_data_to_file", "unet3d.data.open_data_file", "unet3d.training.load_old_model", "os.path.join", "os.path.dirname", "unet3d.model.siam3dunet_model", "os.path.basename", "unet3d.generator.get_training_and_validation_generators", "os.path.abspath", "unet3d.traini...
[((2599, 2639), 'os.path.abspath', 'os.path.abspath', (['f"""siam_data0_{mode}.h5"""'], {}), "(f'siam_data0_{mode}.h5')\n", (2614, 2639), False, 'import os\n'), ((2663, 2703), 'os.path.abspath', 'os.path.abspath', (['f"""siam_data1_{mode}.h5"""'], {}), "(f'siam_data1_{mode}.h5')\n", (2678, 2703), False, 'import os\n'),...
# Copyright (c) 2019 Mycroft AI, Inc. and <NAME> # # This file is part of Mycroft Light # (see https://github.com/MatthewScholefield/mycroft-light). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional i...
[ "pocketsphinx.Decoder", "os.path.join", "pocketsphinx.Decoder.default_config", "os.fdopen", "tempfile.mkstemp" ]
[((1713, 1755), 'os.path.join', 'join', (['rt.paths.user_config', '"""models"""', 'lang'], {}), "(rt.paths.user_config, 'models', lang)\n", (1717, 1755), False, 'from os.path import join\n'), ((2049, 2073), 'pocketsphinx.Decoder.default_config', 'Decoder.default_config', ([], {}), '()\n', (2071, 2073), False, 'from poc...
# Generated by Django 2.2.6 on 2019-11-12 04:24 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0014_auto_20191112_0420'), ] operations = [ migrations.AlterField( model_name='takes', name='...
[ "django.db.models.DateField" ]
[((345, 390), 'django.db.models.DateField', 'models.DateField', ([], {'default': 'datetime.date.today'}), '(default=datetime.date.today)\n', (361, 390), False, 'from django.db import migrations, models\n')]
import logging import typing from datetime import timedelta import disnake from asyncpg.exceptions import PostgresError from disnake.ext.commands import BucketType, cooldown, guild_only from bot.bot import command, bot_has_permissions, group, Group from bot.converters import AnyUser, CommandConverter, TimeDelta from ...
[ "logging.getLogger", "disnake.Embed", "utils.utilities.format_timedelta", "disnake.ext.commands.guild_only", "disnake.ext.commands.cooldown", "bot.bot.group", "bot.bot.command", "utils.utilities.utcnow", "bot.bot.bot_has_permissions", "bot.paginator.Paginator", "datetime.timedelta" ]
[((453, 482), 'logging.getLogger', 'logging.getLogger', (['"""terminal"""'], {}), "('terminal')\n", (470, 482), False, 'import logging\n'), ((568, 577), 'bot.bot.command', 'command', ([], {}), '()\n', (575, 577), False, 'from bot.bot import command, bot_has_permissions, group, Group\n'), ((583, 620), 'disnake.ext.comma...
import os import cv2 import numpy as np from math import * from scipy.stats import mode import time # 图像矫正类 class ImgCorrect: """ 霍夫变换进行线段检索,再根据这些线段算出夹角,利用角度的加权平均值和频率最高的思想作为旋转的最佳角度 """ def __init__(self, img): self.img = img """ # 图像归一化处理 会造成图像清晰度变低 self.h, self.w, self....
[ "numpy.array", "os.path.exists", "os.listdir", "cv2.threshold", "time.localtime", "cv2.warpAffine", "os.rename", "cv2.cvtColor", "cv2.getRotationMatrix2D", "cv2.Canny", "cv2.imread", "cv2.imwrite", "cv2.HoughLinesP", "os.makedirs", "scipy.stats.mode", "os.path.join", "os.path.abspath...
[((6384, 6406), 'os.listdir', 'os.listdir', (['input_path'], {}), '(input_path)\n', (6394, 6406), False, 'import os\n'), ((7140, 7162), 'os.listdir', 'os.listdir', (['input_path'], {}), '(input_path)\n', (7150, 7162), False, 'import os\n'), ((882, 924), 'cv2.cvtColor', 'cv2.cvtColor', (['self.img', 'cv2.COLOR_BGR2GRAY'...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import sys import unittest sys.path.append('..') from hecatoncheir import DbProfilerRepository from hecatoncheir import DbProfilerVerify class TestDbProfilerVerify(unittest.TestCase): def setUp(self): pass def test_verify_column_001(self): col...
[ "hecatoncheir.DbProfilerVerify.verify_table", "hecatoncheir.DbProfilerVerify.DbProfilerVerify", "unittest.main", "hecatoncheir.DbProfilerVerify.verify_column", "sys.path.append", "hecatoncheir.DbProfilerRepository.DbProfilerRepository" ]
[((77, 98), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (92, 98), False, 'import sys\n'), ((1598, 1613), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1611, 1613), False, 'import unittest\n'), ((610, 645), 'hecatoncheir.DbProfilerVerify.verify_column', 'DbProfilerVerify.verify_column', ...
#!/usr/bin/python # -*- coding: utf-8 -*- from abc import abstractproperty from cloudshell.cli.cli import CLI from cloudshell.cli.cli_service_impl import CommandModeContextManager from cloudshell.cli.command_mode import CommandMode from cloudshell.cli.session.ssh_session import SSHSession from cloudshell.cli.session....
[ "cloudshell.cli.session.ssh_session.SSHSession.SESSION_TYPE.lower", "cloudshell.cli.session.ssh_session.SSHSession", "cloudshell.cli.session.telnet_session.TelnetSession.SESSION_TYPE.lower", "cloudshell.cli.session.telnet_session.TelnetSession" ]
[((2320, 2421), 'cloudshell.cli.session.ssh_session.SSHSession', 'SSHSession', (['self.resource_address', 'self.username', 'self.password', 'self.port', 'self.on_session_start'], {}), '(self.resource_address, self.username, self.password, self.port,\n self.on_session_start)\n', (2330, 2421), False, 'from cloudshell....
import re import humanize from io import StringIO async def ask_for_int(bot, message, lower_bound=None, upper_bound=None, timeout=30, timeout_msg=None, default=None): def check(msg): s = msg.content if not s.isdigit(): return False n = int(s) if lower_bound is not None ...
[ "re.sub", "io.StringIO", "re.search" ]
[((833, 881), 're.sub', 're.sub', (['"""(?P<c>[`*_\\\\[\\\\]~])"""', '"""\\\\\\\\\\\\g<c>"""', 'msg'], {}), "('(?P<c>[`*_\\\\[\\\\]~])', '\\\\\\\\\\\\g<c>', msg)\n", (839, 881), False, 'import re\n'), ((920, 993), 're.sub', 're.sub', (['"""(?P<a>`)(?P<b>`)(?P<c>`)"""', '"""\\\\\\\\\\\\g<a>\\\\\\\\\\\\g<b>\\\\\\\\\\\\g<...
from random import randrange from Car import Car car1 = Car("<NAME>",15, 250) car1.drive(100) for t in range(10): print (t) print(car1) a=randrange(1,4) if a == 1: car1.brake(5) print("breaking") elif a == 2: car1.acc(5) print("acceleratione") else: ...
[ "Car.Car", "random.randrange" ]
[((57, 79), 'Car.Car', 'Car', (['"""<NAME>"""', '(15)', '(250)'], {}), "('<NAME>', 15, 250)\n", (60, 79), False, 'from Car import Car\n'), ((153, 168), 'random.randrange', 'randrange', (['(1)', '(4)'], {}), '(1, 4)\n', (162, 168), False, 'from random import randrange\n')]
import unittest import tensorflow as tf import fastestimator as fe import fastestimator.test.unittest_util as fet class TestReflectionPadding2D(unittest.TestCase): def setUp(self): self.x = tf.reshape(tf.convert_to_tensor(list(range(9))), (1, 3, 3, 1)) def test_reflection_padding_2d_double_side(sel...
[ "fastestimator.layers.tensorflow.ReflectionPadding2D", "fastestimator.test.unittest_util.is_equal", "tensorflow.constant" ]
[((337, 492), 'tensorflow.constant', 'tf.constant', (['[[[[4], [3], [4], [5], [4]], [[1], [0], [1], [2], [1]], [[4], [3], [4], [5],\n [4]], [[7], [6], [7], [8], [7]], [[4], [3], [4], [5], [4]]]]'], {}), '([[[[4], [3], [4], [5], [4]], [[1], [0], [1], [2], [1]], [[4], [\n 3], [4], [5], [4]], [[7], [6], [7], [8], [7...
import asyncio import logging import aiohttp import async_timeout _LOGGER = logging.getLogger(__name__) def _load_enum(enum, value, default=None): """Parse an enum with fallback.""" try: return enum(value) except ValueError: return default async def async_request(session, url, **kwargs...
[ "logging.getLogger", "async_timeout.timeout" ]
[((78, 105), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (95, 105), False, 'import logging\n'), ((393, 418), 'async_timeout.timeout', 'async_timeout.timeout', (['(10)'], {}), '(10)\n', (414, 418), False, 'import async_timeout\n')]
''' Created on Feb. 9, 2021 @author: cefect ''' #=============================================================================== # imports #=============================================================================== import os, datetime start = datetime.datetime.now() import pandas as pd import numpy as np from pa...
[ "pandas.Series", "datetime.datetime.now", "pandas.read_excel", "datetime.datetime.today", "hlpr.basic.force_open_dir" ]
[((250, 273), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (271, 273), False, 'import os, datetime\n'), ((6537, 6565), 'hlpr.basic.force_open_dir', 'force_open_dir', (['wrkr.out_dir'], {}), '(wrkr.out_dir)\n', (6551, 6565), False, 'from hlpr.basic import view, force_open_dir\n'), ((505, 530), 'da...
import random import string def gen_string(size=8, chars=string.ascii_lowercase + string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for _ in range(size)) def return_url(request, default): if 'HTTP_REFERER' in request.META: return request.META['HTTP_REFERER'] return de...
[ "random.choice" ]
[((144, 164), 'random.choice', 'random.choice', (['chars'], {}), '(chars)\n', (157, 164), False, 'import random\n')]
from __future__ import print_function, division, absolute_import import argparse import math import time import matplotlib.pyplot as plt import numpy as np import scipy.io as sio import torch from hubconf import SRResNet parser = argparse.ArgumentParser(description="PyTorch SRResNet Demo") parser.add_argument("--de...
[ "numpy.clip", "numpy.mean", "hubconf.SRResNet", "argparse.ArgumentParser", "matplotlib.pyplot.show", "torch.load", "scipy.io.loadmat", "torch.from_numpy", "matplotlib.pyplot.subplot", "matplotlib.pyplot.figure", "torch.set_grad_enabled", "math.log10", "time.time", "torch.device" ]
[((234, 294), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch SRResNet Demo"""'}), "(description='PyTorch SRResNet Demo')\n", (257, 294), False, 'import argparse\n'), ((1153, 1177), 'torch.device', 'torch.device', (['opt.device'], {}), '(opt.device)\n', (1165, 1177), False, 'impor...
from django.db import models from accounts.models import User from datetime import date from django.utils.translation import gettext as _ from django.core.validators import RegexValidator class Application(models.Model): """ this is the model for application that needs to be filled for applying for admission ...
[ "django.db.models.EmailField", "django.db.models.OneToOneField", "django.db.models.FloatField", "django.db.models.DateField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.IntegerField", "django.core.validators.RegexValidator", "django.db.models.BooleanField", "dja...
[((426, 478), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.DO_NOTHING'}), '(User, on_delete=models.DO_NOTHING)\n', (443, 478), False, 'from django.db import models\n'), ((494, 544), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""Select"""', 'max_length': '...
import scrapy from bili1.items import Bili1Item import json class OtherDataSpider(scrapy.Spider): name = 'other_data' # allowed_domains = ['bilibili.com'] start_urls = ['https://api.bilibili.com/x/article/viewinfo?id=1047645&jsonp=jsonp'] url_other = "https://api.bilibili.com/x/article/viewinfo?id=%d&...
[ "json.loads", "bili1.items.Bili1Item", "scrapy.Request" ]
[((441, 466), 'json.loads', 'json.loads', (['response.body'], {}), '(response.body)\n', (451, 466), False, 'import json\n'), ((486, 497), 'bili1.items.Bili1Item', 'Bili1Item', ([], {}), '()\n', (495, 497), False, 'from bili1.items import Bili1Item\n'), ((1581, 1653), 'scrapy.Request', 'scrapy.Request', ([], {'url': 'ne...
import re # text_rules, messages = open('sample_input_partB').read().split('\n\n') text_rules, messages = open('input').read().split('\n\n') rules = {} for rule in text_rules.split('\n'): rule_n, rule_cond = rule.split(':') rules[int(rule_n)] = rule_cond.strip() # Completely determine all rules: # All number...
[ "re.search", "re.sub", "re.match", "re.compile" ]
[((1539, 1566), 're.compile', 're.compile', (['f"""^{rules[0]}$"""'], {}), "(f'^{rules[0]}$')\n", (1549, 1566), False, 'import re\n'), ((539, 572), 're.search', 're.search', (['"""[0-9]"""', 'rules[rule_n]'], {}), "('[0-9]', rules[rule_n])\n", (548, 572), False, 'import re\n'), ((1605, 1621), 're.match', 're.match', ([...
import orm_mfk from sqlalchemy.orm import sessionmaker Session = sessionmaker(bind=orm_mfk.engine) session = Session() addr1 = orm_mfk.Address(street="adsfad") addr2 = orm_mfk.Address(street="123") addr3 = orm_mfk.Address(street="2321asd") c1 = orm_mfk.Customer(name="jack", billing_address = addr1, shiping_address=...
[ "orm_mfk.Customer", "sqlalchemy.orm.sessionmaker", "orm_mfk.Address" ]
[((67, 100), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'bind': 'orm_mfk.engine'}), '(bind=orm_mfk.engine)\n', (79, 100), False, 'from sqlalchemy.orm import sessionmaker\n'), ((130, 162), 'orm_mfk.Address', 'orm_mfk.Address', ([], {'street': '"""adsfad"""'}), "(street='adsfad')\n", (145, 162), False, 'import ...
import os import subprocess index = 1 maxRange = "10" for filename in os.listdir(os.getcwd()): imageName = "{0:0>5}".format(index) print(imageName) subprocess.run(["p3", "plot.py"], cwd=os.getcwd) index += 1
[ "subprocess.run", "os.getcwd" ]
[((82, 93), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (91, 93), False, 'import os\n'), ((161, 209), 'subprocess.run', 'subprocess.run', (["['p3', 'plot.py']"], {'cwd': 'os.getcwd'}), "(['p3', 'plot.py'], cwd=os.getcwd)\n", (175, 209), False, 'import subprocess\n')]
# Generated by Django 3.0.2 on 2020-01-03 14:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0002_submission'), ] operations = [ migrations.AddField( model_name='theme', name='is_series', f...
[ "django.db.models.BooleanField" ]
[((325, 359), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (344, 359), False, 'from django.db import migrations, models\n')]
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'sideui.ui' ## ## Created by: Qt User Interface Compiler version 5.14.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ###########...
[ "PySide2.QtCore.QCoreApplication.translate", "PySide2.QtGui.QFont", "PySide2.QtCore.QMetaObject.connectSlotsByName", "PySide2.QtCore.QRect", "PySide2.QtCore.QSize", "PySide2.QtGui.QIcon" ]
[((1385, 1392), 'PySide2.QtGui.QFont', 'QFont', ([], {}), '()\n', (1390, 1392), False, 'from PySide2.QtGui import QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QIcon, QKeySequence, QLinearGradient, QPalette, QPainter, QPixmap, QRadialGradient\n'), ((1515, 1522), 'PySide2.QtGui.QIcon', 'QIcon', ([], {...
# CreateApiGenerator.py - Creates an object representing a create API import os from jinja2 import Environment, Template, FileSystemLoader import yaml from smoacks.sconfig import sconfig from smoacks.Schema import scr_schemas class OpenapiGenerator: def __init__(self, app_object): self._app_object = app_ob...
[ "jinja2.FileSystemLoader", "yaml.load" ]
[((2340, 2390), 'yaml.load', 'yaml.load', (['rendered_string'], {'Loader': 'yaml.FullLoader'}), '(rendered_string, Loader=yaml.FullLoader)\n', (2349, 2390), False, 'import yaml\n'), ((2111, 2140), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['"""templates"""'], {}), "('templates')\n", (2127, 2140), False, 'from jin...
__author__ = '<NAME>' import urllib2 data_url = "http://files.grouplens.org/datasets/movielens/ml-100k/u.data" movies_url = "http://files.grouplens.org/datasets/movielens/ml-100k/u.item" def get_movies_dataset(): movies = {} # get movies movies_file = urllib2.urlopen(movies_url) for line in movies_fi...
[ "urllib2.urlopen" ]
[((267, 294), 'urllib2.urlopen', 'urllib2.urlopen', (['movies_url'], {}), '(movies_url)\n', (282, 294), False, 'import urllib2\n'), ((493, 518), 'urllib2.urlopen', 'urllib2.urlopen', (['data_url'], {}), '(data_url)\n', (508, 518), False, 'import urllib2\n')]
import logging import sys from django.conf import settings from azure_storage_logging.handlers import BlobStorageTimedRotatingFileHandler as storage formatter = logging.Formatter( fmt='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S' ) screen_handler = logging.StreamHandler(stream=sys.s...
[ "logging.getLogger", "logging.Formatter", "logging.StreamHandler", "azure_storage_logging.handlers.BlobStorageTimedRotatingFileHandler" ]
[((164, 262), 'logging.Formatter', 'logging.Formatter', ([], {'fmt': '"""%(asctime)s %(levelname)-8s %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(fmt='%(asctime)s %(levelname)-8s %(message)s', datefmt=\n '%Y-%m-%d %H:%M:%S')\n", (181, 262), False, 'import logging\n'), ((286, 326), 'logging.StreamHandle...
import abc import logging from enum import Enum from typing import List, Tuple, Union, Dict, Optional from nempy.user_data import AccountData from nempy.sym.constants import BlockchainStatuses, Fees, TransactionStatus from .sym import api as sym from .sym import network from .sym.network import NodeSelector logger = ...
[ "logging.getLogger" ]
[((320, 347), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (337, 347), False, 'import logging\n')]
from django import template from ghoster import forms from django.contrib import admin from django.contrib.admin import helpers import pprint import copy import re register = template.Library() def __flatten(fields): """Returns a list which is a single level of flattening of the original list.""" flat = [...
[ "django.contrib.admin.helpers.AdminForm", "django.contrib.admin.site.get_app_list", "django.template.Library" ]
[((175, 193), 'django.template.Library', 'template.Library', ([], {}), '()\n', (191, 193), False, 'from django import template\n'), ((1669, 1712), 'django.contrib.admin.site.get_app_list', 'admin.site.get_app_list', (["context['request']"], {}), "(context['request'])\n", (1692, 1712), False, 'from django.contrib import...
""" File: websocket_streams.py Author: <NAME> Created on: 21/06/21, 7:15 pm """ from dataclasses import dataclass import datetime import struct def unpack_int8(bin_data, pos): """ Convert 1 byte data """ return struct.unpack(">B", bin_data[pos:pos+1])[0] def unpack_int16(bin_data, pos)...
[ "struct.unpack", "dataclasses.dataclass" ]
[((871, 882), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (880, 882), False, 'from dataclasses import dataclass\n'), ((3104, 3115), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (3113, 3115), False, 'from dataclasses import dataclass\n'), ((243, 285), 'struct.unpack', 'struct.unpack', (['""">B"""'...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() # with open(os.path.join(here, 'CHANGES.txt')) as f: # CHANGES = f.read() CHANGES = "Changes" requires = ['pyramid', 'python-k...
[ "os.path.dirname", "setuptools.find_packages", "os.path.join" ]
[((79, 104), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (94, 104), False, 'import os\n'), ((116, 147), 'os.path.join', 'os.path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (128, 147), False, 'import os\n'), ((1136, 1151), 'setuptools.find_packages', 'find_packages',...
from py_dp.dispersion.binning import make_input_for_binning_with_freq, make_1d_abs_vel_bins, class_index_abs_log from py_dp.dispersion.convert_to_time_process_with_freq import remove_duplicate import numpy as np from copy import copy from py_dp.dispersion.mapping import mapping_v_sgn_repeat import os def test_mapping_...
[ "py_dp.dispersion.binning.make_input_for_binning_with_freq", "py_dp.dispersion.binning.class_index_abs_log", "numpy.unique", "py_dp.dispersion.binning.make_1d_abs_vel_bins", "numpy.log", "os.path.join", "numpy.array", "os.path.dirname", "py_dp.dispersion.convert_to_time_process_with_freq.remove_dupl...
[((413, 489), 'os.path.join', 'os.path.join', (['main_folder', '"""test_related_files"""', '"""particle_tracking_results"""'], {}), "(main_folder, 'test_related_files', 'particle_tracking_results')\n", (425, 489), False, 'import os\n'), ((592, 651), 'py_dp.dispersion.binning.make_input_for_binning_with_freq', 'make_inp...
# Copyright 2017 Starbot Discord Project # # 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...
[ "api.database.init" ]
[((801, 816), 'api.database.init', 'database.init', ([], {}), '()\n', (814, 816), False, 'from api import database\n'), ((1062, 1077), 'api.database.init', 'database.init', ([], {}), '()\n', (1075, 1077), False, 'from api import database\n')]
#!/usr/bin/env python """Automatically pre-renders a queue of videos for live streaming. djmarinara does the following: 1) Polls a URL to obtain a list of URLs of songs. 2) Chooses a song URL at random. 3) Generates a video from the song, with visualizer output and song text (ID3 tags, etc.) 4) Manages playlist files ...
[ "zipfile.ZipFile", "time.sleep", "textwrap.wrap", "os.walk", "os.remove", "re.split", "os.listdir", "shutil.move", "pathlib.Path", "subprocess.Popen", "shutil.disk_usage", "traceback.print_exc", "urllib.request.urlopen", "glob.glob", "os.path.getsize", "random.choice", "hashlib.md5",...
[((2179, 2190), 'time.time', 'time.time', ([], {}), '()\n', (2188, 2190), False, 'import shutil, hashlib, random, time, zipfile, os, json, subprocess, codecs, re, glob, logging, tarfile, textwrap, traceback, sys\n'), ((5532, 5543), 'time.time', 'time.time', ([], {}), '()\n', (5541, 5543), False, 'import shutil, hashlib...
import numpy as np import tensorflow as tf OUTPUT_PATH = "../events/" def save(): input_node = tf.placeholder(shape=[None, 100, 100, 3], dtype=tf.float32) net = tf.layers.conv2d(input_node, 32, (3, 3), strides=(2, 2), padding='same', name='conv_1') net = tf.layers.conv2d(net, 32, (3, 3), strides=(1, 1), ...
[ "tensorflow.local_variables_initializer", "numpy.alltrue", "tensorflow.reset_default_graph", "tensorflow.placeholder", "tensorflow.train.Saver", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.layers.conv2d", "tensorflow.train.import_meta_graph", "tensorflow.get_defaul...
[((102, 161), 'tensorflow.placeholder', 'tf.placeholder', ([], {'shape': '[None, 100, 100, 3]', 'dtype': 'tf.float32'}), '(shape=[None, 100, 100, 3], dtype=tf.float32)\n', (116, 161), True, 'import tensorflow as tf\n'), ((172, 263), 'tensorflow.layers.conv2d', 'tf.layers.conv2d', (['input_node', '(32)', '(3, 3)'], {'st...
from django.db.models.fields import SlugField from rest_framework import serializers from .models import Post, Comment, Like, CommentLike, Node#, InboxLike from users.serializers import User_Profile, userPSerializer, UserSerializer, InboxSerializer class PostSerializer(serializers.ModelSerializer): #author...
[ "users.serializers.UserSerializer", "users.serializers.userPSerializer" ]
[((550, 580), 'users.serializers.UserSerializer', 'UserSerializer', ([], {'read_only': '(True)'}), '(read_only=True)\n', (564, 580), False, 'from users.serializers import User_Profile, userPSerializer, UserSerializer, InboxSerializer\n'), ((2136, 2178), 'users.serializers.UserSerializer', 'UserSerializer', ([], {'many'...
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "tensorflow.compat.v2.where", "tensorflow.compat.v2.constant", "tensorflow.compat.v2.is_tensor", "tensorflow.compat.v2.nest.map_structure", "tensorflow.compat.v2.math.abs", "tensorflow.compat.v2.cast", "tensorflow_probability.python.math.gradient.value_and_gradient", "tensorflow.compat.v2.reshape", ...
[((2719, 2752), 'tensorflow.compat.v2.cast', 'tf.cast', (['result'], {'dtype': 'tf.float64'}), '(result, dtype=tf.float64)\n', (2726, 2752), True, 'import tensorflow.compat.v2 as tf\n'), ((2763, 2795), 'tensorflow.compat.v2.cast', 'tf.cast', (['truth'], {'dtype': 'tf.float64'}), '(truth, dtype=tf.float64)\n', (2770, 27...
import requests def get_all_data(): root = "https://raw.githubusercontent.com/patidarparas13/Sentiment-Analyzer-Tool/master/Datasets/" data = requests.get(root + "imdb_labelled.txt").text.split("\n") data += requests.get(root + "amazon_cells_labelled.txt").text.split("\n") data += requests.get(root +...
[ "requests.get" ]
[((153, 193), 'requests.get', 'requests.get', (["(root + 'imdb_labelled.txt')"], {}), "(root + 'imdb_labelled.txt')\n", (165, 193), False, 'import requests\n'), ((223, 271), 'requests.get', 'requests.get', (["(root + 'amazon_cells_labelled.txt')"], {}), "(root + 'amazon_cells_labelled.txt')\n", (235, 271), False, 'impo...
# Generated by Django 1.10.7 on 2017-05-22 15:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('case_search', '0006_remove_casesearchconfig__config'), ] operations = [ migrations.CreateModel( name='IgnorePatterns', ...
[ "django.db.models.AutoField", "django.db.models.ManyToManyField", "django.db.models.CharField" ]
[((902, 957), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""case_search.IgnorePatterns"""'}), "(to='case_search.IgnorePatterns')\n", (924, 957), False, 'from django.db import migrations, models\n'), ((356, 449), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(Tr...
#import IndexerMod import ThreadingMod import threading import time ##MyCraweler.Crawel() ##MyIndexer = IndexerMod.Indexer() ##MyIndexer.StartIndexing() #MyThreads=[] #MyCraweler.Crawel("https://moz.com/top500") #MyCraweler.Crawel("https://www.facebook.com/") #MyCraweler.Crawel("https://www.crummy.com/software/Beaut...
[ "ThreadingMod.myThread", "threading.Lock", "time.sleep" ]
[((717, 733), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (731, 733), False, 'import threading\n'), ((754, 770), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (768, 770), False, 'import threading\n'), ((1757, 1770), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1767, 1770), False, 'import time\...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # Create your models here. class Person(models.Model): name_text = models.CharField(max_length=50) status = models.IntegerField(default=0) phone_number = models.CharField(max_length=15) location = models.CharField(max_len...
[ "django.db.models.CharField", "django.db.models.IntegerField" ]
[((163, 194), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (179, 194), False, 'from django.db import models\n'), ((205, 235), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (224, 235), False, 'from django.db impo...