seq_id string | text string | repo_name string | sub_path string | file_name string | file_ext string | file_size_in_byte int64 | program_lang string | lang string | doc_type string | stars int64 | dataset string | pt string | api list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
602380992 | # -*- coding: utf-8 -*-
# @Author: MaxST
# @Date: 2019-08-23 17:30:42
# @Last Modified by: MaxST
# @Last Modified time: 2019-09-08 22:12:00
import asyncio
import base64
import binascii
import hashlib
import hmac
import logging
import struct
import threading
from Cryptodome.Cipher import PKCS1_OAEP
from Cryptodome.... | null | talkative_phone/async_core.py | async_core.py | py | 12,967 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "descriptors.PortDescr",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.Q... |
197262884 | # coding=utf-8
"""
Module
"""
from __future__ import absolute_import
import copy
import pytest
from datacube.index.postgres._fields import NumericRangeDocField
from datacube.model import Range
_DATASET_METADATA = {
'id': 'f7018d80-8807-11e5-aeaa-1040f381a756',
'instrument': {'name': 'TM'},
'platform': {
... | null | integration_tests/index/test_config_docs.py | test_config_docs.py | py | 10,371 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "copy.deepcopy",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"lin... |
386921355 | #!/usr/bin/Python
# -*- coding: utf-8 -*-
import json
import decimal
from datetime import date
from datetime import datetime
errors=[
u'成功',
u'缺少必须的数据',
u'数据库操作失败',
u'数据格式错误',
u'没有权限'
]
def createSuccess(data=None):
return {
'code': 0,
'message': errors[0],
'data... | null | utils.py | utils.py | py | 1,437 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.JSONEncoder",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 55,
"usage_type": "argument"
},
{
"api_name": "datetime.date",
"line_number": 57,
"usage_type": "argument"
},
{
"api_name": "json.JS... |
230101130 | from wildspeech.asr.args import get_argparser
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
from wildspeech.asr.logger import WandbLoggerWrapper
import os
import time
from wildspeech.baseline.speaker_system import System
from pytorch_lightning import Trainer
import torch
from numba.core.errors ... | null | tal/baseline/train.py | train.py | py | 3,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.simplefilter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numba.core.errors.NumbaDeprecationWarning",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "warnings.simplefilter",
"line_number": 13,
"usage_type": "call"
},
{
... |
614159807 | from qt_work import qt
import qt_work
import sys
import time
import random
from multiprocessing import Queue
class TestProducer(qt_work.ProducerProcess):
def items(self):
while True:
value = random.random()
print('produced', value)
yield self.name, value
... | null | qt_work/.test.py | .test.py | py | 941 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "qt_work.ProducerProcess",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "random.random",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "qt_work.Consume... |
195476753 | import sqlite3
# Function to check for valid "EMAIL ID"
def test_email(input_email):
if "@" in input_email:
return True
print("\nPlease enter correct Email address!\n")
return False
# Function to check for "EMAIL ID" (if exists already)
def email_search(user_email, db_filename, table_name):
... | null | email.py | email.py | py | 889 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
}
] |
623769188 | import pandas as pd
import requests
import json
from bs4 import BeautifulSoup
import urllib
from tkinter import *
from tkinter.filedialog import askdirectory,askopenfilename
import openpyxl
from os import listdir, path
class Gui(Toplevel):
def __init__(self, parent, title="Обработка файлов"):
T... | null | GetComments/comments.py | comments.py | py | 10,858 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askdirectory",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 50,
"usage_type": "call"
},
{
... |
390708772 | import argparse
import torch
import torch.backends.cudnn as cudnn
import net
import loaddata
import pdb
import matplotlib
import matplotlib.pyplot as plt
plt.set_cmap("jet")
parser = argparse.ArgumentParser(description='single depth prediction with base-refinement network')
parser.add_argument('--base_nyu2', default... | null | demo_nyu2.py | demo_nyu2.py | py | 1,711 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.set_cmap",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "... |
556969058 | # -*- coding: utf-8 -*-
import time
import datetime
class Timestamp(object):
@staticmethod
def decode(timestamp):
"""This receive timestamp number and convert to date string
:param timestamp: timestamp number as 1438041600000
:return: date format year-month-day hour:min:seg
... | null | backpack/temporal.py | temporal.py | py | 1,672 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 29,
"usage_type": "call"
},
{
... |
473390183 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from datetime import datetime
import unittest
import os
from asn1crypto import pem, x509
from asn1crypto.util import timezone
from certvalidator import CertificateValidator, ValidationContext
from certvalidator.errors i... | null | tests/test_certificate_validator.py | test_certificate_validator.py | py | 5,277 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "_unittest_compat.patch",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
133917791 | ######################################## Prepared for the unsupervised machine translation (bilingual part, various ways to get the initial translation) ########################################
######################################## 2: phrase level translation with Moses ######################################... | null | utils/filter_bilingual_phrase.py | filter_bilingual_phrase.py | py | 2,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
}
] |
509710885 | # Standard library imports
import itertools
import argparse
# Dependencies
import numpy as np
# Script Defaults
DEFAULT_DOMAIN = [0, 4]
DEFAULT_NUMPOINTS = 500
DEFAULT_x0 = 1
DEFAULT_v0 = 0
def damped_oscillator(
k,
b,
domain=DEFAULT_DOMAIN,
num_points=DEFAULT_NUMPOINTS,
x_0=DEFAULT_x0,
v_0=... | null | examples/DampedPendulum/DampedOscillatorGeneration.py | DampedOscillatorGeneration.py | py | 5,072 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "numpy.full",
"line_numbe... |
623987257 | from odoo import api, fields, models, tools, SUPERUSER_ID, _
from odoo.exceptions import UserError, AccessError, ValidationError
from odoo.tools.safe_eval import safe_eval
from datetime import date, datetime, timedelta
import logging
_logger = logging.getLogger(__name__)
class CreditLimitResPartner(models.Model):
... | null | accounting_credit_limit/models/accounting_credit_limit.py | accounting_credit_limit.py | py | 2,561 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Boolean... |
29951199 | #!/usr/bin/env python3
#
# evaluate_altafsir.py
#
# check accuracy of tagger against selected corpus from altafsir
#
# get altfsir files for testing:
# $ for f in $(find ~/Desktop/development_230320/corpus/sources/altafsir/data/all/final -type f -name "*.json" | sort -R | tail -2000) ;
# do cp $f altafsir_in ;... | null | evaluate_altafsir.py | evaluate_altafsir.py | py | 2,294 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.scandir",
... |
647302209 | #Plotting count of people with non-zero voxels for WM regions (labels 30xx-40xx), sorted and unsorted
import csv
import matplotlib.pyplot as plt
import numpy as np
from operator import itemgetter
###LEFT HEMISPHERE###
left_seg_list= ['Seg3001','Seg3002','Seg3003','Seg3004','Seg3005','Seg3006','Seg3007','Seg3008','Seg... | null | Evaline_scripts/fs_wm_analyze_count.py | fs_wm_analyze_count.py | py | 4,249 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "csv.excel_tab",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
30445372 | #!/usr/bin/env python
# -*-coding: utf8 -*-
"""Channel API
"""
import time
import json
import urllib
import urllib2
from urlparse import urlparse
import socket
from httplib import HTTPConnection, HTTPException
from core import retry
MAXIMUM_CLIENT_ID_LENGTH = 118
MAXIMUM_TOKEN_DURATION_SECONDS = 24 * 60
MAXIMUM_ME... | null | python/channel.py | channel.py | py | 3,422 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urlparse.urlparse",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "httplib.HTTPConnection",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "httplib.HTT... |
68524505 | from PIL import Image, ImageDraw
import copy
from Object import Object
class Figure:
def __init__(self, image_source):
if isinstance(image_source, str):
# Load image from file and make it black or white (no grey!)
self.image = Image.open(image_source).convert('L').point(lambda x: 0 ... | null | Project 2 Submission/Project Code - Python/Figure.py | Figure.py | py | 2,047 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.Image",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_num... |
215048126 | import os
import click
import platform
import re
import subprocess
from typing import List
from ..utils.env_keys import REPORT_ERROR_KEY
from ..utils.http_client import LaunchableClient
from ..utils.click import emoji
from ..utils.authentication import get_org_workspace
from ..utils.java import get_java_command
from ... | null | launchable/commands/verify.py | verify.py | py | 3,744 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_numb... |
538099613 | import re
import os
from itertools import product, repeat
from subprocess import Popen, PIPE
from multiprocessing import Pool
from modules.xyz2mol import xyz2mol
__GAMESS_PATH__ = "/home/charnley/opt/gamess/github-2017-08-29/rungms"
__SKF_PATH__ = "/home/andersx/dftb/3ob-3-1"
__GAMESS_SCR_DIR__ = "/home/koerstz/scr... | null | modules/qmdftbopt.py | qmdftbopt.py | py | 4,922 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.product",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 94,
"usage_type": "name"
},
{
"api_name": "os.remove",
"l... |
618497844 | """Per-layer profilers."""
import time
from typing import List, Optional, Union
import torch
from torch import Tensor
import torch.nn as nn
from torchgpipe_balancing import utils
__all__: List[str] = []
Device = Union[torch.device, int, str]
def profile_times(module: nn.Sequential,
sample: Tens... | null | torchgpipe_balancing/profile.py | profile.py | py | 2,103 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
... |
493081528 | import pygame
from spritesheet import SpriteSheet
class Player(pygame.sprite.Sprite):
def __init__(self, image, x, y):
pygame.sprite.Sprite.__init__(self)
sheet = SpriteSheet(image)
self.imgs = sheet.load_strip((0, 0, 21, 29), 2)
self.current_img = 0
self.image = self.imgs[... | null | game/BurgerQuest/player.py | player.py | py | 1,736 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "spri... |
386639399 | # -*- coding: utf-8 -*-
import cv2
import numpy as np
import math
import sys
import requests
import pickle
import gc
from skimage.morphology import skeletonize_3d
from PIL import Image
import os
import psutil
process = psutil.Process(os.getpid())
from subprocess import Popen, PIPE
#from signal import si... | null | scripts/image_requester.py | image_requester.py | py | 6,515 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "psutil.Process",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"l... |
370980069 | #!/usr/bin/python3
"""prints all City objects from the database hbtn_0e_14_usa"""
import sys
from relationship_state import Base, State
from relationship_city import City
from sqlalchemy.orm import sessionmaker
from sqlalchemy import (create_engine)
if __name__ == "__main__":
engine = create_engine('mysql+mysqldb:... | null | 0x0F-python-object_relational_mapping/100-relationship_states_cities.py | 100-relationship_states_cities.py | py | 689 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "relationship_state.Base.metadata.create_all",
"line_number": 13,
"usage_type": "call"
},
{
... |
558148632 | import sys
from sklearn.model_selection import train_test_split
from array import array
from sklearn.linear_model import LogisticRegression
def varianc(XPs, XPs_mean):
sum = 0
for i in (XPs):
sum += ((1 / (len(XPs) - 1))) * (i - XPs_mean) ** 2
sum = sum ** (1 / 2)
return sum
def ... | null | project/project_ds962_csm45/project_ds962_csm45.py | project_ds962_csm45.py | py | 4,422 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "array.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "array.array",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "array.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "array.array",
"line_number": ... |
122206118 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | null | tests/unit/test_forms.py | test_forms.py | py | 5,208 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warehouse.forms.URIValidator",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pretend.stub",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyt... |
27867298 | import asyncio
import argparse
import logging
import uuid
from aiocache import Cache
from aiohttp import web
logging.getLogger("aiohttp.access").propagate = False
AIOCACHE_BACKENDS = {
"memory": Cache(Cache.MEMORY),
"redis": Cache(Cache.REDIS),
"memcached": Cache(Cache.MEMCACHED),
}
class CacheManage... | null | tests/performance/server.py | server.py | py | 1,408 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "aiocache.Cache",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aiocache.Cache.MEMORY",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "aiocache.... |
613834790 | import discord
import steam
import pickle
import os
import dm
from discord.ext import commands
class whois:
def __init__(self, client):
self.client = client
@commands.command(pass_context=True)
async def whois(self, ctx, *args):
if ctx.message.channel.is_private:
embed = dm.re... | null | whois.py | whois.py | py | 2,332 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dm.reply",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "discord.Embed",
"line_number... |
436909667 | import logging
extra = {'actor_name':'AGGREGATOR'}
import paho.mqtt.client as mqtt
from thespian.actors import *
from common import *
from model_utils import ModelUtils
#from model_utils_cifar10 import ModelUtils
import json
from json import JSONEncoder
import sys
import time
import numpy as np
import pickle
import z... | null | Server/aggregator.py | aggregator.py | py | 3,205 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.JSONEncoder",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "json.JSONEncoder.default",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.JSO... |
4221150 | import os
from enum import Enum
from typing import Callable, Optional
from PIL import Image
from torch.utils.data import Dataset
class ImageFolderDataset(Dataset):
"""Dataset representing a folder of images.
Args:
sorted:
sample_indices:
first_k:
filenames:
"""
def __in... | null | src/datasets/image_dataset.py | image_dataset.py | py | 4,589 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Option... |
319990945 | import logging
import subprocess
import os
from epibench.report import infer
##
# Given a plink file this function should apply
# the algorithm a return a list of the significant
# pairs.
#
# @param method_params This contains parameters for the method passed by the
# method json file, and is sup... | null | epibench/methods/method_ldcontrast.py | method_ldcontrast.py | py | 1,442 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.info",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "subprocess.call",
"line_nu... |
207321500 | import torch
from theloop import TheLoop
from dataset import GlassesDataset
from torch.nn import functional as F
from torchvision.datasets import MNIST, CIFAR10
import torchvision.models as models
import torchvision.transforms as transforms
from tqdm import tqdm, tqdm_notebook
from sklearn.metrics import accuracy_score... | null | train.py | train.py | py | 2,179 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.sigmoid",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tor... |
173197585 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xgboost as xgb
from sklearn import cross_validation
from sklearn.metrics import accuracy_score
from sklearn.model_selection import GridSearchCV, StratifiedKFold
train = pd.read_csv('input/PKS1921-293-145-train.csv')
test=pd.read_csv('input/P... | null | astrophysics_agn_xgboost-regression.py | astrophysics_agn_xgboost-regression.py | py | 969 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBRegressor",
... |
464915079 | import base64
from distutils.dir_util import copy_tree
from datetime import datetime, timezone
import math
import os
from pathlib import Path
import re
import shutil
import threading
import tkinter
from PIL.ImageTk import PhotoImage
from hurry.filesize import size
from tkinter.ttk import *
from tkinter import filedialo... | null | Downloader.py | Downloader.py | py | 16,800 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Label",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "requests.get",
"l... |
16784834 | from typing import Tuple, Iterable, Dict, Union, Sequence, cast
import warnings
import dataclasses
import numpy as np
from . import _xarray
from ._boundary_utils import shift_boundary_slice_tuple, bound_default_slice
from . import constants
from .types import NumpyModule
try:
import cupy
except ImportError:
cu... | null | fv3gfs/util/quantity.py | quantity.py | py | 20,425 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Tuple",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_numbe... |
395109788 | import json
dataset = [
{
"country":"Cyprus",
"cat_below_25_percent":0,
"cat_25_to_49_percent":0,
"cat_50_to_74_percent":2,
"cat_75_and_above_percent":0,
"sum_of_cities":2,
"percentage_cities_50_and_above_percent":100
},
{
"country":"Estonia",
"cat_below_25_percent":0,
"... | null | calculate_perc.py | calculate_perc.py | py | 9,444 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.mean",
"line_number": 300,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 301,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 302,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 3... |
561758455 | # importing the requests library
import requests
# api-endpoint
URL = "https://maps.googleapis.com/maps/api/geocode/json"
# api key
key = "gcp_api_key"
# location given here
location = "SysPlay eLearning Academy for You"
#location = "eSrijan Innovations Private Limited"
# defining a params dict for the parameter... | null | Cloud/GCP/Maps/maps.py | maps.py | py | 983 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
}
] |
108714151 | import io
import requests
import pandas as pd
class CrunchTime(object):
urls = {
'master': 'http://crunchtimebaseball.com/master.csv'
}
def get_player_map(self):
file = requests.get(self.urls['master']).content
return pd.read_csv(io.StringIO(file.decode('Windows-1252')))
| null | plyball/data/web/crunchtime/crunchtime.py | crunchtime.py | py | 311 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 13,
"usage_type": "call"
}
] |
352619413 | # Copyright (c) 2019, MD2K Center of Excellence
# - Nasir Ali <nasir.ali08@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above cop... | null | cerebralcortex/core/plotting/basic_plots.py | basic_plots.py | py | 3,425 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cufflinks.set_config_file",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "plotly.offline.init_notebook_mode",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Scatter",
"line_number": 51,
"usage_type": "call"
},
{
... |
47615510 | """
pyexcel.plugins.sources.memory_input
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Representation of input file sources
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
import pyexcel.constants as constants
from pyexcel.internal import PARSER
from . import params
from .fil... | null | pyexcel/plugins/sources/memory_input.py | memory_input.py | py | 1,467 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "file_sources.InputSource",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pyexcel.constants.SHEET",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pyexcel.constants",
"line_number": 20,
"usage_type": "name"
},
{
"api_name"... |
246937453 | # -*- coding: utf-8 -*-
"""
A module adding additional functionality to owlready2. The main additions
includes:
- Visualisation of taxonomy and ontology as graphs (using pydot).
- Generation of a controlled vocabulary from an ontology.
If desireble some of this may be moved back into owlready2.
"""
# TODO - factor... | null | EMMO_Integration/atic/emmo/ontology-rooted_relations/python/emmo/ontology.py | ontology.py | py | 33,931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"... |
304270496 | """
File to run sequential training simulation
### Example of how to run
GMPS_PATH=/home/gberseth/playground/GMPS MULTIWORLD_PATH=/home/gberseth/playground/multiworld/ python3 functional_scripts/seq_train.py
"""
import sys
import os
GMPS_PATH = os.environ['GMPS_PATH']
MULTIWORL_PATH = os.environ['MULTIWO... | null | functional_scripts/seq_train3.py | seq_train3.py | py | 6,037 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "comet_ml.Experiment",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "multiprocessing.P... |
117191435 | import json
def extract_basic(img_url, post):
img_id = img_url.split('/')
img_id = (img_id[-2]+'_'+img_id[-1][:-8]+'.jpg')
tags = " ".join(str(tag) for tag in post['tag'])
return """<?xml version="1.0" encoding="utf-8"?>
<annotation>
<folder></folder>
<filename>{}</filename>
<source>
<datab... | null | python_files/_6_json_to_xml.py | _6_json_to_xml.py | py | 6,780 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 187,
"usage_type": "call"
}
] |
501974684 | import Feature
from NLP import NLP_Tool
from Frame_net import Doc_Annotation
import Feature_Extractor
import Feature_Transformer
import numpy as np
from spacy.tokens import Doc
class WhitespaceTokenizer(object):
def __init__(self, vocab):
self.vocab = vocab
def __call__(self, text):
words = te... | null | semantic_role/Semantic_Role_Feature.py | Semantic_Role_Feature.py | py | 3,592 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "spacy.tokens.Doc",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Feature_Extractor.Feature_Extractor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Feature_Transformer.Feature_Transformer",
"line_number": 20,
"usage_type": "call"
... |
289271767 | import plotly.graph_objs as go
import plotly.offline
import numpy as np
class DPP439_eigen_values:
def __init__(self, n_traj, n_samples, tf):
self.n_traj = n_traj
self.n_samples = n_samples
self.T = tf
self.dt = tf/n_samples
self.eigen_values = np.zeros((self.n_samples, sel... | null | ornstein_ulhenbeck/old_codes/ex439_eigen_values_sym.py | ex439_eigen_values_sym.py | py | 2,647 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.unifo... |
522728750 | import time
import datetime
import requests
from operator import itemgetter
print('Give date (DD/MM/YYYY/)')
udate = raw_input()
print('Give currencies (seperated with commas)')
ucny = raw_input()
tsmp = time.mktime(datetime.datetime.strptime(udate, "%d/%m/%Y").timetuple())
lcny = [x.strip() for x in ucny.... | null | 10.py | 10.py | py | 920 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.mktime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "request... |
371778714 | import os, json
import snake
class Level:
def __init__(self, lvl_file):
self.tiles = {}
self.snakes = []
json_level = self.load_level(lvl_file)
json_tiles = json_level["tiles"]
min_x, max_x, min_y, max_y = \
float('inf'), float('-inf'), float('inf'), float('-i... | null | level.py | level.py | py | 1,900 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "snake.Snake",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_nu... |
72049423 | import sys
import numpy as np
import random
from datetime import datetime
sys.path.append("<kapacitor_library>")
sys.path.append("<implementation>")
from kapacitor.udf.agent import Agent, Handler
from kapacitor.udf import udf_pb2
import logging
import znormalization
#output the logs in kapacitor
logging.basicConfig(l... | null | Databases/influx/z-normalization/template_zscore_handler.py | template_zscore_handler.py | py | 3,091 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
91491465 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache... | null | d1_libclient_python/src/d1_client/data_package.py | data_package.py | py | 13,858 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rdflib.plugin.register",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "rdflib.plugin",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "rdflib.query",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "rdflib.pl... |
598143711 | """Initialize app."""
from flask import Flask
#from werkzeug.middleware.dispatcher import DispatcherMiddleware
#import flask
from Applications.FlaskApp.errorpages import *
"""Construct the core application."""
app = Flask(__name__,
instance_relative_config=False)
app.config.from_object('Applications.c... | null | Applications/app.py | app.py | py | 885 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Applications.FlaskApp.flask_app.main_bp",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "Applications.assets.compile_assets",
"line_number": 28,
"usage_type": "call"
}
] |
397072849 | import matplotlib.pyplot as plt
def main():
u = 13.8*2.7
x = 0
y = 1.0
xf = 1
h = 0.05
x_r, y_r = RungeKutta_method_1(u, x, y, xf, h)
# x_2 = RungeKutta_method_2(u, x, y, h)
# print(y)
# print(x_2)
# x_e, y_e = eule(u, x, y, xf, h)
# print(y)
# plt.subplot(1,2,1)
pl... | null | problem_1_cb.py | problem_1_cb.py | py | 1,281 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matpl... |
393738955 | from COVID_model_pretrained_data_augmentation import *
from sklearn.preprocessing import StandardScaler
import tqdm
import copy
import logging
import matplotlib.pyplot as plt
logging.basicConfig(level=logging.INFO)
def prepare_data (path_train):
f = open(path_train, "r")
positive_files = []
negative_files = []
#... | null | src/pretrained-model-data-augmentation/COVID.py | COVID.py | py | 6,352 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "logging.info",
"lin... |
50381 | from datetime import datetime
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class LandOwner(models.Model):
"""Represents an ownership record of a single land
Note: Use partner_id to obtain all lands per a customer
"""
_name = "land.owner"
_order = "start_date... | null | xrma_land/models/land_owner.py | land_owner.py | py | 1,719 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "odoo.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
"... |
409174932 |
"""Plot example."""
import argparse
import matplotlib.pyplot as plt
import torch
from torch import Tensor
from torchvision import transforms, datasets
from torchvision.utils import make_grid
import flowlib
def main() -> None:
"""Load pre-trained model and show reconstruction and samples."""
# Settings
... | null | examples/plot.py | plot.py | py | 2,499 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flowlib.Glow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.device",
"l... |
434835651 | """add shortlinks table
Revision ID: 5a1044a3f647
Revises: 20966e3fc6cf
Create Date: 2015-11-25 14:25:30.276703
"""
# revision identifiers, used by Alembic.
revision = '5a1044a3f647'
down_revision = '20966e3fc6cf'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():... | null | alembic/versions/5a1044a3f647_add_shortlinks_table.py | 5a1044a3f647_add_shortlinks_table.py | py | 914 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateT... |
7783636 | import simpleaudio as sa
import time
import datetime
from random import randint
import copy
from multiprocessing import Process
import sys
from midiutil import MIDIFile
KICK = sa.WaveObject.from_wave_file("808kick.wav")
BLIEP = sa.WaveObject.from_wave_file("808cow.wav")
JACKU = sa.WaveObject.from_wave_file("808clap.wa... | null | Eindopdracht_Arthur_van_Spanjen.py | Eindopdracht_Arthur_van_Spanjen.py | py | 5,542 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "simpleaudio.WaveObject.from_wave_file",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "simpleaudio.WaveObject",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "simpleaudio.WaveObject.from_wave_file",
"line_number": 11,
"usage_type"... |
90798988 | # -*- coding: utf-8 -*-
from __future__ import (
division, absolute_import, print_function, unicode_literals,
)
from builtins import * # noqa
from future.builtins.disabled import * # noqa
import os.path
from mistune import preprocessing
from zhlint.preprocessor import transform
DATA = os.path... | null | tests/test_preprocessor.py | test_preprocessor.py | py | 3,853 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
... |
89083398 | """
Collections of mixins used to login in authorize microservice
"""
import os
from unittest.mock import call
from django.db.models.expressions import F
from datetime import datetime
from rest_framework.test import APITestCase
from breathecode.tests.mixins import GenerateModelsMixin, CacheMixin, TokenMixin, GenerateQu... | null | breathecode/feedback/tests/mixins/feedback_test_case.py | feedback_test_case.py | py | 4,795 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "breathecode.tests.mixins.GenerateModelsMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "breathecode.tests.mixins.CacheMixin",
"line_number": 16,
"us... |
257587378 | import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler
from torch.optim.lr_scheduler import MultiStepLR
from torchvision.transforms import ToTensor, Normalize, Compose, ColorJitter
from apex import amp
from apex.parallel import Distr... | null | trainval_distributed.py | trainval_distributed.py | py | 11,507 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "config.Config",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.cuda.set_device",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.cud... |
158899319 | import itertools
import copy
def delete(di, key):
for k in di[key]:
for l in di[k]:
if l == key:
di[k].remove(l)
di[key] = []
def rec(dict, answ, key, list, min):
dic = dict
for i in list:
print ('i', i)
if len(dic[i]) > 0:
answ += 1 ... | null | checkio/rings.py | rings.py | py | 2,578 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.permutations",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 69,
"usage_type": "call"
}
] |
177694400 | # -*- coding: utf-8 -*-
"""
"""
import re
import logging
import time
logging.basicConfig()
class Const(object):
GAME_CONF_PREFIX = 'game'
GAME_MANAGER_CONFIG_KEY = "gamemanager"
KEY_IP = "ip"
KEY_PORT = 'port'
KEY_CONSOLE_PORT = "console_port"
CONSOLE_DEFAULT_ADD = 2
ENTITY_RE_STR = "Obje... | null | python/pymongo_sharding/Const.py | Const.py | py | 2,206 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"line_num... |
311319851 | import torch
import torch.utils.data
from tqdm import trange
from .transforms import apply_transforms
from .parser import parse_config
def train(config_file, out_file):
config = parse_config(config_file)
model, train_config, data_config = config['model'], config['training'], config['data']
model.train()
... | null | core/train.py | train.py | py | 1,078 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "parser.parse_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.utils",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tqdm... |
165153840 | import os, sys
import re
import copy
import subprocess
from logging import getLogger
from logging.config import dictConfig
from sysutils.utils.file_utils import file_exists, check_or_create_folder, list_folder, get_basename, file_rename
from sysutils.utils.dict_utils import walk_through, dict_merge, get_or_create
from ... | null | app/I18nPerformer.py | I18nPerformer.py | py | 10,699 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sysutils.utils.file_utils.check_or_create_folder",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.config.dictConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging_config.LOGGING_CONFIG",
"line_number": 18,
"usage_type... |
318805861 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import socket
class DevServiceController(object):
def __init__(self, service_desc_path):
with open(service_desc_path, 'r') as f:
self.service_conf = json.load(f)
self.connections = {}
def declare_connection(self, connection... | null | program/main_sniffer/comss/ComssServiceDevelopment/development.py | development.py | py | 1,141 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
... |
640268928 |
from .image_folder import make_dataset
import torch.utils.data as data
from PIL import Image
from torchvision import transforms
class LoadDataset(data.Dataset):
def __init__(self, opt, label_transform, img_transform, label_dir, image_dir):
self.opt = opt
self.label_transform = label_transform
... | null | datasets/other.py | other.py | py | 2,513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image... |
218615593 | import logging
import os
import unittest
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
from smac.configspace import ConfigurationSpace, pcs
from smac.utils.io.input_reader import InputReader
from smac.utils.io.output_writer import OutputWriter
__copyright__ = "Copyright 2021, AutoML.org Freiburg... | null | tests/test_utils/io/test_inputreader.py | test_inputreader.py | py | 3,161 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.... |
218349708 | import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from timeit import default_timer as timer
from robot import *
from reducedgame import *
from valueIteration import *
from humanPolicy import *
from timeout import *
"""
Script to test the time taken for each different horizon of the game.
"""
... | null | scripts/horizon_script.py | horizon_script.py | py | 2,092 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name"... |
204810840 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class Video(models.Model):
title = models.CharField(_("Title"), max_length = 50,
help_text = _("Title of video."))
date_uploaded = model... | null | core/models.py | models.py | py | 4,316 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
285504799 | import time
import requests
from bs4 import BeautifulSoup
##import re
class spider_douban():
def __init__(self):
self.href = [] # 电影链接
self.movie_name = [] # 电影名:list中英other
self.derector_act = [] # 电影导演和主演等
self.review = [] # 简评
self.comment = [] # 评分和评价数
self... | null | test/douban.py | douban.py | py | 4,468 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "time.clock",
"line_numb... |
537326946 | """This module contains an application for combining runs files"""
from XMLManifest import XMLManifest
import Combiner
#from XMLConfig import XMLConfig
import wx
import numpy as np
import os.path
class CombinerFrame(wx.Frame):
"""This window is the main interaction point for combining runs"""
def __init__(sel... | null | CombinerFrame.py | CombinerFrame.py | py | 4,174 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wx.Frame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "wx.ID_ANY",
"line_n... |
587204301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# provides functions for selecting a sample of training data
from __future__ import division
from future.utils import viewitems, viewvalues, viewkeys
import itertools
import logging
import collections
try:
from collections.abc import Mapping
except ImportError:
from ... | null | dedupe/training.py | training.py | py | 17,624 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "future.utils.viewvalues",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "co... |
473759500 | #! /usr/bin/env python3
# 5.000 NO ARGUEMENT FUNCTION
def NoArg ():
print("x doesn't matter.")
print("")
# 5.001 CMD LINE ARGUEMENT
# performed at bottom with function calls
# 5.002 RETURN VALUE FROM OTHER FUNCTION
def Len_Check(x, y):
cat = "same"
if len(x) < len(y):
return x
elif len(x) > len(y):
... | null | python_jqr/task_5.py | task_5.py | py | 906 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 40,
"usage_type": "call"
}
] |
375663351 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
width = 224
height = 224
pic_size = 224*224
mb_size = 100
Z_dim = 100
def variable_init(size):
in_dims = size[0]
w_stddev = ... | null | main_gan_cnn.py | main_gan_cnn.py | py | 9,329 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.random_normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
649525497 | """
models
"""
from django.db import models
from django.core.validators import RegexValidator
class PizzaSize(models.Model):
"""
"""
size = models.CharField(max_length=50)
class PizzaType(models.Model):
"""
"""
type = models.CharField(max_length=50)
desc = models.CharField(max_length=2... | null | core/models.py | models.py | py | 1,490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
648390186 | from flask import Flask, render_template, request, jsonify
import sqlite3
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/new-movie', methods=['POST'])
def newMovie():
connection = sqlite3.connect('database.db')
cursor = connection.cursor()
try:
... | null | server.py | server.py | py | 1,041 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
... |
156158880 | from flask import Flask, jsonify, render_template, request, redirect, json
import sqlalchemy
import psycopg2
from sqlalchemy import create_engine
import json
#from flask_sqlalchemy import SQLAlchemy
import os
#################################################
# Flask Setup
###############################################... | null | app.py | app.py | py | 5,175 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_num... |
162303112 | from typing import Optional, List
from .dpylsp import LspItem
from . import constant as ct
'''
Text Related
'''
EOL: List[str] = ['\n', '\r\n', '\r']
DocumentUri = str
class Position(LspItem):
def __init__(self, line: int, character: int, **kwargs):
self.line: int = line
self.character: int... | null | struct.py | struct.py | py | 6,496 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dpylsp.LspItem",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dpylsp.LspItem",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dpylsp.LspItem",
"line_... |
467593911 | """
Ensure that all GitHub web hooks have a secret key for verification.
"""
import logging
from github3.models import GitHubError
from modularodm import Q
import mock
from nose.tools import *
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
from framework.mongo import StoredObject
from... | null | scripts/github/update_hooks.py | update_hooks.py | py | 3,404 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.WARN",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "addons.github... |
98421922 | from setuptools import setup, find_packages
from os import path
import re
import io
import sys
VERSION = re.search(
"VERSION = '([^']+)'",
io.open(
path.join(path.dirname(__file__), 'cairocffi', '__init__.py'),
encoding='utf-8',
).read().strip()
).group(1)
LONG_DESCRIPTION = io.open(
... | null | setup.py | setup.py | py | 1,723 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.search",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"u... |
293200786 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
def cs_comp(asamp, ysamp):
# solve Ax=y for x
import cvxpy as cvx
nfull = asamp.shape[0]
myx = cvx.Variable(nfull, complex=True)
objective = cvx.Minimize(cvx.norm(myx, 1))
constraints = [myx*asamp == ysamp]
prob = cvx.Problem(object... | null | assets/codes/csense/beat_nyqsha.py | beat_nyqsha.py | py | 1,789 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cvxpy.Variable",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cvxpy.Minimize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cvxpy.norm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cvxpy.Problem",
"line_num... |
620479340 | # -*-coding:utf-8-*-
# 运行kazoo基础例子
from kazoo.client import KazooClient
from kazoo.client import KazooState
import time
def main():
zkpath = '/tmp/zookeeper'
zk=KazooClient(hosts='47.93.60.174:2181')
zk.start()
@zk.add_listener
def my_listener(state):
if state == KazooState.LOST:
... | null | bigdata/11zookeeper/kazoo-basic.py | kazoo-basic.py | py | 2,044 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "kazoo.client.KazooClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "kazoo.client.KazooState.LOST",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "kazoo.client.KazooState",
"line_number": 17,
"usage_type": "name"
},
{
... |
78878844 | from django.shortcuts import render, redirect
from .forms import Cadastro_Musica
from .models import Musica
# Create your views here.
def Cadastro(request):
data = {}
form = Cadastro_Musica(request.POST or None)
if form.is_valid():
form.save()
return redirect('Musica:listar_musica')
... | null | GCC209 - Programação WEB/REO 1/reo1/musica/views.py | views.py | py | 1,027 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.Cadastro_Musica",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
299069884 | import numpy as np
from importlib import import_module
import signal
import time
from termcolor import colored
import h5py
game = import_module("game")
ai = import_module("ai")
ann = import_module("ann")
print("Loading ANN...")
tic_ann = ann.TicNN()
tic_ann.restore("./tic.net")
print("ANN loaded!")
print()
print("... | null | train_ann.py | train_ann.py | py | 868 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "importlib.import_module",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
108928380 | from PIL import Image
import glob
new_im = Image.new('RGB', (480,480))
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for filename in glob.glob('*.png'):
im = Image.open(filename)
# We have 1600 files named e.g. img_3_f_280956978_37.png
# The letter and last number can be interpreted as coord... | null | HE17_14_Shards.py | HE17_14_Shards.py | py | 540 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.new",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,... |
161343869 | from django.utils.translation import get_language
def debug(context):
from django.conf import settings
return {
'DEBUG': settings.DEBUG,
'DONT_USE_METRICS': settings.DONT_USE_METRICS,
}
def custom_settings(context):
from custom_settings.models import Setting
settings = {
... | null | irgid/context_processors.py | context_processors.py | py | 981 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.DONT_USE_METRICS",
"line_number": 8,
"usage_type": "attribute"
... |
492951452 | import os
# windowns 中没有fork(),可以用muliprocessing模块的process
from multiprocessing import Process
# 子进程要执行的代码
def run_proc(name):
print('子进程 %s,ID是:%s' % (name, os.getpid()))
print('当前进程(父进程)的ID是:%s' % os.getpid())
p = Process(target=run_proc, args=('test',)) # 创建Process的实例,并传入子进程要执行的函数和参数
p.start() # 子进程开始
p.j... | null | three/thread/processTest.py | processTest.py | py | 996 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getpid",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_numb... |
257755627 | import re
import h5py
import json
import tarfile
import numpy as np
import keras as ks
import tensorflow as tf
from keras.datasets import mnist
from keras import backend as K
from keras.models import load_model
import mnist_model
# Set allow_growth to true to avoid memory hogging
ks.backend.tensorflow_backend.set_sess... | null | mnist_encoder.py | mnist_encoder.py | py | 2,231 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.backend.tensorflow_backend.set_session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.Session",
"line_number": 15,
"usage_type": "call"
},
{
... |
633163906 | import pandas as pd
import torch
import torch.nn.functional as F
from torchtext import data
import torch.nn as nn
import random
import torch.optim as optim
import sys
import pickle
import os
import time
import spacy
class CNN(nn.Module):
def __init__(self, vocab_size, embedding_dim, n_filters, filter_sizes, output... | null | sentimentAnalysis.py | sentimentAnalysis.py | py | 10,553 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
379150543 | ''
import sympy
from sympy import sin, cos
def solve():
x = sympy.Symbol('x', real=True, nonnegative=True)
S = sympy.trigsimp(((5 * cos(2 * x) - 2) * (10 * sin(x)) - (10 * cos(x) - 2) * (5 * sin(2 * x))) / 2)
dS = sympy.diff(S, x)
equ = sympy.solve(dS, x)
for e in equ:
print('x = {}, S = ... | null | 0527/2210104054/2_sympy.py | 2_sympy.py | py | 410 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sympy.Symbol",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sympy.trigsimp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.cos",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sympy.sin",
"line_number": 8,
... |
523472017 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
class MyNN(torch.nn.Module):
def __init__(self, nvar, nH1, nH2, nout):
super(MyNN, self).__init__()
self.fc1 = nn.Linear(nvar, nH1)
self.relu1 = nn.ReLU()
s... | null | test_01/NN.py | NN.py | py | 4,309 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_numbe... |
599138720 | import tweepy
import datetime
from config import API_KEY, API_SECRET_KEY, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
def tweet(text):
# authentification
auth = tweepy.OAuthHandler(API_KEY, API_SECRET_KEY)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
# getting tweepy api object
api = tweepy.API(... | null | functions.py | functions.py | py | 3,491 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.API_KEY",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "config.API_SECRET_KEY",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "config.... |
176609329 | import pygame
import os
from utilities import strwarptime, intro
#window init and settings
pygame.init()
window = pygame.display.set_mode((900, 600))
pygame.display.set_caption("Corfugrounds[pre-alpha]")
####################################### COLOURS #########################################################... | null | Corfugrounds/main.py | main.py | py | 1,830 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
32908147 | # !/usr/bin/env python
# -*- coding:utf-8 -*-
import grequests
import requests
from bo_lib.general import ProxyManager
from concurrent import futures
import time
import redis
import json
from gevent import monkey; monkey.patch_all()
import gevent
start=time.time()
pm = ProxyManager()
TEST=True
redis_key = 'two_xianyus... | null | baiguan1/xianyu/t7.py | t7.py | py | 3,453 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bo_lib.general.ProxyM... |
113619648 | # import asyncio
import logging
import traceback
import argparse
import subprocess
import sys
import schedule
from rpi2mqtt.config import Config
from rpi2mqtt.binary import *
from rpi2mqtt.temperature import *
from rpi2mqtt.ibeacon import Scanner
from rpi2mqtt.switch import Switch
from rpi2mqtt.thermostat import Hesti... | null | rpi2mqtt/event_loop.py | event_loop.py | py | 4,874 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rpi2mqtt.config.Config.generate_config",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "rpi2mqtt.config.Config",
"line_number": 49,
"usage_type": "name"
},
{
... |
184417984 | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/preguntas")
def question():
return render_template("pregunta.html")
@app.route("/resultado", methods=["GET","POST"])
#Function that makes the question when the url ... | null | application.py | application.py | py | 935 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.f... |
46783105 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob, os
from sklearn.preprocessing import LabelEncoder
from imutils import paths
from scipy import io
import numpy as np
import imutils
import cv2
import sys
import time
import datetime
savePath = "collected"
cam_id = 0
face_size = (47, 62)
monit... | null | Boss_Detection/collect-faces.py | collect-faces.py | py | 1,705 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"... |
211241664 | import torch
__all__ = ['device', 'RunningAverage']
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class RunningAverage:
"""Maintain a running average."""
def __init__(self):
self.avg = 0
self.sum = 0
self.cnt = 0
def reset(self):
"""Reset the run... | null | Regression/utils.py | utils.py | py | 704 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 5,
"usage_type": "attribute"
}
] |
284938252 | from collections import namedtuple
from scipy.optimize import minimize
import numpy as np
from ..chg_methods.chg_method import ChargeMethod
from ..set_of_molecules import SetOfMolecules
def local_minimization(objective_function: "function",
set_of_mols_par: SetOfMolecules,
... | null | modules/optimization_methods/local_minimization.py | local_minimization.py | py | 1,000 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "set_of_molecules.SetOfMolecules",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "chg_methods.chg_method.ChargeMethod",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
540640904 | from django.db import models
import datetime
class Report(models.Model):
Report_Date = models.DateField(default=datetime.datetime.today().strftime('%Y-%m-%d'))
definitiv = models.BooleanField()
def __str__(self):
return(str(self.Report_Date) + " id n°" + str(self.id))
@classmethod
def cre... | null | bbr/models/Report.py | Report.py | py | 950 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
328847140 | from data import DataHandler
from models import ACRegNet
import tensorflow as tf
from utils import get_random_batch, read_config_file, create_dir
def test_acregnet_model(config):
tf.reset_default_graph()
sess = tf.Session()
test_ims, _ = DataHandler.load_images(config['test_ims_file'])
print('Loading... | null | acregnet/test_acregnet.py | test_acregnet.py | py | 1,000 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.reset_default_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "data.DataHandler.load_images",
"line_number": 11,
"usage_type": "call"
},
{
"api_... |
107744859 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(0.00001, 2 * np.pi, 1000)
x = np.sin(np.sqrt(10) * t**2) / t
fig = plt.figure(2)
fig.clf()
ax = fig.add_subplot(111)
ax.plot(t, x)
ax.set_xlim(0, 6.5)
ax.set_ylim(-1.55, 1.55)
ax_chico = fig.add_axes(... | null | matplotlib_oop.py | matplotlib_oop.py | py | 393 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.