code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
"""
import sys
import itertools
from climate.lib import mapper
from climate.lib import utilities
from climate.lib import inquirers
from climate.lib.inquirers import INQUIRER_TABLE
from climate.lib.converters import CONVERSION_TABLE
from climate.lib.converters import map_int, map_float, map_bool, map_list
from . i... | [
"climate.lib.mapper.map_string",
"sys.exit",
"climate.lib.inquirers.inquirer_list",
"climate.lib.inquirers.get_inquirer"
] | [((1644, 1693), 'climate.lib.inquirers.inquirer_list', 'inquirers.inquirer_list', (['menu_names', 'menu_message'], {}), '(menu_names, menu_message)\n', (1667, 1693), False, 'from climate.lib import inquirers\n'), ((4833, 4866), 'climate.lib.inquirers.get_inquirer', 'inquirers.get_inquirer', (['"""choices"""'], {}), "('... |
from django.conf import settings
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAdminUser
from re... | [
"django.views.decorators.cache.cache_page"
] | [((868, 893), 'django.views.decorators.cache.cache_page', 'cache_page', (['CACHE_TIMEOUT'], {}), '(CACHE_TIMEOUT)\n', (878, 893), False, 'from django.views.decorators.cache import cache_page\n'), ((1448, 1473), 'django.views.decorators.cache.cache_page', 'cache_page', (['CACHE_TIMEOUT'], {}), '(CACHE_TIMEOUT)\n', (1458... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import random
import math
import logging
import itertools
from fairseq import utils
from fairseq.data import ... | [
"fairseq.data.data_utils.collate_tokens",
"numpy.full",
"torch.LongTensor",
"torch.FloatTensor",
"random.random",
"numpy.append",
"numpy.array",
"numpy.arange",
"logging.getLogger"
] | [((488, 515), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (505, 515), False, 'import logging\n'), ((842, 978), 'fairseq.data.data_utils.collate_tokens', 'data_utils.collate_tokens', (['[s[key] for s in samples]', 'pad_idx', 'eos_idx', 'left_pad', 'move_eos_to_beginning'], {'pad_to_leng... |
#! /usr/bin/python
import numpy as np
import math
from scipy.spatial import KDTree
import openravepy as orpy
import transformations
from robotiqloader import RobotiqHand, InvalidTriangleException
import sys, time, logging, copy
import itertools
from utils import ObjectFileIO, clamp, compute_grasp_stability, normal_dis... | [
"openravepy.RaveDestroy",
"numpy.sum",
"numpy.random.randint",
"numpy.linalg.norm",
"utils.normal_distance",
"rospy.logwarn",
"openravepy.Environment",
"IPython.embed",
"numpy.random.choice",
"math.isnan",
"transformations.rotation_from_matrix",
"numpy.asarray",
"transformations.rotation_mat... | [((931, 1053), 'openravepy.databases.inversekinematics.InverseKinematicsModel', 'orpy.databases.inversekinematics.InverseKinematicsModel', (['self._robot'], {'iktype': 'orpy.IkParameterization.Type.Transform6D'}), '(self._robot, iktype\n =orpy.IkParameterization.Type.Transform6D)\n', (986, 1053), True, 'import openr... |
# © 2021 <NAME> (initOS GmbH)
# License Apache-2.0 (http://www.apache.org/licenses/).
import os
from queue import Empty
from unittest import mock
import pytest
from doblib.bootstrap import BootstrapEnvironment, aggregate_repo
def aggregate_exception(repo, args, sem, err_queue):
try:
err_queue.put_nowai... | [
"unittest.mock.MagicMock",
"os.getcwd",
"queue.Empty",
"unittest.mock.patch",
"doblib.bootstrap.aggregate_repo",
"doblib.bootstrap.BootstrapEnvironment",
"os.chdir"
] | [((889, 949), 'unittest.mock.patch', 'mock.patch', (['"""doblib.bootstrap.match_dir"""'], {'return_value': '(False)'}), "('doblib.bootstrap.match_dir', return_value=False)\n", (899, 949), False, 'from unittest import mock\n'), ((1601, 1641), 'unittest.mock.patch', 'mock.patch', (['"""doblib.bootstrap.traceback"""'], {}... |
from django.conf.urls import url
from django.http import HttpResponseRedirect
from .views import PostCreate, PostUpdate, PostDelete, ProfileView
app_name = 'api'
urlpatterns = [
url(r'^$', lambda r: HttpResponseRedirect('new/'), name='index'),
url(r'^(?P<pk>[0-9]+)/$', PostUpdate.as_view(), name='update'),
... | [
"django.http.HttpResponseRedirect"
] | [((206, 234), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['"""new/"""'], {}), "('new/')\n", (226, 234), False, 'from django.http import HttpResponseRedirect\n')] |
import uuid
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.transl... | [
"django.forms.EmailField",
"django.core.urlresolvers.reverse",
"django.forms.PasswordInput",
"spreedly.models.Plan.objects.values_list",
"spreedly.models.Gift.objects.create",
"django.utils.translation.ugettext_lazy",
"spreedly.pyspreedly.api.Client",
"django.contrib.auth.models.User.objects.get",
"... | [((616, 661), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(30)', 'required': '(True)'}), '(max_length=30, required=True)\n', (631, 661), False, 'from django import forms\n'), ((696, 727), 'django.forms.EmailField', 'forms.EmailField', ([], {'required': '(True)'}), '(required=True)\n', (712, 727), ... |
import pytest
from lupin.errors import InvalidIn
from lupin.validators import In
@pytest.fixture
def validator():
return In({1, 2, 3})
class TestCall(object):
def test_raise_error_if_invalid_value(self, validator):
with pytest.raises(InvalidIn):
validator(4, [])
def test_does_nothi... | [
"pytest.raises",
"lupin.validators.In"
] | [((128, 141), 'lupin.validators.In', 'In', (['{1, 2, 3}'], {}), '({1, 2, 3})\n', (130, 141), False, 'from lupin.validators import In\n'), ((241, 265), 'pytest.raises', 'pytest.raises', (['InvalidIn'], {}), '(InvalidIn)\n', (254, 265), False, 'import pytest\n')] |
# -*- coding: utf-8 -*-
import os
import csv
import dirfiles
def trial_order(order_directory):
"""
Reads a specific trial order for n blocks from n csv files and
returns n lists to be used by the object block_list.order_trials()
of Expyriment library
"""
# Define the pathway of the inputs dir... | [
"dirfiles.listdir_csvnohidden",
"os.path.abspath"
] | [((344, 376), 'os.path.abspath', 'os.path.abspath', (['order_directory'], {}), '(order_directory)\n', (359, 376), False, 'import os\n'), ((454, 494), 'dirfiles.listdir_csvnohidden', 'dirfiles.listdir_csvnohidden', (['order_path'], {}), '(order_path)\n', (482, 494), False, 'import dirfiles\n')] |
import pct_titles
import os
import cythonmagick
from StringIO import StringIO
def escape(s):
s = s.replace("&", "\&")
s = s.replace("<", "\<")
s = s.replace(">", ">")
s = s.replace('"', """)
s = s.replace("'", ''')
return s
def convert_color(c, alpha):
a = 1.0 - (alpha ... | [
"cythonmagick.Ellipse",
"optparse.OptionParser",
"os.path.dirname",
"cythonmagick.Line",
"cythonmagick.Image",
"os.path.splitext",
"pct_titles.PctFile",
"cythonmagick.Geometry",
"cythonmagick.RoundRectangle"
] | [((4201, 4221), 'pct_titles.PctFile', 'pct_titles.PctFile', ([], {}), '()\n', (4219, 4221), False, 'import pct_titles\n'), ((4311, 4354), 'cythonmagick.Image', 'cythonmagick.Image', ([], {'size': 'size', 'color': '"""grey"""'}), "(size=size, color='grey')\n", (4329, 4354), False, 'import cythonmagick\n'), ((4529, 4550)... |
import os
from flask import Flask, request, redirect, url_for, render_template, send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = set(['m'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['MAX_CONTENT_LENGTH'] = 16*1024*1024
def al... | [
"flask.Flask",
"werkzeug.secure_filename",
"flask.url_for",
"flask.render_template",
"flask.send_from_directory",
"os.path.join"
] | [((204, 219), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'from flask import Flask, request, redirect, url_for, render_template, send_from_directory\n'), ((814, 843), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (829, 843), False, 'from f... |
from django.db import models
from django.db.models import Min
import requests
import isbnlib
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
from django.templatetags.static import static
from django.conf import settings
import datetime
from django.utils.timezone import now
cla... | [
"django.db.models.TextField",
"django.core.files.File",
"django.db.models.ManyToManyField",
"django.core.files.temp.NamedTemporaryFile",
"django.db.models.Min",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveIntegerField",
"django.utils.timezone.now",
"djang... | [((355, 425), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'primary_key': '(True)', 'max_digits': '(13)', 'decimal_places': '(0)'}), '(primary_key=True, max_digits=13, decimal_places=0)\n', (374, 425), False, 'from django.db import models\n'), ((438, 470), 'django.db.models.CharField', 'models.CharFiel... |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import csv
from product_spiders.items import Produc... | [
"scrapy.http.Request",
"scrapy.utils.response.get_base_url",
"csv.DictReader",
"os.path.dirname",
"product_spiders.items.Product",
"os.path.join",
"scrapy.selector.HtmlXPathSelector"
] | [((391, 416), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (406, 416), False, 'import os\n'), ((913, 940), 'scrapy.selector.HtmlXPathSelector', 'HtmlXPathSelector', (['response'], {}), '(response)\n', (930, 940), False, 'from scrapy.selector import HtmlXPathSelector\n'), ((630, 647), 'csv.D... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 1 16:33:02 2018
@author: <NAME>
"""
# Calculate the distance map between the C-alpha atoms in a protein. The input
# file is required to be a C_alpha coordinate file
import sys
import re
import numpy as np
import matplotlib.pyplot as plt
def ge... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"re.match",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.linalg.norm"
] | [((1873, 1885), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1883, 1885), True, 'import matplotlib.pyplot as plt\n'), ((1886, 1918), 'matplotlib.pyplot.imshow', 'plt.imshow', (['dist_mat'], {'cmap': '"""jet"""'}), "(dist_mat, cmap='jet')\n", (1896, 1918), True, 'import matplotlib.pyplot as plt\n'), ((19... |
from setuptools import setup
setup(
name='discord-exchange',
version='0.0.1',
description='A Discord bot to trade on arbitrary quantities',
url='https://github.com/miltfra/discord-exchange',
author='<NAME>',
author_email='<EMAIL>',
license='Apache License 2.0',
packages=['discord_exchan... | [
"setuptools.setup"
] | [((30, 662), 'setuptools.setup', 'setup', ([], {'name': '"""discord-exchange"""', 'version': '"""0.0.1"""', 'description': '"""A Discord bot to trade on arbitrary quantities"""', 'url': '"""https://github.com/miltfra/discord-exchange"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""Apache ... |
# coding: utf-8
import pprint
import re
import six
class QueryVmrPkgResResultDTO:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the ... | [
"six.iteritems"
] | [((4683, 4716), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (4696, 4716), False, 'import six\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-09-22 00:54:06
# @Author : <NAME> (<EMAIL>)
# @Link : https://github.com/iseesaw
# @Version : $Id$
import os
from EAlib.utils.dataloader import BasicLoader
def BasicLoaderTest():
import os
dirpath = "D:\\ACourse\\2019Fall\\Evoluti... | [
"os.path.join",
"os.listdir"
] | [((365, 384), 'os.listdir', 'os.listdir', (['dirpath'], {}), '(dirpath)\n', (375, 384), False, 'import os\n'), ((444, 471), 'os.path.join', 'os.path.join', (['dirpath', 'file'], {}), '(dirpath, file)\n', (456, 471), False, 'import os\n')] |
from django.conf.urls import patterns, include, url
from pydetector.views import hello
from pydetector.views2 import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^logs/$', logs),
# Examples:
url(r'^$', welcome)... | [
"django.contrib.admin.autodiscover",
"django.conf.urls.include",
"django.conf.urls.url"
] | [((207, 227), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (225, 227), False, 'from django.contrib import admin\n'), ((257, 277), 'django.conf.urls.url', 'url', (['"""^logs/$"""', 'logs'], {}), "('^logs/$', logs)\n", (260, 277), False, 'from django.conf.urls import patterns, include, url... |
from keras.models import Model
from keras.optimizers import Adam, SGD
from keras.layers.core import Dropout, Reshape
from keras.layers import PReLU, Conv2DTranspose
from keras.layers import Input, Dense, Dropout, LeakyReLU, BatchNormalization, Conv2D, MaxPooling2D, AveragePooling2D, \
concatenate, Activation, ZeroP... | [
"keras.regularizers.l2",
"keras.layers.core.Reshape",
"keras.layers.Activation",
"keras.layers.convolutional.UpSampling2D",
"keras.layers.Dropout",
"keras.layers.add",
"keras.layers.convolutional.MaxPooling2D",
"keras.optimizers.Adam",
"keras.layers.Conv2DTranspose",
"keras.models.Model",
"keras... | [((2608, 2646), 'keras.layers.Input', 'Input', ([], {'batch_shape': '(None, dim, dim, 1)'}), '(batch_shape=(None, dim, dim, 1))\n', (2613, 2646), False, 'from keras.layers import Concatenate, Input\n'), ((3455, 3475), 'keras.layers.add', 'add', (['[BUCR32, BCR11]'], {}), '([BUCR32, BCR11])\n', (3458, 3475), False, 'fro... |
from datetime import datetime
from app.models import db
__all__ = ['Message']
class Message(db.Model):
"""Message
Messages only have an author. They are either connected to a working
group (AG) or to an individual user (recepient).
:param id:
:param message:
:param time:
:param author... | [
"app.models.db.Column",
"app.models.db.ForeignKey",
"app.models.db.relationship",
"datetime.datetime.now",
"app.models.db.Text"
] | [((500, 568), 'app.models.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'unique': '(True)', 'nullable': '(False)'}), '(db.Integer, primary_key=True, unique=True, nullable=False)\n', (509, 568), False, 'from app.models import db\n'), ((934, 1033), 'app.models.db.relationship', 'db.relationship', ([... |
import datajoint as dj
from djsubject import subject
from djlab import lab
from djephys import ephys
from my_project.utils import get_ephys_probe_data_dir, get_ks_data_dir
# ============== Declare "lab" and "subject" schema ==============
lab.declare('u24_lab')
subject.declare('u24_subject',
dependen... | [
"djephys.ephys.ProbeType.create_neuropixels_probe",
"djlab.lab.declare",
"datajoint.schema",
"djsubject.subject.declare"
] | [((241, 263), 'djlab.lab.declare', 'lab.declare', (['"""u24_lab"""'], {}), "('u24_lab')\n", (252, 263), False, 'from djlab import lab\n'), ((265, 396), 'djsubject.subject.declare', 'subject.declare', (['"""u24_subject"""'], {'dependencies': "{'Source': lab.Source, 'Lab': lab.Lab, 'Protocol': lab.Protocol, 'User':\n ... |
from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from aristotle_mdr.contrib.generic.views import GenericAlterOneToManyView, generic_foreign_key_factory_view
from daedalus_data_dictionary.storage import models
urlpatterns = [
url(r'^dictionary/(?P<iid>\d+)?/edit/?$',
... | [
"django.utils.translation.ugettext_lazy"
] | [((635, 662), 'django.utils.translation.ugettext_lazy', '_', (['"""Add a metadata concept"""'], {}), "('Add a metadata concept')\n", (636, 662), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((687, 725), 'django.utils.translation.ugettext_lazy', '_', (['"""Change dictionary concept entries"""'], {... |
# coding=utf-8
# Author: <NAME> <<EMAIL>>
import numpy as np
from torch import nn
from torch.nn import Parameter
from eeggan.pytorch.modules.conv.multiconv import MultiConv1d
class WeightScale(object):
"""
Implemented for PyTorch using WeightNorm implementation
https://pytorch.org/docs/stable/_modules... | [
"torch.nn.Parameter",
"numpy.sqrt"
] | [((1836, 1846), 'numpy.sqrt', 'np.sqrt', (['(2)'], {}), '(2)\n', (1843, 1846), True, 'import numpy as np\n'), ((1207, 1232), 'torch.nn.Parameter', 'nn.Parameter', (['weight.data'], {}), '(weight.data)\n', (1219, 1232), False, 'from torch import nn\n'), ((1665, 1687), 'torch.nn.Parameter', 'Parameter', (['weight.data'],... |
'''
Module containing Tracer metaclass and associated trace decorator.
'''
from types import FunctionType
from functools import wraps
import traceback
from pprint import pprint
import sys
class Tracer(type):
def __new__(cls, name, bases, cls_dct):
wrapped_cls_dct = {}
for attribute_name, attribute... | [
"sys.exit",
"traceback.print_exc",
"pprint.pprint",
"functools.wraps"
] | [((1038, 1051), 'functools.wraps', 'wraps', (['method'], {}), '(method)\n', (1043, 1051), False, 'from functools import wraps\n'), ((1264, 1285), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (1283, 1285), False, 'import traceback\n'), ((1452, 1490), 'pprint.pprint', 'pprint', (['self._trace'], {'inde... |
"""Rest Api views."""
from rest_framework.views import APIView
from rest_framework.response import Response
from .rectotext import rec_to_text
from .search import find
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decor... | [
"django.utils.decorators.method_decorator",
"django.http.HttpResponse",
"gtts.gTTS",
"os.path.getsize",
"django.http.JsonResponse",
"os.path.join"
] | [((395, 441), 'django.utils.decorators.method_decorator', 'method_decorator', (['csrf_exempt'], {'name': '"""dispatch"""'}), "(csrf_exempt, name='dispatch')\n", (411, 441), False, 'from django.utils.decorators import method_decorator\n'), ((1015, 1061), 'django.utils.decorators.method_decorator', 'method_decorator', ([... |
from pydantic import BaseModel, validator, Field
from typing import List, Dict
from datetime import datetime
class IndicesIn(BaseModel):
index: str
source: str
sourcetype: str
class IndiceList(BaseModel):
indices: List[IndicesIn]
integration: str
execution_date: datetime
@validator('exec... | [
"datetime.datetime.strptime",
"pydantic.validator"
] | [((305, 355), 'pydantic.validator', 'validator', (['"""execution_date"""'], {'pre': '(True)', 'always': '(True)'}), "('execution_date', pre=True, always=True)\n", (314, 355), False, 'from pydantic import BaseModel, validator, Field\n'), ((408, 452), 'datetime.datetime.strptime', 'datetime.strptime', (['v', '"""%Y-%m-%d... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import os
class Config:
__v2ray_core_path = None
__v2ray_node_path = None
def __init__(self):
self.config = configparser.ConfigParser()
parent_dir = os.path.dirname(os.path.abspath(__file__))
self.config_path = os... | [
"os.path.abspath",
"configparser.ConfigParser",
"os.path.join"
] | [((199, 226), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (224, 226), False, 'import configparser\n'), ((318, 371), 'os.path.join', 'os.path.join', (['Config.__v2ray_core_path', '"""config.json"""'], {}), "(Config.__v2ray_core_path, 'config.json')\n", (330, 371), False, 'import os\n'), (... |
import logging
import os
import asyncio
from cryptoxlib.CryptoXLib import CryptoXLib
from cryptoxlib.PeriodicChecker import PeriodicChecker
from cryptoxlib.Pair import Pair
from cryptoxlib.clients.binance.BinanceClient import BinanceClient
from cryptoxlib.clients.binance.BinanceWebsocket import OrderBookSymbolTickerS... | [
"asyncio.sleep",
"logging.StreamHandler",
"cryptoxlib.PeriodicChecker.PeriodicChecker",
"cryptoxlib.Pair.Pair",
"logging.getLogger",
"cryptoxlib.CryptoXLib.CryptoXLib.create_binance_client"
] | [((392, 423), 'logging.getLogger', 'logging.getLogger', (['"""cryptoxlib"""'], {}), "('cryptoxlib')\n", (409, 423), False, 'import logging\n'), ((466, 489), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (487, 489), False, 'import logging\n'), ((3904, 3954), 'cryptoxlib.CryptoXLib.CryptoXLib.create... |
#!/usr/bin/env python3
"""
Python EKF Planner
@Author: <NAME>, original MATLAB code and Python version
@Author: <NAME>, initial MATLAB port
Based on code by <NAME>, Oxford University,
http://www.robots.ox.ac.uk/~pnewman
"""
from collections import namedtuple
import numpy as np
import scipy as sp
import matplotlib.... | [
"matplotlib.pyplot.xlim",
"spatialmath.base.expand_dims",
"matplotlib.pyplot.plot",
"numpy.ones",
"numpy.random.default_rng",
"numpy.cumsum",
"spatialmath.base.array2str",
"numpy.linalg.inv",
"spatialmath.base.plotvol3",
"collections.namedtuple",
"numpy.array",
"numpy.exp",
"matplotlib.pyplo... | [((3961, 3988), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (3982, 3988), True, 'import numpy as np\n'), ((4096, 4141), 'collections.namedtuple', 'namedtuple', (['"""PFlog"""', '"""t odo xest std weights"""'], {}), "('PFlog', 't odo xest std weights')\n", (4106, 4141), False, 'from ... |
# Generated by Django 2.2.13 on 2020-08-26 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0063_merge_20200826_2021'),
]
operations = [
migrations.RenameField(
model_name='censussubdivision',
ol... | [
"django.db.models.IntegerField",
"django.db.migrations.RenameField"
] | [((238, 410), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""censussubdivision"""', 'old_name': '"""households_owner_spending_30_pct_income"""', 'new_name': '"""households_owner_pct_spending_30_pct_income"""'}), "(model_name='censussubdivision', old_name=\n 'households_owner_sp... |
from datetime import datetime
import logging
from flask import jsonify, request
from app import app, db
from app.models import Player, Chart, Score
from app.ranking import update_pb_for_score, update_player_osmos
from app.lazer import process_lazer_payload
from . import dumb_decryption
@app.route('/versions')
def ve... | [
"app.app.config.get",
"app.app.route",
"app.db.session.rollback",
"app.models.Player",
"logging.warning",
"app.models.Chart",
"datetime.datetime.utcnow",
"app.ranking.update_pb_for_score",
"app.db.session.commit",
"app.ranking.update_player_osmos",
"app.models.Score",
"app.models.Chart.query.g... | [((291, 313), 'app.app.route', 'app.route', (['"""/versions"""'], {}), "('/versions')\n", (300, 313), False, 'from app import app, db\n'), ((483, 520), 'app.app.route', 'app.route', (['"""/lazer"""'], {'methods': "['POST']"}), "('/lazer', methods=['POST'])\n", (492, 520), False, 'from app import app, db\n'), ((611, 648... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Generate various Similarity matrix
through the MatrixGenerator methods
gen_matrix for synthetic data, and
gen_E_coli_matrix for DNA data.
"""
import numpy as np
# from scipy import sparse as sp
from scipy.linalg import toeplitz
def gen_lambdas(type_matrix, n):
''... | [
"scipy.linalg.toeplitz",
"numpy.floor",
"numpy.zeros",
"numpy.shape",
"numpy.sort",
"numpy.where",
"numpy.arange",
"numpy.mean",
"numpy.random.permutation",
"numpy.random.rand"
] | [((444, 455), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (452, 455), True, 'import numpy as np\n'), ((1336, 1353), 'scipy.linalg.toeplitz', 'toeplitz', (['lambdas'], {}), '(lambdas)\n', (1344, 1353), False, 'from scipy.linalg import toeplitz\n'), ((3120, 3144), 'numpy.where', 'np.where', (['(N > noise_prop)'], {}... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mapeo', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='organizaciones',
name='sl... | [
"django.db.models.IntegerField",
"django.db.models.SlugField"
] | [((343, 402), 'django.db.models.SlugField', 'models.SlugField', ([], {'default': '(1)', 'max_length': '(450)', 'editable': '(False)'}), '(default=1, max_length=450, editable=False)\n', (359, 402), False, 'from django.db import models, migrations\n'), ((566, 793), 'django.db.models.IntegerField', 'models.IntegerField', ... |
# Generated by Django 2.2.13 on 2020-09-10 15:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hierarchy", "0010_auto_20200910_1650")]
operations = [
migrations.AlterUniqueTogether(
name="subheading",
unique_together={("commodity_c... | [
"django.db.migrations.AlterUniqueTogether"
] | [((215, 343), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""subheading"""', 'unique_together': "{('commodity_code', 'description', 'nomenclature_tree')}"}), "(name='subheading', unique_together={(\n 'commodity_code', 'description', 'nomenclature_tree')})\n", (245, 34... |
from contextlib import ExitStack
from functools import wraps
from typing import TYPE_CHECKING, Any, Dict, Optional, TypeVar, overload
import fsspec
from funcy import cached_property
if TYPE_CHECKING:
from typing import BinaryIO, Callable, TextIO, Union
from typing_extensions import ParamSpec
from dvc.pr... | [
"typing_extensions.ParamSpec",
"contextlib.ExitStack",
"functools.wraps",
"tqdm.utils.CallbackIOWrapper",
"typing.TypeVar",
"dvc.ui._rich_progress.RichTransferProgress",
"dvc.progress.Tqdm"
] | [((408, 423), 'typing_extensions.ParamSpec', 'ParamSpec', (['"""_P"""'], {}), "('_P')\n", (417, 423), False, 'from typing_extensions import ParamSpec\n'), ((433, 446), 'typing.TypeVar', 'TypeVar', (['"""_R"""'], {}), "('_R')\n", (440, 446), False, 'from typing import TYPE_CHECKING, Any, Dict, Optional, TypeVar, overloa... |
# Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | [
"util_test.create_common_tensor",
"torch.ne",
"torch.ne_",
"common_utils.run_tests"
] | [((6502, 6513), 'common_utils.run_tests', 'run_tests', ([], {}), '()\n', (6511, 6513), False, 'from common_utils import TestCase, run_tests\n'), ((912, 935), 'torch.ne', 'torch.ne', (['input1', 'other'], {}), '(input1, other)\n', (920, 935), False, 'import torch\n'), ((1056, 1079), 'torch.ne', 'torch.ne', (['input1', '... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
"absl.testing.absltest.main",
"assessment_plan_modeling.ap_parsing.augmentation_lib.ChangeDelimAugmentation",
"assessment_plan_modeling.ap_parsing.augmentation_lib.NumberTitlesAugmentation",
"assessment_plan_modeling.ap_parsing.ap_parsing_lib.LabeledCharSpan",
"assessment_plan_modeling.ap_parsing.augmentati... | [((15701, 15716), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (15714, 15716), False, 'from absl.testing import absltest\n'), ((3372, 3422), 'assessment_plan_modeling.ap_parsing.augmentation_lib.StructuredAP.build', 'aug_lib.StructuredAP.build', (['ap', 'labeled_char_spans'], {}), '(ap, labeled_char... |
# Copyright (c) 2017 lululemon athletica Canada 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... | [
"os.path.isdir",
"tight.providers.aws.clients.boto3_client.session",
"os.listdir",
"tight.core.test_helpers.placebos_path"
] | [((2025, 2093), 'tight.core.test_helpers.placebos_path', 'test_helpers.placebos_path', (['"""/some/absolute/path.py"""', '"""my_namespace"""'], {}), "('/some/absolute/path.py', 'my_namespace')\n", (2051, 2093), True, 'import tight.core.test_helpers as test_helpers\n'), ((2367, 2432), 'tight.core.test_helpers.placebos_p... |
# project/server/__init__.py
import os
from flask import Flask, make_response, jsonify
app = Flask(__name__)
app_settings = os.getenv(
'APP_SETTINGS',
'project.server.config.DevelopmentConfig'
)
app.config.from_object(app_settings)
from project.server.api.routes import api_blueprint
app.register_bluepr... | [
"flask.jsonify",
"flask.Flask",
"os.getenv"
] | [((98, 113), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (103, 113), False, 'from flask import Flask, make_response, jsonify\n'), ((131, 199), 'os.getenv', 'os.getenv', (['"""APP_SETTINGS"""', '"""project.server.config.DevelopmentConfig"""'], {}), "('APP_SETTINGS', 'project.server.config.DevelopmentConf... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 3 13:10:21 2018
@author: DrLC
"""
from symtab import build_symtab
import constraint
import cfg
import os, sys
from interval import interval
class FCG(object):
def __init__(self, _cfg={}, _main="", _symtab={}):
assert _main in _cfg.keys()
... | [
"constraint.CG",
"symtab.build_symtab",
"constraint.RangeNode",
"cfg.CFG"
] | [((7446, 7464), 'symtab.build_symtab', 'build_symtab', (['path'], {}), '(path)\n', (7458, 7464), False, 'from symtab import build_symtab\n'), ((416, 465), 'constraint.CG', 'constraint.CG', (['_cfg[_main]', '_symtab[_main]', '_main'], {}), '(_cfg[_main], _symtab[_main], _main)\n', (429, 465), False, 'import constraint\n... |
from crc.scripts.script import Script
from crc.services.failing_service import FailingService
class FailingScript(Script):
def get_description(self):
return """It fails"""
def do_task_validate_only(self, task, *args, **kwargs):
pass
def do_task(self, task, *args, **kwargs):
Fai... | [
"crc.services.failing_service.FailingService.fail_as_service"
] | [((317, 349), 'crc.services.failing_service.FailingService.fail_as_service', 'FailingService.fail_as_service', ([], {}), '()\n', (347, 349), False, 'from crc.services.failing_service import FailingService\n')] |
import gi
gi.require_version('Handy', '0.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Handy
class MyWindow(Gtk.Window):
def __init__(self):
# https://lazka.github.io/pgi-docs/Gtk-3.0/classes/Window.html
Gtk.Window.__init__(self)
self.set_title("Switches Exam... | [
"gi.require_version",
"gi.repository.Gtk.main",
"gi.repository.Gtk.ListBox",
"gi.repository.Handy.ActionRow",
"gi.repository.Handy.init",
"gi.repository.Gtk.Switch.new",
"gi.repository.Gtk.Window.__init__"
] | [((11, 45), 'gi.require_version', 'gi.require_version', (['"""Handy"""', '"""0.0"""'], {}), "('Handy', '0.0')\n", (29, 45), False, 'import gi\n'), ((46, 78), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (64, 78), False, 'import gi\n'), ((1472, 1484), 'gi.repository.H... |
# Generated by Django 2.0.4 on 2018-04-21 15:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.TextField",
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField",
"django.db.models.TimeField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.DateField"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((2511, 2622), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang... |
"""
python 操作 Excel
"""
import xlrd
import xlwt
# #读取Excel文件
# workbook = xlrd.open_workbook(filename)
# #获取所有表名
# sheet_names = workbook.sheets()
#
# # #通过索引顺序获取一个工作表
# sheet0 = workbook.sheets()[0]
# # # or
# sheet1 = workbook.sheet_by_index(1)
# # #通过表名获取一个工作表
# sheet3 = workbook.sheet1
# # for i in sheet_names:... | [
"xlrd.open_workbook"
] | [((381, 414), 'xlrd.open_workbook', 'xlrd.open_workbook', (['excelTestFile'], {}), '(excelTestFile)\n', (399, 414), False, 'import xlrd\n')] |
from __future__ import division
#--------------------------#
import sys
#--------------------------#
import sympy as s
from sympy import cos, sin, pi
from sympy.matrices import Matrix as mat
#=====================================================#
from helperfunctions import matmul_series
sys.path.append("../in... | [
"sys.path.append",
"sympy.cos",
"sympy.sympify",
"sympy.diff",
"sympy.sin",
"sympy.matrices.Matrix",
"helperfunctions.matmul_series"
] | [((298, 335), 'sys.path.append', 'sys.path.append', (['"""../int/misc-tools/"""'], {}), "('../int/misc-tools/')\n", (313, 335), False, 'import sys\n'), ((1197, 1259), 'sympy.matrices.Matrix', 'mat', (['[[1, 0, 0, tx], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]'], {}), '([[1, 0, 0, tx], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0,... |
# list(map(int, input().split()))
# int(input())
import sys
sys.setrecursionlimit(10 ** 9)
from itertools import combinations
def main(*args):
N, XY = args
def difference(p1, p2):
return p2[0] - p1[0], p2[1] - p1[1]
for c in combinations(XY, r = 3):
p1, p2, p3 = c # p = (x, y)
... | [
"itertools.combinations",
"sys.setrecursionlimit"
] | [((61, 91), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 9)'], {}), '(10 ** 9)\n', (82, 91), False, 'import sys\n'), ((250, 271), 'itertools.combinations', 'combinations', (['XY'], {'r': '(3)'}), '(XY, r=3)\n', (262, 271), False, 'from itertools import combinations\n')] |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from os import path
from subprocess import check_output
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from c... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((359, 381), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (371, 381), False, 'from os import path\n'), ((442, 471), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (451, 471), False, 'from os import path\n'), ((914, 929), 'setuptools.find_packages', ... |
import sys
import time
import pandas as pd
from os import listdir
from os.path import isfile, join
import json
from .tasks import *
PATH_BERT = '/home/users/whwodud98/pytorch-pretrained-BERT'
sys.path.insert(0, PATH_BERT)
PATH_SENTEVAL = '/home/users/whwodud98/bert/SentEval'
PATH_TO_DATA = '/home/users/whwodud98/ber... | [
"pandas.DataFrame",
"json.dump",
"json.load",
"sys.path.insert",
"time.time",
"senteval.engine.SE",
"os.path.join",
"os.listdir"
] | [((194, 223), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PATH_BERT'], {}), '(0, PATH_BERT)\n', (209, 223), False, 'import sys\n'), ((390, 423), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PATH_SENTEVAL'], {}), '(0, PATH_SENTEVAL)\n', (405, 423), False, 'import sys\n'), ((3186, 3197), 'time.time', 'time.time', ... |
def test_csvfinder():
"""Tests that the finder finds all the correct files
:returns test_files: List of .csv files
"""
from Reader import csvfinder
test_files = csvfinder()
assert test_files.count('poorform') == 0
assert test_files.count('wrongend') == 0
assert test_files.count('false.... | [
"Reader.csvchecker",
"Reader.floatcheck",
"Reader.csvfinder"
] | [((182, 193), 'Reader.csvfinder', 'csvfinder', ([], {}), '()\n', (191, 193), False, 'from Reader import csvfinder\n'), ((926, 948), 'Reader.csvchecker', 'csvchecker', (['test_files'], {}), '(test_files)\n', (936, 948), False, 'from Reader import csvchecker\n'), ((1542, 1565), 'Reader.floatcheck', 'floatcheck', (['check... |
import sys
import yaml
from jsonschema import validate
if len(sys.argv) != 3:
raise RuntimeError(f'Please provide validation file and json schema file as arguments to validate_schemas.py')
merged_file = sys.argv[1]
json_schema_file = sys.argv[2]
with open(json_schema_file) as f:
_META_VAL_JSONSCHEMA = yaml.s... | [
"jsonschema.validate",
"yaml.safe_load"
] | [((314, 331), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (328, 331), False, 'import yaml\n'), ((2206, 2257), 'jsonschema.validate', 'validate', ([], {'instance': 'cfg', 'schema': '_META_VAL_JSONSCHEMA'}), '(instance=cfg, schema=_META_VAL_JSONSCHEMA)\n', (2214, 2257), False, 'from jsonschema import valida... |
from __future__ import print_function
import torch
import numpy as np
import os
# from torch_scatter import scatter_add
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
MESH_EXTENSIONS = [
'.obj',
]
def is_mesh_file(filename):
return any(filename.endswith(extension) for extensi... | [
"numpy.pad",
"torch.ones",
"numpy.sum",
"torch.stack",
"numpy.log",
"os.makedirs",
"os.path.exists",
"torch.nn.functional.one_hot",
"torch.cat",
"numpy.min",
"numpy.max",
"torch.zeros"
] | [((522, 593), 'numpy.pad', 'np.pad', (['input_arr'], {'pad_width': 'npad', 'mode': '"""constant"""', 'constant_values': 'val'}), "(input_arr, pad_width=npad, mode='constant', constant_values=val)\n", (528, 593), True, 'import numpy as np\n'), ((1190, 1235), 'torch.zeros', 'torch.zeros', (['num_classes'], {'dtype': 'tor... |
from rest_framework import routers
from kitsune.questions.api import QuestionViewSet, AnswerViewSet
router = routers.SimpleRouter()
router.register(r"question", QuestionViewSet)
router.register(r"answer", AnswerViewSet)
urlpatterns = router.urls
| [
"rest_framework.routers.SimpleRouter"
] | [((111, 133), 'rest_framework.routers.SimpleRouter', 'routers.SimpleRouter', ([], {}), '()\n', (131, 133), False, 'from rest_framework import routers\n')] |
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import datetime
import logging
import time
import concurrent.futures
from dataclasses import dataclass, field
from typing import List, Tuple, Dict
import re
import netaddr
import ConfigParser
import os
logg... | [
"requests.packages.urllib3.util.retry.Retry",
"requests.adapters.HTTPAdapter",
"requests.Session",
"os.path.dirname",
"netaddr.IPAddress",
"datetime.datetime.now",
"time.sleep",
"dataclasses.field",
"logging.info",
"re.findall",
"datetime.timedelta",
"requests.get",
"netaddr.IPNetwork",
"C... | [((325, 352), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (342, 352), False, 'import logging\n'), ((460, 487), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (485, 487), False, 'import ConfigParser\n'), ((1016, 1034), 'requests.Session', 'requests.Session',... |
from models.model_group import Group
import random
def test_modify_some_group(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create_new_group(Group(group_name='a', group_header='b', group_footer='c'))
old_groups = db.get_group_list()
group = random.choice(old_groups)
new_group... | [
"models.model_group.Group",
"random.choice"
] | [((281, 306), 'random.choice', 'random.choice', (['old_groups'], {}), '(old_groups)\n', (294, 306), False, 'import random\n'), ((323, 380), 'models.model_group.Group', 'Group', ([], {'group_name': '"""k"""', 'group_header': '"""b"""', 'group_footer': '"""y"""'}), "(group_name='k', group_header='b', group_footer='y')\n"... |
#!/usr/bin/env python3
import utils, os, random, time, open_color, arcade
utils.check_version((3,7))
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Sprites Example"
class MyGame(arcade.Window):
def __init__(self):
super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
file_path = ... | [
"os.path.abspath",
"utils.check_version",
"arcade.run",
"arcade.start_render",
"arcade.Sprite",
"arcade.set_background_color",
"arcade.SpriteList",
"os.chdir"
] | [((76, 103), 'utils.check_version', 'utils.check_version', (['(3, 7)'], {}), '((3, 7))\n', (95, 103), False, 'import utils, os, random, time, open_color, arcade\n'), ((3020, 3032), 'arcade.run', 'arcade.run', ([], {}), '()\n', (3030, 3032), False, 'import utils, os, random, time, open_color, arcade\n'), ((371, 390), 'o... |
import logging
import os
import numpy as np
from sklearn.metrics import classification_report
import torch
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.nn import CrossEntropyLoss
from data.dataset import COVIDxFolder
from data import transforms
from torch.utils.data i... | [
"numpy.random.seed",
"model.architecture.COVIDNext50",
"torch.argmax",
"sklearn.metrics.classification_report",
"torch.no_grad",
"util.load_model_weights",
"os.path.join",
"util.clf_metrics",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.FloatTensor",
"tor... | [((402, 429), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (419, 429), False, 'import logging\n'), ((430, 469), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (449, 469), False, 'import logging\n'), ((1108, 1146), 'os.path.join',... |
import cv2
import numpy as np
from calibration import get_calib_from_file
# kitti
# name = '000000'
# pc_pathname = '/home/alex/github/waymo_to_kitti_converter/tools/kitti/velodyne/'+name+'.bin'
# img_pathname = '/home/alex/github/waymo_to_kitti_converter/tools/kitti/image_2/'+name+'.png'
# calib_pathname = '/home/ale... | [
"cv2.waitKey",
"calibration.get_calib_from_file",
"numpy.fromfile",
"numpy.transpose",
"numpy.ones",
"numpy.clip",
"cv2.imread",
"cv2.imshow",
"matplotlib.pyplot.cm.get_cmap",
"cv2.namedWindow"
] | [((2141, 2176), 'calibration.get_calib_from_file', 'get_calib_from_file', (['calib_pathname'], {}), '(calib_pathname)\n', (2160, 2176), False, 'from calibration import get_calib_from_file\n'), ((3845, 3872), 'matplotlib.pyplot.cm.get_cmap', 'plt.cm.get_cmap', (['"""hsv"""', '(256)'], {}), "('hsv', 256)\n", (3860, 3872)... |
from __future__ import division, print_function
# coding=utf-8
import sys
import os
import glob
import re
import numpy as np
import tensorflow as tf
import pathlib
import wget
# from tensorflow.compat.v1.compat import ConfigProto
# from tensorflow.compat.v1 import InteractiveSession
#from tensorflow.pyt... | [
"tensorflow.keras.models.load_model",
"numpy.argmax",
"os.path.dirname",
"flask.Flask",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.expand_dims",
"werkzeug.utils.secure_filename",
"wget.download",
"tensorflow.keras.preprocessing.image.load_img",
"pathlib.Path",
"flask.render_temp... | [((1368, 1383), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1373, 1383), False, 'from flask import Flask, redirect, url_for, request, render_template\n'), ((1871, 1893), 'tensorflow.keras.models.load_model', 'load_model', (['MODEL_PATH'], {}), '(MODEL_PATH)\n', (1881, 1893), False, 'from tensorflow.ker... |
#!/usr/bin/env python
# coding=utf-8
import json
import pytest
from bsAbstimmungen.importer.votingimporter import VotingParser
from bsAbstimmungen.exceptions import AlreadyImportedException
from ..utils import mockdb
def test_raise_exception_when_alread_parsed(mockdb):
parser = VotingParser(mockdb)
parser.par... | [
"pytest.raises",
"bsAbstimmungen.importer.votingimporter.VotingParser"
] | [((285, 305), 'bsAbstimmungen.importer.votingimporter.VotingParser', 'VotingParser', (['mockdb'], {}), '(mockdb)\n', (297, 305), False, 'from bsAbstimmungen.importer.votingimporter import VotingParser\n'), ((593, 613), 'bsAbstimmungen.importer.votingimporter.VotingParser', 'VotingParser', (['mockdb'], {}), '(mockdb)\n'... |
from __future__ import absolute_import, print_function, unicode_literals
import sys
from tabulate import tabulate
from metapub import MedGenFetcher
try:
term = sys.argv[1]
except IndexError:
print('Supply a disease/syndrome/condition name in quotation marks as the argument to this script.')
sys.exit()
#... | [
"metapub.MedGenFetcher",
"logging.getLogger",
"tabulate.tabulate",
"sys.exit"
] | [((460, 475), 'metapub.MedGenFetcher', 'MedGenFetcher', ([], {}), '()\n', (473, 475), False, 'from metapub import MedGenFetcher\n'), ((1457, 1500), 'tabulate.tabulate', 'tabulate', (['table', 'headers'], {'tablefmt': '"""simple"""'}), "(table, headers, tablefmt='simple')\n", (1465, 1500), False, 'from tabulate import t... |
from unittest import mock
from cterasdk import exception
from cterasdk.common import Object
from cterasdk.edge.enum import VolumeStatus
from cterasdk.edge import volumes
from tests.ut import base_edge
class TestEdgeVolumes(base_edge.BaseEdgeTest):
_drive_1 = 'SATA-1'
_drive_2 = 'SATA-2'
_drive_size = 81... | [
"unittest.mock.MagicMock",
"cterasdk.common.Object",
"cterasdk.edge.volumes.Volumes",
"cterasdk.exception.CTERAException",
"unittest.mock.call"
] | [((1460, 1532), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {'side_effect': 'TestEdgeVolumes._mock_no_arrays_single_drive'}), '(side_effect=TestEdgeVolumes._mock_no_arrays_single_drive)\n', (1474, 1532), False, 'from unittest import mock\n'), ((3069, 3141), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {'side... |
from pathlib import Path
import os
import django_heroku
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '<KEY>'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
I... | [
"os.path.abspath",
"os.path.join"
] | [((2828, 2860), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (2840, 2860), False, 'import os\n'), ((3301, 3333), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (3313, 3333), False, 'import os\n'), ((2910, 2951), 'os.path.joi... |
#!/usr/bin/env python
# module TEST_ACD
import unittest
import numpy as np
from .test_common import BaseCommon
from pylocus.point_set import PointSet
from pylocus.algorithms import reconstruct_acd
from pylocus.simulation import create_noisy_edm
class TestACD(BaseCommon.TestAlgorithms):
def setUp(self):
B... | [
"unittest.main",
"pylocus.simulation.create_noisy_edm",
"numpy.ones",
"pylocus.point_set.PointSet"
] | [((1073, 1088), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1086, 1088), False, 'import unittest\n'), ((507, 521), 'pylocus.point_set.PointSet', 'PointSet', (['N', 'd'], {}), '(N, d)\n', (515, 521), False, 'from pylocus.point_set import PointSet\n'), ((1002, 1039), 'pylocus.simulation.create_noisy_edm', 'creat... |
"""
PROBLEM
<NAME> was born on 15 April 1707.
Consider the sequence 1504170715041707n mod 4503599627370517.
An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins.
For example, the first term is 1504170715041707 which is the first Eulercoin. The second... | [
"unittest.main"
] | [((2266, 2281), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2279, 2281), False, 'import unittest\n')] |
#!/usr/bin/env python
from pwn import *
import base64
r = remote('bamboofox.cs.nctu.edu.tw', 58789)
token = 'user=<PASSWORD>00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0... | [
"base64.b64encode"
] | [((457, 480), 'base64.b64encode', 'base64.b64encode', (['token'], {}), '(token)\n', (473, 480), False, 'import base64\n')] |
#! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'konakona'
__VERSION__ = "v1.0"
import os,sys,os.path,pycurl,cStringIO,json
python_version = sys.version_info[0]
if(python_version !=2):
print("本系统依赖于python2.7,您的系统不兼容, goodbye!")
exit()
start_date = raw_input("1.请输入开始日期(YYYY-MM-DD):")
end_date = raw_i... | [
"cStringIO.StringIO",
"pycurl.Curl"
] | [((860, 880), 'cStringIO.StringIO', 'cStringIO.StringIO', ([], {}), '()\n', (878, 880), False, 'import os, sys, os.path, pycurl, cStringIO, json\n'), ((887, 907), 'cStringIO.StringIO', 'cStringIO.StringIO', ([], {}), '()\n', (905, 907), False, 'import os, sys, os.path, pycurl, cStringIO, json\n'), ((1186, 1199), 'pycur... |
''' network architecture for backbone '''
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import models.archs.arch_util as arch_util
import numpy as np
import math
import pdb
from torch.nn.modules.utils import _pair
from models.archs.dcn.deform_conv impor... | [
"torch.nn.ConvTranspose2d",
"torch.stack",
"torch.nn.Sequential",
"models.archs.dcn.deform_conv.ModulatedDeformConvPack",
"torch.nn.Conv2d",
"torch.split",
"torch.cat",
"torch.sigmoid",
"torch.nn.functional.interpolate",
"torch.nn.init.constant_",
"torch.nn.functional.sigmoid",
"torch.zeros",
... | [((1194, 1216), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1207, 1216), True, 'import torch.nn as nn\n'), ((1995, 2142), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'input_channels', 'out_channels': 'n_channels', 'kernel_size': '(kernel_size, kernel_size)', 'padding': '(padding,... |
import hydra
import logging
import os
import torch
import tqdm
import xarray as xr
from ..dataset import S2SDataset, TransformedDataset
from ..transform import ExampleToPytorch, CompositeTransform
from ..util import ECMWF_FORECASTS, collate_with_xarray
from .lightning import S2STercilesModule
from .util import find_ch... | [
"tqdm.tqdm",
"hydra.utils.to_absolute_path",
"hydra.utils.instantiate",
"os.getcwd",
"xarray.concat",
"xarray.Dataset",
"hydra.main",
"hydra.utils.call",
"logging.getLogger"
] | [((345, 372), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (362, 372), False, 'import logging\n'), ((2646, 2697), 'hydra.main', 'hydra.main', ([], {'config_path': '"""conf"""', 'config_name': '"""infer"""'}), "(config_path='conf', config_name='infer')\n", (2656, 2697), False, 'import hy... |
# This file contains the functions for the data access and cycle count models for the Layers executed on the Systolic Array
import logging
import math
import numpy as np
from data_objects import HardwareObject, SAResult_Inflayer, SIMDResult_Inflayer
from layer_object import LayerObject
def conv_access_model(Hardware... | [
"math.ceil"
] | [((13366, 13430), 'math.ceil', 'math.ceil', (['((cycle_oneTile + pipe_overhead_tile) * Number_of_Tile)'], {}), '((cycle_oneTile + pipe_overhead_tile) * Number_of_Tile)\n', (13375, 13430), False, 'import math\n'), ((33418, 33479), 'math.ceil', 'math.ceil', (['(DTile_ic * DTile_oc * bw_filter / RBW_DRAM_to_WBUF)'], {}), ... |
from dataclasses import dataclass
from pendulum import now
from rich.console import ConsoleRenderable
from rich.style import Style
from rich.table import Column, Table
from rich.text import Text
from spiel.modes import Mode
from spiel.rps import RPSCounter
from spiel.state import State
from spiel.utils import drop_no... | [
"pendulum.now",
"rich.style.Style",
"spiel.utils.filter_join"
] | [((1502, 1623), 'spiel.utils.filter_join', 'filter_join', (['""" | """', '[self.state.deck.name, self.state.current_slide.title if self.state.mode is\n Mode.SLIDE else None]'], {}), "(' | ', [self.state.deck.name, self.state.current_slide.title if\n self.state.mode is Mode.SLIDE else None])\n", (1513, 1623), Fals... |
if __name__ == "__main__":
from core.editor import Editor
from widgets.editor_window import EditorWindow
from PyQt5 import QtWidgets
editor = Editor()
application = QtWidgets.QApplication([])
window = EditorWindow()
window.show()
application.exec()
| [
"PyQt5.QtWidgets.QApplication",
"widgets.editor_window.EditorWindow",
"core.editor.Editor"
] | [((160, 168), 'core.editor.Editor', 'Editor', ([], {}), '()\n', (166, 168), False, 'from core.editor import Editor\n'), ((188, 214), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['[]'], {}), '([])\n', (210, 214), False, 'from PyQt5 import QtWidgets\n'), ((228, 242), 'widgets.editor_window.EditorWindow', '... |
from django.db import models
from meiduo_mell.utils.models import BaseModel
from users.models import User
# Create your models here.
class OauthQQUser(BaseModel):
"""
QQ登录用户数据
"""
# ForeignKey: 设置外键
# on_delete: 指明主表删除数据时,对于外键引用表数据如何处理
# CASCADE 级联,删除主表数据时连通一起删除外键表中数据
user = models.Forei... | [
"django.db.models.ForeignKey",
"django.db.models.CharField"
] | [((308, 376), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE', 'verbose_name': '"""用户"""'}), "(User, on_delete=models.CASCADE, verbose_name='用户')\n", (325, 376), False, 'from django.db import models\n'), ((469, 538), 'django.db.models.CharField', 'models.CharField', ([], {'... |
# -*- coding: UTF-8 -*-
from .dataset import IcvDataSet
from ..utils import is_seq, is_dir
from ..image import imwrite
from ..data.core.bbox import BBox
from ..data.core.polys import Polygon
from ..data.core.sample import Sample, Anno
from ..data.core.meta import AnnoMeta,SampleMeta
from ..vis.color import VIS_COLOR
im... | [
"tqdm.tqdm",
"os.makedirs",
"os.path.basename",
"os.path.exists",
"random.choice",
"shutil.rmtree",
"os.path.join"
] | [((2005, 2042), 'os.path.join', 'os.path.join', (['dist_dir', '"""annotations"""'], {}), "(dist_dir, 'annotations')\n", (2017, 2042), False, 'import os\n'), ((2064, 2096), 'os.path.join', 'os.path.join', (['dist_dir', '"""images"""'], {}), "(dist_dir, 'images')\n", (2076, 2096), False, 'import os\n'), ((5892, 5906), 't... |
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import config as cfg
sns.set_style('darkgrid')
sns.set_context('notebook')
sns.despine(trim=True)
plt.close('all')
fig, ax = plt.subplots(1, 1, figsize=(8, 6))
scores = np.load(op.join(cfg.path_outputs,
'a... | [
"seaborn.set_style",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"numpy.std",
"matplotlib.pyplot.close",
"seaborn.despine",
"numpy.mean",
"matplotlib.pyplot.subplots",
"seaborn.set_context"
] | [((118, 143), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (131, 143), True, 'import seaborn as sns\n'), ((144, 171), 'seaborn.set_context', 'sns.set_context', (['"""notebook"""'], {}), "('notebook')\n", (159, 171), True, 'import seaborn as sns\n'), ((172, 194), 'seaborn.despine', '... |
import pdb
import torch
from torch import nn
import torch.nn.functional as F
class Mish(nn.Module):
def __init__(self):
super().__init__()
print('Mish activation loaded....')
def forward(self, x):
x = x * (torch.tanh(F.softplus(x)))
return x | [
"torch.nn.functional.softplus"
] | [((251, 264), 'torch.nn.functional.softplus', 'F.softplus', (['x'], {}), '(x)\n', (261, 264), True, 'import torch.nn.functional as F\n')] |
""" Convolutional Neural Network.
Build and train a convolutional neural network with TensorFlow.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
This example is using TensorFlow layers API, see 'convolutional_network_raw'
example for a raw implementation with variab... | [
"tensorflow.python.estimator.export.export.build_raw_serving_input_receiver_fn",
"tensorflow.global_variables_initializer",
"tensorflow.contrib.layers.flatten",
"tensorflow.reshape",
"tensorflow.layers.dense",
"tensorflow.layers.dropout",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.trai... | [((628, 682), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""/tmp/data/"""'], {'one_hot': '(False)'}), "('/tmp/data/', one_hot=False)\n", (653, 682), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((1406, 1442), 'tensorflow.reshape', 'tf.resh... |
from rest_framework import routers
from .api import UserViewSet
router = routers.DefaultRouter()
router.register('users', UserViewSet, 'users')
urlpatterns = router.urls | [
"rest_framework.routers.DefaultRouter"
] | [((75, 98), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (96, 98), False, 'from rest_framework import routers\n')] |
# pylint: disable=no-self-use
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data import Token, Vocabulary
from allennlp.data.token_indexers import ELMoTokenCharactersIndexer
class TestELMoTokenCharactersIndexer(AllenNlpTestCase):
def test_bos_to_char_ids(self):
indexer = ELMoTokenChar... | [
"allennlp.data.token_indexers.ELMoTokenCharactersIndexer",
"allennlp.data.Vocabulary",
"allennlp.data.Token"
] | [((307, 335), 'allennlp.data.token_indexers.ELMoTokenCharactersIndexer', 'ELMoTokenCharactersIndexer', ([], {}), '()\n', (333, 335), False, 'from allennlp.data.token_indexers import ELMoTokenCharactersIndexer\n'), ((923, 951), 'allennlp.data.token_indexers.ELMoTokenCharactersIndexer', 'ELMoTokenCharactersIndexer', ([],... |
# encoding: UTF-8
"""
Generates test data for CSV import.
"""
from __future__ import print_function
from __future__ import with_statement
# http://www.python.org/dev/peps/pep-3101/ # unicode.format()
# http://www.python.org/dev/peps/pep-3105/ # print function
import codecs
from uuid import uuid4
from datetime import... | [
"uuid.uuid4",
"datetime.timedelta",
"codecs.open",
"datetime.datetime.now"
] | [((835, 852), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (844, 852), False, 'from datetime import datetime, timedelta\n'), ((875, 889), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (887, 889), False, 'from datetime import datetime, timedelta\n'), ((914, 928), 'datetime.datetim... |
from gi.repository import Gtk, GdkPixbuf, GLib, Pango
import dhash
import os
import collections
import threading
import Queue
class mainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="DupDeleter")
self.set_border_width(10)
self.grid = Gtk.Grid()
self.grid... | [
"os.remove",
"os.walk",
"gi.repository.Gtk.Button",
"collections.defaultdict",
"gi.repository.Gtk.TreeViewColumn",
"gi.repository.Gtk.main_quit",
"gi.repository.Gtk.ToolButton.new_from_stock",
"gi.repository.Gtk.CellRendererText",
"gi.repository.Gtk.Image.new_from_pixbuf",
"gi.repository.Gtk.Grid"... | [((13782, 13792), 'gi.repository.Gtk.main', 'Gtk.main', ([], {}), '()\n', (13790, 13792), False, 'from gi.repository import Gtk, GdkPixbuf, GLib, Pango\n'), ((191, 236), 'gi.repository.Gtk.Window.__init__', 'Gtk.Window.__init__', (['self'], {'title': '"""DupDeleter"""'}), "(self, title='DupDeleter')\n", (210, 236), Fal... |
import json
from application.handlers.base import BaseHandler
class APIKMLDownloader(BaseHandler):
def get(self):
if self.request.get('project_code'):
project_code = self.request.get('project_code')
self.response.headers['Content-Type'] = 'application/json'
self.response... | [
"json.dumps"
] | [((327, 369), 'json.dumps', 'json.dumps', (["{'project_code': project_code}"], {}), "({'project_code': project_code})\n", (337, 369), False, 'import json\n')] |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017 CNRS
# 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 ... | [
"pyannote.core.Annotation",
"os.path.realpath",
"pyannote.core.Segment",
"pyannote.parser.MDTMParser"
] | [((2280, 2292), 'pyannote.parser.MDTMParser', 'MDTMParser', ([], {}), '()\n', (2290, 2292), False, 'from pyannote.parser import MDTMParser\n'), ((2522, 2541), 'pyannote.core.Annotation', 'Annotation', ([], {'uri': 'uri'}), '(uri=uri)\n', (2532, 2541), False, 'from pyannote.core import Segment, Annotation\n'), ((2388, 2... |
import toolkit.autodiff.math.scalar as am
import toolkit.autodiff.math as m
from ..math import IdentityOp
from ..CalcFlow import CalcFlow
class FloatScalar(CalcFlow):
def __init__(self, value):
super().__init__(value)
def _calc_unary(self, func):
calc_val = FloatScalar(func.calculate())
... | [
"toolkit.autodiff.math.DivideOp",
"toolkit.autodiff.math.AdditionOp",
"toolkit.autodiff.math.scalar.LnOp",
"toolkit.autodiff.math.ExponentOp",
"toolkit.autodiff.math.scalar.SinOp",
"toolkit.autodiff.math.scalar.ExpOp",
"toolkit.autodiff.math.MultiplyOp",
"toolkit.autodiff.math.SubtractionOp"
] | [((964, 989), 'toolkit.autodiff.math.MultiplyOp', 'm.MultiplyOp', (['self', 'other'], {}), '(self, other)\n', (976, 989), True, 'import toolkit.autodiff.math as m\n'), ((1185, 1210), 'toolkit.autodiff.math.AdditionOp', 'm.AdditionOp', (['self', 'other'], {}), '(self, other)\n', (1197, 1210), True, 'import toolkit.autod... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from datetime import datetime
class Scraping(object):
driver = webdriver.Chrome()
hours: str
edt = {}
def __init__(self, username, password):
# Ouvre la page dans Chrome
self.driver.delete_all_cookies()
... | [
"datetime.datetime.today",
"selenium.webdriver.Chrome"
] | [((144, 162), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (160, 162), False, 'from selenium import webdriver\n'), ((753, 769), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (767, 769), False, 'from datetime import datetime\n'), ((1296, 1312), 'datetime.datetime.today', 'datetime.... |
# Copyright 2010 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 or agreed to ... | [
"C.BITFIELD",
"C.STRUCT"
] | [((1212, 1971), 'C.BITFIELD', 'C.BITFIELD', (['stream', 'offset', 'max_size', 'parent', 'name', "('Reserved', 5)", "('KeepLocalIDListForUNCTarget', 1)", "('PreferEnvironmentPath', 1)", "('UnaliasOnSave', 1)", "('AllowLinkToLink', 1)", "('DisableKnownFolderAlias', 1)", "('DisableKnownFolderTracking', 1)", "('DisableLink... |
import alepy
import numpy as np
import os.path as osp
from control3 import CTRL_ROOT
# import cv2
world = alepy.AtariWorld(osp.join(CTRL_ROOT,"domain_data/atari_roms/space_invaders.bin"))
for j in xrange(5):
x0 = world.GetInitialState(np.random.randint(0,50))
u0 = np.array([0],'uint8')
y,r,o,d = world.St... | [
"numpy.array",
"numpy.random.randint",
"os.path.join"
] | [((124, 188), 'os.path.join', 'osp.join', (['CTRL_ROOT', '"""domain_data/atari_roms/space_invaders.bin"""'], {}), "(CTRL_ROOT, 'domain_data/atari_roms/space_invaders.bin')\n", (132, 188), True, 'import os.path as osp\n'), ((276, 298), 'numpy.array', 'np.array', (['[0]', '"""uint8"""'], {}), "([0], 'uint8')\n", (284, 29... |
import pandas as pd
import argparse
import mlflow
from sklearn.utils import resample
from sklearn.model_selection import train_test_split
import xgboost as xgb
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from urllib.parse import urlparse
if __name__ == "__main__":
df_t... | [
"mlflow.start_run",
"mlflow.log_param",
"argparse.ArgumentParser",
"mlflow.sklearn.log_model",
"mlflow.get_tracking_uri",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"mlflow.log_metrics",
"sklearn.utils.resample",
"xgboost.XGBClassifier",
"s... | [((327, 397), 'pandas.read_csv', 'pd.read_csv', (['"""../../../data/processed/processed_application_train.csv"""'], {}), "('../../../data/processed/processed_application_train.csv')\n", (338, 397), True, 'import pandas as pd\n'), ((412, 481), 'pandas.read_csv', 'pd.read_csv', (['"""../../../data/processed/processed_app... |
"""
Customizing measures arguments
==============================
In this example we will show you how to custorize the measures.
"""
# Load a dataset
from sklearn.datasets import load_iris
from pymfe.mfe import MFE
data = load_iris()
y = data.target
X = data.data
#################################################... | [
"sklearn.datasets.load_iris",
"pymfe.mfe.MFE"
] | [((227, 238), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (236, 238), False, 'from sklearn.datasets import load_iris\n'), ((1001, 1061), 'pymfe.mfe.MFE', 'MFE', ([], {'features': "['sd', 'nr_norm', 'nr_cor_attr', 'min', 'max']"}), "(features=['sd', 'nr_norm', 'nr_cor_attr', 'min', 'max'])\n", (1004, 10... |
#!/usr/bin/env python3
# MIT License
# Copyright (c) 2020 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | [
"subprocess.Popen",
"ipaddress.ip_network",
"argparse.ArgumentParser"
] | [((3784, 3849), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script ping sweep a subnet"""'}), "(description='Script ping sweep a subnet')\n", (3807, 3849), False, 'import argparse\n'), ((2090, 2120), 'ipaddress.ip_network', 'ipaddress.ip_network', (['net_addr'], {}), '(net_addr)\n', (... |
import unittest
import requests
endpoint = "https://app.zipcodebase.com/api/v1"
apikey = ""
# https://app.zipcodebase.com/documentation
class UnitTestsZipcodebaseWithTorNetwork(unittest.TestCase):
def test_Authentification_Remaining_Credits(self):
print("test_Authentification_Remaining_Credits")
... | [
"unittest.main",
"requests.get"
] | [((3318, 3333), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3331, 3333), False, 'import unittest\n'), ((421, 455), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (433, 455), False, 'import requests\n'), ((771, 820), 'requests.get', 'requests.get', (['url'], {'hea... |
#!/usr/bin/env python3
import json
import sys
import numpy as np
import cv2
import math
import time
from collections import namedtuple
from cscore import CameraServer
from networktables import NetworkTables
# Magic Numbers
lowerGreen = (50, 120, 130) # Our Robot's Camera
higherGreen = (100, 220, 220)
minContourArea ... | [
"networktables.NetworkTables.getTable",
"networktables.NetworkTables.flush",
"json.dumps",
"cv2.boxPoints",
"numpy.mean",
"cv2.minAreaRect",
"cv2.inRange",
"cv2.line",
"cv2.contourArea",
"cv2.cvtColor",
"networktables.NetworkTables.setUpdateRate",
"math.isnan",
"numpy.int0",
"networktables... | [((609, 663), 'collections.namedtuple', 'namedtuple', (['"""CameraConfig"""', "['name', 'path', 'config']"], {}), "('CameraConfig', ['name', 'path', 'config'])\n", (619, 663), False, 'from collections import namedtuple\n'), ((1154, 1180), 'cscore.CameraServer.getInstance', 'CameraServer.getInstance', ([], {}), '()\n', ... |
#!/usr/bin/python
import os.path
import os
import glob
import subprocess
import numpy as np
import numpy.lib.recfunctions as rfn
from astropy.io import fits
from astropy.stats import bayesian_blocks
import argparse
from collections import defaultdict
def checkDatFile(datFileName):
if not os.path.isfile(datFileNa... | [
"numpy.load",
"numpy.random.seed",
"argparse.ArgumentParser",
"astropy.stats.bayesian_blocks",
"numpy.argmax",
"numpy.abs",
"numpy.core.records.fromarrays",
"collections.defaultdict",
"os.path.isfile",
"os.path.join",
"subprocess.check_call",
"numpy.copy",
"numpy.power",
"numpy.savetxt",
... | [((1234, 1251), 'numpy.zeros', 'np.zeros', (['n_steps'], {}), '(n_steps)\n', (1242, 1251), True, 'import numpy as np\n'), ((1269, 1311), 'numpy.linspace', 'np.linspace', (['min_prior', 'max_prior', 'n_steps'], {}), '(min_prior, max_prior, n_steps)\n', (1280, 1311), True, 'import numpy as np\n'), ((1451, 1484), 'numpy.a... |
import tensorflow as tf
def upsample_layer(name, inputs):
"""
Takes the outputs of the previous convolutional layer and upsamples them by a factor of two
using the 'nearest neighbor' method.
Parameters
----------
name : string
The name of the tensor to be used in TensorBoard.
input... | [
"tensorflow.variable_scope",
"tensorflow.image.resize_nearest_neighbor"
] | [((590, 613), 'tensorflow.variable_scope', 'tf.variable_scope', (['name'], {}), '(name)\n', (607, 613), True, 'import tensorflow as tf\n'), ((633, 722), 'tensorflow.image.resize_nearest_neighbor', 'tf.image.resize_nearest_neighbor', (['inputs', '(inputs.shape[1] * 2, inputs.shape[2] * 2)'], {}), '(inputs, (inputs.shape... |
#!/usr/bin/env python
'''
Core_Tests.py
Defines unit tests for core.
'''
#############
# IMPORTS #
#############
# standard python packages
import inspect, os, sqlite3, sys, unittest
from StringIO import StringIO
# ------------------------------------------------------ #
# import sibling packages HERE!!!
sys.pat... | [
"unittest.main",
"os.path.abspath"
] | [((549, 594), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../../../../qa')"], {}), "(__file__ + '/../../../../qa')\n", (564, 594), False, 'import inspect, os, sqlite3, sys, unittest\n'), ((330, 376), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../../../../src')"], {}), "(__file__ + '/../../../../s... |
from flask import Flask, abort, render_template, redirect, url_for, request, session, send_from_directory, flash, jsonify
from markupsafe import escape
import random, os, database, json, requests
from werkzeug.utils import secure_filename
# create the application object
app = Flask(__name__)
app.config['DataFolder'] ... | [
"os.path.abspath",
"flask.redirect",
"flask.Flask",
"os.path.exists",
"shutil.which",
"os.system",
"werkzeug.utils.secure_filename",
"flask.url_for",
"database.Database",
"flask.render_template",
"requests.get",
"os.chdir",
"flask.send_from_directory",
"os.rm",
"os.urandom"
] | [((278, 293), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'from flask import Flask, abort, render_template, redirect, url_for, request, session, send_from_directory, flash, jsonify\n'), ((407, 421), 'os.urandom', 'os.urandom', (['(24)'], {}), '(24)\n', (417, 421), False, 'import rando... |
# -*- coding: utf-8 -*-
"""
Universidade Federal de Minas Gerais
Departamento de Ciência da Computação
Programa de Pós-Graduação em Ciência da Computação
Computação Natural
Trabalho Prático 1
Feito por <NAME>, 2016672212.
"""
#--------------------------------------------------------------#
#------------------------ ... | [
"copy.deepcopy",
"random.choice",
"random.randint"
] | [((4218, 4280), 'random.randint', 'random.randint', (['PHASE_START[self.phase]', 'PHASE_END[self.phase]'], {}), '(PHASE_START[self.phase], PHASE_END[self.phase])\n', (4232, 4280), False, 'import copy, random\n'), ((2233, 2256), 'copy.deepcopy', 'copy.deepcopy', (['ind.cube'], {}), '(ind.cube)\n', (2246, 2256), False, '... |
import pytest
import pandas as pd
from src.clients.s3_client import S3Client
from src.sources.data_loader import DataLoader
def test_init():
dl = DataLoader("test_source", "test_client")
assert dl.data_source == "test_source"
assert dl.client == "test_client"
# def test_load_when_database_client():
# ... | [
"pandas.read_csv",
"pytest.raises",
"src.sources.data_loader.DataLoader"
] | [((154, 194), 'src.sources.data_loader.DataLoader', 'DataLoader', (['"""test_source"""', '"""test_client"""'], {}), "('test_source', 'test_client')\n", (164, 194), False, 'from src.sources.data_loader import DataLoader\n'), ((1014, 1077), 'src.sources.data_loader.DataLoader', 'DataLoader', (['"""src/tests/test_data/sam... |
from fairseq.models.roberta import RobertaModel
label_fn = lambda label: roberta.task.label_dictionary.string(
[label + roberta.task.label_dictionary.nspecial]
)
roberta = RobertaModel.from_pretrained(
model_name_or_path='/path/to/checkpoints',
checkpoint_file='checkpoint_best.pt',
data_name_or_path='/... | [
"fairseq.models.roberta.RobertaModel.from_pretrained"
] | [((177, 325), 'fairseq.models.roberta.RobertaModel.from_pretrained', 'RobertaModel.from_pretrained', ([], {'model_name_or_path': '"""/path/to/checkpoints"""', 'checkpoint_file': '"""checkpoint_best.pt"""', 'data_name_or_path': '"""/path/to/data"""'}), "(model_name_or_path='/path/to/checkpoints',\n checkpoint_file='c... |
from evasdk import EvaAutoRenewError, EvaError
import time
import pytest
# TODO: this rely on having an actual robot, should be rewritten to be mockable
@pytest.mark.robot_required
class TestAuth:
def test_create_new_session(self, eva):
token = eva.auth_create_session()
assert(len(token) == 36)
... | [
"time.sleep"
] | [((961, 979), 'time.sleep', 'time.sleep', (['(3 * 60)'], {}), '(3 * 60)\n', (971, 979), False, 'import time\n'), ((1844, 1862), 'time.sleep', 'time.sleep', (['(5 * 60)'], {}), '(5 * 60)\n', (1854, 1862), False, 'import time\n')] |
#!/usr/bin/env python
from gevent import monkey # isort:skip
monkey.patch_all() # isort:skip
import argparse
import os
import time
from dataclasses import dataclass
from typing import Iterator, List
from raiden.utils.nursery import Janitor, Nursery
CWD = os.path.dirname(os.path.abspath(__file__))
GENERATE_MESSAGE... | [
"os.path.abspath",
"os.makedirs",
"argparse.ArgumentParser",
"raiden.utils.nursery.Janitor",
"gevent.monkey.patch_all",
"time.sleep",
"os.path.join"
] | [((63, 81), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (79, 81), False, 'from gevent import monkey\n'), ((331, 372), 'os.path.join', 'os.path.join', (['CWD', '"""generate_messages.py"""'], {}), "(CWD, 'generate_messages.py')\n", (343, 372), False, 'import os\n'), ((277, 302), 'os.path.abspath', 'o... |