code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import pandas as pd
import numpy as np
from netCDF4 import Dataset
import xarray as xr
import scipy.fft as fft
from scipy import signal
import base64
import io
def get_handle(file):
nc_handle = Dataset(file, 'r')
return nc_handle
def get_variable_data(nc_handle, key):
# for key in nc_handle.variables.ke... | [
"netCDF4.Dataset",
"scipy.fft.fft",
"io.BytesIO",
"base64.b64decode",
"scipy.signal.firwin",
"numpy.array"
] | [((200, 218), 'netCDF4.Dataset', 'Dataset', (['file', '"""r"""'], {}), "(file, 'r')\n", (207, 218), False, 'from netCDF4 import Dataset\n'), ((492, 524), 'base64.b64decode', 'base64.b64decode', (['content_string'], {}), '(content_string)\n', (508, 524), False, 'import base64\n'), ((1776, 1843), 'scipy.signal.firwin', '... |
import ast
import grpc
from concurrent import futures
import time
import kvirt.krpc.kcli_pb2 as kcli_pb2
import kvirt.krpc.kcli_pb2_grpc as kcli_pb2_grpc
from kvirt.config import Kconfig, Kbaseconfig, Kcontainerconfig
from kvirt import common, nameutils
from kvirt.common import pprint, error
from kvirt import version
... | [
"kvirt.krpc.kcli_pb2.disk",
"kvirt.krpc.kcli_pb2.plan",
"kvirt.nameutils.get_random_name",
"kvirt.krpc.kcli_pb2.kube",
"kvirt.common.scp",
"kvirt.common.ssh",
"yaml.safe_load",
"kvirt.krpc.kcli_pb2.containerslist",
"kvirt.common.set_lastvm",
"kvirt.krpc.kcli_pb2.networkslist",
"kvirt.krpc.kcli_p... | [((27266, 27324), 'grpc_reflection.v1alpha.reflection.enable_server_reflection', 'reflection.enable_server_reflection', (['SERVICE_NAMES', 'server'], {}), '(SERVICE_NAMES, server)\n', (27301, 27324), False, 'from grpc_reflection.v1alpha import reflection\n'), ((545, 554), 'kvirt.config.Kconfig', 'Kconfig', ([], {}), '(... |
from django.dispatch import Signal
signal_perform_upgrade = Signal(use_caching=True)
signal_post_initial_setup = Signal(use_caching=True)
signal_post_upgrade = Signal(use_caching=True)
signal_pre_initial_setup = Signal(use_caching=True)
signal_pre_upgrade = Signal(use_caching=True)
signal_mayan_pre_save = Signa... | [
"django.dispatch.Signal"
] | [((63, 87), 'django.dispatch.Signal', 'Signal', ([], {'use_caching': '(True)'}), '(use_caching=True)\n', (69, 87), False, 'from django.dispatch import Signal\n'), ((117, 141), 'django.dispatch.Signal', 'Signal', ([], {'use_caching': '(True)'}), '(use_caching=True)\n', (123, 141), False, 'from django.dispatch import Sig... |
import collections
DOUBLE_DASH = '--'
DASH = '-'
UNDER_SCORE = '_'
STRING = 'str'
def parsing_rule(func):
'''
Decorator that sets the _rule attribute in the input callable
'''
func._rule = True
return func
class FilterClass(type):
'''
A metaclass that extracts all methods that have
... | [
"collections.OrderedDict",
"copy.deepcopy"
] | [((562, 587), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (585, 587), False, 'import collections\n'), ((2709, 2728), 'copy.deepcopy', 'copy.deepcopy', (['args'], {}), '(args)\n', (2722, 2728), False, 'import copy\n')] |
from fedml.model.cv.cnn import CNN_DropOut
from fedml.model.cv.efficientnet import EfficientNet
from fedml.model.cv.mobilenet import mobilenet
from fedml.model.cv.mobilenet_v3 import MobileNetV3
from fedml.model.cv.resnet import resnet56
from fedml.model.cv.resnet_gn import resnet18
from fedml.model.linear.lr import Lo... | [
"fedml.model.cv.resnet_gn.resnet18",
"fedml.model.cv.mobilenet_v3.MobileNetV3",
"fedml.model.cv.mobilenet.mobilenet",
"fedml.model.cv.efficientnet.EfficientNet",
"fedml.model.nlp.rnn.RNN_StackOverFlow",
"fedml.model.cv.resnet.resnet56",
"fedml.model.cv.cnn.CNN_DropOut",
"fedml.model.nlp.rnn.RNN_Origin... | [((723, 762), 'fedml.model.linear.lr.LogisticRegression', 'LogisticRegression', (['(28 * 28)', 'output_dim'], {}), '(28 * 28, output_dim)\n', (741, 762), False, 'from fedml.model.linear.lr import LogisticRegression\n'), ((872, 890), 'fedml.model.cv.cnn.CNN_DropOut', 'CNN_DropOut', (['(False)'], {}), '(False)\n', (883, ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 31 14:16:33 2017
@author: <NAME>
"""
import numpy as np
def dict_apply(d, f):
return { key: f(value) for key, value in d.items()}
def add_dicts(dict_1, dict_2):
return {key: dict_1.get(key, 0) + dict_2.get(key, 0) for key in dict_1}
class LessPrecise(float)... | [
"numpy.round",
"random.randint"
] | [((506, 524), 'numpy.round', 'np.round', (['value', '(4)'], {}), '(value, 4)\n', (514, 524), True, 'import numpy as np\n'), ((948, 969), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (962, 969), False, 'import random\n'), ((606, 620), 'numpy.round', 'np.round', (['v', '(4)'], {}), '(v, 4)\n', ... |
"""
module_persistence_homology.py
This module implements the persistence module homology
"""
import numpy as np
from .barcode_bases import barcode_basis
from .image_kernel import image_kernel
###############################################################################
# Find pivot of array
def _pivot(... | [
"numpy.nonzero",
"numpy.array",
"numpy.identity",
"numpy.concatenate"
] | [((606, 619), 'numpy.nonzero', 'np.nonzero', (['l'], {}), '(l)\n', (616, 619), True, 'import numpy as np\n'), ((1605, 1651), 'numpy.concatenate', 'np.concatenate', (['(N.barcode, M.barcode)'], {'axis': '(0)'}), '((N.barcode, M.barcode), axis=0)\n', (1619, 1651), True, 'import numpy as np\n'), ((1750, 1804), 'numpy.conc... |
"""
Raspberry Pi GPIO
"""
import logging
from typing import Any, Callable, Dict, List, Optional
from ...types import ConfigType, PinType
from . import GenericGPIO, InterruptEdge, InterruptSupport, PinDirection, PinPUD
_LOG = logging.getLogger(__name__)
REQUIREMENTS = ("RPi.GPIO",)
class GPIO(GenericGPIO):
"""... | [
"RPi.GPIO.setmode",
"logging.getLogger"
] | [((228, 255), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (245, 255), False, 'import logging\n'), ((1062, 1084), 'RPi.GPIO.setmode', 'gpio.setmode', (['gpio.BCM'], {}), '(gpio.BCM)\n', (1074, 1084), True, 'import RPi.GPIO as gpio\n')] |
#Crie um módulo chamado moeda.py que tenha as funções incorporadas aumentar(), diminuir(), dobro() e metade().
# Faça também um programa que importe esse módulo e use algumas dessas funções.
'''import moeda
p = float(input('Digite o preço: R$'))
print(f'A metade de R${p} é R${moeda.metade(p)}')
print(f'O dobro de R${... | [
"moeda.aumentar",
"moeda.metade",
"moeda.dobro"
] | [((546, 555), 'moeda.metade', 'metade', (['p'], {}), '(p)\n', (552, 555), False, 'from moeda import metade, dobro, aumentar\n'), ((589, 597), 'moeda.dobro', 'dobro', (['p'], {}), '(p)\n', (594, 597), False, 'from moeda import metade, dobro, aumentar\n'), ((633, 648), 'moeda.aumentar', 'aumentar', (['p', '(10)'], {}), '... |
from coapthon.resources.resource import Resource
from databaseManager import DatabaseManager
from coapthon import defines
__author__ = '<NAME>'
class LookupEp(Resource):
"""
Implementation of the endpoint lookup resource.
"""
def __init__(self, name="rd-lookup/ep"):
"""
Initialize a r... | [
"databaseManager.DatabaseManager"
] | [((1128, 1145), 'databaseManager.DatabaseManager', 'DatabaseManager', ([], {}), '()\n', (1143, 1145), False, 'from databaseManager import DatabaseManager\n')] |
#!/usr/bin/python3
"""
Creating table Investor
"""
import models
from datetime import datetime
import sqlalchemy
from sqlalchemy import Column, String, ForeignKey
from sqlalchemy import Integer, DateTime, Float
from models.person import Person
from models.base_model import BaseModel, Base
class Investor(BaseModel, Ba... | [
"sqlalchemy.String",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column"
] | [((699, 731), 'sqlalchemy.Column', 'Column', (['DateTime'], {'nullable': '(False)'}), '(DateTime, nullable=False)\n', (705, 731), False, 'from sqlalchemy import Column, String, ForeignKey\n'), ((749, 790), 'sqlalchemy.Column', 'Column', (['DateTime'], {'default': 'datetime.utcnow'}), '(DateTime, default=datetime.utcnow... |
from drf_yasg.views import get_schema_view
from rest_framework import permissions, versioning
class OpenApiView(get_schema_view()): # type: ignore
permission_classes = (permissions.AllowAny,)
versioning_class = versioning.NamespaceVersioning
| [
"drf_yasg.views.get_schema_view"
] | [((114, 131), 'drf_yasg.views.get_schema_view', 'get_schema_view', ([], {}), '()\n', (129, 131), False, 'from drf_yasg.views import get_schema_view\n')] |
# coding=utf-8
# All code, with the only exception being formalities and formatting, is made by community member b-morgan,
# because of the issue discussed in this thread;
# https://community.octoprint.org/t/temperature-reporting-now-working-with-new-ender-3-v2/21053
# Distributed with his accept, due to testing limi... | [
"re.compile"
] | [((659, 799), 're.compile', 're.compile', (['""".*TT::(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+).+\\\\/\\\\/(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+).*BB::(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+).+\\\\/\\\\/(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+)"""'], {}), "(\n '.*TT::(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+).+\\\\/\\\\/(\\\\d+)\\\\.\\\\d+\\\\.(\\\\d+).*BB:... |
from wallaby import digital
# Misc
ALLOW_BUTTON_WAIT = False
START_TIME = 0
CLONE_SWITCH = 9
IS_CLONE = digital(CLONE_SWITCH)
IS_PRIME = not IS_CLONE
STARTLIGHT = 2
FRONT_BUMPED = 0
# Tophats
LEFT_TOPHAT = 0
RIGHT_TOPHAT = 5
THRESHOLD = 1500
# Servos
SERVO_CLAW = 3
SERVO_ARM = 1
SERVO_HAY_SPIN = 2
SERVO_HAY_ARM = ... | [
"wallaby.digital"
] | [((105, 126), 'wallaby.digital', 'digital', (['CLONE_SWITCH'], {}), '(CLONE_SWITCH)\n', (112, 126), False, 'from wallaby import digital\n')] |
from django.conf.urls import url
from mail import views
urlpatterns = [
url(r'^accounts/$', views.AccountList.as_view(), name='mail_account_list'),
url(r'^accounts/add$', views.AccountCreate.as_view(), name='mail_account_add'),
url(r'^accounts/(?P<pk>\d+)/update$', views.Account... | [
"mail.views.AccountDelete.as_view",
"mail.views.RedirectUpdate.as_view",
"mail.views.AccountCreate.as_view",
"mail.views.RedirectDelete.as_view",
"mail.views.RedirectList.as_view",
"mail.views.AccountUpdate.as_view",
"django.conf.urls.url",
"mail.views.AccountList.as_view",
"mail.views.RedirectCreat... | [((870, 924), 'django.conf.urls.url', 'url', (['"""^export.json$"""', 'views.export'], {'name': '"""mail_export"""'}), "('^export.json$', views.export, name='mail_export')\n", (873, 924), False, 'from django.conf.urls import url\n'), ((112, 139), 'mail.views.AccountList.as_view', 'views.AccountList.as_view', ([], {}), ... |
"""Unit tests for reviewboard.accounts.forms.pages.AccountSettingsForm."""
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.messages.middleware import MessageMiddleware
from django.contrib.sessions.middleware import SessionMiddleware
from django.test... | [
"django.contrib.sessions.middleware.SessionMiddleware",
"reviewboard.accounts.models.Profile.objects.get",
"django.contrib.auth.models.AnonymousUser",
"django.contrib.auth.models.User.objects.get",
"django.views.generic.base.View",
"djblets.testing.decorators.add_fixtures",
"django.test.client.RequestFa... | [((1002, 1030), 'djblets.testing.decorators.add_fixtures', 'add_fixtures', (["['test_users']"], {}), "(['test_users'])\n", (1014, 1030), False, 'from djblets.testing.decorators import add_fixtures\n'), ((920, 936), 'django.test.client.RequestFactory', 'RequestFactory', ([], {}), '()\n', (934, 936), False, 'from django.... |
# The piwheels project
# Copyright (c) 2017 <NAME> <https://github.com/bennuttall>
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must ... | [
"datetime.timedelta",
"datetime.datetime.fromtimestamp",
"collections.OrderedDict",
"requests.post",
"datetime.datetime.now",
"logging.getLogger",
"re.compile"
] | [((4897, 4928), 're.compile', 're.compile', (['"""^add ([^ ]+) file"""'], {}), "('^add ([^ ]+) file')\n", (4907, 4928), False, 'import re\n'), ((4946, 4968), 're.compile', 're.compile', (['"""^create$"""'], {}), "('^create$')\n", (4956, 4968), False, 'import re\n'), ((4986, 5032), 're.compile', 're.compile', (['"""^rem... |
#*******************************************************************************
# Copyright 2014-2018 Intel Corporation
# All Rights Reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the Li... | [
"pandas.read_csv",
"daal4py.optimization_solver_mse",
"numpy.array",
"numpy.loadtxt",
"daal4py.optimization_solver_sgd"
] | [((1557, 1594), 'daal4py.optimization_solver_mse', 'd4p.optimization_solver_mse', (['nVectors'], {}), '(nVectors)\n', (1584, 1594), True, 'import daal4py as d4p\n'), ((1676, 1710), 'numpy.array', 'np.array', (['[[1.0]]'], {'dtype': 'np.double'}), '([[1.0]], dtype=np.double)\n', (1684, 1710), True, 'import numpy as np\n... |
# Methods of State that don't start with an underscore must
# be async and take 4 arguments:
# - self
# - channel: a discord channel
# - user: a discord user
# - args: a list of strings
# Those methods will be automatically called when a user uses a command
# with the same name as one of those methods.
from data impo... | [
"data.Data"
] | [((972, 978), 'data.Data', 'Data', ([], {}), '()\n', (976, 978), False, 'from data import Data\n')] |
#
# Copyright (c) 2019, 2020 by Delphix. All rights reserved.
#
import os
import subprocess
import sys
from dlpx.virtualization._internal import file_util, package_util
from dlpx.virtualization._internal import plugin_dependency_util as pdu
from dlpx.virtualization._internal.exceptions import SubprocessFailedError
i... | [
"mock.patch.object",
"dlpx.virtualization._internal.plugin_dependency_util._execute_pip",
"dlpx.virtualization._internal.package_util.get_version",
"dlpx.virtualization._internal.plugin_dependency_util._pip_install_to_dir",
"os.path.basename",
"pytest.raises"
] | [((402, 447), 'mock.patch.object', 'mock.patch.object', (['pdu', '"""_pip_install_to_dir"""'], {}), "(pdu, '_pip_install_to_dir')\n", (419, 447), False, 'import mock\n'), ((968, 1013), 'mock.patch.object', 'mock.patch.object', (['pdu', '"""_pip_install_to_dir"""'], {}), "(pdu, '_pip_install_to_dir')\n", (985, 1013), Fa... |
import turtle
# Let's make a list of colors
colors = ['red', 'green', 'blue', 'red']
# Print to make sure all the colors are there
print(colors)
# Drawing a square like we did in loops
pen = turtle.Turtle() # Making the pen we are using to draw
for i in range(4): # For each side to draw, i goes from 0 - 3 (position ... | [
"turtle.exitonclick",
"turtle.Turtle"
] | [((194, 209), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (207, 209), False, 'import turtle\n'), ((477, 492), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (490, 492), False, 'import turtle\n'), ((697, 717), 'turtle.exitonclick', 'turtle.exitonclick', ([], {}), '()\n', (715, 717), False, 'import turtle\n'... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api, exceptions, _
class HrAttendanceWxwrokData(models.Model):
_name = "hr.attendance.wxwrok.data"
_description = "Enterprise WeChat attendance data"
_order = "checkin_time"
name = fields.Char(string="Name", readonly=True,)
userid = fields... | [
"odoo.fields.Integer",
"odoo.fields.Date",
"odoo.fields.Char"
] | [((258, 299), 'odoo.fields.Char', 'fields.Char', ([], {'string': '"""Name"""', 'readonly': '(True)'}), "(string='Name', readonly=True)\n", (269, 299), False, 'from odoo import models, fields, api, exceptions, _\n'), ((314, 376), 'odoo.fields.Char', 'fields.Char', ([], {'string': '"""Enterprise WeChat user ID"""', 'read... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from datetime import datetime
import azure.functions as func
def main(req: func.HttpRequest,
outputEvent: func.Out[func.EventGridOutputEvent]) -> func.HttpResponse:
test_uuid = req.params.get('test_uuid')
... | [
"azure.functions.HttpResponse",
"datetime.datetime.utcnow"
] | [((1270, 1296), 'azure.functions.HttpResponse', 'func.HttpResponse', (['r_value'], {}), '(r_value)\n', (1287, 1296), True, 'import azure.functions as func\n'), ((786, 803), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (801, 803), False, 'from datetime import datetime\n')] |
#
# This script creates dump files of metadata in different formats upon requests to FDP.
#
from os import path, makedirs
from urllib2 import urlopen, urlparse, Request
from rdflib import Graph
from logging import getLogger, StreamHandler, INFO
from myglobals import *
logger = getLogger(__name__)
logger.setLevel(INF... | [
"urllib2.urlparse.urlparse",
"os.makedirs",
"os.path.basename",
"logging.StreamHandler",
"urllib2.Request",
"urllib2.urlparse.urljoin",
"os.path.join",
"urllib2.urlopen",
"logging.getLogger"
] | [((281, 300), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'from logging import getLogger, StreamHandler, INFO\n'), ((328, 343), 'logging.StreamHandler', 'StreamHandler', ([], {}), '()\n', (341, 343), False, 'from logging import getLogger, StreamHandler, INFO\n'), ((504, 523)... |
import json
import os
import unittest
from unittest.mock import Mock
from appian_locust import AppianClient, AppianTaskSet
from appian_locust.helper import find_component_by_attribute_in_dict
from appian_locust import logger
from locust import Locust, TaskSet
from appian_locust._save_request_builder import save_builde... | [
"appian_locust.AppianTaskSet",
"locust.Locust",
"json.loads",
"os.path.realpath",
"appian_locust.logger.getLogger",
"locust.TaskSet",
"appian_locust._save_request_builder.save_builder"
] | [((434, 460), 'appian_locust.logger.getLogger', 'logger.getLogger', (['__name__'], {}), '(__name__)\n', (450, 460), False, 'from appian_locust import logger\n'), ((543, 569), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (559, 569), False, 'import os\n'), ((1279, 1306), 'locust.TaskSet', '... |
#!python3
#encoding:utf-8
import os
import time
import pytz
import requests
import json
import datetime
class Editor:
def __init__(self, db, client, user, repo):
self.__db = db
self.__client = client
self.__user = user
self.__repo = repo
def Edit(self, name, description, homepa... | [
"os.rename",
"datetime.datetime.now"
] | [((503, 552), 'os.rename', 'os.rename', (["('../' + self.__repo.Name)", "('../' + name)"], {}), "('../' + self.__repo.Name, '../' + name)\n", (512, 552), False, 'import os\n'), ((1154, 1185), 'datetime.datetime.now', 'datetime.datetime.now', (['pytz.utc'], {}), '(pytz.utc)\n', (1175, 1185), False, 'import datetime\n')] |
import pytest
from collections import namedtuple
from readtagger.findcluster import (
ClusterFinder,
ClusterManager
)
from readtagger.cli import findcluster
from .helpers import ( # noqa: F401
namedtuple_to_argv,
reference_fasta
)
INPUT = 'tagged_dm6.bam'
CORNERCASE = 'cornercase.bam'
CORNERCASE2 = '... | [
"readtagger.cli.findcluster.findcluster",
"readtagger.findcluster.ClusterManager",
"readtagger.findcluster.ClusterFinder",
"pytest.raises",
"collections.namedtuple"
] | [((1634, 1726), 'readtagger.findcluster.ClusterFinder', 'ClusterFinder', ([], {'input_path': 'input_path', 'max_proper_pair_size': 'DEFAULT_MAX_PROPER_PAIR_SIZE'}), '(input_path=input_path, max_proper_pair_size=\n DEFAULT_MAX_PROPER_PAIR_SIZE)\n', (1647, 1726), False, 'from readtagger.findcluster import ClusterFinde... |
import numpy as np
import pandas as pd
def load_word_embeding(embeding_file):
def get_coef(word, *coefs):
return word, np.asarray(coefs, dtype=np.float32)
return dict(get_coef(*s.strip().split(" ")) for s in open(embeding_file))
def tokenize(corpus, max_words, max_len):
from keras.preprocessing.tex... | [
"keras.preprocessing.sequence.pad_sequences",
"pandas.read_csv",
"numpy.asarray",
"numpy.zeros",
"keras.preprocessing.text.Tokenizer"
] | [((415, 445), 'keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {'num_words': 'max_words'}), '(num_words=max_words)\n', (424, 445), False, 'from keras.preprocessing.text import Tokenizer\n'), ((540, 575), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['data'], {'maxlen': 'max_len'}), '(data, max... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 23 01:39:09 2019
@author: Marina
"""
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
import preprocessing
dataDir = r'C:\Users\Marina\Desktop\HMTY\ΔΙΠΛΩΜΑΤΙΚΗ\EMG datasets\DB1-NINAPRO\Ninapro-DB1_Preprocessed'
X_data=[]
Y_data=[]
for su... | [
"matplotlib.pyplot.subplot",
"preprocessing.lpf",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.squeeze",
"matplotlib.pyplot.savefig"
] | [((1155, 1183), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 20)'}), '(figsize=(20, 20))\n', (1165, 1183), True, 'import matplotlib.pyplot as plt\n'), ((1623, 1658), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""ground_truth_db1.png"""'], {}), "('ground_truth_db1.png')\n", (1634, 1658), True, 'i... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: torch2trt/converters/interpolate/interpolate.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.descriptor.EnumValueDescriptor",
"google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper"
] | [((572, 598), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (596, 598), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2111, 2162), 'google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper', 'enum_type_wrapper.EnumTypeWrapper', (['_DATATYPEMES... |
from django.shortcuts import render,get_object_or_404
from .models import BlogArticles
# Create your views here.
def blog_title(request):
blogs = BlogArticles.objects.all()
# render 的第一个参数必须是request,然后是模板的位置和传送的数据,数据是用类字典的形式传送给模板
return render(request, "blog/titles.html", {"blogs": blogs})
def blog_arti... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404"
] | [((251, 304), 'django.shortcuts.render', 'render', (['request', '"""blog/titles.html"""', "{'blogs': blogs}"], {}), "(request, 'blog/titles.html', {'blogs': blogs})\n", (257, 304), False, 'from django.shortcuts import render, get_object_or_404\n'), ((415, 461), 'django.shortcuts.get_object_or_404', 'get_object_or_404',... |
import json
from wizPy import sender
class Light:
ip: str = ""
set_request: json = {"method": "setPilot", "params": {}}
get_request: json = {"method": "getPilot"}
def __init__(self, ip: str):
self.ip = ip
async def apply(self):
if self.set_request is None:
print(... | [
"wizPy.sender.send"
] | [((380, 418), 'wizPy.sender.send', 'sender.send', (['self.ip', 'self.set_request'], {}), '(self.ip, self.set_request)\n', (391, 418), False, 'from wizPy import sender\n'), ((1789, 1827), 'wizPy.sender.send', 'sender.send', (['self.ip', 'self.get_request'], {}), '(self.ip, self.get_request)\n', (1800, 1827), False, 'fro... |
"""
Lean classes to encapculate images
Author: Jeff
"""
from abc import ABCMeta, abstractmethod
import logging
import os
import cv2
import numpy as np
import PIL.Image as PImage
import matplotlib.pyplot as plt
import scipy.signal as ssg
import scipy.ndimage.filters as sf
import scipy.ndimage.interpolation as sni
impo... | [
"matplotlib.pyplot.title",
"numpy.load",
"numpy.sum",
"numpy.abs",
"numpy.argmax",
"skimage.morphology.medial_axis",
"numpy.ravel",
"matplotlib.pyplot.cm.tab20",
"numpy.iinfo",
"numpy.ones",
"numpy.isnan",
"cv2.fillPoly",
"cv2.warpAffine",
"matplotlib.pyplot.figure",
"numpy.mean",
"num... | [((675, 693), 'numpy.iinfo', 'np.iinfo', (['np.uint8'], {}), '(np.uint8)\n', (683, 693), True, 'import numpy as np\n'), ((5712, 5755), 'numpy.array', 'np.array', (['[self.height / 2, self.width / 2]'], {}), '([self.height / 2, self.width / 2])\n', (5720, 5755), True, 'import numpy as np\n'), ((7467, 7477), 'cv_bridge.C... |
import numpy as np
import scipy.interpolate as si
import astropy.units as u
import astropy.constants as constants
from astropy.modeling.blackbody import blackbody_lambda, blackbody_nu
from psisim import datadir
from psisim import spectrum
import psisim.nair as nair
class Telescope():
'''
A general class that d... | [
"psisim.nair.nMathar",
"astropy.units.spectral_density",
"numpy.shape",
"numpy.arange",
"astropy.modeling.blackbody.blackbody_lambda",
"scipy.interpolate.interp1d",
"psisim.spectrum.Spectrum",
"numpy.prod"
] | [((3661, 3752), 'psisim.nair.nMathar', 'nair.nMathar', (['wvs', 'self.pressure.value', 'self.temperature.value', 'self.relative_humidity'], {}), '(wvs, self.pressure.value, self.temperature.value, self.\n relative_humidity)\n', (3673, 3752), True, 'import psisim.nair as nair\n'), ((8361, 8400), 'astropy.modeling.bla... |
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "COSAL"
from misconceptions.pdUtils import functions
def process_file(file_path):
pd_functions = functions.get_pd_functions(file_path)
n_valid = 0
print("Processing %d functions from '%s' ... " % (len(pd_f... | [
"misconceptions.pdUtils.functions.process_pd_function",
"misconceptions.pdUtils.functions.save_function",
"os.path.abspath",
"misconceptions.pdUtils.functions.get_pd_functions",
"misconceptions.pdUtils.functions.parse_function_for_col_names"
] | [((38, 58), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (53, 58), False, 'import os\n'), ((208, 245), 'misconceptions.pdUtils.functions.get_pd_functions', 'functions.get_pd_functions', (['file_path'], {}), '(file_path)\n', (234, 245), False, 'from misconceptions.pdUtils import functions\n'), ((3... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from torch.autograd import Variable
import sys
class ConcreteDropout(nn.Module):
"""This module allows... | [
"argparse.ArgumentParser",
"torch.nn.init.uniform_",
"torch.nn.functional.sigmoid",
"torch.device",
"torchvision.transforms.Normalize",
"torch.no_grad",
"numpy.prod",
"torch.utils.data.DataLoader",
"torch.exp",
"torch.Tensor",
"torch.nn.Linear",
"torch.log",
"torch.manual_seed",
"torch.nn.... | [((8294, 8354), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), "(description='PyTorch MNIST Example')\n", (8317, 8354), False, 'import argparse\n'), ((9596, 9624), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (9613, 9624), F... |
from matrx.logger.logger import GridWorldLogger, GridWorldLoggerV2
import copy
import json
class MessageLogger(GridWorldLogger):
""" Logs messages send and received by (all) agents """
def __init__(self, save_path="", file_name_prefix="", file_extension=".csv", delimeter=";"):
super().__init... | [
"copy.copy",
"json.dumps"
] | [((1496, 1534), 'copy.copy', 'copy.copy', (['self.log_statement_template'], {}), '(self.log_statement_template)\n', (1505, 1534), False, 'import copy\n'), ((3920, 3958), 'copy.copy', 'copy.copy', (['self.log_statement_template'], {}), '(self.log_statement_template)\n', (3929, 3958), False, 'import copy\n'), ((2441, 246... |
#par <NAME> et <NAME>
import string
import operator
phrase = input("phrase à décrypter : ")
print("1) caesar brute force")
print("2) caesar analyse de féquence")
print("3) Vigenere brute force")
print("4) Vigenere, sachant la taille de clé (13)")
option = input("methode de decryption :")
def cesar(chaine,decalage): # ... | [
"string.ascii_uppercase.index"
] | [((1436, 1472), 'string.ascii_uppercase.index', 'string.ascii_uppercase.index', (['lettre'], {}), '(lettre)\n', (1464, 1472), False, 'import string\n'), ((534, 570), 'string.ascii_uppercase.index', 'string.ascii_uppercase.index', (['lettre'], {}), '(lettre)\n', (562, 570), False, 'import string\n'), ((1004, 1040), 'str... |
#!/user/bin/env python3
import json
import random
import numpy as np
from .knng import KNNG
from .learn_hyperplane import LearnHyperPlane
'''
__Assume__
* Given `data_set`, dict object {index: data}
`data` is dict object, whose keys are:
* 'label' : `label_vector`, list object subset in [0,...,L-1]
* 'fe... | [
"json.load",
"numpy.zeros"
] | [((4091, 4107), 'numpy.zeros', 'np.zeros', (['self.L'], {}), '(self.L)\n', (4099, 4107), True, 'import numpy as np\n'), ((4789, 4801), 'json.load', 'json.load', (['f'], {}), '(f)\n', (4798, 4801), False, 'import json\n')] |
# coding=utf-8
# Copyright (C) 2010-2013 <NAME>.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import pkgutil
import importlib
import inspect
import logging
from collections import defaul... | [
"distutils.version.StrictVersion",
"importlib.import_module",
"inspect.isclass",
"os.path.dirname",
"lib.cuckoo.common.constants.CUCKOO_VERSION.split",
"lib.cuckoo.common.config.Config",
"collections.defaultdict",
"os.path.isfile",
"pkgutil.iter_modules",
"inspect.getmodule",
"os.path.splitext",... | [((949, 976), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (966, 976), False, 'import logging\n'), ((989, 1006), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1000, 1006), False, 'from collections import defaultdict\n'), ((1423, 1446), 'os.path.isfile', 'os.path... |
# Generated by Django 3.1.3 on 2020-11-30 12:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('registry', '0019_auto_20201130_1207'),
('gcs_operations', '0009_auto_20201130_1236'),
]
operations = [
... | [
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((432, 498), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""Flight Operation zwmizl"""', 'max_length': '(20)'}), "(default='Flight Operation zwmizl', max_length=20)\n", (448, 498), False, 'from django.db import migrations, models\n'), ((630, 769), 'django.db.models.ForeignKey', 'models.ForeignK... |
import pytest
from flaskbb import create_app
from flaskbb.configs.testing import TestingConfig as Config
from flaskbb.extensions import db
from flaskbb.utils.populate import create_default_groups, create_default_settings
@pytest.fixture(autouse=True)
def application():
"""application with context."""
app = c... | [
"flaskbb.utils.populate.create_default_settings",
"pytest.fixture",
"flaskbb.extensions.db.create_all",
"flaskbb.extensions.db.drop_all",
"flaskbb.create_app",
"flaskbb.utils.populate.create_default_groups"
] | [((225, 253), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (239, 253), False, 'import pytest\n'), ((415, 431), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (429, 431), False, 'import pytest\n'), ((528, 544), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (542, 544... |
"""Flask configurations"""
from os import environ
class Config:
"""Set common configuration"""
SECRET_KEY = environ.get("SECRET_KEY")
class PgConfig:
"""Configurations for production database
See configurations here: https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/
"""
SQLALCHEMY_... | [
"os.environ.get"
] | [((118, 143), 'os.environ.get', 'environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (129, 143), False, 'from os import environ\n'), ((351, 373), 'os.environ.get', 'environ.get', (['"""DB_USER"""'], {}), "('DB_USER')\n", (362, 373), False, 'from os import environ\n'), ((376, 402), 'os.environ.get', 'environ.g... |
#
# Copyright (c) 2020 JinTian.
#
# This file is part of alfred
# (see http://jinfagang.github.io).
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ... | [
"torch.isinf",
"torch.isnan"
] | [((1638, 1655), 'torch.isnan', 'torch.isnan', (['grad'], {}), '(grad)\n', (1649, 1655), False, 'import torch\n'), ((1665, 1682), 'torch.isinf', 'torch.isinf', (['grad'], {}), '(grad)\n', (1676, 1682), False, 'import torch\n')] |
import redis as r
import json
class RedisCache():
def __init__(self, event, redis=None):
self.event = event
self.redis = r.StrictRedis() if redis is None else redis
@property
def _state_key(self):
return '{}/{}'.format(self.event.source.type, self._message_id)
@property
d... | [
"redis.StrictRedis",
"json.dumps"
] | [((143, 158), 'redis.StrictRedis', 'r.StrictRedis', ([], {}), '()\n', (156, 158), True, 'import redis as r\n'), ((1238, 1254), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (1248, 1254), False, 'import json\n')] |
import warnings
from typing import List
from bokeh.embed import components
from bokeh.io import output_notebook
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, CustomJS, Range1d
from bokeh.models.widgets import DataTable, TableColumn, Select
from bokeh.plotting import show, figure
from... | [
"pandas.DataFrame",
"bokeh.models.ColumnDataSource",
"bokeh.io.output_notebook",
"warnings.simplefilter",
"scipy.stats.spearmanr",
"bokeh.models.Range1d",
"warnings.catch_warnings",
"bokeh.layouts.column",
"bokeh.models.widgets.Select",
"bokeh.models.widgets.TableColumn"
] | [((2496, 2569), 'pandas.DataFrame', 'DataFrame', ([], {'data': 'table', 'columns': 'self.budget_names', 'index': 'self.budget_names'}), '(data=table, columns=self.budget_names, index=self.budget_names)\n', (2505, 2569), False, 'from pandas import DataFrame\n'), ((3288, 3310), 'bokeh.models.ColumnDataSource', 'ColumnDat... |
import unittest
import sys
import os
import scipy.stats as stats
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
print(sys.path)
from cde.density_simulation import SkewNormal, GaussianMixture, EconDensity, JumpDiffusionModel, ArmaJump, LinearStudentT
from cde.utils... | [
"numpy.random.seed",
"tests.dummies.SimulationDummy",
"numpy.sum",
"numpy.abs",
"numpy.empty",
"numpy.allclose",
"cde.density_simulation.SkewNormal",
"numpy.ones",
"dill.loads",
"cde.utils.integration.mc_integration_student_t",
"cde.density_simulation.GaussianMixture",
"cde.model_fitting.Confi... | [((14944, 14987), 'numpy.zeros', 'np.zeros', (['(x_cond.shape[0], density.ndim_y)'], {}), '((x_cond.shape[0], density.ndim_y))\n', (14952, 14987), True, 'import numpy as np\n'), ((15380, 15439), 'numpy.zeros', 'np.zeros', (['(x_cond.shape[0], density.ndim_y, density.ndim_y)'], {}), '((x_cond.shape[0], density.ndim_y, d... |
from sa._version import __version__
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="Source Assist",
version=__version__,
author="<NAME>",
author_email="",
description="A DevOps automation tool... | [
"setuptools.find_packages"
] | [((766, 781), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (779, 781), False, 'from setuptools import setup, find_packages\n')] |
from abc import ABCMeta, abstractmethod
from typing import Union
from binance.exceptions import MarginTradingError
from binance.utils import format_time, interval_to_ms
class MarginAccountEndpoints(metaclass = ABCMeta):
@property
@abstractmethod
def request_handler(self):
pass
@property
@a... | [
"binance.exceptions.MarginTradingError",
"binance.utils.format_time"
] | [((1040, 1115), 'binance.exceptions.MarginTradingError', 'MarginTradingError', (['"""Cross Margin transfer called with a type not in [1,2]"""'], {}), "('Cross Margin transfer called with a type not in [1,2]')\n", (1058, 1115), False, 'from binance.exceptions import MarginTradingError\n'), ((2552, 2641), 'binance.except... |
#!/usr/bin/env python
import argparse
import os
from DirectoryManipulator import DirectoryManipulator
from Predictor import Predictor
def load(positive_class, negative_class):
"""
Helper function that loads in the model and creates a DirectoryManipulator.
:return: The model and a DirectoryManipulator.
... | [
"argparse.ArgumentParser",
"os.path.isdir",
"DirectoryManipulator.DirectoryManipulator",
"os.path.isfile",
"os.path.join",
"Predictor.Predictor",
"argparse.ArgumentTypeError"
] | [((406, 532), 'Predictor.Predictor', 'Predictor', (['"""models\\\\inceptionResNetV2_optimized_h5\\\\inceptionResNetV2_optimized.h5"""', '(positive_class, negative_class)'], {}), "(\n 'models\\\\inceptionResNetV2_optimized_h5\\\\inceptionResNetV2_optimized.h5',\n (positive_class, negative_class))\n", (415, 532), F... |
from django.contrib.auth.decorators import login_required
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from .models import Document
class DocumentCreateView(CreateView):
model = Document
fields = ['upload', ]
success_url = reverse_lazy('home')
def get_context... | [
"django.urls.reverse_lazy"
] | [((279, 299), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""home"""'], {}), "('home')\n", (291, 299), False, 'from django.urls import reverse_lazy\n')] |
"""
<NAME> (2011) Columbia University
<EMAIL>
This code contains functions to normalize an artist name,
and possibly a song title.
This is intended to do metadata matching.
It is mostly an elaborate hack, I never did an extensive search of
all problematic name matches.
Code developed using Python 2.6 on a Ubuntu mach... | [
"Levenshtein.distance",
"unicodedata.normalize",
"itertools.permutations",
"re.compile"
] | [((1765, 1782), 're.compile', 're.compile', (['"""\\\\s"""'], {}), "('\\\\s')\n", (1775, 1782), False, 'import re\n'), ((1819, 1836), 're.compile', 're.compile', (['"""\\\\W"""'], {}), "('\\\\W')\n", (1829, 1836), False, 'import re\n'), ((2294, 2329), 're.compile', 're.compile', (['"""(.+)\\\\s(".+?")\\\\s(.+)"""'], {}... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # MODFLOW Tutorial 1: Confined Steady-S... | [
"flopy.modflow.ModflowOc",
"flopy.modflow.ModflowPcg",
"flopy.plot.PlotMapView",
"flopy.modflow.ModflowDis",
"numpy.ones",
"flopy.modflow.ModflowLpf",
"flopy.utils.binaryfile.HeadFile",
"matplotlib.pyplot.figure",
"flopy.modflow.ModflowBas",
"numpy.arange",
"numpy.linspace",
"flopy.utils.binar... | [((1523, 1574), 'flopy.modflow.Modflow', 'flopy.modflow.Modflow', (['modelname'], {'exe_name': '"""mf2005"""'}), "(modelname, exe_name='mf2005')\n", (1544, 1574), False, 'import flopy\n'), ((1839, 1872), 'numpy.linspace', 'np.linspace', (['ztop', 'zbot', '(nlay + 1)'], {}), '(ztop, zbot, nlay + 1)\n', (1850, 1872), Tru... |
# Copyright 2021 solo-learn development team.
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to use,
# copy, modify, merge, publ... | [
"PIL.ImageFilter.GaussianBlur",
"torchvision.transforms.ColorJitter",
"torch.utils.data.DataLoader",
"random.uniform",
"torchvision.transforms.RandomHorizontalFlip",
"PIL.ImageOps.solarize",
"os.path.realpath",
"torchvision.transforms.Normalize",
"PIL.Image.open",
"torchvision.transforms.RandomGra... | [((20960, 21085), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataset'], {'batch_size': 'batch_size', 'shuffle': '(True)', 'num_workers': 'num_workers', 'pin_memory': '(True)', 'drop_last': '(True)'}), '(train_dataset, batch_size=batch_size, shuffle=True, num_workers=\n num_workers, pin_memory=True, drop_l... |
# Generated by Django 2.0.2 on 2018-02-20 08:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('epsilon', '0005_post_content_html'),
]
operations = [
migrations.AddField(
model_name='post',
name='pv',
... | [
"django.db.models.PositiveIntegerField"
] | [((327, 384), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'default': '(0)', 'verbose_name': '"""pv"""'}), "(default=0, verbose_name='pv')\n", (354, 384), False, 'from django.db import migrations, models\n'), ((498, 555), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerF... |
from unittest import TestCase
from src.heap import FasterMinHeap
class TestFasterBinaryMinHeap(TestCase):
def test_init(self):
heap = FasterMinHeap([14, 5, 7, 18, 42, 12, 11, 18, 29])
self.assertEqual([5, 14, 7, 18, 42, 12, 11, 18, 29], heap.as_list())
def test_push(self):
heap = Fa... | [
"src.heap.FasterMinHeap"
] | [((150, 199), 'src.heap.FasterMinHeap', 'FasterMinHeap', (['[14, 5, 7, 18, 42, 12, 11, 18, 29]'], {}), '([14, 5, 7, 18, 42, 12, 11, 18, 29])\n', (163, 199), False, 'from src.heap import FasterMinHeap\n'), ((318, 335), 'src.heap.FasterMinHeap', 'FasterMinHeap', (['[]'], {}), '([])\n', (331, 335), False, 'from src.heap i... |
import numpy as np
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as dts
import matplotlib.ticker as tck
import matplotlib.gridspec as grd
from scipy.optimize import root as solver
from scipy.optimize import curve_fit
class simulatePortfolio():
def dayIter(self, startDate):
"""Ite... | [
"matplotlib.pyplot.subplot",
"matplotlib.dates.MonthLocator",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"numpy.empty",
"matplotlib.dates.YearLocator",
"numpy.isnan",
"numpy.append",
"matplotlib.pyplot.figure",
"matplotlib.dates.DateFormatter",
"datetime.timedelta",
"matplotlib.ticker... | [((5186, 5204), 'numpy.empty', 'np.empty', (['(0)', 'float'], {}), '(0, float)\n', (5194, 5204), True, 'import numpy as np\n'), ((12032, 12060), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(11, 28)'}), '(figsize=(11, 28))\n', (12042, 12060), True, 'import matplotlib.pyplot as plt\n'), ((12068, 12078), '... |
import re
from cloudlift.exceptions import UnrecoverableException
from cloudlift.config import get_client_for
from cloudlift.config.logging import log_err
from cloudlift.utils import chunks
class ParameterStore(object):
def __init__(self, service_name, environment):
self.service_name = service_name
... | [
"cloudlift.exceptions.UnrecoverableException",
"cloudlift.config.logging.log_err",
"re.match",
"cloudlift.config.get_client_for",
"cloudlift.utils.chunks"
] | [((727, 761), 'cloudlift.config.get_client_for', 'get_client_for', (['"""ssm"""', 'environment'], {}), "('ssm', environment)\n", (741, 761), False, 'from cloudlift.config import get_client_for\n'), ((4981, 5070), 'cloudlift.exceptions.UnrecoverableException', 'UnrecoverableException', (['"""Environment variables valida... |
import datetime
import os
import json
import time as Time
import subprocess
from subprocess import Popen, PIPE
def upload_json_to_s3(paths: dict,
save_name: str,
selected_files: list):
"""Save json file to s3
Args:
paths (dict): dictionary of paths from yml ... | [
"json.dump",
"os.remove",
"subprocess.call",
"datetime.timedelta",
"os.path.join"
] | [((508, 563), 'os.path.join', 'os.path.join', (["paths['video_names']", "(save_name + '.json')"], {}), "(paths['video_names'], save_name + '.json')\n", (520, 563), False, 'import os\n'), ((1031, 1050), 'os.remove', 'os.remove', (['filepath'], {}), '(filepath)\n', (1040, 1050), False, 'import os\n'), ((607, 635), 'json.... |
'''
This module extends the RPyC module by own server implementations.
For further information read:
@author: <NAME>
'''
# Imports
import asyncio
import logging
import sys
# RPyC imports
try:
from rpyc.core import SocketStream, Channel, Connection
from rpyc.utils.registry import UDPRegistryClient
from rp... | [
"asyncio.start_server",
"asyncio.get_event_loop",
"asyncio.sleep",
"rpyc.utils.registry.UDPRegistryClient",
"freedm.utils.exceptions.freedmModuleImport",
"rpyc.core.SocketStream"
] | [((465, 486), 'freedm.utils.exceptions.freedmModuleImport', 'freedmModuleImport', (['e'], {}), '(e)\n', (483, 486), False, 'from freedm.utils.exceptions import freedmModuleImport\n'), ((5610, 5634), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (5632, 5634), False, 'import asyncio\n'), ((5652, 5... |
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_jwt_extended import JWTManager
from database.db import initialize_db
from flask_restful import Api
from resources.routes import initialize_routes
from flask_cors import CORS, cross_origin
app = Flask(__name__)
CORS(app)
app.config.from_envvar('ENV_FIL... | [
"flask_restful.Api",
"flask_jwt_extended.JWTManager",
"database.db.initialize_db",
"flask_cors.CORS",
"flask.Flask",
"resources.routes.initialize_routes",
"flask_bcrypt.Bcrypt"
] | [((263, 278), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (268, 278), False, 'from flask import Flask\n'), ((279, 288), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (283, 288), False, 'from flask_cors import CORS, cross_origin\n'), ((339, 347), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n... |
from rofl.functions.const import *
from rofl.functions.torch import *
from rofl.policies.dqn import dqnPolicy
from rofl.utils.drqn import recurrentArguments, unpackBatch, newZero
# TODO: change and review this code for obsDicts, validation still missing
def procState(state):
if isinstance(state, dict):
... | [
"rofl.utils.drqn.unpackBatch",
"rofl.utils.drqn.newZero",
"rofl.utils.drqn.recurrentArguments"
] | [((901, 961), 'rofl.utils.drqn.newZero', 'newZero', (['batch', '(units * layers)', 'size', 'net.device', 'lstm', 'grad'], {}), '(batch, units * layers, size, net.device, lstm, grad)\n', (908, 961), False, 'from rofl.utils.drqn import recurrentArguments, unpackBatch, newZero\n'), ((2874, 2900), 'rofl.utils.drqn.recurren... |
from django.shortcuts import render
from .models import Attraction
def index_main(request):
latest = Attraction.objects.all()
return render(request, "index.html", {"attractions": latest})
def index(request, pk):
current = Attraction.objects.get(id=pk)
name = current.name
description = current.d... | [
"django.shortcuts.render"
] | [((144, 198), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', "{'attractions': latest}"], {}), "(request, 'index.html', {'attractions': latest})\n", (150, 198), False, 'from django.shortcuts import render\n'), ((472, 508), 'django.shortcuts.render', 'render', (['request', '"""att.html"""', 'contex... |
import os.path as osp
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Sequential, Linear
import torch_geometric.transforms as T
from torch_geometric.data import DataLoader
from torch_geometric.nn import (GINConv,global_add_pool,GATConv,ChebConv,GCNConv)
import numpy as np
fro... | [
"numpy.abs",
"torch.cat",
"torch.ones",
"libs.spect_conv.SpectConv",
"torch_geometric.nn.ChebConv",
"torch_geometric.nn.GATConv",
"libs.spect_conv.ML3Layer",
"torch.nn.Linear",
"torch.matmul",
"torch_geometric.nn.global_add_pool",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.cuda.is_availa... | [((438, 504), 'libs.utils.SpectralDesign', 'SpectralDesign', ([], {'nmax': '(64)', 'recfield': '(1)', 'dv': '(2)', 'nfreq': '(5)', 'adddegree': '(True)'}), '(nmax=64, recfield=1, dv=2, nfreq=5, adddegree=True)\n', (452, 504), False, 'from libs.utils import PlanarSATPairsDataset, SpectralDesign\n'), ((511, 578), 'libs.u... |
import mysql.connector as mariadb
from openpyxl import load_workbook
from collections import defaultdict
conn = mariadb.connect(user='root', database='mpce1')
cur = conn.cursor()
initial_mapping = []
with open("C:/git/mpce-database-reform/hidden/deduplication_sheets/edition.xlsx", "rb") as pth:
wbk = load_workbo... | [
"openpyxl.load_workbook",
"mysql.connector.connect"
] | [((113, 159), 'mysql.connector.connect', 'mariadb.connect', ([], {'user': '"""root"""', 'database': '"""mpce1"""'}), "(user='root', database='mpce1')\n", (128, 159), True, 'import mysql.connector as mariadb\n'), ((309, 359), 'openpyxl.load_workbook', 'load_workbook', (['pth'], {'read_only': '(True)', 'keep_vba': '(Fals... |
#!/usr/bin/env python3
# Advent of Code 2020
# <NAME>
import sys # .stdin
import functools # .reduce
# ======================================================================
# HELPER FUNCTIONS
# ======================================================================
# (NONE)
# ========================... | [
"functools.reduce"
] | [((865, 911), 'functools.reduce', 'functools.reduce', (['(lambda a, b: a & b)', 'set_list'], {}), '(lambda a, b: a & b, set_list)\n', (881, 911), False, 'import functools\n')] |
from keras.layers import Input, Conv2D, MaxPool2D, UpSampling2D, Concatenate
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
import keras.backend as K
def __create_unet_model__(input_shape, filters = 64):
"""
Creates the U-Net model.
Args:... | [
"keras.callbacks.ModelCheckpoint",
"keras.backend.reshape",
"keras.layers.MaxPool2D",
"keras.backend.sum",
"keras.optimizers.Adam",
"keras.models.Model",
"keras.layers.Concatenate",
"keras.layers.Conv2D",
"keras.layers.UpSampling2D",
"keras.layers.Input"
] | [((550, 568), 'keras.layers.Input', 'Input', (['input_shape'], {}), '(input_shape)\n', (555, 568), False, 'from keras.layers import Input, Conv2D, MaxPool2D, UpSampling2D, Concatenate\n'), ((3224, 3247), 'keras.models.Model', 'Model', (['input_layer', 'out'], {}), '(input_layer, out)\n', (3229, 3247), False, 'from kera... |
#!/usr/bin/env python
#################################################################################################################
# Copyright 2019 Symantec Corporation. All rights reserved.
# Script to get Events
# You need to provide Client ID and Client Secret Key in config.ini file under Credentials sections, ... | [
"json.loads",
"os.getcwd",
"logging.StreamHandler",
"json.dumps",
"logging.Formatter",
"pathlib.Path",
"requests.get",
"requests.post",
"configparser.ConfigParser",
"logging.getLogger"
] | [((1156, 1213), 'logging.getLogger', 'logging.getLogger', (['"""cwa_getAccountsAssociatedWithOrgUnit"""'], {}), "('cwa_getAccountsAssociatedWithOrgUnit')\n", (1173, 1213), False, 'import logging\n'), ((1303, 1326), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1324, 1326), False, 'import logging\... |
import argparse
import logging
import re
logging.basicConfig(level=logging.INFO)
from common import config # import configuration
logger = logging.getLogger(__name__)
import news_page_objects as news
from requests.exceptions import HTTPError
from urllib3.exceptions import MaxRetryError
# Regular expressions... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"csv.writer",
"logging.getLogger",
"common.config",
"datetime.datetime.now",
"news_page_objects.HomePage",
"re.compile"
] | [((41, 80), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (60, 80), False, 'import logging\n'), ((147, 174), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (164, 174), False, 'import logging\n'), ((363, 393), 're.compile', 're.com... |
from . import db
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
from . import login_manager
from flask_login import UserMixin
from . import login_manager
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(U... | [
"werkzeug.security.check_password_hash",
"werkzeug.security.generate_password_hash"
] | [((872, 904), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (894, 904), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((962, 1011), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password_hash',... |
"""
This file contains the various low-level structure definitions used for sending
and receiving SCSI commands, as well as the structures required for
platform-specific APIs.
Where reasonable, the names of fields have been taken from the specifications
to ease reference searches.
"""
import ctypes
class InquiryComm... | [
"ctypes.sizeof"
] | [((11243, 11263), 'ctypes.sizeof', 'ctypes.sizeof', (['type_'], {}), '(type_)\n', (11256, 11263), False, 'import ctypes\n')] |
from __future__ import annotations
from collections.abc import MutableSequence
from typing import TYPE_CHECKING, Any, Generic, Tuple, TypeVar, Union
from qtpy.QtCore import QAbstractItemModel, QModelIndex, Qt
from ...utils.events import disconnect_events
from ...utils.events.containers import SelectableEventedList
f... | [
"typing.TypeVar",
"qtpy.QtCore.QModelIndex"
] | [((430, 449), 'typing.TypeVar', 'TypeVar', (['"""ItemType"""'], {}), "('ItemType')\n", (437, 449), False, 'from typing import TYPE_CHECKING, Any, Generic, Tuple, TypeVar, Union\n'), ((3116, 3129), 'qtpy.QtCore.QModelIndex', 'QModelIndex', ([], {}), '()\n', (3127, 3129), False, 'from qtpy.QtCore import QAbstractItemMode... |
# If you want to annoy your friend this project is just for you
# send some crappy movie script or birthday wishes just run once and send as many messeges you want
import webbrowser # for opening url in web browser
import pyautogui # for entering and sending messege
import time # we will neeed some sleep time for ... | [
"pyautogui.press",
"webbrowser.open",
"pyautogui.typewrite",
"time.sleep"
] | [((517, 537), 'webbrowser.open', 'webbrowser.open', (['url'], {}), '(url)\n', (532, 537), False, 'import webbrowser\n'), ((661, 675), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (671, 675), False, 'import time\n'), ((740, 764), 'pyautogui.typewrite', 'pyautogui.typewrite', (['msg'], {}), '(msg)\n', (759, 764)... |
# 6/30/16 by RoadrunnerWMC
# Maybe I can make something useful here :P
import itertools
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy
def get_closest_point(x0, y0, Ax, Ay, Bx, By):
"""
Return the point on the line segment defined by (Ax, A... | [
"itertools.tee",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1709, 1732), 'itertools.tee', 'itertools.tee', (['iterable'], {}), '(iterable)\n', (1722, 1732), False, 'import itertools\n'), ((3031, 3066), 'numpy.zeros', 'numpy.zeros', (['(numThings, numThings)'], {}), '((numThings, numThings))\n', (3042, 3066), False, 'import numpy\n'), ((3075, 3110), 'numpy.zeros', 'numpy.zero... |
# Solution of;
# Project Euler Problem 68: Magic 5-gon ring
# https://projecteuler.net/problem=68
#
# Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6,
# and each line adding to nine. Working clockwise, and starting from the group
# of three with the numerically lowest external node (4,3,2 i... | [
"timed.caller"
] | [((1248, 1282), 'timed.caller', 'timed.caller', (['dummy', 'n', 'i', 'prob_id'], {}), '(dummy, n, i, prob_id)\n', (1260, 1282), False, 'import timed\n')] |
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=255)
def __str__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=255)
author = models.ForeignKey(Author, on_delete=models.CASCADE)
def __str__(self):
... | [
"django.db.models.CharField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey"
] | [((70, 102), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (86, 102), False, 'from django.db import models\n'), ((191, 223), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (207, 223), False, 'from django.db ... |
"""add product_image model
Revision ID: 9cb36b52b9c5
Revises: <KEY>
Create Date: 2021-03-23 16:05:40.731083
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9cb36b52b9c5'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | [
"alembic.op.drop_table",
"alembic.op.f",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.String",
"sqlalchemy.Integer"
] | [((998, 1028), 'alembic.op.drop_table', 'op.drop_table', (['"""product_image"""'], {}), "('product_image')\n", (1011, 1028), False, 'from alembic import op\n'), ((588, 643), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['product_id']", "['product.id']"], {}), "(['product_id'], ['product.id'])\n", (6... |
from discord.ext import commands
from helpers import role_helper
import constants
class CreaterolemenuCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def createrolemenu(self, ctx, menu_type: str):
if ctx.message.author.id != constants.administra... | [
"helpers.role_helper.generate_components",
"discord.ext.commands.command",
"helpers.role_helper.generate_components_remove_roles"
] | [((187, 205), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (203, 205), False, 'from discord.ext import commands\n'), ((2253, 2304), 'helpers.role_helper.generate_components', 'role_helper.generate_components', (['suffix', 'emoji_dict'], {}), '(suffix, emoji_dict)\n', (2284, 2304), False, 'from ... |
from AuthenticationSystem.models.action_types import ActionTypes
from AuthenticationSystem.models.resources import Resources
from AuthenticationSystem.handlers.log import LogHandler
import AuthenticationSystem.handlers.exception as ExceptionHandler
class ValidationHandler():
""" Validation class """
def __init... | [
"AuthenticationSystem.handlers.exception.MissingUserException",
"AuthenticationSystem.handlers.exception.MissingResourcesException",
"AuthenticationSystem.handlers.exception.NoneValueException",
"AuthenticationSystem.handlers.exception.MissingActionTypeException",
"AuthenticationSystem.handlers.log.LogHandl... | [((354, 385), 'AuthenticationSystem.handlers.log.LogHandler.get_logger', 'LogHandler.get_logger', (['__name__'], {}), '(__name__)\n', (375, 385), False, 'from AuthenticationSystem.handlers.log import LogHandler\n'), ((980, 1036), 'AuthenticationSystem.handlers.exception.NoneValueException', 'ExceptionHandler.NoneValueE... |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | [
"plugins.tff_backend.bizz.iyo.utils.get_username",
"plugins.tff_backend.models.agenda.EventParticipant.get_or_create_participant",
"plugins.tff_backend.models.agenda.EventParticipant.list_by_event",
"mcfw.rpc.returns",
"mcfw.rpc.parse_complex_value",
"collections.defaultdict",
"mcfw.rpc.arguments",
"p... | [((982, 1006), 'mcfw.rpc.returns', 'returns', (['EventPresenceTO'], {}), '(EventPresenceTO)\n', (989, 1006), False, 'from mcfw.rpc import returns, arguments, parse_complex_value\n'), ((1008, 1057), 'mcfw.rpc.arguments', 'arguments', ([], {'params': 'dict', 'user_detail': 'UserDetailsTO'}), '(params=dict, user_detail=Us... |
import string
import random
import time
import pytest
import os
import subprocess
from os import path
# Provide a list of VMs you want to reuse. VMs should have already microk8s installed.
# the test will attempt a refresh to the channel requested for testing
# reuse_vms = ['vm-ldzcjb', 'vm-nfpgea', 'vm-pkgbtw']
reus... | [
"subprocess.check_output",
"pytest.fixture",
"random.choice",
"os.path.exists",
"time.sleep",
"os.environ.get",
"subprocess.check_call"
] | [((436, 484), 'os.environ.get', 'os.environ.get', (['"""CHANNEL_TO_TEST"""', '"""latest/edge"""'], {}), "('CHANNEL_TO_TEST', 'latest/edge')\n", (450, 484), False, 'import os\n'), ((495, 526), 'os.environ.get', 'os.environ.get', (['"""BACKEND"""', 'None'], {}), "('BACKEND', None)\n", (509, 526), False, 'import os\n'), (... |
#!/usr/bin/env python
import os
def tryunlink(*args):
fn = os.path.join(*args)
if os.path.exists(fn):
os.unlink(fn)
def main():
for root, dirs, files in os.walk("."):
if ".git" in dirs:
dirs.remove(".git")
for x in files:
if os.path.splitext(x)[-1] == ".pyc":
tryunlink(root, ... | [
"os.unlink",
"os.walk",
"os.path.exists",
"os.path.splitext",
"os.path.join"
] | [((62, 81), 'os.path.join', 'os.path.join', (['*args'], {}), '(*args)\n', (74, 81), False, 'import os\n'), ((87, 105), 'os.path.exists', 'os.path.exists', (['fn'], {}), '(fn)\n', (101, 105), False, 'import os\n'), ((169, 181), 'os.walk', 'os.walk', (['"""."""'], {}), "('.')\n", (176, 181), False, 'import os\n'), ((111,... |
##
# \file evaluate_slice_residual_similarity.py
# \brief Evaluate similarity to a reference of one or more images
#
# \author <NAME> (<EMAIL>)
# \date Feb 2018
#
import os
import numpy as np
import pandas as pd
import SimpleITK as sitk
import pysitk.python_helper as ph
import pysitk.simple_itk_helper ... | [
"niftymic.base.data_reader.MultipleImagesReader",
"niftymic.utilities.intensity_correction.IntensityCorrection",
"numpy.set_printoptions",
"os.path.abspath",
"os.path.basename",
"niftymic.validation.residual_evaluator.ResidualEvaluator",
"niftymic.base.stack.Stack.from_filename",
"pysitk.python_helper... | [((657, 674), 'pysitk.python_helper.start_timing', 'ph.start_timing', ([], {}), '()\n', (672, 674), True, 'import pysitk.python_helper as ph\n'), ((704, 736), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (723, 736), True, 'import numpy as np\n'), ((741, 777), 'pandas.s... |
import pandas as pd
import altair as alt
from altair import Chart
from typing import List
def plot_importance(
features: List[str],
importance: List[float],
target: str='',
num: int=10
) -> Chart:
source = pd.DataFrame(
data = {'feature': features, 'importance': importance}
... | [
"pandas.DataFrame",
"altair.Y",
"altair.Chart",
"altair.X",
"altair.Tooltip"
] | [((350, 400), 'altair.Chart', 'alt.Chart', ([], {'data': 'source', 'title': 'f"""Target = {target}"""'}), "(data=source, title=f'Target = {target}')\n", (359, 400), True, 'import altair as alt\n'), ((240, 306), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "{'feature': features, 'importance': importance}"}), "(data... |
import pytest
from fastapi.testclient import TestClient
from web_api.models.layout import Layout
from web_api.server import app
client = TestClient(app)
def test_layout():
req_body = {
"root": "Goal",
"dependencies": [
["Goal", "Criterion A"],
["Goal", "Criterion B"],
... | [
"fastapi.testclient.TestClient"
] | [((139, 154), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (149, 154), False, 'from fastapi.testclient import TestClient\n')] |
# -*- coding: utf-8 -*-
import pytest
import json
import uuid
import re
import StringIO
from django.test import Client, TestCase, RequestFactory
from django.contrib.auth.models import Group, AnonymousUser
from django.contrib.auth import get_user
from django.core.management import call_command
import django_namespace_... | [
"django.core.management.call_command",
"StringIO.StringIO",
"peeringdb_server.models.Organization.objects.create"
] | [((2579, 2598), 'StringIO.StringIO', 'StringIO.StringIO', ([], {}), '()\n', (2596, 2598), False, 'import StringIO\n'), ((2607, 2662), 'django.core.management.call_command', 'call_command', (['"""pdb_geosync"""', '"""fac"""'], {'limit': '(1)', 'stdout': 'out'}), "('pdb_geosync', 'fac', limit=1, stdout=out)\n", (2619, 26... |
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright (c) 2018 Kalray
#
# Permission is here... | [
"metalibm_core.opt.p_size_datapath.solve_format_Comparison",
"metalibm_core.core.passes.Pass.register",
"metalibm_core.core.ml_operations.Conversion",
"metalibm_core.core.legalizer.minmax_legalizer_wrapper",
"metalibm_core.core.legalizer.subsignalsection_legalizer",
"metalibm_core.opt.p_size_datapath.Form... | [((5837, 5896), 'metalibm_core.utility.log_report.Log.report', 'Log.report', (['LOG_PASS_INFO', '"""Registering size_datapath pass"""'], {}), "(LOG_PASS_INFO, 'Registering size_datapath pass')\n", (5847, 5896), False, 'from metalibm_core.utility.log_report import Log\n'), ((5913, 5944), 'metalibm_core.core.passes.Pass.... |
from base64 import b64encode
from pathlib import PurePosixPath
from databricks_api import DatabricksAPI
from requests.exceptions import HTTPError
class DbcUploader:
def __init__(
self,
dbxApi: DatabricksAPI
):
self.__dbxApi = dbxApi
def upload(self, dbcContent: bytes, releasePath:... | [
"base64.b64encode"
] | [((363, 384), 'base64.b64encode', 'b64encode', (['dbcContent'], {}), '(dbcContent)\n', (372, 384), False, 'from base64 import b64encode\n')] |
#!/usr/bin/env python
#
# Copyright 2017 lyremelody
#
# 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... | [
"json.loads",
"requests.get"
] | [((2563, 2584), 'requests.get', 'requests.get', ([], {'url': 'url'}), '(url=url)\n', (2575, 2584), False, 'import requests\n'), ((3313, 3334), 'requests.get', 'requests.get', ([], {'url': 'url'}), '(url=url)\n', (3325, 3334), False, 'import requests\n'), ((2661, 2680), 'json.loads', 'json.loads', (['content'], {}), '(c... |
#******************************************************************************
# * Copyright (c) 2022
# * Author: <NAME>
# *****************************************************************************
# * This program is free software; you can redistribute it and/or modify it under
# * the terms of the GNU General Pub... | [
"sys.path.append",
"pythonx32.x32.BehringerX32",
"re.match",
"alsa_midi.SequencerClient"
] | [((1096, 1129), 'sys.path.append', 'sys.path.append', (['"""python-x32/src"""'], {}), "('python-x32/src')\n", (1111, 1129), False, 'import sys\n'), ((1130, 1173), 'sys.path.append', 'sys.path.append', (['"""python-x32/src/pythonx32"""'], {}), "('python-x32/src/pythonx32')\n", (1145, 1173), False, 'import sys\n'), ((138... |
"""
Doxyrunner Sphinx Plugin
########################
Copyright (c) 2021 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
Introduction
============
This Sphinx plugin can be used to run Doxygen build as part of the Sphinx build
process. It is meant to be used with other plugins such as ``breathe`` in ord... | [
"tempfile.NamedTemporaryFile",
"subprocess.Popen",
"re.match",
"sphinx.util.logging.getLogger",
"pathlib.Path",
"shutil.rmtree",
"re.sub",
"filecmp.dircmp",
"re.compile"
] | [((1958, 1985), 'sphinx.util.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1975, 1985), False, 'from sphinx.util import logging\n'), ((2614, 2659), 're.compile', 're.compile', (['"""^\\\\s*([A-Z0-9_]+)\\\\s*=\\\\s*(.*)$"""'], {}), "('^\\\\s*([A-Z0-9_]+)\\\\s*=\\\\s*(.*)$')\n", (2624, 265... |
import logging
import os
from subprocess import Popen, PIPE
from tempfile import TemporaryDirectory
def get_logger():
return logging.getLogger(__name__)
class PdfToPng(object):
def __init__(self, dpi=None, image_size=None, page_range=None):
self.dpi = dpi
self.image_size = image_size
... | [
"subprocess.Popen",
"tempfile.TemporaryDirectory",
"sciencebeam_gym.pdf.pdf_to_lxml_wrapper.download_if_not_exist",
"logging.basicConfig",
"os.path.join",
"os.listdir",
"logging.getLogger"
] | [((131, 158), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (148, 158), False, 'import logging\n'), ((1826, 1859), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""INFO"""'}), "(level='INFO')\n", (1845, 1859), False, 'import logging\n'), ((2006, 2064), 'sciencebeam_gym.pd... |
# Copyright (C) 2013-2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# propagated, or dist... | [
"bitcoinlib.core.x"
] | [((715, 728), 'bitcoinlib.core.x', 'x', (['hex_pubkey'], {}), '(hex_pubkey)\n', (716, 728), False, 'from bitcoinlib.core import x, b2x\n')] |
#The MIT License (MIT)
#
#Copyright (c) 2016 Xustyx
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, p... | [
"argparse.ArgumentParser",
"routeparser.RouteParser",
"routemanager.RouteManager",
"argparse.FileType",
"argparse.ArgumentTypeError"
] | [((1410, 1553), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Simulates a real gps route from waypoints file (CSV/KML) and exports it into outfile (CSV/KML)"""'}), "(description=\n 'Simulates a real gps route from waypoints file (CSV/KML) and exports it into outfile (CSV/KML)'\n )... |
import torch as th
import torch.nn as nn
import torch.functional as F
import dgl
import dgl.nn as dglnn
import sklearn.linear_model as lm
import sklearn.metrics as skm
import tqdm
class SAGE(nn.Module):
def __init__(self, in_feats, n_hidden, n_classes, n_layers, activation, dropout):
super().__init__()
... | [
"torch.nn.Dropout",
"tqdm.tqdm",
"torch.nn.ModuleList",
"dgl.nn.SAGEConv",
"sklearn.linear_model.LogisticRegression",
"sklearn.metrics.f1_score",
"dgl.dataloading.MultiLayerFullNeighborSampler"
] | [((3458, 3522), 'sklearn.linear_model.LogisticRegression', 'lm.LogisticRegression', ([], {'multi_class': '"""multinomial"""', 'max_iter': '(10000)'}), "(multi_class='multinomial', max_iter=10000)\n", (3479, 3522), True, 'import sklearn.linear_model as lm\n'), ((3613, 3670), 'sklearn.metrics.f1_score', 'skm.f1_score', (... |
#!/usr/bin/env python3
"""
The core IR types for datalog.
"""
from collections import namedtuple
from typing import Sequence, Tuple, Union
class Constant(namedtuple("Constant", ["value"])):
"""Representation of a constant for interpreter dispatching."""
class LVar(namedtuple("LVar", ["name"])):
"""Represe... | [
"collections.namedtuple"
] | [((158, 191), 'collections.namedtuple', 'namedtuple', (['"""Constant"""', "['value']"], {}), "('Constant', ['value'])\n", (168, 191), False, 'from collections import namedtuple\n'), ((275, 303), 'collections.namedtuple', 'namedtuple', (['"""LVar"""', "['name']"], {}), "('LVar', ['name'])\n", (285, 303), False, 'from co... |
#!/usr/bin/env python3
from __future__ import print_function
from __future__ import absolute_import
import os, sys, subprocess, re, datetime, glob, six
import click, boto3, fnmatch
import sqlite3
from taw.util import *
from taw.taw import * # This must be the end of imports
# ====================
# Exported Functi... | [
"datetime.datetime.strftime",
"click.argument",
"os.path.basename",
"subprocess.check_output",
"click.option",
"re.match",
"click.launch",
"sqlite3.connect",
"re.search",
"boto3.session.Session",
"six.iteritems",
"os.path.expanduser",
"fnmatch.fnmatch",
"subprocess.check_call"
] | [((599, 696), 'click.argument', 'click.argument', (['"""restype"""'], {'default': '"""instance"""', 'metavar': '"""[resource type (default: instance)]"""'}), "('restype', default='instance', metavar=\n '[resource type (default: instance)]')\n", (613, 696), False, 'import click, boto3, fnmatch\n'), ((693, 762), 'clic... |
import numpy as np
from Utility_Functions.Plots.PlotAccuracyWithDrifts import plot_accuracy_with_drifts
from Utility_Functions.Plots.PlotADWIN import plot_adwin
from Utility_Functions.Plots.PlotReconstructionErrorOverTime import plot_reconstruction_error_over_time
from Utility_Functions.Plots.PlotReconstructionErrorFor... | [
"numpy.mean",
"numpy.where",
"numpy.round",
"numpy.dtype"
] | [((2387, 2412), 'numpy.where', 'np.where', (['drift_decisions'], {}), '(drift_decisions)\n', (2395, 2412), True, 'import numpy as np\n'), ((3189, 3208), 'numpy.mean', 'np.mean', (['acc_vector'], {}), '(acc_vector)\n', (3196, 3208), True, 'import numpy as np\n'), ((1891, 2017), 'numpy.dtype', 'np.dtype', (["[('widths', ... |
import logging
import os
import pickle
import tempfile
import tornado.ioloop
from pyworker.tornado import MessageQueueDispatcher
def sum_splits(correlation_id, msg):
job_id = correlation_id.split(':', maxsplit=1)[0]
sections = msg['sections']
sum_counts = {}
for section in sections:
with ope... | [
"pyworker.tornado.MessageQueueDispatcher",
"pickle.load",
"tempfile.gettempdir",
"logging.getLogger"
] | [((742, 785), 'logging.getLogger', 'logging.getLogger', (['"""MessageQueueDispatcher"""'], {}), "('MessageQueueDispatcher')\n", (759, 785), False, 'import logging\n'), ((839, 914), 'pyworker.tornado.MessageQueueDispatcher', 'MessageQueueDispatcher', (["os.environ['AMQP_SERVER']", '"""sum-splits"""', 'sum_splits'], {}),... |
import os
import matplotlib.pyplot as plt
from hyperparams import MAX_STEPS
steps, rewards = [], []
def plot(step, reward, title):
steps.append(step)
rewards.append(reward)
plt.plot(steps, rewards, 'b-')
plt.title(title)
plt.xlabel('Steps')
plt.ylabel('Rewards')
plt.xlim((0, MAX_STEPS))... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"os.path.join"
] | [((194, 224), 'matplotlib.pyplot.plot', 'plt.plot', (['steps', 'rewards', '"""b-"""'], {}), "(steps, rewards, 'b-')\n", (202, 224), True, 'import matplotlib.pyplot as plt\n'), ((228, 244), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (237, 244), True, 'import matplotlib.pyplot as plt\n'), ((248... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.