code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/evn python
# -*- coding:utf-8 -*-
from shadon.tsetsHttp import testsHttp
from shadon.testsConfig import testsConfig
import os
class testsToken():
def __init__(self):
self.url = '/oauth/authorizationServer/accessToken'
self.mytestsConfig = testsConfig()
self.mytestsConfig.getCon... | [
"os.remove",
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"shadon.testsConfig.testsConfig",
"shadon.tsetsHttp.testsHttp"
] | [((273, 286), 'shadon.testsConfig.testsConfig', 'testsConfig', ([], {}), '()\n', (284, 286), False, 'from shadon.testsConfig import testsConfig\n'), ((1024, 1035), 'shadon.tsetsHttp.testsHttp', 'testsHttp', ([], {}), '()\n', (1033, 1035), False, 'from shadon.tsetsHttp import testsHttp\n'), ((567, 606), 'os.path.exists'... |
from parameterized import parameterized
from rest_framework import status
from rest_framework.reverse import reverse
from api.applications.enums import (
ApplicationExportType,
ApplicationExportLicenceOfficialType,
GoodsTypeCategory,
)
from api.applications.models import (
StandardApplication,
Open... | [
"api.applications.models.StandardApplication.objects.get",
"api.applications.models.GiftingClearanceApplication.objects.count",
"api.applications.models.F680ClearanceApplication.objects.get",
"api.applications.models.F680ClearanceApplication.objects.count",
"api.applications.models.StandardApplication.objec... | [((767, 803), 'rest_framework.reverse.reverse', 'reverse', (['"""applications:applications"""'], {}), "('applications:applications')\n", (774, 803), False, 'from rest_framework.reverse import reverse\n'), ((5485, 5839), 'parameterized.parameterized.expand', 'parameterized.expand', (["[[{}], [{'application_type': CaseTy... |
# Copyright 2018 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... | [
"htmap.load",
"pytest.fixture",
"time.sleep",
"pytest.raises",
"pathlib.Path",
"htmap.transfer_output_files",
"pytest.mark.timeout"
] | [((731, 759), 'pytest.mark.timeout', 'pytest.mark.timeout', (['TIMEOUT'], {}), '(TIMEOUT)\n', (750, 759), False, 'import pytest\n'), ((882, 910), 'pytest.mark.timeout', 'pytest.mark.timeout', (['TIMEOUT'], {}), '(TIMEOUT)\n', (901, 910), False, 'import pytest\n'), ((1119, 1147), 'pytest.mark.timeout', 'pytest.mark.time... |
#!/usr/bin/env python
from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'^$', 'pyhn.apps.news.views.index.index', name='index'),
url(
r'^social/', include('social.apps.django_app.urls', namespace='social')
),
url(r'^news/', include('pyhn.apps.news.urls'... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((114, 173), 'django.conf.urls.url', 'url', (['"""^$"""', '"""pyhn.apps.news.views.index.index"""'], {'name': '"""index"""'}), "('^$', 'pyhn.apps.news.views.index.index', name='index')\n", (117, 173), False, 'from django.conf.urls import patterns, include, url\n'), ((426, 517), 'django.conf.urls.url', 'url', (['"""^us... |
import random
from collections import Counter
from datetime import datetime
from typing import List, Tuple, Union
import discord
from discord import Embed
from discord.ext import commands
from crimsobot.models.currency_account import CurrencyAccount
from crimsobot.models.guess_statistic import GuessStatistic
from cri... | [
"random.randint",
"random.choice",
"crimsobot.utils.tools.clib_path_join",
"datetime.datetime",
"crimsobot.models.currency_account.CurrencyAccount.get_by_discord_user",
"datetime.datetime.utcnow",
"crimsobot.models.guess_statistic.GuessStatistic.get_by_discord_user",
"crimsobot.utils.tools.crimbed"
] | [((1712, 1738), 'random.choice', 'random.choice', (['answer_list'], {}), '(answer_list)\n', (1725, 1738), False, 'import random\n'), ((2734, 2754), 'random.choice', 'random.choice', (['story'], {}), '(story)\n', (2747, 2754), False, 'import random\n'), ((4153, 4170), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], ... |
from ..const.const import (
MONTH_TO_NUMBER,
SENSOR_LOCATIONS_TO_URL,
_LOGGER,
)
from datetime import datetime, date
from bs4 import BeautifulSoup
import urllib.request
import urllib.error
class VenloAfval(object):
def get_date_from_afvaltype(self, tableRows, afvaltype):
try:
for r... | [
"bs4.BeautifulSoup",
"datetime.datetime.strptime",
"datetime.datetime.today",
"datetime.date.today"
] | [((1852, 1886), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (1865, 1886), False, 'from bs4 import BeautifulSoup\n'), ((1204, 1216), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1214, 1216), False, 'from datetime import datetime, date\n'), ((879, 895),... |
"""
================================
Neuropathic pain - Neurofeedback
================================
"""
import logging
from typing import Literal, TypeVar
from bci_framework.extensions.stimuli_delivery import StimuliAPI, Feedback, DeliveryInstance
from bci_framework.extensions.stimuli_delivery.utils import Widg... | [
"browser.html.BR",
"bci_framework.extensions.stimuli_delivery.utils.Widgets.slider",
"bci_framework.extensions.properties.CHANNELS.values",
"bci_framework.extensions.stimuli_delivery.utils.Widgets.get_value",
"logging.warning",
"bci_framework.extensions.stimuli_delivery.utils.Widgets.label",
"bci_framew... | [((434, 460), 'typing.TypeVar', 'TypeVar', (['"""Time in seconds"""'], {}), "('Time in seconds')\n", (441, 460), False, 'from typing import Literal, TypeVar\n'), ((466, 497), 'typing.TypeVar', 'TypeVar', (['"""Time in milliseconds"""'], {}), "('Time in milliseconds')\n", (473, 497), False, 'from typing import Literal, ... |
"""Provide unit tests for `~python_venv.env`:py:mod:."""
import unittest
import parameterized # https://pypi.org/project/parameterized/
from python_venv import const, env, reqs
class TestEnv_000_General(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_PV_EN... | [
"parameterized.parameterized.expand",
"python_venv.env.BaseVirtualEnvironment"
] | [((1274, 1850), 'parameterized.parameterized.expand', 'parameterized.parameterized.expand', (["[('dry_run', {'dry_run': True}, 'dry_run', True), ('force', {'force': True},\n 'force', True), ('message_prefix', {'message_prefix':\n 'dummy_message_prefix'}, 'message_prefix', 'dummy_message_prefix'), (\n 'python',... |
from django.core.management.base import BaseCommand
from ncharts.models import VariableTimes
from ncharts.models import ClientState
from ncharts import views as nc_views
from django.contrib.sessions.models import Session
class Command(BaseCommand):
def handle(self, **options):
sessions = Session.object... | [
"ncharts.views.client_id_name",
"django.contrib.sessions.models.Session.objects.all",
"ncharts.models.VariableTimes.objects.all",
"ncharts.models.ClientState.objects.all"
] | [((306, 327), 'django.contrib.sessions.models.Session.objects.all', 'Session.objects.all', ([], {}), '()\n', (325, 327), False, 'from django.contrib.sessions.models import Session\n'), ((391, 416), 'ncharts.models.ClientState.objects.all', 'ClientState.objects.all', ([], {}), '()\n', (414, 416), False, 'from ncharts.mo... |
import os
import fnmatch
def finder(path, ext):
"""Returns files from path by extension"""
l = []
if not ext.startswith('*.'):
ext = '*.{0}'.format(ext)
for path, dirs, files in os.walk(os.path.abspath(path)):
for f in fnmatch.filter(files, ext):
l.append(os.path... | [
"fnmatch.filter",
"os.path.abspath",
"os.path.join"
] | [((221, 242), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (236, 242), False, 'import os\n'), ((263, 289), 'fnmatch.filter', 'fnmatch.filter', (['files', 'ext'], {}), '(files, ext)\n', (277, 289), False, 'import fnmatch\n'), ((313, 334), 'os.path.join', 'os.path.join', (['path', 'f'], {}), '(path, ... |
from datetime import datetime
from airflow.operators.dummy_operator import DummyOperator
from marquez_airflow import DAG
DAG_NAME = 'test_dag'
default_args = {
'depends_on_past': False,
'start_date': datetime(2019, 2, 1),
}
dag = DAG(DAG_NAME, schedule_interval='0 0 * * *',
catchup=False,
... | [
"marquez_airflow.DAG",
"airflow.operators.dummy_operator.DummyOperator",
"datetime.datetime"
] | [((243, 364), 'marquez_airflow.DAG', 'DAG', (['DAG_NAME'], {'schedule_interval': '"""0 0 * * *"""', 'catchup': '(False)', 'default_args': 'default_args', 'description': '"""My awesome DAG"""'}), "(DAG_NAME, schedule_interval='0 0 * * *', catchup=False, default_args=\n default_args, description='My awesome DAG')\n", ... |
# encoding: utf-8
from miniworld.model.spatial.MovementPattern.RandomWalk import RandomWalk
from .AbstractNode import AbstractNode
__author__ = "<NAME>"
__email__ = "uni at lamp<EMAIL>"
class DefaultNode(AbstractNode):
"""
Attributes
----------
crnt_movement_pattern : AbstractMovem... | [
"miniworld.model.spatial.MovementPattern.RandomWalk.RandomWalk"
] | [((544, 556), 'miniworld.model.spatial.MovementPattern.RandomWalk.RandomWalk', 'RandomWalk', ([], {}), '()\n', (554, 556), False, 'from miniworld.model.spatial.MovementPattern.RandomWalk import RandomWalk\n')] |
from django.apps import apps
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class EventManager(models.Manager):
... | [
"django.utils.timezone.now",
"django.utils.text.slugify",
"django.urls.reverse",
"django.apps.apps.get_app_config",
"django.utils.translation.ugettext_lazy"
] | [((2711, 2734), 'django.utils.translation.ugettext_lazy', '_', (['"""Registration Count"""'], {}), "('Registration Count')\n", (2712, 2734), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((2404, 2414), 'django.utils.translation.ugettext_lazy', '_', (['"""Event"""'], {}), "('Event')\n", (2405, 2414... |
"""
===================
Setup Scene Example
===================
This script provides examples for loading, using and saving an object library based on a YAML file.
We will step through the individual commands, generate thumbnails, VHACD meshes, URDF files for all objects.
After that, we will compute the stable poses o... | [
"burg_toolkit.ObjectLibrary.from_yaml",
"argparse.ArgumentParser",
"burg_toolkit.visualization.show_geometries",
"os.path.dirname",
"burg_toolkit.scene_sim.SceneSimulator",
"burg_toolkit.sampling.sample_scene",
"os.path.join"
] | [((622, 666), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (645, 666), False, 'import argparse\n'), ((1426, 1473), 'burg_toolkit.ObjectLibrary.from_yaml', 'burg.ObjectLibrary.from_yaml', (['object_library_fn'], {}), '(object_library_fn)\n', (1454, 14... |
"""Requests Table."""
import json
import logging
from datetime import datetime
import cherrypy
from sqlalchemy import Column, Integer, String, TIMESTAMP, ForeignKey, Enum
from sqlalchemy.orm import relationship
from lzproduction.utils.collections import subdict
from ..utils import db_session
from ..statuses import LO... | [
"sqlalchemy.Enum",
"sqlalchemy.ForeignKey",
"json.dumps",
"lzproduction.utils.collections.subdict",
"sqlalchemy.orm.relationship",
"sqlalchemy.Column",
"sqlalchemy.String",
"datetime.datetime.now",
"logging.getLogger"
] | [((495, 522), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (512, 522), False, 'import logging\n'), ((675, 708), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (681, 708), False, 'from sqlalchemy import Column, Integer, String, T... |
import binascii
import numpy as np
import copy
from scapy.all import TCP, UDP, IP, IPv6, ARP, raw
def get_packet_matrix(packet):
"""
Transform a packet content into 1D array of bytes
Parameters
----------
packet : an IP packet
Returns
-------
1D ndarry of packet bytes
"""
hex... | [
"copy.deepcopy",
"numpy.uint8",
"scapy.all.raw"
] | [((444, 456), 'numpy.uint8', 'np.uint8', (['fh'], {}), '(fh)\n', (452, 456), True, 'import numpy as np\n'), ((718, 739), 'copy.deepcopy', 'copy.deepcopy', (['packet'], {}), '(packet)\n', (731, 739), False, 'import copy\n'), ((342, 353), 'scapy.all.raw', 'raw', (['packet'], {}), '(packet)\n', (345, 353), False, 'from sc... |
######################################################
#
# PyRAI2MD 2 module for thermostat in NVT ensemble
#
# Author <NAME>
# Sep 7 2021
#
######################################################
import numpy as np
def NoseHoover(traj):
""" Velocity scaling function in NVT ensemble (Nose Hoover thermostat)
... | [
"numpy.exp"
] | [((1333, 1355), 'numpy.exp', 'np.exp', (['(-V2 * size / 8)'], {}), '(-V2 * size / 8)\n', (1339, 1355), True, 'import numpy as np\n'), ((1454, 1476), 'numpy.exp', 'np.exp', (['(-V2 * size / 8)'], {}), '(-V2 * size / 8)\n', (1460, 1476), True, 'import numpy as np\n'), ((1489, 1511), 'numpy.exp', 'np.exp', (['(-V1 * size ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/4/5 15:18
# @Author : <NAME>
# @Email : <EMAIL>
# @File : setup.py.py
import setuptools
__version__ = None
exec(open('liyi_cute/__init__.py').read())
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
tests_req... | [
"setuptools.find_packages"
] | [((1107, 1133), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (1131, 1133), False, 'import setuptools\n')] |
import sys
import logging
from optparse import OptionParser
log = logging.getLogger('aws-cloudfront-extension.check_issue')
log_formatter = logging.Formatter(
'[%(asctime)s %(name)s][%(levelname)s] %(message)s')
log_stream_handler = logging.StreamHandler(sys.stdout)
log_stream_handler.setFormatter(log_formatter)
l... | [
"optparse.OptionParser",
"logging.StreamHandler",
"logging.getLogger",
"logging.Formatter",
"sys.exit"
] | [((67, 124), 'logging.getLogger', 'logging.getLogger', (['"""aws-cloudfront-extension.check_issue"""'], {}), "('aws-cloudfront-extension.check_issue')\n", (84, 124), False, 'import logging\n'), ((141, 211), 'logging.Formatter', 'logging.Formatter', (['"""[%(asctime)s %(name)s][%(levelname)s] %(message)s"""'], {}), "('[... |
import json
from common.mapr_logger.log import Log
class NodeLabels(object):
MAPR_LABEL = "mapr.com/usenode"
EXCLUSIVE_LABEL = "mapr.com/exclusivecluster"
def __init__(self, k8s):
self.k8s = k8s
self._node_count = 0
self._items = None
self._json = None
def _get_json(... | [
"common.mapr_logger.log.Log.info",
"common.mapr_logger.log.Log.error",
"json.loads"
] | [((335, 390), 'common.mapr_logger.log.Log.info', 'Log.info', (['"""Retrieving node information..."""'], {'stdout': '(True)'}), "('Retrieving node information...', stdout=True)\n", (343, 390), False, 'from common.mapr_logger.log import Log\n'), ((520, 538), 'json.loads', 'json.loads', (['result'], {}), '(result)\n', (53... |
from django.conf.urls import url
from . import views
app_name = 'minicms'
urlpatterns = [
url(r'^$', views.homepage, name='homepage'),
url(r'^(?P<path>.+)/$', views.page, name='page'),
]
| [
"django.conf.urls.url"
] | [((95, 137), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.homepage'], {'name': '"""homepage"""'}), "('^$', views.homepage, name='homepage')\n", (98, 137), False, 'from django.conf.urls import url\n'), ((144, 191), 'django.conf.urls.url', 'url', (['"""^(?P<path>.+)/$"""', 'views.page'], {'name': '"""page"""'}), "... |
# -*- coding: utf-8 -*-
import torch
class Agent:
def __init__(self, env, cfg):
# if gpu is to be used
self.device = torch.device(
f"cuda:{cfg.gpu}" if torch.cuda.is_available() else "cpu"
)
self.env = env
self.cfg = cfg
self.n_states = self.env.observa... | [
"torch.cuda.is_available"
] | [((187, 212), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (210, 212), False, 'import torch\n')] |
import torch.nn as nn
import torch
class EventModel(nn.Module):
def __init__(self, input_size, hidden_size, output_size, device):
super(EventModel, self).__init__()
self.i2o = nn.Linear(input_size * 4, output_size, device=device)
self.dropout = nn.Dropout(0.1)
self.relu = nn.ReLU(... | [
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.cat",
"torch.nn.Linear"
] | [((199, 252), 'torch.nn.Linear', 'nn.Linear', (['(input_size * 4)', 'output_size'], {'device': 'device'}), '(input_size * 4, output_size, device=device)\n', (208, 252), True, 'import torch.nn as nn\n'), ((276, 291), 'torch.nn.Dropout', 'nn.Dropout', (['(0.1)'], {}), '(0.1)\n', (286, 291), True, 'import torch.nn as nn\n... |
"""TrackML scoring metric"""
__authors__ = ['<NAME>', '<NAME>', '<NAME>',
'<NAME>']
import numpy
import pandas
def _analyze_tracks(truth, submission):
"""Compute the majority particle, hit counts, and weight for each track.
Parameters
----------
truth : pandas.DataFrame
Truth ... | [
"pandas.merge",
"numpy.true_divide",
"pandas.DataFrame.from_records"
] | [((911, 1058), 'pandas.merge', 'pandas.merge', (["truth[['hit_id', 'particle_id', 'weight']]", "submission[['hit_id', 'track_id']]"], {'on': "['hit_id']", 'how': '"""left"""', 'validate': '"""one_to_one"""'}), "(truth[['hit_id', 'particle_id', 'weight']], submission[[\n 'hit_id', 'track_id']], on=['hit_id'], how='le... |
"""
Define an Exporter Plugin class providing
additional options to xmodule lib ExportManager
"""
import datetime
from lxml import etree
from xmodule.modulestore import xml_exporter
from .. import app_settings
from . import resolvers
class PluggableCourseExportManager(xml_exporter.CourseExportManager):
"""
... | [
"lxml.etree.XSLT",
"lxml.etree.XML",
"lxml.etree.XMLParser",
"datetime.datetime.now"
] | [((2377, 2406), 'lxml.etree.XMLParser', 'etree.XMLParser', ([], {'recover': '(True)'}), '(recover=True)\n', (2392, 2406), False, 'from lxml import etree\n'), ((2724, 2752), 'lxml.etree.XML', 'etree.XML', (['xsl_sheet', 'parser'], {}), '(xsl_sheet, parser)\n', (2733, 2752), False, 'from lxml import etree\n'), ((2773, 27... |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2019 by the contributors (see AUTHORS file).
:license: BSD-2-Clause, see LICENSE for details.
"""
from collections import namedtuple
from sphinxcontrib.confluencebuilder.translator import ConfluenceTranslator
from sphinxcontrib_confluencebuilder_util impor... | [
"sphinxcontrib_confluencebuilder_util.ConfluenceTestUtil.prepareSphinx",
"os.path.realpath",
"sphinxcontrib_confluencebuilder_util.ConfluenceTestUtil.prepareConfiguration",
"sphinxcontrib.confluencebuilder.translator.ConfluenceTranslator",
"collections.namedtuple",
"sphinxcontrib_confluencebuilder_util.Co... | [((442, 475), 'collections.namedtuple', 'namedtuple', (['"""Reporter"""', '"""warning"""'], {}), "('Reporter', 'warning')\n", (452, 475), False, 'from collections import namedtuple\n'), ((736, 760), 'sphinxcontrib_confluencebuilder_util.ConfluenceTestUtil.prepareConfiguration', '_.prepareConfiguration', ([], {}), '()\n... |
"""
Functions for creating and deleting the ModMon database.
"""
import argparse
import sys
from sqlalchemy import create_engine
from sqlalchemy.exc import ProgrammingError
from .schema import Base
from .connect import get_database_config, DATABASE_NAME, ENGINE
from ..config import config
from ..utils.utils import as... | [
"sqlalchemy.create_engine",
"argparse.ArgumentParser",
"sys.exit"
] | [((777, 815), 'sqlalchemy.create_engine', 'create_engine', (['ADMIN_CONNECTION_STRING'], {}), '(ADMIN_CONNECTION_STRING)\n', (790, 815), False, 'from sqlalchemy import create_engine\n'), ((1979, 2017), 'sqlalchemy.create_engine', 'create_engine', (['ADMIN_CONNECTION_STRING'], {}), '(ADMIN_CONNECTION_STRING)\n', (1992, ... |
import json
f = open('data/movies.json')
data = json.load(f)
for movie in data[:10]:
print(movie["Title"]) | [
"json.load"
] | [((49, 61), 'json.load', 'json.load', (['f'], {}), '(f)\n', (58, 61), False, 'import json\n')] |
###############################################################################
## The MIT License
##
## SPDX short identifier: MIT
##
## Copyright 2019 Genentech Inc. South San Francisco
##
## Permission is hereby granted, free of charge, to any person obtaining a
## copy of this software and associated documentation ... | [
"platform.system",
"os.path.join",
"distutils.core.setup"
] | [((2753, 2846), 'distutils.core.setup', 'setup', ([], {'name': '"""openmm_py"""', 'version': '"""1.0"""', 'py_modules': "['openmm_py']", 'ext_modules': '[extension]'}), "(name='openmm_py', version='1.0', py_modules=['openmm_py'],\n ext_modules=[extension])\n", (2758, 2846), False, 'from distutils.core import setup\n... |
import re
__all__ = ['UntypedProperty', 'TypedProperty', 'TimecodeProperty']
class UntypedProperty(object):
"""
The Property classes form the basis for the FixedInterfaceObject. They
implement a Python property, and store the data in the instances dataVar.
Docstrings can also be provided to improve help() ... | [
"re.compile"
] | [((3465, 3638), 're.compile', 're.compile', (['"""(?P<sign>[+\\\\-]?)(?P<hours>[0-9]{2}):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9]{2})(?P<dropFrame>[:;.])(?P<frames>[0-9]{2})(?:@(?P<frameRate>[0-9.]+)|$)"""'], {}), "(\n '(?P<sign>[+\\\\-]?)(?P<hours>[0-9]{2}):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9]{2})(?P<dropFrame>[:... |
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import csv
import re
from tests.common.types import (
VID,
Rank,
Prop,
Tag,
Edge,
Vertex,
)
class CSV... | [
"csv.reader",
"tests.common.types.Edge",
"tests.common.types.Rank",
"re.search",
"tests.common.types.Tag",
"tests.common.types.Vertex"
] | [((3852, 3857), 'tests.common.types.Tag', 'Tag', ([], {}), '()\n', (3855, 3857), False, 'from tests.common.types import VID, Rank, Prop, Tag, Edge, Vertex\n'), ((2865, 2901), 're.search', 're.search', (['""":SRC_VID\\\\((.*)\\\\)"""', 'col'], {}), "(':SRC_VID\\\\((.*)\\\\)', col)\n", (2874, 2901), False, 'import re\n')... |
'''
Created on May 8, 2013
Copyright: <NAME>
License: BSD
convenience functions for interactiveBrokers module
'''
from ib.ext.Contract import Contract
priceTicks = {1:'bid',2:'ask',4:'last',6:'high',7:'low',9:'close', 14:'open'}
timeFormat = "%Y%m%d %H:%M:%S"
dateFormat = "%Y%m%d"
def createContr... | [
"ib.ext.Contract.Contract"
] | [((424, 434), 'ib.ext.Contract.Contract', 'Contract', ([], {}), '()\n', (432, 434), False, 'from ib.ext.Contract import Contract\n')] |
from collections import defaultdict
from ..objects import Clause
from ..objects import Statement
from ..structs import KnowledgeMap
from ..objects import Pattern
def parse_clause(words):
assert len(words) == 3
name, relation, node = words
return Clause((name, relation, node))
def parse_chained(words):
... | [
"collections.defaultdict"
] | [((335, 351), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (346, 351), False, 'from collections import defaultdict\n')] |
from rest_framework.decorators import api_view
from rest_framework import status
from rest_framework.response import Response
from visitors.models import Visitor
from visitors.serializers import VisitorSerializer
# Create your views here.
@api_view(['GET', 'POST'])
def visitor_list(request, format=None):
if (requ... | [
"visitors.models.Visitor.objects.all",
"rest_framework.response.Response",
"visitors.models.Visitor.objects.get",
"visitors.serializers.VisitorSerializer",
"rest_framework.decorators.api_view"
] | [((242, 267), 'rest_framework.decorators.api_view', 'api_view', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (250, 267), False, 'from rest_framework.decorators import api_view\n'), ((802, 836), 'rest_framework.decorators.api_view', 'api_view', (["['GET', 'PUT', 'DELETE']"], {}), "(['GET', 'PUT', 'DELETE'])\n", (81... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
"""
The module file for saos8_facts
"""
DOCUMENTATION = """
module: s... | [
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.ciena.saos8.plugins.module_utils.network.saos8.facts.facts.Facts"
] | [((3652, 3720), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'argument_spec', 'supports_check_mode': '(True)'}), '(argument_spec=argument_spec, supports_check_mode=True)\n', (3665, 3720), False, 'from ansible.module_utils.basic import AnsibleModule\n'), ((3957, 3970), 'ansible_col... |
import json
import pytest
from freezegun import freeze_time
from sso.core.logging import create_x_access_log
from sso.tests.factories.user import UserFactory
class TestAppAccessLog:
@pytest.mark.django_db
@freeze_time("2017-06-22 15:50:00.000000+00:00")
def test_user_info_is_logged(self, rf, mocker):
... | [
"sso.core.logging.create_x_access_log",
"freezegun.freeze_time",
"json.loads",
"sso.tests.factories.user.UserFactory"
] | [((218, 265), 'freezegun.freeze_time', 'freeze_time', (['"""2017-06-22 15:50:00.000000+00:00"""'], {}), "('2017-06-22 15:50:00.000000+00:00')\n", (229, 265), False, 'from freezegun import freeze_time\n'), ((965, 1012), 'freezegun.freeze_time', 'freeze_time', (['"""2017-06-22 15:50:00.000000+00:00"""'], {}), "('2017-06-... |
import parserBOJ
import openpyxl as xl
parse = parserBOJ.Parse()
wb = xl.Workbook()
ws = wb.active
ws.title = "sheet100"
# 컬럼명 지정
col_names = ['문제 번호', '문제 제목', '맞힌 사람', '제출 횟수', '정답률']
for seq, name in enumerate(col_names):
ws.cell(row=1, column=seq+1, value=name)
row_num = 2
# 데이터 입력
for n, rows in enumerate(p... | [
"parserBOJ.Parse",
"openpyxl.Workbook"
] | [((48, 65), 'parserBOJ.Parse', 'parserBOJ.Parse', ([], {}), '()\n', (63, 65), False, 'import parserBOJ\n'), ((71, 84), 'openpyxl.Workbook', 'xl.Workbook', ([], {}), '()\n', (82, 84), True, 'import openpyxl as xl\n')] |
import json
class FieldOperation(object):
def __init__(self, d):
if type(d) is str:
d = json.loads(d)
self.from_dict(d)
def from_dict(self, d):
self.__dict__ = {}
for key, value in d.items():
if type(value) is dict:
value ... | [
"json.loads"
] | [((120, 133), 'json.loads', 'json.loads', (['d'], {}), '(d)\n', (130, 133), False, 'import json\n')] |
# import json
# a_dictionary = {"d": 4}
# def add_to_json(channel):
# '''add new channel to the json list file'''
# with open("stored_youtube_channels.json", "r+") as file:
# data = json.load(file)
# data.update(a_dictionary)
# file.seek(0)
# json.dump(data, file)
# #... | [
"json.dump",
"json.load",
"os.path.exists",
"json.dumps",
"datetime.datetime.now",
"os.listdir"
] | [((882, 896), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (894, 896), False, 'from datetime import datetime\n'), ((3029, 3044), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (3039, 3044), False, 'import os\n'), ((1494, 1530), 'os.path.exists', 'path.exists', (['f"""channels_{list}.json"""'], ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
from pandas.api.types import is_scalar
from pandas.util._validators import validate_bool_kwarg
from pandas.core.index import _ensure_index_from_sequences
from pandas._libs import lib
from pa... | [
"pandas.core.dtypes.cast.maybe_upcast_putmask",
"pandas.util._validators.validate_bool_kwarg",
"pandas.core.dtypes.common.is_numeric_dtype",
"ray.put",
"pandas.core.dtypes.common.is_bool_dtype",
"pandas.DataFrame",
"ray.remote",
"numpy.cumsum",
"pandas.concat",
"pandas.compat.lzip",
"pandas.api.... | [((93466, 93495), 'ray.remote', 'ray.remote', ([], {'num_return_vals': '(2)'}), '(num_return_vals=2)\n', (93476, 93495), False, 'import ray\n'), ((91212, 91241), 'pandas.concat', 'pd.concat', (['df_rows'], {'axis': 'axis'}), '(df_rows, axis=axis)\n', (91221, 91241), True, 'import pandas as pd\n'), ((9073, 9092), 'ray.g... |
import json
import os
import pandas as pd
from src import DATA_FOLDER, UNZIPED_FOLDER_NAME
from src.io import CNAE_JSON_NAME, NATJU_JSON_NAME, QUAL_SOCIO_JSON_NAME, MOTIVOS_JSON_NAME, PAIS_JSON_NAME, \
MUNIC_JSON_NAME
from src.io.get_last_ref_date import main as get_last_ref_date
def main(ref_date=No... | [
"json.dump",
"src.io.get_last_ref_date.main",
"pandas.read_csv",
"os.path.join",
"os.listdir"
] | [((393, 449), 'os.path.join', 'os.path.join', (['DATA_FOLDER', 'ref_date', 'UNZIPED_FOLDER_NAME'], {}), '(DATA_FOLDER, ref_date, UNZIPED_FOLDER_NAME)\n', (405, 449), False, 'import os\n'), ((480, 504), 'os.listdir', 'os.listdir', (['path_unziped'], {}), '(path_unziped)\n', (490, 504), False, 'import os\n'), ((1510, 157... |
#!env python
import aoc
import collections
import pprint
import re
ISINT = re.compile(r'^-?[0-9]+$')
def parse_data(lines):
return [line.split() for line in lines]
def valueof(v, registers):
if v is None:
return None
if ISINT.match(v):
return int(v)
return registers[v]
def solve... | [
"collections.defaultdict",
"collections.deque",
"aoc.input_lines",
"re.compile"
] | [((78, 102), 're.compile', 're.compile', (['"""^-?[0-9]+$"""'], {}), "('^-?[0-9]+$')\n", (88, 102), False, 'import re\n'), ((345, 373), 'collections.defaultdict', 'collections.defaultdict', (['int'], {}), '(int)\n', (368, 373), False, 'import collections\n'), ((1315, 1340), 'collections.defaultdict', 'collections.defau... |
"""
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | [
"unittest.main"
] | [((2404, 2419), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2417, 2419), False, 'import unittest\n')] |
from __future__ import unicode_literals
from django.db import models
class DemographicInformation(models.Model):
session_id = models.CharField(max_length=32, blank=True)
# This could be used to store different platforms such as android,
# ios, web if different identification methods are used for each one.... | [
"django.db.models.FileField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((132, 175), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)', 'blank': '(True)'}), '(max_length=32, blank=True)\n', (148, 175), False, 'from django.db import models\n'), ((336, 383), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(256)', 'default': '"""web"""'}), "(... |
""" Storage subsystem's API: responsible of communication with storage service
"""
import logging
from pprint import pformat
from aiohttp import web
from yarl import URL
from servicelib.rest_responses import unwrap_envelope
from .storage_config import get_client_session, get_storage_config
log = logging.getLogger(... | [
"pprint.pformat",
"aiohttp.web.HTTPServiceUnavailable",
"yarl.URL.build",
"servicelib.rest_responses.unwrap_envelope",
"logging.getLogger"
] | [((302, 329), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (319, 329), False, 'import logging\n'), ((1271, 1295), 'servicelib.rest_responses.unwrap_envelope', 'unwrap_envelope', (['payload'], {}), '(payload)\n', (1286, 1295), False, 'from servicelib.rest_responses import unwrap_envelope... |
import glob
import re
import pkgutil
import kattiskitten.languages as languages
SUPPORTED_LANGUAGES = []
LANGUAGE_EXTENSIONS = {}
CONFIGS = {}
for importer, language, ispkg in pkgutil.iter_modules(languages.__path__):
SUPPORTED_LANGUAGES.append(language)
config = importer.find_module(language).load_module(lan... | [
"pkgutil.iter_modules",
"re.search",
"glob.glob"
] | [((178, 218), 'pkgutil.iter_modules', 'pkgutil.iter_modules', (['languages.__path__'], {}), '(languages.__path__)\n', (198, 218), False, 'import pkgutil\n'), ((667, 703), 'glob.glob', 'glob.glob', (['f"""./{problem}/solution.*"""'], {}), "(f'./{problem}/solution.*')\n", (676, 703), False, 'import glob\n'), ((979, 1016)... |
import spacy
from spacy.tokens import Doc
from spacy.vocab import Vocab
TEST_TOKENS = ['Une', 'banque', 'est', 'une', 'institution', 'financière', '.', '5']
TEST_POS = ['DET', 'NOUN', 'AUX', 'DET', 'NOUN', 'ADJ', 'PUNCT', 'NUM']
TEST_SPACES = [True] * len(TEST_TOKENS)
def test_single_UPOS_contextual() -> None:
... | [
"spacy.load",
"spacy.vocab.Vocab"
] | [((335, 379), 'spacy.load', 'spacy.load', (['"""fr_single_upos2usas_contextual"""'], {}), "('fr_single_upos2usas_contextual')\n", (345, 379), False, 'import spacy\n'), ((394, 401), 'spacy.vocab.Vocab', 'Vocab', ([], {}), '()\n', (399, 401), False, 'from spacy.vocab import Vocab\n')] |
from spacy.lang.zh import Chinese
from spacy.tokens import Token
nlp = Chinese()
# 注册词符的扩展属性"is_country",其默认值是False
Token.set_extension("is_country", default=False)
# 处理文本,将词符"新加坡"的is_country属性设置为True
doc = nlp("我住在新加坡。")
doc[3]._.is_country = True
# 对所有词符打印词符文本及is_country属性
print([(token.text, token._.is_country) ... | [
"spacy.tokens.Token.set_extension",
"spacy.lang.zh.Chinese"
] | [((72, 81), 'spacy.lang.zh.Chinese', 'Chinese', ([], {}), '()\n', (79, 81), False, 'from spacy.lang.zh import Chinese\n'), ((118, 166), 'spacy.tokens.Token.set_extension', 'Token.set_extension', (['"""is_country"""'], {'default': '(False)'}), "('is_country', default=False)\n", (137, 166), False, 'from spacy.tokens impo... |
from charPairs import CharPairs
from decimal import *
#Word Similarity Algorithm
#Similarity(string1, string2) = 2 * number of incommon char. pairs / sum of total number of char. pairs in each string
class similarity:
def __init__(self,string1, string2):
#get character pairs for string1
strChar1 = C... | [
"charPairs.CharPairs"
] | [((319, 337), 'charPairs.CharPairs', 'CharPairs', (['string1'], {}), '(string1)\n', (328, 337), False, 'from charPairs import CharPairs\n'), ((544, 562), 'charPairs.CharPairs', 'CharPairs', (['string2'], {}), '(string2)\n', (553, 562), False, 'from charPairs import CharPairs\n')] |
import os
import jeev
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="jeev",
version=jeev.version.split('-')[0] + 'b0',
author="<NAME>",
author_email="<EMAIL>",
description="A simple chat bot, at you... | [
"jeev.version.split",
"os.path.dirname",
"setuptools.find_packages"
] | [((445, 479), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['modules']"}), "(exclude=['modules'])\n", (458, 479), False, 'from setuptools import setup, find_packages\n'), ((194, 217), 'jeev.version.split', 'jeev.version.split', (['"""-"""'], {}), "('-')\n", (212, 217), False, 'import jeev\n'), ((114, ... |
from typing import Tuple
import gym
import numpy as np
from gym_gathering.observations.base_observation_generator import ObservationGenerator
class SingleChannelObservationGenerator(ObservationGenerator):
def __init__(
self,
maze: np.ndarray,
random_goal: bool,
goal_range: int,
... | [
"numpy.zeros",
"gym.spaces.Box"
] | [((872, 943), 'gym.spaces.Box', 'gym.spaces.Box', ([], {'low': '(0)', 'high': '(255)', 'shape': '(*maze.shape, 1)', 'dtype': 'np.uint8'}), '(low=0, high=255, shape=(*maze.shape, 1), dtype=np.uint8)\n', (886, 943), False, 'import gym\n'), ((1062, 1087), 'numpy.zeros', 'np.zeros', (['self.maze.shape'], {}), '(self.maze.s... |
from sprites import *
import pygame
import random
import os
import subprocess
class Mixin:
#dd clouds and fire to game
def add_sprite(self,event,coOrds = None):
#Check coOrds are valid clouds and fire to game (coOrds = None is used to random generate a sprite's coOrds)
if (coOrds == None) or (coOrds[... | [
"random.randrange"
] | [((1239, 1273), 'random.randrange', 'random.randrange', (['(0)', 'SCREEN_HEIGHT'], {}), '(0, SCREEN_HEIGHT)\n', (1255, 1273), False, 'import random\n'), ((1329, 1362), 'random.randrange', 'random.randrange', (['(0)', 'SCREEN_WIDTH'], {}), '(0, SCREEN_WIDTH)\n', (1345, 1362), False, 'import random\n')] |
#!/usr/bin/env python3
from collections import OrderedDict
filepath = r"C:\Users\Yun\Downloads\python-3.9.0-docs-text\library\code.txt"
dict_words = OrderedDict()
with open(filepath,'r') as f:
words = f.read().lower().replace('\n','').split(' ')
set_words = set(words)
set_words.remove('')
for word in set_words:
... | [
"collections.OrderedDict"
] | [((151, 164), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (162, 164), False, 'from collections import OrderedDict\n')] |
# -*- coding: utf-8 -*-
# This file is part of the Ingram Micro Cloud Blue Connect SDK.
# Copyright (c) 2019-2020 Ingram Micro. All Rights Reserved.
import pytest
from mock import patch
from connect.exceptions import Message
from connect.resources.base import BaseResource
from .common import Response
def test_depr... | [
"pytest.deprecated_call",
"connect.exceptions.Message",
"mock.patch"
] | [((473, 494), 'mock.patch', 'patch', (['"""requests.get"""'], {}), "('requests.get')\n", (478, 494), False, 'from mock import patch\n'), ((370, 394), 'pytest.deprecated_call', 'pytest.deprecated_call', ([], {}), '()\n', (392, 394), False, 'import pytest\n'), ((755, 779), 'pytest.deprecated_call', 'pytest.deprecated_cal... |
from predicate import Predicate
__author__ = ''
class Rule(object):
"""
Base class for fuzzy rules
"""
__COUNT = 0
__slots__ = ('_antecedent', '_consequent', '_weight', '_number')
def __init__(self, antecedent, consequent, weight=1):
"""
Initialize a rule
... | [
"rules.parser.parse_rule"
] | [((2937, 2985), 'rules.parser.parse_rule', 'parse_rule', (['sentence', 'scope', 'tnorm', 'snorm', 'cnorm'], {}), '(sentence, scope, tnorm, snorm, cnorm)\n', (2947, 2985), False, 'from rules.parser import parse_rule\n')] |
# Generated by Django 3.0.14 on 2021-08-17 22:16
import warnings
from django.core.paginator import Paginator
from django.db import migrations
from bpp.util import pbar
def value(elem, *path, return_none=False):
v = None
if elem.versions:
for _elem in elem.versions:
if _elem["current"]:
... | [
"bpp.util.pbar",
"warnings.warn",
"django.core.paginator.Paginator",
"django.db.migrations.RunPython"
] | [((1364, 1389), 'django.core.paginator.Paginator', 'Paginator', (['queryset', '(1000)'], {}), '(queryset, 1000)\n', (1373, 1389), False, 'from django.core.paginator import Paginator\n'), ((1406, 1432), 'bpp.util.pbar', 'pbar', (['paginator.page_range'], {}), '(paginator.page_range)\n', (1410, 1432), False, 'from bpp.ut... |
from django.contrib import admin
from .models import Demo, Emoji, Tag, TechStackTag, Comment
admin.site.register(Demo)
admin.site.register(Tag)
admin.site.register(TechStackTag)
admin.site.register(Comment)
admin.site.register(Emoji)
| [
"django.contrib.admin.site.register"
] | [((95, 120), 'django.contrib.admin.site.register', 'admin.site.register', (['Demo'], {}), '(Demo)\n', (114, 120), False, 'from django.contrib import admin\n'), ((121, 145), 'django.contrib.admin.site.register', 'admin.site.register', (['Tag'], {}), '(Tag)\n', (140, 145), False, 'from django.contrib import admin\n'), ((... |
#!/usr/bin/python2.7
# 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 ... | [
"re.compile"
] | [((704, 758), 're.compile', 're.compile', (['"""^(KDDI|DoCoMo|SoftBank|J-PHONE|Vodafone)"""'], {}), "('^(KDDI|DoCoMo|SoftBank|J-PHONE|Vodafone)')\n", (714, 758), False, 'import re\n'), ((955, 974), 're.compile', 're.compile', (['"""^KDDI"""'], {}), "('^KDDI')\n", (965, 974), False, 'import re\n')] |
from fastapi import APIRouter, Depends, Request
from sqlalchemy.orm import Session
from api import search
from ..dependencies import get_user
router = APIRouter()
# Dependency
def get_db(request: Request):
return request.state.db
@router.get("/api/v1/search/{key}")
def search_schools_and_contacts(key, db: Sess... | [
"api.search.json_search",
"fastapi.Depends",
"fastapi.APIRouter"
] | [((152, 163), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (161, 163), False, 'from fastapi import APIRouter, Depends, Request\n'), ((326, 341), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (333, 341), False, 'from fastapi import APIRouter, Depends, Request\n'), ((355, 372), 'fastapi.Depends', '... |
# Stacked Histogram with minutes spent on training type from monthly perspective
import psycopg2
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime
import seaborn as sns
from matplotlib.pyplot import figure
# get session data summary with sport split
conn = psycopg2.connect(host="localho... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.axvline",
"pandas.date_range",
"pandas.pivot_table",
"pandas.merge",
"matplotlib.pyplot.legend",
"pandas.read_sql_query",
"matplotlib.pyplot.ylabel",
"pandas.DateOffset",
"matplotlib.pyplot.xlabel",
"psycopg2.connect"
] | [((290, 387), 'psycopg2.connect', 'psycopg2.connect', ([], {'host': '"""localhost"""', 'database': '"""garmin_data"""', 'user': '"""postgres"""', 'password': '"""*****"""'}), "(host='localhost', database='garmin_data', user='postgres',\n password='*****')\n", (306, 387), False, 'import psycopg2\n'), ((389, 765), 'pa... |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
ans += a[(3 * n) - (2*i + 2)]
print(ans)
| [
"sys.setrecursionlimit"
] | [((38, 68), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 7)'], {}), '(10 ** 7)\n', (59, 68), False, 'import sys\n')] |
import pandas as pd
from common.tflogs2pandas import tflog2pandas
import glob
df_results = pd.DataFrame()
filenames = glob.glob("output_data/tensorboard/model-*/PPO_1")
for filename in filenames:
print(filename)
df = tflog2pandas(filename)
df = df[df["metric"]=="time/fps"]
average_fps = df["value"].me... | [
"pandas.DataFrame",
"common.tflogs2pandas.tflog2pandas",
"glob.glob"
] | [((93, 107), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (105, 107), True, 'import pandas as pd\n'), ((120, 170), 'glob.glob', 'glob.glob', (['"""output_data/tensorboard/model-*/PPO_1"""'], {}), "('output_data/tensorboard/model-*/PPO_1')\n", (129, 170), False, 'import glob\n'), ((227, 249), 'common.tflogs2pan... |
from flask_wtf import FlaskForm
from wtforms import StringField,TextAreaField,FileField,SubmitField
from wtforms.validators import Required
class CommentForm(FlaskForm):
title = StringField('Comment title',validators= [Required()])
comment = TextAreaField('Comment review')
submit = SubmitField('submit')
... | [
"wtforms.SubmitField",
"wtforms.validators.Required",
"wtforms.TextAreaField"
] | [((251, 282), 'wtforms.TextAreaField', 'TextAreaField', (['"""Comment review"""'], {}), "('Comment review')\n", (264, 282), False, 'from wtforms import StringField, TextAreaField, FileField, SubmitField\n'), ((296, 317), 'wtforms.SubmitField', 'SubmitField', (['"""submit"""'], {}), "('submit')\n", (307, 317), False, 'f... |
# -*- coding: utf-8 -*-
"""
The goal of this code is to support hosting a client library. This module
should in the end function similarly to the Mendeley Desktop.
Syncing
-------------------------------------------
Jim's next goals
----------------
1) Handle deleted IDs - needs an API update
2) Me... | [
"os.path.expanduser",
"json.loads",
"timeit.default_timer",
"datetime.datetime.strptime",
"pdb.set_trace",
"sqlalchemy.desc",
"pandas.Timedelta",
"os.path.join",
"pandas.concat"
] | [((28339, 28384), 'datetime.datetime.strptime', 'datetime.strptime', (['x', '"""%Y-%m-%dT%H:%M:%S.%fZ"""'], {}), "(x, '%Y-%m-%dT%H:%M:%S.%fZ')\n", (28356, 28384), False, 'from datetime import datetime\n'), ((2819, 2853), 'os.path.join', 'os.path.join', (['root_path', 'save_name'], {}), '(root_path, save_name)\n', (2831... |
"""
Django settings for imagr_site project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | [
"deployment.setup_deployment",
"os.path.dirname",
"credentials.set_credentials"
] | [((433, 462), 'credentials.set_credentials', 'credentials.set_credentials', ([], {}), '()\n', (460, 462), False, 'import credentials\n'), ((883, 912), 'deployment.setup_deployment', 'deployment.setup_deployment', ([], {}), '()\n', (910, 912), False, 'import deployment\n'), ((358, 383), 'os.path.dirname', 'os.path.dirna... |
import cv2
import numpy as np
import time
'''
Parameters Used inside Code
'''
#Gaussian kernel size used for blurring
G_kernel_size = (3,3)
#canny thresholding parameters
canny_u_threshold = 200
canny_l_threshold = 80
# define the upper and lower boundaries of the HSV pixel
# intensities to be considered 'skin'
low... | [
"numpy.array"
] | [((325, 361), 'numpy.array', 'np.array', (['[0, 48, 80]'], {'dtype': '"""uint8"""'}), "([0, 48, 80], dtype='uint8')\n", (333, 361), True, 'import numpy as np\n'), ((372, 411), 'numpy.array', 'np.array', (['[20, 255, 255]'], {'dtype': '"""uint8"""'}), "([20, 255, 255], dtype='uint8')\n", (380, 411), True, 'import numpy ... |
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
import traceback
from mclib.visual_zone import VisualZone
class LayerItem(QGraphicsRectItem):
def __init__(self, room, layer_index, renderer, main_window):
super().__init__()
self.room = room
self.layer_index... | [
"mclib.visual_zone.VisualZone.get_zone_ids_overlapping_point",
"traceback.format_exc"
] | [((5739, 5808), 'mclib.visual_zone.VisualZone.get_zone_ids_overlapping_point', 'VisualZone.get_zone_ids_overlapping_point', (['self.room.zone_lists', 'x', 'y'], {}), '(self.room.zone_lists, x, y)\n', (5780, 5808), False, 'from mclib.visual_zone import VisualZone\n'), ((510, 532), 'traceback.format_exc', 'traceback.form... |
#!/usr/bin/env python
from pandocfilters import toJSONFilter, RawInline
"""
Pandoc filter that causes emphasis to be rendered using
the custom macro '\myemph{...}' rather than '\emph{...}'
in latex. Other output formats are unaffected.
"""
def latex(s):
return RawInline('latex', s)
def myemph(k, v, f, meta):
if... | [
"pandocfilters.toJSONFilter",
"pandocfilters.RawInline"
] | [((266, 287), 'pandocfilters.RawInline', 'RawInline', (['"""latex"""', 's'], {}), "('latex', s)\n", (275, 287), False, 'from pandocfilters import toJSONFilter, RawInline\n'), ((432, 452), 'pandocfilters.toJSONFilter', 'toJSONFilter', (['myemph'], {}), '(myemph)\n', (444, 452), False, 'from pandocfilters import toJSONFi... |
#!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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:/... | [
"socket.socket",
"sys.exit",
"re.compile"
] | [((6555, 6589), 're.compile', 're.compile', (['"""HTTP/1\\\\.. (\\\\d+) .*"""'], {}), "('HTTP/1\\\\.. (\\\\d+) .*')\n", (6565, 6589), False, 'import re\n'), ((7977, 7988), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (7985, 7988), False, 'import sys\n'), ((1497, 1546), 'socket.socket', 'socket.socket', (['socket.AF_... |
import time
import random
from ggplib.util import log
def depth_charges(sm, seconds):
# play for n seconds
seconds = float(seconds)
log.info("depth_charges() : playing for %s seconds" % seconds)
role_count = len(sm.get_roles())
# cache some objects
joint_move = sm.get_joint_move()
base... | [
"ggplib.util.log.info",
"time.time"
] | [((148, 210), 'ggplib.util.log.info', 'log.info', (["('depth_charges() : playing for %s seconds' % seconds)"], {}), "('depth_charges() : playing for %s seconds' % seconds)\n", (156, 210), False, 'from ggplib.util import log\n'), ((499, 510), 'time.time', 'time.time', ([], {}), '()\n', (508, 510), False, 'import time\n'... |
import unittest
from moment import moment
from datetime import timedelta
class TestAddOperator(unittest.TestCase):
def test_day(self):
a = moment('20201228').add(3, 'd')
b = moment('20201228') + timedelta(days=3)
self.assertEqual(a, b)
def test_second(self):
a = moment('20201... | [
"unittest.main",
"moment.moment",
"datetime.timedelta"
] | [((1244, 1259), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1257, 1259), False, 'import unittest\n'), ((197, 215), 'moment.moment', 'moment', (['"""20201228"""'], {}), "('20201228')\n", (203, 215), False, 'from moment import moment\n'), ((218, 235), 'datetime.timedelta', 'timedelta', ([], {'days': '(3)'}), '(d... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import acl
from flask import Flask, g
from flask_restful import reqparse, Api, Resource
from flask_httpauth import HTTPTokenAuth
import base64
from utils import *
from acl_dvpp import Dvpp
from acl_model import Model
from acl_image import AclImage
from ima... | [
"flask_restful.Api",
"os.mkdir",
"os.remove",
"acl.finalize",
"base64.b64decode",
"acl_model.Model",
"os.path.join",
"acl.rt.set_device",
"image_net_classes.get_image_net_class",
"acl.rt.create_context",
"acl.rt.destroy_context",
"flask_restful.reqparse.RequestParser",
"acl.rt.get_run_mode",... | [((432, 442), 'acl.init', 'acl.init', ([], {}), '()\n', (440, 442), False, 'import acl\n'), ((5153, 5168), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (5158, 5168), False, 'from flask import Flask, g\n'), ((5175, 5183), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (5178, 5183), False, 'from fla... |
from __future__ import print_function
import sys
import time
import uuid
import copy
import random
import logging
import threading
try:
import Queue
except ImportError: # for python3
import queue as Queue
import msgpack
import raft.store as store
import raft.tcp as channel
import raft.log as log
def make_se... | [
"raft.log.logentry",
"threading.Thread.__init__",
"copy.deepcopy",
"uuid.uuid4",
"raft.log.RaftLog",
"raft.store.read_state",
"time.time",
"msgpack.unpackb",
"random.random",
"raft.tcp.start",
"msgpack.packb",
"queue.Queue"
] | [((366, 379), 'queue.Queue', 'Queue.Queue', ([], {}), '()\n', (377, 379), True, 'import queue as Queue\n'), ((840, 870), 'raft.tcp.start', 'channel.start', (['port', 'self.uuid'], {}), '(port, self.uuid)\n', (853, 870), True, 'import raft.tcp as channel\n'), ((898, 909), 'time.time', 'time.time', ([], {}), '()\n', (907... |
import unittest
from filesystem.basefile import BaseFile
import os
class TestBaseFile(unittest.TestCase):
def setUp(self):
os.mknod("/tmp/testfile")
if not os.path.isfile("/tmp/testfile"):
raise Exception("Cannot create /tmp/testfile")
self.file = BaseFile("/tmp/testfile")
... | [
"unittest.main",
"os.remove",
"os.mknod",
"os.path.isfile",
"filesystem.basefile.BaseFile"
] | [((3289, 3304), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3302, 3304), False, 'import unittest\n'), ((136, 161), 'os.mknod', 'os.mknod', (['"""/tmp/testfile"""'], {}), "('/tmp/testfile')\n", (144, 161), False, 'import os\n'), ((289, 314), 'filesystem.basefile.BaseFile', 'BaseFile', (['"""/tmp/testfile"""'], ... |
from wordcloud import WordCloud, STOPWORDS
import os
import re
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.patches import Patch
from loguru import logger
from GEN_Utils import FileHandling
from GEN_Utils.HDF5_Utils import hdf_to_dict
logger.info('Impor... | [
"matplotlib.pyplot.title",
"seaborn.lineplot",
"matplotlib.pyplot.tight_layout",
"os.mkdir",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"seaborn.barplot",
"os.path.exists",
"pandas.read_excel",
"loguru.logger.info",
"numpy.arange",
"seaborn.color_palette",
"matplotlib.patches.Patc... | [((302, 326), 'loguru.logger.info', 'logger.info', (['"""Import OK"""'], {}), "('Import OK')\n", (313, 326), False, 'from loguru import logger\n'), ((841, 882), 'pandas.read_excel', 'pd.read_excel', (['input_path'], {'sheetname': 'None'}), '(input_path, sheetname=None)\n', (854, 882), True, 'import pandas as pd\n'), ((... |
from jk_hwriter import HWriter
from jk_rawhtml.htmlgeneral import *
from jk_rawhtml._HTMLElementProto import _HTMLElementProto, HTMLElement
from jk_rawhtml._HTMLCommentProto import _HTMLCommentProto, HTMLComment
from jk_rawhtml._HTMLRawTextProto import _HTMLRawTextProto, HTMLRawText
from jk_rawhtml._HTMLRawCSSPro... | [
"jk_rawhtml._HTMLRawTextProto._HTMLRawTextProto",
"jk_rawhtml._HTMLElementProto._HTMLElementProto",
"jk_rawhtml.HTML5Scope.HTML5Scope"
] | [((617, 718), 'jk_rawhtml._HTMLElementProto._HTMLElementProto', '_HTMLElementProto', (['"""span"""'], {'tagType': 'HTML_TAG_TYPE_INLINE_ALL', 'extraAttributes': "{'class': 'eNameB'}"}), "('span', tagType=HTML_TAG_TYPE_INLINE_ALL, extraAttributes\n ={'class': 'eNameB'})\n", (634, 718), False, 'from jk_rawhtml._HTMLEl... |
# Generated by Django 1.11.18 on 2019-03-04 10:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('structure', '0006_customer_backend_id'),
]
operations = [
migrations.AddField(
model_name='customer',
name='blocked... | [
"django.db.models.BooleanField"
] | [((341, 375), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (360, 375), False, 'from django.db import migrations, models\n')] |
import logging
import antlr4
from antlr4.error.ErrorListener import ErrorListener
import click
from .antlr.CLexer import CLexer
from .antlr.CParser import CParser
logger = logging.getLogger(__name__)
class MyErrorListener(ErrorListener):
def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e)... | [
"antlr4.CommonTokenStream",
"antlr4.FileStream",
"click.option",
"click.command",
"logging.getLogger"
] | [((176, 203), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (193, 203), False, 'import logging\n'), ((828, 843), 'click.command', 'click.command', ([], {}), '()\n', (841, 843), False, 'import click\n'), ((845, 896), 'click.option', 'click.option', (['"""--filepath"""'], {'type': 'str', '... |
# -*- coding: utf-8 -*-
""" Print information of the users who got unassigned tickets."""
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from p3 import models as p3_models
from assopy import models as assopy_models
from optparse import make_option
### Globals
###... | [
"assopy.models.Order.objects.filter",
"p3.models.TicketConference.objects.filter",
"django.core.management.base.CommandError",
"optparse.make_option"
] | [((556, 606), 'assopy.models.Order.objects.filter', 'assopy_models.Order.objects.filter', ([], {'_complete': '(True)'}), '(_complete=True)\n', (590, 606), True, 'from assopy import models as assopy_models\n'), ((1056, 1115), 'p3.models.TicketConference.objects.filter', 'p3_models.TicketConference.objects.filter', ([], ... |
from django import forms
from uploads.core.models import Document
#from uploads.core.models import File
# 創造一個依照model的form,會繼承欄位description document
class DocumentForm(forms.ModelForm):
class Meta:
model = Document
fields = ('description', 'document', )
class nameForm(forms.Form):
rename=form... | [
"django.forms.CharField"
] | [((316, 333), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (331, 333), False, 'from django import forms\n')] |
# -*- coding: utf-8 -*-
"""
This code is auto generated from troposphere_mate.code_generator.__init__.py scripts.
"""
import sys
if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover
from typing import Union, List, Any
import troposphere.cloudformation
from troposphere.cloudformati... | [
"troposphere_mate.core.mate.preprocess_init_kwargs"
] | [((1153, 1383), 'troposphere_mate.core.mate.preprocess_init_kwargs', 'preprocess_init_kwargs', ([], {'title': 'title', 'template': 'template', 'validation': 'validation', 'TemplateURL': 'TemplateURL', 'NotificationARNs': 'NotificationARNs', 'Parameters': 'Parameters', 'Tags': 'Tags', 'TimeoutInMinutes': 'TimeoutInMinut... |
from fastapi import APIRouter
from src.controllers import healthcheck
router = APIRouter(
prefix="/healthcheck",
tags=["healthcheck"]
)
@router.get("", name="Health check", response_model=str)
async def runGetHealthCheck():
return healthcheck.getHealthCheck()
| [
"src.controllers.healthcheck.getHealthCheck",
"fastapi.APIRouter"
] | [((80, 134), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/healthcheck"""', 'tags': "['healthcheck']"}), "(prefix='/healthcheck', tags=['healthcheck'])\n", (89, 134), False, 'from fastapi import APIRouter\n'), ((246, 274), 'src.controllers.healthcheck.getHealthCheck', 'healthcheck.getHealthCheck', ([], {}), '(... |
# -*- coding: UTF-8 -*-
import collections
import math
import md5
from nose.tools import nottest
import raco.algebra
import raco.fakedb
import raco.myrial.interpreter as interpreter
import raco.scheme as scheme
import raco.myrial.groupby
import raco.myrial.myrial_test as myrial_test
from raco.algebra import Apply
fro... | [
"raco.scheme.Scheme",
"math.sqrt",
"math.ceil",
"math.tan",
"math.floor",
"raco.fake_data.FakeData.emp_table.elements",
"math.sin",
"collections.defaultdict",
"md5.new",
"math.cos",
"collections.Counter",
"math.log",
"raco.scheme.getName"
] | [((11134, 11357), 'collections.Counter', 'collections.Counter', (["[('<NAME>', 'human resources'), ('<NAME>', 'accounting'), ('<NAME>',\n 'accounting'), ('<NAME>', 'human resources'), ('<NAME>', 'accounting'),\n ('<NAME>', 'engineering'), ('<NAME>', 'accounting')]"], {}), "([('<NAME>', 'human resources'), ('<NAME... |
import cdms2,sys,cdutil,os,cdat_info
f=cdms2.open(os.path.join(cdat_info.get_sampledata_path(),"navy_land.nc"))
navy_frac = f("sftlf")/100.
target = cdms2.open(os.path.join(cdat_info.get_sampledata_path(),'clt.nc'))("clt",slice(0,1)).getGrid()
mask = cdutil.generateLandSeaMask(target,navy_frac)
target = cdms2.open(os... | [
"cdutil.generateLandSeaMask",
"cdat_info.get_sampledata_path",
"cdms2.createGaussianGrid"
] | [((253, 298), 'cdutil.generateLandSeaMask', 'cdutil.generateLandSeaMask', (['target', 'navy_frac'], {}), '(target, navy_frac)\n', (279, 298), False, 'import cdms2, sys, cdutil, os, cdat_info\n'), ((399, 444), 'cdutil.generateLandSeaMask', 'cdutil.generateLandSeaMask', (['target', 'navy_frac'], {}), '(target, navy_frac)... |
import django
if django.get_version() >= '1.5':
from django.conf.urls import patterns, url
else:
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^simple/action/$', 'simpleAction', name = 'simpleAction'),
)
| [
"django.conf.urls.defaults.url",
"django.get_version"
] | [((18, 38), 'django.get_version', 'django.get_version', ([], {}), '()\n', (36, 38), False, 'import django\n'), ((190, 250), 'django.conf.urls.defaults.url', 'url', (['"""^simple/action/$"""', '"""simpleAction"""'], {'name': '"""simpleAction"""'}), "('^simple/action/$', 'simpleAction', name='simpleAction')\n", (193, 250... |
# <NAME>
import numpy as np
import pylab as plt
from spectral.io import envi
import os, sys
sys.path.append('../utils')
from fpa import FPA
I = envi.open('../data/EMIT_LinearityMap_20220117.hdr').load()
thresh = 20
fpa = FPA('../config/tvac2_config.json')
for band in range(I.shape[2]):
x = np.squeeze(I[:,:,band])... | [
"sys.path.append",
"spectral.io.envi.save_image",
"spectral.io.envi.open",
"fpa.FPA",
"numpy.squeeze"
] | [((92, 119), 'sys.path.append', 'sys.path.append', (['"""../utils"""'], {}), "('../utils')\n", (107, 119), False, 'import os, sys\n'), ((224, 258), 'fpa.FPA', 'FPA', (['"""../config/tvac2_config.json"""'], {}), "('../config/tvac2_config.json')\n", (227, 258), False, 'from fpa import FPA\n'), ((1019, 1104), 'spectral.io... |
from process import *
import sys
import time
import signal
def main(argv):
# proc = Process.from_name('Gw.exe')
proc = Process(3356)
dbg = ProcessDebugger(proc)
scanner = ProcessScanner(proc)
def signal_handler(signal, frame):
dbg.detach()
signal.signal(signal.SIGINT, signal_handler)... | [
"signal.signal",
"sys.exit"
] | [((276, 320), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal_handler'], {}), '(signal.SIGINT, signal_handler)\n', (289, 320), False, 'import signal\n'), ((1759, 1774), 'sys.exit', 'sys.exit', (['error'], {}), '(error)\n', (1767, 1774), False, 'import sys\n')] |
# -*- coding: utf8 -*-
""" SunFinder 的协程版本
"""
from __future__ import unicode_literals
from gevent.pool import Pool
from .subfinder import SubFinder
class SubFinderGevent(SubFinder):
""" SubFinder Thread version
"""
def _init_pool(self):
self.pool = Pool(10)
| [
"gevent.pool.Pool"
] | [((272, 280), 'gevent.pool.Pool', 'Pool', (['(10)'], {}), '(10)\n', (276, 280), False, 'from gevent.pool import Pool\n')] |
import bottle
import model
result = ''
kolicina2 = 0
st = 0
vhodna = ''
izhodna = ''
@bottle.get('/')
def index():
return bottle.template('index.tpl', result=result)
@bottle.get('/pretvori/')
def pretvori():
kolicina = kolicina2
global st
st = float(bottle.request.query['st'])
... | [
"model.pretvarjanje",
"bottle.template",
"bottle.get",
"bottle.run"
] | [((97, 112), 'bottle.get', 'bottle.get', (['"""/"""'], {}), "('/')\n", (107, 112), False, 'import bottle\n'), ((189, 213), 'bottle.get', 'bottle.get', (['"""/pretvori/"""'], {}), "('/pretvori/')\n", (199, 213), False, 'import bottle\n'), ((614, 640), 'bottle.get', 'bottle.get', (['"""/na_dolzino/"""'], {}), "('/na_dolz... |
# Author: <NAME>
# email: <EMAIL>
import numpy as np
import init_paths
from images_io import load_image
from xinshuo_visualization import visualize_image
def test_load_image():
image_path = '../lena.png'
print('basic')
img = load_image(image_path)
assert img.shape == (512, 512, 3)
print('testing for resizing'... | [
"xinshuo_visualization.visualize_image",
"images_io.load_image"
] | [((231, 253), 'images_io.load_image', 'load_image', (['image_path'], {}), '(image_path)\n', (241, 253), False, 'from images_io import load_image\n'), ((329, 370), 'images_io.load_image', 'load_image', (['image_path'], {'resize_factor': '(2.0)'}), '(image_path, resize_factor=2.0)\n', (339, 370), False, 'from images_io i... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [
"pytest.importorskip",
"yaml.safe_load",
"pathlib.Path"
] | [((919, 1007), 'pytest.importorskip', 'pytest.importorskip', (['"""addheader.add"""'], {'reason': '"""`addheader` package is not available"""'}), "('addheader.add', reason=\n '`addheader` package is not available')\n", (938, 1007), False, 'import pytest\n'), ((1108, 1128), 'pathlib.Path', 'Path', (['idaes.__file__']... |
'''
Created on Feb 5, 2018
@author: <NAME>
'''
import CONSTANTS,time
def log_arguments(f):
"""
@f: Function to be wrapped with the logging of it's arguments
"""
def logger(*args,**kwargs):
"""
wrapping function, it logs the arguments of the decorated function
"""
if CON... | [
"time.time"
] | [((964, 975), 'time.time', 'time.time', ([], {}), '()\n', (973, 975), False, 'import CONSTANTS, time\n'), ((1055, 1066), 'time.time', 'time.time', ([], {}), '()\n', (1064, 1066), False, 'import CONSTANTS, time\n')] |
'''
util.py
'''
import os.path
import h5py
import numpy as np
import constants
import skimage.io
import skimage.transform
from scipy.io import loadmat
import glob
import os
import cPickle as pickle
import torch
from itertools import izip_longest
from glove import Glove
import torch
import torch.nn as nn
# Makes the ... | [
"numpy.flip",
"os.makedirs",
"scipy.io.loadmat",
"torch.LongTensor",
"itertools.izip_longest",
"torch.load",
"os.path.exists",
"torch.save",
"torch.nn.init.xavier_uniform",
"numpy.array",
"glove.Glove",
"numpy.swapaxes",
"numpy.random.rand",
"os.path.join",
"os.listdir"
] | [((1039, 1074), 'scipy.io.loadmat', 'loadmat', (['"""data_constants/setid.mat"""'], {}), "('data_constants/setid.mat')\n", (1046, 1074), False, 'from scipy.io import loadmat\n'), ((3085, 3110), 'os.path.exists', 'os.path.exists', (['save_path'], {}), '(save_path)\n', (3099, 3110), False, 'import os\n'), ((5568, 5575), ... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pinner... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((127, 149), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (139, 149), False, 'from os import path\n'), ((210, 238), 'os.path.join', 'path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (219, 238), False, 'from os import path\n'), ((651, 677), 'setuptools.find_packages', 'f... |
#!/usr/bin/env python
import re
import logging
import argparse
import requests
from plexapi.myplex import MyPlexAccount
logging.basicConfig(format='%(message)s', level=logging.INFO)
logging.getLogger('plexapi').setLevel(logging.CRITICAL)
log = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
parser.add... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"requests.post",
"plexapi.myplex.MyPlexAccount",
"re.search",
"logging.getLogger"
] | [((121, 182), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(message)s"""', 'level': 'logging.INFO'}), "(format='%(message)s', level=logging.INFO)\n", (140, 182), False, 'import logging\n'), ((245, 272), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (262, 272), False... |
from tftk.image.dataset import Mnist
from tftk.image.dataset import Food101
from tftk.image.dataset import ImageDatasetUtil
from tftk.image.model.classification import SimpleClassificationModel
from tftk.callback import CallbackBuilder
from tftk.optimizer import OptimizerBuilder
from tftk import Context
from tftk.ima... | [
"tensorflow.cast",
"tensorflow.keras.backend.abs",
"tensorflow.one_hot",
"tftk.Context.init_context"
] | [((1544, 1570), 'tensorflow.keras.backend.abs', 'tf.keras.backend.abs', (['diff'], {}), '(diff)\n', (1564, 1570), True, 'import tensorflow as tf\n'), ((2593, 2631), 'tftk.Context.init_context', 'Context.init_context', ([], {'TRAINING_NAME': '""""""'}), "(TRAINING_NAME='')\n", (2613, 2631), False, 'from tftk import Cont... |
# Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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... | [
"logging.getLogger"
] | [((2087, 2114), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2104, 2114), False, 'import logging\n')] |
import datetime
import time
from urllib.parse import urlencode
import requests
from pandas import read_csv
from geodataimport.compat import StringIO, binary_type, bytes_to_str
from geodataimport.utils import RemoteDataError, _init_session, _sanitize_dates
class _GeoData(object):
"""
Parameters
---------... | [
"geodataimport.utils._sanitize_dates",
"geodataimport.compat.StringIO",
"pandas.read_csv",
"urllib.parse.urlencode",
"geodataimport.compat.bytes_to_str",
"datetime.date.today",
"geodataimport.utils.RemoteDataError",
"geodataimport.utils._init_session",
"time.sleep",
"datetime.timedelta"
] | [((1326, 1380), 'geodataimport.utils._sanitize_dates', '_sanitize_dates', (['(start or self.default_start_date)', 'end'], {}), '(start or self.default_start_date, end)\n', (1341, 1380), False, 'from geodataimport.utils import RemoteDataError, _init_session, _sanitize_dates\n'), ((1727, 1795), 'geodataimport.utils._init... |
import requests
import params
base_url = params.url
url = base_url+"v2/public/user/create"
user_email_domain = params.email_domain
# User Inputs
first_name = input("Type user's first name: ")
last_name = input("Type user's last name: ")
# Create user creds from inputs
full_name = first_name + " " + las... | [
"requests.request"
] | [((831, 891), 'requests.request', 'requests.request', (['"""POST"""', 'url'], {'json': 'payload', 'headers': 'headers'}), "('POST', url, json=payload, headers=headers)\n", (847, 891), False, 'import requests\n')] |
'''
Created on Sep 16, 2010
kNN: k Nearest Neighbors
Input: inX: vector to compare to existing dataset (1xN)
dataSet: size m data set of known vectors (NxM)
labels: data set labels (1xM vector)
k: number of neighbors to use for comparison (should be an odd number)
Output: ... | [
"matplotlib.pyplot.figure",
"operator.itemgetter",
"matplotlib.pyplot.show"
] | [((3799, 3811), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3809, 3811), True, 'import matplotlib.pyplot as plt\n'), ((4143, 4153), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (4151, 4153), True, 'import matplotlib.pyplot as plt\n'), ((2246, 2268), 'operator.itemgetter', 'operator.itemgette... |