code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
import random
import sys
chainlength = int(sys.argv[1])
dfname = sys.argv[2]
outfl = 'result.data'
cluster_size = int(sys.argv[3])
def readsize(dfname):
with open(dfname, 'r') as df:
lines = df.readlines()
for line in lines:
content = line.split()
if content and cont... | [
"numpy.sqrt",
"numpy.ones",
"numpy.sort",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.around",
"random.random"
] | [((6414, 6442), 'numpy.array', 'np.array', (['[size, size, size]'], {}), '([size, size, size])\n', (6422, 6442), True, 'import numpy as np\n'), ((1052, 1063), 'numpy.array', 'np.array', (['M'], {}), '(M)\n', (1060, 1063), True, 'import numpy as np\n'), ((1155, 1192), 'numpy.empty', 'np.empty', (['(n, k)'], {'dtype': 'd... |
from django.test import TestCase
from django.utils import timezone
from accounts.models import CustomUser, CustomUserManager
class UserCreateTestCase(TestCase):
def test_create_user_correctly(self):
"Creating users correctly"
new_user = CustomUser.objects.create(
email="<EMAIL>",
... | [
"django.utils.timezone.now"
] | [((498, 512), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (510, 512), False, 'from django.utils import timezone\n')] |
import pytest
from pji.utils import ValueProxy
@pytest.mark.unittest
class TestUtilsValue:
def test_value_proxy_init(self):
value = ValueProxy()
assert value.value is None
value = ValueProxy(233)
assert value.value == 233
def test_value_proxy_set(self):
value = Value... | [
"pji.utils.ValueProxy"
] | [((147, 159), 'pji.utils.ValueProxy', 'ValueProxy', ([], {}), '()\n', (157, 159), False, 'from pji.utils import ValueProxy\n'), ((212, 227), 'pji.utils.ValueProxy', 'ValueProxy', (['(233)'], {}), '(233)\n', (222, 227), False, 'from pji.utils import ValueProxy\n'), ((315, 327), 'pji.utils.ValueProxy', 'ValueProxy', ([],... |
#Intro Page
from tkinter import *
from PIL import Image, ImageTk
import cv2
#----------------------------Start Function--------------------------#
def start(event):
label1.destroy()
import log
win.destroy()
log.main()
#------------------------Main Window---------------------------------#li
def main_... | [
"PIL.Image.fromarray",
"log.main",
"cv2.VideoCapture",
"cv2.cvtColor",
"PIL.ImageTk.PhotoImage"
] | [((225, 235), 'log.main', 'log.main', ([], {}), '()\n', (233, 235), False, 'import log\n'), ((584, 618), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""images/vid.MP4"""'], {}), "('images/vid.MP4')\n", (600, 618), False, 'import cv2\n'), ((887, 926), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2RGBA'], {}),... |
"""
This module provides helper functions to support exercises during AM1
with outliers, robust regression and template regression in the CORE
data analytics workshop series, week 4.
"""
import numpy as np
import pandas as pd
import math
from collections import namedtuple
def recovery_sulphur_dataframe_wit... | [
"numpy.random.normal",
"collections.namedtuple",
"numpy.ones",
"math.sqrt",
"math.log",
"numpy.zeros",
"numpy.linspace",
"pandas.DataFrame",
"numpy.zeros_like",
"numpy.random.RandomState"
] | [((1701, 1804), 'pandas.DataFrame', 'pd.DataFrame', (["{'metal_recovery_percent': recovery_percent, 'feed_sulphur_percent':\n sulphur_percent}"], {}), "({'metal_recovery_percent': recovery_percent,\n 'feed_sulphur_percent': sulphur_percent})\n", (1713, 1804), True, 'import pandas as pd\n'), ((1910, 1937), 'numpy.... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import json
from os.path import join, isfile
import pytest
from asv import util
from . import tools
def test_run_publish(capfd, basic_conf_2):
tmpdir, local, conf, machine_file = basic_conf_2
tmpdir = util.lon... | [
"json.load",
"asv.util.long_path",
"os.path.join",
"pytest.raises"
] | [((312, 334), 'asv.util.long_path', 'util.long_path', (['tmpdir'], {}), '(tmpdir)\n', (326, 334), False, 'from asv import util\n'), ((1171, 1205), 'os.path.join', 'join', (['tmpdir', '"""html"""', '"""index.html"""'], {}), "(tmpdir, 'html', 'index.html')\n", (1175, 1205), False, 'from os.path import join, isfile\n'), (... |
# @author Metro
# @time 2021/11/24
import os.path
import gym
from agents.pdqn import P_DQN
from utilities.memory import ReplayBuffer
from utilities.utilities import *
from utilities.route_generator import generate_routefile
class Train_and_Evaluate(object):
def __init__(self, config):
# Environment
... | [
"utilities.memory.ReplayBuffer",
"utilities.route_generator.generate_routefile",
"gym.make",
"agents.pdqn.P_DQN"
] | [((324, 382), 'utilities.route_generator.generate_routefile', 'generate_routefile', ([], {'seed': 'config.seed', 'demand': 'config.demand'}), '(seed=config.seed, demand=config.demand)\n', (342, 382), False, 'from utilities.route_generator import generate_routefile\n'), ((402, 430), 'gym.make', 'gym.make', (['config.env... |
import numpy as np
from fixtrack.frontend.pickable_base import PickableBase
from vispy import scene
class PickableMarkers(PickableBase):
"""
Markers that can highlight on hover and be selected
"""
class State(PickableBase.State):
def __init__(self, **kwargs):
super(PickableMarker... | [
"numpy.full",
"numpy.zeros",
"vispy.scene.visuals.Markers"
] | [((790, 806), 'numpy.zeros', 'np.zeros', (['(0, 3)'], {}), '((0, 3))\n', (798, 806), True, 'import numpy as np\n'), ((1818, 1859), 'numpy.full', 'np.full', (['(n,)', "self._cfg.vis_args['size']"], {}), "((n,), self._cfg.vis_args['size'])\n", (1825, 1859), True, 'import numpy as np\n'), ((896, 942), 'vispy.scene.visuals... |
# Generated by Django 2.1.7 on 2019-02-27 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_longer_password'),
]
operations = [
migrations.AlterField(
model_name='session',
name='title',
... | [
"django.db.models.CharField"
] | [((330, 385), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(200)', 'null': '(True)'}), '(blank=True, max_length=200, null=True)\n', (346, 385), False, 'from django.db import migrations, models\n')] |
from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='xiandb',
version='0.2.0',
description='A database model for Xian',
long_d... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((217, 828), 'setuptools.setup', 'setup', ([], {'name': '"""xiandb"""', 'version': '"""0.2.0"""', 'description': '"""A database model for Xian"""', 'long_description': 'long_description', 'url': '"""https://github.com/Kuba77/Xian-DB"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""'... |
from functools import partial
import tensorflow as tf
_EPSILON = tf.keras.backend.epsilon()
def register_keras_custom_object(cls):
tf.keras.utils.get_custom_objects()[cls.__name__] = cls
return cls
def binary_focal_loss(y_true, y_pred, gamma, *, pos_weight=None, from_logits=False, label_smoothing=None):
... | [
"tensorflow.shape",
"tensorflow.keras.backend.epsilon",
"tensorflow.nn.relu",
"tensorflow.math.log",
"tensorflow.math.sigmoid",
"tensorflow.math.maximum",
"tensorflow.where",
"tensorflow.broadcast_dynamic_shape",
"tensorflow.broadcast_to",
"functools.partial",
"tensorflow.convert_to_tensor",
"... | [((66, 92), 'tensorflow.keras.backend.epsilon', 'tf.keras.backend.epsilon', ([], {}), '()\n', (90, 92), True, 'import tensorflow as tf\n'), ((331, 359), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['y_pred'], {}), '(y_pred)\n', (351, 359), True, 'import tensorflow as tf\n'), ((2262, 2297), 'tensorflow.dtyp... |
import time
from collections import OrderedDict
from datetime import datetime, timedelta
from django.db import models
from django.conf import settings
from django.utils.timezone import utc
from .skills import Skill, SkillGroup
from metrics.models import Corporation
from tasks.models import EveApiCache, Task
from evet... | [
"django.db.models.TextField",
"django.db.models.IntegerField",
"utils.common.convert_timestamp",
"time.sleep",
"django.db.models.BigIntegerField",
"utils.connection.get_cache",
"datetime.timedelta",
"metrics.models.Corporation.find_corporation",
"django.db.models.FloatField",
"django.db.models.For... | [((448, 477), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""apis.Api"""'], {}), "('apis.Api')\n", (465, 477), False, 'from django.db import models\n'), ((496, 520), 'django.db.models.BigIntegerField', 'models.BigIntegerField', ([], {}), '()\n', (518, 520), False, 'from django.db import models\n'), ((541, 57... |
from django.urls import path
from backend.api.v1.dialogs.views import (
DialogListCreateView,
DialogRetrieveUpdateDestroyAPIView,
DialogMembershipListCreateView,
DialogMessageListCreateView,
DialogMessageRetrieveUpdateDestroyAPIView,
)
urlpatterns = [
path('', DialogListCreateView.as_view()),
... | [
"backend.api.v1.dialogs.views.DialogMessageListCreateView.as_view",
"backend.api.v1.dialogs.views.DialogMembershipListCreateView.as_view",
"backend.api.v1.dialogs.views.DialogRetrieveUpdateDestroyAPIView.as_view",
"backend.api.v1.dialogs.views.DialogMessageRetrieveUpdateDestroyAPIView.as_view",
"backend.api... | [((286, 316), 'backend.api.v1.dialogs.views.DialogListCreateView.as_view', 'DialogListCreateView.as_view', ([], {}), '()\n', (314, 316), False, 'from backend.api.v1.dialogs.views import DialogListCreateView, DialogRetrieveUpdateDestroyAPIView, DialogMembershipListCreateView, DialogMessageListCreateView, DialogMessageRe... |
#
# msmarco doc: create the train.tsv triples
# -------------------------------
import random
random.seed(42)
import argparse
import os
import sys
from tqdm import tqdm
sys.path.append(os.getcwd())
from matchmaker.evaluation.msmarco_eval import *
from collections import defaultdict
from matchmaker.dataloaders.blin... | [
"random.choice",
"random.shuffle",
"argparse.ArgumentParser",
"tqdm.tqdm",
"random.seed",
"os.getcwd",
"collections.defaultdict",
"matchmaker.dataloaders.bling_fire_tokenizer.BlingFireTokenizer"
] | [((97, 112), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (108, 112), False, 'import random\n'), ((386, 411), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (409, 411), False, 'import argparse\n'), ((1503, 1523), 'matchmaker.dataloaders.bling_fire_tokenizer.BlingFireTokenizer', 'Blin... |
import matplotlib.pyplot as plt
import numpy as np
from photonpy.cpp.context import Context
import photonpy.cpp.gaussian as gaussian
from photonpy.smlm.util import imshow_hstack
from photonpy.cpp.estimator import Estimator
def CheckDeriv(psf:Estimator, theta):
nderiv,ev=psf.NumDeriv(theta,eps=1e-6)
deriv,ev=p... | [
"matplotlib.pyplot.imshow",
"photonpy.cpp.context.Context",
"numpy.abs",
"photonpy.cpp.gaussian.Gaussian",
"numpy.random.poisson",
"photonpy.smlm.util.imshow_hstack",
"numpy.max",
"matplotlib.pyplot.figure",
"numpy.min",
"matplotlib.pyplot.set_cmap"
] | [((508, 520), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (518, 520), True, 'import matplotlib.pyplot as plt\n'), ((525, 560), 'photonpy.smlm.util.imshow_hstack', 'imshow_hstack', (['(deriv[0] - nderiv[0])'], {}), '(deriv[0] - nderiv[0])\n', (538, 560), False, 'from photonpy.smlm.util import imshow_hsta... |
# -*- coding: utf-8
"""Module for testing helper functions.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/tools_tests/helpers_tests.py
SPDX-License-Identifier: MIT
"""
... | [
"tespy.tools.helpers.newton",
"nose.tools.eq_"
] | [((919, 976), 'tespy.tools.helpers.newton', 'newton', (['func', 'deriv', '[]', '(0)'], {'valmin': '(-10)', 'valmax': '(10)', 'val0': '(0)'}), '(func, deriv, [], 0, valmin=-10, valmax=10, val0=0)\n', (925, 976), False, 'from tespy.tools.helpers import newton\n'), ((1114, 1135), 'nose.tools.eq_', 'eq_', (['(4.0)', 'resul... |
"""
Dynamo Utils
============
All utility functions for interactions with DynamoDB
Functions
- ensure_json
- create_user_table
- create_or_update_record
- list_tables
- list_records
- get_record
- delete_table
- delete_record
- check_active
"""
import boto3
from decimal import Deci... | [
"boto3.resource",
"boto3.client"
] | [((409, 564), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'aws_access_key_id': 'AWS_ACCESS_KEY', 'aws_secret_access_key': 'AWS_SECRET_KEY', 'endpoint_url': 'DYNAMO_URL', 'region_name': 'AWS_REGION'}), "('dynamodb', aws_access_key_id=AWS_ACCESS_KEY,\n aws_secret_access_key=AWS_SECRET_KEY, endpoint_url=D... |
# -*- coding: utf-8 -*-
import unittest
from uuid import uuid4
from copy import deepcopy
from openprocurement.api.models import get_now
from openprocurement.edge.tests.base import AuctionBaseWebTest, test_award, test_auction_data, test_document, ROUTE_PREFIX
try:
import openprocurement.auctions.core as auctions_co... | [
"unittest.TestSuite",
"openprocurement.edge.tests.base.test_auction_data.copy",
"unittest.makeSuite",
"unittest.skipUnless",
"uuid.uuid4",
"copy.deepcopy",
"unittest.main",
"openprocurement.api.models.get_now"
] | [((371, 434), 'unittest.skipUnless', 'unittest.skipUnless', (['auctions_core', '"""Auctions is not reachable"""'], {}), "(auctions_core, 'Auctions is not reachable')\n", (390, 434), False, 'import unittest\n'), ((16751, 16814), 'unittest.skipUnless', 'unittest.skipUnless', (['auctions_core', '"""Auctions is not reachab... |
#!/usr/bin/env python3
import os
import sys
import logging
import subprocess
logging.basicConfig(level=logging.INFO)
root_dir = 'submitted_data'
submitted_file_split = set()
for dir_, _, files in os.walk(root_dir):
for file_name in files:
rel_dir = os.path.relpath(dir_, root_dir)
rel_file = os... | [
"logging.basicConfig",
"os.makedirs",
"os.path.join",
"os.path.isfile",
"os.path.isdir",
"cimr.processor.query.Querier",
"logging.info",
"os.walk",
"os.path.relpath"
] | [((80, 119), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (99, 119), False, 'import logging\n'), ((202, 219), 'os.walk', 'os.walk', (['root_dir'], {}), '(root_dir)\n', (209, 219), False, 'import os\n'), ((267, 298), 'os.path.relpath', 'os.path.relpath', (['dir... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 13:38:35 2021
GROUND INVASION! The Game
@author: <NAME> (<EMAIL>)
"""
# Packages used:
import numpy as np
import pandas as pd
import random as rng
from termcolor import colored
# Defining starting forces
## Defenders:
def_force = 1250
def_reserves = ... | [
"numpy.random.normal",
"termcolor.colored",
"random.choice"
] | [((799, 871), 'termcolor.colored', 'colored', (['"""########## INTELLIGENCE REPORT ##########"""'], {'on_color': '"""on_cyan"""'}), "('########## INTELLIGENCE REPORT ##########', on_color='on_cyan')\n", (806, 871), False, 'from termcolor import colored\n'), ((1906, 1978), 'termcolor.colored', 'colored', (['"""#########... |
# This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
import dateutil.parser
import pytz
from flask import flash, request... | [
"indico.modules.users.User.get_system_user",
"pytz.timezone",
"indico_room_assistance.util.event_has_room_with_support_attached",
"flask.request.view_args.get",
"indico.util.string.natural_sort_key",
"indico_room_assistance.util.can_request_assistance_for_event",
"flask_pluginengine.render_plugin_templa... | [((1787, 1802), 'indico_room_assistance._', '_', (['"""Recipients"""'], {}), "('Recipients')\n", (1788, 1802), False, 'from indico_room_assistance import _\n'), ((2664, 2692), 'indico_room_assistance._', '_', (['"""Room assistance support"""'], {}), "('Room assistance support')\n", (2665, 2692), False, 'from indico_roo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# REST
from rest_framework.viewsets import ViewSetMixin
from rest_framework import routers, serializers, viewsets
from rest_framework.authentication import SessionAuthentication, BasicAuthentication, TokenAuthentication
from rest_framework.permissions imp... | [
"rest_framework.serializers.DateTimeField",
"blockchain.models.Address.objects.all",
"rest_framework.serializers.JSONField",
"blockchain.models.Address.objects.get_or_create_rsa_address",
"blockchain.models.Prescription.objects.filter",
"blockchain.models.Address.objects.filter",
"blockchain.utils.savif... | [((885, 908), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (906, 908), False, 'from rest_framework import routers, serializers, viewsets\n'), ((1022, 1064), 'rest_framework.serializers.DateTimeField', 'serializers.DateTimeField', ([], {'read_only': '(False)'}), '(read_only=False)\n... |
from collections import deque, defaultdict
import os
import sys
import logging
import time
import json
import gym
import torch.nn as nn
import torch
import numpy as np
import matplotlib.pyplot as plt
from model import RL_Policy, Semantic_Mapping
from utils.storage import GlobalRolloutStorage
from envs import make_vec_... | [
"numpy.random.rand",
"torch.from_numpy",
"logging.info",
"os.path.exists",
"numpy.mean",
"collections.deque",
"torch.set_num_threads",
"numpy.max",
"numpy.random.seed",
"numpy.min",
"arguments.get_args",
"model.Semantic_Mapping",
"envs.make_vec_envs",
"time.time",
"time.gmtime",
"torch... | [((430, 440), 'arguments.get_args', 'get_args', ([], {}), '()\n', (438, 440), False, 'from arguments import get_args\n'), ((446, 471), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (460, 471), True, 'import numpy as np\n'), ((476, 504), 'torch.manual_seed', 'torch.manual_seed', (['args.se... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v0449gRpc.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from go... | [
"google.protobuf.descriptor_pool.Default",
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.symbol_database.Default"
] | [((478, 504), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (502, 504), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1803, 1944), 'google.protobuf.reflection.GeneratedProtocolMessageType', '_reflection.GeneratedProtocolMessageType', (['"""dataR... |
import datetime
from django.core.management import call_command
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from resources_portal.management.commands.populate_dev_database import populate_dev_database
from resources_portal.models import Material, Organ... | [
"resources_portal.models.Material.objects.filter",
"django.core.management.call_command",
"datetime.datetime.strptime",
"resources_portal.models.Organization.objects.filter",
"resources_portal.models.Organization.objects.get",
"resources_portal.models.Material.objects.get",
"resources_portal.models.Mate... | [((561, 584), 'resources_portal.management.commands.populate_dev_database.populate_dev_database', 'populate_dev_database', ([], {}), '()\n', (582, 584), False, 'from resources_portal.management.commands.populate_dev_database import populate_dev_database\n'), ((652, 699), 'django.core.management.call_command', 'call_com... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler"
] | [((643, 666), 'logging.getLogger', 'logging.getLogger', (['"""MA"""'], {}), "('MA')\n", (660, 666), False, 'import logging\n'), ((1846, 1872), 'logging.Formatter', 'logging.Formatter', (['log_fmt'], {}), '(log_fmt)\n', (1863, 1872), False, 'import logging\n'), ((1957, 1980), 'logging.StreamHandler', 'logging.StreamHand... |
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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... | [
"datetime.datetime.now",
"airbyte_cdk.models.AirbyteCatalog",
"airbyte_cdk.models.AirbyteStream",
"airbyte_cdk.models.AirbyteConnectionStatus"
] | [((3981, 4012), 'airbyte_cdk.models.AirbyteCatalog', 'AirbyteCatalog', ([], {'streams': 'streams'}), '(streams=streams)\n', (3995, 4012), False, 'from airbyte_cdk.models import AirbyteCatalog, AirbyteConnectionStatus, AirbyteMessage, AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog, Status, Type\n'), ((228... |
from datetime import datetime
from typing import Optional, Dict, List, Union
from schema import Schema, Or
from src.monitorables.nodes.node import Node
from src.utils.exceptions import InvalidDictSchemaException
class ChainlinkNode(Node):
def __init__(self, node_name: str, node_id: str, parent_id: str) -> None:... | [
"src.utils.exceptions.InvalidDictSchemaException",
"datetime.datetime.now",
"schema.Or"
] | [((10028, 10093), 'schema.Or', 'Or', (["{'address': str, 'balance': float, 'latest_usage': float}", '{}'], {}), "({'address': str, 'balance': float, 'latest_usage': float}, {})\n", (10030, 10093), False, 'from schema import Schema, Or\n'), ((10760, 10810), 'src.utils.exceptions.InvalidDictSchemaException', 'InvalidDict... |
import pickle
import numpy as np
import os
def _analyze_query_point_assignment(
query_data_dict: dict,
init_Rdata_dict: dict,
init_Edata_dict: dict,
num_R: int,
query_point_assignment_array: np.ndarray,
root: str,
n_points_to_copy=50,
):
"""
Analyzes and visualizes qDCA results.
... | [
"os.path.exists",
"pickle.dump",
"numpy.where",
"os.path.join",
"pickle.load",
"numpy.array",
"numpy.empty",
"os.mkdir",
"numpy.concatenate"
] | [((4090, 4146), 'os.path.join', 'os.path.join', (['root', '"""visualization"""', '"""same_label_images"""'], {}), "(root, 'visualization', 'same_label_images')\n", (4102, 4146), False, 'import os\n'), ((4176, 4233), 'os.path.join', 'os.path.join', (['root', '"""visualization"""', '"""wrong_label_images"""'], {}), "(roo... |
#!/usr/bin/env python3
###############################################################################
#
# Category Summaries
#
#
###############################################################################
import datetime
import io
import json
import logging
import pprint
import sys
from typing import Dict, Any
... | [
"logging.getLogger",
"json.loads",
"logging.StreamHandler",
"dateutil.tz.tzlocal",
"datetime.datetime.utcnow",
"datetime.datetime.strptime",
"logging.Formatter",
"dateutil.tz.tzutc",
"pprint.pformat",
"datetime.datetime.now",
"sys.exit",
"datetime.timedelta"
] | [((369, 396), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (386, 396), False, 'import logging\n'), ((457, 480), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (478, 480), False, 'import logging\n'), ((651, 680), 'logging.Formatter', 'logging.Formatter', (['LOG_FORMA... |
from typing import ParamSpecArgs
from flask_restful import Resource, reqparse
from models.hotel import HotelModel
from flask_jwt_extended import jwt_required
from models.site import SiteModel
from resources.filtros import *
import sqlite3
path_params = reqparse.RequestParser()
path_params.add_argument('cidade', type=s... | [
"sqlite3.connect",
"flask_restful.reqparse.RequestParser",
"models.hotel.HotelModel.find_hotel",
"flask_jwt_extended.jwt_required",
"models.hotel.HotelModel"
] | [((254, 278), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (276, 278), False, 'from flask_restful import Resource, reqparse\n'), ((1671, 1695), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (1693, 1695), False, 'from flask_restful import Resou... |
# Generated by Django 3.2.2 on 2021-09-02 15:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('django_db_logger', '0001_initial'),
('policyengine', '0001_initial'),
]
operations = [
... | [
"django.db.models.ForeignKey"
] | [((437, 557), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""policyengine.community"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.SET_NULL, to='policyengine.community')\n", (454, 557)... |
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# TODO: db_uri
# dialect+driver://username:password@host:port/database?charset=utf8
DB_URI = 'mysql+pymysql://root:root123@127.0.0.1:33... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"sqlalchemy.ForeignKey",
"sqlalchemy.String",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.Column"
] | [((364, 385), 'sqlalchemy.create_engine', 'create_engine', (['DB_URI'], {}), '(DB_URI)\n', (377, 385), False, 'from sqlalchemy import create_engine, Column, Integer, String, ForeignKey\n'), ((394, 423), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {'bind': 'engine'}), '(bind=engine)\n', (410,... |
# coding: utf-8
from __future__ import unicode_literals
from ...lemmatizer import read_index, read_exc
import pytest
@pytest.mark.models
@pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]),
("aardwolf", ["aardwolf"]),
... | [
"pytest.mark.parametrize"
] | [((142, 327), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""text,lemmas"""', "[('aardwolves', ['aardwolf']), ('aardwolf', ['aardwolf']), ('planets', [\n 'planet']), ('ring', ['ring']), ('axes', ['axis', 'axe', 'ax'])]"], {}), "('text,lemmas', [('aardwolves', ['aardwolf']), (\n 'aardwolf', ['aardwolf... |
import numpy as np
from keras.models import Sequential
from keras.layers import LSTM, Dense, Dropout
def visualize_training_results(results):
"""
Plots the loss and accuracy for the training and testing data
"""
history = results.history
plt.figure(figsize=(12,4))
plt.plot(history['val_loss'])
... | [
"numpy.array",
"keras.layers.LSTM",
"keras.layers.Dropout",
"keras.models.Sequential"
] | [((1429, 1441), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1439, 1441), False, 'from keras.models import Sequential\n'), ((1144, 1155), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (1152, 1155), True, 'import numpy as np\n'), ((1157, 1168), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (1165, 11... |
import torch
import torch.nn.functional as F
class SelfAttnFunc(torch.autograd.Function):
@staticmethod
def forward(
ctx,
use_time_mask,
is_training,
heads,
scale,
inputs,
input_weights,
output_weights,
input_biases,
output_biases... | [
"torch._fused_dropout",
"torch.empty_like",
"torch.mm",
"torch.tensor",
"torch._softmax_backward_data",
"torch.sum",
"torch._masked_scale",
"torch.nn.functional.softmax",
"torch.device"
] | [((414, 454), 'torch.tensor', 'torch.tensor', (['[input_biases is not None]'], {}), '([input_biases is not None])\n', (426, 454), False, 'import torch\n'), ((473, 494), 'torch.tensor', 'torch.tensor', (['[heads]'], {}), '([heads])\n', (485, 494), False, 'import torch\n'), ((513, 534), 'torch.tensor', 'torch.tensor', ([... |
"""This module contains helper functions and utilities for nelpy."""
__all__ = ['spatial_information',
'frange',
'swap_cols',
'swap_rows',
'pairwise',
'is_sorted',
'linear_merge',
'PrettyDuration',
'ddt_asa',
'get_contig... | [
"numpy.prod",
"logging.warnings",
"numpy.hstack",
"math.floor",
"numpy.log",
"numpy.asanyarray",
"numpy.array",
"copy.deepcopy",
"numpy.linalg.norm",
"operator.itemgetter",
"numpy.gradient",
"numpy.arange",
"numpy.mean",
"numpy.atleast_2d",
"numpy.searchsorted",
"numpy.where",
"numpy... | [((1683, 1708), 'numpy.array', 'np.array', (['(n_elem * [None])'], {}), '(n_elem * [None])\n', (1691, 1708), True, 'import numpy as np\n'), ((2313, 2339), 'numpy.array', 'np.array', (['indices'], {'ndmin': '(2)'}), '(indices, ndmin=2)\n', (2321, 2339), True, 'import numpy as np\n'), ((2790, 2845), 'numpy.linspace', 'np... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"paddle.fluid.executor.Executor",
"collections.OrderedDict",
"paddle.fluid.io.load_inference_model",
"paddle.fluid.dygraph.guard",
"paddle.in_dynamic_mode",
"paddle.jit.save",
"paddle.enable_static",
"os.path.dirname",
"paddle.disable_static",
"paddle.fluid.log_helper.get_logger",
"os.path.basen... | [((1386, 1471), 'paddle.fluid.log_helper.get_logger', 'get_logger', (['__name__', 'logging.INFO'], {'fmt': '"""%(asctime)s-%(levelname)s: %(message)s"""'}), "(__name__, logging.INFO, fmt='%(asctime)s-%(levelname)s: %(message)s'\n )\n", (1396, 1471), False, 'from paddle.fluid.log_helper import get_logger\n'), ((14910... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy import Item, Field
class TweetsItem(Item):
# define the fields for your item here like:
Author = Field()
Title = Field()
Create_time = Fie... | [
"scrapy.Field"
] | [((271, 278), 'scrapy.Field', 'Field', ([], {}), '()\n', (276, 278), False, 'from scrapy import Item, Field\n'), ((291, 298), 'scrapy.Field', 'Field', ([], {}), '()\n', (296, 298), False, 'from scrapy import Item, Field\n'), ((317, 324), 'scrapy.Field', 'Field', ([], {}), '()\n', (322, 324), False, 'from scrapy import ... |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function # Python 2/3 compatibility
__doc__ = """
Examples of design matrices specification and and computation (event-related
design, FIR design, etc)
Re... | [
"numpy.ones",
"numpy.arange",
"nipy.modalities.fmri.experimental_paradigm.BlockParadigm",
"numpy.linspace",
"matplotlib.pyplot.figure",
"nipy.modalities.fmri.design_matrix.make_dmtx",
"numpy.random.randn",
"nipy.modalities.fmri.experimental_paradigm.EventRelatedParadigm",
"matplotlib.pyplot.subplot"... | [((791, 832), 'numpy.linspace', 'np.linspace', (['(0)', '((nscans - 1) * tr)', 'nscans'], {}), '(0, (nscans - 1) * tr, nscans)\n', (802, 832), True, 'import numpy as np\n'), ((1138, 1178), 'nipy.modalities.fmri.experimental_paradigm.EventRelatedParadigm', 'EventRelatedParadigm', (['conditions', 'onsets'], {}), '(condit... |
from app import app
from app.database.db import Database
if __name__ == "__main__":
db = Database()
db.create_tables()
db.create_admin()
app.run(debug=True) | [
"app.app.run",
"app.database.db.Database"
] | [((95, 105), 'app.database.db.Database', 'Database', ([], {}), '()\n', (103, 105), False, 'from app.database.db import Database\n'), ((155, 174), 'app.app.run', 'app.run', ([], {'debug': '(True)'}), '(debug=True)\n', (162, 174), False, 'from app import app\n')] |
from pathlib import Path
from bsmu.bone_age.models import constants
IMAGE_DIR = Path('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads')
TRAIN_DATA_CSV_PATH = constants.TRAIN_DATA_CSV_PATH
VALID_DATA_CSV_PATH = constants.VALID_DATA_CSV_PATH
TEST_DATA_CSV_PATH = constants.TEST_DATA_CSV_PATH
BATC... | [
"pathlib.Path"
] | [((86, 153), 'pathlib.Path', 'Path', (['"""C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads"""'], {}), "('C:/MyDiskBackup/Projects/BoneAge/Data/SmallImages500_NoPads')\n", (90, 153), False, 'from pathlib import Path\n')] |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from uuid import uuid4
from sqlalchemy.dialects.postgresql import ARRAY, UUID
from sqlalchemy.ext.declara... | [
"werkzeug.urls.url_parse",
"indico.util.i18n._",
"indico.core.db.sqlalchemy.PyIntEnum",
"indico.core.db.db.func.lower",
"uuid.uuid4",
"indico.core.db.db.text",
"indico.modules.oauth.logger.info",
"sqlalchemy.dialects.postgresql.ARRAY",
"indico.core.db.db.Column"
] | [((604, 637), 'indico.util.i18n._', '_', (['"""User information (read only)"""'], {}), "('User information (read only)')\n", (605, 637), False, 'from indico.util.i18n import _\n'), ((668, 695), 'indico.util.i18n._', '_', (['"""Legacy API (read only)"""'], {}), "('Legacy API (read only)')\n", (669, 695), False, 'from in... |
import torch.nn as nn
from .basic import *
class squeeze_excitation_2d(nn.Module):
"""Squeeze-and-Excitation Block 2D
Args:
channel (int): number of input channels.
channel_reduction (int): channel squeezing factor.
spatial_reduction (int): pooling factor for x,y axes.
"""
def ... | [
"torch.nn.Sigmoid",
"torch.nn.AvgPool3d",
"torch.nn.Sequential",
"torch.nn.Upsample",
"torch.nn.AvgPool2d"
] | [((1066, 1088), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1079, 1088), True, 'import torch.nn as nn\n'), ((2277, 2299), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (2290, 2299), True, 'import torch.nn as nn\n'), ((555, 618), 'torch.nn.AvgPool2d', 'nn.AvgPoo... |
import os
import option
import utility
import grapeMenu
import grapeGit as git
import grapeConfig
class Clone(option.Option):
""" grape-clone
Clones a git repo and configures it for use with git.
Usage: grape-clone <url> <path> [--recursive] [--allNested]
Arguments:
<url> The URL of th... | [
"grapeGit.clone",
"grapeConfig.grapeConfig",
"grapeMenu.menu",
"utility.printMsg",
"os.chdir",
"grapeConfig.read"
] | [((981, 1098), 'utility.printMsg', 'utility.printMsg', (["('Cloning %s into %s %s' % (remotepath, destpath, 'recursively' if args[\n '--recursive'] else ''))"], {}), "('Cloning %s into %s %s' % (remotepath, destpath, \n 'recursively' if args['--recursive'] else ''))\n", (997, 1098), False, 'import utility\n'), ((... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, German Neuroinformatics Node (G-Node)
# <NAME> <<EMAIL>>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of t... | [
"mock.Mock",
"nixio.Value",
"quantities.Quantity",
"neo.core.Event",
"numpy.array_split",
"neo.core.Unit",
"numpy.array",
"neo.io.nixio.NixIO",
"neo.core.AnalogSignal",
"neo.core.SpikeTrain",
"numpy.arange",
"os.remove",
"numpy.random.random",
"numpy.float64",
"numpy.testing.assert_almos... | [((1013, 1058), 'unittest.skipUnless', 'unittest.skipUnless', (['HAVE_NIX', '"""Requires NIX"""'], {}), "(HAVE_NIX, 'Requires NIX')\n", (1032, 1058), False, 'import unittest\n'), ((45446, 45491), 'unittest.skipUnless', 'unittest.skipUnless', (['HAVE_NIX', '"""Requires NIX"""'], {}), "(HAVE_NIX, 'Requires NIX')\n", (454... |
from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass, field
from typing import List, Iterator, TypeVar, Union, Any, Generic
import pandas as pd
from pandas.core.indexing import _LocIndexer
from reamber.base.Map import Map
from reamber.base.Property import stack_props
NoteLi... | [
"reamber.base.Property.stack_props",
"copy.deepcopy",
"pandas.DataFrame",
"dataclasses.field",
"typing.TypeVar"
] | [((326, 346), 'typing.TypeVar', 'TypeVar', (['"""NoteListT"""'], {}), "('NoteListT')\n", (333, 346), False, 'from typing import List, Iterator, TypeVar, Union, Any, Generic\n'), ((358, 377), 'typing.TypeVar', 'TypeVar', (['"""HitListT"""'], {}), "('HitListT')\n", (365, 377), False, 'from typing import List, Iterator, T... |
"""
=========
filtering.py
=========
This module provides more granular filtering for captures.
You can customize your own filters too.
"""
from __future__ import annotations
import re
from abc import ABC, ABCMeta, abstractmethod
from dataclasses import dataclass
from json import JSONEncoder
from pathlib import Posi... | [
"numpy.mean",
"numpy.abs",
"numpy.median",
"numpy.logical_and",
"pathlib.PosixPath",
"dataclasses.dataclass",
"numpy.min",
"typing.NewType",
"numpy.max",
"numpy.tanh",
"numpy.std"
] | [((1019, 1046), 'typing.NewType', 'NewType', (['"""FilterSetId"""', 'str'], {}), "('FilterSetId', str)\n", (1026, 1046), False, 'from typing import Any, Dict, Iterable, Mapping, NewType, Optional, Protocol, Type, TypedDict, Union\n'), ((1124, 1150), 'typing.NewType', 'NewType', (['"""FilterName"""', 'str'], {}), "('Fil... |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Tests for Interrogate."""
import socket
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import artifact_test
from grr.lib import client_index
from grr.lib import config_lib
from grr.lib import flags
fro... | [
"grr.lib.flags.StartMain",
"grr.lib.test_lib.GrrTestProgram",
"grr.lib.rdfvalue.RDFURN",
"grr.lib.aff4.FACTORY.Open",
"grr.lib.test_lib.ClientFixture",
"grr.lib.test_lib.TestFlowHelper",
"grr.lib.flow.EventHandler",
"grr.lib.config_lib.CONFIG.Set",
"grr.lib.rdfvalue.SessionID",
"grr.lib.search.Sea... | [((568, 614), 'grr.lib.rdfvalue.SessionID', 'rdfvalue.SessionID', ([], {'flow_name': '"""discovery_test"""'}), "(flow_name='discovery_test')\n", (586, 614), False, 'from grr.lib import rdfvalue\n'), ((724, 761), 'grr.lib.flow.EventHandler', 'flow.EventHandler', ([], {'auth_required': '(True)'}), '(auth_required=True)\n... |
from armstrong.dev.tests.utils import ArmstrongTestCase
import random
def random_range():
# TODO: make sure this can only be generated once
return range(random.randint(1000, 2000))
class HatbandTestCase(ArmstrongTestCase):
pass
class HatbandTestMixin(object):
script_code = """
<script type="t... | [
"random.randint"
] | [((163, 189), 'random.randint', 'random.randint', (['(1000)', '(2000)'], {}), '(1000, 2000)\n', (177, 189), False, 'import random\n')] |
import unittest
from logics.classes.propositional import Inference, Formula
from logics.classes.propositional.proof_theories import NaturalDeductionStep, NaturalDeductionRule
from logics.utils.parsers import classical_parser
from logics.instances.propositional.natural_deduction import classical_natural_deduction_syste... | [
"logics.classes.propositional.Formula",
"logics.instances.propositional.natural_deduction.classical_natural_deduction_system.is_correct_application",
"unittest.main",
"logics.utils.parsers.classical_parser.parse_derivation",
"logics.instances.propositional.natural_deduction.classical_natural_deduction_syste... | [((7981, 7996), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7994, 7996), False, 'import unittest\n'), ((1035, 1213), 'logics.utils.parsers.classical_parser.parse_derivation', 'classical_parser.parse_derivation', (['"""p; premise\n (p → q); premise\n q; E→; [1, 0]; []\n p ∧ q; I... |
from __future__ import absolute_import
from __future__ import unicode_literals
from compose import utils
class StreamOutputError(Exception):
pass
def stream_output(output, stream):
is_terminal = hasattr(stream, 'isatty') and stream.isatty()
stream = utils.get_output_stream(stream)
all_events = []
... | [
"compose.utils.json_stream",
"compose.utils.get_output_stream"
] | [((267, 298), 'compose.utils.get_output_stream', 'utils.get_output_stream', (['stream'], {}), '(stream)\n', (290, 298), False, 'from compose import utils\n'), ((365, 390), 'compose.utils.json_stream', 'utils.json_stream', (['output'], {}), '(output)\n', (382, 390), False, 'from compose import utils\n')] |
import os
from bids_validator import BIDSValidator
def validate(bids_directory):
print('- Validate: init started.')
file_paths = []
result = []
validator = BIDSValidator()
for path, dirs, files in os.walk(bids_directory):
for filename in files:
if filename == '.bidsignore':
... | [
"os.walk",
"os.path.join",
"bids_validator.BIDSValidator"
] | [((174, 189), 'bids_validator.BIDSValidator', 'BIDSValidator', ([], {}), '()\n', (187, 189), False, 'from bids_validator import BIDSValidator\n'), ((219, 242), 'os.walk', 'os.walk', (['bids_directory'], {}), '(bids_directory)\n', (226, 242), False, 'import os\n'), ((523, 551), 'os.path.join', 'os.path.join', (['path', ... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 applica... | [
"six.iteritems"
] | [((11071, 11100), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (11080, 11100), False, 'from six import iteritems\n')] |
import asyncio
from contextlib import suppress
from unittest import mock
import pytest
from aiohttp.base_protocol import BaseProtocol
async def test_loop() -> None:
loop = asyncio.get_event_loop()
asyncio.set_event_loop(None)
pr = BaseProtocol(loop)
assert pr._loop is loop
async def test_pause_wri... | [
"unittest.mock.Mock",
"asyncio.sleep",
"pytest.raises",
"contextlib.suppress",
"aiohttp.base_protocol.BaseProtocol",
"asyncio.set_event_loop",
"asyncio.get_event_loop"
] | [((180, 204), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (202, 204), False, 'import asyncio\n'), ((209, 237), 'asyncio.set_event_loop', 'asyncio.set_event_loop', (['None'], {}), '(None)\n', (231, 237), False, 'import asyncio\n'), ((247, 265), 'aiohttp.base_protocol.BaseProtocol', 'BaseProtoco... |
# Helper code to plot binary losses.
#
# <NAME> (http://eli.thegreenplace.net)
# This code is in the public domain
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
fig, ax = plt.subplots()
fig.set_tight_layout(True)
xs = np.linspace(-2, 2... | [
"numpy.ones_like",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"numpy.zeros_like",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((247, 261), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (259, 261), True, 'import matplotlib.pyplot as plt\n'), ((303, 326), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)', '(500)'], {}), '(-2, 2, 500)\n', (314, 326), True, 'import numpy as np\n'), ((717, 734), 'matplotlib.pyplot.ylim', 'plt.yli... |
#!/usr/bin/env python3
################################
# Development tool
# Auto-compiles style.less to style.css
#
# Requires lessc and less clean css to be installed:
# npm install -g less
# npm install -g less-plugin-clean-css
################################
import os, time
from os import path
from math import fl... | [
"os.path.exists",
"os.path.getmtime",
"time.sleep",
"os.chdir",
"os.system",
"time.time"
] | [((466, 481), 'os.chdir', 'os.chdir', (['"""../"""'], {}), "('../')\n", (474, 481), False, 'import os, time\n'), ((895, 906), 'time.time', 'time.time', ([], {}), '()\n', (904, 906), False, 'import os, time\n'), ((909, 986), 'os.system', 'os.system', (["('lessc ' + self.style_less + ' ' + self.style_css + ' --clean-css'... |
# -- encoding: UTF-8 --
import json
import uuid
from admin_export_action import report
from admin_export_action.admin import export_selected_objects
from admin_export_action.config import default_config, get_config
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from djang... | [
"django.test.RequestFactory",
"news.models.NewsTag.objects.values_list",
"json.loads",
"news.models.News.objects.all",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"uuid.UUID",
"admin_export_action.report.get_field_verbose_name",
"admin_export_action.admin.export_selected_ob... | [((1538, 1554), 'django.test.RequestFactory', 'RequestFactory', ([], {}), '()\n', (1552, 1554), False, 'from django.test import TestCase, RequestFactory\n'), ((1788, 1836), 'admin_export_action.admin.export_selected_objects', 'export_selected_objects', (['modeladmin', 'request', 'qs'], {}), '(modeladmin, request, qs)\n... |
import base64
import datetime
from abc import ABC, abstractmethod
from .conditions import AnyValue
from .errors import FieldError, FormError
__all__ = [
'Field', 'StringField', 'IntegerField', 'FloatField', 'BooleanField',
'DateTimeField', 'DateField', 'TimeField', 'ListField','SetField', 'EnumField', 'BytesF... | [
"datetime.datetime.strptime",
"base64.decodebytes"
] | [((2728, 2775), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['value', 'self.pattern'], {}), '(value, self.pattern)\n', (2754, 2775), False, 'import datetime\n'), ((4211, 4236), 'base64.decodebytes', 'base64.decodebytes', (['value'], {}), '(value)\n', (4229, 4236), False, 'import base64\n'), ((3094, 314... |
import numpy as np
import cv2
#define a canvas of size 300x300 px, with 3 channels (R,G,B) and data type as 8 bit unsigned integer
canvas = np.zeros((300,300,3), dtype ="uint8")
#define color
#draw a circle
#arguments are canvas/image, midpoint, radius, color, thickness(optional)
#display in cv2 window
green = (0,255... | [
"cv2.imshow",
"cv2.circle",
"numpy.zeros",
"numpy.random.randint",
"cv2.waitKey"
] | [((141, 179), 'numpy.zeros', 'np.zeros', (['(300, 300, 3)'], {'dtype': '"""uint8"""'}), "((300, 300, 3), dtype='uint8')\n", (149, 179), True, 'import numpy as np\n'), ((324, 365), 'cv2.circle', 'cv2.circle', (['canvas', '(100, 100)', '(10)', 'green'], {}), '(canvas, (100, 100), 10, green)\n', (334, 365), False, 'import... |
import io
from PIL import Image as PILImage
from sqlalchemy import Column, ForeignKey, LargeBinary, Index, Integer, String
from resources.models.ModelBase import Base
class Image(Base):
# If this is used then the image is stored in the database
image = Column(LargeBinary(length=16777215), default=None)
#... | [
"sqlalchemy.String",
"sqlalchemy.LargeBinary",
"sqlalchemy.ForeignKey",
"io.BytesIO"
] | [((271, 299), 'sqlalchemy.LargeBinary', 'LargeBinary', ([], {'length': '(16777215)'}), '(length=16777215)\n', (282, 299), False, 'from sqlalchemy import Column, ForeignKey, LargeBinary, Index, Integer, String\n'), ((399, 410), 'sqlalchemy.String', 'String', (['(500)'], {}), '(500)\n', (405, 410), False, 'from sqlalchem... |
import os
import sys
import argparse
import json
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from arch2vec.models.pretraining_nasbench101 import configs
from arch2vec.utils import load_json, preprocessing, one_hot_darts
from arch2vec.preprocessing.gen_is... | [
"os.path.exists",
"argparse.ArgumentParser",
"torch.eye",
"arch2vec.utils.one_hot_darts",
"os.mkdir",
"arch2vec.models.model.Model",
"random.randint",
"torch.sort",
"arch2vec.preprocessing.gen_isomorphism_graphs.process",
"torch.Tensor",
"torch.save",
"arch2vec.utils.load_json",
"torch.manua... | [((5645, 5673), 'torch.Tensor', 'torch.Tensor', (['policy.rewards'], {}), '(policy.rewards)\n', (5657, 5673), False, 'import torch\n'), ((5693, 5712), 'torch.sort', 'torch.sort', (['returns'], {}), '(returns)\n', (5703, 5712), False, 'import torch\n'), ((6314, 6321), 'arch2vec.darts.cnn.train_search.Train', 'Train', ([... |
"""Test AdaNet estimator single graph implementation.
Copyright 2018 The AdaNet Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LI... | [
"adanet.tf_compat.v1.placeholder",
"tensorflow_estimator.python.estimator.head.binary_class_head.BinaryClassHead",
"tensorflow.math.log",
"adanet.tf_compat.v1.metrics.mean",
"tensorflow.split",
"absl.logging.info",
"tensorflow.io.gfile.listdir",
"adanet.tf_compat.v1.variable_scope",
"adanet.tf_compa... | [((2394, 2429), 'absl.logging.set_verbosity', 'logging.set_verbosity', (['logging.INFO'], {}), '(logging.INFO)\n', (2415, 2429), False, 'from absl import logging\n'), ((56220, 56772), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': 'single_iteration', 'max_iteration... |
import subprocess, os
ue4_win = r"C:\Program Files\Epic Games\UE_4.16"
ue4_linux = "/home/qiuwch/workspace/UE416"
ue4_mac = '/Users/Shared/Epic Games/UE_4.16'
win_uprojects = [
r'C:\qiuwch\workspace\uprojects\UE4RealisticRendering\RealisticRendering.uproject',
r'C:\qiuwch\workspace\uprojects\UE4ArchinteriorsV... | [
"os.path.isfile",
"os.path.basename",
"os.path.expanduser"
] | [((803, 901), 'os.path.expanduser', 'os.path.expanduser', (['"""~/workspace/uprojects/UE4RealisticRendering/RealisticRendering.uproject"""'], {}), "(\n '~/workspace/uprojects/UE4RealisticRendering/RealisticRendering.uproject')\n", (821, 901), False, 'import subprocess, os\n'), ((902, 1015), 'os.path.expanduser', 'os... |
"""
Django settings for openstack_lease_it project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
#... | [
"logging.getLogger",
"os.path.join",
"ast.literal_eval",
"openstack_lease_it.config.load_config",
"os.path.abspath"
] | [((587, 600), 'openstack_lease_it.config.load_config', 'load_config', ([], {}), '()\n', (598, 600), False, 'from openstack_lease_it.config import GLOBAL_CONFIG, load_config\n'), ((792, 839), 'ast.literal_eval', 'ast.literal_eval', (["GLOBAL_CONFIG['DJANGO_DEBUG']"], {}), "(GLOBAL_CONFIG['DJANGO_DEBUG'])\n", (808, 839),... |
from unittest import TestCase
from pandora.client import APIClient
from pandora.errors import InvalidAuthToken, ParameterMissing
from pandora.models.pandora import Station, AdItem, PlaylistItem
from pandora.py2compat import Mock, patch
from pydora.utils import iterate_forever
class TestIterateForever(TestCase):
... | [
"pandora.errors.InvalidAuthToken",
"pydora.utils.iterate_forever",
"pandora.py2compat.patch.object",
"pandora.models.pandora.AdItem.from_json",
"pandora.py2compat.Mock",
"pandora.models.pandora.Station.from_json",
"pandora.models.pandora.PlaylistItem.from_json",
"pandora.errors.ParameterMissing",
"p... | [((430, 479), 'pandora.client.APIClient', 'APIClient', (['self.transport', 'None', 'None', 'None', 'None'], {}), '(self.transport, None, None, None, None)\n', (439, 479), False, 'from pandora.client import APIClient\n'), ((516, 522), 'pandora.py2compat.Mock', 'Mock', ([], {}), '()\n', (520, 522), False, 'from pandora.p... |
""" Bifurcation point classes. Each class locates and processes bifurcation points.
* _BranchPointFold is a version based on BranchPoint location algorithms
* BranchPoint: Branch process is broken (can't find alternate branch -- see MATCONT notes)
<NAME>, March 2006
"""
from __future__ import absolute_i... | [
"scipy.optimize.fsolve",
"numpy.average",
"numpy.conjugate",
"PyDSTool.common.args",
"numpy.real",
"scipy.linalg.eig",
"numpy.zeros",
"numpy.dot",
"numpy.nonzero",
"scipy.linalg.norm",
"numpy.transpose",
"numpy.imag"
] | [((1323, 1329), 'PyDSTool.common.args', 'args', ([], {}), '()\n', (1327, 1329), False, 'from PyDSTool.common import args\n'), ((1932, 1982), 'numpy.average', 'average', (['[point[0] for point in pointlist]'], {'axis': '(0)'}), '([point[0] for point in pointlist], axis=0)\n', (1939, 1982), False, 'from numpy import Inf,... |
"""
PyXLL-Jupyter
This package integrated Jupyter notebooks into Microsoft Excel.
To install it, first install PyXLL (see https://www.pyxll.com).
Briefly, to install PyXLL do the following::
pip install pyxll
pyxll install
Once PyXLL is installed then installing this package will add a
button to the PyXLL ... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((572, 594), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (584, 594), False, 'from os import path\n'), ((606, 644), 'os.path.join', 'path.join', (['this_directory', '"""README.md"""'], {}), "(this_directory, 'README.md')\n", (615, 644), False, 'from os import path\n'), ((936, 951), 'setuptool... |
from typing import List
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import JsonResponse
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views import generic, View
from board.forms import SignUpForm
from .co... | [
"django.shortcuts.render",
"django.http.JsonResponse",
"django.contrib.auth.models.User.objects.filter",
"django.urls.reverse_lazy",
"django.contrib.auth.models.User.objects.get"
] | [((679, 717), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'context'], {}), "(request, 'index.html', context)\n", (685, 717), False, 'from django.shortcuts import render\n'), ((1216, 1254), 'django.shortcuts.render', 'render', (['request', '"""board.html"""', 'context'], {}), "(request, 'board.... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-01-15 22:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailsearchpromotions', '0002_capitalizeverbose'),
('wagtailcore', '0040_page_draft_title... | [
"django.db.migrations.AlterModelTable",
"django.db.migrations.DeleteModel",
"django.db.migrations.RemoveField",
"django.db.migrations.SeparateDatabaseAndState"
] | [((546, 641), 'django.db.migrations.AlterModelTable', 'migrations.AlterModelTable', (['"""SignUpFormPageResponse"""', '"""sign_up_form_signupformpageresponse"""'], {}), "('SignUpFormPageResponse',\n 'sign_up_form_signupformpageresponse')\n", (572, 641), False, 'from django.db import migrations\n'), ((647, 722), 'dja... |
#!/usr/bin/env python3
#
# Copyright (c) 2019 <NAME> and contributors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The test_webframe module covers the webframe module."""
from typing import List
from typing import TYPE_CHECKING
from typing import Tuple
from... | [
"webframe.local_to_ui_tz",
"datetime.datetime.fromtimestamp",
"webframe.handle_exception",
"configparser.ConfigParser",
"os.path.isabs",
"time.strftime",
"typing.cast",
"os.path.dirname",
"webframe.fill_missing_header_items",
"unittest.main",
"unittest.mock.patch",
"webframe.handle_static"
] | [((3887, 3902), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3900, 3902), False, 'import unittest\n'), ((833, 878), 'webframe.handle_static', 'webframe.handle_static', (['"""/osm/static/osm.css"""'], {}), "('/osm/static/osm.css')\n", (855, 878), False, 'import webframe\n'), ((1081, 1131), 'webframe.handle_stati... |
from __future__ import unicode_literals
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import requests
from youtube_search import YoutubeSearch
import youtube_dl
import eyed3.id3
import eyed3
import lyricsgenius
import telepot
spotifyy = spotipy.Spotify(
client_credentials_manager=SpotifyClient... | [
"telepot.Bot",
"lyricsgenius.Genius",
"spotipy.oauth2.SpotifyClientCredentials",
"requests.get",
"youtube_dl.YoutubeDL",
"eyed3.load"
] | [((467, 495), 'lyricsgenius.Genius', 'lyricsgenius.Genius', (['"""<KEY>"""'], {}), "('<KEY>')\n", (486, 495), False, 'import lyricsgenius\n'), ((525, 543), 'telepot.Bot', 'telepot.Bot', (['token'], {}), '(token)\n', (536, 543), False, 'import telepot\n'), ((3585, 3635), 'requests.get', 'requests.get', (["results['album... |
#------------------------------------------------------------------------------
# Copyright (c) 2018-2019, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------... | [
"atom.api.Int",
"pytest.mark.parametrize",
"atom.api.Dict",
"pytest.raises"
] | [((1130, 1172), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""member"""', 'MEMBERS'], {}), "('member', MEMBERS)\n", (1153, 1172), False, 'import pytest\n'), ((1305, 1347), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""member"""', 'MEMBERS'], {}), "('member', MEMBERS)\n", (1328, 1347), False,... |
from django.contrib import admin
from bible.models import Bible, VerseOfTheDay
@admin.register(Bible)
class BibleAdmin(admin.ModelAdmin):
list_display = ['__str__', 'text']
readonly_fields = ['book', 'chapter', 'verse', 'text', 'category']
search_fields = ['text', 'book', 'chapter']
list_filter = ['ca... | [
"django.contrib.admin.register"
] | [((82, 103), 'django.contrib.admin.register', 'admin.register', (['Bible'], {}), '(Bible)\n', (96, 103), False, 'from django.contrib import admin\n'), ((561, 590), 'django.contrib.admin.register', 'admin.register', (['VerseOfTheDay'], {}), '(VerseOfTheDay)\n', (575, 590), False, 'from django.contrib import admin\n')] |
# Copyright 2020 Soil, Inc.
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); yo... | [
"threading.Lock",
"oslo_log.log.getLogger"
] | [((1137, 1164), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1154, 1164), True, 'from oslo_log import log as logging\n'), ((1175, 1191), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1189, 1191), False, 'import threading\n')] |
from __future__ import absolute_import, print_function
import unittest
import os
import tensorflow as tf
from tensorflow.keras import regularizers
from niftynet.network.simple_gan import SimpleGAN
from tests.niftynet_testcase import NiftyNetTestCase
class SimpleGANTest(NiftyNetTestCase):
def test_3d_reg_shape(s... | [
"tensorflow.ones",
"niftynet.network.simple_gan.SimpleGAN",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.test.main"
] | [((1488, 1502), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1500, 1502), True, 'import tensorflow as tf\n'), ((410, 430), 'tensorflow.ones', 'tf.ones', (['input_shape'], {}), '(input_shape)\n', (417, 430), True, 'import tensorflow as tf\n'), ((443, 463), 'tensorflow.ones', 'tf.ones', (['noise_shape'], {}... |
import time
import thingspeak_wrapper as tsw
# Initiate the class ThingWrapper with (CHANNEL_ID, WRITE_API__KEY, READ_API_KEY)
# if is a public channel just pass the CHANNEL_ID argument, api_key defaults are None
my_channel = tsw.wrapper.ThingWrapper(501309, '6TQDNWJQ44FA0GAQ', '10EVD2N6YIHI5O7Z')
# all set of func... | [
"thingspeak_wrapper.wrapper.ThingWrapper",
"time.sleep"
] | [((228, 300), 'thingspeak_wrapper.wrapper.ThingWrapper', 'tsw.wrapper.ThingWrapper', (['(501309)', '"""6TQDNWJQ44FA0GAQ"""', '"""10EVD2N6YIHI5O7Z"""'], {}), "(501309, '6TQDNWJQ44FA0GAQ', '10EVD2N6YIHI5O7Z')\n", (252, 300), True, 'import thingspeak_wrapper as tsw\n'), ((820, 834), 'time.sleep', 'time.sleep', (['(15)'], ... |
#
# Copyright (c) 2019, Neptune Labs Sp. z o.o.
#
# 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 agr... | [
"skopt.plots.plot_convergence",
"io.BytesIO",
"skopt.plots.plot_regret",
"matplotlib.pyplot.figure",
"skopt.utils.dump",
"skopt.plots.plot_evaluations",
"numpy.min",
"warnings.warn",
"neptunecontrib.monitoring.utils.expect_not_a_run",
"matplotlib.pyplot.subplots",
"skopt.plots.plot_objective"
] | [((4317, 4339), 'neptunecontrib.monitoring.utils.expect_not_a_run', 'expect_not_a_run', (['_exp'], {}), '(_exp)\n', (4333, 4339), False, 'from neptunecontrib.monitoring.utils import axes2fig, expect_not_a_run\n'), ((4825, 4847), 'warnings.warn', 'warnings.warn', (['message'], {}), '(message)\n', (4838, 4847), False, 'i... |
# Generated by Django 2.1.5 on 2019-02-12 21:18
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0049_add_all_other_translations")]
operations = [
migrations.CreateModel(
name="ClickThroughAgreement... | [
"django.db.models.AutoField",
"django.db.models.TextField",
"django.db.models.ForeignKey"
] | [((830, 939), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.PROTECT', 'to': '"""api.ClickThroughAgreement"""'}), "(null=True, on_delete=django.db.models.deletion.PROTECT,\n to='api.ClickThroughAgreement')\n", (847, 939), False, 'from django.db imp... |
#!/usr/bin/env python
'''Generally useful bits and bobs.'''
import queue # For PrintThread and exe_run
from time import sleep, time, gmtime, strftime # For lock timeout, exe_run timeout and logging
from multiprocessing import RLock
from copy import copy
import threading # For Print... | [
"psutil.Process",
"time.sleep",
"copy.copy",
"threading.Thread.__init__",
"re.split",
"collections.deque",
"subprocess.Popen",
"os.chmod",
"platform.system",
"os.path.isdir",
"os.path.expanduser",
"subprocess.check_output",
"requests.get",
"time.time",
"multiprocessing.RLock",
"time.gm... | [((7666, 7695), 'os.chmod', 'os.chmod', (['path', 'stat.S_IWRITE'], {}), '(path, stat.S_IWRITE)\n', (7674, 7695), False, 'import os\n'), ((7837, 7861), 'os.path.isdir', 'os.path.isdir', (['directory'], {}), '(directory)\n', (7850, 7861), False, 'import os\n'), ((15992, 16016), 'os.path.isdir', 'os.path.isdir', (['direc... |
import numpy as np
import astropy.modeling.blackbody as bb
import astropy.constants as const
from astropy.io import fits
from scipy.interpolate import interp2d
class FaiglerMazehFit():
def __init__(self, P_orb, inc, R_star, M_star, T_star, A_ellip=False, A_beam=False,
R_p=False, a=False, u=False, g=0.65, logg=... | [
"numpy.mean",
"numpy.log10",
"astropy.modeling.blackbody.blackbody_lambda",
"numpy.sin",
"numpy.genfromtxt"
] | [((8484, 8553), 'numpy.genfromtxt', 'np.genfromtxt', (['file'], {'delimiter': 'delimiter', 'usecols': '(0, 1)', 'unpack': '(True)'}), '(file, delimiter=delimiter, usecols=(0, 1), unpack=True)\n', (8497, 8553), True, 'import numpy as np\n'), ((6992, 7078), 'numpy.genfromtxt', 'np.genfromtxt', (['"""../claret_ldc.dat"""'... |
# Lint as: python3
# Copyright 2019, The TensorFlow Federated 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 ... | [
"attr.s",
"tensorflow_federated.learning.build_federated_averaging_process",
"tensorflow_federated.python.research.utils.checkpoint_utils.save",
"tensorflow.test.main",
"tensorflow.compat.v1.enable_v2_behavior",
"functools.partial",
"tensorflow.nest.flatten",
"tensorflow_federated.python.research.util... | [((890, 921), 'attr.s', 'attr.s', ([], {'cmp': '(False)', 'frozen': '(False)'}), '(cmp=False, frozen=False)\n', (896, 921), False, 'import attr\n'), ((1255, 1264), 'attr.ib', 'attr.ib', ([], {}), '()\n', (1262, 1264), False, 'import attr\n'), ((1285, 1294), 'attr.ib', 'attr.ib', ([], {}), '()\n', (1292, 1294), False, '... |
"""
field.py
Class instance used for modifying field via Display window.
"""
# Load the needed packages
from functools import partial
from ..core import Variable, Component, QtGui, QtCore
class FieldButtonWindow(Component):
'''Class to display a Window with Field name radio buttons.'''
Vradar = None #: s... | [
"functools.partial"
] | [((3174, 3209), 'functools.partial', 'partial', (['self.FieldSelectCmd', 'field'], {}), '(self.FieldSelectCmd, field)\n', (3181, 3209), False, 'from functools import partial\n')] |
from bson.errors import InvalidId
from django.core.exceptions import ValidationError
from django.utils.encoding import smart_str
from mongoengine import dereference
from mongoengine.base.document import BaseDocument
from mongoengine.document import Document
from rest_framework import serializers
from mongoengine.fields... | [
"django.core.exceptions.ValidationError",
"django.utils.encoding.smart_str",
"mongoengine.dereference.DeReference"
] | [((2884, 2904), 'django.core.exceptions.ValidationError', 'ValidationError', (['msg'], {}), '(msg)\n', (2899, 2904), False, 'from django.core.exceptions import ValidationError\n'), ((1074, 1090), 'django.utils.encoding.smart_str', 'smart_str', (['field'], {}), '(field)\n', (1083, 1090), False, 'from django.utils.encodi... |
import pytest
from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore... | [
"fuzz_lightyear.datastore.get_non_vulnerable_operations.cache_clear",
"fuzz_lightyear.datastore._ALL_POST_FUZZ_HOOKS_BY_TAG.clear",
"fuzz_lightyear.supplements.abstraction.get_abstraction.cache_clear",
"fuzz_lightyear.datastore._RERUN_POST_FUZZ_HOOKS_BY_TAG.clear",
"fuzz_lightyear.datastore.get_included_tag... | [((723, 751), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (737, 751), False, 'import pytest\n'), ((1238, 1266), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (1252, 1266), False, 'import pytest\n'), ((776, 805), 'fuzz_lightyear.supplements.... |
import logging
from qrutilities.imageutils import ImageUtils
from PyQt4.QtGui import QColor
logger = logging.getLogger('console')
class WellPlotStyleHandler(object):
'''
classdocs
'''
def saveDataState(self, wellPlotData, wellPlotStyleWidget):
if wellPlotStyleWidget.plotTitleOnCheckBox.isC... | [
"logging.getLogger",
"qrutilities.imageutils.ImageUtils.rgbToString"
] | [((101, 129), 'logging.getLogger', 'logging.getLogger', (['"""console"""'], {}), "('console')\n", (118, 129), False, 'import logging\n'), ((615, 646), 'qrutilities.imageutils.ImageUtils.rgbToString', 'ImageUtils.rgbToString', (['r', 'g', 'b'], {}), '(r, g, b)\n', (637, 646), False, 'from qrutilities.imageutils import I... |
import datetime
import json
import dateutil.parser
from django.contrib.auth import get_user_model
from django.test import Client, TestCase
from django.utils import timezone
from apps.devicelocation.models import DeviceLocation
from apps.physicaldevice.models import Device
from apps.property.models import GenericProp... | [
"apps.property.models.GenericProperty.objects.create_str_property",
"apps.streamdata.models.StreamData.objects.all",
"apps.report.models.GeneratedUserReport.objects.filter",
"apps.property.models.GenericProperty.objects.create_int_property",
"apps.physicaldevice.models.Device.objects.create_device",
"apps... | [((937, 953), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (951, 953), False, 'from django.contrib.auth import get_user_model\n'), ((1148, 1248), 'apps.stream.models.StreamVariable.objects.create_variable', 'StreamVariable.objects.create_variable', ([], {'name': '"""Var A"""', 'project': 's... |
#!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import optparse
import os
import sys
import tempfile
import zipfile
from util import build_utils
def _C... | [
"util.build_utils.CheckOptions",
"zipfile.ZipFile",
"os.rename",
"util.build_utils.ParseGnList",
"os.path.join",
"optparse.OptionParser",
"logging.warning",
"util.build_utils.TempDir",
"os.environ.get",
"os.getcwd",
"util.build_utils.CheckOutput",
"util.build_utils.ExpandFileArgs",
"util.bui... | [((675, 705), 'zipfile.ZipFile', 'zipfile.ZipFile', (['dex_path', '"""r"""'], {}), "(dex_path, 'r')\n", (690, 705), False, 'import zipfile\n'), ((754, 810), 'zipfile.ZipFile', 'zipfile.ZipFile', (['tmp_dex_path', '"""w"""', 'zipfile.ZIP_DEFLATED'], {}), "(tmp_dex_path, 'w', zipfile.ZIP_DEFLATED)\n", (769, 810), False, ... |
"""Django settings for botwtracker project.
Copyright (c) 2017, <NAME>.
botw-tracker is an open source software project released under the MIT License.
See the accompanying LICENSE file for terms.
"""
import os
from .config_local import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_... | [
"os.path.abspath",
"os.path.join"
] | [((397, 433), 'os.path.join', 'os.path.join', (['BASE_DIR', '""".."""', '"""data"""'], {}), "(BASE_DIR, '..', 'data')\n", (409, 433), False, 'import os\n'), ((2871, 2909), 'os.path.join', 'os.path.join', (['BASE_DIR', '""".."""', '"""static"""'], {}), "(BASE_DIR, '..', 'static')\n", (2883, 2909), False, 'import os\n'),... |
import legacy_code.tf_cnn_siamese.configurations as conf
import tensorflow as tf
import numpy as np
def construct_cnn(x, conv_weights, conv_biases, fc_weights, fc_biases,
dropout = False):
"""
constructs the convolution graph for one image
:param x: input node
:param conv_weights: convolutio... | [
"tensorflow.nn.conv2d",
"numpy.prod",
"tensorflow.nn.max_pool",
"tensorflow.Variable",
"tensorflow.squared_difference",
"tensorflow.nn.l2_loss",
"tensorflow.nn.sigmoid",
"tensorflow.name_scope",
"tensorflow.nn.dropout",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.nn.sigmoid_cross_en... | [((1327, 1348), 'tensorflow.reshape', 'tf.reshape', (['x', '[n, m]'], {}), '(x, [n, m])\n', (1337, 1348), True, 'import tensorflow as tf\n'), ((2472, 2509), 'tensorflow.squared_difference', 'tf.squared_difference', (['twin_1', 'twin_2'], {}), '(twin_1, twin_2)\n', (2493, 2509), True, 'import tensorflow as tf\n'), ((325... |
import sys
import logging
import unittest
from testfixtures import LogCapture
from twisted.python.failure import Failure
from scrapy.utils.log import (failure_to_exc_info, TopLevelFormatter,
LogCounterHandler, StreamLogger)
from scrapy.utils.test import get_crawler
from scrapy.extensions... | [
"logging.getLogger",
"scrapy.utils.log.LogCounterHandler",
"scrapy.utils.test.get_crawler",
"scrapy.utils.log.failure_to_exc_info",
"sys.exc_info",
"scrapy.utils.log.StreamLogger",
"twisted.python.failure.Failure",
"scrapy.utils.log.TopLevelFormatter",
"testfixtures.LogCapture"
] | [((802, 814), 'testfixtures.LogCapture', 'LogCapture', ([], {}), '()\n', (812, 814), False, 'from testfixtures import LogCapture\n'), ((930, 955), 'logging.getLogger', 'logging.getLogger', (['"""test"""'], {}), "('test')\n", (947, 955), False, 'import logging\n'), ((1142, 1173), 'logging.getLogger', 'logging.getLogger'... |
###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... | [
"tensorflow.python.keras.__version__.split",
"onnx.defs.onnx_opset_version",
"os.environ.get",
"pkg_resources.parse_version",
"distutils.version.StrictVersion",
"pkg_resources.get_distribution"
] | [((709, 739), 'onnx.defs.onnx_opset_version', 'onnx.defs.onnx_opset_version', ([], {}), '()\n', (737, 739), False, 'import onnx\n'), ((820, 856), 'pkg_resources.parse_version', 'pkg_resources.parse_version', (['"""1.0.1"""'], {}), "('1.0.1')\n", (847, 856), False, 'import pkg_resources\n'), ((1089, 1120), 'os.environ.g... |
'''Test package.'''
import xroms
from glob import glob
import os
def test_open_netcdf():
'''Test xroms.open_netcdf().'''
base = os.path.join(xroms.__path__[0],'..','tests','input')
files = glob('%s/ocean_his_000?.nc' % base)
ds = xroms.open_netcdf(files)
assert ds
def test_open_zar... | [
"xroms.open_zarr",
"os.path.join",
"glob.glob",
"xroms.open_netcdf"
] | [((144, 199), 'os.path.join', 'os.path.join', (['xroms.__path__[0]', '""".."""', '"""tests"""', '"""input"""'], {}), "(xroms.__path__[0], '..', 'tests', 'input')\n", (156, 199), False, 'import os\n'), ((209, 244), 'glob.glob', 'glob', (["('%s/ocean_his_000?.nc' % base)"], {}), "('%s/ocean_his_000?.nc' % base)\n", (213,... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^piechart/', views.demo_piechart, name='demo_piechart'),
url(r'^linechart/', views.demo_linechart, name='demo_linechart'),
url(r'^linechart_without_date/', views.demo_linechart_without_date,... | [
"django.conf.urls.url"
] | [((75, 109), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.home'], {'name': '"""home"""'}), "('^$', views.home, name='home')\n", (78, 109), False, 'from django.conf.urls import url\n'), ((116, 176), 'django.conf.urls.url', 'url', (['"""^piechart/"""', 'views.demo_piechart'], {'name': '"""demo_piechart"""'}), "('^... |
# -*- coding:utf-8 -*-
import tensorflow as tf
class CNN:
def __init__(self, save_or_load_path=None, trainable=True, learning_rate = 0.00002,timestep=9,road=189,predstep=1):
self.trainable = trainable
self.learning_rate = learning_rate
self.road = road
self.input_size = timestep *... | [
"tensorflow.nn.conv2d",
"tensorflow.nn.max_pool",
"tensorflow.Variable",
"tensorflow.squared_difference",
"tensorflow.placeholder",
"tensorflow.nn.conv1d",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.train.AdamOptimizer",
"tensorflow.truncated_normal"
] | [((391, 462), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, self.input_size]', 'name': '"""input"""'}), "(tf.float32, shape=[None, self.input_size], name='input')\n", (405, 462), True, 'import tensorflow as tf\n'), ((495, 568), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32']... |
import cv2
import mediapipe as mp
from time import sleep
import numpy as np
import autopy
import pynput
wCam, hCam = 1280, 720
wScr, hScr = autopy.screen.size()
cap = cv2.VideoCapture(0)
cap.set(3, wCam)
cap.set(4, hCam)
mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands
mouse = pynput.mouse.Cont... | [
"autopy.screen.size",
"cv2.flip",
"time.sleep",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.cvtColor",
"pynput.mouse.Controller",
"cv2.waitKey"
] | [((141, 161), 'autopy.screen.size', 'autopy.screen.size', ([], {}), '()\n', (159, 161), False, 'import autopy\n'), ((169, 188), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (185, 188), False, 'import cv2\n'), ((303, 328), 'pynput.mouse.Controller', 'pynput.mouse.Controller', ([], {}), '()\n', (326, 3... |
import threading
from queue import Queue
from multiprocessing.pool import ApplyResult
import tabular_logger as tlogger
class AsyncWorker(object):
@property
def concurrent_tasks(self):
raise NotImplementedError()
def run_async(self, task_id, task, callback):
raise NotImplementedError()
... | [
"tabular_logger.info",
"multiprocessing.pool.ApplyResult",
"tabular_logger.exception",
"tabular_logger.warn",
"threading.Thread",
"queue.Queue"
] | [((430, 437), 'queue.Queue', 'Queue', ([], {}), '()\n', (435, 437), False, 'from queue import Queue\n'), ((502, 509), 'queue.Queue', 'Queue', ([], {}), '()\n', (507, 509), False, 'from queue import Queue\n'), ((836, 898), 'threading.Thread', 'threading.Thread', ([], {'target': 'WorkerHub._handle_input', 'args': '(self,... |
"""Django Admin Panels for App"""
from django.contrib import admin
from mailer import models
@admin.register(models.SendingAddress)
class SendingAddressAdmin(admin.ModelAdmin):
"""Admin View for SendingAddress"""
list_display = ('address', 'organization')
list_filter = ('organization__name',)
actions ... | [
"django.contrib.admin.register"
] | [((96, 133), 'django.contrib.admin.register', 'admin.register', (['models.SendingAddress'], {}), '(models.SendingAddress)\n', (110, 133), False, 'from django.contrib import admin\n')] |
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import os
import time
import csv
from webdriver_manager.chrome import ChromeDriverManager
import math
from basic_function import ... | [
"selenium.webdriver.chrome.options.Options",
"os.path.exists",
"time.sleep",
"os.remove",
"webdriver_manager.chrome.ChromeDriverManager",
"csv.reader",
"basic_function.basic_login",
"basic_function.find_element"
] | [((422, 431), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (429, 431), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1060, 1073), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1070, 1073), False, 'import time\n'), ((2036, 2049), 'time.sleep', 'time.sleep', (['(... |
import struct
import msgpack
from lbrynet.wallet.transaction import Transaction, Output
from torba.server.hash import hash_to_hex_str
from torba.server.block_processor import BlockProcessor
from lbrynet.schema.claim import Claim
from lbrynet.wallet.server.model import ClaimInfo
class LBRYBlockProcessor(BlockProce... | [
"lbrynet.schema.claim.Claim.from_bytes",
"lbrynet.wallet.server.model.ClaimInfo",
"struct.pack",
"torba.server.hash.hash_to_hex_str"
] | [((6877, 6952), 'lbrynet.wallet.server.model.ClaimInfo', 'ClaimInfo', (['name', 'value', 'txid', 'nout', 'output.amount', 'address', 'height', 'cert_id'], {}), '(name, value, txid, nout, output.amount, address, height, cert_id)\n', (6886, 6952), False, 'from lbrynet.wallet.server.model import ClaimInfo\n'), ((4367, 439... |