code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import eisoil.core.pluginmanager as pm
from dhcpgenithreedelegate import DHCPGENI3Delegate
def setup():
# setup config keys
# config = pm.getService("config")
delegate = DHCPGENI3Delegate()
handler = pm.getService('geniv3handler')
handler.setDelegate(delegate) | [
"dhcpgenithreedelegate.DHCPGENI3Delegate",
"eisoil.core.pluginmanager.getService"
] | [((188, 207), 'dhcpgenithreedelegate.DHCPGENI3Delegate', 'DHCPGENI3Delegate', ([], {}), '()\n', (205, 207), False, 'from dhcpgenithreedelegate import DHCPGENI3Delegate\n'), ((222, 252), 'eisoil.core.pluginmanager.getService', 'pm.getService', (['"""geniv3handler"""'], {}), "('geniv3handler')\n", (235, 252), True, 'impo... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2017--, <NAME>
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -------------------------------------------... | [
"click.Path",
"click.command",
"skbio.io.read"
] | [((1124, 1139), 'click.command', 'click.command', ([], {}), '()\n', (1137, 1139), False, 'import click\n'), ((657, 702), 'skbio.io.read', 'skbio.io.read', (['input_fasta_fp'], {'format': '"""fasta"""'}), "(input_fasta_fp, format='fasta')\n", (670, 702), False, 'import skbio\n'), ((1208, 1281), 'click.Path', 'click.Path... |
import random
import itertools
class Proxy:
def __init__(self, proxies):
self.proxies = proxies
self.proxy_count = len(self.proxies)
self._rotating_proxy = itertools.cycle(proxies)
def get_random(self):
index = random.randint(0, self.proxy_count)
return self.proxies[... | [
"itertools.cycle",
"random.randint"
] | [((187, 211), 'itertools.cycle', 'itertools.cycle', (['proxies'], {}), '(proxies)\n', (202, 211), False, 'import itertools\n'), ((255, 290), 'random.randint', 'random.randint', (['(0)', 'self.proxy_count'], {}), '(0, self.proxy_count)\n', (269, 290), False, 'import random\n')] |
from setuptools import setup
setup(
name='simple_GAN',
version='1.0',
description='A simple GAN implemented using numpy only.',
author='<NAME>',
author_email='<EMAIL>',
packages=['simple_GAN'],
install_requires=["numpy", "matplotlib"],
)
| [
"setuptools.setup"
] | [((30, 249), 'setuptools.setup', 'setup', ([], {'name': '"""simple_GAN"""', 'version': '"""1.0"""', 'description': '"""A simple GAN implemented using numpy only."""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['simple_GAN']", 'install_requires': "['numpy', 'matplotlib']"}), "(name='simple_... |
__author__ = 'christianbuia'
import random
from Crypto.Cipher import AES
def pkcs7_padding(message_bytes, block_size):
pad_length = block_size - (len(message_bytes) % block_size)
if pad_length != block_size:
for i in range(0, pad_length):
message_bytes += bytes([pad_length])
return... | [
"Crypto.Cipher.AES.new",
"random.randint"
] | [((778, 804), 'Crypto.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_ECB'], {}), '(key, AES.MODE_ECB)\n', (785, 804), False, 'from Crypto.Cipher import AES\n'), ((1046, 1072), 'Crypto.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_ECB'], {}), '(key, AES.MODE_ECB)\n', (1053, 1072), False, 'from Crypto.Cipher import AES\... |
from hwt.hdl.constants import INTF_DIRECTION
from hwt.synthesizer.param import Param
from hwt.synthesizer.unit import Unit
class UnitWrapper(Unit):
"""
Class which creates wrapper around original unit instance,
original unit will be stored inside as subunit named baseUnit
:note: This is example of la... | [
"hwt.hdl.constants.INTF_DIRECTION.opposite"
] | [((1173, 1213), 'hwt.hdl.constants.INTF_DIRECTION.opposite', 'INTF_DIRECTION.opposite', (['intf._direction'], {}), '(intf._direction)\n', (1196, 1213), False, 'from hwt.hdl.constants import INTF_DIRECTION\n')] |
# Author: <NAME> && <NAME>
# University of California, Davis
# Winter 2017 - ECS 240 - Zhendong Su
#Standard Libraries
import sys
import os
#3rd Party Libraries
#Local Libraries
import io_utils
import dirent_utils
import variable_table
import undeclared_local_variable_checker
import overriding_declared_variable_chec... | [
"dirent_utils.get_file_basename_extension",
"undeclared_local_variable_checker.Undeclared_Local_Variable_Checker",
"overriding_declared_variable_checker.Overridding_Declared_Variable_Checker",
"function_parameter_overridden_checker.Function_Parameter_Overridden_Checker",
"global_local_variable_confusion_che... | [((528, 566), 'variable_table.Variable_Table', 'variable_table.Variable_Table', (['py_path'], {}), '(py_path)\n', (557, 566), False, 'import variable_table\n'), ((1264, 1333), 'undeclared_local_variable_checker.Undeclared_Local_Variable_Checker', 'undeclared_local_variable_checker.Undeclared_Local_Variable_Checker', ([... |
from meteor_reasoner.utils.parser import *
from collections import defaultdict
def load_dataset(lines):
"""
Read string-like facts into a dictionary object.
Args:
lines (list of strings): a list of facts in the form of A(x,y,z)@[1,2] or A@[1,2)
Returns:
A defaultdict object, in whic... | [
"collections.defaultdict"
] | [((552, 569), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (563, 569), False, 'from collections import defaultdict\n')] |
from setuptools import setup
with open("README.md","r") as fh:
long_description = fh.read()
setup(
name='crud_generator',
version='1.0.2',
description='This will generate a crud operations (crud.py) for your Database tables.',
long_description=long_description,
long_description_content_type="tex... | [
"setuptools.setup"
] | [((96, 356), 'setuptools.setup', 'setup', ([], {'name': '"""crud_generator"""', 'version': '"""1.0.2"""', 'description': '"""This will generate a crud operations (crud.py) for your Database tables."""', 'long_description': 'long_description', 'long_description_content_type': '"""text/markdown"""', 'py_modules': "['crud... |
from django.conf.urls import re_path
from molo.commenting.admin import CommentingModelAdminGroup
from molo.commenting.admin_views import MoloCommentsAdminReplyView
from wagtail.core import hooks
from wagtail.contrib.modeladmin.options import modeladmin_register
@hooks.register('register_admin_urls')
def register_molo... | [
"wagtail.contrib.modeladmin.options.modeladmin_register",
"wagtail.core.hooks.register",
"molo.commenting.admin_views.MoloCommentsAdminReplyView.as_view"
] | [((265, 302), 'wagtail.core.hooks.register', 'hooks.register', (['"""register_admin_urls"""'], {}), "('register_admin_urls')\n", (279, 302), False, 'from wagtail.core import hooks\n'), ((532, 578), 'wagtail.contrib.modeladmin.options.modeladmin_register', 'modeladmin_register', (['CommentingModelAdminGroup'], {}), '(Co... |
from dataclasses import dataclass
import csv
from os import write
@dataclass
class Inventory:
id: int
name: str
price: float
quantity: int
field_names = ['id', 'name', 'price', 'quantity']
def to_dict(self):
inv_dict = dict()
inv_dict['id'] = self.id
inv_dict['name'] = ... | [
"csv.DictWriter"
] | [((881, 927), 'csv.DictWriter', 'csv.DictWriter', (['inv_obj', 'inventory.field_names'], {}), '(inv_obj, inventory.field_names)\n', (895, 927), False, 'import csv\n')] |
import re
from django.template import Template, Context
try:
from django.utils.timezone import make_aware, utc
except ImportError:
make_aware, utc = None, None
def format_list(l, must_sort=True, separator=' '):
"""
Format a list as a string. Default the items in the list are sorted.
E.g.
>>>... | [
"django.template.Template",
"re.sub",
"django.template.Context"
] | [((530, 555), 're.sub', 're.sub', (['"""\\\\s\\\\s*"""', '""" """', 's'], {}), "('\\\\s\\\\s*', ' ', s)\n", (536, 555), False, 'import re\n'), ((562, 587), 're.sub', 're.sub', (['""">\\\\s*<"""', '"""><"""', 's'], {}), "('>\\\\s*<', '><', s)\n", (568, 587), False, 'import re\n'), ((595, 646), 're.sub', 're.sub', (['"""... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | [
"pyomo.common.fileutils.this_file_dir",
"os.path.join",
"pyomo.common.fileutils.import_file",
"os.path.isdir",
"pyomo.common.download.FileDownloader"
] | [((2350, 2372), 'pyomo.common.fileutils.this_file_dir', 'futils.this_file_dir', ([], {}), '()\n', (2370, 2372), True, 'import pyomo.common.fileutils as futils\n'), ((2392, 2454), 'os.path.join', 'os.path.join', (['download_dir', '""".."""', '""".."""', '"""scripts"""', '"""workshops"""'], {}), "(download_dir, '..', '..... |
from ..responses import *
from ..utils import send_json, pop_args, byte_to_dict, get_user
from django.contrib.auth.models import User as Default_User
from ..models import User
from django.contrib.auth.hashers import make_password
from django.views import View
import sys
sys.path.append("../../")
import json
from Django... | [
"sys.path.append",
"django.contrib.auth.hashers.make_password"
] | [((271, 296), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (286, 296), False, 'import sys\n'), ((3736, 3775), 'django.contrib.auth.hashers.make_password', 'make_password', (["update_value['password']"], {}), "(update_value['password'])\n", (3749, 3775), False, 'from django.contrib.auth.... |
# -*- Mode: Python -*-
import coro
import unittest
import os
import signal
from coro import signal_handler
from coro.test import coro_unittest
signal_caught_flag = False
W = coro.write_stderr
class Test (unittest.TestCase):
def test_0_set_signal_handler (self):
signal_handler.register (signal.SIGUSR1, ... | [
"os.kill",
"coro.test.coro_unittest.run_tests",
"coro.signal_handler.register",
"coro.sleep_relative",
"os.getpid"
] | [((802, 827), 'coro.test.coro_unittest.run_tests', 'coro_unittest.run_tests', ([], {}), '()\n', (825, 827), False, 'from coro.test import coro_unittest\n'), ((279, 337), 'coro.signal_handler.register', 'signal_handler.register', (['signal.SIGUSR1', 'self.usr1_handler'], {}), '(signal.SIGUSR1, self.usr1_handler)\n', (30... |
"""
/scripts/mail/__init__.py
Concerns all things emails.
"""
import inspect
import os
import traceback
from dotenv import load_dotenv
from scripts.mail.mail import write_email
load_dotenv()
def email_if_exception(func):
"""Wrapper that sends an email to <EMAIL> if the
wrapped function raises an exceptio... | [
"inspect.getfile",
"traceback.format_exc",
"dotenv.load_dotenv"
] | [((182, 195), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (193, 195), False, 'from dotenv import load_dotenv\n'), ((620, 641), 'inspect.getfile', 'inspect.getfile', (['func'], {}), '(func)\n', (635, 641), False, 'import inspect\n'), ((715, 736), 'inspect.getfile', 'inspect.getfile', (['func'], {}), '(func)\n... |
#
#
# OrientExpress for Kodi.
#
# Glue code to use the external expressvpn command line tool from
# within Kodi.
#
# For now error handling is almost non-existant.
#
import os
import re
import sys
import subprocess
import time
import socket
import resources.lib.kodistuff as kodi
# import kodistuff as kodi
#
# Exter... | [
"subprocess.Popen",
"resources.lib.kodistuff.setting",
"re.search"
] | [((386, 415), 'resources.lib.kodistuff.setting', 'kodi.setting', (['"""expressvpncmd"""'], {}), "('expressvpncmd')\n", (398, 415), True, 'import resources.lib.kodistuff as kodi\n'), ((789, 889), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'su... |
import json
from collections import OrderedDict
def jsonDefault(OrderedDict):
return OrderedDict.__dict__
class AttckObject(object):
"""
Parent class to all other classes
Creates objects that are categorized as Mitre ATT&CK Groups (e.g. APT1, APT32, etc.)
Arguments:
A... | [
"json.dumps"
] | [((1216, 1263), 'json.dumps', 'json.dumps', (['self'], {'default': 'jsonDefault', 'indent': '(4)'}), '(self, default=jsonDefault, indent=4)\n', (1226, 1263), False, 'import json\n')] |
"""
Finds the nth prime number
Author: <NAME>
"""
import math
# Finds prime factors until the index limit_index is met
def prime_factors(limit_index):
primes = [2,3]
n = 2
current_value = 5
while (n<limit_index):
is_prime = True
for prime in primes:
if (math.sqrt(current_va... | [
"math.sqrt"
] | [((300, 324), 'math.sqrt', 'math.sqrt', (['current_value'], {}), '(current_value)\n', (309, 324), False, 'import math\n')] |
import numpy as np
from transonic import Array, const
from transonic.backends import backends
backend = backends["cython"]
type_formatter = backend.type_formatter
def compare(result, dtype, ndim, memview, mem_layout=None, positive_indices=None):
A = Array[dtype, ndim, memview, mem_layout, positive_indices]
... | [
"transonic.const"
] | [((1185, 1193), 'transonic.const', 'const', (['A'], {}), '(A)\n', (1190, 1193), False, 'from transonic import Array, const\n')] |
from collections import defaultdict
class Solution(object):
def isScramble(self, s1, s2):
"""
:type s1: str
:type s2: str
:rtype: bool
"""
if len(s1) != len(s2) or set(s1) != set(s2):
return False
if s1 == s2:
return True
if n... | [
"collections.defaultdict"
] | [((472, 488), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (483, 488), False, 'from collections import defaultdict\n')] |
# Generated by Django 3.1 on 2020-08-12 05:19
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('lesson_planner... | [
"django.db.migrations.swappable_dependency",
"django.db.migrations.RemoveField",
"django.db.models.UUIDField",
"django.db.models.ForeignKey"
] | [((237, 294), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (268, 294), False, 'from django.db import migrations, models\n'), ((385, 441), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name... |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
import airflow
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': airflow.utils.dates.days_ago(0),
'email_on_failure': False,
'email_on_retry': False,
... | [
"datetime.timedelta",
"airflow.utils.dates.days_ago",
"airflow.operators.bash_operator.BashOperator",
"airflow.DAG"
] | [((388, 489), 'airflow.DAG', 'DAG', (['"""example_dag_one"""'], {'schedule_interval': '"""*/5 * * * *"""', 'catchup': '(False)', 'default_args': 'default_args'}), "('example_dag_one', schedule_interval='*/5 * * * *', catchup=False,\n default_args=default_args)\n", (391, 489), False, 'from airflow import DAG\n'), ((5... |
"""Run all the test files in test directory."""
import os
import sys
import unittest
test_dir = os.path.abspath(os.path.dirname(__file__))
top_level = os.path.abspath(os.path.relpath('../', test_dir))
print(top_level)
class TestLoader(object):
@staticmethod
def load_tests(*args):
"""Load unit tests"... | [
"unittest.TestSuite",
"os.path.join",
"unittest.defaultTestLoader.discover",
"os.path.dirname",
"unittest.TextTestRunner",
"os.path.relpath"
] | [((114, 139), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (129, 139), False, 'import os\n'), ((169, 201), 'os.path.relpath', 'os.path.relpath', (['"""../"""', 'test_dir'], {}), "('../', test_dir)\n", (184, 201), False, 'import os\n'), ((824, 868), 'unittest.TextTestRunner', 'unittest.TextT... |
from citrination_client.data import DatasetFile
def test_can_crud_path():
"""
Tests that full get/set/delete functionality is
available for the path property
"""
path = "path"
d = DatasetFile(path)
assert d.path is path
d.path = path
assert d.path is path
del(d.path)
assert... | [
"citrination_client.data.DatasetFile"
] | [((206, 223), 'citrination_client.data.DatasetFile', 'DatasetFile', (['path'], {}), '(path)\n', (217, 223), False, 'from citrination_client.data import DatasetFile\n'), ((492, 509), 'citrination_client.data.DatasetFile', 'DatasetFile', (['path'], {}), '(path)\n', (503, 509), False, 'from citrination_client.data import ... |
from django.shortcuts import render,redirect,get_object_or_404
from hightow.models import Post, Profile
from django.shortcuts import redirect
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404,HttpResponseRedirect
from .forms import NewPostForm, UserForm, ProfileForm,CommentForm,N... | [
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"hightow.models.Profile.objects.all",
"hightow.models.Profile.objects.get",
"hightow.models.Post.objects.filter",
"hightow.models.Post.objects.all",
"django.shortcuts.redirect",
"django.contrib.auth.decorators.login_required",
"django.co... | [((1057, 1101), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/accounts/login/"""'}), "(login_url='/accounts/login/')\n", (1071, 1101), False, 'from django.contrib.auth.decorators import login_required\n'), ((1223, 1267), 'django.contrib.auth.decorators.login_required', 'logi... |
from cif_file_ingester.converter import convert
from cif_file_ingester.parse_cif import parse_with_pmg, get_crystal_system, parse_text
from pypif import pif
from pypif.obj import *
from pymatgen import *
import numpy as np
import os, sys
def test_crystal_system():
'''
Test that the correct crystal system infor... | [
"cif_file_ingester.parse_cif.get_crystal_system",
"cif_file_ingester.converter.convert",
"cif_file_ingester.parse_cif.parse_text"
] | [((430, 459), 'cif_file_ingester.parse_cif.get_crystal_system', 'get_crystal_system', (['structure'], {}), '(structure)\n', (448, 459), False, 'from cif_file_ingester.parse_cif import parse_with_pmg, get_crystal_system, parse_text\n'), ((728, 762), 'cif_file_ingester.parse_cif.parse_text', 'parse_text', (['"""test_file... |
#!/usr/bin/env python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import vtkPoints
from vtkmodules.vtkCommonDataModel import (
... | [
"vtkmodules.vtkCommonDataModel.vtkPolyData",
"vtkmodules.vtkFiltersModeling.vtkRuledSurfaceFilter",
"vtkmodules.vtkRenderingCore.vtkActor",
"vtkmodules.vtkCommonDataModel.vtkCellArray",
"vtkmodules.vtkRenderingCore.vtkRenderWindow",
"vtkmodules.vtkRenderingCore.vtkRenderWindowInteractor",
"vtkmodules.vt... | [((608, 624), 'vtkmodules.vtkCommonColor.vtkNamedColors', 'vtkNamedColors', ([], {}), '()\n', (622, 624), False, 'from vtkmodules.vtkCommonColor import vtkNamedColors\n'), ((681, 694), 'vtkmodules.vtkRenderingCore.vtkRenderer', 'vtkRenderer', ([], {}), '()\n', (692, 694), False, 'from vtkmodules.vtkRenderingCore import... |
from collections import Counter
class Solution(object):
def minWindow(self, search_string, target):
"""
:type s: str
:type t: str
:rtype: str
"""
cnt = Counter(target)
start = 0
end = 0
target_length = len(target)
min_window = ... | [
"collections.Counter"
] | [((213, 228), 'collections.Counter', 'Counter', (['target'], {}), '(target)\n', (220, 228), False, 'from collections import Counter\n')] |
import copy
import os
import torch
import torchvision
import warnings
import math
import utils.misc
import numpy as np
import os.path as osp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import models.modified_resnet_cifar as modified_resnet_cifar
import models.modified_resnetmtl_cif... | [
"torchvision.datasets.CIFAR100",
"torch.optim.lr_scheduler.MultiStepLR",
"math.sqrt",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"copy.deepcopy",
"numpy.linalg.norm",
"trainer.incremental.incremental_train_and_eval",
"numpy.arange",
"os.path.exists",
"utils.compute_accuracy.... | [((832, 865), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (855, 865), False, 'import warnings\n'), ((1852, 1959), 'torchvision.datasets.CIFAR100', 'torchvision.datasets.CIFAR100', ([], {'root': '"""./data"""', 'train': '(True)', 'download': '(True)', 'transform': 'self.... |
"""
Script to generate synthetic simulations in AISTATS paper
"""
# Author: <NAME>
import csv
import os
from typing import Any, Optional, Union
from sklearn import clone
import catenets.logger as log
from catenets.experiment_utils.base import eval_root_mse, get_model_set
from catenets.experiment_utils.simulation_util... | [
"os.path.exists",
"catenets.experiment_utils.simulation_utils.simulate_treatment_setup",
"catenets.logger.debug",
"os.makedirs",
"csv.writer",
"catenets.experiment_utils.base.eval_root_mse",
"catenets.experiment_utils.base.get_model_set",
"sklearn.clone",
"catenets.models.jax.PseudoOutcomeNet"
] | [((1205, 1276), 'catenets.experiment_utils.base.get_model_set', 'get_model_set', ([], {'model_selection': '"""all"""', 'model_params': 'MODEL_PARAMS_AISTATS'}), "(model_selection='all', model_params=MODEL_PARAMS_AISTATS)\n", (1218, 1276), False, 'from catenets.experiment_utils.base import eval_root_mse, get_model_set\n... |
from rest_framework.routers import DefaultRouter
from voters.api.views import VoterViewSet
router = DefaultRouter()
router.register('', VoterViewSet)
urlpatterns = router.urls
| [
"rest_framework.routers.DefaultRouter"
] | [((102, 117), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (115, 117), False, 'from rest_framework.routers import DefaultRouter\n')] |
from os import path
import analytics_utils
import setuptools
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="analytics_utils",
version=analytics_utils.__version__,
autho... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((93, 115), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (105, 115), False, 'from os import path\n'), ((127, 165), 'os.path.join', 'path.join', (['this_directory', '"""README.md"""'], {}), "(this_directory, 'README.md')\n", (136, 165), False, 'from os import path\n'), ((593, 619), 'setuptools... |
"""Utility functions module"""
import pandas as pd
def strip_nans(data):
"""Remove leading and trailing rows with missing values"""
index = data.index
start = 0
while start <= len(index) - 1:
if not pd.isnull(data[index[start]]):
break
start = start + 1
end = len(ind... | [
"pandas.isnull"
] | [((227, 256), 'pandas.isnull', 'pd.isnull', (['data[index[start]]'], {}), '(data[index[start]])\n', (236, 256), True, 'import pandas as pd\n'), ((363, 390), 'pandas.isnull', 'pd.isnull', (['data[index[end]]'], {}), '(data[index[end]])\n', (372, 390), True, 'import pandas as pd\n')] |
# Generated by Django 2.0.2 on 2018-08-18 22:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20180818_2349'),
]
operations = [
migrations.AlterField(
model_name='message',
name='topic',
... | [
"django.db.models.CharField"
] | [((337, 469), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('GE', 'General'), ('GR', 'Greeting'), ('DI', 'Dislike'), ('LI', 'Like')]", 'default': '"""GE"""', 'max_length': '(2)'}), "(choices=[('GE', 'General'), ('GR', 'Greeting'), ('DI',\n 'Dislike'), ('LI', 'Like')], default='GE', max_length... |
from Bio import Entrez, SeqIO
import pickle
import sys
import yaml
def main():
with open('../config.yaml','r') as fp:
config = yaml.load(fp,yaml.FullLoader)
sequences = []
Entrez.email = config['email']
for i in range(1,25):
i = str(i)
sys.stdout.write('\rgetting chr... | [
"pickle.dump",
"yaml.load",
"Bio.SeqIO.read",
"Bio.Entrez.efetch",
"sys.stdout.flush",
"sys.stdout.write"
] | [((147, 177), 'yaml.load', 'yaml.load', (['fp', 'yaml.FullLoader'], {}), '(fp, yaml.FullLoader)\n', (156, 177), False, 'import yaml\n'), ((289, 345), 'sys.stdout.write', 'sys.stdout.write', (["('\\rgetting chromosome ' + i + '/24...')"], {}), "('\\rgetting chromosome ' + i + '/24...')\n", (305, 345), False, 'import sys... |
#!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
import sys
here = path.abspath(path.dirname(__file__))
long_description = """"
# Workflow for lab, animal, and session management
Build a workflow for lab management and animal metadata using DataJoint Elements
+ [elements-lab](htt... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((118, 140), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (130, 140), False, 'from os import path\n'), ((506, 541), 'os.path.join', 'path.join', (['here', '"""requirements.txt"""'], {}), "(here, 'requirements.txt')\n", (515, 541), False, 'from os import path\n'), ((996, 1048), 'setuptools.fin... |
"""
OpenCTM Exporter for Maya.
"""
import maya.api.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx
import sys
from ctypes import *
import openctm
__author__ = "<NAME>, <NAME>"
__version__ = "0.2"
kPluginTranslatorTypeName = "ctm"
kOptionScript = "OpenCTMExporterScript"
kOptionsTypes = {
'normals': bo... | [
"openctm.ctmGetFloatArray",
"maya.api.OpenMaya.MFloatArray",
"maya.api.OpenMaya.MColorArray",
"openctm.ctmErrorString",
"maya.api.OpenMaya.MItDag",
"openctm.CTMfloat",
"maya.api.OpenMaya.MItSelectionList",
"maya.api.OpenMaya.MGlobal.getActiveSelectionList",
"openctm.ctmNewContext",
"openctm.ctmFre... | [((15784, 15846), 'maya.OpenMayaMPx.MFnPlugin', 'OpenMayaMPx.MFnPlugin', (['mobject', '"""Autodesk"""', '__version__', '"""Any"""'], {}), "(mobject, 'Autodesk', __version__, 'Any')\n", (15805, 15846), True, 'import maya.OpenMayaMPx as OpenMayaMPx\n'), ((16274, 16304), 'maya.OpenMayaMPx.MFnPlugin', 'OpenMayaMPx.MFnPlugi... |
#!/usr/bin/env python
import sys
import csv
with open(sys.argv[1]) as infile, open(sys.argv[2], 'w') as outfile:
reader = csv.reader(infile)
writer = csv.writer(outfile)
for row in reader:
writer.writerow([row[1][::-1], row[0][::-1]])
| [
"csv.writer",
"csv.reader"
] | [((124, 142), 'csv.reader', 'csv.reader', (['infile'], {}), '(infile)\n', (134, 142), False, 'import csv\n'), ((154, 173), 'csv.writer', 'csv.writer', (['outfile'], {}), '(outfile)\n', (164, 173), False, 'import csv\n')] |
from clients import ctm_api_client, ctm_saas_client
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class Session:
def __init__(self, endpoint=None, username=None, password=None, api_key=None):
self.endpoint = endpoint
self.username = username
self.pass... | [
"clients.ctm_api_client.Configuration",
"clients.ctm_api_client.ApiClient",
"clients.ctm_saas_client.ApiClient",
"clients.ctm_saas_client.Configuration",
"urllib3.disable_warnings",
"clients.ctm_api_client.RunApi",
"clients.ctm_saas_client.RunApi",
"clients.ctm_api_client.DeployApi",
"clients.ctm_sa... | [((69, 136), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (93, 136), False, 'import urllib3\n'), ((433, 463), 'clients.ctm_api_client.Configuration', 'ctm_api_client.Configuration', ([], {}), '()\n', (461, 4... |
# pylint: disable=invalid-name
"""Lambda module for learning sqlite3 interaction with pandas"""
import os
import sqlite3
import warnings
import pandas as pd
warnings.simplefilter(action="ignore", category=UserWarning)
# label output
print("\n" + "#" * 79)
print("Assignment - Part 2, Making and Populating a Database"... | [
"warnings.simplefilter",
"os.path.abspath",
"sqlite3.connect",
"pandas.read_csv"
] | [((159, 219), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'UserWarning'}), "(action='ignore', category=UserWarning)\n", (180, 219), False, 'import warnings\n'), ((543, 658), 'pandas.read_csv', 'pd.read_csv', (['csv'], {'header': '(0)', 'names': "['user_id', 'sports', 'r... |
#!/usr/bin/env python3
import numpy
import rawcam
import random
from hashlib import md5
while True:
rc = rawcam.init() # initializes camera interface, returns config object
#rc.pack = rawcam.Pack.NONE
#rc.unpack = rawcam.Unpack.NONE
#rawcam.set_timing(0, 0, 0, 0, 0, 0, 0)
rawcam.set_data_lanes(2)
... | [
"rawcam.set_buffer_size",
"rawcam.set_pack_mode",
"rawcam.set_unpack_mode",
"rawcam.set_buffer_dimensions",
"rawcam.set_camera_num",
"rawcam.buffer_get",
"numpy.frombuffer",
"rawcam.set_data_lanes",
"hashlib.md5",
"rawcam.init",
"rawcam.set_buffer_num",
"rawcam.set_zero_copy",
"rawcam.buffer... | [((110, 123), 'rawcam.init', 'rawcam.init', ([], {}), '()\n', (121, 123), False, 'import rawcam\n'), ((295, 319), 'rawcam.set_data_lanes', 'rawcam.set_data_lanes', (['(2)'], {}), '(2)\n', (316, 319), False, 'import rawcam\n'), ((324, 347), 'rawcam.set_image_id', 'rawcam.set_image_id', (['(42)'], {}), '(42)\n', (343, 34... |
from flask import Flask
#API Keys are taken from OS environment!
app = Flask(__name__)
import dont_binge.views | [
"flask.Flask"
] | [((72, 87), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (77, 87), False, 'from flask import Flask\n')] |
import argparse
import admin as ad
from config import Config
import numpy as np
"""Bring in the configuration filename from the command line"""
parser = argparse.ArgumentParser(
description="Get input YAML file as inputFile")
parser.add_argument('inputFile',
help='The input YAML file to drive the ... | [
"numpy.random.normal",
"argparse.ArgumentParser",
"config.Config",
"admin.array2csv",
"numpy.array",
"admin.yaml_loader",
"numpy.zeros"
] | [((154, 225), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get input YAML file as inputFile"""'}), "(description='Get input YAML file as inputFile')\n", (177, 225), False, 'import argparse\n'), ((374, 404), 'admin.yaml_loader', 'ad.yaml_loader', (['args.inputFile'], {}), '(args.inputFi... |
ENUM_FILE_TPL = '''\
# Models generated from rpc.swagger.json, do not edit
# flake8: noqa
import enum
{% for e in enums %}
class {{e._path | last}}(enum.Enum):
"""
ref: {{ e._ref }}
default: {{ e.default }}
"""
{% for prop in e.enum %}{{ prop.name }} = '{{ prop.value }}'
{% endfor %}
{% endfor... | [
"os.path.dirname",
"etcd3.swagger_helper.SwaggerSpec",
"yapf.yapflib.yapf_api.FormatCode",
"jinja2.Template"
] | [((910, 939), 'etcd3.swagger_helper.SwaggerSpec', 'SwaggerSpec', (['rpc_swagger_json'], {}), '(rpc_swagger_json)\n', (921, 939), False, 'from etcd3.swagger_helper import SwaggerSpec\n'), ((1019, 1049), 'jinja2.Template', 'jinja2.Template', (['ENUM_FILE_TPL'], {}), '(ENUM_FILE_TPL)\n', (1034, 1049), False, 'import jinja... |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
# Package meta-data.
NAME = "EthSential"
DESCRIPTION = "Security analysis for Ethereum smart contracts"
URL = "https://github.com/1140251/Ethsential"
AUTHOR = "<NAME>"
AUTHOR_MAIL = "<EMAIL>"
REQUIRES_PYTHON = ">=3.6.0"
# If version is set... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((1285, 1325), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (1298, 1325), False, 'from setuptools import setup, find_packages\n'), ((664, 689), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (679, 689), False, 'import o... |
import os
import json
import urlparse
from redis import StrictRedis
from markdown2 import markdown
import requests
import bleach
from flask import Flask, render_template, make_response, abort
app = Flask(__name__)
HEROKU = 'HEROKU' in os.environ
if HEROKU:
urlparse.uses_netloc.append('redis')
redis_url = ur... | [
"flask.render_template",
"urlparse.uses_netloc.append",
"flask.Flask",
"flask.abort",
"json.dumps",
"os.environ.get",
"markdown2.markdown",
"redis.StrictRedis",
"flask.make_response",
"urlparse.urlparse"
] | [((200, 215), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (205, 215), False, 'from flask import Flask, render_template, make_response, abort\n'), ((265, 301), 'urlparse.uses_netloc.append', 'urlparse.uses_netloc.append', (['"""redis"""'], {}), "('redis')\n", (292, 301), False, 'import urlparse\n'), ((31... |
"""Module for hashing service implementation"""
__all__ = ['HashingService']
from typing import List
from typing import Optional
from fastapi import Depends
from services.hashing import IHashingService
from services.hashing.factories import HashingAlgorithmFactory
from services.hashing.factories import IHashingAlgo... | [
"fastapi.Depends"
] | [((733, 765), 'fastapi.Depends', 'Depends', (['HashingAlgorithmFactory'], {}), '(HashingAlgorithmFactory)\n', (740, 765), False, 'from fastapi import Depends\n')] |
import logging
import sys
import sh
from kubeyard.commands.devel import BaseDevelCommand
logger = logging.getLogger(__name__)
class UpdateRequirementsCommand(BaseDevelCommand):
"""
Command can update requirements using `freeze_requirements` command in container.
Requirements: \n
- `freeze_requ... | [
"logging.getLogger"
] | [((101, 128), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (118, 128), False, 'import logging\n')] |
import math
n = int(input())
s = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
for j in range(i+1, n):
x_i = s[i][0]
y_i = s[i][1]
x_j = s[j][0]
y_j = s[j][1]
ans = max(ans, math.sqrt((x_i - x_j)**2 + (y_i - y_j)**2))
print(ans)
| [
"math.sqrt"
] | [((256, 302), 'math.sqrt', 'math.sqrt', (['((x_i - x_j) ** 2 + (y_i - y_j) ** 2)'], {}), '((x_i - x_j) ** 2 + (y_i - y_j) ** 2)\n', (265, 302), False, 'import math\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
users/admin.py -- Decide what appears on Admin screen
Written by <NAME>, IBM, 2020
Licensed under Apache 2.0, see LICENSE for details
"""
# System imports
from django.contrib import admin
from django.contrib.auth.models import Group
# Register your models here.
fro... | [
"django.contrib.admin.site.unregister",
"django.contrib.admin.register"
] | [((346, 374), 'django.contrib.admin.site.unregister', 'admin.site.unregister', (['Group'], {}), '(Group)\n', (367, 374), False, 'from django.contrib import admin\n'), ((378, 401), 'django.contrib.admin.register', 'admin.register', (['Profile'], {}), '(Profile)\n', (392, 401), False, 'from django.contrib import admin\n'... |
"""String formating language samples."""
import collections
import locale
# category: exemples
def basic_formating():
"""Simple replacement..."""
return "{}".format('infinite')
def deep_formating():
"""Mix of many formating possibilities."""
return "{value.__class__.__bases__[0].__name__!r}".fo... | [
"collections.namedtuple",
"locale.setlocale"
] | [((1318, 1369), 'collections.namedtuple', 'collections.namedtuple', (['"""Value"""', "['absolute_value']"], {}), "('Value', ['absolute_value'])\n", (1340, 1369), False, 'import collections\n'), ((3067, 3122), 'locale.setlocale', 'locale.setlocale', (['locale.LC_NUMERIC', "('fr_FR', 'UTF-8')"], {}), "(locale.LC_NUMERIC,... |
#coding:utf-8
#
# id: bugs.core_6460
# title: Incorrect query result when using named window
# decription:
# Confirmed bug on 4.0.0.2265. Discussed with Vlad 21.12.2020 (subj: "fresh fails on 4.0.0.2298").
# Checked on 4.0.0.2307 -- all OK.
# Mor... | [
"pytest.mark.version",
"firebird.qa.db_factory",
"firebird.qa.isql_act"
] | [((649, 694), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (659, 694), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((1738, 1800), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'subst... |
#!/usr/bin/python
import time
import sys
import atexit
import pyVmomi
from pyVmomi import vim, vmodl
from pyVim import connect
from pyVim.connect import Disconnect, SmartConnect, GetSi
#system = sys.argv[1]
inputs = {'vcenter_ip': '192.168.255.20',
'vcenter_password': '<PASSWORD>!',
'vcenter_user': '<EMAIL>',
'... | [
"pyVim.connect.SmartConnectNoSSL",
"pyVmomi.vim.option.OptionValue",
"time.sleep",
"pyVmomi.vim.vm.ConfigSpec"
] | [((752, 874), 'pyVim.connect.SmartConnectNoSSL', 'connect.SmartConnectNoSSL', ([], {'host': "inputs['vcenter_ip']", 'port': '(443)', 'user': "inputs['vcenter_user']", 'pwd': "inputs['<PASSWORD>']"}), "(host=inputs['vcenter_ip'], port=443, user=inputs[\n 'vcenter_user'], pwd=inputs['<PASSWORD>'])\n", (777, 874), Fals... |
from urllib import parse
from rest_framework.settings import api_settings
from rest_framework.test import APIRequestFactory
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from olympia import amo
from olympia.amo.tests import addon_factory, ESTestCase, reverse_ns
from olympia.co... | [
"olympia.shelves.models.Shelf.objects.create",
"django.contrib.auth.models.AnonymousUser",
"olympia.shelves.serializers.ShelfSerializer",
"olympia.amo.tests.addon_factory",
"rest_framework.settings.api_settings.DEFAULT_VERSIONING_CLASS",
"olympia.amo.tests.reverse_ns",
"olympia.promoted.models.PromotedA... | [((720, 852), 'olympia.amo.tests.addon_factory', 'addon_factory', ([], {'name': '"""test addon test01"""', 'type': 'amo.ADDON_EXTENSION', 'average_daily_users': '(46812)', 'weekly_downloads': '(132)', 'summary': 'None'}), "(name='test addon test01', type=amo.ADDON_EXTENSION,\n average_daily_users=46812, weekly_downl... |
# -*- coding: utf-8 -*-
from taiga.requestmaker import RequestMaker
from taiga.models.base import InstanceResource, ListResource, SearchableList
import unittest
from mock import patch
import datetime
from .tools import MockResponse
class Fake(InstanceResource):
endpoint = 'fakes'
allowed_params = ['param1'... | [
"taiga.models.base.SearchableList",
"taiga.requestmaker.RequestMaker",
"mock.patch"
] | [((1180, 1224), 'mock.patch', 'patch', (['"""taiga.requestmaker.RequestMaker.put"""'], {}), "('taiga.requestmaker.RequestMaker.put')\n", (1185, 1224), False, 'from mock import patch\n'), ((1573, 1617), 'mock.patch', 'patch', (['"""taiga.requestmaker.RequestMaker.put"""'], {}), "('taiga.requestmaker.RequestMaker.put')\n... |
from typing import Any, Dict, List, cast
from ...dwr_parser import parse_dwr
from .models import (
SearchServiceResult,
Creation,
Author,
AdventureStat,
Status,
StatusName,
Difficulty,
)
class SearchResponceBuilder():
def build(self, raw_data: str) -> SearchServiceResult:
js_o... | [
"typing.cast"
] | [((407, 436), 'typing.cast', 'cast', (['int', "data['resultSize']"], {}), "(int, data['resultSize'])\n", (411, 436), False, 'from typing import Any, Dict, List, cast\n'), ((459, 502), 'typing.cast', 'cast', (['List[Dict[str, Any]]', "data['results']"], {}), "(List[Dict[str, Any]], data['results'])\n", (463, 502), False... |
# -*- coding#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 21 01:49:38 2018
@author: syenpark
"""
import pylab as plt
def fib(n, memo={}):
if n < 2:
return 1
else:
try:
return memo[n]
except KeyError:
memo[n] = fib(n-1, memo) + fib(n-... | [
"pylab.figure",
"pylab.plot",
"pylab.show"
] | [((596, 614), 'pylab.figure', 'plt.figure', (['"""fibs"""'], {}), "('fibs')\n", (606, 614), True, 'import pylab as plt\n'), ((619, 660), 'pylab.plot', 'plt.plot', (['xvals', 'yvals'], {'label': '"""fibonacci"""'}), "(xvals, yvals, label='fibonacci')\n", (627, 660), True, 'import pylab as plt\n'), ((667, 677), 'pylab.sh... |
# -*- coding: UTF-8 -*-
import os
import argparse
import cv2
import time
import torch
import torch.optim as optim
from tqdm import tqdm
from config.config import cfg
from core.resnet import resnet18
from core.metrics import Arcface
from utils.data_gen import get_train_loader
parser = argparse.ArgumentParser(descripti... | [
"os.path.exists",
"collections.OrderedDict",
"cv2.merge",
"core.resnet.resnet18",
"torch.nn.CrossEntropyLoss",
"argparse.ArgumentParser",
"torch.load",
"cv2.imshow",
"cv2.waitKey",
"core.metrics.Arcface",
"os.mkdir",
"cv2.split",
"time.time",
"utils.data_gen.get_train_loader",
"torch.no_... | [((287, 351), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""recognition face Training"""'}), "(description='recognition face Training')\n", (310, 351), False, 'import argparse\n'), ((995, 1022), 'torch.load', 'torch.load', (['args.resume_net'], {}), '(args.resume_net)\n', (1005, 1022), ... |
import yaml
def does_database_match_yaml(conn, string):
does_match = get_does_match(conn, string)
table_names = get_table_names()
if not tables_exist(table_names, conn):
return False
for table_name in table_names:
if not does_match(table_name):
return False
return True
... | [
"yaml.load"
] | [((645, 662), 'yaml.load', 'yaml.load', (['string'], {}), '(string)\n', (654, 662), False, 'import yaml\n')] |
# -*- coding:utf-8 -*-
import urllib.parse as urlparser
from typing import Dict, List
from owlmixin import OwlMixin, TOption
from owlmixin.owlcollections import TList
from jumeaux.addons.log2reqs import Log2ReqsExecutor
from jumeaux.logger import Logger
from jumeaux.models import Request, Log2ReqsAddOnPayload
logge... | [
"jumeaux.logger.Logger",
"urllib.parse.parse_qs",
"owlmixin.TOption",
"jumeaux.models.Request.from_dict"
] | [((332, 348), 'jumeaux.logger.Logger', 'Logger', (['__name__'], {}), '(__name__)\n', (338, 348), False, 'from jumeaux.logger import Logger\n'), ((795, 808), 'owlmixin.TOption', 'TOption', (['None'], {}), '(None)\n', (802, 808), False, 'from owlmixin import OwlMixin, TOption\n'), ((642, 700), 'urllib.parse.parse_qs', 'u... |
from handler.base_plugin import BasePlugin
import aiohttp
class DialogflowPlugin(BasePlugin):
__slots__ = ("prefixes", "client_token", "base_url", "base_version")
def __init__(self, client_token="<KEY>", prefixes=("",)):
super().__init__()
self.prefixes = prefixes
self.client_token ... | [
"aiohttp.ClientSession"
] | [((1204, 1227), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (1225, 1227), False, 'import aiohttp\n')] |
import sys
import time
import argparse
import os
import warnings
import numpy as np
import torch
import torch.nn as nn
from collections import defaultdict
import pickle as pk
from torch.nn import Parameter
from layers import DNANodeRepModule, ConvNodeRepModule
from metrics import compute_mae, compute_mape, compute_ss... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.L1Loss",
"metrics.compute_mape",
"torch.nn.MSELoss",
"torch.nn.BatchNorm1d",
"training_environment.checkpoint_filepath",
"torch.cuda.is_available",
"dataset.UrbanPlanningDataset",
"numpy.nanmean",
"numpy.array",
"layers.DNANodeRepModule",
"layer... | [((762, 803), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""UP"""'}), "(description='UP')\n", (785, 803), False, 'import argparse\n'), ((972, 997), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (995, 997), False, 'import torch\n'), ((1017, 1037), 'torch.device'... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import scipy
# ==============================================================================
# ==============================================================================
# ========================================================================... | [
"pandas.Series",
"numpy.array",
"scipy.interpolate.splev",
"scipy.interpolate.splrep",
"numpy.arange"
] | [((1718, 1777), 'scipy.interpolate.splrep', 'scipy.interpolate.splrep', ([], {'x': 'value_times', 'y': 'values', 'k': '(3)', 's': '(0)'}), '(x=value_times, y=values, k=3, s=0)\n', (1742, 1777), False, 'import scipy\n'), ((1851, 1883), 'numpy.arange', 'np.arange', (['(0)', 'value_times[-1]', '(1)'], {}), '(0, value_time... |
from django.urls import path
from authors.apps.authentication.views import (SocialView, UserRetrieveUpdateAPIView,\
RegistrationAPIView, LoginAPIView \
,
ForgotPasswordView,
... | [
"authors.apps.authentication.views.ChangePasswordView.as_view",
"authors.apps.authentication.views.UserRetrieveUpdateAPIView.as_view",
"authors.apps.authentication.views.RegistrationAPIView.as_view",
"authors.apps.authentication.views.SocialView.as_view",
"authors.apps.authentication.views.UserActivationAPI... | [((452, 487), 'authors.apps.authentication.views.UserRetrieveUpdateAPIView.as_view', 'UserRetrieveUpdateAPIView.as_view', ([], {}), '()\n', (485, 487), False, 'from authors.apps.authentication.views import SocialView, UserRetrieveUpdateAPIView, RegistrationAPIView, LoginAPIView, ForgotPasswordView, UserActivationAPIVie... |
# coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="crop_image.py">
# Copyright (c) 2019 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a
# ... | [
"asposeimagingcloudexamples.imaging_base.ImagingBase.__init__",
"asposeimagingcloud.models.requests.CreateCroppedImageRequest"
] | [((1664, 1703), 'asposeimagingcloudexamples.imaging_base.ImagingBase.__init__', 'ImagingBase.__init__', (['self', 'imaging_api'], {}), '(self, imaging_api)\n', (1684, 1703), False, 'from asposeimagingcloudexamples.imaging_base import ImagingBase\n'), ((4836, 4936), 'asposeimagingcloud.models.requests.CreateCroppedImage... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of CERN Search.
# Copyright (C) 2018-2021 CERN.
#
# Citadel Search is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Helper methods for CERN Search records."""
from elas... | [
"flask.current_app.logger.debug",
"invenio_indexer.utils.schema_to_index",
"invenio_search.utils.prefix_index",
"invenio_indexer.utils.default_record_to_index",
"invenio_search.current_search.mappings.keys",
"invenio_search.current_search_client.indices.get_mapping"
] | [((692, 744), 'flask.current_app.logger.debug', 'current_app.logger.debug', (['"""Identity: %s"""', 'g.identity'], {}), "('Identity: %s', g.identity)\n", (716, 744), False, 'from flask import current_app, g\n'), ((749, 807), 'flask.current_app.logger.debug', 'current_app.logger.debug', (['"""Current User: %s"""', 'curr... |
# Copyright 2018 The CapsLayer Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"capslayer.shape",
"numpy.prod",
"tensorflow.compat.v1.variable_scope",
"tensorflow.split",
"capslayer.norm",
"capslayer.core.transforming",
"capslayer.ops.squash",
"tensorflow.layers.conv2d",
"numpy.zeros",
"tensorflow.sigmoid",
"tensorflow.name_scope",
"tensorflow.clip_by_value",
"numpy.co... | [((1880, 1913), 'tensorflow.compat.v1.variable_scope', 'tf.compat.v1.variable_scope', (['name'], {}), '(name)\n', (1907, 1913), True, 'import tensorflow as tf\n'), ((4250, 4310), 'capslayer.core.routing', 'routing', (['vote', 'activation', 'routing_method'], {'num_iter': 'num_iter'}), '(vote, activation, routing_method... |
#
# HTTP Response Functions
#
import pscheduler
from werkzeug.datastructures import Headers
from flask import Response
from flask import request
from .args import arg_boolean
from .log import log
# TODO: Duplicative, but easier than the cross-module imports. :-@
def response_json_dump(dump, sanitize=True):
if ... | [
"werkzeug.datastructures.Headers",
"flask.Response",
"pscheduler.json_decomment"
] | [((695, 745), 'flask.Response', 'Response', (["(text + '\\n')"], {'mimetype': '"""application/json"""'}), "(text + '\\n', mimetype='application/json')\n", (703, 745), False, 'from flask import Response\n'), ((858, 913), 'flask.Response', 'Response', (["(message + '\\n')"], {'status': '(200)', 'mimetype': 'mimetype'}), ... |
# Simple Linear Regression
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Salary_Data.csv')
X = dataset.iloc[:, :-1].values # Independent Variable
y = dataset.iloc[:, 1].values # Dependent Variable
# Splitting the dataset into the Training set an... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.show"
] | [((134, 164), 'pandas.read_csv', 'pd.read_csv', (['"""Salary_Data.csv"""'], {}), "('Salary_Data.csv')\n", (145, 164), True, 'import pandas as pd\n'), ((419, 474), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(1 / 3)', 'random_state': '(0)'}), '(X, y, test_size=1 / 3, rando... |
from __future__ import absolute_import, division, print_function
import os
class Test(object):
def test_run(self, dials_regression):
filename = os.path.join(dials_regression, 'image_examples', 'XDS', 'XPARM.XDS')
import dxtbx
models = dxtbx.load(filename)
self.detector = models.get_detector()
a... | [
"random.uniform",
"dxtbx.model.parallax_correction",
"os.path.join",
"dxtbx.load",
"scitbx.matrix.col",
"dxtbx.model.parallax_correction_inv"
] | [((152, 220), 'os.path.join', 'os.path.join', (['dials_regression', '"""image_examples"""', '"""XDS"""', '"""XPARM.XDS"""'], {}), "(dials_regression, 'image_examples', 'XDS', 'XPARM.XDS')\n", (164, 220), False, 'import os\n'), ((252, 272), 'dxtbx.load', 'dxtbx.load', (['filename'], {}), '(filename)\n', (262, 272), Fals... |
from .pylint_errors import pylint_dict_final
from flask import Flask, render_template, request, jsonify, session
from flask_socketio import SocketIO
import eventlet.wsgi
import tempfile, mmap, os, re
from datetime import datetime
from pylint import epylint as lint
from subprocess import Popen, PIPE, STDOUT
from multipr... | [
"flask.render_template",
"flask.Flask",
"subprocess.Popen",
"multiprocessing.cpu_count",
"flask_socketio.SocketIO",
"os.remove",
"datetime.datetime.now",
"tempfile.NamedTemporaryFile",
"multiprocessing.Pool",
"pylint.epylint.py_run",
"flask.jsonify"
] | [((418, 433), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (423, 433), False, 'from flask import Flask, render_template, request, jsonify, session\n'), ((509, 522), 'flask_socketio.SocketIO', 'SocketIO', (['app'], {}), '(app)\n', (517, 522), False, 'from flask_socketio import SocketIO\n'), ((536, 547), '... |
import numpy as np
def sweepcut(p,g):
"""
Computes a cluster using sweep cut and conductance as a criterion.
Parameters
----------
p: numpy array
A vector that is used to perform rounding.
g: graph object
Returns
-------
In a list of l... | [
"numpy.argsort",
"numpy.count_nonzero",
"numpy.zeros"
] | [((1345, 1371), 'numpy.argsort', 'np.argsort', (['(-1 * p)'], {'axis': '(0)'}), '(-1 * p, axis=0)\n', (1355, 1371), True, 'import numpy as np\n'), ((1394, 1413), 'numpy.count_nonzero', 'np.count_nonzero', (['p'], {}), '(p)\n', (1410, 1413), True, 'import numpy as np\n'), ((1480, 1496), 'numpy.zeros', 'np.zeros', (['(n,... |
import paramiko, json, os
from kubernetes import client, config
from apps.common import static_value
from apps.common.utils import init_kubernetes
from apps.network_manager.api import NicApi
def get_master_server_info():
base_path = os.path.dirname(os.path.abspath(__file__))
with open(base_path+'/master_serv... | [
"apps.network_manager.api.NicApi",
"json.load",
"apps.common.utils.init_kubernetes",
"os.path.abspath",
"paramiko.SSHClient",
"json.dump"
] | [((680, 700), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (698, 700), False, 'import paramiko, json, os\n'), ((1888, 1908), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (1906, 1908), False, 'import paramiko, json, os\n'), ((2588, 2605), 'apps.common.utils.init_kubernetes', 'init_kuber... |
# All credits to the fmriprep peeps
from nipype.interfaces.utility import Function
def erode_mask(in_file, epi_mask, epi_mask_erosion_mm=0,
erosion_mm=0):
import os
import nibabel as nib
import scipy.ndimage as nd
# thresholding
probability_map_nii = nib.load(in_fil... | [
"nipype.interfaces.utility.Function",
"nibabel.load",
"scipy.ndimage.binary_erosion",
"pandas.concat",
"nibabel.Nifti1Image",
"os.path.abspath",
"numpy.zeros_like"
] | [((1623, 1782), 'nipype.interfaces.utility.Function', 'Function', ([], {'function': 'erode_mask', 'input_names': "['in_file', 'epi_mask', 'epi_mask_erosion_mm', 'erosion_mm']", 'output_names': "['roi_eroded', 'epi_mask_eroded']"}), "(function=erode_mask, input_names=['in_file', 'epi_mask',\n 'epi_mask_erosion_mm', '... |
import pytest
import globus_sdk
from tests.common import make_response
@pytest.fixture
def make_oauth_token_response():
"""
response with conveniently formatted names to help with iteration in tests
"""
def f(client=None):
return make_response(
response_class=globus_sdk.services.... | [
"tests.common.make_response"
] | [((258, 1054), 'tests.common.make_response', 'make_response', ([], {'response_class': 'globus_sdk.services.auth.response.OAuthTokenResponse', 'json_body': "{'access_token': 'access_token_1', 'expires_in': 3600, 'id_token':\n '<PASSWORD>', 'refresh_token': '<PASSWORD>', 'resource_server':\n 'resource_server_1', 's... |
from flask_testing import TestCase
from unit_tests.utilities import Utilities
from unittest.mock import MagicMock, patch
from maintain_frontend import main
from maintain_frontend.dependencies.session_api.session import Session
from maintain_frontend.constants.permissions import Permissions
from maintain_frontend.models... | [
"unittest.mock.MagicMock",
"json.dumps",
"flask.url_for",
"maintain_frontend.models.LLC1Search",
"unit_tests.utilities.Utilities.mock_session_cookie_flask_test",
"maintain_frontend.main.app.test_request_context",
"unittest.mock.patch"
] | [((2831, 2878), 'unittest.mock.patch', 'patch', (['"""maintain_frontend.app.requests.Session"""'], {}), "('maintain_frontend.app.requests.Session')\n", (2836, 2878), False, 'from unittest.mock import MagicMock, patch\n'), ((2884, 2969), 'unittest.mock.patch', 'patch', (['"""maintain_frontend.add_land_charge.address_con... |
from flask import Flask
from .main.routes import main
from .extensions import mongo
def create_app():
app = Flask(__name__)
app.config['MONGO_URI'] = ''
app.register_blueprint(main)
mongo.init_app(app)
return app
| [
"flask.Flask"
] | [((120, 135), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (125, 135), False, 'from flask import Flask\n')] |
#!/usr/bin/env python3.6
# Create an HTML page listing all the ad hoc queries in Redmine
import sys
import jinja2
from jinja2 import Template
import re
import string
from optparse import OptionParser
import csv
def main():
usage = "usage: %prog -i ad_hoc_listing_file -t ad_hoc_listing_template_file -o project_li... | [
"jinja2.FileSystemLoader",
"optparse.OptionParser",
"jinja2.Environment"
] | [((350, 375), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (362, 375), False, 'from optparse import OptionParser\n'), ((1300, 1333), 'jinja2.FileSystemLoader', 'jinja2.FileSystemLoader', (['template'], {}), '(template)\n', (1323, 1333), False, 'import jinja2\n'), ((1344, 1377), ... |
"""
75. Sort Colors
Medium
6543
338
Add to List
Share
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
We will use the integers 0, 1, and 2 to represent the color red, white, and blu... | [
"collections.Counter"
] | [((4299, 4312), 'collections.Counter', 'Counter', (['nums'], {}), '(nums)\n', (4306, 4312), False, 'from collections import Counter\n')] |
import torch
# compute features in pytorch
def compute_features(audio, hp):
# compute spectrogram from first channel
stft = torch.stft(audio, hp.features.n_fft, hp.features.hop, hp.features.win_len, center=False)
return | [
"torch.stft"
] | [((135, 227), 'torch.stft', 'torch.stft', (['audio', 'hp.features.n_fft', 'hp.features.hop', 'hp.features.win_len'], {'center': '(False)'}), '(audio, hp.features.n_fft, hp.features.hop, hp.features.win_len,\n center=False)\n', (145, 227), False, 'import torch\n')] |
# Generated by Django 3.1.7 on 2021-04-23 03:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('person', '0001_initial'),
('todo', '0002_todo_github_repo'),
]
operations = [
migrations.AddField(
model_name='todo',
... | [
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((364, 420), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'default': 'None', 'to': '"""person.Person"""'}), "(default=None, to='person.Person')\n", (386, 420), False, 'from django.db import migrations, models\n'), ((545, 601), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(Tr... |
######################################
# DO NOT USE ON WALLABY #
# USE THE ONE IN /usr/lib/wallaby.py #
# INSTEAD #
######################################
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.2
#
# Do not make changes to this file ... | [
"_wallaby.get_object_bbox_height",
"_wallaby.graphics_rectangle_fill",
"_wallaby.setpwm",
"_wallaby.BackEMF_port",
"_wallaby.get_create_rfcliff",
"_wallaby.get_create_overcurrents",
"_wallaby.create_load_song",
"_wallaby.Gyro_x",
"_wallaby.get_mouse_middle_button",
"_wallaby.gyro_z",
"_wallaby.g... | [((11148, 11177), '_wallaby.Battery_isCharging', '_wallaby.Battery_isCharging', ([], {}), '()\n', (11175, 11177), False, 'import _wallaby\n'), ((11277, 11318), '_wallaby.Battery_powerLevel', '_wallaby.Battery_powerLevel', (['battery_type'], {}), '(battery_type)\n', (11304, 11318), False, 'import _wallaby\n'), ((11405, ... |
from rest_framework import viewsets, status, serializers, mixins, filters
from rest_framework.exceptions import NotFound
from rest_framework.decorators import action
from rest_framework.response import Response
from .models import PostIt, Board, WorkIn, VoteIn
from django.core.exceptions import ObjectDoesNotExist
from ... | [
"rest_framework.decorators.action",
"django.contrib.auth.models.User.objects.all",
"rest_framework.response.Response",
"django.contrib.auth.models.User.objects.get",
"rest_framework.exceptions.NotFound"
] | [((3458, 3502), 'rest_framework.decorators.action', 'action', ([], {'detail': '(True)', 'methods': "['get', 'post']"}), "(detail=True, methods=['get', 'post'])\n", (3464, 3502), False, 'from rest_framework.decorators import action\n'), ((3593, 3637), 'rest_framework.decorators.action', 'action', ([], {'detail': '(True)... |
import requests
import time
import datetime
d_url = "https://corona-rest-api.herokuapp.com/Api/"
raw = None
try:
raw = requests.get(d_url)
except:
print("Error in connection.")
if raw != None:
data = raw.json()['Success']
print(data)
#### Intermediate: 19. Countdown App
# import time
#
#
# def n... | [
"requests.get"
] | [((126, 145), 'requests.get', 'requests.get', (['d_url'], {}), '(d_url)\n', (138, 145), False, 'import requests\n')] |
import unittest
import numpy as np
from RyStats.inferential import pearsons_correlation, polyserial_correlation
class TestCorrelation(unittest.TestCase):
"""Test Fixture for correlation."""
def test_pearsons_correlation(self):
"""Testing pearsons correlation."""
rng = np.random.default_rng(... | [
"numpy.abs",
"numpy.random.default_rng",
"numpy.corrcoef",
"numpy.digitize",
"numpy.count_nonzero",
"RyStats.inferential.polyserial_correlation",
"unittest.main",
"RyStats.inferential.pearsons_correlation"
] | [((2540, 2555), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2553, 2555), False, 'import unittest\n'), ((298, 347), 'numpy.random.default_rng', 'np.random.default_rng', (['(34982750394857201981982375)'], {}), '(34982750394857201981982375)\n', (319, 347), True, 'import numpy as np\n'), ((444, 473), 'RyStats.infe... |
import logging
from docker.errors import APIError, NotFound
logger = logging.getLogger('clients.docker.network')
class DockerNetworksMixin:
def create_network(self, name):
return self.client.networks.create(name, driver="bridge")
def remove_network(self, network):
try:
network.r... | [
"logging.getLogger"
] | [((71, 114), 'logging.getLogger', 'logging.getLogger', (['"""clients.docker.network"""'], {}), "('clients.docker.network')\n", (88, 114), False, 'import logging\n')] |
from abc import ABCMeta, abstractmethod
from typing import Any, Awaitable, Callable, Dict, Generic, Optional, TypeVar
from graia.amnesia.message import Element
from graia.broadcast import Dispatchable
T = TypeVar("T")
P = TypeVar("P")
class AbstractEventParser(Generic[T, P], metaclass=ABCMeta):
parsers: Dict[T,... | [
"typing.TypeVar"
] | [((207, 219), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (214, 219), False, 'from typing import Any, Awaitable, Callable, Dict, Generic, Optional, TypeVar\n'), ((224, 236), 'typing.TypeVar', 'TypeVar', (['"""P"""'], {}), "('P')\n", (231, 236), False, 'from typing import Any, Awaitable, Callable, Dict, G... |
"""
Base of all the elements found on the Elk panel... Zone, Keypad, etc.
"""
import re
from abc import abstractmethod
from .const import TextDescriptions
from .message import sd_encode
class Element:
"""Element class"""
def __init__(self, index, elk):
self._index = index
self._elk = elk
... | [
"re.compile"
] | [((3793, 3821), 're.compile', 're.compile', (['"""USER \\\\d\\\\d\\\\d"""'], {}), "('USER \\\\d\\\\d\\\\d')\n", (3803, 3821), False, 'import re\n')] |
from __future__ import print_function
import qt
import shutil
import sys
import os
import time
import progressbar
from constants import *
def copy_script(data, once):
if once:
shutil.copy2('%s'%sys.argv[0],'%s/%s'%(data.get_filepath()[:-(len(data.get_filename())+1)],os.path.basename(sys.argv[0])))
... | [
"qt.instruments.create",
"qt.mstart",
"os.path.basename",
"time.time"
] | [((1338, 1430), 'qt.instruments.create', 'qt.instruments.create', (['"""ZNB20"""', '"""RhodeSchwartz_ZNB20"""'], {'address': 'ZNB20_ADDRESS', 'reset': '(True)'}), "('ZNB20', 'RhodeSchwartz_ZNB20', address=ZNB20_ADDRESS,\n reset=True)\n", (1359, 1430), False, 'import qt\n'), ((1434, 1530), 'qt.instruments.create', 'q... |
import numpy as np
from stable_baselines3 import SAC
# from stable_baselines3.sac import CnnPolicy
from stable_baselines3.sac import MlpPolicy
import gym
import d4rl
import json
import os
env = gym.make("carla-lane-v0")
exp_name = "baseline_carla"
total_timesteps = 1000000
save_every = 5000
tensorboard_log = os.path... | [
"numpy.mean",
"stable_baselines3.SAC",
"os.path.join",
"numpy.std",
"gym.make",
"json.dump"
] | [((196, 221), 'gym.make', 'gym.make', (['"""carla-lane-v0"""'], {}), "('carla-lane-v0')\n", (204, 221), False, 'import gym\n'), ((313, 345), 'os.path.join', 'os.path.join', (['"""./logs"""', 'exp_name'], {}), "('./logs', exp_name)\n", (325, 345), False, 'import os\n'), ((355, 442), 'stable_baselines3.SAC', 'SAC', (['Ml... |
import sys
from confluent_kafka.schema_registry import SchemaRegistryClient
import pyspark.sql.functions as fn
from pyspark.sql.types import StringType
#
from pyspark.sql import SparkSession
from pyspark.sql.avro.functions import from_avro, to_avro
#
# https://blogit.michelin.io/kafka-to-delta-lake-using-apache-spark-... | [
"pyspark.sql.functions.expr",
"pyspark.sql.SparkSession.builder.appName",
"sys.exit",
"pyspark.sql.types.StringType",
"confluent_kafka.schema_registry.SchemaRegistryClient"
] | [((1593, 1635), 'confluent_kafka.schema_registry.SchemaRegistryClient', 'SchemaRegistryClient', (['schema_registry_conf'], {}), '(schema_registry_conf)\n', (1613, 1635), False, 'from confluent_kafka.schema_registry import SchemaRegistryClient\n'), ((456, 468), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (464, 468... |
from flask import Flask
app = Flask(__name__)
#app.config['CONFIG'] = None
from pbnh.app import views
| [
"flask.Flask"
] | [((31, 46), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (36, 46), False, 'from flask import Flask\n')] |
from django.db import models
from django.core.validators import (
EmailValidator,
MaxValueValidator,
MinValueValidator,
URLValidator,
validate_slug
)
from main.validators import validate_even_number
# Create your models here.
# every table in database is represented as a class
# every row in databs... | [
"django.core.validators.MaxValueValidator",
"django.db.models.TextField",
"django.core.validators.EmailValidator",
"django.db.models.IntegerField",
"django.core.validators.MinValueValidator",
"django.db.models.CharField"
] | [((525, 557), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (541, 557), False, 'from django.db import models\n'), ((590, 622), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'unique': '(True)'}), '(unique=True)\n', (609, 622), False, 'from django.d... |
from time import sleep, time
import logging
from player import Player
nqlog = logging.getLogger("nq")
class SpotifyPlayer(Player):
def __init__(self, loc, sp, dev):
super().__init__(loc)
self.sp = sp
self.sp.transfer_playback(dev, force_play=False)
self.cur_ms = 0
self.init_song_info()
def init_song_in... | [
"logging.getLogger",
"time.time",
"time.sleep"
] | [((80, 103), 'logging.getLogger', 'logging.getLogger', (['"""nq"""'], {}), "('nq')\n", (97, 103), False, 'import logging\n'), ((437, 443), 'time.time', 'time', ([], {}), '()\n', (441, 443), False, 'from time import sleep, time\n'), ((1231, 1239), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (1236, 1239), False, 'from... |
import time
import datetime
import re
s1 = "2,193,45"
s2 = '16,990.5'
s3 = "45,990,987.75"
s4 = "4,36.5"
s5 = "2343432"
s6 = "5.08.3"
s7 = "5,05.3"
s8 = "1.047.8"
s9 = "5问 232"
i0 = "17928"
i1 = "1792.8"
i2 = "179.28"
def match(s2):
if s2.count('.') == 1 and len(s2.split('.')[1]) <= 2:
sec = s2.split('.'... | [
"re.search"
] | [((1128, 1151), 're.search', 're.search', (['regex', 'texts'], {}), '(regex, texts)\n', (1137, 1151), False, 'import re\n')] |
from indicators.SingleValueIndicator import SingleValueIndicator
from indicators.EMA import EMA
class TEMA(SingleValueIndicator):
def __init__(self, period, timeSeries = None):
super(TEMA, self).__init__()
self.period = period
self.ema = EMA(period)
self.addSubIndicator(self.ema)
self.emaEma = EMA(period... | [
"indicators.EMA.EMA"
] | [((248, 259), 'indicators.EMA.EMA', 'EMA', (['period'], {}), '(period)\n', (251, 259), False, 'from indicators.EMA import EMA\n'), ((310, 321), 'indicators.EMA.EMA', 'EMA', (['period'], {}), '(period)\n', (313, 321), False, 'from indicators.EMA import EMA\n'), ((341, 352), 'indicators.EMA.EMA', 'EMA', (['period'], {}),... |
"""
This file includes a set of helpers that make treating Swift as a filesystem a
bit easier.
See COPYING for license information.
"""
import datetime
import stat
import os
import urlparse
import time
from twisted.internet import defer, reactor, task
from twisted.web.iweb import IBodyProducer, UNKNOWN_LENGTH
from tw... | [
"urlparse.urljoin",
"swftp.utils.try_datetime_parse",
"datetime.datetime.utcnow",
"twisted.internet.defer.returnValue",
"zope.interface.implements",
"os.stat_result",
"swftp.utils.OrderedDict",
"swftp.swift.NotFound",
"twisted.internet.task.deferLater",
"twisted.internet.defer.Deferred"
] | [((668, 695), 'urlparse.urljoin', 'urlparse.urljoin', (['"""/"""', 'path'], {}), "('/', path)\n", (684, 695), False, 'import urlparse\n'), ((1819, 1852), 'swftp.utils.try_datetime_parse', 'try_datetime_parse', (['last_modified'], {}), '(last_modified)\n', (1837, 1852), False, 'from swftp.utils import try_datetime_parse... |
from app import app
from flask import redirect, flash, request
from werkzeug import secure_filename
from .alchemy import db, User, tablename
import os
from os import listdir, mkdir
from os.path import isfile, join, isdir
import time
import uuid
import re
import shutil
main_path = app.config['USER_STORAGE_PATH']
# ch... | [
"os.listdir",
"flask.flash",
"re.compile",
"os.rename",
"time.strftime",
"os.path.splitext",
"os.path.join",
"uuid.uuid4",
"flask.redirect",
"werkzeug.secure_filename",
"os.path.isdir",
"os.mkdir",
"shutil.rmtree",
"os.remove"
] | [((1351, 1363), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1361, 1363), False, 'import uuid\n'), ((2733, 2756), 'os.listdir', 'listdir', (['self.user_path'], {}), '(self.user_path)\n', (2740, 2756), False, 'from os import listdir, mkdir\n'), ((3306, 3329), 'os.listdir', 'listdir', (['self.user_path'], {}), '(self.u... |
# Copyright 2021 Huawei Technologies 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 applicable law or agreed to... | [
"argparse.ArgumentParser"
] | [((774, 829), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MindSpore SinGAN"""'}), "(description='MindSpore SinGAN')\n", (797, 829), False, 'import argparse\n')] |