code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
"""
Base-Client Class
This is the parent-class of all client-classes and holds properties and functions they all depend on.
Author: <NAME>
"""
import src.util.debugger as Debugger
import src.util.configmaker as configmaker
class BaseClient(object):
"""Base-Client Class"""
def __init__(... | [
"src.util.debugger.Debugger",
"src.util.configmaker.getConfig"
] | [((392, 420), 'src.util.debugger.Debugger', 'Debugger.Debugger', (['debugFlag'], {}), '(debugFlag)\n', (409, 420), True, 'import src.util.debugger as Debugger\n'), ((562, 607), 'src.util.configmaker.getConfig', 'configmaker.getConfig', (['configpath', 'configtype'], {}), '(configpath, configtype)\n', (583, 607), True, ... |
# -*- coding: utf-8 -*-
import sys
from cryptomon.common import Colors
if sys.version_info >= (3, 0):
import io
else:
import StringIO as io
ascii_title = """
/$$$$$$ /$$ /$$ /$$
/$$__ $$ | $$ ... | [
"StringIO.StringIO"
] | [((1247, 1265), 'StringIO.StringIO', 'io.StringIO', (['title'], {}), '(title)\n', (1258, 1265), True, 'import StringIO as io\n')] |
import cv2
video=cv2.VideoCapture(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.mp4')
#pre trained pedestrian and car classifier
car_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\car.xml')
pedestrian_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.x... | [
"cv2.rectangle",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.waitKey"
] | [((18, 114), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""C:\\\\Users\\\\ISHITA\\\\Desktop\\\\ML project\\\\UEM_PROJECT_COM\\\\pedestrian.mp4"""'], {}), "(\n 'C:\\\\Users\\\\ISHITA\\\\Desktop\\\\ML project\\\\UEM_PROJECT_COM\\\\pedestrian.mp4')\n", (34, 114), False, 'import cv2\n'), ((374, 413), 'cv2.CascadeClassif... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
#
# Distributed under terms of the MIT license.
"""
Strategy base class
"""
from abc import ABCMeta, abstractmethod
from tinydb import TinyDB, Query
from node import Node
import json
class Strategy(object):
def __init__(self, this_controller, thi... | [
"tinydb.Query",
"node.Node",
"tinydb.TinyDB"
] | [((449, 470), 'tinydb.TinyDB', 'TinyDB', (['"""ledger.json"""'], {}), "('ledger.json')\n", (455, 470), False, 'from tinydb import TinyDB, Query\n'), ((489, 509), 'tinydb.TinyDB', 'TinyDB', (['"""nodes.json"""'], {}), "('nodes.json')\n", (495, 509), False, 'from tinydb import TinyDB, Query\n'), ((857, 915), 'node.Node',... |
#-*- encoding:utf-8 -*-
from __future__ import print_function
import sys
try:
reload(sys)
sys.setdefaultencoding('utf-8')
except:
pass
import codecs
from textrank4zh import TextRank4Keyword, TextRank4Sentence
text = codecs.open('../test/doc/01.txt', 'r', 'utf-8').read()
tr4w = TextRank4Keyword()
tr4w.an... | [
"codecs.open",
"sys.setdefaultencoding",
"textrank4zh.TextRank4Sentence",
"textrank4zh.TextRank4Keyword"
] | [((293, 311), 'textrank4zh.TextRank4Keyword', 'TextRank4Keyword', ([], {}), '()\n', (309, 311), False, 'from textrank4zh import TextRank4Keyword, TextRank4Sentence\n'), ((647, 666), 'textrank4zh.TextRank4Sentence', 'TextRank4Sentence', ([], {}), '()\n', (664, 666), False, 'from textrank4zh import TextRank4Keyword, Text... |
import random
import uuid
import sys
import json
from faker import Factory
from faker.providers.person.fi_FI import Provider as PersonProvider
fake = Factory.create('fi_FI')
email_by_user = {}
users_by_id = {}
def anonymize_users(users):
usernames = set()
emails = set()
for data in users:
if data... | [
"json.load",
"faker.Factory.create",
"json.dump",
"uuid.uuid4"
] | [((151, 174), 'faker.Factory.create', 'Factory.create', (['"""fi_FI"""'], {}), "('fi_FI')\n", (165, 174), False, 'from faker import Factory\n'), ((1731, 1751), 'json.load', 'json.load', (['sys.stdin'], {}), '(sys.stdin)\n', (1740, 1751), False, 'import json\n'), ((1795, 1832), 'json.dump', 'json.dump', (['data', 'sys.s... |
import random
from typing import Optional, Tuple, Union
import numpy as np
import torch
from torch import Tensor
from torch_geometric.utils import coalesce, degree, remove_self_loops
from .num_nodes import maybe_num_nodes
def negative_sampling(edge_index: Tensor,
num_nodes: Optional[Union[int... | [
"torch.split",
"torch_geometric.utils.degree",
"torch.all",
"torch.stack",
"numpy.isin",
"torch.from_numpy",
"torch_geometric.utils.remove_self_loops",
"torch.arange",
"torch_geometric.utils.coalesce",
"torch.cat"
] | [((5711, 5748), 'torch.split', 'torch.split', (['edge_index', 'split'], {'dim': '(1)'}), '(edge_index, split, dim=1)\n', (5722, 5748), False, 'import torch\n'), ((5764, 5799), 'torch_geometric.utils.degree', 'degree', (['src_batch'], {'dtype': 'torch.long'}), '(src_batch, dtype=torch.long)\n', (5770, 5799), False, 'fro... |
import sys
if sys.version_info[:2] >= (3, 0):
# pylint: disable=E0611,F0401,I0011
from urllib.request import build_opener
else:
from urllib2 import build_opener
from . import __version__
urls = {
'gdata': "https://www.googleapis.com/youtube/v3/",
'watchv': "http://www.youtube.com/watch?v=%s",
... | [
"urllib2.build_opener"
] | [((906, 920), 'urllib2.build_opener', 'build_opener', ([], {}), '()\n', (918, 920), False, 'from urllib2 import build_opener\n')] |
from tkinter import *
from PIL import ImageGrab
import numpy as np
import cv2
import time
import pyautogui as pg
import DirectInputRoutines as DIR
from LogKey import key_check
last_time = time.time()
one_hot = [0, 0, 0, 0, 0, 0]
hash_dict = {'w':0, 's':1, 'a':2, 'd':3, 'c':4, 'v':5}
X = []
y = []
def a... | [
"cv2.fillPoly",
"pyautogui.hotkey",
"numpy.median",
"cv2.GaussianBlur",
"PIL.ImageGrab.grab",
"cv2.line",
"numpy.zeros_like",
"cv2.bitwise_and",
"numpy.array",
"cv2.cvtColor",
"cv2.Canny",
"time.time",
"numpy.save"
] | [((196, 207), 'time.time', 'time.time', ([], {}), '()\n', (205, 207), False, 'import time\n'), ((3513, 3532), 'numpy.save', 'np.save', (['"""X.npy"""', 'X'], {}), "('X.npy', X)\n", (3520, 3532), True, 'import numpy as np\n'), ((3534, 3553), 'numpy.save', 'np.save', (['"""y.npy"""', 'y'], {}), "('y.npy', y)\n", (3541, 3... |
# Generated by Django 2.2.5 on 2019-10-05 23:22
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Password',
fields=[
('id', models.IntegerFi... | [
"django.db.models.DateTimeField",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((304, 371), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)', 'unique': '(True)'}), '(primary_key=True, serialize=False, unique=True)\n', (323, 371), False, 'from django.db import migrations, models\n'), ((402, 434), 'django.db.models.CharField', 'models.Ch... |
import pytest
from onnx import TensorProto
from onnx import helper as oh
import finn.core.onnx_exec as oxe
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.streamline.reorder import MoveTransposePastJoinAdd
from finn.util.basic import gen_finn_dt_tensor
def create_model(perm):
if perm ==... | [
"onnx.helper.make_graph",
"onnx.helper.make_node",
"finn.core.onnx_exec.compare_execution",
"finn.util.basic.gen_finn_dt_tensor",
"onnx.helper.make_tensor_value_info",
"onnx.helper.make_model",
"pytest.mark.parametrize",
"finn.transformation.streamline.reorder.MoveTransposePastJoinAdd",
"finn.core.m... | [((1846, 1907), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""perm"""', '[[0, 3, 1, 2], [0, 2, 3, 1]]'], {}), "('perm', [[0, 3, 1, 2], [0, 2, 3, 1]])\n", (1869, 1907), False, 'import pytest\n'), ((533, 628), 'onnx.helper.make_node', 'oh.make_node', (['"""Transpose"""'], {'inputs': "['in_transpose1']", 'ou... |
import quandl
import math
import numpy as np
from sklearn import preprocessing, cross_validation, svm
from sklearn.linear_model import LinearRegression
import pickle
import datetime
from matplotlib import style
import matplotlib.pyplot as plot
# Config
isLoadFromLocal = True
quandl.ApiConfig.api_key = '<KEY>'
style.us... | [
"datetime.datetime.fromtimestamp",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.style.use",
"quandl.get",
"sklearn.cross_validation.train_test_split",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.scale",
"matplo... | [((312, 331), 'matplotlib.style.use', 'style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (321, 331), False, 'from matplotlib import style\n'), ((1072, 1094), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['x'], {}), '(x)\n', (1091, 1094), False, 'from sklearn import preprocessing, cross_validation, svm\n'), ... |
import random
import sys
ntables = 100
ncols = 100
nrows = 10000
def printstderr(s):
sys.stderr.write(s + '\n')
sys.stderr.flush()
def get_value():
return random.randint(-99999999, 99999999)
for t in range(ntables):
printstderr(f'{t}/{ntables}')
print(f"create table x ({','.join(['x int'] * ncols)});")
... | [
"sys.stderr.write",
"sys.stderr.flush",
"random.randint"
] | [((89, 115), 'sys.stderr.write', 'sys.stderr.write', (["(s + '\\n')"], {}), "(s + '\\n')\n", (105, 115), False, 'import sys\n'), ((118, 136), 'sys.stderr.flush', 'sys.stderr.flush', ([], {}), '()\n', (134, 136), False, 'import sys\n'), ((164, 199), 'random.randint', 'random.randint', (['(-99999999)', '(99999999)'], {})... |
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routes import items
import config
from constants import *
config.parse_args()
app = FastAPI(
title="API",
description="API boilerplate",
version="1.0.0",
openapi_tags=API_TAGS_METADATA,
)
app.add_midd... | [
"fastapi.FastAPI",
"config.parse_args"
] | [((161, 180), 'config.parse_args', 'config.parse_args', ([], {}), '()\n', (178, 180), False, 'import config\n'), ((187, 291), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""API"""', 'description': '"""API boilerplate"""', 'version': '"""1.0.0"""', 'openapi_tags': 'API_TAGS_METADATA'}), "(title='API', description='API... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.html import mark_safe
# Create your models here.
class Gellifinsta(models.Model):
class Meta:
ordering = ['-taken_at_datetime']
shortcode = models.CharField(_("Shortcode"), max_length=20)
taken_... | [
"django.utils.translation.ugettext_lazy",
"django.utils.html.mark_safe"
] | [((279, 293), 'django.utils.translation.ugettext_lazy', '_', (['"""Shortcode"""'], {}), "('Shortcode')\n", (280, 293), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((355, 368), 'django.utils.translation.ugettext_lazy', '_', (['"""taken at"""'], {}), "('taken at')\n", (356, 368), True, 'from djang... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-01-16 13:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scanBase', '0002_auto_20180116_1321'),
]
operations ... | [
"django.db.models.GenericIPAddressField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((430, 523), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (446, 523), False, 'from django.db import migrations, models\... |
import unittest
from nanoservice import Responder
from nanoservice import Requester
class BaseTestCase(unittest.TestCase):
def setUp(self):
addr = 'inproc://test'
self.client = Requester(addr)
self.service = Responder(addr)
self.service.register('divide', lambda x, y: x / y)
... | [
"unittest.main",
"nanoservice.Requester",
"nanoservice.Responder"
] | [((1743, 1758), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1756, 1758), False, 'import unittest\n'), ((201, 216), 'nanoservice.Requester', 'Requester', (['addr'], {}), '(addr)\n', (210, 216), False, 'from nanoservice import Requester\n'), ((240, 255), 'nanoservice.Responder', 'Responder', (['addr'], {}), '(ad... |
import unittest
class LexerTestCase(unittest.TestCase):
def makeLexer(self, text):
from spi import Lexer
lexer = Lexer(text)
return lexer
def test_tokens(self):
from spi import TokenType
records = (
('234', TokenType.INTEGER_CONST, 234),
('3.14'... | [
"spi.Lexer",
"spi.SemanticAnalyzer",
"spi.Interpreter",
"unittest.main",
"spi.Parser"
] | [((9013, 9028), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9026, 9028), False, 'import unittest\n'), ((135, 146), 'spi.Lexer', 'Lexer', (['text'], {}), '(text)\n', (140, 146), False, 'from spi import Lexer, Parser, SemanticAnalyzer, Interpreter\n'), ((1535, 1546), 'spi.Lexer', 'Lexer', (['text'], {}), '(text)... |
from pygame import Surface, font
from copy import copy
from random import randint, choice
import string
from lib.transactionButton import TransactionButton
SHOP_PREFIX = ["archer", "baker", "fisher", "miller", "rancher", "robber"]
SHOP_SUFFIX = ["cave", "creek", "desert", "farm", "field", "forest", "hill", "lake", "m... | [
"random.choice",
"pygame.Surface",
"copy.copy",
"lib.transactionButton.TransactionButton",
"pygame.font.Font",
"random.randint"
] | [((1236, 1271), 'pygame.font.Font', 'font.Font', (['"""res/fonts/west.ttf"""', '(17)'], {}), "('res/fonts/west.ttf', 17)\n", (1245, 1271), False, 'from pygame import Surface, font\n'), ((1290, 1325), 'pygame.font.Font', 'font.Font', (['"""res/fonts/west.ttf"""', '(15)'], {}), "('res/fonts/west.ttf', 15)\n", (1299, 1325... |
import tkinter.messagebox
from tkinter import *
import tkinter as tk
from tkinter import filedialog
import numpy
import pytesseract #Python wrapper for Google-owned OCR engine known by the name of Tesseract.
import cv2
from PIL import Image, ImageTk
import os
root = tk.Tk()
root.title("Object Character Recognizer")
ro... | [
"tkinter.LabelFrame",
"PIL.Image.open",
"cv2.threshold",
"cv2.medianBlur",
"tkinter.Button",
"os.getcwd",
"numpy.array",
"tkinter.Tk",
"tkinter.Label",
"pytesseract.image_to_string",
"cv2.cvtColor"
] | [((268, 275), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (273, 275), True, 'import tkinter as tk\n'), ((3726, 3783), 'tkinter.LabelFrame', 'tk.LabelFrame', (['root'], {'text': '"""Image:"""', 'width': '(768)', 'height': '(600)'}), "(root, text='Image:', width=768, height=600)\n", (3739, 3783), True, 'import tkinter as tk... |
# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient h... | [
"numpy.eye",
"libceed.Ceed",
"numpy.allclose",
"numpy.sqrt",
"check.output",
"numpy.float32"
] | [((1674, 1701), 'libceed.Ceed', 'libceed.Ceed', (['ceed_resource'], {}), '(ceed_resource)\n', (1686, 1701), False, 'import libceed\n'), ((2155, 2182), 'libceed.Ceed', 'libceed.Ceed', (['ceed_resource'], {}), '(ceed_resource)\n', (2167, 2182), False, 'import libceed\n'), ((2857, 2884), 'libceed.Ceed', 'libceed.Ceed', ([... |
from YouTubeFacesDB import generate_ytf_database
###############################################################################
# Create the dataset
###############################################################################
generate_ytf_database(
directory= '../data',#'/scratch/vitay/Datasets/YouTubeFaces'... | [
"YouTubeFacesDB.generate_ytf_database"
] | [((231, 383), 'YouTubeFacesDB.generate_ytf_database', 'generate_ytf_database', ([], {'directory': '"""../data"""', 'filename': '"""ytfdb.h5"""', 'labels': '(10)', 'max_number': '(-1)', 'size': '(100, 100)', 'color': '(False)', 'bw_first': '(True)', 'cropped': '(True)'}), "(directory='../data', filename='ytfdb.h5', labe... |
from freezegun import freeze_time
from rest_framework import test
from waldur_mastermind.billing.tests.utils import get_financial_report_url
from waldur_mastermind.invoices import models as invoice_models
from waldur_mastermind.invoices.tests import factories as invoice_factories
from waldur_mastermind.invoices.tests ... | [
"waldur_mastermind.invoices.tests.fixtures.InvoiceFixture",
"freezegun.freeze_time",
"waldur_mastermind.invoices.tests.factories.InvoiceItemFactory",
"waldur_mastermind.billing.tests.utils.get_financial_report_url"
] | [((359, 384), 'freezegun.freeze_time', 'freeze_time', (['"""2017-01-10"""'], {}), "('2017-01-10')\n", (370, 384), False, 'from freezegun import freeze_time\n'), ((482, 515), 'waldur_mastermind.invoices.tests.fixtures.InvoiceFixture', 'invoice_fixtures.InvoiceFixture', ([], {}), '()\n', (513, 515), True, 'from waldur_ma... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | [
"tests.test_cli.tools_for_testing.ConfigLoaderMock",
"click.ClickException",
"aea.cli.utils.package_utils.validate_package_name",
"jsonschema.ValidationError",
"unittest.mock.patch",
"aea.cli.utils.generic.is_readme_present",
"aea.cli.utils.package_utils.try_get_item_source_path",
"tests.test_cli.tool... | [((2790, 2875), 'unittest.mock.patch', 'mock.patch', (['"""aea.cli.utils.package_utils.os.path.join"""'], {'return_value': '"""some-path"""'}), "('aea.cli.utils.package_utils.os.path.join', return_value='some-path'\n )\n", (2800, 2875), False, 'from unittest import TestCase, mock\n'), ((3979, 4064), 'unittest.mock.p... |
from rest_framework import serializers
from punkweb_boards.conf.settings import SHOUTBOX_DISABLED_TAGS
from punkweb_boards.models import (
BoardProfile,
Category,
Subcategory,
Thread,
Post,
Conversation,
Message,
Report,
Shout,
)
class BoardProfileSerializer(serializers.ModelSerial... | [
"punkweb_boards.models.Shout.objects.create",
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ReadOnlyField"
] | [((344, 371), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (369, 371), False, 'from rest_framework import serializers\n'), ((388, 415), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {}), '()\n', (413, 415), False, 'from rest_framework import ... |
import cv2
import ezdxf
import numpy as np
def draw_hatch(img, entity, color, mask):
for poly_path in entity.paths.paths:
# print(poly_path.path_type_flags)
polygon = np.array([vertex[:-1] for vertex in poly_path.vertices]).astype(int)
if poly_path.path_type_flags & 1 == 1:
cv2... | [
"cv2.fillPoly",
"numpy.ceil",
"cv2.drawContours",
"cv2.flip",
"numpy.ones",
"numpy.floor",
"numpy.column_stack",
"cv2.findContours",
"ezdxf.readfile",
"numpy.array",
"numpy.zeros",
"numpy.cos",
"numpy.sin",
"numpy.zeros_like",
"numpy.arange"
] | [((1455, 1481), 'numpy.arange', 'np.arange', (['s', '(e + d / 2)', 'd'], {}), '(s, e + d / 2, d)\n', (1464, 1481), True, 'import numpy as np\n'), ((3039, 3062), 'ezdxf.readfile', 'ezdxf.readfile', (['in_path'], {}), '(in_path)\n', (3053, 3062), False, 'import ezdxf\n'), ((3306, 3324), 'numpy.zeros_like', 'np.zeros_like... |
# Generated by Django 2.0.5 on 2019-07-26 06:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('TCS', '0041_auto_20190726_0030'),
]
operations = [
migrations.AlterModelOptions(
name='modelo',
options={'default_permission... | [
"django.db.migrations.AlterModelOptions"
] | [((223, 645), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""modelo"""', 'options': "{'default_permissions': [], 'ordering': ['-id'], 'permissions': [(\n 'Can_View__Modelo', 'Ve modelos'), ('Can_Create__Modelo',\n 'Crea modelos'), ('Can_Update__Modelo', 'Modifica model... |
import torch
from kornia.geometry.linalg import transform_points
from kornia.geometry.transform import remap
from kornia.utils import create_meshgrid
from .distort import distort_points, tilt_projection
# Based on https://github.com/opencv/opencv/blob/master/modules/calib3d/src/undistort.dispatch.cpp#L384
def undis... | [
"torch.any",
"torch.stack",
"kornia.geometry.transform.remap",
"torch.nn.functional.pad",
"kornia.utils.create_meshgrid"
] | [((3764, 3787), 'torch.stack', 'torch.stack', (['[x, y]', '(-1)'], {}), '([x, y], -1)\n', (3775, 3787), False, 'import torch\n'), ((5543, 5604), 'kornia.utils.create_meshgrid', 'create_meshgrid', (['rows', 'cols', '(False)', 'image.device', 'image.dtype'], {}), '(rows, cols, False, image.device, image.dtype)\n', (5558,... |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from os import path as op
from ..util import load_data_file
# This is the package data dir, not the dir for config, etc.
DATA_DIR = op.join... | [
"os.path.dirname",
"numpy.zeros",
"os.path.join",
"numpy.modf"
] | [((321, 341), 'os.path.dirname', 'op.dirname', (['__file__'], {}), '(__file__)\n', (331, 341), True, 'from os import path as op\n'), ((1080, 1124), 'numpy.zeros', 'np.zeros', (['(value.shape + (4,))'], {'dtype': 'np.ubyte'}), '(value.shape + (4,), dtype=np.ubyte)\n', (1088, 1124), True, 'import numpy as np\n'), ((1178,... |
#! @@Author : <NAME>
#! @@Create : 18 Januari 2019
#! @@Modify : 19 Januari 2019
#! Gambar dari reddit.
#! Gunakan VPN karena DNS situs reddit sudah di blokir dari negara Indonesia.
import os
import json
import requests
import progressbar
from PIL import Image
from lxml import html
from time import sleep
from ImageDel... | [
"InstagramAPI.InstagramAPI.uploadPhoto",
"PIL.Image.open",
"time.sleep",
"ImageDeleter.delete_png",
"requests.get",
"os.system",
"InstagramAPI.InstagramAPI.login",
"os.remove"
] | [((651, 669), 'os.system', 'os.system', (['"""pause"""'], {}), "('pause')\n", (660, 669), False, 'import os\n'), ((472, 492), 'InstagramAPI.InstagramAPI.login', 'InstagramAPI.login', ([], {}), '()\n', (490, 492), False, 'from InstagramAPI import InstagramAPI\n'), ((2478, 2497), 'os.remove', 'os.remove', (['bad_file'], ... |
from collections import MutableMapping, Container
from datetime import datetime, timedelta
from pyvalid import accepts
class LimitedTimeTable(MutableMapping, Container):
def __init__(self, time_span):
self.__storage = dict()
self.__time_span = None
self.time_span = time_span
@propert... | [
"datetime.datetime.now",
"pyvalid.accepts"
] | [((407, 433), 'pyvalid.accepts', 'accepts', (['object', 'timedelta'], {}), '(object, timedelta)\n', (414, 433), False, 'from pyvalid import accepts\n'), ((1711, 1744), 'pyvalid.accepts', 'accepts', (['object', 'datetime', 'object'], {}), '(object, datetime, object)\n', (1718, 1744), False, 'from pyvalid import accepts\... |
#!/usr/bin/python
# Copyright (C) 2015 Ion Torrent Systems, Inc. All Rights Reserved
import subprocess
import re
pluginName = 'DataExport'
pluginDir = ""
networkFS = ["nfs", "cifs"]
localFS = ["ext4", "ext3", "xfs", "ntfs", "exfat", "vboxsf"]
supportedFS = ",".join(localFS + networkFS)
def test(bucket):
return... | [
"subprocess.Popen",
"re.match"
] | [((359, 430), 'subprocess.Popen', 'subprocess.Popen', (['exe'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.STDOUT'}), '(exe, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\n', (375, 430), False, 'import subprocess\n'), ((519, 590), 'subprocess.Popen', 'subprocess.Popen', (['exe'], {'stdout': 'subprocess.PIP... |
# Ported from JavaSript version to Python and Pygame Zero
# Designed to work well with mu-editor environment.
#
# The original Javascript version wasdonw by <NAME>
# at https://github.com/beneater/boids (MIT License)
# No endorsement implied.
#
# Complex numbers are are used as vectors to integrate x and y positions an... | [
"random.randint"
] | [((1346, 1370), 'random.randint', 'random.randint', (['(0)', 'WIDTH'], {}), '(0, WIDTH)\n', (1360, 1370), False, 'import random\n'), ((1386, 1411), 'random.randint', 'random.randint', (['(0)', 'HEIGHT'], {}), '(0, HEIGHT)\n', (1400, 1411), False, 'import random\n'), ((1455, 1494), 'random.randint', 'random.randint', ([... |
import warnings
import numpy as np
import torch
import torch.nn.functional as F
from sklearn import metrics
from torch.utils.data import DataLoader, SequentialSampler, TensorDataset
from tqdm import tqdm
from datasets.bert_processors.abstract_processor import convert_examples_to_features_with_emotion, \
... | [
"datasets.bert_processors.abstract_processor.convert_examples_to_hierarchical_features",
"torch.nn.functional.sigmoid",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"numpy.array",
"sklearn.metrics.jaccard_score",
"utils.emotion.Emotion",
"sklearn.metrics.hamming_loss",
"dataset... | [((539, 572), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (562, 572), False, 'import warnings\n'), ((785, 858), 'utils.tokenization.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['args.model'], {'is_lowercase': 'args.is_lowercase'}), '(args.model, is... |
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, config):
super(Model, self).__init__()
self.drop = nn.Dropout(config['dropout'])
self.fc1 = nn.Linear(784, 2000)
self.fc2 = nn.Linear(2000, 2000)
self.fc3 = nn.Linea... | [
"torch.nn.Dropout",
"torch.nn.Linear"
] | [((177, 206), 'torch.nn.Dropout', 'nn.Dropout', (["config['dropout']"], {}), "(config['dropout'])\n", (187, 206), True, 'import torch.nn as nn\n'), ((229, 249), 'torch.nn.Linear', 'nn.Linear', (['(784)', '(2000)'], {}), '(784, 2000)\n', (238, 249), True, 'import torch.nn as nn\n'), ((270, 291), 'torch.nn.Linear', 'nn.L... |
#!/usr/bin/env python
# coding: utf-8
""" Learning Koopman Invariant Subspace
(c) <NAME>, 2017.
<EMAIL>
"""
import numpy as np
np.random.seed(1234567890)
from argparse import ArgumentParser
from os import path
import time
from lkis import TimeSeriesBatchMaker, KoopmanInvariantSubspaceLearner
from losses import co... | [
"torch.manual_seed",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"lkis.TimeSeriesBatchMaker",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"lkis.KoopmanInvariantSubspaceLearner",
"losses.combined_loss",
"numpy.random.seed",
"torch.save",
"matplotlib.pyplot.title",
"numpy... | [((131, 157), 'numpy.random.seed', 'np.random.seed', (['(1234567890)'], {}), '(1234567890)\n', (145, 157), True, 'import numpy as np\n'), ((485, 496), 'time.time', 'time.time', ([], {}), '()\n', (494, 496), False, 'import time\n'), ((506, 596), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Learn... |
from telethon.tl.functions.photos import DeletePhotosRequest, GetUserPhotosRequest
from telethon.tl.types import InputPhoto
from userbot.cmdhelp import CmdHelp
from userbot.utils import admin_cmd, edit_or_reply, sudo_cmd
CmdHelp("delfp").add_command("delpfp", None, "delete ur currnt profile picture").add()
@borg.on... | [
"userbot.utils.admin_cmd",
"userbot.cmdhelp.CmdHelp",
"telethon.tl.functions.photos.DeletePhotosRequest",
"telethon.tl.functions.photos.GetUserPhotosRequest",
"telethon.tl.types.InputPhoto",
"userbot.utils.sudo_cmd"
] | [((321, 354), 'userbot.utils.admin_cmd', 'admin_cmd', ([], {'pattern': '"""delpfp ?(.*)"""'}), "(pattern='delpfp ?(.*)')\n", (330, 354), False, 'from userbot.utils import admin_cmd, edit_or_reply, sudo_cmd\n'), ((365, 414), 'userbot.utils.sudo_cmd', 'sudo_cmd', ([], {'pattern': '"""delpfp ?(.*)"""', 'allow_sudo': '(Tru... |
# Copyright (C) 2006, 2008 Canonical Ltd
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it and/or
# modify it under the terms of either of these t... | [
"dulwich.lru_cache.LRUSizeCache",
"dulwich.lru_cache.LRUCache"
] | [((1169, 1201), 'dulwich.lru_cache.LRUCache', 'lru_cache.LRUCache', ([], {'max_cache': '(10)'}), '(max_cache=10)\n', (1187, 1201), False, 'from dulwich import lru_cache\n'), ((1268, 1301), 'dulwich.lru_cache.LRUCache', 'lru_cache.LRUCache', ([], {'max_cache': '(256)'}), '(max_cache=256)\n', (1286, 1301), False, 'from d... |
# coding: utf-8
import logging
import requests
import mimetypes
from io import BytesIO
from urllib.parse import urlparse
from datetime import datetime, timedelta
from collections import OrderedDict
from flask_babelex import gettext as _
from flask import (
render_template,
abort,
current_app,
request,
... | [
"logging.getLogger",
"flask.request.args.get",
"webapp.controllers.get_press_releases",
"flask.render_template",
"webapp.controllers.get_article_by_oap_pid",
"webapp.utils.utils.get_next_issue",
"webapp.controllers.send_email_error",
"webapp.controllers.get_page_by_journal_acron_lang",
"webapp.contr... | [((1059, 1086), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1076, 1086), False, 'import logging\n'), ((1108, 1158), 'flask_babelex.gettext', '_', (['"""O periódico está indisponível por motivo de: """'], {}), "('O periódico está indisponível por motivo de: ')\n", (1109, 1158), True, '... |
"""
Converter um DataFrame para CSV
"""
import pandas as pd
dataset = pd.DataFrame({'Frutas': ["Abacaxi", "Mamão"],
"Nomes": ["Éverton", "Márcia"]},
index=["Linha 1", "Linha 2"])
dataset.to_csv("dataset.csv") | [
"pandas.DataFrame"
] | [((71, 184), 'pandas.DataFrame', 'pd.DataFrame', (["{'Frutas': ['Abacaxi', 'Mamão'], 'Nomes': ['Éverton', 'Márcia']}"], {'index': "['Linha 1', 'Linha 2']"}), "({'Frutas': ['Abacaxi', 'Mamão'], 'Nomes': ['Éverton', 'Márcia'\n ]}, index=['Linha 1', 'Linha 2'])\n", (83, 184), True, 'import pandas as pd\n')] |
import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
ALLOWED_HOSTS = []
ROOT_URLCONF = 'groups.tests.urls'
STATIC_URL = '/static/'
SECRET_KEY = '<KEY>'
PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',)
DATABASES = {
'default':... | [
"os.path.abspath",
"dj_database_url.config",
"os.path.join"
] | [((321, 382), 'dj_database_url.config', 'dj_database_url.config', ([], {'default': '"""postgres://localhost/groups"""'}), "(default='postgres://localhost/groups')\n", (343, 382), False, 'import dj_database_url\n'), ((79, 104), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (94, 104), False, '... |
import bluetooth
import time
bt = bluetooth.BLE() # singleton
bt.active(True) # activate BT stack
UART_UUID = bluetooth.UUID('6E400001-B5A3-F393-E0A9-E50E24DCCA9E')
UART_TX = (bluetooth.UUID('6E400003-B5A3-F393-E0A9-E50E24DCCA9E'), bluetooth.FLAG_READ | bluetooth.FLAG_NOTIFY,)
UAR... | [
"bluetooth.BLE",
"bluetooth.UUID"
] | [((34, 49), 'bluetooth.BLE', 'bluetooth.BLE', ([], {}), '()\n', (47, 49), False, 'import bluetooth\n'), ((149, 203), 'bluetooth.UUID', 'bluetooth.UUID', (['"""6E400001-B5A3-F393-E0A9-E50E24DCCA9E"""'], {}), "('6E400001-B5A3-F393-E0A9-E50E24DCCA9E')\n", (163, 203), False, 'import bluetooth\n'), ((215, 269), 'bluetooth.U... |
import optparse
import sys
def make_set(data, s, e_vocab, f_vocab, aligned, reverse):
for pair in data.split():
cur = pair.split('-')
if reverse:
e_vocab.add(int(cur[1]))
f_vocab.add(int(cur[0]))
aligned.add(int(cur[0]))
s.add((int(cur[1]), int(cur[0]... | [
"optparse.OptionParser",
"sys.stdout.write"
] | [((2468, 2491), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (2489, 2491), False, 'import optparse\n'), ((1285, 1307), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (1301, 1307), False, 'import sys\n'), ((1242, 1277), 'sys.stdout.write', 'sys.stdout.write', (["('%i-%i '... |
# -*- coding: utf-8 -*-
# Copyright 2017-2018 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"tbears.block_manager.tbears_db.TbearsDB.make_db",
"os.path.dirname",
"os.path.join",
"shutil.rmtree"
] | [((771, 815), 'os.path.join', 'os.path.join', (['DIRECTORY_PATH', '"""./.tbears_db"""'], {}), "(DIRECTORY_PATH, './.tbears_db')\n", (783, 815), False, 'import os\n'), ((733, 758), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (748, 758), False, 'import os\n'), ((1080, 1102), 'shutil.rmtree',... |
# encoding: utf-8
"""
mplsmask.py
Created by <NAME> on 2016-12-01.
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
"""
from exabgp.bgp.message.notification import Notify
from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState
from exabgp.bgp.message.update.attribute.bgpls.linkstate import ... | [
"exabgp.bgp.message.update.attribute.bgpls.linkstate.LinkState.register"
] | [((1453, 1473), 'exabgp.bgp.message.update.attribute.bgpls.linkstate.LinkState.register', 'LinkState.register', ([], {}), '()\n', (1471, 1473), False, 'from exabgp.bgp.message.update.attribute.bgpls.linkstate import LinkState\n')] |
import unittest
from opencmiss.utils.zinc.finiteelement import evaluateFieldNodesetRange
from opencmiss.utils.zinc.general import ChangeManager
from opencmiss.zinc.context import Context
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
from opencmiss.zinc.result import RESULT_OK
from s... | [
"opencmiss.zinc.context.Context",
"scaffoldmaker.meshtypes.meshtype_3d_cecum1.MeshType_3d_cecum1.getParameterSetNames",
"scaffoldmaker.meshtypes.meshtype_3d_cecum1.MeshType_3d_cecum1.generateBaseMesh",
"testutils.assertAlmostEqualList",
"scaffoldmaker.utils.zinc_utils.createFaceMeshGroupExteriorOnFace",
"... | [((4961, 4976), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4974, 4976), False, 'import unittest\n'), ((681, 722), 'scaffoldmaker.meshtypes.meshtype_3d_cecum1.MeshType_3d_cecum1.getParameterSetNames', 'MeshType_3d_cecum1.getParameterSetNames', ([], {}), '()\n', (720, 722), False, 'from scaffoldmaker.meshtypes.... |
import sys
class Screen:
def __init__(self) -> None:
pass
def handle_events(self, events):
for event in events:
if event.type == self.pygame.QUIT:
sys.exit()
def draw(self, screen):
pass | [
"sys.exit"
] | [((201, 211), 'sys.exit', 'sys.exit', ([], {}), '()\n', (209, 211), False, 'import sys\n')] |
import numpy as np
from math import pi,exp
def static_stability(height,area,theta,s_et=None,n_et=None):
"""
The function "static_stability" computes the vertical gradient (z-derivative)
of hemispheric-averaged potential temperature, i.e. d\tilde{theta}/dz in the def-
inition of QGPV in eq.(3) of Huang ... | [
"numpy.abs",
"numpy.mean",
"numpy.ones",
"numpy.exp",
"numpy.sum",
"numpy.zeros",
"numpy.empty_like",
"numpy.cos",
"numpy.sin",
"math.exp"
] | [((2300, 2324), 'numpy.zeros', 'np.zeros', (['theta.shape[0]'], {}), '(theta.shape[0])\n', (2308, 2324), True, 'import numpy as np\n'), ((2338, 2362), 'numpy.zeros', 'np.zeros', (['theta.shape[0]'], {}), '(theta.shape[0])\n', (2346, 2362), True, 'import numpy as np\n'), ((2621, 2652), 'numpy.sum', 'np.sum', (['area_zon... |
import numpy as np
import scipy.interpolate
import scipy.ndimage
from sklearn.feature_extraction.image import extract_patches_2d, reconstruct_from_patches_2d
def _calc_patch_grid_dims(shape, patch_size, patch_stride):
x_w, x_h, x_c = shape
num_rows = 1 + (x_h - patch_size) // patch_stride
num_cols = 1 + (... | [
"numpy.clip",
"sklearn.feature_extraction.image.extract_patches_2d",
"numpy.array",
"image_analogy.img_utils.preprocess_image",
"numpy.arange",
"numpy.rank",
"numpy.reshape",
"numpy.where",
"scipy.misc.imsave",
"numpy.asarray",
"image_analogy.img_utils.load_image",
"image_analogy.img_utils.dep... | [((527, 574), 'sklearn.feature_extraction.image.extract_patches_2d', 'extract_patches_2d', (['x', '(patch_size, patch_size)'], {}), '(x, (patch_size, patch_size))\n', (545, 574), False, 'from sklearn.feature_extraction.image import extract_patches_2d, reconstruct_from_patches_2d\n'), ((1228, 1303), 'numpy.reshape', 'np... |
#!/usr/bin/env python3
import socket, threading
from queue import Queue
import sys, struct
# NOTE: Use this path to create the UDS Server socket
SERVER_SOCKET_PATH = "./socket";
class Result:
def __init__(self):
self._evt = threading.Event()
self._result = None
def set_result(self, value... | [
"socket.socket",
"struct.pack",
"threading.Event",
"threading.Thread",
"queue.Queue"
] | [((3692, 3721), 'socket.socket', 'socket.socket', (['socket.AF_UNIX'], {}), '(socket.AF_UNIX)\n', (3705, 3721), False, 'import socket, threading\n'), ((239, 256), 'threading.Event', 'threading.Event', ([], {}), '()\n', (254, 256), False, 'import socket, threading\n'), ((564, 571), 'queue.Queue', 'Queue', ([], {}), '()\... |
"""
Calibrate with the ROS package aruco_detect
"""
import rospy
import roslib
from geometry_msgs.msg import Transform
class ROSArUcoCalibrate:
def __init__(self, aruco_tag_len=0.0795):
print("Please roslaunch roslaunch aruco_detect aruco_detect.launch before you run!")
self.aruco_tf_topic = "/f... | [
"rospy.Subscriber",
"rospy.logwarn"
] | [((374, 434), 'rospy.Subscriber', 'rospy.Subscriber', (['self.aruco_tf_topic', 'Transform', 'self._tfCb'], {}), '(self.aruco_tf_topic, Transform, self._tfCb)\n', (390, 434), False, 'import rospy\n'), ((533, 572), 'rospy.logwarn', 'rospy.logwarn', (['"""_tfCb: tf_msg is None!"""'], {}), "('_tfCb: tf_msg is None!')\n", (... |
from __future__ import absolute_import
__author__ = 'marafi'
def SolutionAlgorithim(OData, Dt, Tol, Steps):
#Insert within the While loop, make sure parameter "ok" is defined
import OpenSeesAPI
OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
OData.AddObject(OpenSeesAPI.TCL.TCLScript('put... | [
"OpenSeesAPI.TCL.TCLScript",
"OpenSeesAPI.Analysis.Algorithm.KrylovNewton",
"OpenSeesAPI.Analysis.Algorithm.Newton",
"OpenSeesAPI.Analysis.Algorithm.Broyden",
"OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch",
"OpenSeesAPI.Analysis.Test.EnergyIncr",
"OpenSeesAPI.Analysis.Integrator.Static.DisplacementCo... | [((224, 268), 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', (['"""if {$ok != 0} {"""'], {}), "('if {$ok != 0} {')\n", (249, 268), False, 'import OpenSeesAPI\n'), ((290, 379), 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', (['(\'puts "Trying Lower Dt: %f and Tol: %f ... "\' % (Dt, Tol))'], {}), '(... |
# -*- coding: utf-8 -*-
# Copyright (c) Polyconseil SAS. All rights reserved.
import hashlib
import json
import logging
import os
import re
from .html import html_config, HtmlHarvester # pylint: disable=unused-import
from .sphinx import ( # pylint: disable=unused-import
sphinx_config, sphinx_rtd_config,
Sph... | [
"logging.getLogger",
"hashlib.md5",
"re.compile",
"json.dump",
"os.path.join",
"os.path.splitext",
"os.walk",
"os.path.relpath"
] | [((374, 401), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (391, 401), False, 'import logging\n'), ((656, 669), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (667, 669), False, 'import hashlib\n'), ((2091, 2108), 'os.walk', 'os.walk', (['base_dir'], {}), '(base_dir)\n', (2098, 2108), ... |
# Generated by Django 2.0.4 on 2019-05-21 16:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carPooling', '0017_carpoolingrecunbook'),
]
operations = [
migrations.AlterField(
model_name='carpoolinguserconf',
n... | [
"django.db.models.CharField"
] | [((352, 416), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)', 'null': '(True)', 'verbose_name': '"""真实姓名"""'}), "(max_length=128, null=True, verbose_name='真实姓名')\n", (368, 416), False, 'from django.db import migrations, models\n'), ((551, 618), 'django.db.models.CharField', 'models.CharFi... |
import bz2
import csv
import collections
import math
from enum import Enum
class Select(Enum):
FIRST = 'first'
RANGE_KEY = 'range_key'
RANGE_VALUE = 'range_value'
class SelectPolicy:
def __init__(self, policy, field=None):
self.policy = policy
self.field = field
class StateSet:
... | [
"csv.DictReader",
"math.ceil",
"argparse.ArgumentParser",
"math.floor",
"bz2.open"
] | [((8663, 8716), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Load state set"""'}), "(description='Load state set')\n", (8686, 8716), False, 'import argparse\n'), ((5410, 5427), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (5424, 5427), False, 'import csv\n'), ((6173, 6190)... |
from hpcrocket.core.filesystem import Filesystem, FilesystemFactory
from hpcrocket.core.launchoptions import Options
from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem
from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem
class PyFilesystemFactory(FilesystemFactory):
def __init__(self, o... | [
"hpcrocket.pyfilesystem.localfilesystem.LocalFilesystem",
"hpcrocket.pyfilesystem.sshfilesystem.SSHFilesystem"
] | [((447, 467), 'hpcrocket.pyfilesystem.localfilesystem.LocalFilesystem', 'LocalFilesystem', (['"""."""'], {}), "('.')\n", (462, 467), False, 'from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem\n'), ((627, 664), 'hpcrocket.pyfilesystem.sshfilesystem.SSHFilesystem', 'SSHFilesystem', (['connection', 'proxyj... |
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | [
"mock.patch",
"sagemaker.tensorflow.TensorFlow",
"mock.Mock",
"pytest.raises",
"packaging.version.Version",
"pytest.fixture",
"pytest.skip"
] | [((829, 845), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (843, 845), False, 'import pytest\n'), ((1202, 1256), 'mock.patch', 'patch', (['"""sagemaker.fw_utils.python_deprecation_warning"""'], {}), "('sagemaker.fw_utils.python_deprecation_warning')\n", (1207, 1256), False, 'from mock import Mock, patch\n'), (... |
import subprocess
proc = subprocess.Popen(['python3', 'articlekeywords.py', 'aih.txt' , '5'], stdout=subprocess.PIPE )
#print(type(proc.communicate()[0]))
# path = '/opt/mycroft/skills/mycroft-bitcoinprice-skill/'
text = proc.stdout.read()
rows = text.splitlines()
#print(text.splitlines())
count = 0
s = ""
for ... | [
"subprocess.Popen"
] | [((27, 123), 'subprocess.Popen', 'subprocess.Popen', (["['python3', 'articlekeywords.py', 'aih.txt', '5']"], {'stdout': 'subprocess.PIPE'}), "(['python3', 'articlekeywords.py', 'aih.txt', '5'], stdout=\n subprocess.PIPE)\n", (43, 123), False, 'import subprocess\n')] |
# Python 2.7.1
import RPi.GPIO as GPIO
from twython import Twython
import time
import sys
import os
import pygame
APP_KEY='zmmlyAJzMDIntLpDYmSH98gbw'
APP_SECRET='<KEY>'
OAUTH_TOKEN='<KEY>'
OAUTH_TOKEN_SECRET='<KEY>'
applepislcy = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
### GENERAL ###
def Clea... | [
"RPi.GPIO.cleanup",
"sys.exit",
"pygame.init",
"twython.Twython",
"pygame.event.get",
"pygame.quit",
"pygame.display.set_mode",
"time.sleep",
"pygame.display.set_caption",
"time.localtime",
"pygame.display.update",
"pygame.font.SysFont"
] | [((232, 293), 'twython.Twython', 'Twython', (['APP_KEY', 'APP_SECRET', 'OAUTH_TOKEN', 'OAUTH_TOKEN_SECRET'], {}), '(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)\n', (239, 293), False, 'from twython import Twython\n'), ((331, 345), 'RPi.GPIO.cleanup', 'GPIO.cleanup', ([], {}), '()\n', (343, 345), True, 'import ... |
"""plerr entrypoint"""
from plerr import cli
if __name__ == '__main__':
cli.main()
| [
"plerr.cli.main"
] | [((77, 87), 'plerr.cli.main', 'cli.main', ([], {}), '()\n', (85, 87), False, 'from plerr import cli\n')] |
# 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, software
# distributed under t... | [
"tempest.lib.decorators.attr",
"tempest.lib.decorators.idempotent_id",
"senlin_tempest_plugin.common.utils.create_a_policy"
] | [((779, 813), 'tempest.lib.decorators.attr', 'decorators.attr', ([], {'type': "['negative']"}), "(type=['negative'])\n", (794, 813), False, 'from tempest.lib import decorators\n'), ((819, 883), 'tempest.lib.decorators.idempotent_id', 'decorators.idempotent_id', (['"""5df90d82-9889-4c6f-824c-30272bcfa767"""'], {}), "('5... |
from datasette import hookimpl
from datasette.utils import detect_spatialite
from shapely import wkt
def get_spatial_tables(conn):
if not detect_spatialite(conn):
return {}
spatial_tables = {}
c = conn.cursor()
c.execute(
"""SELECT f_table_name, f_geometry_column, srid, spatial_index_... | [
"shapely.wkt.loads",
"datasette.utils.detect_spatialite"
] | [((144, 167), 'datasette.utils.detect_spatialite', 'detect_spatialite', (['conn'], {}), '(conn)\n', (161, 167), False, 'from datasette.utils import detect_spatialite\n'), ((1106, 1121), 'shapely.wkt.loads', 'wkt.loads', (['data'], {}), '(data)\n', (1115, 1121), False, 'from shapely import wkt\n')] |
"""
Message context.
"""
from typing import Dict
from microcosm.api import defaults, typed
from microcosm.config.types import boolean
from microcosm_logging.decorators import logger
from microcosm_pubsub.constants import TTL_KEY, URI_KEY
from microcosm_pubsub.message import SQSMessage
@defaults(
enable_ttl=typ... | [
"microcosm.api.typed"
] | [((317, 351), 'microcosm.api.typed', 'typed', (['boolean'], {'default_value': '(True)'}), '(boolean, default_value=True)\n', (322, 351), False, 'from microcosm.api import defaults, typed\n'), ((369, 397), 'microcosm.api.typed', 'typed', (['int'], {'default_value': '(32)'}), '(int, default_value=32)\n', (374, 397), Fals... |
import pytest
from app.db import session_scope
pytestmark = pytest.mark.asyncio
async def test_engine_configured(env):
async with session_scope() as session:
assert str(session.bind.engine.url) == env("SQLALCHEMY_DATABASE_URI")
| [
"app.db.session_scope"
] | [((138, 153), 'app.db.session_scope', 'session_scope', ([], {}), '()\n', (151, 153), False, 'from app.db import session_scope\n')] |
#!/usr/bin/env python3
"""
Description: Python script to append the common columns in one sheet from another sheet using fuzzy matching.
"""
import pip
def import_or_install(package):
try:
__import__(package)
except ImportError:
pip.main(['install', package])
import os
import sys
im... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.isfile",
"fuzzywuzzy.process.extractOne",
"sys.exit",
"pip.main"
] | [((4202, 4227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4225, 4227), False, 'import argparse\n'), ((6315, 6347), 'os.path.isfile', 'os.path.isfile', (['args.destination'], {}), '(args.destination)\n', (6329, 6347), False, 'import os\n'), ((6779, 6804), 'argparse.ArgumentParser', 'argpar... |
import os
from twisted.internet.defer import succeed
class Load(object):
def register(self, sysinfo):
self._sysinfo = sysinfo
def run(self):
self._sysinfo.add_header("System load", str(os.getloadavg()[0]))
return succeed(None)
| [
"os.getloadavg",
"twisted.internet.defer.succeed"
] | [((250, 263), 'twisted.internet.defer.succeed', 'succeed', (['None'], {}), '(None)\n', (257, 263), False, 'from twisted.internet.defer import succeed\n'), ((214, 229), 'os.getloadavg', 'os.getloadavg', ([], {}), '()\n', (227, 229), False, 'import os\n')] |
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot
import agentframework
import csv
import matplotlib.animation
#create environment in which agents will operate
environment=[]
#read csv downloaded file
f = open('in.txt', newline='')
reader = csv.reader(f, quoting=csv.QUOTE_NONNUMERIC)
for row in ... | [
"matplotlib.pyplot.imshow",
"matplotlib.use",
"matplotlib.animation.FuncAnimation",
"agentframework.Agent",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"csv.reader",
"matplotlib.pyplot.show"
] | [((18, 41), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (32, 41), False, 'import matplotlib\n'), ((265, 308), 'csv.reader', 'csv.reader', (['f'], {'quoting': 'csv.QUOTE_NONNUMERIC'}), '(f, quoting=csv.QUOTE_NONNUMERIC)\n', (275, 308), False, 'import csv\n'), ((837, 877), 'matplotlib.pyplot... |
"""Validation for UDFs.
Warning: This is an experimental module and API here can change without notice.
DO NOT USE DIRECTLY.
"""
from inspect import Parameter, Signature, signature
from typing import Any, Callable, List
import ibis.common.exceptions as com
from ibis.expr.datatypes import DataType
def _parameter_c... | [
"ibis.common.exceptions.IbisTypeError",
"inspect.signature"
] | [((1277, 1292), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (1286, 1292), False, 'from inspect import Parameter, Signature, signature\n'), ((2323, 2395), 'ibis.common.exceptions.IbisTypeError', 'com.IbisTypeError', (['"""The output type of a UDF must be a single datatype."""'], {}), "('The output type... |
import inspect
from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType
from .resolver import *
#
# Schema
#
class GrammarError(Exception):
pass
keywords = ['query', 'mutation', 'subscription', 'source']
class SchemaMetaDict(dict):
'''
Dictionary that allows decorated sche... | [
"ariadne.SubscriptionType",
"ariadne.QueryType",
"ariadne.MutationType",
"inspect.unwrap",
"inspect.getdoc"
] | [((4025, 4045), 'inspect.unwrap', 'inspect.unwrap', (['func'], {}), '(func)\n', (4039, 4045), False, 'import inspect\n'), ((5069, 5080), 'ariadne.QueryType', 'QueryType', ([], {}), '()\n', (5078, 5080), False, 'from ariadne import make_executable_schema, QueryType, MutationType, SubscriptionType\n'), ((5110, 5124), 'ar... |
import random
from otp.ai.AIBase import *
from direct.distributed.ClockDelta import *
from toontown.battle.BattleBase import *
from toontown.battle.BattleCalculatorAI import *
from toontown.toonbase.ToontownBattleGlobals import *
from toontown.battle.SuitBattleGlobals import *
from pandac.PandaModules import *
from too... | [
"toontown.pets.DistributedPetProxyAI.DistributedPetProxyAI",
"direct.distributed.DistributedObjectAI.DistributedObjectAI.requestDelete",
"direct.fsm.State.State",
"toontown.ai.DatabaseObject.DatabaseObject",
"direct.distributed.DistributedObjectAI.DistributedObjectAI.delete",
"toontown.toon.DistributedToo... | [((947, 1017), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'DirectNotifyGlobal.directNotify.newCategory', (['"""DistributedBattleBaseAI"""'], {}), "('DistributedBattleBaseAI')\n", (990, 1017), False, 'from direct.directnotify import DirectNotifyGlobal\n'), ((1167, 1226), 'direct.distributed.Distr... |
import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
from scipy.spatial.distance import pdist, squareform
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family' : 'sans-serif',
'weight' : 'bold',
... | [
"numpy.clip",
"configparser.ConfigParser",
"numpy.sin",
"numpy.divide",
"gym.utils.seeding.np_random",
"numpy.mean",
"numpy.multiply",
"numpy.min",
"matplotlib.pyplot.ylim",
"numpy.random.normal",
"numpy.eye",
"matplotlib.pyplot.gca",
"numpy.fill_diagonal",
"os.path.dirname",
"numpy.cos"... | [((488, 515), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (513, 515), False, 'import configparser\n'), ((1655, 1720), 'numpy.zeros', 'np.zeros', (['(self.n_nodes, self.nx * self.filter_len, self.n_pools)'], {}), '((self.n_nodes, self.nx * self.filter_len, self.n_pools))\n', (1663, 1720),... |
# -*-coding:utf-8-*-
# from functools import reduce
from functools import reduce
SANCAI_jixiang = [1, 3, 5, 7, 8, 11, 13, 15, 16, 18, 21, 23, 24, 25, 31, 32, 33, 35, 37, 39, 41, 45, 47, 48, 52, 57, 61,
63,
65, 67, 68, 81] # 吉祥运暗示数(代表健全,幸福,名誉等)
SANCAI_xiaoji = [6, 17, 26, 27, 29, 30,... | [
"functools.reduce"
] | [((1814, 1859), 'functools.reduce', 'reduce', (['(lambda x, y: x + y)', 'good_num_list', '[]'], {}), '(lambda x, y: x + y, good_num_list, [])\n', (1820, 1859), False, 'from functools import reduce\n'), ((1881, 1925), 'functools.reduce', 'reduce', (['(lambda x, y: x + y)', 'bad_num_list', '[]'], {}), '(lambda x, y: x + ... |
"""
Losses that assume an underlying spatial organization
(gradients, curvature, etc.)
"""
import torch
import torch.nn as tnn
from nitorch.core.pyutils import make_list, prod
from nitorch.core.utils import slice_tensor
from nitorch.spatial import diff1d
from ._base import Loss
class LocalFeatures(tnn.Module):
"... | [
"nitorch.core.utils.slice_tensor",
"torch.stack",
"nitorch.core.pyutils.make_list",
"nitorch.spatial.diff1d",
"nitorch.core.pyutils.prod",
"torch.cat"
] | [((2889, 2904), 'nitorch.core.pyutils.make_list', 'make_list', (['side'], {}), '(side)\n', (2898, 2904), False, 'from nitorch.core.pyutils import make_list, prod\n'), ((3083, 3097), 'nitorch.core.pyutils.make_list', 'make_list', (['dim'], {}), '(dim)\n', (3092, 3097), False, 'from nitorch.core.pyutils import make_list,... |
#!/usr/bin/env python3
# Copyright 2020 Gaitech Korea Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"ament_index_python.packages.get_package_share_directory",
"launch.substitutions.LaunchConfiguration",
"launch.actions.DeclareLaunchArgument"
] | [((959, 999), 'ament_index_python.packages.get_package_share_directory', 'get_package_share_directory', (['"""twist_mux"""'], {}), "('twist_mux')\n", (986, 999), False, 'from ament_index_python.packages import get_package_share_directory\n'), ((1116, 1156), 'ament_index_python.packages.get_package_share_directory', 'ge... |
import sys
import unittest
import requests_mock
from mock import patch
sys.path.append('services/LiveService')
from LiveService import LiveService
L = LiveService()
baseURL = "https://yanexx65s8e1.live.elementalclouddev.com/api"
class LiveServiceTest(unittest.TestCase):
'''@patch('services.LiveService.LiveSe... | [
"unittest.main",
"requests_mock.Mocker",
"sys.path.append",
"LiveService.LiveService"
] | [((71, 110), 'sys.path.append', 'sys.path.append', (['"""services/LiveService"""'], {}), "('services/LiveService')\n", (86, 110), False, 'import sys\n'), ((154, 167), 'LiveService.LiveService', 'LiveService', ([], {}), '()\n', (165, 167), False, 'from LiveService import LiveService\n'), ((798, 820), 'requests_mock.Mock... |
import pandas as pd
import numpy as np
import os
import logging
# suppress warnings
import warnings;
warnings.filterwarnings('ignore');
from tqdm.autonotebook import tqdm
# register `pandas.progress_apply` and `pandas.Series.map_apply` with `tqdm`
tqdm.pandas()
# https://pandas.pydata.org/pandas-docs/stable/user_g... | [
"tqdm.autonotebook.tqdm.pandas",
"matplotlib.rcParams.update",
"seaborn.set_style",
"warnings.filterwarnings",
"numpy.set_printoptions"
] | [((103, 136), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (126, 136), False, 'import warnings\n'), ((252, 265), 'tqdm.autonotebook.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (263, 265), False, 'from tqdm.autonotebook import tqdm\n'), ((746, 780), 'numpy.set_printopt... |
import sys
import soundcard
import numpy
import pytest
ones = numpy.ones(1024)
signal = numpy.concatenate([[ones], [-ones]]).T
def test_speakers():
for speaker in soundcard.all_speakers():
assert isinstance(speaker.name, str)
assert hasattr(speaker, 'id')
assert isinstance(speaker.channels... | [
"soundcard.get_microphone",
"soundcard.all_speakers",
"soundcard.all_microphones",
"numpy.ones",
"soundcard.default_microphone",
"soundcard.default_speaker",
"soundcard.get_speaker",
"numpy.concatenate"
] | [((63, 79), 'numpy.ones', 'numpy.ones', (['(1024)'], {}), '(1024)\n', (73, 79), False, 'import numpy\n'), ((89, 125), 'numpy.concatenate', 'numpy.concatenate', (['[[ones], [-ones]]'], {}), '([[ones], [-ones]])\n', (106, 125), False, 'import numpy\n'), ((169, 193), 'soundcard.all_speakers', 'soundcard.all_speakers', ([]... |
import numpy as np
import h5py
import os
from devito.logger import info
from devito import TimeFunction, clear_cache
from examples.seismic.acoustic import AcousticWaveSolver
from examples.seismic import Model, RickerSource, Receiver, TimeAxis
from math import floor
from scipy.interpolate import griddata
import argparse... | [
"examples.seismic.TimeAxis",
"numpy.reshape",
"argparse.ArgumentParser",
"scipy.interpolate.griddata",
"devito.TimeFunction",
"os.path.join",
"h5py.File",
"examples.seismic.RickerSource",
"numpy.zeros",
"examples.seismic.Model",
"numpy.linspace",
"examples.seismic.Receiver",
"devito.clear_ca... | [((331, 370), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (354, 370), False, 'import argparse\n'), ((877, 904), 'numpy.reshape', 'np.reshape', (['vp', '(1601, 401)'], {}), '(vp, (1601, 401))\n', (887, 904), True, 'import numpy as np\n'), ((959, 996), 'num... |
from setuptools import setup
setup(name="pykinematicskineticstoolbox",
version="0.0",
description="Installable python package which collects useful kinematics and kinetics functions",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
packages=["pykinematicskineticstoolbox"],
install_requires... | [
"setuptools.setup"
] | [((30, 325), 'setuptools.setup', 'setup', ([], {'name': '"""pykinematicskineticstoolbox"""', 'version': '"""0.0"""', 'description': '"""Installable python package which collects useful kinematics and kinetics functions"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "... |
from datetime import datetime
# ensure an rpc peer is added
def addpeer(p, rpcpeer):
pid = rpcpeer['id']
if pid not in p.persist['peerstate']:
p.persist['peerstate'][pid] = {
'connected': rpcpeer['connected'],
'last_seen': datetime.now() if rpcpeer['connected'] else None,
... | [
"datetime.datetime.now"
] | [((883, 897), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (895, 897), False, 'from datetime import datetime\n'), ((265, 279), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (277, 279), False, 'from datetime import datetime\n')] |
"""
Functions for reading Magritek Spinsolve binary (dx/1d) files and
parameter (acqu.par/proc.par) files.
"""
import os
from warnings import warn
import numpy as np
from . import fileiobase
from . import jcampdx
__developer_info__ = """
Spinsolve is the software used on the Magritek benchtop NMR devices.
A spect... | [
"os.path.join",
"os.path.isfile",
"os.path.isdir",
"warnings.warn",
"numpy.frombuffer"
] | [((3216, 3242), 'os.path.join', 'os.path.join', (['dir', 'acqupar'], {}), '(dir, acqupar)\n', (3228, 3242), False, 'import os\n'), ((3250, 3273), 'os.path.isfile', 'os.path.isfile', (['acqupar'], {}), '(acqupar)\n', (3264, 3273), False, 'import os\n'), ((3551, 3577), 'os.path.join', 'os.path.join', (['dir', 'procpar'],... |
# -*- coding: utf-8 -*-
#
# Graph : graph package
#
# Copyright or Copr. 2006 INRIA - CIRAD - INRA
#
# File author(s): <NAME> <<EMAIL>>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at
# http://www.cecill.info/licences/Licence_CeCILL-C_V1... | [
"id_dict.IdDict"
] | [((1438, 1469), 'id_dict.IdDict', 'IdDict', ([], {'idgenerator': 'idgenerator'}), '(idgenerator=idgenerator)\n', (1444, 1469), False, 'from id_dict import IdDict\n'), ((1492, 1523), 'id_dict.IdDict', 'IdDict', ([], {'idgenerator': 'idgenerator'}), '(idgenerator=idgenerator)\n', (1498, 1523), False, 'from id_dict import... |
import paddle.fluid as fluid
from paddle.fluid.initializer import MSRA
from paddle.fluid.param_attr import ParamAttr
class MobileNetV2SSD:
def __init__(self, img, num_classes, img_shape):
self.img = img
self.num_classes = num_classes
self.img_shape = img_shape
def ssd_net(self, scale=... | [
"paddle.fluid.data",
"paddle.fluid.layers.relu6",
"paddle.fluid.initializer.MSRA",
"paddle.fluid.layers.conv2d",
"paddle.fluid.layers.batch_norm",
"paddle.fluid.layers.multi_box_head",
"paddle.fluid.layers.elementwise_add"
] | [((8339, 8389), 'paddle.fluid.data', 'fluid.data', ([], {'name': '"""data"""', 'shape': '[None, 3, 300, 300]'}), "(name='data', shape=[None, 3, 300, 300])\n", (8349, 8389), True, 'import paddle.fluid as fluid\n'), ((1779, 2209), 'paddle.fluid.layers.multi_box_head', 'fluid.layers.multi_box_head', ([], {'inputs': '[modu... |
#! /usr/bin/env python3
import json
import os.path
import jinja2
DEFAULT_PARAMS = {
"ansible_user": "vagrant"
}
if __name__ == "__main__":
# Reading configuration
here = os.path.dirname(os.path.realpath(__file__ + "/../"))
with open(here + "/config.json", "r") as rf:
config = json.load(rf... | [
"json.load",
"jinja2.FileSystemLoader",
"json.dumps"
] | [((308, 321), 'json.load', 'json.load', (['rf'], {}), '(rf)\n', (317, 321), False, 'import json\n'), ((332, 376), 'json.dumps', 'json.dumps', (['config'], {'sort_keys': '(True)', 'indent': '(4)'}), '(config, sort_keys=True, indent=4)\n', (342, 376), False, 'import json\n'), ((1075, 1120), 'jinja2.FileSystemLoader', 'ji... |
# pylint: skip-file
import os
from assimilator import *
from Boinc import boinc_project_path
class SlimeClustersAssimilator(Assimilator):
def __init__(self):
Assimilator.__init__(self)
def assimilate_handler(self, wu, results, canonical_result):
if canonical_result == None:
return... | [
"Boinc.boinc_project_path.project_path",
"os.path.exists",
"os.path.join",
"os.makedirs"
] | [((404, 453), 'Boinc.boinc_project_path.project_path', 'boinc_project_path.project_path', (['"""slime-clusters"""'], {}), "('slime-clusters')\n", (435, 453), False, 'from Boinc import boinc_project_path\n'), ((473, 509), 'os.path.join', 'os.path.join', (['dst_dir', '"""results.txt"""'], {}), "(dst_dir, 'results.txt')\n... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | [
"numpy.cumsum",
"modin.error_message.ErrorMessage.catch_bugs_and_request_email",
"numpy.all"
] | [((2458, 2544), 'modin.error_message.ErrorMessage.catch_bugs_and_request_email', 'ErrorMessage.catch_bugs_and_request_email', (['(axis is not None and axis not in [0, 1])'], {}), '(axis is not None and axis not in\n [0, 1])\n', (2499, 2544), False, 'from modin.error_message import ErrorMessage\n'), ((2590, 2624), 'n... |
from astropy.table import Table, Column
import matplotlib.pyplot as plt
#url = "https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=pl_hostname,ra,dec&order=dec&format=csv"
url = "https://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets"
# This... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.legend",
"astropy.table.Table.read"
] | [((359, 388), 'astropy.table.Table.read', 'Table.read', (['url'], {'format': '"""csv"""'}), "(url, format='csv')\n", (369, 388), False, 'from astropy.table import Table, Column\n'), ((645, 657), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (655, 657), True, 'import matplotlib.pyplot as plt\n'), ((1455, 1... |
# Copyright (C) 2019 Cancer Care Associates
# 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 ... | [
"pymedphys._dicom.header.adjust_RED_by_structure_name",
"pymedphys._dicom.header.adjust_machine_name",
"pymedphys._dicom.header.RED_adjustment_map_from_structure_names",
"subprocess.check_call",
"pymedphys._dicom.utilities.remove_file",
"uuid.uuid4",
"os.path.dirname",
"pymedphys._dicom.create.dicom_d... | [((958, 983), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (973, 983), False, 'import os\n'), ((1256, 1309), 'pydicom.write_file', 'pydicom.write_file', (['ORIGINAL_DICOM_FILENAME', 'original'], {}), '(ORIGINAL_DICOM_FILENAME, original)\n', (1274, 1309), False, 'import pydicom\n'), ((1676, ... |
#!/usr/bin/env python3
import os, sys, re, json, requests, datetime, tarfile, argparse
from pprint import pprint
import numpy as np
from utils.UrlUtils import UrlUtils
server = 'https://qc.sentinel1.eo.esa.int/'
cal_re = re.compile(r'S1\w_AUX_CAL')
def cmdLineParse():
'''
Command line parser.
'''
... | [
"requests.session",
"tarfile.open",
"argparse.ArgumentParser",
"re.compile",
"os.makedirs",
"json.dumps",
"utils.UrlUtils.UrlUtils",
"tarfile.is_tarfile",
"os.path.join",
"os.path.isdir",
"os.path.basename",
"os.unlink",
"pprint.pprint"
] | [((225, 252), 're.compile', 're.compile', (['"""S1\\\\w_AUX_CAL"""'], {}), "('S1\\\\w_AUX_CAL')\n", (235, 252), False, 'import os, sys, re, json, requests, datetime, tarfile, argparse\n'), ((329, 426), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Fetch calibration auxiliary files inges... |
# Copyright 2005-2008, <NAME>
# Copyright 2010, 2012 <NAME>
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute, modify and/or redistribute modified versions of
# this program under the terms of the GNU Affero General Public License
# (AGPL) as published by the Free Software Fo... | [
"django.conf.urls.url",
"conservancy.feeds.BlogFeed",
"conservancy.feeds.OmnibusFeed",
"conservancy.feeds.PressReleaseFeed",
"django.conf.urls.include",
"django.contrib.admin.autodiscover"
] | [((1144, 1164), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (1162, 1164), False, 'from django.contrib import admin, admindocs\n'), ((1186, 1211), 'django.conf.urls.url', 'url', (['"""^$"""', 'frontpage.view'], {}), "('^$', frontpage.view)\n", (1189, 1211), False, 'from django.conf.urls ... |
import unittest
from unittest.mock import Mock
from graphene import Schema
from graphene.test import Client
from graphene_spike.query import Query
class MainTest(unittest.TestCase):
def setUp(self):
self.schema = Schema(query=Query)
self.client = client = Client(self.schema)
def test_hello_... | [
"graphene.Schema",
"graphene.test.Client"
] | [((229, 248), 'graphene.Schema', 'Schema', ([], {'query': 'Query'}), '(query=Query)\n', (235, 248), False, 'from graphene import Schema\n'), ((280, 299), 'graphene.test.Client', 'Client', (['self.schema'], {}), '(self.schema)\n', (286, 299), False, 'from graphene.test import Client\n')] |
from django.db import models
from django.contrib import admin
class Provider(models.Model):
name = models.CharField(max_length=50)
domain = models.CharField(max_length=50)
class Meta:
ordering = ['name']
app_label = 'api'
def __str__(self):
return self.domain
@admin.registe... | [
"django.contrib.admin.register",
"django.db.models.CharField"
] | [((307, 331), 'django.contrib.admin.register', 'admin.register', (['Provider'], {}), '(Provider)\n', (321, 331), False, 'from django.contrib import admin\n'), ((105, 136), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (121, 136), False, 'from django.db import model... |
#!/usr/bin/env python
# license removed for brevity
import rospy
from std_msgs.msg import String
from gazebo_msgs.msg import LinkState
def talker():
pub = rospy.Publisher('/gazebo/set_link_state', LinkState, queue_size=10)
ppp = LinkState()
rospy.init_node('talker', anonymous=True)
rate = rospy.R... | [
"rospy.is_shutdown",
"rospy.init_node",
"gazebo_msgs.msg.LinkState",
"rospy.Rate",
"rospy.Publisher",
"rospy.loginfo"
] | [((161, 228), 'rospy.Publisher', 'rospy.Publisher', (['"""/gazebo/set_link_state"""', 'LinkState'], {'queue_size': '(10)'}), "('/gazebo/set_link_state', LinkState, queue_size=10)\n", (176, 228), False, 'import rospy\n'), ((239, 250), 'gazebo_msgs.msg.LinkState', 'LinkState', ([], {}), '()\n', (248, 250), False, 'from g... |
import torch
from os import listdir, path
from PIL import Image
import torchvision
class DiscriminatorDataset(torch.utils.data.Dataset):
def __init__(self):
super(DiscriminatorDataset, self).__init__()
currentDir = path.dirname(__file__)
abstractDir = path.join(currentDir, 'image_data/abs... | [
"os.listdir",
"PIL.Image.open",
"os.path.join",
"os.path.dirname",
"torchvision.transforms.ToTensor"
] | [((238, 260), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (250, 260), False, 'from os import listdir, path\n'), ((283, 327), 'os.path.join', 'path.join', (['currentDir', '"""image_data/abstract"""'], {}), "(currentDir, 'image_data/abstract')\n", (292, 327), False, 'from os import listdir, pat... |
"""Tests for the HAPServer."""
from socket import timeout
from unittest.mock import Mock, MagicMock, patch
import pytest
from pyhap import hap_server
@patch('pyhap.hap_server.HAPServer.server_bind', new=MagicMock())
@patch('pyhap.hap_server.HAPServer.server_activate', new=MagicMock())
def test_finish_request_pops_s... | [
"pyhap.hap_server.HAPServer",
"unittest.mock.Mock",
"unittest.mock.MagicMock",
"socket.timeout",
"pytest.raises"
] | [((426, 432), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (430, 432), False, 'from unittest.mock import Mock, MagicMock, patch\n'), ((924, 985), 'pyhap.hap_server.HAPServer', 'hap_server.HAPServer', (['server_addr', 'amock'], {'handler_type': 'raises'}), '(server_addr, amock, handler_type=raises)\n', (944, 985), Fa... |
import torch
from torchaudio_unittest.common_utils import PytorchTestCase
from torchaudio_unittest.models.emformer.emformer_test_impl import EmformerTestImpl
class EmformerFloat32CPUTest(EmformerTestImpl, PytorchTestCase):
dtype = torch.float32
device = torch.device("cpu")
class EmformerFloat64CPUTest(Emfor... | [
"torch.device"
] | [((264, 283), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (276, 283), False, 'import torch\n'), ((390, 409), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (402, 409), False, 'import torch\n')] |
"""This module contains code for parsing RPC responses."""
from dataclasses import dataclass, field
from typing import Union, Tuple, Any, Dict, List, Optional, Literal
from apischema import alias
from apischema.conversions import as_str
from solana.publickey import PublicKey
from solana.transaction import Transactio... | [
"apischema.conversions.as_str",
"apischema.alias"
] | [((332, 349), 'apischema.conversions.as_str', 'as_str', (['PublicKey'], {}), '(PublicKey)\n', (338, 349), False, 'from apischema.conversions import as_str\n'), ((917, 935), 'apischema.alias', 'alias', (['"""rentEpoch"""'], {}), "('rentEpoch')\n", (922, 935), False, 'from apischema import alias\n'), ((3584, 3614), 'apis... |
"""
Vesper archive settings.
The Vesper server serves the Vesper archive that is in the directory
in which the server starts. The archive settings are the composition
of a set of default settings (hard-coded in this module) and settings
(optionally) specified in the file "Archive Settings.yaml" in the
archive director... | [
"vesper.archive_paths.initialize",
"vesper.util.settings.Settings.create_from_yaml",
"os.getcwd",
"sys.exit",
"vesper.util.settings_type.SettingsType"
] | [((536, 599), 'vesper.util.settings.Settings.create_from_yaml', 'Settings.create_from_yaml', (['"""\ndatabase:\n engine: SQLite\n"""'], {}), '("""\ndatabase:\n engine: SQLite\n""")\n', (561, 599), False, 'from vesper.util.settings import Settings\n'), ((619, 670), 'vesper.util.settings_type.SettingsType', 'Settin... |
import subprocess
from LEGEND import tbot as bot
from LEGEND import tbot as borg
from LEGEND.events import register
from LEGEND import OWNER_ID, SUDO_USERS
import asyncio
import traceback
import io
import os
import sys
import time
from telethon.tl import functions
from telethon.tl import types
from telethon.tl.types im... | [
"traceback.format_exc",
"LEGEND.events.register",
"LEGEND.tbot.send_file",
"io.StringIO",
"asyncio.create_subprocess_shell",
"time.time"
] | [((360, 391), 'LEGEND.events.register', 'register', ([], {'pattern': '"""^/bash (.*)"""'}), "(pattern='^/bash (.*)')\n", (368, 391), False, 'from LEGEND.events import register\n'), ((1284, 1310), 'LEGEND.events.register', 'register', ([], {'pattern': '"""^/eval"""'}), "(pattern='^/eval')\n", (1292, 1310), False, 'from ... |
# Status: Being ported by Steven Watanabe
# Base revision: 47077
#
# Copyright (c) 2005 <NAME>.
# Copyright 2006 <NAME>
# Copyright (c) 2008 <NAME>
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.... | [
"b2.build.generators.add_usage_requirements",
"b2.tools.builtin.DummyGenerator",
"b2.build.feature.feature",
"b2.build.type.register"
] | [((728, 757), 'b2.build.type.register', 'type.register', (['"""PCH"""', "['pch']"], {}), "('PCH', ['pch'])\n", (741, 757), False, 'from b2.build import type, feature, generators\n'), ((758, 791), 'b2.build.type.register', 'type.register', (['"""C_PCH"""', '[]', '"""PCH"""'], {}), "('C_PCH', [], 'PCH')\n", (771, 791), F... |