code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.db.models.deletion import CASCADE
from django.db.models.signals import post_save
from django.dispatch import receiver
class CustomUser(AbstractUser):
user_type_data=(('1',"Manager"),('2',"Guard"),('3',"Customer"))
user... | [
"django.db.models.OneToOneField",
"django.db.models.Manager",
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.db.mo... | [((3471, 3509), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'CustomUser'}), '(post_save, sender=CustomUser)\n', (3479, 3509), False, 'from django.dispatch import receiver\n'), ((3948, 3986), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'CustomUser'}), '(post_save, sender=Cus... |
import face_recognition
import cv2
from PIL import Image, ImageDraw, ImageFont
import sys
import pandas as pd
import datetime
import pygame
# Module 1 Reference Data Load Module
ef = pd.read_csv('./DataFiles/Employee.csv')
empno = ef["Employee No"].tolist()
firstname = ef["First Name"].tolist()
lastname = ef["Last Name... | [
"PIL.Image.fromarray",
"pygame.mixer.music.play",
"pygame.mixer.music.pause",
"pandas.read_csv",
"PIL.ImageFont.load_default",
"sys.exit",
"pygame.mixer.music.queue",
"datetime.datetime.now",
"PIL.ImageDraw.Draw",
"face_recognition.face_encodings",
"cv2.VideoCapture",
"face_recognition.load_im... | [((183, 222), 'pandas.read_csv', 'pd.read_csv', (['"""./DataFiles/Employee.csv"""'], {}), "('./DataFiles/Employee.csv')\n", (194, 222), True, 'import pandas as pd\n'), ((635, 654), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (651, 654), False, 'import cv2\n'), ((781, 830), 'face_recognition.load_ima... |
from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools
from sys import platform
import re
import os
class DarknetConan(ConanFile):
name = "darknet"
version = "git61c9d02"
license = "MIT"
url = "https://github.com/pjreddie/darknet"
description = "Darknet is an open source neural netw... | [
"conans.tools.Git",
"conans.AutoToolsBuildEnvironment",
"conans.tools.SystemPackageTool"
] | [((1048, 1059), 'conans.tools.Git', 'tools.Git', ([], {}), '()\n', (1057, 1059), False, 'from conans import ConanFile, CMake, AutoToolsBuildEnvironment, tools\n'), ((2960, 2991), 'conans.AutoToolsBuildEnvironment', 'AutoToolsBuildEnvironment', (['self'], {}), '(self)\n', (2985, 2991), False, 'from conans import ConanFi... |
import time
import json
import models.resnet_model as resnet_model
from cleverhans.attacks_tf import fgm
from models.madry_mnist import MadryModel
from models.aditi_mnist import AditiMNIST
from models.zico_mnist import ZicoMNIST
from utils import *
from adv_utils import *
from models.vgg16 import vgg_16
from models.acw... | [
"models.aditi_mnist.AditiMNIST",
"models.zico_mnist.ZicoMNIST",
"models.madry_mnist.MadryModel",
"models.resnet_model.ResNet",
"argparse.ArgumentParser",
"models.acwgan_gp.ACWGAN_GP",
"time.sleep",
"models.resnet_model.HParams",
"models.vgg16.vgg_16"
] | [((400, 458), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Generative Adversarial Examples"""'], {}), "('Generative Adversarial Examples')\n", (423, 458), False, 'import argparse\n'), ((3277, 3332), 'models.resnet_model.ResNet', 'resnet_model.ResNet', (['hps', 'images_standardized', 'training'], {}), '(h... |
#!/usr/bin/env python3
"""Creating a dataframe from a dict or list."""
import pandas as pd
d = {"a": [1, 2, 3],
"b": [4, 5, 6],
"c": [7, 8, 9]}
l = [[1,4,7],
[2,5,8],
[3,6,9]]
df = pd.DataFrame(d)
print(df)
df = pd.DataFrame(l)
df.columns = ['a', 'b', 'c']
print(df)
# a b c
# 0 1 4 7
#... | [
"pandas.DataFrame"
] | [((205, 220), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (217, 220), True, 'import pandas as pd\n'), ((237, 252), 'pandas.DataFrame', 'pd.DataFrame', (['l'], {}), '(l)\n', (249, 252), True, 'import pandas as pd\n')] |
'''
Visualizing your data
Since 1800, life expectancy around the globe has been steadily going up. You would expect the Gapminder data to confirm this.
The DataFrame g1800s has been pre-loaded. Your job in this exercise is to create a scatter plot with life expectancy in '1800' on the x-axis and life expectancy in '1... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim"
] | [((1033, 1071), 'pandas.read_csv', 'pd.read_csv', (['"""../_datasets/g1800s.csv"""'], {}), "('../_datasets/g1800s.csv')\n", (1044, 1071), True, 'import pandas as pd\n'), ((1230, 1278), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Life Expectancy by Country in 1800"""'], {}), "('Life Expectancy by Country in 1800')\n... |
import json
import logging
import os
from unittest import mock
from elastic.cobalt_strike_extractor.extractor import CSBeaconExtractor
logger = logging.getLogger()
def test_transform_beacon(shared_datadir):
with mock.patch.dict(
os.environ,
{
"INPUT_ELASTICSEARCH_ENABLED": "False",
... | [
"logging.getLogger",
"json.loads",
"unittest.mock.patch.dict",
"elastic.cobalt_strike_extractor.extractor.CSBeaconExtractor"
] | [((146, 165), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (163, 165), False, 'import logging\n'), ((220, 368), 'unittest.mock.patch.dict', 'mock.patch.dict', (['os.environ', "{'INPUT_ELASTICSEARCH_ENABLED': 'False', 'OUTPUT_ELASTICSEARCH_ENABLED':\n 'False', 'OUTPUT_CONSOLE_ENABLED': 'True'}"], {}), ... |
"""The CranPort class that understands the CRAN package format."""
from pathlib import Path
from re import compile as re_compile
from tarfile import TarFile
from traceback import print_exc
from typing import Callable, Dict, Optional, Union, cast
from .uses import Cran
from ..core import Port, PortDepends, PortError, Po... | [
"traceback.print_exc",
"typing.cast",
"re.compile"
] | [((1820, 1860), 're.compile', 're_compile', (['"""^\\\\* (?:R|man|src)/[^:]*:$"""'], {}), "('^\\\\* (?:R|man|src)/[^:]*:$')\n", (1830, 1860), True, 'from re import compile as re_compile\n'), ((2256, 2298), 're.compile', 're_compile', (['"""([\\\\w.]+)(?:\\\\s*\\\\((.*)\\\\))?"""'], {}), "('([\\\\w.]+)(?:\\\\s*\\\\((.*)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy import signal
import copy
"""
___author__ = "<NAME>, <NAME>"
__email__ = <EMAIL>"
"""
def randRange(x1, x2, integer):
y = np.random.uniform(low=x1, high=x2, size=(1,))
if integer:
y = int(y)
return y
def normWav(x,alwa... | [
"numpy.random.normal",
"numpy.mean",
"numpy.random.rand",
"numpy.power",
"numpy.linalg.norm",
"numpy.pad",
"scipy.signal.lfilter",
"numpy.random.uniform",
"copy.deepcopy",
"scipy.signal.freqz",
"numpy.random.permutation"
] | [((207, 252), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'x1', 'high': 'x2', 'size': '(1,)'}), '(low=x1, high=x2, size=(1,))\n', (224, 252), True, 'import numpy as np\n'), ((1034, 1059), 'scipy.signal.freqz', 'signal.freqz', (['b', '(1)'], {'fs': 'fs'}), '(b, 1, fs=fs)\n', (1046, 1059), False, 'from scip... |
import comet_ml # noqa: F401
import pytest
import numpy as np
import torch
from conftest import create_dataset, create_image
from traintool.image_classification.preprocessing import (
recognize_data_format,
torch_to_numpy,
numpy_to_torch,
files_to_numpy,
files_to_torch,
load_image,
recogn... | [
"conftest.create_image",
"traintool.image_classification.preprocessing.load_image",
"numpy.allclose",
"traintool.image_classification.preprocessing.files_to_torch",
"conftest.create_dataset",
"traintool.image_classification.preprocessing.recognize_image_format",
"traintool.image_classification.preproces... | [((408, 468), 'conftest.create_dataset', 'create_dataset', ([], {'data_format': '"""numpy"""', 'seed': '(0)', 'grayscale': '(False)'}), "(data_format='numpy', seed=0, grayscale=False)\n", (422, 468), False, 'from conftest import create_dataset, create_image\n'), ((516, 576), 'conftest.create_dataset', 'create_dataset',... |
from cms.models.pluginmodel import CMSPlugin
from django.db import models
class VerticalSpacerPlugin(CMSPlugin):
smart_space = models.PositiveIntegerField(
"Default Space",
default=0,
help_text="in px, for desktop, height on other devices is calculated automatically",
)
space_xs =... | [
"django.db.models.PositiveIntegerField"
] | [((133, 278), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', (['"""Default Space"""'], {'default': '(0)', 'help_text': '"""in px, for desktop, height on other devices is calculated automatically"""'}), "('Default Space', default=0, help_text=\n 'in px, for desktop, height on other devices is... |
from __future__ import absolute_import, division, print_function
import pandas as pd
from plotnine import ggplot, aes, geom_abline, geom_point, theme
df = pd.DataFrame({
'slope': [1, 1],
'intercept': [1, -1],
'x': [-1, 1],
'y': [-1, 1],
'z': range(2)
})
_theme = theme(sub... | [
"plotnine.geom_point",
"plotnine.aes",
"plotnine.theme",
"plotnine.geom_abline"
] | [((311, 349), 'plotnine.theme', 'theme', ([], {'subplots_adjust': "{'right': 0.85}"}), "(subplots_adjust={'right': 0.85})\n", (316, 349), False, 'from plotnine import ggplot, aes, geom_abline, geom_point, theme\n'), ((1321, 1340), 'plotnine.geom_abline', 'geom_abline', ([], {'size': '(2)'}), '(size=2)\n', (1332, 1340),... |
import numpy as np
from numpy import ndarray
from base_ada_classifier import BaseClassifier
class RandomClassifier(BaseClassifier):
_feature_index: int = None
_feature_value: float = None
_max_cycle = 1000
def __init__(self, w: ndarray, norm_factor = 1):
super(RandomClassifier, self).__init__(... | [
"numpy.ones",
"numpy.random.choice",
"numpy.max",
"numpy.random.randint",
"numpy.min",
"numpy.arange"
] | [((474, 506), 'numpy.random.randint', 'np.random.randint', (['(0)', 'n_features'], {}), '(0, n_features)\n', (491, 506), True, 'import numpy as np\n'), ((523, 544), 'numpy.min', 'np.min', (['X[:, f_index]'], {}), '(X[:, f_index])\n', (529, 544), True, 'import numpy as np\n'), ((561, 582), 'numpy.max', 'np.max', (['X[:,... |
import pandas as pd
from Bio import SeqIO
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.cluster import MeanShift
from sklearn import preprocessing
import matplotlib.pyplot as plt
import... | [
"pandas.Series",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.xlabel",
"warnings.catch_warnings",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.close",
"sklearn.feature_extraction.text.... | [((514, 531), 'pandas.DataFrame', 'pd.DataFrame', (['[d]'], {}), '([d])\n', (526, 531), True, 'import pandas as pd\n'), ((541, 570), 'pandas.Series', 'pd.Series', (['d'], {'name': '"""Sequence"""'}), "(d, name='Sequence')\n", (550, 570), True, 'import pandas as pd\n'), ((626, 641), 'pandas.DataFrame', 'pd.DataFrame', (... |
import math
vineyard_area = int(input())
production_area = vineyard_area * (40 / 100)
kg_grape = float(input()) * production_area
vine_for_sale = int(input())
workers = int(input())
vine = kg_grape / 2.5
if vine >= vine_for_sale:
vine_left = vine - vine_for_sale
vine_for_workers = vine_left / workers
prin... | [
"math.ceil",
"math.floor"
] | [((361, 377), 'math.floor', 'math.floor', (['vine'], {}), '(vine)\n', (371, 377), False, 'import math\n'), ((389, 409), 'math.ceil', 'math.ceil', (['vine_left'], {}), '(vine_left)\n', (398, 409), False, 'import math\n'), ((441, 468), 'math.ceil', 'math.ceil', (['vine_for_workers'], {}), '(vine_for_workers)\n', (450, 46... |
'''
Author: <NAME> @ CUHK-CSE
Homepage: https://dekura.github.io/
Date: 2020-12-25 17:52:17
LastEditTime: 2021-04-16 13:14:40
Contact: <EMAIL>
Description: the utils to calculate levelset parameters
Input:
target
Output:
levelset params
'''
import os
import sys
sys.path.append('/home/guojin/projects/develset_... | [
"torch.mul",
"torch.abs",
"PIL.Image.open",
"torch.stack",
"torch.sqrt",
"torch.from_numpy",
"torch.min",
"torch.tensor",
"torch.cuda.is_available",
"torch.arange",
"torch.div",
"time.time",
"torch.save",
"torchvision.transforms.ToTensor",
"sys.path.append",
"torch.zeros",
"torch.whe... | [((272, 338), 'sys.path.append', 'sys.path.append', (['"""/home/guojin/projects/develset_opc/levelset_net"""'], {}), "('/home/guojin/projects/develset_opc/levelset_net')\n", (287, 338), False, 'import sys\n'), ((2743, 2768), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2766, 2768), False, 'i... |
import re
from datetime import datetime, timedelta, timezone
from typing import Dict, List, Optional
from urllib.parse import unquote
import semver # type: ignore
from dateutil import parser
from gitlab.v4.objects import ( # type: ignore
Project,
ProjectIssue,
ProjectMergeRequest,
ProjectTag,
)
from ... | [
"dateutil.parser.parse",
"datetime.datetime.fromtimestamp",
"re.compile",
"jinja2.Template",
"semver.VersionInfo.parse",
"datetime.timedelta"
] | [((1281, 1302), 're.compile', 're.compile', (['"""[\\\\s_-]"""'], {}), "('[\\\\s_-]')\n", (1291, 1302), False, 'import re\n'), ((1428, 1464), 'jinja2.Template', 'Template', (['template'], {'trim_blocks': '(True)'}), '(template, trim_blocks=True)\n', (1436, 1464), False, 'from jinja2 import Template\n'), ((1931, 1964), ... |
from time import sleep
from expiring_dict import ExpiringDict
cache = ExpiringDict() # No TTL set, keys set via [] will not expire
cache["abc"] = "persistent"
cache.ttl("123", "expires", 1) # This will expire after 1 second
print("abc" in cache)
print("123" in cache)
sleep(1.1)
print("abc" in cache)
print("123" not... | [
"expiring_dict.ExpiringDict",
"time.sleep"
] | [((71, 85), 'expiring_dict.ExpiringDict', 'ExpiringDict', ([], {}), '()\n', (83, 85), False, 'from expiring_dict import ExpiringDict\n'), ((272, 282), 'time.sleep', 'sleep', (['(1.1)'], {}), '(1.1)\n', (277, 282), False, 'from time import sleep\n'), ((341, 356), 'expiring_dict.ExpiringDict', 'ExpiringDict', (['(1)'], {... |
from collections import OrderedDict
from lib import util
## Serializes all device atoms
def serialize(obj, state = None):
if state == None:
state = []
if isinstance(obj, Atom):
if obj in state:
return {
'object_ref': state.index(obj) + 1,
}
state.... | [
"lib.util.uuid_from_text",
"collections.OrderedDict"
] | [((637, 650), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (648, 650), False, 'from collections import OrderedDict\n'), ((1224, 1729), 'collections.OrderedDict', 'OrderedDict', (["[('application_version_name', 'none'), ('branch', 'alex/future'), (\n 'comment', ''), ('creator', 'Bitwig'), ('device_cate... |
"""Shared API."""
# pylint: disable=too-many-lines
from __future__ import annotations
import asyncio
from copy import copy
from re import search
from typing import Any, Text
from aiohttp.client import ClientError, ClientSession, ClientTimeout
from .const import (
ALL,
ATTR_DATA,
HEADERS,
HEADERS_JS,
... | [
"aiohttp.client.ClientTimeout",
"copy.copy",
"aiohttp.client.ClientSession",
"re.search"
] | [((2423, 2447), 'copy.copy', 'copy', (['host_configuration'], {}), '(host_configuration)\n', (2427, 2447), False, 'from copy import copy\n'), ((2888, 2903), 'aiohttp.client.ClientSession', 'ClientSession', ([], {}), '()\n', (2901, 2903), False, 'from aiohttp.client import ClientError, ClientSession, ClientTimeout\n'), ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
class BaseNotification(object):
_config = {}
_EVENTS = None
@classmethod
def update_config(cls, new_config):
cls._config.update(new_config)
@classmethod
def register_eventlog_events(cls, events):
cls._EVENTS = eve... | [
"logging.warn",
"logging.info"
] | [((3300, 3375), 'logging.info', 'logging.info', (['"""Redirect notifications: from %s to %s"""', 'targets', 'new_targets'], {}), "('Redirect notifications: from %s to %s', targets, new_targets)\n", (3312, 3375), False, 'import logging\n'), ((2947, 3001), 'logging.warn', 'logging.warn', (['"""no members found for group:... |
# ChangeLog
import os, sys
import tempfile
import re
import subprocess
from datetime import datetime
from dateutil import parser as dtparser
from pytz import timezone
import time
import math
import shutil
import json
from libpredweb import myfunc
from libpredweb import webserver_common as webcom
TZ = webcom.TZ
os.env... | [
"libpredweb.webserver_common.IsFrontEndNode",
"libpredweb.webserver_common.get_serverstatus",
"libpredweb.webserver_common.get_running",
"libpredweb.webserver_common.get_queue",
"sys.path.append",
"libpredweb.webserver_common.get_finished_job",
"django.shortcuts.render",
"os.path.exists",
"django.ht... | [((336, 348), 'time.tzset', 'time.tzset', ([], {}), '()\n', (346, 348), False, 'import time\n'), ((815, 841), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (831, 841), False, 'import os, sys\n'), ((924, 949), 'sys.path.append', 'sys.path.append', (['path_app'], {}), '(path_app)\n', (939, 9... |
from pymir import settings
from . import (
audio_sample, amplitude_envelop, amplitude_frequency, spectrogram
)
import os
def compute():
"""
Basic initial diagnose that compares an electric guitar
audio signal and synthetized drums across different
audio signal representations
"""
bass_s... | [
"os.path.join"
] | [((334, 412), 'os.path.join', 'os.path.join', (['settings.DATA_DIR', '"""audio"""', '"""shuffleblues"""', '"""bass_Selection.wav"""'], {}), "(settings.DATA_DIR, 'audio', 'shuffleblues', 'bass_Selection.wav')\n", (346, 412), False, 'import os\n'), ((457, 542), 'os.path.join', 'os.path.join', (['settings.DATA_DIR', '"""a... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CustomerOnDemandResource:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): T... | [
"huaweicloudsdkcore.utils.http_utils.sanitize_for_serialization",
"six.iteritems",
"sys.setdefaultencoding"
] | [((12431, 12464), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (12444, 12464), False, 'import six\n'), ((13449, 13480), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (13471, 13480), False, 'import sys\n'), ((13507, 13539), 'huaweic... |
import pytest
from redis.exceptions import WatchError
def test_ok(redis):
client = redis.ext.client
pipeline = client.pipeline()
pipeline.set('test', 1)
pipeline.sadd('test2', 2)
pipeline.execute()
assert client.get('test') == b'1'
assert redis.dict == {b'test': b'1', b'test2': {b'2'}}
... | [
"pytest.raises"
] | [((1419, 1478), 'pytest.raises', 'pytest.raises', (['WatchError'], {'match': '"""Watched variable changed"""'}), "(WatchError, match='Watched variable changed')\n", (1432, 1478), False, 'import pytest\n')] |
import numpy as np
import cv2 as cv
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
def read_gray_image(path):
img = cv.imread(path)
img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
plt.imshow(img_gray, cmap='gray', interpolation='nearest')
plt.savefig('./results/img_gray.png')
plt.clos... | [
"cv2.rectangle",
"cv2.warpPerspective",
"cv2.HoughLines",
"numpy.sin",
"matplotlib.pyplot.imshow",
"cv2.threshold",
"numpy.where",
"cv2.line",
"numpy.asarray",
"matplotlib.pyplot.close",
"cv2.matchTemplate",
"matplotlib.pyplot.savefig",
"cv2.getPerspectiveTransform",
"matplotlib.use",
"n... | [((54, 75), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (68, 75), False, 'import matplotlib\n'), ((148, 163), 'cv2.imread', 'cv.imread', (['path'], {}), '(path)\n', (157, 163), True, 'import cv2 as cv\n'), ((176, 211), 'cv2.cvtColor', 'cv.cvtColor', (['img', 'cv.COLOR_BGR2GRAY'], {}), '(img, c... |
from trex_stl_lib.api import *
import argparse
MIN_VLAN, MAX_VLAN = 1, (1 << 12) - 1
class Dot1QFieldEngine(object):
def create_streams(self, burst_size, pps, vlans):
"""
Get Single Burst Streams with given pps and burst size.
Args:
burst_size (int): Burst size for STL Sing... | [
"argparse.ArgumentParser"
] | [((1705, 1814), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(description=description, formatter_class=argparse.\n ArgumentDefaultsHelpFormatter)\n', (1728, 1814), False, 'import argparse\n')] |
import torch
from torch import nn
from torch.nn import Parameter
jit_scripts = {}
class StochasticModule(torch.nn.Module):
def __init__(self, *args, **kwargs):
super(StochasticModule, self).__init__(*args, **kwargs)
class BDropout(StochasticModule):
"""
Extends the base Dropout layer by ad... | [
"torch.bernoulli",
"torch.manual_seed",
"torch.log",
"torch.rand_like",
"torch.mv",
"torch.tensor",
"torch.nn.Parameter",
"torch.svd",
"torch.zeros",
"torch.randn"
] | [((3792, 3810), 'torch.rand_like', 'torch.rand_like', (['x'], {}), '(x)\n', (3807, 3810), False, 'import torch\n'), ((4352, 4374), 'torch.bernoulli', 'torch.bernoulli', (['probs'], {}), '(probs)\n', (4367, 4374), False, 'import torch\n'), ((12061, 12087), 'torch.nn.Parameter', 'torch.nn.Parameter', (['w.data'], {}), '(... |
# Copyright 2019, OpenTelemetry 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 or agreed to i... | [
"mock.patch.object",
"django.contrib.auth.models.User.objects.count",
"mock.call",
"time.time",
"oteltrace.contrib.django.patch.apply_django_patches"
] | [((1079, 1090), 'time.time', 'time.time', ([], {}), '()\n', (1088, 1090), False, 'import time\n'), ((1107, 1127), 'django.contrib.auth.models.User.objects.count', 'User.objects.count', ([], {}), '()\n', (1125, 1127), False, 'from django.contrib.auth.models import User\n'), ((1168, 1179), 'time.time', 'time.time', ([], ... |
from typing import List, Dict
import optimize
import launch
from configurator import configurator_enums, _configurator_base
import argparse
import functools
import ray
from os import path
import pathlib
import time
import json
import hashlib
import util
import argparse
N_WORKERS = 2
N_TRIALS = 8
EXPERIMENT_EXPORT_R... | [
"os.path.exists",
"argparse.ArgumentParser",
"pathlib.Path",
"launch.KubeContext",
"json.dumps",
"os.path.join",
"functools.partial",
"optimize.Optimizer",
"json.load",
"ray.init",
"time.time",
"json.dump"
] | [((2137, 2200), 'os.path.join', 'path.join', (['EXPERIMENT_EXPORT_RESULTS_DIRECTORY', 'experiment_name'], {}), '(EXPERIMENT_EXPORT_RESULTS_DIRECTORY, experiment_name)\n', (2146, 2200), False, 'from os import path\n'), ((2301, 2346), 'os.path.join', 'path.join', (['experiment_dir', '"""config_dump.json"""'], {}), "(expe... |
import mock
from nose.tools import eq_, assert_raises
from lib.validators import RegexValidator
import argparse
class TestRegexValidator:
def setup(self):
pattern = "1.2.3.4"
self.sut = RegexValidator(pattern)
def test_call_happy_path(self):
eq_("1.2.3.4", self.sut.__call__("1.2.3.4"... | [
"lib.validators.RegexValidator",
"nose.tools.assert_raises"
] | [((209, 232), 'lib.validators.RegexValidator', 'RegexValidator', (['pattern'], {}), '(pattern)\n', (223, 232), False, 'from lib.validators import RegexValidator\n'), ((370, 425), 'nose.tools.assert_raises', 'assert_raises', (['ValueError', 'self.sut.__call__', '"""a.b.c.d"""'], {}), "(ValueError, self.sut.__call__, 'a.... |
from aiogram.types import InlineKeyboardMarkup
from aiogram.types import InlineKeyboardButton
from aiogram.utils.callback_data import CallbackData
from data import all_emoji
cb_set_status_prmt = CallbackData('cb_set_status_prmt', 'type_btn')
def create_kb_set_status_permit():
keyboard = InlineKeyboardMarkup()
... | [
"aiogram.utils.callback_data.CallbackData",
"aiogram.types.InlineKeyboardMarkup"
] | [((198, 244), 'aiogram.utils.callback_data.CallbackData', 'CallbackData', (['"""cb_set_status_prmt"""', '"""type_btn"""'], {}), "('cb_set_status_prmt', 'type_btn')\n", (210, 244), False, 'from aiogram.utils.callback_data import CallbackData\n'), ((295, 317), 'aiogram.types.InlineKeyboardMarkup', 'InlineKeyboardMarkup',... |
# encoding: utf-8
from .datasets import build_dataset
from .samplers import build_sampler
from .collate_function import build_collate_fn
from torch.utils.data import DataLoader
def make_data_loader(cfg, is_train):
if cfg.DATA.DATASETS.NAMES == "none":
return None, None, None, None
# 0. config
da... | [
"torch.utils.data.DataLoader"
] | [((1382, 1528), 'torch.utils.data.DataLoader', 'DataLoader', (['train_set'], {'batch_size': 'train_batch_size', 'sampler': 'train_sampler', 'num_workers': 'num_workers', 'collate_fn': 'collate_fn', 'drop_last': 'drop_last'}), '(train_set, batch_size=train_batch_size, sampler=train_sampler,\n num_workers=num_workers,... |
import json
from flask import Blueprint, request
from services.database.DBConn import database
from security.JWT.symmetric import session_cookie
userDB = database.users
auth_api = Blueprint('auth_api', __name__)
@auth_api.route("/create_user", methods=['POST'])
def create_user():
"""Generated End-Point Sample
... | [
"flask.request.args.get",
"security.JWT.symmetric.session_cookie",
"json.dumps",
"flask.request.get_json",
"flask.Blueprint"
] | [((181, 212), 'flask.Blueprint', 'Blueprint', (['"""auth_api"""', '__name__'], {}), "('auth_api', __name__)\n", (190, 212), False, 'from flask import Blueprint, request\n'), ((451, 479), 'flask.request.get_json', 'request.get_json', ([], {'force': '(True)'}), '(force=True)\n', (467, 479), False, 'from flask import Blue... |
import os
import logging
import nose.tools
import angr
from angr.analyses.cfg_fast import Segment, SegmentList
l = logging.getLogger("angr.tests.test_cfgfast")
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
def cfg_fast_functions_check(arch, binary_path, fun... | [
"logging.getLogger",
"angr.Project",
"os.path.join",
"os.path.realpath",
"angr.analyses.cfg_fast.SegmentList"
] | [((119, 163), 'logging.getLogger', 'logging.getLogger', (['"""angr.tests.test_cfgfast"""'], {}), "('angr.tests.test_cfgfast')\n", (136, 163), False, 'import logging\n'), ((807, 853), 'os.path.join', 'os.path.join', (['test_location', 'arch', 'binary_path'], {}), '(test_location, arch, binary_path)\n', (819, 853), False... |
import sublime, sublime_plugin
import shlex, os
from ..libs import util
from ..libs import Terminal
from ..libs import javaScriptEnhancements
from ..libs.global_vars import *
class JavascriptEnhancementsExecuteOnTerminalCommand():
custom_name = ""
cli = ""
path_cli = ""
settings_name = ""
placeholders = {... | [
"os.path.expanduser",
"os.path.isabs",
"os.path.join",
"shlex.quote",
"sublime.platform",
"sublime.error_message"
] | [((3919, 3954), 'shlex.quote', 'shlex.quote', (['self.working_directory'], {}), '(self.working_directory)\n', (3930, 3954), False, 'import shlex, os\n'), ((4038, 4064), 'shlex.quote', 'shlex.quote', (['self.path_cli'], {}), '(self.path_cli)\n', (4049, 4064), False, 'import shlex, os\n'), ((4127, 4145), 'sublime.platfor... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
from .access_token import get_access_token
from .request import Broker
from .vocabulary import Batch as b
from .vocabulary import ThreatExchange as t
from .errors import (
pytxFetchError
)
class Batch(object):
"""
Class ... | [
"json.dumps"
] | [((3947, 3964), 'json.dumps', 'json.dumps', (['batch'], {}), '(batch)\n', (3957, 3964), False, 'import json\n')] |
__author__ = '<NAME>'
import multiprocessing as mp
import numpy as np
import os # For path names working under Windows and Linux
from pypet import Environment, cartesian_product
def multiply(traj, result_list):
"""Example of a sophisticated simulation that involves multiplying two values.
This time we will... | [
"pypet.Environment",
"pypet.cartesian_product",
"os.path.join",
"numpy.array",
"multiprocessing.Manager"
] | [((682, 721), 'os.path.join', 'os.path.join', (['"""hdf5"""', '"""example_12.hdf5"""'], {}), "('hdf5', 'example_12.hdf5')\n", (694, 721), False, 'import os\n'), ((732, 935), 'pypet.Environment', 'Environment', ([], {'trajectory': '"""Multiplication"""', 'filename': 'filename', 'file_title': '"""Example_12_Sharing_Data"... |
import tensorflow as tf
from tensorflow.keras.layers import (
Concatenate, Conv2D, LeakyReLU, UpSampling2D, ZeroPadding2D, BatchNormalization
)
"""
Part 1: Feature Extraction
"""
@tf.keras.utils.register_keras_serializable(package='Vision')
class ConvBlock(tf.keras.layers.Layer):
""" base conv includes paddi... | [
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.backend.image_data_format"
] | [((187, 247), 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""Vision"""'}), "(package='Vision')\n", (229, 247), True, 'import tensorflow as tf\n'), ((1553, 1613), 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras... |
import json
import gzip
from pathlib import Path
# JSON KEYS
DATASET_ID_JSON_KEY = "ds_id"
DATASET_TYPE_JSON_KEY = "type"
SLIDE_ID_JSON_KEY = "slide_id"
TILE_ID_JSON_KEY = "tile_id"
ANNOT_TYPE_JSON_KEY = "type"
ANNOT_X_JSON_KEY = "x"
ANNOT_Y_JSON_KEY = "y"
ANNOT_POSITIVITY_JSON_KEY = "positivity"
SLIDES_JSON_KEY = "sl... | [
"gzip.open"
] | [((2078, 2105), 'gzip.open', 'gzip.open', (['annotations_path'], {}), '(annotations_path)\n', (2087, 2105), False, 'import gzip\n')] |
import eventlet
eventlet.monkey_patch(socket=True, select=True, time=True)
import sys
import time
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_service import service as common_service
from oslo_utils import excutils
from neutron._i18n import _
from neut... | [
"neutron.common.config.set_config_defaults",
"time.ctime",
"oslo_utils.excutils.save_and_reraise_exception",
"neutron.common.config.init",
"neutron.common.rpc.get_client",
"neutron.common.rpc.create_connection",
"neutron.service.RpcWorker",
"neutron._i18n._LE",
"neutron.common.config.setup_logging",... | [((16, 74), 'eventlet.monkey_patch', 'eventlet.monkey_patch', ([], {'socket': '(True)', 'select': '(True)', 'time': '(True)'}), '(socket=True, select=True, time=True)\n', (37, 74), False, 'import eventlet\n'), ((1277, 1304), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1294, 1304)... |
import time
from pypresence import Presence
supported_games = [
"CUSA08519_00",
"CUSA20602_00"
]
system_names = {
"ps4_main": "PlayStation®4",
"ps5_main": "PlayStation®5",
}
class Integration:
def __init__(self, controller):
# Controller to access vars
self.controller = contro... | [
"pypresence.Presence",
"time.time"
] | [((817, 841), 'pypresence.Presence', 'Presence', (['app_id'], {'pipe': '(0)'}), '(app_id, pipe=0)\n', (825, 841), False, 'from pypresence import Presence\n'), ((979, 990), 'time.time', 'time.time', ([], {}), '()\n', (988, 990), False, 'import time\n'), ((1864, 1875), 'time.time', 'time.time', ([], {}), '()\n', (1873, 1... |
"""
@author: <NAME>, <NAME>
@note: Example semaphore object
@copyright: See LICENSE
"""
from concoord.threadingobject.dsemaphore import DSemaphore
class Semaphore():
def __init__(self, count=1):
self.semaphore = DSemaphore(count)
def __repr__(self):
return repr(self.semaphore)
def acquire... | [
"concoord.threadingobject.dsemaphore.DSemaphore"
] | [((225, 242), 'concoord.threadingobject.dsemaphore.DSemaphore', 'DSemaphore', (['count'], {}), '(count)\n', (235, 242), False, 'from concoord.threadingobject.dsemaphore import DSemaphore\n')] |
import random
# 顾客参加一个抽奖活动,三个关闭的门后面只有一个有奖品,顾客选择一个门之后,主持人会打开一个没有奖品的门,并给顾客一次改变选择的机会。
# 此时,改选另外一个门会得到更大的获奖几率么?
def door_and_prize(switch, loop_num):
win = 0
for loop in range(loop_num):
prize = random.randint(0, 2) # 随机生成奖品门
init_choice = random.randint(0, 2) # 初始选择的门
doors = [0, 1, 2] ... | [
"random.randint"
] | [((209, 229), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0, 2)\n', (223, 229), False, 'import random\n'), ((263, 283), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0, 2)\n', (277, 283), False, 'import random\n')] |
import sys
from niveristand import nivs_rt_sequence
from niveristand import realtimesequencetools
from niveristand.clientapi import BooleanValue, ChannelReference, DoubleValue, I32Value, I64Value, RealTimeSequence
from niveristand.errors import TranslateError, VeristandError
from niveristand.library.primitives import ... | [
"testutilities.rtseqrunner.run_rtseq_in_VM",
"niveristand.library.primitives.localhost_wait",
"testutilities.validation.test_validate",
"pytest.mark.parametrize",
"niveristand.clientapi.I64Value",
"niveristand.clientapi.DoubleValue",
"niveristand.clientapi.ChannelReference",
"niveristand.clientapi.Rea... | [((10295, 10383), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func_name, params, expected_result"""', 'run_tests'], {'ids': 'idfunc'}), "('func_name, params, expected_result', run_tests,\n ids=idfunc)\n", (10318, 10383), False, 'import pytest\n'), ((10711, 10799), 'pytest.mark.parametrize', 'pytest.m... |
'''
File: mcb.py
File Created: Tuesday, 11th December 2018 3:07:00 pm
Author: xss (<EMAIL>)
Description: A Python program to keep track of multiple
pieces of text. (mcb for multiclipboard)
-----
Last Modified: Tuesday, 11th December 2018 3:07:14 pm
Modified By: xss (<EMAIL>)
-----
''... | [
"os.path.isdir",
"os.path.join",
"os.mkdir"
] | [((709, 762), 'os.path.join', 'os.path.join', (['self.clipboard_dir', 'self.clipboard_name'], {}), '(self.clipboard_dir, self.clipboard_name)\n', (721, 762), False, 'import os\n'), ((602, 635), 'os.path.isdir', 'os.path.isdir', (['self.clipboard_dir'], {}), '(self.clipboard_dir)\n', (615, 635), False, 'import os\n'), (... |
from django.contrib import admin
# Register your models here.
from posts.models import Image, Location
class ImageAdmin(admin.ModelAdmin):
pass
admin.site.register(Image, ImageAdmin)
class ProjectAdmin(admin.ModelAdmin):
pass
class LocationAdmin(admin.ModelAdmin):
pass
admin.site.register(Locatio... | [
"django.contrib.admin.site.register"
] | [((153, 191), 'django.contrib.admin.site.register', 'admin.site.register', (['Image', 'ImageAdmin'], {}), '(Image, ImageAdmin)\n', (172, 191), False, 'from django.contrib import admin\n'), ((293, 337), 'django.contrib.admin.site.register', 'admin.site.register', (['Location', 'LocationAdmin'], {}), '(Location, Location... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Agency'
db.create_table('agency_agency', (
('id', self.gf('django.db.models.fiel... | [
"south.db.db.send_create_signal",
"django.db.models.ForeignKey",
"south.db.db.create_unique",
"django.db.models.AutoField",
"south.db.db.delete_table"
] | [((1354, 1397), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""agency"""', "['Agency']"], {}), "('agency', ['Agency'])\n", (1375, 1397), False, 'from south.db import db\n'), ((1779, 1850), 'south.db.db.create_unique', 'db.create_unique', (['"""agency_agency_contacts"""', "['agency_id', 'contact_id']"]... |
import sys
import re
from pathlib import Path
import logging
from typing import Optional, Union
import pandas as pd
logger = logging.getLogger(__name__)
class GradsCtl(object):
def __init__(self):
self.dset = None # data file path
self.dset_template = False
self.title = ''
sel... | [
"logging.getLogger",
"pathlib.Path",
"pandas.Timestamp.now",
"pandas.Timedelta",
"re.match",
"pandas.to_datetime"
] | [((128, 155), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (145, 155), False, 'import logging\n'), ((1660, 1679), 'pathlib.Path', 'Path', (['ctl_file_path'], {}), '(ctl_file_path)\n', (1664, 1679), False, 'from pathlib import Path\n'), ((8197, 8215), 'pandas.Timestamp.now', 'pd.Timestam... |
import sys
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
n = int(sys.argv[1])
genresDict = {}
groupFactor = 0
rangesTotal = []
allBigGroupRanges = []
for i in range(1, n+1, 3):
bigGroupDict = {}
bigGroupRanges = [0,0]
totalTagsCount = 0
for j in range(0, 3):
fileName = "... | [
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((2355, 2369), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2367, 2369), True, 'import matplotlib.pyplot as plt\n'), ((3026, 3036), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3034, 3036), True, 'import matplotlib.pyplot as plt\n'), ((1998, 2012), 'matplotlib.pyplot.subplots', 'plt.sub... |
import argparse
from util.geometry_types import Color
class Settings:
def __init__(self):
# Construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--ou... | [
"argparse.ArgumentParser"
] | [((175, 200), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (198, 200), False, 'import argparse\n')] |
from flask_api import FlaskAPI
from flask_sqlalchemy import SQLAlchemy
from instance.config import app_config
from flask import request, jsonify, abort
db = SQLAlchemy()
def create_app(config_name):
app = FlaskAPI(__name__, instance_relative_config=True)
app.config.from_object(app_config[config_name])
ap... | [
"mycroblog.models.Entry",
"flask.abort",
"flask_api.FlaskAPI",
"mycroblog.models.Entry.get_all",
"mycroblog.models.Entry.query.filter_by",
"flask_sqlalchemy.SQLAlchemy",
"flask.request.data.get",
"flask.jsonify"
] | [((159, 171), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (169, 171), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((212, 261), 'flask_api.FlaskAPI', 'FlaskAPI', (['__name__'], {'instance_relative_config': '(True)'}), '(__name__, instance_relative_config=True)\n', (220, 261), False, 'from fla... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 11 11:16:27 2020
@author: hiroyasu
"""
import cvxpy as cp
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import control
import SCPmulti as scp
import pickle
DT = scp.DT
TSPAN = scp.TSPAN
M = scp.M
II = s... | [
"cvxpy.sum_squares",
"numpy.sqrt",
"numpy.random.rand",
"numpy.array",
"numpy.linalg.norm",
"numpy.sin",
"cvxpy.Minimize",
"numpy.reshape",
"matplotlib.pyplot.plot",
"numpy.diff",
"numpy.linspace",
"numpy.random.seed",
"numpy.vstack",
"numpy.identity",
"numpy.ones",
"control.lqr",
"p... | [((475, 516), 'numpy.load', 'np.load', (['"""data/params/desired_n/Xhis.npy"""'], {}), "('data/params/desired_n/Xhis.npy')\n", (482, 516), True, 'import numpy as np\n'), ((524, 565), 'numpy.load', 'np.load', (['"""data/params/desired_n/Uhis.npy"""'], {}), "('data/params/desired_n/Uhis.npy')\n", (531, 565), True, 'impor... |
from os import environ
'''
Local Settings for _empat_sajak account.
'''
# Configuration for Twitter API
ENABLE_TWITTER_POSTING = environ.get('TWITTER_POSTING', "Y") # Tweet resulting status?
MY_CONSUMER_KEY = environ.get('TWITTER_CONSUMER_KEY') # Your Twitter API Consumer Key set in Heroku config
MY_CONSUMER_SECRE... | [
"os.environ.get"
] | [((132, 167), 'os.environ.get', 'environ.get', (['"""TWITTER_POSTING"""', '"""Y"""'], {}), "('TWITTER_POSTING', 'Y')\n", (143, 167), False, 'from os import environ\n'), ((213, 248), 'os.environ.get', 'environ.get', (['"""TWITTER_CONSUMER_KEY"""'], {}), "('TWITTER_CONSUMER_KEY')\n", (224, 248), False, 'from os import en... |
from pytpp.attributes._helper import IterableMeta, Attribute
from pytpp.attributes.application_base import ApplicationBaseAttributes
class AmazonAppAttributes(ApplicationBaseAttributes, metaclass=IterableMeta):
__config_class__ = "Amazon App"
access_key_id = Attribute('Access Key ID', min_version='16.1')
aws_crede... | [
"pytpp.attributes._helper.Attribute"
] | [((263, 309), 'pytpp.attributes._helper.Attribute', 'Attribute', (['"""Access Key ID"""'], {'min_version': '"""16.1"""'}), "('Access Key ID', min_version='16.1')\n", (272, 309), False, 'from pytpp.attributes._helper import IterableMeta, Attribute\n'), ((331, 381), 'pytpp.attributes._helper.Attribute', 'Attribute', (['"... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import datetime
from django import template
from django.template import Library
from django.template import resolve_variable
from django.core.exceptions import ObjectDoesNotExist
from html2text import html2text as h2t
from intranet.org.models import Scratchpad
register... | [
"html2text.html2text",
"intranet.org.models.Scratchpad.objects.latest",
"django.template.resolve_variable",
"django.template.Library",
"datetime.date.today",
"django.template.loader.get_template"
] | [((323, 332), 'django.template.Library', 'Library', ([], {}), '()\n', (330, 332), False, 'from django.template import Library\n'), ((428, 438), 'html2text.html2text', 'h2t', (['value'], {}), '(value)\n', (431, 438), True, 'from html2text import html2text as h2t\n'), ((2371, 2402), 'intranet.org.models.Scratchpad.object... |
'''some useful functions while working with shell'''
from __future__ import print_function
from cloudmesh.user.cm_user import cm_user
import json
from cloudmesh_common.tables import array_dict_table_printer, dict_key_list_table_printer
from cloudmesh_base.util import banner
import csv
from cmd3.console import Console
i... | [
"hostlist.expand_hostlist",
"cmd3.console.Console.error",
"cloudmesh.experiment.group.GroupManagement",
"cloudmesh.user.cm_user.cm_user",
"json.dumps",
"cloudmesh_base.util.banner",
"cloudmesh_common.tables.array_dict_table_printer",
"cloudmesh.util.naming.server_name_analyzer",
"cloudmesh_common.ta... | [((760, 769), 'cloudmesh.user.cm_user.cm_user', 'cm_user', ([], {}), '()\n', (767, 769), False, 'from cloudmesh.user.cm_user import cm_user\n'), ((7336, 7345), 'cloudmesh.user.cm_user.cm_user', 'cm_user', ([], {}), '()\n', (7343, 7345), False, 'from cloudmesh.user.cm_user import cm_user\n'), ((9358, 9434), 'cmd3.consol... |
from random import randint
import pytest
from ms.algo.mergesort_thread import sort as sort_thread
from ms.algo.mergesort_proc import sort as sort_proc
# the following helps when running $ pytest -vv tests
sort_thread.__name__ = 'Sort Thread'
sort_proc.__name__ = 'Sort Proc'
@pytest.fixture(params=[sort_thread, so... | [
"pytest.fixture",
"pytest.mark.parametrize",
"random.randint"
] | [((282, 329), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[sort_thread, sort_proc]'}), '(params=[sort_thread, sort_proc])\n', (296, 329), False, 'import pytest\n'), ((518, 553), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[1, 2, 4, 8]'}), '(params=[1, 2, 4, 8])\n', (532, 553), False, 'import pytest\n'... |
import numpy as np
class RolloutWorker:
def __init__(self, env, policy, cfg, env_params, language_conditioned=False):
self.env = env
self.policy = policy
self.cfg = cfg
self.env_params = env_params
self.language_conditioned = language_conditioned
self.timestep_cou... | [
"numpy.mean",
"numpy.array",
"numpy.zeros_like",
"numpy.sum"
] | [((3750, 3816), 'numpy.mean', 'np.mean', (["[_rd['success'][-1] for rd in rollout_data for _rd in rd]"], {}), "([_rd['success'][-1] for rd in rollout_data for _rd in rd])\n", (3757, 3816), True, 'import numpy as np\n'), ((3835, 3898), 'numpy.sum', 'np.sum', (["[_rd['reward'] for rd in rollout_data for _rd in rd]", '(1)... |
from typing import final, List
import os
from .ftp_client import FTPClient
@final
class FTPClientPrivate(FTPClient):
user_name: str
password: str
host_address: str
def __init__(
self,
user_name: str,
password: str,
host_address: str) -> None:
... | [
"os.listdir"
] | [((1157, 1169), 'os.listdir', 'os.listdir', ([], {}), '()\n', (1167, 1169), False, 'import os\n')] |
from django.db import models
from grapple.models import GraphQLString
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel
from wagtail.contrib.settings.models import BaseSetting, register_setting
@register_setting
class SocialMediaSettings(BaseSetting):
""" Social media setting
"""
facebo... | [
"django.db.models.URLField",
"wagtail.admin.edit_handlers.FieldPanel",
"grapple.models.GraphQLString"
] | [((325, 389), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'null': '(True)', 'help_text': '"""Facebook URL"""'}), "(blank=True, null=True, help_text='Facebook URL')\n", (340, 389), False, 'from django.db import models\n'), ((403, 465), 'django.db.models.URLField', 'models.URLField', ([], {'b... |
import numpy as np
import pytest
from pytest import approx
from uhi.numpy_plottable import ensure_plottable_histogram
def test_from_numpy() -> None:
hist1 = ((1, 2, 3, 4, 1, 2), (0, 1, 2, 3))
h = ensure_plottable_histogram(hist1)
assert h.values() == approx(np.array(hist1[0]))
assert len(h.axes) ==... | [
"numpy.random.normal",
"pytest.approx",
"numpy.histogramdd",
"uhi.numpy_plottable.ensure_plottable_histogram",
"numpy.array",
"pytest.importorskip",
"numpy.random.seed",
"numpy.histogram2d"
] | [((208, 241), 'uhi.numpy_plottable.ensure_plottable_histogram', 'ensure_plottable_histogram', (['hist1'], {}), '(hist1)\n', (234, 241), False, 'from uhi.numpy_plottable import ensure_plottable_histogram\n'), ((496, 514), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (510, 514), True, 'import numpy as... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import numpy as np
sys.path.append('.')
from mle.supervised_learning.decision_tree import RegressionTree
import pandas as pd
dataset = pd.read_csv(
"data/uci/bike/day.csv",
usecols=['season', 'holiday', 'weekday', 'workingday', 'weathersit', 'cnt'])
p... | [
"sys.path.append",
"pandas.read_csv",
"mle.supervised_learning.decision_tree.RegressionTree"
] | [((78, 98), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (93, 98), False, 'import sys\n'), ((196, 313), 'pandas.read_csv', 'pd.read_csv', (['"""data/uci/bike/day.csv"""'], {'usecols': "['season', 'holiday', 'weekday', 'workingday', 'weathersit', 'cnt']"}), "('data/uci/bike/day.csv', usecols=['sea... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import torch
from torchknickknacks import metrics
x1 = torch.rand(100,)
x2 = torch.rand(100,)
r = metrics.pearson_coeff(x1, x2)
x = torch.rand(100, 30)
r_pairs = metrics.pearson_coeff_pairs(x)
| [
"torchknickknacks.metrics.pearson_coeff_pairs",
"torchknickknacks.metrics.pearson_coeff",
"torch.rand"
] | [((103, 118), 'torch.rand', 'torch.rand', (['(100)'], {}), '(100)\n', (113, 118), False, 'import torch\n'), ((125, 140), 'torch.rand', 'torch.rand', (['(100)'], {}), '(100)\n', (135, 140), False, 'import torch\n'), ((146, 175), 'torchknickknacks.metrics.pearson_coeff', 'metrics.pearson_coeff', (['x1', 'x2'], {}), '(x1,... |
import datetime
import sys
from _sha256 import sha256
import requests
BASE_URL = "https://cdn-api.co-vin.in/api/v2/"
BASE_HEADER = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
'origin': 'https://selfregistration.cow... | [
"datetime.datetime.today",
"requests.post",
"sys.exit"
] | [((1333, 1405), 'requests.post', 'requests.post', ([], {'url': 'self.OTP_PRO_URL', 'json': 'data', 'headers': 'self.base_header'}), '(url=self.OTP_PRO_URL, json=data, headers=self.base_header)\n', (1346, 1405), False, 'import requests\n'), ((1986, 2059), 'requests.post', 'requests.post', ([], {'url': 'self.VALIDATE_OTP... |
"""
comp_decomp.py
Compression on a specific file, using sys (in: raw file, out: Mycompdata.txt)
Decompression of compressed file to original file (in: Mycompdata.txt, out: Mydecompdata.txt)
"""
import zlib, sys, time, base64
# Compression of raw file
rawfile = sys.argv[1]
outfile = sys.argv[2]
fp = open(rawfile, ... | [
"sys.getsizeof",
"zlib.compress"
] | [((398, 420), 'zlib.compress', 'zlib.compress', (['text', '(9)'], {}), '(text, 9)\n', (411, 420), False, 'import zlib, sys, time, base64\n'), ((363, 382), 'sys.getsizeof', 'sys.getsizeof', (['text'], {}), '(text)\n', (376, 382), False, 'import zlib, sys, time, base64\n'), ((447, 472), 'sys.getsizeof', 'sys.getsizeof', ... |
import time
from threading import Thread
def car(speed, name):
road = 0
while road < 100:
print(f'Car {name}: {road}\n')
road += speed
time.sleep(0.5)
if __name__ == '__main__':
t_car1 = Thread(target=car, args=[10, '1'])
t_car2 = Thread(target=car, args=[20, '2'])
t_ca... | [
"threading.Thread",
"time.sleep"
] | [((228, 262), 'threading.Thread', 'Thread', ([], {'target': 'car', 'args': "[10, '1']"}), "(target=car, args=[10, '1'])\n", (234, 262), False, 'from threading import Thread\n'), ((276, 310), 'threading.Thread', 'Thread', ([], {'target': 'car', 'args': "[20, '2']"}), "(target=car, args=[20, '2'])\n", (282, 310), False, ... |
import logging
import gevent
class CommandTemplate(object):
"""
The base class for Commands. If you make your own command, it should inherit from this class
"""
#Each command has certain settings. These are the default values, but you can override them in your command
triggers = [] #A list of trigger words th... | [
"logging.getLogger",
"gevent.spawn",
"gevent.sleep"
] | [((2680, 2727), 'gevent.spawn', 'gevent.spawn', (['self.keepRunningScheduledFunction'], {}), '(self.keepRunningScheduledFunction)\n', (2692, 2727), False, 'import gevent\n'), ((7476, 7523), 'gevent.spawn', 'gevent.spawn', (['self.keepRunningScheduledFunction'], {}), '(self.keepRunningScheduledFunction)\n', (7488, 7523)... |
import beautifulsoup4
import cookielib
import mechanize
br = mechanize.Browser()
jar = cookielib.LWPCookieJar()
br.set_cookiejar(jar)
br.set_handle_equiv( True )
br.set_handle_gzip( True )
br.set_handle_redirect( True )
br.set_handle_referer( True )
br.set_handle_robots( False )
| [
"cookielib.LWPCookieJar",
"mechanize.Browser"
] | [((63, 82), 'mechanize.Browser', 'mechanize.Browser', ([], {}), '()\n', (80, 82), False, 'import mechanize\n'), ((89, 113), 'cookielib.LWPCookieJar', 'cookielib.LWPCookieJar', ([], {}), '()\n', (111, 113), False, 'import cookielib\n')] |
from configparser import ConfigParser
from csv import DictReader, DictWriter
import click
from datetime import date
import os
from random import sample
import tweepy
from hashtags import HASHTAGS
def read_config(path="config"):
if os.path.exists(path):
config = ConfigParser()
config.read(path)
... | [
"csv.DictWriter",
"os.path.exists",
"click.argument",
"click.Choice",
"csv.DictReader",
"configparser.ConfigParser",
"random.sample",
"click.group",
"click.option",
"tweepy.Cursor",
"tweepy.API"
] | [((1218, 1231), 'click.group', 'click.group', ([], {}), '()\n', (1229, 1231), False, 'import click\n'), ((1367, 1418), 'click.option', 'click.option', (['"""--since"""', '"""-s"""'], {'default': '"""2018-10-01"""'}), "('--since', '-s', default='2018-10-01')\n", (1379, 1418), False, 'import click\n'), ((1420, 1471), 'cl... |
import aiosql
import psycopg2
import os
# import pdfemail # right now it's a symbolic link to pdf2mbox
PDFDIR = os.getenv('PDFDIR')
conn = psycopg2.connect("")
conn.autocommit = True
stmts = aiosql.from_path("pdf2db-em.sql", "psycopg2")
# pdfs = sql.get_dc19pdf_list(conn)
# for p in pdfs:
# print(p[1])
#
... | [
"psycopg2.connect",
"aiosql.from_path",
"os.getenv"
] | [((121, 140), 'os.getenv', 'os.getenv', (['"""PDFDIR"""'], {}), "('PDFDIR')\n", (130, 140), False, 'import os\n'), ((148, 168), 'psycopg2.connect', 'psycopg2.connect', (['""""""'], {}), "('')\n", (164, 168), False, 'import psycopg2\n'), ((200, 245), 'aiosql.from_path', 'aiosql.from_path', (['"""pdf2db-em.sql"""', '"""p... |
"""Prediction of users based on tweet embeddings"""
import numpy as np
from sklearn.linear_model import LogisticRegression
from .models import User
from .twitter import vectorize_tweet
def predict_user(user0_name, user1_name, hypo_tweet_text):
"""
Determine and return which user is more likely to say a hypothe... | [
"numpy.array",
"numpy.vstack",
"sklearn.linear_model.LogisticRegression"
] | [((481, 529), 'numpy.array', 'np.array', (['[tweet.vect for tweet in user0.tweets]'], {}), '([tweet.vect for tweet in user0.tweets])\n', (489, 529), True, 'import numpy as np\n'), ((548, 596), 'numpy.array', 'np.array', (['[tweet.vect for tweet in user1.tweets]'], {}), '([tweet.vect for tweet in user1.tweets])\n', (556... |
#!/usr/bin/env python
"""
Numba sampling routines
"""
import numpy as np
import math
from numba import jit, prange
# import lom._cython.matrix_updates as cython_mu
import lom._numba.lom_outputs as lom_outputs
import lom._numba.posterior_score_fcts as score_fcts
# only needed for IBP
from lom.auxiliary_functions import... | [
"lom.auxiliary_functions.logit",
"numpy.random.rand",
"numpy.log",
"numpy.array",
"numba.prange",
"math.exp",
"numpy.arange",
"numpy.int8",
"lom.auxiliary_functions.expit",
"numpy.max",
"numpy.exp",
"numpy.dot",
"numpy.ones",
"numba.jit",
"numpy.random.ranf",
"math.lgamma",
"numpy.su... | [((395, 448), 'numba.jit', 'jit', (['"""int8(float64, int8)"""'], {'nopython': '(True)', 'nogil': '(True)'}), "('int8(float64, int8)', nopython=True, nogil=True)\n", (398, 448), False, 'from numba import jit, prange\n'), ((856, 903), 'numba.jit', 'jit', (['"""int8(float64)"""'], {'nopython': '(True)', 'nogil': '(True)'... |
"""
Copyright (C) 2021 NVIDIA Corporation. All rights reserved.
Licensed under the NVIDIA Source Code License. See LICENSE at the main github page.
Authors: <NAME>, <NAME>, <NAME>, <NAME>
"""
import torch
from torch import nn
from torch.nn import functional as F
from simulator_model import layers
import functools
impo... | [
"torch.nn.LeakyReLU",
"torch.nn.InstanceNorm2d",
"functools.partial",
"torch.nn.Linear",
"sys.path.append"
] | [((327, 348), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (342, 348), False, 'import sys\n'), ((1913, 2011), 'functools.partial', 'functools.partial', (['layers.SNConv2d'], {'kernel_size': '(3)', 'padding': '(0)', 'num_svs': '(1)', 'num_itrs': '(1)', 'eps': '(1e-12)'}), '(layers.SNConv2d, kern... |
"""Tests for graphein.protein.features.nodes.amino_acids"""
# Graphein
# Author: <NAME> <<EMAIL>>, <NAME>
# License: MIT
# Project Website: https://github.com/a-r-j/graphein
# Code Repository: https://github.com/a-r-j/graphein
from functools import partial
import numpy as np
import pandas as pd
from pandas.testing im... | [
"graphein.protein.features.nodes.amino_acid.expasy_protein_scale",
"pandas.testing.assert_series_equal",
"graphein.protein.features.nodes.amino_acid.amino_acid_one_hot",
"graphein.protein.graphs.construct_graph",
"functools.partial",
"graphein.protein.config.ProteinGraphConfig",
"graphein.protein.featur... | [((795, 815), 'graphein.protein.features.nodes.amino_acid.load_expasy_scales', 'load_expasy_scales', ([], {}), '()\n', (813, 815), False, 'from graphein.protein.features.nodes.amino_acid import amino_acid_one_hot, expasy_protein_scale, hydrogen_bond_acceptor, hydrogen_bond_donor, load_expasy_scales\n'), ((828, 887), 'g... |
import pandas as pd
import numpy as np
def handle_missing_values(df, prop_required_row = 0.75, prop_required_col = 0.75):
''' function which takes in a dataframe, required notnull proportions of non-null rows and columns.
drop the columns and rows columns based on theshold:'''
#drop columns with nul... | [
"pandas.concat"
] | [((1133, 1191), 'pandas.concat', 'pd.concat', (['[zero_val, null_count, mis_val_percent]'], {'axis': '(1)'}), '([zero_val, null_count, mis_val_percent], axis=1)\n', (1142, 1191), True, 'import pandas as pd\n')] |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from platform import system
from tkinter import Frame, Scrollbar, VERTICAL, Y, RIGHT, FALSE, Canvas, LEFT, BOTH, TRUE, NW
from tkinter import ttk
# http://tkinter.unpythonic.net/wiki/VerticalScrolledFrame
class VerticalScrolledFrame(Frame):
"""A pure Tkinter scrollable fram... | [
"tkinter.Frame.__init__",
"tkinter.Canvas",
"platform.system",
"tkinter.Scrollbar",
"tkinter.Frame"
] | [((594, 658), 'tkinter.Frame.__init__', 'Frame.__init__', (['self', 'parent', '*args'], {'background': 'background'}), '(self, parent, *args, background=background, **kw)\n', (608, 658), False, 'from tkinter import Frame, Scrollbar, VERTICAL, Y, RIGHT, FALSE, Canvas, LEFT, BOTH, TRUE, NW\n'), ((756, 788), 'tkinter.Scro... |
"""市町村コード関係の関数群."""
from collections import namedtuple
Urls = namedtuple('Urls', 'hourly')
def get_cityname(code):
"""市町村名を取得する.
Arguments:
code {str} -- 市町村コード
Returns:
str -- 市町村名
"""
if code != '01101':
return None
return "札幌市中央区"
def get_tenkijp_urls(code):
... | [
"collections.namedtuple"
] | [((64, 92), 'collections.namedtuple', 'namedtuple', (['"""Urls"""', '"""hourly"""'], {}), "('Urls', 'hourly')\n", (74, 92), False, 'from collections import namedtuple\n')] |
from sproxy.utils import read_request, write_request
class fake_socket:
def recv(self, n):
self.c = self.c + n
return self.data[self.c-n:self.c]
def send(self, data):
self.data = data
self.c = 0
conn = fake_socket()
def test_read_write_request():
input_data = 'hello world'... | [
"sproxy.utils.write_request",
"sproxy.utils.read_request"
] | [((325, 356), 'sproxy.utils.write_request', 'write_request', (['conn', 'input_data'], {}), '(conn, input_data)\n', (338, 356), False, 'from sproxy.utils import read_request, write_request\n'), ((375, 393), 'sproxy.utils.read_request', 'read_request', (['conn'], {}), '(conn)\n', (387, 393), False, 'from sproxy.utils imp... |
from fs import enums, errors, osfs
from self_print import SelfPrint
class StartProject:
def __init__(self, name, fs=None):
self.sp = SelfPrint(leading="- ")
self.name = name
if fs is None:
fs = osfs.OSFS(".")
self.fs = fs
def warning(self, text):
print("War... | [
"fs.osfs.OSFS",
"self_print.SelfPrint"
] | [((147, 170), 'self_print.SelfPrint', 'SelfPrint', ([], {'leading': '"""- """'}), "(leading='- ')\n", (156, 170), False, 'from self_print import SelfPrint\n'), ((236, 250), 'fs.osfs.OSFS', 'osfs.OSFS', (['"""."""'], {}), "('.')\n", (245, 250), False, 'from fs import enums, errors, osfs\n')] |
import os
import glob
import shutil
import secrets
#import schedule
#import time
rand = secrets.token_hex(3)
vid_rand = secrets.token_hex(1)
a= os.getcwd()
for file in os.listdir(a):
#for images
if file in glob.glob("*.jpg") or file in glob.glob("*.png") or file in glob.glob("*.jpeg"):
*_, ext = os.path.sp... | [
"secrets.token_hex",
"os.listdir",
"shutil.move",
"os.rename",
"os.path.splitext",
"os.getcwd",
"glob.glob"
] | [((89, 109), 'secrets.token_hex', 'secrets.token_hex', (['(3)'], {}), '(3)\n', (106, 109), False, 'import secrets\n'), ((121, 141), 'secrets.token_hex', 'secrets.token_hex', (['(1)'], {}), '(1)\n', (138, 141), False, 'import secrets\n'), ((146, 157), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (155, 157), False, 'impor... |
"""Summarize most recent commit data via histogram
Input is a .csv file with commit dates'
Output is terminal output listing the count by contributor.
"""
import time
from datetime import datetime
import pandas as pd
INPUT_FILE = "../data/github_links_with_most_recent_commit_date-20210920-114948.csv"
DATETIME_STA... | [
"datetime.datetime.strptime",
"datetime.datetime.now",
"time.strftime",
"pandas.read_csv"
] | [((325, 355), 'time.strftime', 'time.strftime', (['"""%Y%m%d-%H%M%S"""'], {}), "('%Y%m%d-%H%M%S')\n", (338, 355), False, 'import time\n'), ((452, 502), 'pandas.read_csv', 'pd.read_csv', (['INPUT_FILE'], {'header': '(0)', 'index_col': '(False)'}), '(INPUT_FILE, header=0, index_col=False)\n', (463, 502), True, 'import pa... |
"""
nmrglue table functions.
nmrglue uses numpy records array as stores of various data (peak tables,
trajectories, etc). This module provides functions to read and write records
arrays from disk. Formatting of the numeric values is left to Python's str
function and only the data type need be specified. In addition... | [
"numpy.insert",
"numpy.abs",
"numpy.delete",
"numpy.recfromtxt",
"numpy.log",
"numpy.take",
"numpy.array",
"numpy.empty",
"numpy.rec.array"
] | [((5991, 6013), 'numpy.insert', 'np.insert', (['rec', 'N', 'row'], {}), '(rec, N, row)\n', (6000, 6013), True, 'import numpy as np\n'), ((6804, 6821), 'numpy.delete', 'np.delete', (['rec', 'N'], {}), '(rec, N)\n', (6813, 6821), True, 'import numpy as np\n'), ((7526, 7549), 'numpy.take', 'np.take', (['rec', 'new_order']... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | [
"robot.utils.prepr",
"robot.utils.Utf8Reader",
"re.compile"
] | [((805, 837), 're.compile', 're.compile', (['u"""[ \t\xa0]{2,}|\t+"""'], {}), "(u'[ \\t\\xa0]{2,}|\\t+')\n", (815, 837), False, 'import re\n'), ((859, 901), 're.compile', 're.compile', (['u"""[ \t\xa0]+\\\\|(?=[ \t\xa0]+)"""'], {}), "(u'[ \\t\\xa0]+\\\\|(?=[ \\t\\xa0]+)')\n", (869, 901), False, 'import re\n'), ((2720, ... |
import logging
import example_app
from jivago.jivago_application import JivagoApplication
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
app = JivagoApplication(example_app, debug=True)
app.run_dev()
| [
"logging.getLogger",
"jivago.jivago_application.JivagoApplication"
] | [((176, 218), 'jivago.jivago_application.JivagoApplication', 'JivagoApplication', (['example_app'], {'debug': '(True)'}), '(example_app, debug=True)\n', (193, 218), False, 'from jivago.jivago_application import JivagoApplication\n'), ((123, 142), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (140, 142), F... |
import os
import pandas as pd
import pyodbc
from fds.datax._get_data._get_data import GetSDFData as fd
from fds.datax._sdfhelpers._find import FdsDataStoreLedger
from fds.datax.utils.helper_func import __valid_cache_name__
from fds.datax.utils.ipyexit import IpyExit
class FdsDataStore:
def __init__(self, dir_pat... | [
"os.path.exists",
"pandas.read_parquet",
"os.makedirs",
"fds.datax._get_data._get_data.GetSDFData.fds_symbology",
"fds.datax._get_data._get_data.GetSDFData.fds_prices",
"pandas.to_datetime",
"os.path.join",
"fds.datax._get_data._get_data.GetSDFData.fds_sec_ref",
"fds.datax._sdfhelpers._find.FdsDataS... | [((1140, 1247), 'fds.datax._get_data._get_data.GetSDFData.fds_symbology', 'fd.fds_symbology', ([], {'univ_df': 'univ', 'mssql_dsn': 'mssql_dsn', 'id_type': 'df_type', 'ref_id': '"""ref_id"""', 'ref_date': '"""date"""'}), "(univ_df=univ, mssql_dsn=mssql_dsn, id_type=df_type, ref_id\n ='ref_id', ref_date='date')\n", (... |
from setuptools import find_packages, setup
setup(
name="src",
packages=find_packages(),
version="0.1.0",
description="Project for MLOps course jan 2022",
author="<NAME>",
license="MIT",
)
| [
"setuptools.find_packages"
] | [((81, 96), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (94, 96), False, 'from setuptools import find_packages, setup\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | [
"pyherc.ai.pathfinding.a_star",
"pyherc.events.new_notice_event",
"pyherc.data.find_free_space",
"pyherc.data.geometry.find_direction",
"pyherc.events.new_lose_focus_event"
] | [((4069, 4120), 'pyherc.ai.pathfinding.a_star', 'a_star', (['character.location', 'self.destination', 'level'], {}), '(character.location, self.destination, level)\n', (4075, 4120), False, 'from pyherc.ai.pathfinding import a_star\n'), ((4259, 4304), 'pyherc.data.geometry.find_direction', 'find_direction', (['character... |
"""
Modified from: https://github.com/facebookresearch/votenet/blob/master/models/proposal_module.py
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import os
import sys
#sys.path.append(os.path.join(os.getcwd(), os.pardir, "openks/models/pytorch/mmd_modules/ThreeDJCG")) # HA... | [
"openks.models.pytorch.mmd_modules.ThreeDJCG.models.proposal_module.ROI_heads.roi_heads.StandardROIHeads",
"openks.models.pytorch.mmd_modules.ThreeDJCG.lib.pointnet2.pointnet2_modules.PointnetSAModuleVotes",
"torch.from_numpy",
"torch.argmax"
] | [((1487, 1638), 'openks.models.pytorch.mmd_modules.ThreeDJCG.lib.pointnet2.pointnet2_modules.PointnetSAModuleVotes', 'PointnetSAModuleVotes', ([], {'npoint': 'self.num_proposal', 'radius': '(0.3)', 'nsample': '(16)', 'mlp': '[self.seed_feat_dim, 128, 128, 128]', 'use_xyz': '(True)', 'normalize_xyz': '(True)'}), '(npoin... |
import logging
import os
import subprocess
ALTO_JAR = os.getenv('ALTO_JAR')
if ALTO_JAR == None:
if os.path.isfile(os.path.expanduser("~/tuw_nlp_resources/alto-2.3.6-SNAPSHOT-all.jar")):
ALTO_JAR = os.path.expanduser(
"~/tuw_nlp_resources/alto-2.3.6-SNAPSHOT-all.jar")
assert ALTO_JAR, 'ALTO is... | [
"os.path.expanduser",
"subprocess.run",
"logging.warning",
"os.getenv"
] | [((55, 76), 'os.getenv', 'os.getenv', (['"""ALTO_JAR"""'], {}), "('ALTO_JAR')\n", (64, 76), False, 'import os\n'), ((2067, 2090), 'subprocess.run', 'subprocess.run', (['command'], {}), '(command)\n', (2081, 2090), False, 'import subprocess\n'), ((120, 189), 'os.path.expanduser', 'os.path.expanduser', (['"""~/tuw_nlp_re... |
import matplotlib.pyplot as plt
import os
root_path = os.path.dirname(os.path.abspath('__file__'))
# root_path = os.path.abspath(os.path.join(root_path,os.path.pardir)) # For run in CMD
# root_path = os.path.abspath(os.path.join(root_path,os.path.pardir))
print("root_path:{}".format(root_path))
from variables import mu... | [
"os.path.abspath",
"sys.path.append",
"models.multi_step_esvr"
] | [((345, 371), 'sys.path.append', 'sys.path.append', (['root_path'], {}), '(root_path)\n', (360, 371), False, 'import sys\n'), ((70, 97), 'os.path.abspath', 'os.path.abspath', (['"""__file__"""'], {}), "('__file__')\n", (85, 97), False, 'import os\n'), ((470, 660), 'models.multi_step_esvr', 'multi_step_esvr', ([], {'roo... |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | [
"google.appengine.api.oauth.get_current_user",
"logging.warning"
] | [((4047, 4117), 'logging.warning', 'logging.warning', (['"""Oauth framework user didn\'t match oauth token user."""'], {}), '("Oauth framework user didn\'t match oauth token user.")\n', (4062, 4117), False, 'import logging\n'), ((2062, 2126), 'logging.warning', 'logging.warning', (['"""Oauth token doesn\'t include an e... |
import pandas as pd
import numpy as np
lmh = pd.read_csv("./train_650_svm_submission-1.csv")
sz = pd.read_csv("./submission_file_senet.csv")
# print(lmh)
# print(sz)
count = 0
for index, row in lmh.iterrows():
if row["Category"]==sz.loc[sz["Id"] == row["Id"]]["Category"].item():
count +=1
# else:
... | [
"pandas.read_csv"
] | [((46, 93), 'pandas.read_csv', 'pd.read_csv', (['"""./train_650_svm_submission-1.csv"""'], {}), "('./train_650_svm_submission-1.csv')\n", (57, 93), True, 'import pandas as pd\n'), ((99, 141), 'pandas.read_csv', 'pd.read_csv', (['"""./submission_file_senet.csv"""'], {}), "('./submission_file_senet.csv')\n", (110, 141), ... |
from django import forms
from decharges.decharge.validators import (
rne_validator,
validate_first_name,
validate_last_name,
)
class RenommerBeneficiaireForm(forms.Form):
ancien_prenom = forms.Field(label="Ancien prénom")
ancien_nom = forms.Field(label="Ancien nom")
ancien_rne = forms.Field(l... | [
"django.forms.Field"
] | [((206, 240), 'django.forms.Field', 'forms.Field', ([], {'label': '"""Ancien prénom"""'}), "(label='Ancien prénom')\n", (217, 240), False, 'from django import forms\n'), ((258, 289), 'django.forms.Field', 'forms.Field', ([], {'label': '"""Ancien nom"""'}), "(label='Ancien nom')\n", (269, 289), False, 'from django impor... |
#
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_6755_ExtraNULLChar_ResultCLOBCol(self):
obj = IbmDbTestFunctions()
obj.assert_ex... | [
"ibm_db.connect",
"ibm_db.prepare",
"ibm_db.fetch_tuple",
"ibm_db.exec_immediate",
"ibm_db.close",
"ibm_db.server_info",
"ibm_db.execute",
"testfunctions.IbmDbTestFunctions"
] | [((282, 302), 'testfunctions.IbmDbTestFunctions', 'IbmDbTestFunctions', ([], {}), '()\n', (300, 302), False, 'from testfunctions import IbmDbTestFunctions\n'), ((384, 445), 'ibm_db.connect', 'ibm_db.connect', (['config.database', 'config.user', 'config.password'], {}), '(config.database, config.user, config.password)\n... |
# coding: utf-8
"""
VolumeScanDescriptor.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are ... | [
"six.iteritems"
] | [((9160, 9189), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (9169, 9189), False, 'from six import iteritems\n')] |
__author__ = 'J41R0'
from jinja2 import Environment
project_template = """
# default imports
from flask import Blueprint, request, send_file, jsonify
from flask_restplus import Api, Resource, reqparse
from flask_jwt_extended import jwt_optional, jwt_required, decode_token, create_access_token, create_refresh_token
fr... | [
"jinja2.Environment"
] | [((25396, 25409), 'jinja2.Environment', 'Environment', ([], {}), '()\n', (25407, 25409), False, 'from jinja2 import Environment\n')] |
"""Admin functions for a running pymap server."""
import os
import os.path
import re
import asyncio
from argparse import ArgumentParser, Namespace
from grpclib.client import Channel # type: ignore
from pymap.core import __version__
from .append import AppendCommand
from .command import ClientCommand
from ..grpc.adm... | [
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"re.match",
"grpclib.client.Channel",
"asyncio.get_event_loop"
] | [((408, 444), 'os.path.join', 'os.path.join', (['os.sep', '"""tmp"""', '"""pymap"""'], {}), "(os.sep, 'tmp', 'pymap')\n", (420, 444), False, 'import os\n'), ((787, 822), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (801, 822), False, 'from argparse import Arg... |
from werkzeug.utils import find_modules, import_string
def scan_modules(module_path, callback=None, recursive=True):
for name in find_modules(module_path, include_packages=True, recursive=recursive):
module = import_string(name)
if callback:
callback(module)
| [
"werkzeug.utils.import_string",
"werkzeug.utils.find_modules"
] | [((135, 204), 'werkzeug.utils.find_modules', 'find_modules', (['module_path'], {'include_packages': '(True)', 'recursive': 'recursive'}), '(module_path, include_packages=True, recursive=recursive)\n', (147, 204), False, 'from werkzeug.utils import find_modules, import_string\n'), ((223, 242), 'werkzeug.utils.import_str... |
"""Handlers for API operations /servers/{server}/users level."""
import json
import logging
import boto3
import parse
import mcrcon
import mcserver
import myutils
logger = myutils.get_logger(__name__, logging.INFO)
@myutils.log_calls(level=logging.DEBUG)
def get_handler(event, context): # pylint: disable=unused-ar... | [
"mcrcon.MCRcon",
"boto3.client",
"parse.parse",
"json.dumps",
"myutils.get_logger",
"myutils.log_calls",
"mcserver.gather"
] | [((174, 216), 'myutils.get_logger', 'myutils.get_logger', (['__name__', 'logging.INFO'], {}), '(__name__, logging.INFO)\n', (192, 216), False, 'import myutils\n'), ((220, 258), 'myutils.log_calls', 'myutils.log_calls', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (237, 258), False, 'import myutils\n'), ... |