code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from rest_framework import serializers class StageSerializer(serializers.Serializer): name = serializers.CharField()
[ "rest_framework.serializers.CharField" ]
[((99, 122), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (120, 122), False, 'from rest_framework import serializers\n')]
from telebot import types, TeleBot from dynaconf import settings as _settings import pyowm bot = TeleBot(_settings.SECRET_KEY) keyboard = types.InlineKeyboardMarkup() key_yes = types.InlineKeyboardButton(text='Что у нас по погоде?', callback_data='weather') keyboard.add(key_yes) key_no = types.InlineKeyboardButton(t...
[ "telebot.types.InlineKeyboardButton", "pyowm.OWM", "telebot.TeleBot", "telebot.types.InlineKeyboardMarkup" ]
[((99, 128), 'telebot.TeleBot', 'TeleBot', (['_settings.SECRET_KEY'], {}), '(_settings.SECRET_KEY)\n', (106, 128), False, 'from telebot import types, TeleBot\n'), ((141, 169), 'telebot.types.InlineKeyboardMarkup', 'types.InlineKeyboardMarkup', ([], {}), '()\n', (167, 169), False, 'from telebot import types, TeleBot\n')...
from time import sleep, time from .api import Api class Snapshots(Api): delay = 10 def get_snapshots(self, project): return self.do_request('/naut/project/{project}/snapshots'.format(project=project)) def get_snapshot(self, project, id): return self.do_request('/naut/project/{project}/sn...
[ "time.sleep", "time.time" ]
[((1195, 1201), 'time.time', 'time', ([], {}), '()\n', (1199, 1201), False, 'from time import sleep, time\n'), ((1603, 1620), 'time.sleep', 'sleep', (['self.delay'], {}), '(self.delay)\n', (1608, 1620), False, 'from time import sleep, time\n'), ((1565, 1571), 'time.time', 'time', ([], {}), '()\n', (1569, 1571), False, ...
from Genome.NN.Layer import Layer import numpy as np import pickle class Brain: def __init__(self, brain_structure): self.brain_structure = brain_structure self.layers = [] self.id = 0 # First layer added here ids = [] genes = [] for i in range(brain_struct...
[ "numpy.random.rand", "pickle.dump", "pickle.load", "Genome.NN.Layer.Layer" ]
[((537, 547), 'Genome.NN.Layer.Layer', 'Layer', (['ids'], {}), '(ids)\n', (542, 547), False, 'from Genome.NN.Layer import Layer\n'), ((1202, 1212), 'Genome.NN.Layer.Layer', 'Layer', (['ids'], {}), '(ids)\n', (1207, 1212), False, 'from Genome.NN.Layer import Layer\n'), ((1500, 1510), 'Genome.NN.Layer.Layer', 'Layer', ([...
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Task,Utils,Logs,Errors,ConfigSet,Node feats=Utils.defaultdict(set) class task_gen(object): mappings={} prec=Utils.defaultdict(list) def...
[ "waflib.ConfigSet.ConfigSet", "waflib.Task.always_run", "waflib.Errors.WafError", "waflib.Logs.debug", "waflib.Task.task_factory", "waflib.Utils.h_list", "waflib.Utils.to_list", "waflib.Utils.defaultdict", "waflib.Logs.warn", "waflib.Task.update_outputs", "waflib.Utils.h_fun", "re.compile" ]
[((226, 248), 'waflib.Utils.defaultdict', 'Utils.defaultdict', (['set'], {}), '(set)\n', (243, 248), False, 'from waflib import Task, Utils, Logs, Errors, ConfigSet, Node\n'), ((8419, 8447), 're.compile', 're.compile', (['"""@(\\\\w+)@"""', 're.M'], {}), "('@(\\\\w+)@', re.M)\n", (8429, 8447), False, 'import copy, re, ...
# !/usr/bin/python3 # coding: utf-8 # Copyright 2015-2018 # # 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...
[ "cv2.GaussianBlur", "numpy.sum", "cv2.medianBlur", "numpy.ones", "cv2.bilateralFilter", "cv2.warpAffine", "os.path.isfile", "numpy.arange", "cv2.minAreaRect", "cv2.normalize", "cv2.erode", "cv2.absdiff", "wand.image.Image", "cv2.getRotationMatrix2D", "os.path.join", "cv2.dilate", "cv...
[((906, 917), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (915, 917), False, 'import os\n'), ((933, 968), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""data/img"""'], {}), "(BASE_PATH, 'data/img')\n", (945, 968), False, 'import os\n'), ((982, 1017), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""data/tmp"""'],...
import unittest from unittest.mock import MagicMock from ocrd_browser.view import ViewImages from ocrd_browser.ui import MainWindow from tests import TestCase class ViewImagesTestCase(TestCase): def setUp(self): self.vx = ViewImages('unique', MagicMock(spec=MainWindow)) def test_can_construct(self):...
[ "unittest.main", "unittest.mock.MagicMock" ]
[((392, 407), 'unittest.main', 'unittest.main', ([], {}), '()\n', (405, 407), False, 'import unittest\n'), ((258, 284), 'unittest.mock.MagicMock', 'MagicMock', ([], {'spec': 'MainWindow'}), '(spec=MainWindow)\n', (267, 284), False, 'from unittest.mock import MagicMock\n')]
from __future__ import absolute_import, division, print_function import types import time from threading import Thread from manhattan.record import Record, PageRecord, GoalRecord from manhattan.log.timerotating import TimeRotatingLog from .base import BaseTest, work_path def set_fake_name(log, index): def fake...
[ "threading.Thread", "manhattan.log.timerotating.TimeRotatingLog", "manhattan.record.GoalRecord", "types.MethodType", "manhattan.record.Record.from_list", "time.sleep", "manhattan.record.PageRecord" ]
[((411, 443), 'types.MethodType', 'types.MethodType', (['fake_name', 'log'], {}), '(fake_name, log)\n', (427, 443), False, 'import types\n'), ((793, 830), 'threading.Thread', 'Thread', ([], {'target': 'consume', 'args': '(log_r,)'}), '(target=consume, args=(log_r,))\n', (799, 830), False, 'from threading import Thread\...
import argparse import d3rlpy def main(): parser = argparse.ArgumentParser() parser.add_argument('--game', type=str, default='breakout') parser.add_argument('--seed', type=int, default=1) parser.add_argument('--gpu', type=int) args = parser.parse_args() d3rlpy.seed(args.seed) dataset, en...
[ "d3rlpy.preprocessing.ClipRewardScaler", "argparse.ArgumentParser", "d3rlpy.datasets.get_atari_transitions", "d3rlpy.models.optimizers.AdamFactory", "d3rlpy.metrics.evaluate_on_environment", "d3rlpy.seed", "d3rlpy.models.q_functions.QRQFunctionFactory" ]
[((57, 82), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (80, 82), False, 'import argparse\n'), ((281, 303), 'd3rlpy.seed', 'd3rlpy.seed', (['args.seed'], {}), '(args.seed)\n', (292, 303), False, 'import d3rlpy\n'), ((324, 434), 'd3rlpy.datasets.get_atari_transitions', 'd3rlpy.datasets.get_at...
""" trajectory/utils/prereqs.py Author: <NAME> Define a collection of useful utility functions for analyzing course and departmental prerequisite structures. """ def get_prereq_graph(course_id, format=None): """ Generate a graph of prerequisites within a course. If format is not requested, simply return ...
[ "networkx.readwrite.json_graph.adjacency_data", "trajectory.models.meta.session.query", "networkx.readwrite.json_graph.node_link_data", "networkx.spring_layout", "trajectory.utils.common.row2dict", "networkx.DiGraph" ]
[((1041, 1053), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (1051, 1053), True, 'import networkx as nx\n'), ((2728, 2747), 'networkx.spring_layout', 'nx.spring_layout', (['G'], {}), '(G)\n', (2744, 2747), True, 'import networkx as nx\n'), ((1526, 1542), 'trajectory.utils.common.row2dict', 'row2dict', (['course'...
import re import keras.backend as keras_backend from keras.layers import DepthwiseConv2D import numpy as np from traits.api import Float, HasStrictTraits, Instance, Int, Tuple, Property from blusky.wavelets.i_wavelet_2d import IWavelet2D class ApplyFatherWavlet2D(HasStrictTraits): """ Provides a "convolut...
[ "traits.api.Instance", "numpy.iscomplexobj", "traits.api.Property", "keras.layers.DepthwiseConv2D", "keras.backend.variable", "traits.api.Int", "numpy.log2", "numpy.zeros", "re.sub" ]
[((1557, 1563), 'traits.api.Int', 'Int', (['(2)'], {}), '(2)\n', (1560, 1563), False, 'from traits.api import Float, HasStrictTraits, Instance, Int, Tuple, Property\n'), ((1770, 1776), 'traits.api.Int', 'Int', (['(0)'], {}), '(0)\n', (1773, 1776), False, 'from traits.api import Float, HasStrictTraits, Instance, Int, Tu...
import networkx as nx from matplotlib.pyplot import draw, show, clf from mason import mason def add_node(g, node): if node == "": return "Add name to the node" g.add_node(node) return "Node added successfully" def remove_node(g, node): if g.has_node(node): g.remove_no...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "matplotlib.pyplot.draw", "networkx.spring_layout", "networkx.draw", "networkx.draw_networkx_edge_labels", "mason.mason" ]
[((1823, 1828), 'matplotlib.pyplot.clf', 'clf', ([], {}), '()\n', (1826, 1828), False, 'from matplotlib.pyplot import draw, show, clf\n'), ((1840, 1859), 'networkx.spring_layout', 'nx.spring_layout', (['g'], {}), '(g)\n', (1856, 1859), True, 'import networkx as nx\n'), ((1865, 1931), 'networkx.draw', 'nx.draw', (['g', ...
# Generated by Django 2.2.24 on 2022-04-20 16:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ptart', '0010_project_archived'), ] operations = [ migrations.AddField( model_name='label', name='deprecated', ...
[ "django.db.models.BooleanField" ]
[((334, 368), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (353, 368), False, 'from django.db import migrations, models\n')]
import time from .base import FunctionalTest from catalog.models import Book from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select bookCatalogLink = '/catalog/books/' bookDetailsLink = '/catalog/book/' class TestBookPage(FunctionalTest): submit_selector = 'input[type=su...
[ "catalog.models.Book.objects.all", "time.sleep" ]
[((1004, 1017), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1014, 1017), False, 'import time\n'), ((1382, 1396), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (1392, 1396), False, 'import time\n'), ((2266, 2279), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (2276, 2279), False, 'import time\n'),...
from model_boundd import MIPwithBounds import networkx as nx def get_vars_and_coefficients(elements, start=3): """Use a list which comes from line.split() to create lists of float coefficients and SCIP variables.""" return [var for var in elements[start + 1::2]], [float(coeff) for coeff in elements[start::2]]...
[ "model_boundd.MIPwithBounds", "networkx.DiGraph", "networkx.topological_sort" ]
[((762, 774), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (772, 774), True, 'import networkx as nx\n'), ((886, 916), 'model_boundd.MIPwithBounds', 'MIPwithBounds', (['filepath', '(1e-07)'], {}), '(filepath, 1e-07)\n', (899, 916), False, 'from model_boundd import MIPwithBounds\n'), ((4297, 4323), 'networkx.topol...
#! python3 import random numberOfStreaks = 0 for experimentNumber in range(10000): # Code that creates a list of 100 'heads' or 'tails' values. randomList = [] for listEntry in range(100): if random.randint(0,1) == 1: randomList.append('H') else: randomList.append('T...
[ "random.randint" ]
[((213, 233), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (227, 233), False, 'import random\n')]
from django.shortcuts import render, redirect from django_eveonline_connector.models import EveClient, EveToken, EveCharacter, EveScope, EveCorporation, PrimaryEveCharacterAssociation from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required from django.conf impo...
[ "django.contrib.messages.success", "django_eveonline_connector.models.PrimaryEveCharacterAssociation.objects.create", "django.shortcuts.redirect", "django_eveonline_connector.models.EveToken.objects.get_or_create", "django.contrib.messages.error", "django_eveonline_connector.models.EveToken.objects.get", ...
[((357, 384), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (374, 384), False, 'import logging\n'), ((507, 531), 'django_eveonline_connector.models.EveClient.get_instance', 'EveClient.get_instance', ([], {}), '()\n', (529, 531), False, 'from django_eveonline_connector.models import EveCl...
from project.server.common.escape import cleanify class TestReplacements: def test_ae(self): assert cleanify("") == "" assert cleanify("Äpfel") == "Aepfel" assert cleanify("äpfel") == "aepfel" assert cleanify("Äpfel Äpfel äpfel") == "Aepfel Aepfel aepfel" def test_...
[ "project.server.common.escape.cleanify" ]
[((121, 133), 'project.server.common.escape.cleanify', 'cleanify', (['""""""'], {}), "('')\n", (129, 133), False, 'from project.server.common.escape import cleanify\n'), ((156, 173), 'project.server.common.escape.cleanify', 'cleanify', (['"""Äpfel"""'], {}), "('Äpfel')\n", (164, 173), False, 'from project.server.common...
#!/usr/local/bin/python3.5 -u import sys sys.stdout.write("Enter a number: ") a = float(sys.stdin.readline()) if a < 0: print("negative") elif a == 0: print("zero") elif a < 10: print("small") else: print("large")
[ "sys.stdout.write", "sys.stdin.readline" ]
[((41, 77), 'sys.stdout.write', 'sys.stdout.write', (['"""Enter a number: """'], {}), "('Enter a number: ')\n", (57, 77), False, 'import sys\n'), ((88, 108), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (106, 108), False, 'import sys\n')]
# Copyright 2021, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
[ "jinja2.PackageLoader" ]
[((1450, 1496), 'jinja2.PackageLoader', 'jinja2.PackageLoader', (['module_name', '"""templates"""'], {}), "(module_name, 'templates')\n", (1470, 1496), False, 'import jinja2\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # Import modules import pytest import numpy as np # Import from package from pyswarms.discrete import BinaryPSO @pytest.mark.parametrize( "options", [ {"c2": 0.7, "w": 0.5, "k": 2, "p": 2}, {"c1": 0.5, "w": 0.5, "k": 2, "p": 2}, {"c1": 0....
[ "pytest.mark.parametrize", "pytest.raises", "numpy.array", "pyswarms.discrete.BinaryPSO" ]
[((163, 414), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""options"""', "[{'c2': 0.7, 'w': 0.5, 'k': 2, 'p': 2}, {'c1': 0.5, 'w': 0.5, 'k': 2, 'p': \n 2}, {'c1': 0.5, 'c2': 0.7, 'k': 2, 'p': 2}, {'c1': 0.5, 'c2': 0.7, 'w':\n 0.5, 'p': 2}, {'c1': 0.5, 'c2': 0.7, 'w': 0.5, 'k': 2}]"], {}), "('options...
"""pytest-faker plugin.""" import pytest from faker import Factory @pytest.fixture(scope='session') def faker_locale(): """Faker locale. None by default which means faker's default locale. """ return None @pytest.fixture(scope='session') def faker(faker_locale): """Faker factory object.""" ...
[ "pytest.fixture", "faker.Factory.create" ]
[((71, 102), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (85, 102), False, 'import pytest\n'), ((228, 259), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (242, 259), False, 'import pytest\n'), ((328, 356), 'faker.Factory.cre...
# Copyright 2017 Google Inc. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # #...
[ "deepvariant.core.genomics.struct_pb2.Value", "deepvariant.core.genomics.variants_pb2.Variant.FromString", "deepvariant.core.ranges.make_range" ]
[((2951, 3026), 'deepvariant.core.ranges.make_range', 'ranges.make_range', (['variant.reference_name', 'variant.start', '(variant.start + 1)'], {}), '(variant.reference_name, variant.start, variant.start + 1)\n', (2968, 3026), False, 'from deepvariant.core import ranges\n'), ((3285, 3354), 'deepvariant.core.ranges.make...
import MulensModel as mm import Functions as mc import random import numpy as np import matplotlib.pyplot as plt from matplotlib import rc import matplotlib from scipy.stats import truncnorm, loguniform, uniform #plt.style.use('ggplot') print(plt.style.available) #print(plt.rcParams["font.family"].available) #print...
[ "matplotlib.pyplot.title", "Functions.truncatedLogNormDist", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "Functions.uniDist", "matplotlib.pyplot.style.use", "numpy.array", "numpy.linspace", "Functions.logUniDist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.py...
[((613, 634), 'Functions.logUniDist', 'mc.logUniDist', (['(0.2)', '(5)'], {}), '(0.2, 5)\n', (626, 634), True, 'import Functions as mc\n'), ((642, 665), 'Functions.logUniDist', 'mc.logUniDist', (['(1e-05)', '(1)'], {}), '(1e-05, 1)\n', (655, 665), True, 'import Functions as mc\n'), ((677, 695), 'Functions.uniDist', 'mc...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from ase import Atoms from ase.constraints import dict2constraint import copy import importlib import numpy as np from p...
[ "ase.constraints.dict2constraint", "copy.deepcopy", "ase.cell.Cell", "numpy.asarray", "pyiron_atomistics.atomistics.job.interactive.GenericInteractive.structure.fset", "numpy.array", "pyiron_atomistics.atomistics.structure.atoms.pyiron_to_ase", "pyiron_atomistics.atomistics.job.interactive.GenericInte...
[((2640, 2665), 'copy.deepcopy', 'copy.deepcopy', (['atoms_dict'], {}), '(atoms_dict)\n', (2653, 2665), False, 'import copy\n'), ((3278, 3302), 'ase.Atoms', 'Atoms', ([], {}), '(**atoms_dict_copy)\n', (3283, 3302), False, 'from ase import Atoms\n'), ((1159, 1188), 'copy.deepcopy', 'copy.deepcopy', (['structure.info'], ...
from sqlalchemy import Column, Integer, Float, String, Boolean, ForeignKey from sqlalchemy.orm import relationship, backref from mps_database.models import Base class ThresholdFault(Base): """ ThresholdFault class (threshold_faults table) Describe an analog fault, which is generated by an AnalogDevice. The An...
[ "sqlalchemy.orm.relationship", "sqlalchemy.ForeignKey", "sqlalchemy.Column" ]
[((1436, 1469), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (1442, 1469), False, 'from sqlalchemy import Column, Integer, Float, String, Boolean, ForeignKey\n'), ((1479, 1509), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)'}), '(String, n...
import numpy as np from logistic_regression import logistic_kernel_regression, compute_label from kernel_creation import convert_spectral_kernel_quad, convert_spectral_kernel_quint, convert_spectral_kernel_trig from kernel_creation import convert_acid_kernel, convert_acid_quad, convert_mismatch_lev, convert_lect_trig, ...
[ "read_fn.save_label", "kernel_creation.get_mismatch_dict", "kernel_creation.compute_test_matrix", "numpy.sum", "numpy.linalg.eigvals", "SVM.SVM", "numpy.asarray", "numpy.identity", "read_fn.read_csv_file_label", "kernel_creation.compute_K_matrix", "SVM.svm_compute_label", "numpy.mean", "kern...
[((7342, 7412), 'read_fn.save_label', 'save_label', (['(0)', 'list_labels_svm', '"""results/SVM-quint-centered-mixed.csv"""'], {}), "(0, list_labels_svm, 'results/SVM-quint-centered-mixed.csv')\n", (7352, 7412), False, 'from read_fn import read_csv_file_label, read_csv_file_data, save_label, save_data_converted\n'), ((...
# -*- coding: utf-8 -*- import unittest import networkx from challenge.algorithm import dijkstras_shortest_path class TestAlgorithmModule(unittest.TestCase): def test_empty_graph(self): """Nodes are memebers of graph.nodes""" graph = networkx.Graph() with self.assertRaises(ValueError): ...
[ "unittest.main", "networkx.Graph", "challenge.algorithm.dijkstras_shortest_path" ]
[((1965, 1980), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1978, 1980), False, 'import unittest\n'), ((258, 274), 'networkx.Graph', 'networkx.Graph', ([], {}), '()\n', (272, 274), False, 'import networkx\n'), ((425, 441), 'networkx.Graph', 'networkx.Graph', ([], {}), '()\n', (439, 441), False, 'import network...
import os import re import subprocess import sys from enum import Enum from pathlib import Path from typing import Any, Optional, Tuple import click import click._bashcomplete from .models import ParamMeta from .params import Option from .utils import get_params_from_function try: import shellingham except Impor...
[ "subprocess.run", "click.parser.split_arg_string", "click.exceptions.Exit", "pathlib.Path.home", "click.get_current_context", "click.echo", "click._bashcomplete.get_choices", "shellingham.detect_shell", "click.secho", "re.sub", "os.getenv", "sys.exit" ]
[((520, 577), 'os.getenv', 'os.getenv', (['"""_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION"""'], {}), "('_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION')\n", (529, 577), False, 'import os\n'), ((1224, 1290), 'click.secho', 'click.secho', (['f"""{shell} completion installed in {path}"""'], {'fg': '"""green"""'}), "(f'{she...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-07-15 13:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("program", "0041_auto_20170711_2248")] operations = [ migrations.AddField( mo...
[ "django.db.models.TextField" ]
[((401, 546), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'help_text': '"""Private notes for the event. Only visible to the submitting user and the BornHack organisers."""'}), "(blank=True, help_text=\n 'Private notes for the event. Only visible to the submitting user and the BornHack ...
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project """ Utilities related to process/script execution. """ from rez.vendor.six import six from rez.utils.yaml import dump_yaml from rez.vendor.enum import Enum from contextlib import contextmanager import subprocess import sys import stat ...
[ "os.chmod", "sys.__stdin__.fileno", "sys.path.extend", "os.path.splitext", "sys.stdin.fileno", "rez.utils.yaml.dump_yaml", "rez.utils.sourcecode.SourceCode" ]
[((481, 503), 'sys.path.extend', 'sys.path.extend', (['paths'], {}), '(paths)\n', (496, 503), False, 'import sys\n'), ((7219, 7245), 'os.path.splitext', 'os.path.splitext', (['filepath'], {}), '(filepath)\n', (7235, 7245), False, 'import os\n'), ((8797, 8811), 'rez.utils.yaml.dump_yaml', 'dump_yaml', (['doc'], {}), '(d...
import pickle from . import ClientConstants as CC from . import ClientNetworkingContexts from . import ClientNetworkingDomain from . import HydrusData from . import HydrusSerialisable from . import HydrusGlobals as HG import requests import threading try: import socket import socks SOCKS_PROXY_OK...
[ "threading.Lock", "requests.Session", "pickle.dumps" ]
[((847, 863), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (861, 863), False, 'import threading\n'), ((1884, 1902), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1900, 1902), False, 'import requests\n'), ((2232, 2253), 'pickle.dumps', 'pickle.dumps', (['session'], {}), '(session)\n', (2244, 2253),...
# -*- coding: UTF-8 -*- import unittest import uuid import pytz from geopy import Point from geopy.compat import u from geopy.exc import GeocoderAuthenticationFailure, GeocoderQueryError from geopy.geocoders import GeoNames from test.geocoders.util import GeocoderTestBase, env class GeoNamesTestCaseUnitTest(Geocode...
[ "pytz.FixedOffset", "geopy.compat.u", "uuid.uuid4", "geopy.geocoders.GeoNames", "pytz.timezone", "test.geocoders.util.env.get", "geopy.Point" ]
[((390, 460), 'geopy.geocoders.GeoNames', 'GeoNames', ([], {'username': '"""DUMMYUSER_NORBERT"""', 'user_agent': '"""my_user_agent/1.0"""'}), "(username='DUMMYUSER_NORBERT', user_agent='my_user_agent/1.0')\n", (398, 460), False, 'from geopy.geocoders import GeoNames\n'), ((809, 852), 'geopy.geocoders.GeoNames', 'GeoNam...
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from cwr.grammar.field import basic, special, table, filename """ CWR fields grammar adapters. These classes allow the factories to create rules in an homogeneous way, by setting a basic interface which will wrap around field rules, giving a basic comm...
[ "cwr.grammar.field.basic.flag", "cwr.grammar.field.special.isrc", "cwr.grammar.field.special.percentage", "cwr.grammar.field.special.visan", "cwr.grammar.field.table.char_code", "cwr.grammar.field.basic.numeric_float", "cwr.grammar.field.special.lookup_int", "cwr.grammar.field.special.ipi_base_number"...
[((2373, 2418), 'cwr.grammar.field.basic.alphanum', 'basic.alphanum', (['columns', 'name'], {'extended': '(False)'}), '(columns, name, extended=False)\n', (2387, 2418), False, 'from cwr.grammar.field import basic, special, table, filename\n'), ((3148, 3192), 'cwr.grammar.field.basic.alphanum', 'basic.alphanum', (['colu...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.swahili import swahili def test_swahili(): """Test module swahili.py by downloading swahili.csv and testing shape of extracted data has 48...
[ "shutil.rmtree", "tempfile.mkdtemp", "observations.r.swahili.swahili" ]
[((361, 379), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (377, 379), False, 'import tempfile\n'), ((402, 420), 'observations.r.swahili.swahili', 'swahili', (['test_path'], {}), '(test_path)\n', (409, 420), False, 'from observations.r.swahili import swahili\n'), ((479, 503), 'shutil.rmtree', 'shutil.rmtre...
import json import boto3 dynamo = boto3.resource("dynamodb") table = dynamo.Table("Attendance_Count") def lambda_handler(event, context): # TODO implement res = table.get_item(Key = {"RollNo" : event['RollNo']}) print(res['Item']['Name']) Count = res['Item']['Count'] Count= Count+1 ...
[ "boto3.resource" ]
[((38, 64), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (52, 64), False, 'import boto3\n')]
# Python import datetime import logging # Django from django.core.management.base import BaseCommand, CommandError from django.db import transaction from django.utils.timezone import now # CyBorgBackup from cyborgbackup.main.models import Job, Repository class Command(BaseCommand): ''' Management command t...
[ "cyborgbackup.main.models.Job.objects.filter", "cyborgbackup.main.models.Repository.objects.filter" ]
[((926, 962), 'cyborgbackup.main.models.Job.objects.filter', 'Job.objects.filter', ([], {'status': '"""running"""'}), "(status='running')\n", (944, 962), False, 'from cyborgbackup.main.models import Job, Repository\n'), ((1081, 1120), 'cyborgbackup.main.models.Repository.objects.filter', 'Repository.objects.filter', ([...
import _thread import time import hashlib from django.core.exceptions import ValidationError from django.db import transaction from django.db.models import Q from django.conf import settings from django.template.defaultfilters import slugify from SocialNetwork_API.services.base import BaseService from SocialNetwork_A...
[ "django.template.defaultfilters.slugify", "django.db.transaction.atomic", "django.db.models.Q", "time.time" ]
[((4231, 4260), 'django.db.models.Q', 'Q', ([], {'username__icontains': 'search'}), '(username__icontains=search)\n', (4232, 4260), False, 'from django.db.models import Q\n'), ((2057, 2087), 'django.template.defaultfilters.slugify', 'slugify', (["user_data['username']"], {}), "(user_data['username'])\n", (2064, 2087), ...
import base64 from io import BytesIO from os.path import dirname from typing import Tuple from collections import deque from PIL import Image, ImageFont, ImageDraw, ImageOps font_size = 70 line_gap = 20 body_pos = (205, 340) subtitle_pos = (790, 320) body_color = (0, 0, 0, 255) subtitle_color = (129, 212, 250, 255) li...
[ "io.BytesIO", "PIL.Image.new", "os.path.dirname", "PIL.ImageDraw.Draw", "collections.deque" ]
[((731, 740), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (738, 740), False, 'from io import BytesIO\n'), ((958, 992), 'PIL.Image.new', 'Image.new', (['"""RGBA"""', '(width, height)'], {}), "('RGBA', (width, height))\n", (967, 992), False, 'from PIL import Image, ImageFont, ImageDraw, ImageOps\n'), ((1005, 1027), 'PIL.I...
import os from collections import OrderedDict import pytest from ruamel.yaml import YAML from cli.src.helpers.build_io import (ANSIBLE_CFG_FILE, ANSIBLE_INVENTORY_FILE, ANSIBLE_OUTPUT_DIR, ANSIBLE_VAULT_OUTPUT_DIR, ...
[ "cli.src.helpers.build_io.get_ansible_vault_path", "cli.src.helpers.objdict_helpers.dict_to_objdict", "cli.src.helpers.build_io.save_manifest", "cli.src.helpers.build_io.get_ansible_path", "cli.src.helpers.build_io.save_inventory", "cli.src.helpers.build_io.get_inventory_path", "os.path.join", "cli.sr...
[((2113, 2138), 'os.path.join', 'os.path.join', (['OUTPUT_PATH'], {}), '(OUTPUT_PATH)\n', (2125, 2138), False, 'import os\n'), ((2205, 2232), 'os.path.exists', 'os.path.exists', (['output_path'], {}), '(output_path)\n', (2219, 2232), False, 'import os\n'), ((2317, 2361), 'os.path.join', 'os.path.join', (['OUTPUT_PATH',...
# # Developing a classification Audit trend # # In first iteration, this will only work on datasets that already have two or more binary classification variables included. # # We will need additional metadata: role options of being predictions or ground truths. # import pytest import numpy as np import pandas as pd i...
[ "wiggum.Binary_TPR_Trend", "wiggum.Binary_Error_Trend", "wiggum.Binary_F1_Trend", "wiggum.LabeledDataFrame", "wiggum.Binary_Accuracy_Trend", "wiggum.Binary_FDR_Trend", "wiggum.Binary_PPV_Trend", "wiggum.Binary_FNR_Trend", "wiggum.Binary_TNR_Trend" ]
[((505, 533), 'wiggum.LabeledDataFrame', 'wg.LabeledDataFrame', (['dataset'], {}), '(dataset)\n', (524, 533), True, 'import wiggum as wg\n'), ((551, 577), 'wiggum.Binary_Accuracy_Trend', 'wg.Binary_Accuracy_Trend', ([], {}), '()\n', (575, 577), True, 'import wiggum as wg\n'), ((594, 615), 'wiggum.Binary_TPR_Trend', 'wg...
# -*- coding: utf-8 -*- from enum import Enum import operator as op from typing import TypeVar, Callable from dewloosh.core.tools import getasany from .function import Function __all__ = ['Equality', 'InEquality'] class Relations(Enum): eq = '=' gt = '>' ge = '>=' lt = '<' le = '<=' def t...
[ "typing.TypeVar", "dewloosh.core.tools.getasany" ]
[((523, 572), 'typing.TypeVar', 'TypeVar', (['"""RelationType"""', 'str', 'Relations', 'Callable'], {}), "('RelationType', str, Relations, Callable)\n", (530, 572), False, 'from typing import TypeVar, Callable\n'), ((748, 792), 'dewloosh.core.tools.getasany', 'getasany', (["['op', 'operator']", 'None'], {}), "(['op', '...
""" python -m tests.database """ try: import _thread except ImportError: import thread as _thread from bigorm.database import BigQueryDatabaseContext as DatabaseContext from tests import UNIT_TEST_PROJECT def _open_context(): with DatabaseContext(project=UNIT_TEST_PROJECT): DatabaseContext.get_s...
[ "bigorm.database.BigQueryDatabaseContext", "thread.start_new_thread", "bigorm.database.BigQueryDatabaseContext.get_session" ]
[((437, 480), 'thread.start_new_thread', '_thread.start_new_thread', (['_open_context', '()'], {}), '(_open_context, ())\n', (461, 480), True, 'import thread as _thread\n'), ((247, 289), 'bigorm.database.BigQueryDatabaseContext', 'DatabaseContext', ([], {'project': 'UNIT_TEST_PROJECT'}), '(project=UNIT_TEST_PROJECT)\n'...
from django.db import models class Region(models.Model): region_name = models.CharField(max_length=30, primary_key=True) def __str__(self): return self.region_name class Country(models.Model): country_name = models.CharField(max_length=30, primary_key=True) region = models.ForeignKey(Region, on_delete=models....
[ "django.db.models.CharField", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey" ]
[((74, 123), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(30)', 'primary_key': '(True)'}), '(max_length=30, primary_key=True)\n', (90, 123), False, 'from django.db import models\n'), ((217, 266), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(30)', 'primary_key': '(Tr...
from address_extractor import datafile def load_street_types(): return set(line.strip().lower() for line in datafile.read_street_types()) STREET_TYPES = load_street_types() def is_valid(token): return token.lower() in STREET_TYPES
[ "address_extractor.datafile.read_street_types" ]
[((118, 146), 'address_extractor.datafile.read_street_types', 'datafile.read_street_types', ([], {}), '()\n', (144, 146), False, 'from address_extractor import datafile\n')]
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
[ "unittest.main" ]
[((1672, 1687), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1685, 1687), False, 'import unittest\n')]
####################################### # --- Day 5: Hydrothermal Venture --- # ####################################### from collections import defaultdict import AOCUtils def get_overlap_count(vents, part_two=False): grid = defaultdict(int) for start, end in vents: delta = None if start[0] =...
[ "collections.defaultdict", "AOCUtils.print_time_taken", "AOCUtils.load_input" ]
[((842, 864), 'AOCUtils.load_input', 'AOCUtils.load_input', (['(5)'], {}), '(5)\n', (861, 864), False, 'import AOCUtils\n'), ((1221, 1248), 'AOCUtils.print_time_taken', 'AOCUtils.print_time_taken', ([], {}), '()\n', (1246, 1248), False, 'import AOCUtils\n'), ((231, 247), 'collections.defaultdict', 'defaultdict', (['int...
# -*- coding: utf-8 -*- from django.views import View from django.shortcuts import render from apps.accounts.models.choices import ActionCategory from apps.accounts.models.pending_action import PendingAction from apps.accounts.services.auth_service import AuthService class ConfirmEmailView(View): """Renders the...
[ "django.shortcuts.render", "apps.accounts.models.pending_action.PendingAction.objects.get", "apps.accounts.services.auth_service.AuthService.confirm_email" ]
[((906, 965), 'django.shortcuts.render', 'render', (['request', '"""transactions/confirm_email.html"""', 'context'], {}), "(request, 'transactions/confirm_email.html', context)\n", (912, 965), False, 'from django.shortcuts import render\n'), ((519, 596), 'apps.accounts.models.pending_action.PendingAction.objects.get', ...
""" Notebook """ import datetime last_id = 0 class Note: def __init__(self, memo, tags=''): self.memo = memo self.tags = tags self.creation_date = datetime.date.today() global last_id last_id += 1 self.id = last_id def match(self, filter): return filter ...
[ "datetime.date.today" ]
[((177, 198), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (196, 198), False, 'import datetime\n')]
# # @@@ START COPYRIGHT @@@ # #Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"...
[ "os.environ.get", "xml.dom.minidom.parse" ]
[((886, 916), 'os.environ.get', 'os.environ.get', (['"""DCS_CONF_DIR"""'], {}), "('DCS_CONF_DIR')\n", (900, 916), False, 'import os\n'), ((1022, 1068), 'xml.dom.minidom.parse', 'minidom.parse', (["(dcsconfig_dir + '/dcs-site.xml')"], {}), "(dcsconfig_dir + '/dcs-site.xml')\n", (1035, 1068), False, 'from xml.dom import ...
""" How to reference supporting evidence for some object in the database. See: "Metadata in PyOpenWorm" for discussion on semantics of what giving evidence for an object means. """ from __future__ import absolute_import from __future__ import print_function import PyOpenWorm as P from PyOpenWorm.evidence import Evide...
[ "PyOpenWorm.disconnect", "PyOpenWorm.context.Context", "PyOpenWorm.data.Data", "PyOpenWorm.connect" ]
[((518, 524), 'PyOpenWorm.data.Data', 'Data', ([], {}), '()\n', (522, 524), False, 'from PyOpenWorm.data import Data\n'), ((580, 597), 'PyOpenWorm.connect', 'P.connect', ([], {'conf': 'd'}), '(conf=d)\n', (589, 597), True, 'import PyOpenWorm as P\n'), ((605, 661), 'PyOpenWorm.context.Context', 'Context', ([], {'ident':...
from flask_wtf import FlaskForm from wtforms import TextField, PasswordField from wtforms.validators import DataRequired, Length, Email, EqualTo class LoginForm(FlaskForm): username = TextField("Login", validators=[DataRequired(), Length(min=6, max=20)]) password = PasswordField("Password", validators=...
[ "wtforms.validators.Email", "wtforms.validators.DataRequired", "wtforms.validators.Length", "wtforms.validators.EqualTo" ]
[((227, 241), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (239, 241), False, 'from wtforms.validators import DataRequired, Length, Email, EqualTo\n'), ((243, 264), 'wtforms.validators.Length', 'Length', ([], {'min': '(6)', 'max': '(20)'}), '(min=6, max=20)\n', (249, 264), False, 'from wtforms.v...
from setuptools import setup setup(name='rcssl', version='1.5', description='Install Let\'s Encrypt SSL on RunCloud servers the easy way.', author="Rehmat", author_email="<EMAIL>", url="https://github.com/rehmatworks/runcloud-letsencrypt", license="MIT", entry_points={ 'console_scripts': [ 'rcssl = rcssl.r...
[ "setuptools.setup" ]
[((30, 396), 'setuptools.setup', 'setup', ([], {'name': '"""rcssl"""', 'version': '"""1.5"""', 'description': '"""Install Let\'s Encrypt SSL on RunCloud servers the easy way."""', 'author': '"""Rehmat"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/rehmatworks/runcloud-letsencrypt"""', 'license': '"...
import re import json import sys import os args = sys.argv if (len(args) < 2): sys.exit(1) path = args[1] if(path[-1:] == "/"): path = path[:-1] result_filedata_list = [] count = 0 while True: # Decectory exist check dirpath = path + '/command/' + str(count) if os.path.isdir(dirpath): co...
[ "json.load", "os.path.isdir", "os.path.getsize", "json.dumps", "os.path.isfile", "sys.exit" ]
[((84, 95), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (92, 95), False, 'import sys\n'), ((286, 308), 'os.path.isdir', 'os.path.isdir', (['dirpath'], {}), '(dirpath)\n', (299, 308), False, 'import os\n'), ((2044, 2062), 'json.dumps', 'json.dumps', (['result'], {}), '(result)\n', (2054, 2062), False, 'import json\n...
#!/usr/bin/python # coding=utf-8 import sys import csv import datetime #run with python timezone.py 8.30 pdt eest # time timezone timezone-of-conversion def main(): # check if correct ammount of arguments doesnt work otherwise if len(sys.argv) != 4: print('Incorrect amount of arguments.') ...
[ "datetime.datetime.strptime", "csv.reader", "datetime.timedelta", "sys.exit" ]
[((2318, 2329), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2326, 2329), False, 'import sys\n'), ((2739, 2750), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2747, 2750), False, 'import sys\n'), ((324, 335), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (332, 335), False, 'import sys\n'), ((467, 501), 'csv.re...
# Script wh helps to plot Figures 3A and 3B import matplotlib.pyplot as plt import pandas as pd import numpy as np # Include all GENES, those containing Indels and SNVS (that's why I repeat this step of loading "alleles" dataframe) This prevents badly groupping in 20210105_plotStacked...INDELS.py alleles = pd.read_csv...
[ "pandas.DataFrame", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.barh", "numpy.arange", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotl...
[((309, 363), 'pandas.read_csv', 'pd.read_csv', (['"""/path/to/Alleles_20201228.csv"""'], {'sep': '"""\t"""'}), "('/path/to/Alleles_20201228.csv', sep='\\t')\n", (320, 363), True, 'import pandas as pd\n'), ((629, 686), 'pandas.read_csv', 'pd.read_csv', (['"""/path/to/phenotypes_20210107.csv"""'], {'sep': '"""\t"""'}), ...
from plot_common import output_graph # results of N = 5, 10, 15, 20 Ns = [5, 10, 15, 20] large_dataset_precisions = { 'SKBPR-BC': (Ns, [0.0366, 0.0297, 0.0263, 0.0244], [0.0004, 0.0003, 0.0002, 0.0002], [0.0002, 0.0003, 0.0003, 0.0003]), 'SKBPR-BC-SEQ': (Ns, [0.0363, 0.0293, 0.0260, 0.0241], [0.0001, 0.0002, ...
[ "plot_common.output_graph" ]
[((1017, 1085), 'plot_common.output_graph', 'output_graph', (['mixed_datasets', '"""output/sequence_precision_recall.png"""'], {}), "(mixed_datasets, 'output/sequence_precision_recall.png')\n", (1029, 1085), False, 'from plot_common import output_graph\n')]
# OpenNero will execute ModMain when this mod is loaded from Maze.client import ClientMain def ModMain(mode = ""): ClientMain(mode) def StartMe(): from Maze.module import getMod getMod().set_speedup(1.0) # full speed ahead getMod().start_sarsa() # start an algorithm for headless mode
[ "Maze.module.getMod", "Maze.client.ClientMain" ]
[((124, 140), 'Maze.client.ClientMain', 'ClientMain', (['mode'], {}), '(mode)\n', (134, 140), False, 'from Maze.client import ClientMain\n'), ((200, 208), 'Maze.module.getMod', 'getMod', ([], {}), '()\n', (206, 208), False, 'from Maze.module import getMod\n'), ((250, 258), 'Maze.module.getMod', 'getMod', ([], {}), '()\...
# Source Generated with Decompyle++ # File: bank_selection_component.pyc (Python 2.5) from __future__ import absolute_import from ableton.v2.base import NamedTuple, listenable_property, listens, listens_group, liveobj_valid, SlotManager, nop from ableton.v2.control_surface import Component from ableton.v2.control_surf...
[ "ableton.v2.base.NamedTuple", "ableton.v2.control_surface.control.control_list", "ableton.v2.base.liveobj_valid", "ableton.v2.base.listenable_property", "ableton.v2.base.listens_group", "ableton.v2.control_surface.control.forward_control", "ableton.v2.base.listens" ]
[((2548, 2633), 'ableton.v2.control_surface.control.control_list', 'control_list', (['ButtonControl'], {'color': '"""ItemNavigation.ItemSelected"""', 'control_count': '(8)'}), "(ButtonControl, color='ItemNavigation.ItemSelected',\n control_count=8)\n", (2560, 2633), False, 'from ableton.v2.control_surface.control im...
import torch from torch.nn import Module, Linear, Softmax, CosineSimilarity, Embedding class KeyValueMemoryNet(Module): """Defines PyTorch model for Key-Value Memory Network. Key-Value Memory Networks (KV-MemNN) are described here: https://arxiv.org/pdf/1606.03126.pdf Goal is to read correct response fr...
[ "torch.nn.Embedding", "torch.cat", "torch.nn.CosineSimilarity", "torch.nn.Softmax", "torch.nn.Linear", "torch.matmul" ]
[((1318, 1366), 'torch.nn.Linear', 'Linear', (['embedding_dim', 'embedding_dim'], {'bias': '(False)'}), '(embedding_dim, embedding_dim, bias=False)\n', (1324, 1366), False, 'from torch.nn import Module, Linear, Softmax, CosineSimilarity, Embedding\n'), ((1393, 1416), 'torch.nn.CosineSimilarity', 'CosineSimilarity', ([]...
import os # Function to rename multiple files def main(): i = 252 path="/home/tristan/Bilder/Temp2/" for filename in os.listdir(path): print(filename) if "JPG" in filename: print(filename) my_dest =str(i) + ".jpg" my_source =path + filename my_dest =path +...
[ "os.rename", "os.listdir" ]
[((131, 147), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (141, 147), False, 'import os\n'), ((338, 367), 'os.rename', 'os.rename', (['my_source', 'my_dest'], {}), '(my_source, my_dest)\n', (347, 367), False, 'import os\n')]
import platform, typing from typing import Optional from klgists.common.exceptions import ExternalCommandFailed from klgists.files.wrap_cmd_call import wrap_cmd_call from sauronlib import logger from sauronlib.audio_info import AudioInfo class CouldNotConfigureOsAudioError(IOError): def description(self): return...
[ "platform.system", "klgists.files.wrap_cmd_call.wrap_cmd_call", "sauronlib.logger.info", "sauronlib.logger.debug" ]
[((2629, 2668), 'sauronlib.logger.debug', 'logger.debug', (['"""Starting audio handler."""'], {}), "('Starting audio handler.')\n", (2641, 2668), False, 'from sauronlib import logger\n'), ((2691, 2728), 'sauronlib.logger.info', 'logger.info', (['"""Started audio handler."""'], {}), "('Started audio handler.')\n", (2702...
from collections import UserDict from functools import wraps import logging def var_method(func): """This decorator marks the given function as a scheduler variable. The function must take no arguments (other than self).""" # pylint: disable=W0212 # The scheduler plugin class will search for these. ...
[ "functools.wraps" ]
[((454, 465), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (459, 465), False, 'from functools import wraps\n')]
import numpy as np import os from astropy.io import fits from astropy.stats import sigma_clip, sigma_clipped_stats from specklepy.logging import logger from specklepy.reduction.subwindow import SubWindow from specklepy.utils.time import default_time_stamp class MasterDark(object): extensions = {'variance': 'VA...
[ "astropy.stats.sigma_clipped_stats", "astropy.io.fits.PrimaryHDU", "numpy.reciprocal", "astropy.io.fits.Header", "astropy.io.fits.HDUList", "os.path.join", "numpy.unique", "specklepy.reduction.subwindow.SubWindow.from_str", "astropy.io.fits.getdata", "numpy.var", "specklepy.utils.time.default_ti...
[((1150, 1174), 'os.path.split', 'os.path.split', (['file_path'], {}), '(file_path)\n', (1163, 1174), False, 'import os\n'), ((1310, 1332), 'astropy.io.fits.getdata', 'fits.getdata', (['obj.path'], {}), '(obj.path)\n', (1322, 1332), False, 'from astropy.io import fits\n'), ((2034, 2076), 'os.path.join', 'os.path.join',...
#!/usr/bin/env python #python import os import shutil import random #appion from appionlib import appionScript from appionlib import apStack from appionlib import apDisplay from appionlib import apStackFormat class convertStackScript(appionScript.AppionScript): #===================== def setupParserOptions(self): ...
[ "os.path.abspath", "appionlib.apStackFormat.linkFormattedStack", "appionlib.apStack.getOnlyStackData", "appionlib.apDisplay.printError", "os.path.join" ]
[((1064, 1123), 'appionlib.apStack.getOnlyStackData', 'apStack.getOnlyStackData', (["self.params['stackid']"], {'msg': '(False)'}), "(self.params['stackid'], msg=False)\n", (1088, 1123), False, 'from appionlib import apStack\n'), ((1235, 1279), 'os.path.join', 'os.path.join', (['uppath', "self.params['runname']"], {}),...
#!/usr/bin/env python3 # coding: utf-8 # Contains common methods frequently used across.... # The example reference at the below matplotlib is helpful in choosing an # appropriate colormap for the output plot # https://matplotlib.org/examples/color/colormaps_reference.html # import the necessary packages import numpy...
[ "matplotlib.pyplot.scatter", "matplotlib.pyplot.contourf", "numpy.arange", "numpy.unique" ]
[((2481, 2528), 'matplotlib.pyplot.contourf', 'plt.contourf', (['xx', 'yy', 'Z'], {'alpha': 'alpha', 'cmap': 'cmap'}), '(xx, yy, Z, alpha=alpha, cmap=cmap)\n', (2493, 2528), True, 'import matplotlib.pyplot as plt\n'), ((4126, 4181), 'matplotlib.pyplot.contourf', 'plt.contourf', (['xx', 'yy', 'mesh_output'], {'alpha': '...
import ext import re CODE = "assembly.txt" OUTPUT = "assembled.bin" def parse(value): if re.match("^0[a-zA-Z]", value): if value[1] == "b": parsed = int(value, 2) elif value[1] == "x": parsed = int(value, 16) else: parsed = int(value) return parsed with ope...
[ "ext.inst_size", "ext.render_inst", "re.match" ]
[((95, 124), 're.match', 're.match', (['"""^0[a-zA-Z]"""', 'value'], {}), "('^0[a-zA-Z]', value)\n", (103, 124), False, 'import re\n'), ((1231, 1284), 'ext.render_inst', 'ext.render_inst', (['macro[1]', 'macro[2]', 'macro[0]', 'lookup'], {}), '(macro[1], macro[2], macro[0], lookup)\n', (1246, 1284), False, 'import ext\...
# -*- coding: utf-8 -*- # Copyright (c) 2021 <NAME> # The source code contained in this file is licensed under the MIT license. # SPDX-License-Identifier: MIT import logging from pythonic_testcase import assert_raises, PythonicTestCase from ..testutils import (assert_did_log_message, assert_no_log_messages, buil...
[ "pythonic_testcase.assert_raises" ]
[((640, 669), 'pythonic_testcase.assert_raises', 'assert_raises', (['AssertionError'], {}), '(AssertionError)\n', (653, 669), False, 'from pythonic_testcase import assert_raises, PythonicTestCase\n')]
import json import string from io import IOBase from random import choice from string import ascii_letters from typing import Optional import pytest import requests from werkzeug import Response from infobip_channels.core.models import CamelCaseModel, MultipartMixin def get_random_string(length: int) -> str: re...
[ "requests.post", "random.choice", "requests.get", "json.dumps" ]
[((714, 785), 'requests.post', 'requests.post', ([], {'url': "(f'{self.url}' + endpoint)", 'json': 'body', 'headers': 'headers'}), "(url=f'{self.url}' + endpoint, json=body, headers=headers)\n", (727, 785), False, 'import requests\n'), ((887, 946), 'requests.get', 'requests.get', ([], {'url': "(f'{self.url}' + endpoint...
import numpy as np import seaborn as sns def p_x_given_y(y, mus, sigmas): mu = mus[0] + sigmas[1, 0] / sigmas[0, 0] * (y - mus[1]) sigma = sigmas[0, 0] - sigmas[1, 0] / sigmas[1, 1] * sigmas[1, 0] return np.random.normal(mu, sigma) def p_y_given_x(x, mus, sigmas): mu = mus[1] + sigmas[0, 1] / sigmas...
[ "numpy.zeros", "numpy.array", "numpy.random.normal", "seaborn.jointplot", "numpy.random.rand" ]
[((218, 245), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma'], {}), '(mu, sigma)\n', (234, 245), True, 'import numpy as np\n'), ((423, 450), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma'], {}), '(mu, sigma)\n', (439, 450), True, 'import numpy as np\n'), ((512, 531), 'numpy.zeros', 'np.zeros', (...
from pathlib import Path ROOT = Path(__file__).parent TEMPLATES_DIR = ROOT / "templates" OUT = ROOT / "out" UBUNTU_VERSIONS = {"18.04": "bionic", "20.04": "focal"} PYTHON_VERSIONS = {"3.6.15", "3.7.12", "3.8.12", "3.9.7", "3.10.0rc2"} VERSIONS = ((u_ver, p_ver) for u_ver in UBUNTU_VERSIONS for p_ver in PYTHON_VERSI...
[ "pathlib.Path" ]
[((33, 47), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (37, 47), False, 'from pathlib import Path\n')]
# coding: utf-8 # Creates: # * cachito_fe_vel_comp.pdf # In[1]: import os import numpy as np import yaml from astropy.io import ascii as asc from astropy.time import Time import astropy.units as u import astropy.constants as c from astropy.modeling import models, fitting from matplotlib import pyplot as plt #...
[ "astropy.time.Time", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "numpy.arange", "utilities_az.supernova.LightCurve2", "os.path.join" ]
[((426, 477), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['seaborn-paper', 'az-paper-onecol']"], {}), "(['seaborn-paper', 'az-paper-onecol'])\n", (439, 477), True, 'from matplotlib import pyplot as plt\n'), ((660, 708), 'astropy.time.Time', 'Time', (["['2015-09-05', '2015-10-05', '2015-10-10']"], {}), "(['2015-...
# -*- coding: utf-8 -*- """ proxy.py ~~~~~~~~ ⚡⚡⚡ Fast, Lightweight, Programmable Proxy Server in a single Python file. :copyright: (c) 2013-present by <NAME> and contributors. :license: BSD, see LICENSE for more details. """ import logging import multiprocessing import selectors import socket impo...
[ "threading.Thread", "multiprocessing.Lock", "socket.socket", "socket.fromfd", "selectors.DefaultSelector", "threading.Event", "multiprocessing.Pipe", "multiprocessing.reduction.recv_handle", "logging.getLogger" ]
[((650, 677), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (667, 677), False, 'import logging\n'), ((4808, 4830), 'multiprocessing.Lock', 'multiprocessing.Lock', ([], {}), '()\n', (4828, 4830), False, 'import multiprocessing\n'), ((1717, 1769), 'socket.socket', 'socket.socket', (['self....
import gym import itertools import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers import baselines.common.tf_util as U from baselines.common.tf_util import load_state, save_state from baselines import logger from baselines import deepq from baselines.deepq.replay_buffer import ReplayBuf...
[ "gym.make", "tensorflow.train.Saver", "tensorflow.contrib.layers.fully_connected", "baselines.common.tf_util.make_session", "baselines.common.tf_util.initialize", "tensorflow.variable_scope", "baselines.deepq.utils.ObservationInput", "baselines.common.schedules.LinearSchedule", "tensorflow.train.Ada...
[((868, 884), 'tensorflow.train.Saver', 'tf.train.Saver', ([], {}), '()\n', (882, 884), True, 'import tensorflow as tf\n'), ((494, 531), 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {'reuse': 'reuse'}), '(scope, reuse=reuse)\n', (511, 531), True, 'import tensorflow as tf\n'), ((566, 636), 'tensorflow.c...
###################################################################################### # ----------Copyright 2021 Division of Medical and Environmental Computing,----------# # ----------Technical University of Darmstadt, Darmstadt, Germany--------------------# ###########################################################...
[ "nnunet.utilities.task_name_id_conversion.convert_id_to_task_name", "argparse.ArgumentParser" ]
[((605, 807), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""We extend nnUNet to offer self-supervision tasks. This step is to split the dataset into two - self-supervision input and self- supervisio output folder."""'}), "(description=\n 'We extend nnUNet to offer self-supervision ta...
import json from collections import OrderedDict from django import forms from django.dispatch import receiver from django.template.loader import get_template from django.utils.translation import gettext_lazy as _ from pretix.base.forms import SecretKeySettingsField from pretix.base.signals import ( logentry_displ...
[ "django.template.loader.get_template", "django.dispatch.receiver", "json.loads", "django.utils.translation.gettext_lazy" ]
[((411, 478), 'django.dispatch.receiver', 'receiver', (['register_payment_providers'], {'dispatch_uid': '"""payment_paypal"""'}), "(register_payment_providers, dispatch_uid='payment_paypal')\n", (419, 478), False, 'from django.dispatch import receiver\n'), ((581, 654), 'django.dispatch.receiver', 'receiver', ([], {'sig...
from functools import total_ordering from MinPQ import MinPQ """ Write a program to solve the 8-puzzle problem (and its natural generalizations) using the A* search algorithm """ class Board(): def __init__(self, array): """constructor takes an n x n list of lists containing the n ** 2 i...
[ "MinPQ.MinPQ" ]
[((4847, 4854), 'MinPQ.MinPQ', 'MinPQ', ([], {}), '()\n', (4852, 4854), False, 'from MinPQ import MinPQ\n'), ((4984, 4991), 'MinPQ.MinPQ', 'MinPQ', ([], {}), '()\n', (4989, 4991), False, 'from MinPQ import MinPQ\n')]
import os MIGRATION_BASE_DIR = os.path.dirname(__file__) accept_versions = {'1.9.0', '1.10.0', '2.0.0'}
[ "os.path.dirname" ]
[((32, 57), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (47, 57), False, 'import os\n')]
import numpy as np from sklearn.metrics import roc_auc_score,jaccard_score import cv2 from torch import nn import torch.nn.functional as F import math from functools import wraps import warnings import weakref from torch.optim.optimizer import Optimizer class WeightedBCE(nn.Module): def __init__(self, weights=[0....
[ "torch.nn.functional.binary_cross_entropy", "numpy.sum", "cv2.imwrite", "math.floor", "numpy.mean", "math.cos", "functools.wraps", "warnings.warn", "math.log", "weakref.ref" ]
[((3473, 3486), 'numpy.mean', 'np.mean', (['aucs'], {}), '(aucs)\n', (3480, 3486), True, 'import numpy as np\n'), ((4124, 4137), 'numpy.mean', 'np.mean', (['ious'], {}), '(ious)\n', (4131, 4137), True, 'import numpy as np\n'), ((4271, 4298), 'numpy.sum', 'np.sum', (['(y_true_f * y_pred_f)'], {}), '(y_true_f * y_pred_f)...
import unittest import numpy as np from scipy.optimize import root from scipy.interpolate import interp1d from scipy.stats import entropy, poisson import warnings from epipack.numeric_epi_models import ( DynamicBirthRate, ConstantBirthRate, DynamicLinearRate, ConstantLi...
[ "matplotlib.pyplot.yscale", "numpy.abs", "numpy.isclose", "numpy.histogram", "matplotlib.pyplot.figure", "epipack.numeric_epi_models.ConstantLinearRate", "numpy.sin", "numpy.exp", "numpy.arange", "scipy.interpolate.interp1d", "epipack.numeric_epi_models.ConstantQuadraticRate", "numpy.linspace"...
[((4359, 4429), 'epipack.numeric_epi_models.SISModel', 'SISModel', ([], {'infection_rate': '(2)', 'recovery_rate': '(1)', 'initial_population_size': 'N'}), '(infection_rate=2, recovery_rate=1, initial_population_size=N)\n', (4367, 4429), False, 'from epipack.numeric_epi_models import DynamicBirthRate, ConstantBirthRate...
from cyber_sdk.client.lcd import LCDClient if __name__ == "__main__": client = LCDClient(url="https://lcd.space-pussy-1.cybernode.ai/", chain_id="space-pussy-1") client.tx.tx_info( "D22FC6EB287D9F099DD8EBADAAC5D9A0F6AA9D6B87F4A35A3FACEF4182706A16" )
[ "cyber_sdk.client.lcd.LCDClient" ]
[((84, 171), 'cyber_sdk.client.lcd.LCDClient', 'LCDClient', ([], {'url': '"""https://lcd.space-pussy-1.cybernode.ai/"""', 'chain_id': '"""space-pussy-1"""'}), "(url='https://lcd.space-pussy-1.cybernode.ai/', chain_id=\n 'space-pussy-1')\n", (93, 171), False, 'from cyber_sdk.client.lcd import LCDClient\n')]
# Generated by Django 3.1.6 on 2021-02-08 21:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("api", "0090_rename_repository_project"), ] operations = [ migrations.AddField( model_name="user", name="onboarded_at...
[ "django.db.models.DateTimeField" ]
[((341, 474), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'help_text': '"""Date of the last time the user completed the interactive onboarding"""', 'null': '(True)'}), "(blank=True, help_text=\n 'Date of the last time the user completed the interactive onboarding',\n null=Tr...
#!/usr/bin/env python3 # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import copy import torch from torch.optim.optimizer import Optimizer import numpy as np from scipy.optimize import minimize __all__ = ('CurveSGD',) class CurveSGD(Op...
[ "torch.mean", "scipy.optimize.minimize", "torch.zeros_like", "torch.autograd.grad", "torch.zeros" ]
[((2653, 2748), 'torch.autograd.grad', 'torch.autograd.grad', (['grads', 'params'], {'grad_outputs': 'delta', 'only_inputs': '(True)', 'retain_graph': '(True)'}), '(grads, params, grad_outputs=delta, only_inputs=True,\n retain_graph=True)\n', (2672, 2748), False, 'import torch\n'), ((8827, 8883), 'torch.zeros_like',...
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
[ "troveclient.v1.flavors.Flavor", "trove.tests.util.create_dbaas_client", "proboscis.asserts.assert_raises", "nose.tools.assert_true", "proboscis.test", "trove.common.utils.poll_until", "trove.tests.util.test_config.version_url.replace", "nose.tools.assert_equal", "trove.tests.util.test_config.dbaas_...
[((3544, 3659), 'proboscis.test', 'test', ([], {'groups': '[tests.DBAAS_API, GROUP, GROUP_DS, tests.PRE_INSTANCES]', 'depends_on_groups': "['services.initialize']"}), "(groups=[tests.DBAAS_API, GROUP, GROUP_DS, tests.PRE_INSTANCES],\n depends_on_groups=['services.initialize'])\n", (3548, 3659), False, 'from probosci...
import random import ctypes import sys import wgpu.backends.rs # noqa import numpy as np from pytest import skip from testutils import run_tests, get_default_device from testutils import can_use_wgpu_lib, is_ci from renderutils import render_to_texture, render_to_screen # noqa if not can_use_wgpu_lib: skip("S...
[ "random.randint", "ctypes.sizeof", "testutils.get_default_device", "pytest.skip", "numpy.ctypeslib.as_array", "numpy.all" ]
[((313, 383), 'pytest.skip', 'skip', (['"""Skipping tests that need the wgpu lib"""'], {'allow_module_level': '(True)'}), "('Skipping tests that need the wgpu lib', allow_module_level=True)\n", (317, 383), False, 'from pytest import skip\n'), ((13362, 13382), 'ctypes.sizeof', 'ctypes.sizeof', (['data1'], {}), '(data1)\...
import requests # import re from bs4 import BeautifulSoup import time courl = "https://e-hentai.org/?page={}" def getContent(url): res = requests.get(url) soup = BeautifulSoup(res.text, 'lxml') return soup def getImage(soup): src = soup.find_all('div', {'class': 'it5'}) name = soup.find_all('div...
[ "bs4.BeautifulSoup", "requests.get", "time.sleep" ]
[((142, 159), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (154, 159), False, 'import requests\n'), ((171, 202), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"""lxml"""'], {}), "(res.text, 'lxml')\n", (184, 202), False, 'from bs4 import BeautifulSoup\n'), ((956, 969), 'time.sleep', 'time.sleep', ([...
# Note: model title and parameter table are inserted automatically r""" This model provides the scattering intensity, $I(q)$, for a lyotropic lamellar phase where a random distribution in solution are assumed. The SLD of the head region is taken to be different from the SLD of the tail region. Definition ---------- T...
[ "numpy.random.uniform" ]
[((3537, 3560), 'numpy.random.uniform', 'np.random.uniform', (['(1)', '(4)'], {}), '(1, 4)\n', (3554, 3560), True, 'import numpy as np\n'), ((3591, 3614), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (3608, 3614), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from distutils.version import LooseVersion from django.contrib.sites.shortcuts import get_current_site from django.utils import timezone from django.utils.dates import MONTHS from django.utils.translation import ugettext_lazy as _, get_...
[ "distutils.version.LooseVersion", "django.utils.timezone.now", "cms.plugin_pool.plugin_pool.register_plugin", "datetime.timedelta", "django.utils.translation.get_language_from_request", "django.contrib.sites.shortcuts.get_current_site", "django.utils.translation.ugettext_lazy" ]
[((850, 1118), 'django.utils.translation.ugettext_lazy', '_', (['"""There is an error in plugin configuration: selected Events config is not available. Please switch to edit mode and change plugin app_config settings to use valid config. Also note that aldryn-events should be used at least once as an apphook for that c...
import os import numpy as np import pandas as pd import tensorflow as tf def load_data(data_path, label_col, feature_cols=None): # Load data csv with pandas and divide it to features and labels if feature_cols: data = pd.read_csv(os.path.abspath(data_path), usecols=feature_cols + [label_col], low_memo...
[ "os.path.abspath" ]
[((5919, 5952), 'os.path.abspath', 'os.path.abspath', (['"""data/train.csv"""'], {}), "('data/train.csv')\n", (5934, 5952), False, 'import os\n'), ((6033, 6071), 'os.path.abspath', 'os.path.abspath', (['"""data/validation.csv"""'], {}), "('data/validation.csv')\n", (6048, 6071), False, 'import os\n'), ((6146, 6178), 'o...
import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") process.load("CondCore.DBCommon.CondDBCommon_cfi") process.CondDBCommon.connect = 'sqlite_file:userconf.db' process.CondDBCommon.DBParameters.authenticationPath = '.' process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.Co...
[ "FWCore.ParameterSet.Config.string", "FWCore.ParameterSet.Config.uint64", "FWCore.ParameterSet.Config.untracked.int32", "FWCore.ParameterSet.Config.untracked.string", "FWCore.ParameterSet.Config.untracked.bool", "FWCore.ParameterSet.Config.Process", "FWCore.ParameterSet.Config.int32", "FWCore.Paramete...
[((52, 71), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""TEST"""'], {}), "('TEST')\n", (63, 71), True, 'import FWCore.ParameterSet.Config as cms\n'), ((3367, 3393), 'FWCore.ParameterSet.Config.Path', 'cms.Path', (['process.conf_o2o'], {}), '(process.conf_o2o)\n', (3375, 3393), True, 'import FWCore.Paramet...
from gcloud_sync_ssh.host_config import HostConfig def test_empty(): hc = HostConfig() assert not hc.minidict() def test_default_lines(): hc = HostConfig(HostName="172.16.31.10", CertificateFile="exists-or-not-we-dont-check") ls = hc.lines() assert ls == [' CertificateFile exists-or-not-we-do...
[ "gcloud_sync_ssh.host_config.HostConfig" ]
[((80, 92), 'gcloud_sync_ssh.host_config.HostConfig', 'HostConfig', ([], {}), '()\n', (90, 92), False, 'from gcloud_sync_ssh.host_config import HostConfig\n'), ((159, 246), 'gcloud_sync_ssh.host_config.HostConfig', 'HostConfig', ([], {'HostName': '"""172.16.31.10"""', 'CertificateFile': '"""exists-or-not-we-dont-check"...
import json import PySimpleGUI as sg from ..Ventanas import principal as ventana, ayuda from ..Componentes import menu_estadisticas, menu_tablero from ..Componentes import menu_puntajes from ..Componentes import menu_configuracion from ..Handlers import usuario def iniciar(): ''' comienza la ejecucion del menu de...
[ "PySimpleGUI.theme", "json.load" ]
[((415, 430), 'json.load', 'json.load', (['file'], {}), '(file)\n', (424, 430), False, 'import json\n'), ((508, 560), 'PySimpleGUI.theme', 'sg.theme', (["user['configuracion']['paleta_de_colores']"], {}), "(user['configuracion']['paleta_de_colores'])\n", (516, 560), True, 'import PySimpleGUI as sg\n')]
import configparser from datetime import datetime import os from pyspark.sql import SparkSession from pyspark.sql.functions import udf, col from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format, dayofweek config = configparser.ConfigParser() config.read('dl.cfg') os.environ['AWS_...
[ "pyspark.sql.functions.dayofmonth", "pyspark.sql.functions.month", "pyspark.sql.SparkSession.builder.config", "pyspark.sql.functions.weekofyear", "pyspark.sql.functions.hour", "pyspark.sql.functions.dayofweek", "configparser.ConfigParser", "pyspark.sql.functions.year" ]
[((253, 280), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (278, 280), False, 'import configparser\n'), ((3268, 3286), 'pyspark.sql.functions.hour', 'hour', (['"""start_time"""'], {}), "('start_time')\n", (3272, 3286), False, 'from pyspark.sql.functions import year, month, dayofmonth, hou...
import json import requests import sys def fetch_jsons(json_output=False): print('[INFO] Fetching latest resource files.') try: insecure_deps = json.loads(requests.get('https://raw.githubusercontent.com/pyupio/safety-db/master/data/insecure.json').content) print('[INFO] Fetched list of Insecu...
[ "requests.get", "sys.exit" ]
[((778, 789), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (786, 789), False, 'import sys\n'), ((174, 276), 'requests.get', 'requests.get', (['"""https://raw.githubusercontent.com/pyupio/safety-db/master/data/insecure.json"""'], {}), "(\n 'https://raw.githubusercontent.com/pyupio/safety-db/master/data/insecure.js...
# %% # line printer def printer(info): print('\n\n================================= {} =================================================\n\n'.format(info)) # %% import itertools # to get a counter starting from 0 to infinte counter = itertools.count() # return type is the iterator and count will start from 0...
[ "numpy.random.seed", "numpy.random.randint", "itertools.cycle", "itertools.permutations", "itertools.zip_longest", "numpy.random.choice", "itertools.product", "itertools.chain", "itertools.filterfalse", "itertools.accumulate", "itertools.count", "itertools.combinations", "itertools.islice", ...
[((244, 261), 'itertools.count', 'itertools.count', ([], {}), '()\n', (259, 261), False, 'import itertools\n'), ((456, 493), 'itertools.count', 'itertools.count', ([], {'start': 'start', 'step': '(-5)'}), '(start=start, step=-5)\n', (471, 493), False, 'import itertools\n'), ((609, 646), 'itertools.count', 'itertools.co...
#!/usr/bin/python import subprocess import sys import os # This is in the `unicode-character-database` package on Arch Linux. UNICODE_DATABASE = '/usr/share/unicode-character-database/UnicodeData.txt' WORDS = 'data/words.txt' NOTO_EMOJI_DIR = '/home/jasper/Stash/noto-emoji' def load_unicode_database(): data = {} ...
[ "subprocess.run", "os.path.isfile" ]
[((1539, 1582), 'subprocess.run', 'subprocess.run', (['montage_command'], {'check': '(True)'}), '(montage_command, check=True)\n', (1553, 1582), False, 'import subprocess\n'), ((1630, 1747), 'subprocess.run', 'subprocess.run', (["['convert', '-channel', 'A', '-threshold', '50%', tmp_png,\n 'png32:build/sprites.png']...
from fastapi import FastAPI from pydantic import BaseModel from typing import List import subprocess import random import string import os app = FastAPI() class Item(BaseModel): kube_str: str yaml_file: List[str] class Response(BaseModel): Output: str Error: str @app.get("/general/{item}", response_...
[ "subprocess.run", "os.remove", "random.choices", "os.path.exists", "fastapi.FastAPI" ]
[((146, 155), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (153, 155), False, 'from fastapi import FastAPI\n'), ((513, 566), 'subprocess.run', 'subprocess.run', (['input'], {'capture_output': '(True)', 'text': '(True)'}), '(input, capture_output=True, text=True)\n', (527, 566), False, 'import subprocess\n'), ((1557,...
from collections import OrderedDict import pytest from powersimdata.data_access.execute_table import ExecuteTable from powersimdata.data_access.sql_store import SqlError row_id = 9000 def _get_test_row(): global row_id row_id += 1 return OrderedDict([("id", row_id)]) class NoEffectSqlStore(ExecuteTab...
[ "collections.OrderedDict", "pytest.raises" ]
[((255, 284), 'collections.OrderedDict', 'OrderedDict', (["[('id', row_id)]"], {}), "([('id', row_id)])\n", (266, 284), False, 'from collections import OrderedDict\n'), ((766, 789), 'pytest.raises', 'pytest.raises', (['SqlError'], {}), '(SqlError)\n', (779, 789), False, 'import pytest\n')]
import requests import github3 import expecter import json import sys from mock import patch from io import BytesIO from unittest import TestCase from requests.structures import CaseInsensitiveDict is_py3 = sys.version_info > (3, 0) def load(name): with path(name) as f: j = json.load(f) return j de...
[ "mock.patch.object", "json.load", "json.dumps", "requests.Response", "requests.structures.CaseInsensitiveDict", "github3.GitHub" ]
[((290, 302), 'json.load', 'json.load', (['f'], {}), '(f)\n', (299, 302), False, 'import json\n'), ((1429, 1445), 'github3.GitHub', 'github3.GitHub', ([], {}), '()\n', (1443, 1445), False, 'import github3\n'), ((1535, 1585), 'mock.patch.object', 'patch.object', (['requests.sessions.Session', '"""request"""'], {}), "(re...
from pathlib import Path from typing import List, Optional, Union from exofile.archive import ExoFile from pandas.core.frame import DataFrame from ephemere import constants as const def load_archive( query: bool = True, exofile_param_file: Optional[Union[str, Path]] = None, use_alt_exofile: bool = False...
[ "exofile.archive.ExoFile.load" ]
[((681, 837), 'exofile.archive.ExoFile.load', 'ExoFile.load', ([], {'query': 'query', 'param': 'exofile_param_file', 'use_alt_file': 'use_alt_exofile', 'warn_units': 'warn_units', 'warn_local_file': 'warn_local_file'}), '(query=query, param=exofile_param_file, use_alt_file=\n use_alt_exofile, warn_units=warn_units, ...