code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright 2013-2021 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | [
"libdiscid.read",
"libdiscid.default_device",
"unittest.skipIf",
"libdiscid.put",
"unittest.main",
"libdiscid.sectors_to_seconds"
] | [((1796, 1927), 'unittest.skipIf', 'unittest.skipIf', (['(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in libdiscid.FEATURES)', '"""not available on this platform"""'], {}), "(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in\n libdiscid.FEATURES, 'not available on this platform')\n", (1811, 1927),... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.employes_view, name='employes'),
path('<int:employee_id>/', views.employee_view, name='employee'),
] | [
"django.urls.path"
] | [((70, 116), 'django.urls.path', 'path', (['""""""', 'views.employes_view'], {'name': '"""employes"""'}), "('', views.employes_view, name='employes')\n", (74, 116), False, 'from django.urls import path\n'), ((122, 186), 'django.urls.path', 'path', (['"""<int:employee_id>/"""', 'views.employee_view'], {'name': '"""emplo... |
import torchvision.transforms
import sys
import unittest
if sys.version_info.minor >= 7:
def __getattr__(name):
if name in torchvision.transforms.transforms.__all__:
return torchvision.transforms.__getattribute__(name)
else:
raise AttributeError(f"module {name} not impleme... | [
"unittest.__getattribute__"
] | [((718, 749), 'unittest.__getattribute__', 'unittest.__getattribute__', (['name'], {}), '(name)\n', (743, 749), False, 'import unittest\n')] |
import pandas as pd
import os
import sys
import datetime
utils_path = os.path.join(os.path.abspath(os.getenv('PROCESSING_DIR')),'utils')
if utils_path not in sys.path:
sys.path.append(utils_path)
import util_files
import util_cloud
import util_carto
import logging
from zipfile import ZipFile
import tabula
# Set up... | [
"logging.getLogger",
"logging.basicConfig",
"datetime.datetime",
"logging.StreamHandler",
"zipfile.ZipFile",
"os.getenv",
"util_files.prep_dirs",
"os.path.join",
"os.path.basename",
"util_carto.upload_to_carto",
"sys.path.append"
] | [((372, 391), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (389, 391), False, 'import logging\n'), ((526, 549), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (547, 549), False, 'import logging\n'), ((577, 664), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asct... |
# FOR DATES AND TIMES #
# From MBTdelay #
# (C) <NAME> 2019 #
import time
import datetime
from dateutil import tz
from datetime import timedelta
import arrow
from time import strptime
## CONVERT HUMAN READABLE TO UNIX TIMESTAMP
# CONVERT YYYY-mm-dd HH:MM:SS (EASTERN) TO UNIX (utc) TIMESTAMP
def conv_east_to_unixts_hm... | [
"arrow.get",
"arrow.Arrow.fromtimestamp"
] | [((3431, 3444), 'arrow.get', 'arrow.get', (['dt'], {}), '(dt)\n', (3440, 3444), False, 'import arrow\n'), ((336, 372), 'arrow.get', 'arrow.get', (['dt', '"""YYYY-MM-DD HH:mm:ss"""'], {}), "(dt, 'YYYY-MM-DD HH:mm:ss')\n", (345, 372), False, 'import arrow\n'), ((586, 622), 'arrow.get', 'arrow.get', (['dt', '"""YYYY-MM-DD... |
import re
import os
import psutil
import argparse
import requests
from os import _exit,path,devnull
from sys import stdout
from time import sleep
from random import choice
from argparse import ArgumentParser
from traceback import print_exc
from threading import Thread,Lock,enumerate as list_threads
from user_agent impo... | [
"selenium.webdriver.ChromeOptions",
"random.choice",
"argparse.ArgumentParser",
"threading.Lock",
"threading.enumerate",
"selenium.webdriver.Chrome",
"selenium.webdriver.Firefox",
"os.geteuid",
"time.sleep",
"psutil.Process",
"os.path.isfile",
"selenium.webdriver.FirefoxOptions",
"requests.g... | [((793, 823), 'sys.stdout.write', 'stdout.write', (["('%s\\n' % message)"], {}), "('%s\\n' % message)\n", (805, 823), False, 'from sys import stdout\n'), ((4395, 4411), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (4409, 4411), False, 'from argparse import ArgumentParser\n'), ((661, 672), 'traceback.p... |
import numpy as np
from itertools import product
from itertools import permutations
def choose_nums(big, small):
"""
This function takes 2 inputs (number of big number and number of small
numbers) and returns a list of appropriate randomized inetegers
"""
#test inputs
assert type(big) is int, "... | [
"itertools.permutations",
"numpy.random.randint",
"itertools.product"
] | [((3151, 3178), 'numpy.random.randint', 'np.random.randint', (['(100)', '(999)'], {}), '(100, 999)\n', (3168, 3178), True, 'import numpy as np\n'), ((784, 807), 'numpy.random.randint', 'np.random.randint', (['(0)', '(3)'], {}), '(0, 3)\n', (801, 807), True, 'import numpy as np\n'), ((897, 921), 'numpy.random.randint', ... |
"""
From this example you can learn how to set a menu,
and how to declare it dynamically (eg. for internationalization).
At the moment, the menu only works for Mac/Cocoa render.
"""
from quasargui import *
from quasargui.tools import static_vars
menu = [
{'title': 'Top Action', 'action': lambda: layout.api.plugi... | [
"quasargui.tools.static_vars"
] | [((1130, 1152), 'quasargui.tools.static_vars', 'static_vars', ([], {'counter': '(0)'}), '(counter=0)\n', (1141, 1152), False, 'from quasargui.tools import static_vars\n'), ((1439, 1467), 'quasargui.tools.static_vars', 'static_vars', ([], {'spare_menu': 'None'}), '(spare_menu=None)\n', (1450, 1467), False, 'from quasarg... |
# Generated by Django 3.2.3 on 2021-08-19 13:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('twinbird', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='twinbird',
name='catid',
... | [
"django.db.models.IntegerField"
] | [((327, 394), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)', 'verbose_name': '"""收據店家欄位id"""'}), "(blank=True, null=True, verbose_name='收據店家欄位id')\n", (346, 394), False, 'from django.db import migrations, models\n'), ((517, 584), 'django.db.models.IntegerField', 'mode... |
#!/usr/bin/env python
#from distutils.core import setup
from setuptools import setup
setup(name='dear',
version='0.1.1',
description='Dear EARs Audio Analysis Framework',
author='<NAME>',
author_email='<EMAIL>',
url='http://dongying.github.com/dear',
packages=['dear','dear.spectrum','dear.anal... | [
"setuptools.setup"
] | [((87, 353), 'setuptools.setup', 'setup', ([], {'name': '"""dear"""', 'version': '"""0.1.1"""', 'description': '"""Dear EARs Audio Analysis Framework"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""http://dongying.github.com/dear"""', 'packages': "['dear', 'dear.spectrum', 'dear.analysis', 'd... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from logging import DEBUG
from logging import getLogger
from logging import StreamHandler
from scapy.all import sniff
import toml
from . import functions
from .logger import NekomataArpLogger
from .utils import DEFAULT_MAC
from .utils import gen_xeger
logger = getLogge... | [
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"doctest.testmod",
"toml.load"
] | [((312, 331), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (321, 331), False, 'from logging import getLogger\n'), ((342, 357), 'logging.StreamHandler', 'StreamHandler', ([], {}), '()\n', (355, 357), False, 'from logging import StreamHandler\n'), ((1659, 1676), 'doctest.testmod', 'doctest.testmo... |
"""Queries
This module contains MongoDB queries for the Squirrel program.
Examples
python -m unittest tests.test_queries
"""
import sys
from pprint import pprint
from typing import List
from bson import ObjectId
from pymongo import MongoClient
from pymongo.database import Database
from pymongo.errors import Serve... | [
"pymongo.MongoClient"
] | [((654, 711), 'pymongo.MongoClient', 'MongoClient', (['client_uri'], {'serverSelectionTimeoutMS': 'timeout'}), '(client_uri, serverSelectionTimeoutMS=timeout)\n', (665, 711), False, 'from pymongo import MongoClient\n'), ((1137, 1150), 'pymongo.MongoClient', 'MongoClient', ([], {}), '()\n', (1148, 1150), False, 'from py... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA2D
#
# https://github.com/CNES/Pandora2D
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | [
"numpy.reshape",
"json_checker.Checker",
"scipy.optimize.minimize",
"numpy.rollaxis",
"multiprocessing.cpu_count",
"numpy.array",
"numpy.isnan",
"numpy.nonzero",
"json_checker.And",
"numpy.all",
"scipy.interpolate.interp2d"
] | [((1888, 1903), 'json_checker.Checker', 'Checker', (['schema'], {}), '(schema)\n', (1895, 1903), False, 'from json_checker import And, Checker\n'), ((3432, 3453), 'numpy.isnan', 'np.isnan', (['matrix_cost'], {}), '(matrix_cost)\n', (3440, 3453), True, 'import numpy as np\n'), ((3504, 3516), 'numpy.all', 'np.all', (['na... |
import sqlite3
import pandas as pd
agn_params_file = '/global/cscratch1/sd/jchiang8/desc/sims_GCRCatSimInterface/work/2020-02-18/agn_cosmoDC2_v1.1.4.db'
schema = '''CREATE TABLE agn_params
(galaxy_id int, htmid_8 int, magNorm real,
redshift real, M_i real, ra real, dec re... | [
"pandas.read_sql",
"sqlite3.connect"
] | [((625, 657), 'sqlite3.connect', 'sqlite3.connect', (['agn_params_file'], {}), '(agn_params_file)\n', (640, 657), False, 'import sqlite3\n'), ((676, 700), 'pandas.read_sql', 'pd.read_sql', (['query', 'conn'], {}), '(query, conn)\n', (687, 700), True, 'import pandas as pd\n'), ((746, 770), 'sqlite3.connect', 'sqlite3.co... |
from flask_wtf import FlaskForm
from wtforms import (StringField, SubmitField, TextAreaField)
from wtforms.validators import DataRequired
from flask_wtf.file import FileAllowed, FileField
class NewChatroom(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
class NewChat(FlaskForm):
title ... | [
"wtforms.validators.DataRequired"
] | [((265, 279), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (277, 279), False, 'from wtforms.validators import DataRequired\n'), ((357, 371), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (369, 371), False, 'from wtforms.validators import DataRequired\n')] |
from collections import defaultdict
import math
import random
import pandas as pd
import numpy as np
from components.history import History
# from components.stats import Stats
from components.params import MetaParams, Params
from components.agent import Agent, ZeroInt, Basic, Superfan, Nerd1, Nerd2, Nerd3, Nerd4, Ner... | [
"pandas.read_csv",
"components.history.History",
"pandas.DataFrame",
"math.exp",
"pandas.concat"
] | [((377, 407), 'pandas.read_csv', 'pd.read_csv', (['"""./data/data.csv"""'], {}), "('./data/data.csv')\n", (388, 407), True, 'import pandas as pd\n'), ((509, 555), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'meta_params.results_full'}), '(columns=meta_params.results_full)\n', (521, 555), True, 'import pandas a... |
# Copyright 2021 <NAME>
#
# 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 in writing, softw... | [
"django.db.models.ImageField",
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey"
] | [((641, 679), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""images/"""'}), "(upload_to='images/')\n", (658, 679), False, 'from django.db import models\n'), ((788, 819), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)'}), '(null=True)\n', (808, 819), False, 'f... |
import argparse
import torch
parser = argparse.ArgumentParser()
parser.add_argument('model')
args = parser.parse_args()
a = torch.load(args.model)
if 'extra_state' in a:
if 'subepoch' in a['extra_state']:
print(f"Subepoch: {a['extra_state']['subepoch']}")
print(f"Epoch: {a['extra_state']['train_iterat... | [
"torch.load",
"argparse.ArgumentParser"
] | [((39, 64), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (62, 64), False, 'import argparse\n'), ((126, 148), 'torch.load', 'torch.load', (['args.model'], {}), '(args.model)\n', (136, 148), False, 'import torch\n')] |
# Copyright 2020 The TensorStore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"pickle.dumps",
"tensorstore.IndexTransform",
"pytest.raises",
"tensorstore.Spec"
] | [((729, 839), 'tensorstore.Spec', 'ts.Spec', (["{'driver': 'array', 'array': [[1, 2], [3, 4]], 'transform': {'input_rank': \n 2}, 'dtype': 'int32'}"], {}), "({'driver': 'array', 'array': [[1, 2], [3, 4]], 'transform': {\n 'input_rank': 2}, 'dtype': 'int32'})\n", (736, 839), True, 'import tensorstore as ts\n'), ((... |
import numpy as np
import math
import random
import matplotlib.pyplot as plt
# ref : http://outlace.com/rlpart3.html
# TODO : add ploting method
class QAgent:
# TODO : inherit from some RL classes which implement alpha , gamma , etc and delete them from constructor
# TODO : make growing strategy... | [
"random.uniform",
"numpy.fromfile",
"numpy.eye",
"numpy.ones",
"numpy.unique",
"math.sqrt",
"numpy.argmax",
"numpy.max",
"numpy.append",
"numpy.zeros",
"numpy.argwhere",
"numpy.triu",
"numpy.transpose",
"random.randint",
"numpy.arange"
] | [((816, 855), 'numpy.zeros', 'np.zeros', (['(nbStateBatch, self.nbAction)'], {}), '((nbStateBatch, self.nbAction))\n', (824, 855), True, 'import numpy as np\n'), ((1453, 1473), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (1467, 1473), False, 'import random\n'), ((3326, 3367), 'numpy.fromfile',... |
# This program is free software: you can redistribute it and/or modify it under the
# terms of the Apache License (v2.0) as published by the Apache Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or... | [
"logging.getLogger",
"sqlalchemy.orm.relationship",
"sqlalchemy.DateTime",
"sqlalchemy.schema.Sequence",
"sqlalchemy.schema.CheckConstraint",
"sqlalchemy.ForeignKey",
"sqlalchemy.Index",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.BigInteger",
"sqlalchemy.Column"
] | [((1054, 1081), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1071, 1081), False, 'import logging\n'), ((1092, 1110), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (1108, 1110), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), (... |
#!/usr/bin/env python
from jsk_arc2017_common.msg import WeightStamped
from jsk_recognition_msgs.msg import BoolStamped
import message_filters
import rospy
from std_srvs.srv import Trigger
from std_srvs.srv import TriggerResponse
class WeightChangeDetector(object):
def __init__(self):
self.input_topics ... | [
"message_filters.TimeSynchronizer",
"rospy.init_node",
"rospy.get_param",
"rospy.Service",
"jsk_recognition_msgs.msg.BoolStamped",
"rospy.spin",
"message_filters.Subscriber",
"message_filters.ApproximateTimeSynchronizer",
"rospy.Publisher",
"std_srvs.srv.TriggerResponse",
"jsk_arc2017_common.msg... | [((3467, 3508), 'rospy.init_node', 'rospy.init_node', (['"""weight_change_detector"""'], {}), "('weight_change_detector')\n", (3482, 3508), False, 'import rospy\n'), ((3546, 3558), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (3556, 3558), False, 'import rospy\n'), ((322, 354), 'rospy.get_param', 'rospy.get_param', ([... |
from __future__ import absolute_import, print_function
import argparse
import logging
import os
import sys
from importlib import import_module
from . import SUPPORTED_SHELLS, __version__, complete
log = logging.getLogger(__name__)
def get_main_parser():
parser = argparse.ArgumentParser(prog="shtab")
parser... | [
"logging.getLogger",
"logging.basicConfig",
"sys.path.insert",
"importlib.import_module",
"argparse.ArgumentParser"
] | [((206, 233), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'import logging\n'), ((272, 309), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""shtab"""'}), "(prog='shtab')\n", (295, 309), False, 'import argparse\n'), ((1326, 1366), 'logging.basic... |
# MIT License
#
# Copyright (c) 2021 <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, modify, merge, publi... | [
"librosa.feature.melspectrogram",
"librosa.magphase",
"torch.Tensor",
"librosa.feature.mfcc",
"numpy.std",
"librosa.stft",
"librosa.amplitude_to_db",
"numpy.log1p",
"torch.FloatTensor"
] | [((883, 984), 'librosa.stft', 'librosa.stft', (['sound'], {'n_fft': 'self.n_fft', 'hop_length': 'self.hop_length', 'window': 'signal.windows.hamming'}), '(sound, n_fft=self.n_fft, hop_length=self.hop_length, window=\n signal.windows.hamming)\n', (895, 984), False, 'import librosa\n'), ((1005, 1027), 'librosa.magphas... |
# Generated by Django 2.0.2 on 2018-04-14 04:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0007_auto_20180324_1551'),
]
operations = [
migrations.AddField(
model_name='user',
name='token',
... | [
"django.db.models.CharField"
] | [((329, 373), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(100)'}), '(blank=True, max_length=100)\n', (345, 373), False, 'from django.db import migrations, models\n')] |
"""Views."""
from datetime import timedelta
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils import timezone
from django.views.generic import ListView
from django_ical.views import ICalFeed
from html2text import html2te... | [
"html2text.html2text",
"django.shortcuts.get_object_or_404",
"django.utils.timezone.now",
"rough_trade_calendar.models.Location.objects.get",
"django.urls.reverse",
"datetime.timedelta"
] | [((729, 793), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['models.Location'], {'slug': "self.kwargs['location']"}), "(models.Location, slug=self.kwargs['location'])\n", (746, 793), False, 'from django.shortcuts import get_object_or_404\n'), ((1366, 1408), 'rough_trade_calendar.models.Location.objects.g... |
import os
from os.path import join
from platform import system
from shutil import copy
from setuptools import setup
def main():
data_dir_path: str = {
'Windows': os.path.join(os.environ.get('LOCALAPPDATA', ''), 'dictCLI'),
'Linux': os.path.join(os.environ.get('HOME', ''), '.cache', 'dictCLI'),
... | [
"os.path.exists",
"os.path.join",
"setuptools.setup",
"os.environ.get",
"platform.system",
"os.mkdir"
] | [((356, 385), 'os.path.exists', 'os.path.exists', (['data_dir_path'], {}), '(data_dir_path)\n', (370, 385), False, 'import os\n'), ((1345, 1832), 'setuptools.setup', 'setup', ([], {'name': '"""dictcli"""', 'url': '"""https://www.github.com/Chaitanyabsprip/dictionaryCLI"""', 'author': '"""<NAME>"""', 'author_email': '""... |
import matplotlib.pyplot as plt
plt.style.use('fast')
def ReadFile(name, cols=2):
f = open(name, 'r')
ret = []
for i in range(cols):
ret.append([])
for line in f:
v = [float(i) for i in line.split()]
for i in range(cols):
ret[i].append(v[i])
if ret[1][-1] > ... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.minorticks_on",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((33, 54), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fast"""'], {}), "('fast')\n", (46, 54), True, 'import matplotlib.pyplot as plt\n'), ((795, 814), 'matplotlib.pyplot.minorticks_on', 'plt.minorticks_on', ([], {}), '()\n', (812, 814), True, 'import matplotlib.pyplot as plt\n'), ((815, 875), 'matplotlib.py... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import pyjson5
import simplejson
impo... | [
"pyjson5.load"
] | [((361, 384), 'pyjson5.load', 'pyjson5.load', (['sys.stdin'], {}), '(sys.stdin)\n', (373, 384), False, 'import pyjson5\n')] |
# coding=utf-8
# Copyright 2020 EM-NAT Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.reduce_sum",
"tensorflow.logging.set_verbosity",
"tensorflow.string_split",
"tensorflow.gfile.MakeDirs",
"tensorflow.Graph",
"models.utils.get_shape_list",
"argparse.ArgumentParser",
"tensorflow.train.init_from_checkpoint",
... | [((872, 927), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Scoring with NAT"""'}), "(description='Scoring with NAT')\n", (895, 927), False, 'import argparse\n'), ((2027, 2069), 'tensorflow.data.TextLineDataset', 'tf.data.TextLineDataset', (['source_input_file'], {}), '(source_input_fil... |
import pytest
import torch
from src.model.ops import Reshape
def test_reshape():
x = torch.empty(128, 100)
y = Reshape(-1, 1).forward(x)
assert y.size() == torch.Size([12800, 1])
| [
"src.model.ops.Reshape",
"torch.Size",
"torch.empty"
] | [((92, 113), 'torch.empty', 'torch.empty', (['(128)', '(100)'], {}), '(128, 100)\n', (103, 113), False, 'import torch\n'), ((171, 193), 'torch.Size', 'torch.Size', (['[12800, 1]'], {}), '([12800, 1])\n', (181, 193), False, 'import torch\n'), ((122, 136), 'src.model.ops.Reshape', 'Reshape', (['(-1)', '(1)'], {}), '(-1, ... |
import numpy as np
import nibabel as nib
import os
def squeezeNii(root, file):
img = nib.load(root + '/' + file)
newFile = file.replace('.nii','_temp.nii')
nib.save(nib.Nifti1Image(np.squeeze(img.dataobj),img.affine), root+'/'+newFile)
# This is to get the directory that the program
# is curre... | [
"numpy.squeeze",
"os.walk",
"nibabel.load"
] | [((466, 483), 'os.walk', 'os.walk', (['dir_path'], {}), '(dir_path)\n', (473, 483), False, 'import os\n'), ((95, 122), 'nibabel.load', 'nib.load', (["(root + '/' + file)"], {}), "(root + '/' + file)\n", (103, 122), True, 'import nibabel as nib\n'), ((201, 224), 'numpy.squeeze', 'np.squeeze', (['img.dataobj'], {}), '(im... |
from skaio.core.base.broker import BrokerBase
from skaio.core.base.serializer import TaskSerializer
from skaio.core.brokers.redis import RedisBroker
from skaio.core.serializers.pickle_serializer import PickleSerializer
from skaio.core.base.task import BaseTask
class Publisher:
def __init__(self, broker: BrokerBas... | [
"skaio.core.serializers.pickle_serializer.PickleSerializer",
"skaio.core.brokers.redis.RedisBroker.create"
] | [((396, 416), 'skaio.core.brokers.redis.RedisBroker.create', 'RedisBroker.create', ([], {}), '()\n', (414, 416), False, 'from skaio.core.brokers.redis import RedisBroker\n'), ((459, 477), 'skaio.core.serializers.pickle_serializer.PickleSerializer', 'PickleSerializer', ([], {}), '()\n', (475, 477), False, 'from skaio.co... |
import boto3
from urllib.parse import unquote
def get_targets_from_bucket(client, src_bucket):
"""
Find the 'TargetBucket' tag on a bucket and return
a list of all targets
"""
bucket_tagging = client.get_bucket_tagging(Bucket=src_bucket)
tags = bucket_tagging["TagSet"]
# Look for the 'Tar... | [
"boto3.client",
"urllib.parse.unquote"
] | [((851, 869), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (863, 869), False, 'import boto3\n'), ((973, 1011), 'urllib.parse.unquote', 'unquote', (["record['s3']['object']['key']"], {}), "(record['s3']['object']['key'])\n", (980, 1011), False, 'from urllib.parse import unquote\n')] |
from __future__ import print_function
import click
import json
import os
import cobra
import re
from gsmodutils.utils import StringIO
class ParseError(Exception):
pass
def load_scrumpy_model(filepath_or_string, name=None, model_id=None, media=None, objective_reactions=None,
obj_dir='mi... | [
"os.path.exists",
"click.argument",
"re.compile",
"click.option",
"cobra.io.save_json_model",
"os.path.join",
"os.path.abspath",
"cobra.Reaction",
"os.path.isfile",
"cobra.Metabolite",
"cobra.Model",
"json.load",
"click.command",
"gsmodutils.utils.StringIO"
] | [((9028, 9043), 'click.command', 'click.command', ([], {}), '()\n', (9041, 9043), False, 'import click\n'), ((9045, 9068), 'click.argument', 'click.argument', (['"""model"""'], {}), "('model')\n", (9059, 9068), False, 'import click\n'), ((9070, 9096), 'click.argument', 'click.argument', (['"""model_id"""'], {}), "('mod... |
import pandas as pd
#creating dataframe from files
insurance_df = pd.read_csv(filepath_or_buffer = '~/Downloads/insurance.csv', sep =',', header=0)
#print(insurance_df.to_string())
print(insurance_df[['age']])
print(insurance_df.columns)
print(insurance_df.index)
print(insurance_df.dtypes)
print(insurance_df.... | [
"pandas.read_csv"
] | [((68, 146), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': '"""~/Downloads/insurance.csv"""', 'sep': '""","""', 'header': '(0)'}), "(filepath_or_buffer='~/Downloads/insurance.csv', sep=',', header=0)\n", (79, 146), True, 'import pandas as pd\n')] |
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import numpy as np
def exponential(x, a, b):
return a * b**x
def get_curve_pars(d20, d21):
year = np.linspace(1, 120, num=120)
temp_20 = np.linspace(0, d20*100, num=100)
temp_21 = np.linspace(d20*101, d20*100 + d21*20, num=20)
... | [
"scipy.optimize.curve_fit",
"numpy.linspace",
"numpy.concatenate",
"numpy.diag"
] | [((179, 207), 'numpy.linspace', 'np.linspace', (['(1)', '(120)'], {'num': '(120)'}), '(1, 120, num=120)\n', (190, 207), True, 'import numpy as np\n'), ((222, 256), 'numpy.linspace', 'np.linspace', (['(0)', '(d20 * 100)'], {'num': '(100)'}), '(0, d20 * 100, num=100)\n', (233, 256), True, 'import numpy as np\n'), ((269, ... |
import random
import tkinter as tk
import math
class App:
def __init__(self):
self.window = tk.Tk()
self.window.title("linear_congruential_generator")
self.window.protocol("WM_DELETE_WINDOW", self.kill_callback)
self.window.geometry("300x300")
label = tk.Labe... | [
"tkinter.Entry",
"tkinter.Button",
"tkinter.Tk",
"tkinter.Scrollbar",
"tkinter.Label",
"tkinter.Frame",
"tkinter.Listbox"
] | [((115, 122), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (120, 122), True, 'import tkinter as tk\n'), ((313, 368), 'tkinter.Label', 'tk.Label', (['self.window'], {'text': '"""Xn+1 = (A * Xn + B) Mod M"""'}), "(self.window, text='Xn+1 = (A * Xn + B) Mod M')\n", (321, 368), True, 'import tkinter as tk\n'), ((437, 447), 'tk... |
"""
Serial Module
Uses "pySerial" Package
By: Computer Vision Zone
Website: https://www.computervision.zone/
"""
import serial
import time
import logging
import serial.tools.list_ports
class SerialObject:
"""
Allow to transmit data to a Serial Device like Arduino.
Example send $255255000
"""
def _... | [
"serial.Serial",
"serial.tools.list_ports.comports",
"logging.warning",
"time.sleep"
] | [((2210, 2223), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (2220, 2223), False, 'import time\n'), ((2274, 2287), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (2284, 2287), False, 'import time\n'), ((739, 773), 'serial.tools.list_ports.comports', 'serial.tools.list_ports.comports', ([], {}), '()\n', (771... |
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | [
"numpy.mean",
"numpy.ceil",
"numpy.random.choice",
"numpy.sum",
"numpy.zeros_like"
] | [((4039, 4068), 'numpy.zeros_like', 'np.zeros_like', (['bottom[0].data'], {}), '(bottom[0].data)\n', (4052, 4068), True, 'import numpy as np\n'), ((4260, 4274), 'numpy.mean', 'np.mean', (['whdrs'], {}), '(whdrs)\n', (4267, 4274), True, 'import numpy as np\n'), ((6038, 6071), 'numpy.sum', 'np.sum', (['comparisons[comp_l... |
import pandas as pd
import tempfile
from lib.aws_util.s3.download import download_from_s3
def read_csv_on_s3(bucket_name: str, obj: str) -> pd.DataFrame:
dir_ = tempfile.mkdtemp()
save_path = f'{dir_}/data.csv'
download_from_s3(bucket_name, obj, save_path)
return pd.read_csv(save_path) | [
"tempfile.mkdtemp",
"pandas.read_csv",
"lib.aws_util.s3.download.download_from_s3"
] | [((166, 184), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (182, 184), False, 'import tempfile\n'), ((220, 265), 'lib.aws_util.s3.download.download_from_s3', 'download_from_s3', (['bucket_name', 'obj', 'save_path'], {}), '(bucket_name, obj, save_path)\n', (236, 265), False, 'from lib.aws_util.s3.download i... |
import inspect
import textwrap
from typing import Dict
class DotDict(dict):
""" Allow accessing/setting dictionary attributes with dot notation (e.g., `mydict.foo`) """
def __getattr__(self, item):
if item not in self.keys():
raise KeyError(str(item))
return dict.get(self, item)
... | [
"inspect.stack"
] | [((1494, 1509), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1507, 1509), False, 'import inspect\n')] |
from django.contrib import admin
from .models import Factura, DetallesFactura, DescuentoCategoria, DescuentoSubCategoria, DescuentoProducto, PagosCredito, PagosDebito
# Register your models here.
admin.site.register(Factura)
admin.site.register(DetallesFactura)
admin.site.register(DescuentoCategoria)
admin.site.regist... | [
"django.contrib.admin.site.register"
] | [((197, 225), 'django.contrib.admin.site.register', 'admin.site.register', (['Factura'], {}), '(Factura)\n', (216, 225), False, 'from django.contrib import admin\n'), ((226, 262), 'django.contrib.admin.site.register', 'admin.site.register', (['DetallesFactura'], {}), '(DetallesFactura)\n', (245, 262), False, 'from djan... |
from .base import AbstractDataloader
from .negative_samplers import negative_sampler_factory
import torch
import torch.utils.data as data_utils
class BertUserMtlDataloader(AbstractDataloader):
def __init__(self, args, dataset):
"""
This is the data loader class for the personalised bidirectional ... | [
"torch.LongTensor",
"torch.FloatTensor",
"torch.utils.data.DataLoader"
] | [((2315, 2434), 'torch.utils.data.DataLoader', 'data_utils.DataLoader', (['dataset'], {'batch_size': 'self.args.train_batch_size', 'shuffle': '(True)', 'pin_memory': '(True)', 'num_workers': '(0)'}), '(dataset, batch_size=self.args.train_batch_size,\n shuffle=True, pin_memory=True, num_workers=0)\n', (2336, 2434), T... |
"""
Parse L2CAP packets
"""
import struct
from . import hci_acl
"""
Fixed channel ids for L2CAP packets
References can be found here:
* https://www.bluetooth.org/en-us/specification/adopted-specifications - Core specification 4.1
** [vol 3] Part A (Section 2.1) - Channel identifiers
"""
L2CAP_CID_NUL = 0x000... | [
"struct.unpack"
] | [((1890, 1920), 'struct.unpack', 'struct.unpack', (['"""<HH"""', 'data[:4]'], {}), "('<HH', data[:4])\n", (1903, 1920), False, 'import struct\n'), ((3819, 3856), 'struct.unpack', 'struct.unpack', (['"""<BBH"""', 'l2cap_data[:4]'], {}), "('<BBH', l2cap_data[:4])\n", (3832, 3856), False, 'import struct\n')] |
"""
Traffic.py
"""
__author__ = "<EMAIL>"
import numpy as np
from os import listdir
from re import split
from OU import OU
from helper import softmax
def natural_key(string_):
"""See http://www.codinghorror.com/blog/archives/001018.html"""
return [int(s) if s.isdigit() else s for s in split(r'(\d+)', string... | [
"numpy.random.normal",
"re.split",
"numpy.multiply",
"numpy.average",
"numpy.random.choice",
"numpy.random.exponential",
"numpy.fill_diagonal",
"numpy.split",
"numpy.outer",
"numpy.vstack",
"numpy.random.uniform",
"numpy.full",
"numpy.loadtxt",
"numpy.random.randn",
"OU.OU"
] | [((1266, 1314), 'OU.OU', 'OU', (['(1)', '(self.capacity / 2)', '(0.1)', '(self.capacity / 2)'], {}), '(1, self.capacity / 2, 0.1, self.capacity / 2)\n', (1268, 1314), False, 'from OU import OU\n'), ((1335, 1369), 'OU.OU', 'OU', (['(self.nodes_num ** 2)', '(1)', '(0.1)', '(1)'], {}), '(self.nodes_num ** 2, 1, 0.1, 1)\n'... |
from carrots import Microproducer
import datetime
rabbit_uri = 'amqp://rabbitmq:rabbitmq@localhost:5672/%2F'
mp = Microproducer(rabbit_uri,'','example.tasks')
ids = [{'id': i} for i in range(0,100000)]
before = datetime.datetime.now()
mp.send(ids)
print((datetime.datetime.now()-before).total_seconds()) | [
"datetime.datetime.now",
"carrots.Microproducer"
] | [((115, 161), 'carrots.Microproducer', 'Microproducer', (['rabbit_uri', '""""""', '"""example.tasks"""'], {}), "(rabbit_uri, '', 'example.tasks')\n", (128, 161), False, 'from carrots import Microproducer\n'), ((213, 236), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (234, 236), False, 'import dat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_data_frame
Tests for `data_frame` utils module.
"""
import unittest
import nose
import os
import pandas as pd
import datetime
from xlseries.utils.data_frame import get_data_frame, compare_period_ranges
from xlseries.utils.data_frame import get_data_frames, dfs_... | [
"datetime.datetime",
"xlseries.utils.data_frame.dfs_to_json_and_csv",
"xlseries.utils.data_frame.compare_period_ranges",
"os.path.join",
"os.path.dirname",
"xlseries.utils.data_frame.compare_data_frames",
"pandas.period_range",
"xlseries.utils.case_loaders.load_expected_case",
"nose.run"
] | [((4041, 4071), 'nose.run', 'nose.run', ([], {'defaultTest': '__name__'}), '(defaultTest=__name__)\n', (4049, 4071), False, 'import nose\n'), ((2545, 2575), 'datetime.datetime', 'datetime.datetime', (['(2015)', '(2)', '(16)'], {}), '(2015, 2, 16)\n', (2562, 2575), False, 'import datetime\n'), ((2590, 2619), 'datetime.d... |
from thebutton.genericstep import GenericStep
from datetime import datetime as dt
step_factories = {}
def step_factory(name):
def step_factory_impl(fn):
step_factories[name.lower()] = fn
return fn
return step_factory_impl
@step_factory("wait")
def wait(time):
yield GenericStep(time=tim... | [
"datetime.datetime.now",
"thebutton.genericstep.GenericStep"
] | [((300, 322), 'thebutton.genericstep.GenericStep', 'GenericStep', ([], {'time': 'time'}), '(time=time)\n', (311, 322), False, 'from thebutton.genericstep import GenericStep\n'), ((367, 392), 'thebutton.genericstep.GenericStep', 'GenericStep', ([], {'colour': '"""red"""'}), "(colour='red')\n", (378, 392), False, 'from t... |
# Copyright 2019 The resource-policy-evaluation-library Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | [
"urllib.parse.urlparse",
"googleapiclienthelpers.discovery.build_subresource",
"rpe.exceptions.InvalidRemediationSpecStep",
"rpe.exceptions.UnsupportedRemediationSpec",
"tenacity.wait_random_exponential",
"tenacity.retry_if_exception",
"tenacity.stop_after_attempt"
] | [((1907, 1968), 'googleapiclienthelpers.discovery.build_subresource', 'build_subresource', (['full_resource_path', 'self.version'], {}), '(full_resource_path, self.version, **kwargs)\n', (1924, 1968), False, 'from googleapiclienthelpers.discovery import build_subresource\n'), ((5964, 5977), 'urllib.parse.urlparse', 'ur... |
#!/usr/bin/env python
"""
Given a Tamil corpus segmented according to some Tamil-specific technique, what
percentage of tokens (or types) are covered by the multilingual M2M-100
vocabulary?
"""
import argparse
from collections import Counter
def count_tokens(corpora):
counts = Counter()
for corpus in corpor... | [
"collections.Counter",
"argparse.ArgumentParser"
] | [((286, 295), 'collections.Counter', 'Counter', ([], {}), '()\n', (293, 295), False, 'from collections import Counter\n'), ((584, 609), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (607, 609), False, 'import argparse\n')] |
"""LeNet 5"""
import torch
import torch.nn as nn
class LeNet5(nn.Module):
def __init__(self, num_classes=0):
super(LeNet5, self).__init__()
self.conv1 = _conv(1, 6)
self.conv2 = _conv(6, 16)
self.conv3 = _conv(16, 120)
self.pool = nn.AvgPool2d(2)
self.fc1 = _fc(120... | [
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.flatten"
] | [((278, 293), 'torch.nn.AvgPool2d', 'nn.AvgPool2d', (['(2)'], {}), '(2)\n', (290, 293), True, 'import torch.nn as nn\n'), ((345, 362), 'torch.nn.Linear', 'nn.Linear', (['(84)', '(10)'], {}), '(84, 10)\n', (354, 362), True, 'import torch.nn as nn\n'), ((422, 448), 'torch.nn.Linear', 'nn.Linear', (['(10)', 'num_classes']... |
"""
Ensure builds passed on Travis for current commit.
Because TravisPy is GPLv3 licensed this is a standalone program, the only
program that includes TravisPy in this repository and therefore only thing in
repository that is GPLv3 too.
"""
from subprocess import check_output
from travispy import TravisPy
def error... | [
"subprocess.check_output",
"travispy.TravisPy"
] | [((436, 446), 'travispy.TravisPy', 'TravisPy', ([], {}), '()\n', (444, 446), False, 'from travispy import TravisPy\n'), ((462, 504), 'subprocess.check_output', 'check_output', (["['git', 'rev-parse', 'HEAD']"], {}), "(['git', 'rev-parse', 'HEAD'])\n", (474, 504), False, 'from subprocess import check_output\n')] |
from django.urls import path
from account import views
app_name = 'account'
urlpatterns = [
path('smoke/', views.smoke, name='smoke'),
path('profile/<int:pk>/', views.MyProfile.as_view(), name='my-profile'),
path('contact-us/', views.ContactUs.as_view(), name='contact-us'),
path('signup/', views.Sign... | [
"account.views.LatestRates.as_view",
"account.views.SignUpView.as_view",
"account.views.Activate.as_view",
"account.views.MyProfile.as_view",
"account.views.ContactUs.as_view",
"account.views.RatesList.as_view",
"django.urls.path"
] | [((99, 140), 'django.urls.path', 'path', (['"""smoke/"""', 'views.smoke'], {'name': '"""smoke"""'}), "('smoke/', views.smoke, name='smoke')\n", (103, 140), False, 'from django.urls import path\n'), ((172, 197), 'account.views.MyProfile.as_view', 'views.MyProfile.as_view', ([], {}), '()\n', (195, 197), False, 'from acco... |
import urllib3
from MicrosoftApiModule import *
urllib3.disable_warnings()
OUTPUTS_PREFIX = "AADIdentityProtection"
BASE_URL = 'https://graph.microsoft.com/beta'
REQUIRED_PERMISSIONS = (
'offline_access', # allows device-flow login
'IdentityRiskEvent.Read.All',
'IdentityRiskyUser.ReadWrite.All'
)
DATE_FO... | [
"urllib3.disable_warnings"
] | [((49, 75), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (73, 75), False, 'import urllib3\n')] |
"""
This module abstract a single work date and deals with all the aspects of extracting data
and meta data about and from this specific date: gps data, determining if work day, holiday etc.
"""
import os
import datetime as dt
import platform
from random import randint
from math import isclose
import subprocess
import... | [
"os.path.exists",
"fastkml.kml.KML",
"twlog.TimeWatchLogger",
"time.sleep",
"platform.system",
"datetime.timedelta",
"datetime.datetime.strftime",
"random.randint",
"re.search"
] | [((400, 423), 'twlog.TimeWatchLogger', 'twlog.TimeWatchLogger', ([], {}), '()\n', (421, 423), False, 'import twlog\n'), ((3557, 3618), 're.search', 're.search', ([], {'pattern': 'ptn', 'string': "work_day['minimal_start_time']"}), "(pattern=ptn, string=work_day['minimal_start_time'])\n", (3566, 3618), False, 'import re... |
import numpy as np
import json
from PIL import Image
from pathlib import Path
import argparse
import os
def crop_images_bbox(input_dir,output_dir,anno_path, double_path = False):
with open(anno_path) as f:
anno = json.load(f)
imageid2filename = {}
for item in anno['images']:
imageid2filen... | [
"json.load",
"PIL.Image.open",
"argparse.ArgumentParser",
"pathlib.Path"
] | [((1293, 1359), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Cropping COCO images with bounding boxs"""'], {}), "('Cropping COCO images with bounding boxs')\n", (1316, 1359), False, 'import argparse\n'), ((1548, 1568), 'pathlib.Path', 'Path', (['args.coco_path'], {}), '(args.coco_path)\n', (1552, 1568), ... |
"""
Contains functions to manage shortcuts
"""
import wx
wx.ID_VOCAL = wx.NewId()
wx.ID_EDITOR_FOCUS = wx.NewId()
wx.ID_SHELL_FOCUS = wx.NewId()
wx.ID_TREE_FOCUS = wx.NewId()
def InitF6(frame):
"""F6 to navigate between regions
:param frame: see InitShorcuts->param
:type frame: idem
:return: ent... | [
"wx.NewId"
] | [((77, 87), 'wx.NewId', 'wx.NewId', ([], {}), '()\n', (85, 87), False, 'import wx\n'), ((109, 119), 'wx.NewId', 'wx.NewId', ([], {}), '()\n', (117, 119), False, 'import wx\n'), ((140, 150), 'wx.NewId', 'wx.NewId', ([], {}), '()\n', (148, 150), False, 'import wx\n'), ((170, 180), 'wx.NewId', 'wx.NewId', ([], {}), '()\n'... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CommandSystemDialog.ui'
#
# Created: Fri Jun 19 20:08:08 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... | [
"PyQt4.QtGui.QApplication",
"PyQt4.QtGui.QWidget",
"PyQt4.QtGui.QScrollArea",
"PyQt4.QtGui.QSizePolicy",
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QPushButton",
"PyQt4.QtGui.QTextBrowser",
"PyQt4.QtGui.QDialogButtonBox",
"PyQt4.QtCore.QRect",
"PyQt4.QtGui.... | [((89364, 89392), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (89382, 89392), False, 'from PyQt4 import QtCore, QtGui\n'), ((89419, 89434), 'PyQt4.QtGui.QWidget', 'QtGui.QWidget', ([], {}), '()\n', (89432, 89434), False, 'from PyQt4 import QtCore, QtGui\n'), ((494, 558), 'PyQt4... |
# -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.recovery.mallett2019` module.
"""
from __future__ import division, unicode_literals
import unittest
import numpy as np
from colour.characterisation import SDS_COLOURCHECKERS
from colour.colorimetry import (SpectralShape, MSDS_CMFS_STANDARD_OBSERVER,
... | [
"colour.recovery.spectral_primary_decomposition_Mallett2019",
"numpy.ones_like",
"numpy.testing.assert_array_less",
"colour.difference.delta_E_CIE1976",
"colour.models.XYZ_to_Lab",
"colour.colorimetry.SpectralShape",
"colour.colorimetry.sd_to_XYZ",
"colour.models.XYZ_to_RGB",
"unittest.main",
"num... | [((4307, 4322), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4320, 4322), False, 'import unittest\n'), ((1618, 1633), 'numpy.full', 'np.full', (['(3)', '(1.0)'], {}), '(3, 1.0)\n', (1625, 1633), True, 'import numpy as np\n'), ((3510, 3537), 'colour.colorimetry.SpectralShape', 'SpectralShape', (['(380)', '(730)'... |
import typing
from enum import Enum
from sensory_cloud.config import Config
from sensory_cloud.token_manager import ITokenManager, Metadata
import sensory_cloud.generated.v1.video.video_pb2_grpc as video_pb2_grpc
import sensory_cloud.generated.v1.video.video_pb2 as video_pb2
class VideoRequest(Enum):
video_pb2.... | [
"sensory_cloud.generated.v1.video.video_pb2_grpc.VideoModelsStub",
"sensory_cloud.generated.v1.video.video_pb2.CreateEnrollmentConfig",
"sensory_cloud.generated.v1.video.video_pb2_grpc.VideoBiometricsStub",
"sensory_cloud.generated.v1.video.video_pb2_grpc.VideoRecognitionStub",
"sensory_cloud.generated.v1.v... | [((2659, 2705), 'sensory_cloud.generated.v1.video.video_pb2_grpc.VideoModelsStub', 'video_pb2_grpc.VideoModelsStub', (['config.channel'], {}), '(config.channel)\n', (2689, 2705), True, 'import sensory_cloud.generated.v1.video.video_pb2_grpc as video_pb2_grpc\n'), ((2806, 2856), 'sensory_cloud.generated.v1.video.video_p... |
# Copyright 2021 Google LLC
#
# 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 in writing, ... | [
"tensorflow.norm",
"tensorflow.transpose",
"tensorflow.reshape"
] | [((1848, 1898), 'tensorflow.reshape', 'tf.reshape', (['activation', '[-1, activation.shape[-1]]'], {}), '(activation, [-1, activation.shape[-1]])\n', (1858, 1898), True, 'import tensorflow as tf\n'), ((1945, 1991), 'tensorflow.reshape', 'tf.reshape', (['expected', '[-1, expected.shape[-1]]'], {}), '(expected, [-1, expe... |
import enum
class AssetType(enum.Enum):
algo = enum.auto()
aggregate_algo = enum.auto()
aggregatetuple = enum.auto()
composite_algo = enum.auto()
composite_traintuple = enum.auto()
data_sample = enum.auto()
dataset = enum.auto()
objective = enum.auto()
node = enum.auto()
testtu... | [
"enum.auto"
] | [((53, 64), 'enum.auto', 'enum.auto', ([], {}), '()\n', (62, 64), False, 'import enum\n'), ((86, 97), 'enum.auto', 'enum.auto', ([], {}), '()\n', (95, 97), False, 'import enum\n'), ((119, 130), 'enum.auto', 'enum.auto', ([], {}), '()\n', (128, 130), False, 'import enum\n'), ((152, 163), 'enum.auto', 'enum.auto', ([], {... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import json
import numpy as np
from pprint import pprint
sys.path.append('../')
from main_human36 import main_human as main
# ordering of table 1 in the camera ready paper
# 1) 3d supervised - opt_row_sup
from opts.table_1.row_sup import opt as opt_... | [
"numpy.mean",
"os.makedirs",
"os.path.join",
"os.path.isdir",
"main_human36.main_human",
"sys.path.append",
"json.dump"
] | [((126, 148), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (141, 148), False, 'import sys\n'), ((1214, 1253), 'os.path.join', 'os.path.join', (['exp_opt.ckpt', 'exp_opt.exp'], {}), '(exp_opt.ckpt, exp_opt.exp)\n', (1226, 1253), False, 'import os\n'), ((1864, 1887), 'main_human36.main_human', ... |
# -*- coding: utf-8 -*-
from utils.statistics.online_statistics import movingmean
#more stable on big amount of data, due to operations with higher of accuracy
def best_variance(data):
n = len(data)
sum_sq = 0
for x in data:
sum_sq += x**2
mean_ = 0
for i in range(n):
mean_ = movin... | [
"utils.statistics.online_statistics.movingmean"
] | [((315, 348), 'utils.statistics.online_statistics.movingmean', 'movingmean', (['(i + 1)', 'data[i]', 'mean_'], {}), '(i + 1, data[i], mean_)\n', (325, 348), False, 'from utils.statistics.online_statistics import movingmean\n')] |
"""Query classes."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
import operator
import sys
from schevo.lib import optimize
from schevo import base
from schevo.constant import UNASSIGNED
import schevo.error
from schevo import field
from schevo.fieldspec import FieldMap, FieldSpecMap
from sc... | [
"schevo.label.plural",
"schevo.label.label",
"schevo.trace.log",
"schevo.field.set",
"schevo.fieldspec.FieldSpecMap",
"schevo.lib.odict.odict",
"schevo.meta.schema_metaclass",
"schevo.namespace.namespaceproperty",
"schevo.field.get",
"schevo.lib.optimize.bind_all"
] | [((642, 663), 'schevo.meta.schema_metaclass', 'schema_metaclass', (['"""Q"""'], {}), "('Q')\n", (658, 663), False, 'from schevo.meta import schema_metaclass\n'), ((19801, 19841), 'schevo.lib.optimize.bind_all', 'optimize.bind_all', (['sys.modules[__name__]'], {}), '(sys.modules[__name__])\n', (19818, 19841), False, 'fr... |
import torch
from training.branch.oneshot_experiments_helpers.base import PruningStrategy
class RandomPruning(PruningStrategy):
@staticmethod
def valid_name(strategy_name): return strategy_name == 'random'
def score(self, model, mask):
scores = {}
for i, k in enumerate(sorted(model.pruna... | [
"torch.Generator"
] | [((363, 380), 'torch.Generator', 'torch.Generator', ([], {}), '()\n', (378, 380), False, 'import torch\n')] |
from sklearn.metrics import f1_score, \
precision_score, recall_score, roc_auc_score, \
accuracy_score
import warnings
warnings.filterwarnings("ignore")
def scorer_f1(y_true,y_pred):
return f1_score(y_true,y_pred)
def scorer_precision(y_true,y_pred):
return precision_score(y_true,y_pred)
def scorer_recall(y... | [
"warnings.filterwarnings",
"sklearn.metrics.f1_score",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.accuracy_score"
] | [((119, 152), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (142, 152), False, 'import warnings\n'), ((196, 220), 'sklearn.metrics.f1_score', 'f1_score', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (204, 220), False, 'from sklearn.metrics import f1_score, precision_... |
# https://scikit-learn.org/stable/auto_examples/inspection/plot_permutation_importance_multicollinear.html#sphx-glr-auto-examples-inspection-plot-permutation-importance-multicollinear-py
# https://orbi.uliege.be/bitstream/2268/155642/1/louppe13.pdf
# https://proceedings.neurips.cc/paper/2019/file/702cafa3bb4c9c86e4a3b6... | [
"numpy.random.rand",
"sklearn.ensemble.ExtraTreesClassifier",
"scipy.cluster.hierarchy.fcluster",
"numpy.arange",
"numpy.mean",
"numpy.full_like",
"numpy.max",
"sklearn.inspection.permutation_importance",
"numpy.dot",
"numpy.random.seed",
"numpy.concatenate",
"numpy.min",
"pandas.DataFrame",... | [((1112, 1123), 'time.time', 'time.time', ([], {}), '()\n', (1121, 1123), False, 'import time\n'), ((1137, 1188), 'sklearn.model_selection.cross_val_score', 'cross_val_score', (['model', 'dataset_x', 'dataset_y'], {'cv': 'cv'}), '(model, dataset_x, dataset_y, cv=cv)\n', (1152, 1188), False, 'from sklearn.model_selectio... |
from .ff import ff_fn, plan_cost, first_goals
from misc.numerical import INF
from misc.functions import in_add
from planner.progression.best_first import a_star_search, best_first_search, deferred_best_first_search
def h_0(state, goal, operators):
return 0
def h_naive(state, goal, operators):
return sum(1 for ... | [
"planner.progression.best_first.best_first_search",
"misc.functions.in_add"
] | [((3117, 3181), 'planner.progression.best_first.best_first_search', 'best_first_search', (['initial', 'goal', 'generator', 'greedy'], {'stack': '(False)'}), '(initial, goal, generator, greedy, stack=False)\n', (3134, 3181), False, 'from planner.progression.best_first import a_star_search, best_first_search, deferred_be... |
import frappe
def execute():
for i in frappe.get_all('Asset',{'docstatus':1},['location','name','serial_no']):
if len(frappe.get_all('Asset Serial No',{'name':i.get("serial_no")})) == 0:
if i.get("serial_no"):
print("1111",i.get("serial_no"))
asset_... | [
"frappe.get_all",
"frappe.new_doc"
] | [((43, 119), 'frappe.get_all', 'frappe.get_all', (['"""Asset"""', "{'docstatus': 1}", "['location', 'name', 'serial_no']"], {}), "('Asset', {'docstatus': 1}, ['location', 'name', 'serial_no'])\n", (57, 119), False, 'import frappe\n'), ((329, 362), 'frappe.new_doc', 'frappe.new_doc', (['"""Asset Serial No"""'], {}), "('... |
# coding: utf-8
import pytest
if __name__ == "__main__":
# import os
# import sys
# sys.path.append(os.path.realpath('..'))
pytest.main([__file__])
from tests.import_check import ImportCheck
def test_single():
# from ooobuild.lo.document.filter_options_request import FilterOptionsRequest
# ns =... | [
"tests.import_check.ImportCheck",
"pytest.main"
] | [((140, 163), 'pytest.main', 'pytest.main', (['[__file__]'], {}), '([__file__])\n', (151, 163), False, 'import pytest\n'), ((467, 480), 'tests.import_check.ImportCheck', 'ImportCheck', ([], {}), '()\n', (478, 480), False, 'from tests.import_check import ImportCheck\n')] |
import numpy as np
def mark_label_on_pathways(name, pid, pw_map, gene_id_list, label=1):
"""Marks given genes to the pathways
Parameters
----------
name: str
pid: int
patient id
pw_map: map of networkx graphs of pathways
patient label mapping
gene_id_list: list of list of ... | [
"numpy.any"
] | [((781, 832), 'numpy.any', 'np.any', (["[(g in nd['uniprotids']) for g in gene_ids]"], {}), "([(g in nd['uniprotids']) for g in gene_ids])\n", (787, 832), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
from SkinningTools.UI.qt_util import *
from SkinningTools.UI.utils import *
from SkinningTools.Maya import interface, api
from SkinningTools.py23 import *
#@todo: make sure all cmds modules are moved over to interface/api
from maya import cmds
from maya.api import OpenMaya
from colle... | [
"SkinningTools.Maya.api.connectSelectionChangedCallback",
"SkinningTools.Maya.api.disconnectCallback",
"SkinningTools.UI.weightEditor.rightClickTableView.RightClickTableView",
"maya.cmds.selectMode",
"SkinningTools.Maya.tools.apiWeights.ApiWeights",
"copy.copy",
"SkinningTools.Maya.api.addCleanJoint",
... | [((37024, 37051), 'SkinningTools.Maya.interface.get_maya_window', 'interface.get_maya_window', ([], {}), '()\n', (37049, 37051), False, 'from SkinningTools.Maya import interface, api\n'), ((1403, 1415), 'SkinningTools.Maya.tools.apiWeights.ApiWeights', 'ApiWeights', ([], {}), '()\n', (1413, 1415), False, 'from Skinning... |
# -*- coding: UTF-8 -*-
#!/usr/bin/python3
"""
Language Discriminator
"""
#************************************************************
# Imported Libraries
#************************************************************
import torch
import torch.nn as nn
from .base_mlp import BaseMLP
import pdb
class XlingDiscrimin... | [
"torch.nn.BCEWithLogitsLoss",
"torch.ones_like",
"torch.zeros_like"
] | [((497, 541), 'torch.nn.BCEWithLogitsLoss', 'torch.nn.BCEWithLogitsLoss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (523, 541), False, 'import torch\n'), ((740, 758), 'torch.ones_like', 'torch.ones_like', (['o'], {}), '(o)\n', (755, 758), False, 'import torch\n'), ((789, 808), 'torch.zeros_like', 'torc... |
import datetime
def get_hours_in_seconds(hours):
return datetime.timedelta(hours=hours).seconds
def is_json_content(request):
return True if request.content_type == 'application/json' else False
def is_empty_content_length(request):
return True if request and request.content_length and request.content... | [
"datetime.timedelta"
] | [((62, 93), 'datetime.timedelta', 'datetime.timedelta', ([], {'hours': 'hours'}), '(hours=hours)\n', (80, 93), False, 'import datetime\n')] |
from src.base.tile import Tile
class TileLoader:
def __init__(self, bbox=None, image_api=None):
self.bbox = bbox
self.image_api = image_api
self.tile = None
def load_tile(self):
image = self.image_api.get_image(self.bbox)
self.tile = Tile(image, self.bbox)
retu... | [
"src.base.tile.Tile"
] | [((285, 307), 'src.base.tile.Tile', 'Tile', (['image', 'self.bbox'], {}), '(image, self.bbox)\n', (289, 307), False, 'from src.base.tile import Tile\n')] |
from utils import create_input_files
if __name__ == '__main__':
# Create input files (along with word map)
create_input_files(dataset='flickr8k',
karpathy_json_path=r"D:\Users\wt\Downloads\caption_datasets\dataset_flickr8k.json",
image_folder=r"D:\Users\wt\Download... | [
"utils.create_input_files"
] | [((116, 459), 'utils.create_input_files', 'create_input_files', ([], {'dataset': '"""flickr8k"""', 'karpathy_json_path': '"""D:\\\\Users\\\\wt\\\\Downloads\\\\caption_datasets\\\\dataset_flickr8k.json"""', 'image_folder': '"""D:\\\\Users\\\\wt\\\\Downloads\\\\image_caption\\\\flickr8k\\\\images"""', 'captions_per_image... |
import numpy as np
with open("input", "r") as f:
lines = f.readlines()
rules = {}
for i, line in enumerate(lines):
if line == "\n":
break
name, rest = line.strip().split(":")
range1, range2 = rest.split(" or ")
min1, max1 = range1.split("-")
min2, max2 = range2.split("-")
rules[na... | [
"numpy.array"
] | [((1066, 1087), 'numpy.array', 'np.array', (['valid_ticks'], {}), '(valid_ticks)\n', (1074, 1087), True, 'import numpy as np\n')] |
from suds.client import Client
from suds.plugin import MessagePlugin
from suds.cache import FileCache
from .http import HttpTransport
from . import settings
import logging
logger = logging.getLogger(__name__)
#: Cache of :class:`suds.client.Client <suds.client.Client>` objects
#: When unit-testing SOAP APIs it's pr... | [
"logging.getLogger"
] | [((183, 210), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (200, 210), False, 'import logging\n')] |
import random
import numpy as np
from collections import deque
class SumTree(object):
write = 0
def __init_(self,capacity):
self.capacity = capacity
self.tree = np.zeros(2*capacity -1 )
self.data = np.zeros(capacity, dtype=object)
def _propatate(self,idx, change):
pare... | [
"numpy.array",
"numpy.zeros",
"collections.deque",
"random.uniform"
] | [((191, 217), 'numpy.zeros', 'np.zeros', (['(2 * capacity - 1)'], {}), '(2 * capacity - 1)\n', (199, 217), True, 'import numpy as np\n'), ((236, 268), 'numpy.zeros', 'np.zeros', (['capacity'], {'dtype': 'object'}), '(capacity, dtype=object)\n', (244, 268), True, 'import numpy as np\n'), ((3047, 3078), 'numpy.array', 'n... |
from datetime import date
import block
import pytest
def test_parse():
sample = """
2006/10/15 McDonald's
Expenses:Dining $5.36
Assets:Checking
2007/01/01 * <NAME>
Expenses:Dining $5.36
Assets:Checking
Extra
Stuff
2013/01/01
Bank $10
Credit -$10
"""
blocks =... | [
"pytest.mark.skip",
"block.parse",
"datetime.date"
] | [((1075, 1093), 'pytest.mark.skip', 'pytest.mark.skip', ([], {}), '()\n', (1091, 1093), False, 'import pytest\n'), ((447, 465), 'datetime.date', 'date', (['(2006)', '(10)', '(15)'], {}), '(2006, 10, 15)\n', (451, 465), False, 'from datetime import date\n'), ((495, 511), 'datetime.date', 'date', (['(2007)', '(1)', '(1)'... |
#!/usr/bin/env python3
'''
Created on Oct 18, 2017
@author: arnon
'''
from sshpipe import SSHPipeHandler
import logging
from logging.handlers import SocketHandler
import pickle
import struct
mlogger = logging.getLogger(__file__)
class SSHPipeSocketHandler(SSHPipeHandler, SocketHandler):
''' SSHPipeSocketHandle... | [
"logging.getLogger",
"argparse.ArgumentParser",
"logging.handlers.SocketHandler.__init__",
"pickle.dumps",
"logging.handlers.SocketHandler.close",
"sshpipe.SSHPipeHandler.__init__",
"sshpipe.SSHPipeHandler.atexit"
] | [((204, 231), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (221, 231), False, 'import logging\n'), ((2080, 2105), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2103, 2105), False, 'import argparse\n'), ((450, 496), 'sshpipe.SSHPipeHandler.__init__', 'SSHPipeHa... |
import os
api_base = os.environ.get('GENOMELINK_API_BASE', 'https://genomelink.io')
from genomelink.oauth import OAuth
from genomelink.resource.report import Report
| [
"os.environ.get"
] | [((21, 83), 'os.environ.get', 'os.environ.get', (['"""GENOMELINK_API_BASE"""', '"""https://genomelink.io"""'], {}), "('GENOMELINK_API_BASE', 'https://genomelink.io')\n", (35, 83), False, 'import os\n')] |
class Solution:
MOVES = [[1, 0], [0, 1], [-1, 0], [0, -1]]
"""
@param grid: a boolean 2D matrix
@return: an integer
"""
def numIslands(self, grid):
self.n = len(grid)
if self.n == 0: return 0
self.m = len(grid[0])
if self.m == 0: return 0
self.grid = g... | [
"queue.Queue"
] | [((732, 739), 'queue.Queue', 'Queue', ([], {}), '()\n', (737, 739), False, 'from queue import Queue\n')] |
import qrcode
qr=qrcode.QRCode(
version=1,
box_size=10,
border=1
)
name = input("Your Name: ")
about = input("About You: ")
email = input("Email ID: ")
contact_no = input("Contact No: ")
website = input("Website Link: ")
data = "Name: " + name + "\n\nAbout: " + about + "\n\nEmail: " + email + "\n\nContact: " + co... | [
"qrcode.QRCode"
] | [((17, 64), 'qrcode.QRCode', 'qrcode.QRCode', ([], {'version': '(1)', 'box_size': '(10)', 'border': '(1)'}), '(version=1, box_size=10, border=1)\n', (30, 64), False, 'import qrcode\n')] |
import asyncio
# import spec_checker.modules.fast_speedtest as fast
from spec_checker.modules.speedtest_net import Speedtest
from spec_checker.modules.utilities import truncate
# from main import speed_stage
from PyQt5.QtCore import QObject, QThread, pyqtSignal, QTimer
from asyncqt import asyncSlot
import asyncio
impo... | [
"pythoncom.CoInitialize"
] | [((333, 357), 'pythoncom.CoInitialize', 'pythoncom.CoInitialize', ([], {}), '()\n', (355, 357), False, 'import pythoncom\n')] |
#!/usr/bin/env python
__description__ = 'msi plugin for oledump.py'
__author__ = '<NAME>'
__version__ = '0.0.1'
__date__ = '2018/02/18'
"""
Source code put in public domain by Didier Stevens, no Copyright
https://DidierStevens.com
Use at your own risk
History:
2018/02/18: start
Todo:
"""
import binascii
import ... | [
"hashlib.md5"
] | [((1327, 1351), 'hashlib.md5', 'hashlib.md5', (['self.stream'], {}), '(self.stream)\n', (1338, 1351), False, 'import hashlib\n')] |
# -*- coding: utf-8 -*-
from typing import Optional
import uvicorn
from fastapi import FastAPI, Query, Path, Response
from rarbg import *
tags_metadata = [
{
"name": "Search",
"externalDocs": {
"description": "Available Categories",
"url": "https://github.com/Apocalypsor/... | [
"fastapi.FastAPI",
"fastapi.Response",
"uvicorn.run",
"fastapi.Query",
"fastapi.Path"
] | [((411, 475), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""Customed RARBG feed"""', 'openapi_tags': 'tags_metadata'}), "(title='Customed RARBG feed', openapi_tags=tags_metadata)\n", (418, 475), False, 'from fastapi import FastAPI, Query, Path, Response\n'), ((588, 618), 'fastapi.Path', 'Path', (['...'], {'descripti... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from drforest.datasets import make_simulation1
from drforest.ensemble import DimensionReductionForestRegressor
from drforest.ensemble import permutation_importance
plt.rc('... | [
"matplotlib.pyplot.subplots_adjust",
"numpy.arange",
"drforest.datasets.make_simulation1",
"drforest.ensemble.DimensionReductionForestRegressor",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"numpy.sign",
"numpy.meshgrid",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.rc"
] | [((312, 342), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (318, 342), True, 'import matplotlib.pyplot as plt\n'), ((398, 490), 'drforest.datasets.make_simulation1', 'make_simulation1', ([], {'n_samples': 'n_samples', 'noise': '(1)', 'n_features': 'n_featu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 7
@author: maita
Creates label geojson for the VG250 admin geometries
"""
import geopandas as gpd
# define the points layers
out_path = "/home/maita/Nextcloud/Documents/Work/Gap_Map/out/"
pointfiles = {"all":out_path + "nstops.csv",
... | [
"geopandas.GeoDataFrame",
"geopandas.read_file"
] | [((769, 868), 'geopandas.GeoDataFrame', 'gpd.GeoDataFrame', ([], {'columns': "['label', 'level', 'centroid']", 'geometry': '"""centroid"""', 'crs': '"""epsg:3857"""'}), "(columns=['label', 'level', 'centroid'], geometry=\n 'centroid', crs='epsg:3857')\n", (785, 868), True, 'import geopandas as gpd\n'), ((1017, 1041)... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... | [
"netius.get_loop",
"os.makedirs",
"aiohttp.ClientSession"
] | [((2777, 2806), 'netius.get_loop', 'netius.get_loop', ([], {'_compat': '(True)'}), '(_compat=True)\n', (2792, 2806), False, 'import netius\n'), ((2812, 2849), 'os.makedirs', 'os.makedirs', (['"""players"""'], {'exist_ok': '(True)'}), "('players', exist_ok=True)\n", (2823, 2849), False, 'import os\n'), ((1952, 1975), 'a... |
"""Custom Django model fields"""
import ipaddress
from typing import Optional, Union
from django.db import models
from django.core.exceptions import ValidationError
from django.forms import CharField
from peering_coord.scion_addr import ASN
IpAddress = Union[ipaddress.IPv4Address, ipaddress.IPv6Address]
IpNetwork ... | [
"ipaddress.ip_network",
"ipaddress.ip_address",
"peering_coord.scion_addr.ASN",
"django.core.exceptions.ValidationError"
] | [((909, 919), 'peering_coord.scion_addr.ASN', 'ASN', (['value'], {}), '(value)\n', (912, 919), False, 'from peering_coord.scion_addr import ASN\n'), ((1217, 1227), 'peering_coord.scion_addr.ASN', 'ASN', (['value'], {}), '(value)\n', (1220, 1227), False, 'from peering_coord.scion_addr import ASN\n'), ((2594, 2621), 'ipa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file
Self-contained Python program for benchmarking sorting algorithms.
Original code for the sorting functions available at:
http://danishmujeeb.com/blog/2014/01/basic-sorting-algorithms-implemented-in-python/
http://interactivepython.org/runestone/static/pythonds/... | [
"random.randint",
"random.seed",
"sys.exit"
] | [((3565, 3582), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (3576, 3582), False, 'import random\n'), ((3053, 3065), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (3061, 3065), False, 'import sys\n'), ((3600, 3630), 'random.randint', 'random.randint', (['(0)', '(2 ** 31 - 1)'], {}), '(0, 2 ** 31 - 1)\n... |
import socket
import time
import langfile
def ex(args, message, client, invoke):
args_out = ""
if len(args) > 0:
args_out = "\n\n*Attatched arguments %s*" % args.__str__()[1:-1].replace("'", "")
argstr = args.__str__()[1:-1].replace("'", "")
client_socket = socket.socket(socket.AF_INET... | [
"time.sleep",
"socket.socket"
] | [((292, 341), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (305, 341), False, 'import socket\n'), ((639, 652), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (649, 652), False, 'import time\n')] |
import argparse
import os
import sys
import codecs
import gzip
import time
from operator import itemgetter
from process_dict import *
def clean_exit(config):
""" Triggers a clean exit, with removal of in-process files, when Control-C is pressed. """
print("Canceling!\nRemoving partial files.\n")
cleanup(c... | [
"sys.stdout.flush",
"os.path.exists",
"time.localtime",
"argparse.ArgumentParser",
"os.makedirs",
"time.clock",
"os.rename",
"gzip.open",
"sys.stdout.write",
"os.path.isfile",
"operator.itemgetter",
"codecs.open",
"os.remove"
] | [((1479, 1514), 'codecs.open', 'codecs.open', (['filename', '"""r"""', '"""utf-8"""'], {}), "(filename, 'r', 'utf-8')\n", (1490, 1514), False, 'import codecs\n'), ((1796, 1840), 'codecs.open', 'codecs.open', (["(filename + '.tmp')", '"""w"""', '"""utf-8"""'], {}), "(filename + '.tmp', 'w', 'utf-8')\n", (1807, 1840), Fa... |
"""
Test plain variable substitution in file names
"""
import os
import shutil
from textxjinja import textx_jinja_generator
def test_basic():
this_folder = os.path.dirname(__file__)
template_folder = os.path.join(this_folder, 'templates')
output_folder = os.path.join(this_folder, 'output')
# Remove o... | [
"os.path.dirname",
"textxjinja.textx_jinja_generator",
"os.path.join",
"shutil.rmtree"
] | [((162, 187), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (177, 187), False, 'import os\n'), ((210, 248), 'os.path.join', 'os.path.join', (['this_folder', '"""templates"""'], {}), "(this_folder, 'templates')\n", (222, 248), False, 'import os\n'), ((269, 304), 'os.path.join', 'os.path.join'... |
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
from typing import Optional, Tuple, Any
from torch import Tensor
from utils.tensor_utils import tensor_to_python_float
from .topk_accuracy import top_k_accuracy
from .intersection_over_union import compute_miou_ba... | [
"utils.tensor_utils.tensor_to_python_float"
] | [((701, 761), 'utils.tensor_utils.tensor_to_python_float', 'tensor_to_python_float', (['loss'], {'is_distributed': 'use_distributed'}), '(loss, is_distributed=use_distributed)\n', (723, 761), False, 'from utils.tensor_utils import tensor_to_python_float\n'), ((1229, 1294), 'utils.tensor_utils.tensor_to_python_float', '... |
from django.urls import path
from . import views
urlpatterns = [
path('phonebanking/', views.phonebanking, name='phonebanking'),
path('about-us/', views.about, name='about'),
path('mission-statement/', views.mission, name='mission'),
path('by-laws/', views.by_laws, name='by_laws'),
path('issues/', ... | [
"django.urls.path"
] | [((70, 132), 'django.urls.path', 'path', (['"""phonebanking/"""', 'views.phonebanking'], {'name': '"""phonebanking"""'}), "('phonebanking/', views.phonebanking, name='phonebanking')\n", (74, 132), False, 'from django.urls import path\n'), ((138, 182), 'django.urls.path', 'path', (['"""about-us/"""', 'views.about'], {'n... |
import sys
sys.path.append('/home/kevinlad/icra_ws/src/local_planner_py/scripts')
sys.path.append('/home/kevinlad/icra_ws/src/local_planner_py/scripts/envs')
| [
"sys.path.append"
] | [((11, 81), 'sys.path.append', 'sys.path.append', (['"""/home/kevinlad/icra_ws/src/local_planner_py/scripts"""'], {}), "('/home/kevinlad/icra_ws/src/local_planner_py/scripts')\n", (26, 81), False, 'import sys\n'), ((82, 157), 'sys.path.append', 'sys.path.append', (['"""/home/kevinlad/icra_ws/src/local_planner_py/script... |