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
599223068
import pandas as pd import pymysql import sys import tushare as ts def svmPredict(oriDf): sys.path.append("C:\\Users\\xjwhh\\Anaconda3\\Lib\\site-packages") # import svm # import naive_bayes # import ensemble from sklearn import svm from sklearn import naive_bayes from sklearn import ensem...
null
src/main/java/stocking/python_Impl/MinuteData1.py
MinuteData1.py
py
7,086
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line...
449310029
from __future__ import unicode_literals, print_function, division import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F class SGNS(nn.Module): """Skip-Gram Negative Sampling architecture.""" def __init__(self, vocab_size, dim, enable_cuda=False): """Ini...
null
Lab2/SGNS/SGNS.py
SGNS.py
py
1,656
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
319124702
# -*- coding: utf-8 -*- import webapp2 import jinja2 import os import json import urllib import hashlib import time import cgi from urllib import urlopen from google.appengine.api import users from google.appengine.ext import ndb ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.pa...
null
write_review.py
write_review.py
py
6,182
python
en
code
null
code-starcoder2
66
[ { "api_name": "jinja2.Environment", "line_number": 14, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", ...
594682739
from django.contrib import admin from django.contrib.contenttypes.admin import GenericStackedInline from .models import MetaContent, URLMetaContent class MetaContentInlineAdmin(GenericStackedInline): model = MetaContent max_num = 1 fieldsets = ( ('HTML', { 'fields': ('title', 'descrip...
null
blancseo/admin.py
admin.py
py
989
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.contenttypes.admin.GenericStackedInline", "line_number": 7, "usage_type": "name" }, { "api_name": "models.MetaContent", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 22, "usage_type"...
369030054
# -*- encoding:utf-8 -*- from datetime import datetime import json import requests from django.conf import settings from rest_framework import viewsets from models import ScopeEvent from serializers import ScopeEventSerializer from tools.decorator import api_except from tools.iam_client import scopes_list, user_list f...
null
WiseEye/alert_back/summary/views.py
views.py
py
3,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "tools.record_opr_log.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 21, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 21, "usage_type": "name...
639013083
#local stuff import yahoo_api, functions import yaml with open("credentials.yml", 'r') as ymlfile: creds = yaml.load(ymlfile) key = creds['consumer_key'] secret = creds['consumer_secret'] access_token = creds['access_token'] access_token_secret = creds['access_token_secret'] session_handle = creds['session_handle...
null
yahoo_gameid.py
yahoo_gameid.py
py
615
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.load", "line_number": 7, "usage_type": "call" }, { "api_name": "yahoo_api.YahooAPI", "line_number": 14, "usage_type": "call" } ]
88675909
"""Vectorizer implementations. """ __author__ = 'Paul Landes' import logging from dataclasses import dataclass, field from typing import Set, List, Iterable, Union import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder import torch from zensols.persist import persisted from zensols.deep...
null
src/python/zensols/deeplearn/vectorize/vectorizers.py
vectorizers.py
py
5,741
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "zensols.deeplearn.vectorize.EncodableFeatureVectorizer", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 33, "usage_type": "name" }, { ...
4602335
import matplotlib.pyplot as plt import numpy as np import dplm_base # dplm_instance.set_slot([-6, 18, 0]) # moment_weight, moment_spring_list, moment_total = dplm_instance.calculate_current_moment() # lower_limit, upper_limit, step_size, total_angle_num = dplm_instance.get_allowed_angle_range().values() # 26 32 38 #1...
null
main.py
main.py
py
4,234
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 30, "usage_type": "call" }, { "api_name": "stable_baselines3.common.cmd_util.make_vec_env", "line_number": 41, "usage_type": "call" }, { "api_name": "sta...
216253288
#!/usr/bin/python # -*- coding: utf-8 -*- import networkx as nx import matplotlib.pyplot as plt # graph: set of set def draw_graph(graph): nodes = reduce(lambda x,y: x|y, graph, set()) labels = {} G = nx.Graph() # add nodes for node in nodes: labels[node] = node # add edges ...
null
display.py
display.py
py
615
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "networkx.shell_layout", "line_number": 25, "usage_type": "call" }, { "api_name": "networkx.draw_networkx_nodes", "line_number": 26, "usage_type": "call" }, { "api_name": "net...
520815597
#!/usr/bin/env python3 # vim: set fileencoding=utf-8: # Standard library import json import os # Third-party import git GIT_USER_NAME = "CC creativecommons.github.io Bot" GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org" GITHUB_USERNAME = "cc-creativecommons-github-io-bot" GITHUB_ORGANIZATION ...
null
push_data_to_ccos/push_data_via_git.py
push_data_via_git.py
py
2,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "git.Repo.clone_from", ...
632120793
import torch from torch import Tensor import torch.nn.functional as functional from typing import Union, List, Dict, Tuple, NamedTuple from termcolor import colored as clr # Project imports from .base_agent import BaseAgent Constraint = NamedTuple("Constraint", [("task_idx", int), ...
null
agents/andrei_test.py
andrei_test.py
py
4,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.NamedTuple", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Dict", "line_nu...
138882198
from __future__ import print_function from __future__ import absolute_import import copy import os import re import sys import types import importlib import pkgutil import inspect import warnings from pprint import pprint try: from fabric.api import env from fabric.tasks import WrappedCallableTask from fa...
null
burlap/__init__.py
__init__.py
py
12,850
python
en
code
null
code-starcoder2
66
[ { "api_name": "fabric.api.env._rc", "line_number": 25, "usage_type": "attribute" }, { "api_name": "fabric.api.env", "line_number": 25, "usage_type": "name" }, { "api_name": "yaml.add_representer", "line_number": 40, "usage_type": "call" }, { "api_name": "fabric.ap...
509945187
import asyncio import json import logging import shutil import time from pathlib import Path from typing import Dict, Optional import zipfile import os import aiopg import attr from aiodocker import Docker from aiodocker.containers import DockerContainer from aiodocker.exceptions import DockerContainerError, DockerErr...
null
services/sidecar/src/simcore_service_sidecar/executor.py
executor.py
py
20,275
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 34, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "name" }, { "api_name": "typing....
216851982
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.shortcuts import render from .forms import PostCityForm from .models import Municipio, Mapeamento REGIONS = { 'norte': ['AC', 'AP', 'AM', 'PA', 'RO', 'RR', 'TO'], 'nordeste': ['AL', 'BA', 'CE', 'MA', 'PB', 'PE', 'PI', 'RN', ...
null
formulario/views.py
views.py
py
2,529
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.PostCityForm", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "fo...
150321604
""" 匹配系统程序总入口。 - 离线任务,每晚定时执行 - 在线任务,为业务员提供服务。 TODO: 将 tw 和 jy 的进程合并起来 """ # pylint: disable=undefined-variable import os import shutil import time import argparse import numpy as np from utils import data_flow from utils import log from utils import radar_chart from utils import match from utils import system fro...
null
run.py
run.py
py
3,463
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 86, "usage_type": "call" }, { "api_name": "os.path", "line_number": 86, "usage_type": "attribute" }, { "api_name": "os.mkdir", "l...
553885187
import time import platform import sys from PyQt4.QtGui import * from PyQt4.QtCore import * import qrc_resources from functools import partial from serial_prompt_dialog import * from dut_details_dialog import * from dut_details_tree import * from dut_tree_widget import TreeTableWidget __version__ = "1.0.0" class Mai...
null
classes/gui/main_gui.py
main_gui.py
py
8,409
python
en
code
null
code-starcoder2
66
[ { "api_name": "dut_tree_widget.TreeTableWidget", "line_number": 23, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 37, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 219, "usage_type": "call" } ]
587647012
import sys import json def load_data(filepath): with open(filepath, 'r', encoding='utf-8') as file_descriptor: file_contents = file_descriptor.read() file_descriptor.close() return file_contents def pretty_print_json(json_contents): print(json.dumps(json.loads(json_contents), sort_keys=True,...
null
pprint_json.py
pprint_json.py
py
668
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 20,...
617778566
from matplotlib import pyplot as plt import numpy as np import h5py import os HalfLen = 5 # LSTM中输入的序列长度一半 train_path = ['Training.mat'] # train_path.append('J:/头颈血管重建VNET/CTA血管自动分割VNET/原始数据/5/分割V/DataNormalized.mat') # train_path.append('J:/头颈血管重建VNET/CTA血管自动分割VNET/原始数据/6/分割V/DataNormalized.mat') # train_path.appen...
null
examples/data_for_UNET.py
data_for_UNET.py
py
2,302
python
en
code
null
code-starcoder2
66
[ { "api_name": "h5py.File", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_n...
402613449
import sys import datetime as dt import json from hyper.data_service.common import clean_url, govc, parse_tab_list_view, print_json def get_vcenter_from_config(config_json): vcenter_url = "https://{}".format(config_json['vcenter']['host']) vcenter = HypervisorVcenter( vcenter_url, config_json[...
null
backend/hyper/data_service/hypervisor_vcenter.py
hypervisor_vcenter.py
py
13,628
python
en
code
null
code-starcoder2
66
[ { "api_name": "hyper.data_service.common.clean_url", "line_number": 20, "usage_type": "call" }, { "api_name": "hyper.data_service.common.govc", "line_number": 36, "usage_type": "call" }, { "api_name": "hyper.data_service.common.parse_tab_list_view", "line_number": 70, "us...
566067767
import numpy as np import matplotlib.pyplot as plt class Word2vec_Scratch(object): def __init__(self, word_list, proj_dim, window): self.stop = ['is', 'a', 'in', 'to', 'will', 'be', 'and', 'an', 'the', 'next', 'which', 'also', 'are'] self.word_list = [[word.lower() for word in sentenc...
null
NLP/Word2Vec/Word2Vec_From Scratch.py
Word2Vec_From Scratch.py
py
7,646
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.rand", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.exp", "line...
231908530
from math import * from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer from PhysicsTools.HeppyCore.utils.deltar import deltaR, deltaPhi from PhysicsTools.HeppyCore.framework.event import * from CMGTools.HToZZ4L.tools.DiObject import DiObject from CMGTools.HToZZ4L.tools.DiObjectPair import DiObjectPair from...
null
CMGTools/HToZZ4L/python/analyzers/FourLeptonAnalyzerBase.py
FourLeptonAnalyzerBase.py
py
10,993
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Iterable", "line_number": 31, "usage_type": "attribute" }, { "api_name": "PhysicsTools.Heppy.analyzers.core.Analyzer.Analyzer", "line_number": 44, "usage_type": "name" }, { "api_name": "ROOT.MEMCalculatorsWrapper", "line_number": 47, "usage_type...
601368558
#! /usr/bin/python # -*- coding:utf-8 -*- import os import sys import cv2 import numpy from pyExcelerator import * import xlwt import xlrd import time from xlrd import open_workbook from xlwt import easyxf def CheckIdenticalImages(img1, img2): image1=cv2.imread(img1) image2=cv2.imread(i...
null
Python/compare2image.py
compare2image.py
py
10,718
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
440892317
from __future__ import annotations from functools import cache from starlette.datastructures import FormData from typing import Any, get_type_hints, Type, TypeVar FieldType = TypeVar("FieldType", bound=type) T = TypeVar("T") class FieldCollection: @cache def __get__(self, _: None, owner: Type[Form]) -> dict...
null
wordlette/forms.py
forms.py
py
3,063
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Type", "line_number": 13, "usage_type": "name" }, { "api_name": "functools.cache", "line_n...
467904915
# -*- coding: utf-8 -*- import os from typing import List, Union def get_file_suffix(filename: str) -> Union[str, None]: """ 不支持在文件名中包含. :param filename: :return: """ file_split = filename.rsplit(".", 2) name_length = len(file_split) if name_length < 2: return elif name_le...
null
recursive_filepath.py
recursive_filepath.py
py
1,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Union", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number"...
475085946
def elbowMethod(data, kmin, kmax): """ Devuelve una grafica con la inertia por k para implementar el elbow mehtod de seleccion de k """ # Inicializamos el vector que recogerá el SSE o inertia inertias = [] ks = range(kmin, kmax) # Interamos sobre los posibles k for k in ks: ...
null
Modelling/Clustering/KMeans_helpers.py
KMeans_helpers.py
py
2,797
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.metrics.silhouette_score", "line_number": 50, "usage_type": "call" } ]
48393948
#!/usr/bin/python3 """ Fabric scrit that creates and distributes an archive you the web server using the function""" from datetime import datetime from os import path from fabric.api import local, put, run, env env.hosts = ['34.139.140.249', '100.26.46.66'] def do_pack(): """Extract the content of an archive""" ...
null
3-deploy_web_static.py
3-deploy_web_static.py
py
1,770
python
en
code
null
code-starcoder2
66
[ { "api_name": "fabric.api.env.hosts", "line_number": 8, "usage_type": "attribute" }, { "api_name": "fabric.api.env", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime...
20525807
#!/usr/bin/python2.7 # Copyright 2015 Google Inc. # # 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 ...
null
app/full_text_search.py
full_text_search.py
py
5,585
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.escape", "line_number": 37, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 38, "usage_type": "call" }, { "api_name": "re.I", "line_number": 38, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 75, "u...
11779517
import cv2 import numpy as np kamera = cv2.VideoCapture(0) while True: ret, frame = kamera.read() hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) low_blue = np.array([100, 60, 60]) high_blue = np.array([140, 255, 255]) mask = cv2.inRange(hsv, low_blue, high_blue) last_pic = cv2.bitwise_and(fra...
null
filter_operations/blurring.py
blurring.py
py
904
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "...
527948008
import numpy as np import matplotlib.pyplot as plt import moose import collections EREST_ACT = -70e-3 #: Resting membrane potential AbParams = collections.namedtuple("AbParams",[ "aRate", # 'A_A' "aB", # 'A_B' "aC", # 'A_C' "aVHalf", # 'A_D' "aVSlope", # 'A_F' "bRate", ...
null
class10.py
class10.py
py
12,940
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 91, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 103, "usage_type": "call" }, { "api_name": "...
575490170
from itertools import combinations def nonDivisibleSubset_(k, arr): nonDivisibles = [] for i in range(2, len(arr) + 1): combination = combinations(arr, i) for comb in combination: sub_combs = combinations(list(comb), 2) for sub_comb in sub_combs: sub_comb...
null
non-divisible subset.py
non-divisible subset.py
py
1,634
python
en
code
null
code-starcoder2
66
[ { "api_name": "itertools.combinations", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 8, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 21, "usage_type": "call" } ]
308362056
import pygame from pygame.draw import * pygame.init() width = 500 #Ширина граф. окна height = 300 #Высота граф. окна FPS = 30 screen = pygame.display.set_mode((width, height)) black = (0, 0, 0) white = (225, 225, 225) def draw_sky_and_ground(width, height, dot): ''' Функция рисует небо и землю на экране. ...
null
lab4/.idea/1.py
1.py
py
5,760
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.Surface...
374688067
# -*- coding: utf-8 -*- """ Created on Wed Apr 18 20:12:25 2018 @author: Malachis """ # template.py # A template for iterating through the sequence of dialogs in an flist # and accessing the data from both the log.json and label.json files # Demonstration Code dumps information about the dialog acts of both # the ...
null
spkdata.py
spkdata.py
py
3,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 44, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
602702472
# -*- coding: utf-8 -*- import yaml import jinja2 import glob import re import mistune def transpose_headlines(markdown, level): prefix = '' for i in range(level): prefix += '#' markdown = re.sub(r'^#', '#' + prefix, markdown) markdown = re.sub(r'\n#', '\n#' + prefix, markdown) return mark...
null
generate.py
generate.py
py
3,300
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "re.finditer", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 32, "usa...
477500049
#!/usr/bin/env python # -*- coding: utf-8 -*- from planeta import Planeta import numpy as np import matplotlib.pyplot as plt condicion_inicial = [10., 0., 0., 0.3] p = Planeta(condicion_inicial) n_pasos=4000 dt=0.1 X=np.zeros(n_pasos) Y=np.zeros(n_pasos) VX=np.zeros(n_pasos) VY=np.zeros(n_pasos) ET=np.zeros(n_pas...
null
solucion_usando_RK4.py
solucion_usando_RK4.py
py
986
python
en
code
null
code-starcoder2
66
[ { "api_name": "planeta.Planeta", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
108271935
from django.shortcuts import render from django.contrib.auth.models import User from .models import Category, Problem from django.utils import timezone import os, subprocess def home(request): problems = None categories = Category.get_all_objects() category_ID = request.GET.get('category') print(catego...
null
problemset/views.py
views.py
py
2,016
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Category.get_all_objects", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Category", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Problem.get_all_objects_by_categoryid", "line_number": 13, "usage_type": "call" },...
366536500
''' Example of `drop_last` using in static graph multi-cards mode ''' import paddle import paddle.static as static import numpy as np import os # We use 2 CPU cores to run inference network os.environ['CPU_NUM'] = '2' paddle.enable_static() # The data source has only 3 batches, which can not be # divided evenly to e...
null
dataloader/doc/sample3.py
sample3.py
py
1,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "paddle.enable_static", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "paddle.static.data",...
165454967
from ..auth import Auth consumers = { "pagination": False, "sorting": True, "authentication": Auth, "allowed_read_roles": ["admin","root"], # GET, OPTIONS "allowed_write_roles": ["admin","root"], # POST, PUT, DELETE "allowed_item_read_roles": ["admin","root", "consumer"], # GET, OPTIONS ...
null
domains/consumers.py
consumers.py
py
1,247
python
en
code
null
code-starcoder2
66
[ { "api_name": "auth.Auth", "line_number": 7, "usage_type": "name" } ]
443318755
import json import re with open('/Users/AUM/Desktop/MerchantInsight/MAPS_bot/MAPS_bot/facebook_api/facebook_all.json') as json_data: facebook_data = json.load(json_data) with open('/Users/AUM/Desktop/MerchantInsight/MAPS_bot/MAPS_bot/facebook_api/facebook_all_v2.json') as json_data: facebook_data_2 = json.loa...
null
MAPS_bot/MAPS_bot/facebook_api/wrap_up.py
wrap_up.py
py
8,386
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "re.search", "line_number": 203, "usage_type": "call" }, { "api_name": "re.M", "line_number": 203, "usag...
565865641
from flask import Flask app = Flask(__name__) page = ''' <!doctype html> <head> <title>Hello Flask</title> <body> <h1>Hello Flask</h1> <img src='static/flask.jpg' width="20%" height="20%"> </body> </html> ''' @app.route('/') @app.route('/get') def main(): return 'Hello World' @app.route('/index') def...
null
1-hello-world.py
1-hello-world.py
py
409
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" } ]
605983601
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20160715_1458'), ('startups', '0020_startup_company_website'), ('events', '0012_event_hosted_by_mentor'), ...
null
portal/events/migrations/0013_auto_20160802_1457.py
0013_auto_20160802_1457.py
py
1,032
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 16, "usage_type": "call" }, ...
388510568
from amplpy import AMPL import sys sys.path.append('../../utils/') from getpara import * ampl = AMPL() ampl.read('mod.mod') #ampl.readData('dat.dat') ampl.setOption('solver','cplex') # Set starting values (from heuristic) ind = ampl.getParameter('ind') ind.setValues([1]) ampl.getParameter('row1').setValues({1:1}) ...
null
test_dirs/dantzig/main.py
main.py
py
1,033
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": "amplpy.AMPL", "line_number": 8, "usage_type": "call" } ]
494786169
from django.shortcuts import render from django.http import JsonResponse, HttpResponse from django.views.decorators.csrf import csrf_exempt import importlib # name of model classes from demo/model/ AVAILABLE_MODELS = ["bart_base", "bart_base_entailment", "bart_base_vocab_constraint"] AVAILABLE_MODEL_CLASSES = [] for...
null
demo/demo/view.py
view.py
py
1,610
python
en
code
null
code-starcoder2
66
[ { "api_name": "importlib.import_module", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 29, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 45, "usage_type": "call" }, { "api_name...
433124934
import logging import os import pytest from piqe_ocp_lib.api.tasks.populate_cluster.populate_cluster import PopulateOcpCluster from piqe_ocp_lib import __loggername__ logger = logging.getLogger(__loggername__) @pytest.fixture(scope='session') def populate_ocp_cluster(ocp_smoke_args): """ A fixture that provi...
null
piqe_ocp_lib/tests/tasks/test_populate_ocp.py
test_populate_ocp.py
py
2,490
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "piqe_ocp_lib.__loggername__", "line_number": 7, "usage_type": "argument" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.en...
186237925
import requests from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response from api import Api def search(request): cep = request.matchdict['cep'] res = requests.get('https://viacep.com.br/ws/' + cep + '/json/') return Response(str(res.text)...
null
main.py
main.py
py
597
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "pyramid.response.Response", "line_number": 11, "usage_type": "call" }, { "api_name": "pyramid.config.Configurator", "line_number": 15, "usage_type": "call" }, { "api_name": "ap...
145428205
from __future__ import annotations from enum import IntEnum, auto import math import random from tkinter.filedialog import Directory from typing import List, Optional, Sequence, Tuple, Union import pygame import pygame.draw import KDS.Animator import KDS.Audio import KDS.Colors import KDS.Convert import KDS.Logging ...
null
KDS/AI.py
AI.py
py
42,526
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.mixer.init", "line_number": 23, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.key.stop_text_...
422633919
#!/usr/bin/env python # -*- coding: utf-8 -*- from lib import Utils from stk import ModelResult,ReportResult class Ranker: def run(conf): testingResults = ModelResult( conf = conf) projects = Utils.getProjects( path = "./projects") reportResults = ReportResult( conf = conf ) for testingData in test...
null
app/ranker/rank.py
rank.py
py
505
python
en
code
null
code-starcoder2
66
[ { "api_name": "stk.ModelResult", "line_number": 9, "usage_type": "call" }, { "api_name": "lib.Utils.getProjects", "line_number": 10, "usage_type": "call" }, { "api_name": "lib.Utils", "line_number": 10, "usage_type": "name" }, { "api_name": "stk.ReportResult", ...
503092688
from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score import joblib def conf_matrix_accuracy(np_matrix): ''' method: sum up the diagonal data, then divide by the sum of total output: the accuracy of the confusion matrix ''' row_n, col_n = np_matrix.shape diag_...
null
wendy_prac/test_log.py
test_log.py
py
728
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 26, "usage_type": "call" } ]
231047990
from django.shortcuts import render, redirect from django.contrib import messages from .models import Sensor, Data, TestConfig, Maturity_Data, Strength_Data from projects.models import Project from .forms import MaturityForm import plotly.graph_objs as go import plotly.offline as ply import urllib.request import js...
null
sensors/views copy 2.py
views copy 2.py
py
14,252
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Sensor.objects.get", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Sensor.objects", "line_number": 20, "usage_type": "attribute" }, { "api_name": "models.Sensor", "line_number": 20, "usage_type": "name" }, { "api_name": "dj...
551676677
#!/usr/bin/env python import math from collections import namedtuple from pprint import pprint import random from collections import Counter random.seed(98112011) def read_and_write(): # Reads the data from a text file and store it in a list 'list_of_sentences' in the form of list of lists f = open('berp-POS...
null
Assignment 2 POS Tagging/jain-payoj-assgn2.py
jain-payoj-assgn2.py
py
20,422
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 73, "usage_type": "call" }, { "api_name": "collections.Counter", ...
437268098
#!/usr/bin/env python # -*- coding: UTF-8 -*- import rospy from std_msgs.msg import String import urllib import json param_is_remote_control = '/voice/param/is_remote_control' topic_text_to_voice = '/voice/text_to_voice' topic_android_remote_control = '/voice/android_remote_control' topic_text_to_text = '/voice/text...
null
scripts/TextToText.py
TextToText.py
py
1,934
python
en
code
null
code-starcoder2
66
[ { "api_name": "rospy.init_node", "line_number": 20, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 27, "usage_type": "call" }, { "api_name": "std_msgs.msg.String", "line_number": 27, "usage_type": "argument" }, { "api_name": "rospy.Publish...
492626105
''' Author: Lucas Yudi Sugi - 9293251 Reference: http://www.computacaointeligente.com.br/algoritmos/mapas-auto-organizaveis-som/ ''' import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import RegularPolygon import matplotlib.lines as mlines class KOHONEN(): def __init__(self,data,grid,alph...
null
kohonen/kohonen.py
kohonen.py
py
4,239
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.log", "l...
495108434
from keras.models import Sequential from keras.layers.core import Flatten, Dense, Dropout from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.optimizers import Adam from keras.layers.normalization import BatchNormalization from keras.preprocessing import image from keras.utils.np_utils import ...
null
statefarm.py
statefarm.py
py
4,308
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.utils.np_utils.to_categorical", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.preprocessing.image", "line_number": 12, "usage_ty...
524737641
import random import arcade import os SPRITE_SCALING = 0.5 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 SCREEN_TITLE = "Move Sprite with Keyboard Example" MOVEMENT_SPEED = 5 COIN_COUNT = 50 class Player(arcade.Sprite): def update(self): self.center_x += self.change_x self.center_y += self.change_y ...
null
lab08-sprites/lab08-sprites.py
lab08-sprites.py
py
3,620
python
en
code
null
code-starcoder2
66
[ { "api_name": "arcade.Sprite", "line_number": 15, "usage_type": "attribute" }, { "api_name": "arcade.Window", "line_number": 32, "usage_type": "attribute" }, { "api_name": "arcade.set_background_color", "line_number": 42, "usage_type": "call" }, { "api_name": "arc...
257406274
import zmq from zmq.eventloop.zmqstream import ZMQStream from zmq.eventloop import ioloop ioloop.install() from tornado.websocket import WebSocketHandler from tornado.web import Application, RequestHandler, StaticFileHandler from tornado.ioloop import IOLoop class ZMQPair: def __init__(self,callback): sel...
null
dist/app.py
app.py
py
1,310
python
en
code
null
code-starcoder2
66
[ { "api_name": "zmq.eventloop.ioloop.install", "line_number": 4, "usage_type": "call" }, { "api_name": "zmq.eventloop.ioloop", "line_number": 4, "usage_type": "name" }, { "api_name": "zmq.Context", "line_number": 13, "usage_type": "call" }, { "api_name": "zmq.PAIR"...
248960848
from django.shortcuts import render,redirect from .models import * from .forms import TaskForm # Create your views here. def index(request): tasks=Task.objects.all() form=TaskForm() if request.method=='POST': form=TaskForm(request.POST) if form.is_valid(): form.save() re...
null
todo/views.py
views.py
py
972
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.TaskForm", "line_number": 8, "usage_type": "call" }, { "api_name": "forms.TaskForm", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcu...
583623380
#Memanggil library Flask from flask import Flask , request from flask import render_template from config import Config from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_seeder import FlaskSeeder from flask_jwt_extended import JWTManager #Inisialisasi JWT #email from flask_mail impor...
null
app/__init__.py
__init__.py
py
2,456
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 29, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 30, "usage_type": "argument" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 31, "usage_type": "call" }, { "api_name": "flask_migra...
631848273
from Catbnbs.database import owner_emile from pymongo import MongoClient import time def main(): client = MongoClient( "mongodb+srv://dominiquems:Domi-2492@cluster0.xxqtl.azure.mongodb.net/catbnb?retryWrites=true&w=majority") db = client.get_database('catbnb') indicator = True while indicator:...
null
database/main_emile.py
main_emile.py
py
921
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "Catbnbs.database.owner_emile.main_owner", "line_number": 21, "usage_type": "call" }, { "api_name": "Catbnbs.database.owner_emile", "line_number": 21, "usage_type": "name" }, ...
639247423
#!/usr/bin/python3 import asyncio from multiprocessing import Pool from licel_controller import settings, tr_commands class Controller(): def __init__(self, *args, **kwargs): self.commands_to_execute = [] def run(self): with Pool(1) as pool: try: results = pool.ma...
null
licel_controller/interface.py
interface.py
py
1,937
python
en
code
null
code-starcoder2
66
[ { "api_name": "multiprocessing.Pool", "line_number": 13, "usage_type": "call" }, { "api_name": "licel_controller.tr_commands.SELECT", "line_number": 35, "usage_type": "attribute" }, { "api_name": "licel_controller.tr_commands", "line_number": 35, "usage_type": "name" },...
462284853
# Уточнение корней уравнения методом Риддера # Задается большой интервал, проходить его с шагом h находим отрезок, # где есть корень и уточняем его заданным методом с заданной точностью, # шаг будет задаваться так, что на отрезке [Xn, Xn+1] будет только один корень, # точность полученных корней должна быть от 6 до 9 зн...
null
2 sem/lab4.py
lab4.py
py
7,559
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 163, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 165, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 165, "usage_type": "name" }, { "api_name": "matplot...
173222941
import onnxruntime as ort from utils import predict, BBox import torch device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print("Using device {}".format(device)) face_detector = ort.InferenceSession('models/version-RFB-320.onnx') face_detector_input = face_detector.get_inputs()[0].name model_path...
null
quickstart/6-bmi-onnx-pytorch/init_script.py
init_script.py
py
448
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "onnxruntime.Inferen...
279366782
from scipy.stats import rankdata from itertools import chain import scipy.sparse as sps import numpy as np import math import pandas as pd from we7dm.util import array_ops class DenseMatrixInSparseCoo(sps.coo_matrix): """ Child class of sps.coo_matrix whose data is a dense matrix whose rows and cols have sp...
null
recsys/toolbox/sparse_trix.py
sparse_trix.py
py
22,536
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.sparse.coo_matrix", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scipy.sparse", "line_number": 12, "usage_type": "name" }, { "api_name": "scipy.sparse.coo_matrix.__init__", "line_number": 23, "usage_type": "call" }, { "api_na...
249554265
# -*- coding: utf-8 -*- """ A program to read the console messages from Chrome, using the Selenium test driver. """ import argparse import collections from collections import namedtuple import json import os import re import sys import time from selenium import webdriver from selenium.webdriver.chrome.options import...
null
get_msgs.py
get_msgs.py
py
7,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.search", "line_number": 37, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 72, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 95, "usage_type": "call" }, { "api_name": "selenium.web...
209933478
# Rhino from compas_fab.robots import Configuration from compas_rhino.artists import RobotModelArtist, CapsuleArtist, SphereArtist, CylinderArtist, FrameArtist from compas.datastructures import Mesh from compas.geometry import Circle, Line from compas.geometry import Cylinder, Capsule, Sphere from compas.geometry impo...
null
lecture_03/assignment_02/asling/Assignment_02_clean_edit.py
Assignment_02_clean_edit.py
py
5,286
python
en
code
null
code-starcoder2
66
[ { "api_name": "compas.geometry.Cylinder", "line_number": 17, "usage_type": "call" }, { "api_name": "compas.geometry.Circle", "line_number": 17, "usage_type": "call" }, { "api_name": "compas.geometry.Plane", "line_number": 17, "usage_type": "call" }, { "api_name": ...
80136645
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'Eleven.views.home', name='home'), url(r'^about$', 'Eleven.views.about', name='about'), url(r'^blog/', include('b...
null
Eleven/urls.py
urls.py
py
457
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api...
636111490
import json import time v = {} v['referenceWidth'] = 8 v['outputDim'] = 1170 v['circleMinDist'] = 15 v['circleEdgeStrength'] = 224 v['circleCircularity'] = 18 v['circleMinRadius'] = 5 v['circleMaxRadius'] = 30 v['radius'] = 18 v['radiusOfTheUniverse'] = 30.3 v['markerThreshold'] = 45 v['sampleP...
null
tracker/dict_generator.py
dict_generator.py
py
805
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 40, "usage_type": "call" } ]
34098763
import pandas as pd import logging import argparse import os from keras.callbacks import LearningRateScheduler, ModelCheckpoint from keras.optimizers import SGD, Adam from keras.utils import np_utils from sys import path path.insert(0, os.path.join('/home/giancarlo/Documents/HeadPose-test/', 'FSA-Net', 'demo')) from FS...
null
code/test-FSA-Net(FSA_code).py
test-FSA-Net(FSA_code).py
py
3,293
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, ...
315773115
import numpy as np import os import cv2 import pandas as pd def main(): """ Applies Hough-transform for circles to all images and saves: - Images highlighting hits - Images trying to highlight false positives - csv-files with coordinates of all hits - csv-file summarizing the total amount ...
null
hough_circle.py
hough_circle.py
py
2,802
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 24, ...
32497873
import numpy as np import csv import matplotlib.pyplot as plt def getCoopOverTFromFiles(game, nb_states): """ Read series of files to get the cooperation ratio in the right files depending on the game and the number of internal states considered :param game: dilemma considered :param nb_states: num...
null
StateAnalytical/plotCoopForT.py
plotCoopForT.py
py
2,312
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 47, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
508733264
# Create your views here. from django.http import HttpResponse , HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from ....
null
blog/views.py
views.py
py
3,291
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Post.published_objects.all", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Post.published_objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 18, "usage_type": "name" }, { "...
213447956
import requests import urllib.parse as parse import json import os headers={ "X-Naver-Client-Id" : "20zXc9hd72PdUrs4rInK", "X-Naver-Client-Secret" : "6EujMSZenc" } url = "https://openapi.naver.com/v1/search/image" params = { "query" : "테슬라", "display" : 100, "start" : 1 } res = requests.get(url,...
null
study/login/naver_image_search.py
naver_image_search.py
py
665
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 27, "usage_type": "call" }, { "api_name": "urllib.parse", "lin...
40679023
from synthesizer.inference import Synthesizer from encoder import inference as encoder from vocoder import inference as vocoder from pathlib import Path import numpy as np import librosa import argparse import torch import os import subprocess if __name__ == '__main__': ## Info & args parser = argparse.Argume...
null
run.py
run.py
py
3,708
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "...
602572871
from metadata import * import argparse import pickle import time from threading import Thread, current_thread import os, os.path from joblib import Parallel, delayed from mind_model import * import pandas as pd from itertools import product import os.path as op from mind_model import * import random from utils import *...
null
src/mind_search_per5frame.py
mind_search_per5frame.py
py
10,699
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 42...
87854975
# -*- coding: utf-8 -*- import json import logging import traceback from odoo.exceptions import ValidationError from odoo import fields, models, api from odoo.addons.web_approval.controllers.main import Approval _logger = logging.getLogger(__name__) class ApprovalWizard(models.TransientModel): _name = 'approval...
null
my_addons/web_approval/wizard/approval_wizard.py
approval_wizard.py
py
16,719
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "odoo.models.TransientModel", "line_number": 13, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 13, "usage_type": "name" }, { "api_name": "odoo.fi...
622835443
"""Split TZA to multiple files """ import os import fiona def main(): base_path = os.path.join( os.path.dirname(__file__), '..', '..', '..', 'data', 'Infrastructure' ) tza_path = os.path.join( base_path, 'Roads', 'osm_mainroads', 'TZA.shp' ) with fiona.open(tza_path...
null
scripts/1_preprocess/network/split_tza_osm.py
split_tza_osm.py
py
999
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8...
320957344
import csv import math import random import sys import numpy as np import pandas as pd from numpy.linalg import inv #from PIL import Image # Variable setting import keras from keras.models import * from keras.utils import np_utils from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormaliz...
null
hw3/Confusion_matrix_drawing model.py
Confusion_matrix_drawing model.py
py
4,542
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.load", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 52, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_n...
184000106
""" The serial module provides classes for turning log data into datapoints. """ from dataclasses import asdict from config import NEVER from wrangling.domain import * class DictionaryViewWithEncapsulation: """ Subclasses inherit a to_dict() method which does not serialize private or protected methods. ...
null
wrangling/Datapoint.py
Datapoint.py
py
13,204
python
en
code
null
code-starcoder2
66
[ { "api_name": "dataclasses.asdict", "line_number": 19, "usage_type": "call" }, { "api_name": "config.NEVER", "line_number": 26, "usage_type": "name" }, { "api_name": "config.NEVER", "line_number": 74, "usage_type": "name" }, { "api_name": "config.NEVER", "line...
574944928
# -*- coding: UTF-8 -*- __author__ = 'quentingerome' from flask import request from . import route from ..models import Program @route('/program', methods=['GET']) def get_program(): return Program.query.default() @route('/program', methods=['PUT']) def put_program(): periods = request.json.get('periods')...
null
backend/thermostat/api/program.py
program.py
py
608
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Program.query.default", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Program.query", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Program", "line_number": 12, "usage_type": "name" }, { "api_name": ...
311168017
import requests from html.parser import HTMLParser import PIL as pil import PIL.Image as Image from config import * import sys import time import os _SAVE_PATH = os.path.join(os.getenv('HOME'), 'Images') class CostcoParser(HTMLParser): def __init__(self): super().__init__() self.found = False ...
null
CostcoOld/scrapeimg.py
scrapeimg.py
py
2,487
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "html.parser.HTMLParser", "lin...
643613517
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import datetime import time __dir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.append(__dir__) sys.path.append(os.path.abspath(os.path.join(__dir__, '..', '..', '..'))) sys.path...
null
tools/slim/prune.py
prune.py
py
11,918
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path.append", "line...
147077712
import tensorflow as tf from tensorflow.keras import models, layers import json import numpy as np import os import pyaudio from speechpy.feature import mfcc from datetime import datetime import wave import random NWW_PATH = "C:\\Users\\cej17\\Documents\\Coding_Projects\\rand\\Not Wake Word\\" JSON_PATH = "C:\\User...
null
Model/Wake Word/model_final_script.py
model_final_script.py
py
8,714
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyaudio.paInt16", "line_number": 32, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 45, "usage_type": "call" }, { "api_name": "tensorflow.keras.models", "line_number": 45, "usage_type": "name" }, { "a...
86899458
import json import os import tensorflow as tf # 获取训练与测试数据 (images_train, labels_train), (images_test, labels_test) = tf.keras.datasets.mnist.load_data() images_train, images_test = images_train / 255.0, images_test / 255.0 def build_and_compile_cnn_model(): model = tf.keras.Sequential([ tf.keras.layers....
null
l09_distribution/distribution_worker2_mnist.py
distribution_worker2_mnist.py
py
1,164
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras.datasets.mnist.load_data", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 12, "usage_type": "call" }, ...
324686562
from rest_framework import serializers from rest_framework_jwt.settings import api_settings from exam import models from rest_framework.exceptions import AuthenticationFailed from django.core.cache import cache from django.conf import settings from project_api.libs.alipay import alipay, gateway from uuid import ...
null
study_docker_compose/project_api/project_api/utils/exam/ExamSerializer.py
ExamSerializer.py
py
8,643
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 12, "usage_type": "name" }, { "api_name": "exam.models.Task", "line_number": 14, "usage_type": "attribute...
290542004
import json import requests ticker_url = "https://api.coinmarketcap.com/v2/ticker/?structure=array" limit = 100 start = 1 sort = 'id' convert = "USD" choice = input("Do you want to enter any custom parameters? (y/n): ") if choice == 'y': limit = input('What is the custom limit?: ') start = input('What is th...
null
Coinmaker/cointicker_1.py
cointicker_1.py
py
675
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" } ]
430358135
from django import forms from .models import MappedField class MapFieldsForm(forms.Form): def __init__(self, program, all_fields, missing_fields, *args, **kwargs): super(MapFieldsForm, self).__init__(*args, **kwargs) choices = [('', '(leave it blank)')] choices.extend(zip(all_fields, all...
null
field_mapper/forms.py
forms.py
py
907
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.Form", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 14, "usage_type": "call" }, { "api_name": "django.for...
505430091
# Copyright 2014 MongoDB, Inc. # # 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, so...
null
giza/giza/content/toc.py
toc.py
py
10,678
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "rstcloth.table.TableData", "line_number": 48, "usage_type": "call" }, { "api_name": "rstcloth.rstcloth.RstCloth", "line_number": 52, "usage_type": "call" }, { "api_name": ...
576213400
# -*- coding: utf-8 -*- """ AAA """ import logging from datetime import datetime from pyramid.view import view_config from arttest.logic.calendars import CalendarService from arttest.logic.returnhelper import response LOG = logging.getLogger(__name__) class CalendarMy(object): """docstring for CalendarMy""" d...
null
arttest/views/calendarmy.py
calendarmy.py
py
2,695
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "arttest.logic.calendars.CalendarService", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "ap...
536544944
from contextlib import contextmanager import logging.config import numpy as np import torch import torch.distributed as dist def barrier(): """ Works as a temporary distributed barrier, currently pytorch doesn't implement barrier for NCCL backend. Calls all_reduce on dummy tensor and synchronizes wit...
null
PyTorch/Translation/GNMT/seq2seq/utils.py
utils.py
py
4,049
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.distributed.is_initialized", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.distributed", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.distributed.all_reduce", "line_number": 16, "usage_type": "call" }, { ...
86562577
import httplib2 from oauth2client.client import OAuth2WebServerFlow from oauth2client.file import Storage from oauth2client import tools from googleapiclient.discovery import build class ServiceProvider: def __init__(self, client_id, client_secret): self.scope = 'https://www.googleapis.com/auth/drive' ...
null
integration/gdrive/serviceProvider.py
serviceProvider.py
py
890
python
en
code
null
code-starcoder2
66
[ { "api_name": "oauth2client.client.OAuth2WebServerFlow", "line_number": 15, "usage_type": "call" }, { "api_name": "oauth2client.file.Storage", "line_number": 17, "usage_type": "call" }, { "api_name": "oauth2client.tools.run_flow", "line_number": 20, "usage_type": "call" ...
362353578
import aiohttp import asyncio import uvicorn from fastai import * from fastai.vision import * from io import BytesIO from starlette.applications import Starlette from starlette.middleware.cors import CORSMiddleware from starlette.responses import HTMLResponse, JSONResponse, FileResponse, StreamingResponse from starlett...
null
app/server.py
server.py
py
16,265
python
en
code
null
code-starcoder2
66
[ { "api_name": "starlette.applications.Starlette", "line_number": 20, "usage_type": "call" }, { "api_name": "starlette.middleware.cors.CORSMiddleware", "line_number": 21, "usage_type": "argument" }, { "api_name": "starlette.staticfiles.StaticFiles", "line_number": 22, "usa...
200513097
import numpy as np import cv2 import time cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0.25) cap.set(cv2.CAP_PROP_EXPOSURE, 0.01) # Define the codec and create VideoWriter object fourcc = cv2.VideoWriter_fourcc(*'XVID') output_file = './' + str(time.time()).split('.')[0] + '.avi' print(output_file) ...
null
vision/record_footage.py
record_footage.py
py
762
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_AUTO_EXPOSURE", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_EXPOSURE", "line_number": 7, "usage_type": "attribute" }, { "api_name...
173538944
import numpy as np import pandas as pd import matplotlib.pyplot as plt df_train['SalePrice'].describe() sns.distplot(df_train['SalePrice']) var = 'GrLivArea' data = pd.concat([df_train['SalePrice'], df_train[var]], axis=1) data.plot.scatter(x=var, y='SalePrice', ylim=(0,800000), s=32); var = 'TotalBsmtSF' data = pd...
null
Data_exploration.py
Data_exploration.py
py
1,059
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.concat", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots",...
564982396
from test.base import TestCase, main import click from click.testing import CliRunner from ocrd.decorators import ocrd_cli_options from ocrd.logging import setOverrideLogLevel, initLogging @click.command() @ocrd_cli_options def cli(*args, **kwargs): # pylint: disable=unused-argument pass class TestCli(TestCase): ...
null
test/test_cli.py
test_cli.py
py
1,235
python
en
code
null
code-starcoder2
66
[ { "api_name": "click.command", "line_number": 7, "usage_type": "call" }, { "api_name": "ocrd.decorators.ocrd_cli_options", "line_number": 8, "usage_type": "name" }, { "api_name": "test.base.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "ocrd....
338848580
from ai_safety_gridworlds.environments.shared import safety_game from collections import defaultdict import experiments.environment_helper as environment_helper import numpy as np class ModelFreeAUPAgent: name = "Model-free AUP" pen_epsilon, AUP_epsilon = .2, .9 # chance of choosing greedy action in training...
null
agents/model_free_aup.py
model_free_aup.py
py
5,954
python
en
code
null
code-starcoder2
66
[ { "api_name": "experiments.environment_helper.derive_possible_rewards", "line_number": 35, "usage_type": "call" }, { "api_name": "experiments.environment_helper", "line_number": 35, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 37, "usage...
422986818
import re from nltk.corpus import stopwords from nltk.util import ngrams import os.path # Begins the two main objectives of this program def word_processing(tokens, arxiv_name, i, n): if (len(tokens) != 0): path = '/home/gdbartlettclab/cxg078/Documents/corpora_build/results/node%s/%s/'%(n, arxiv_name) ...
null
python_scripts/parse_scripts/original_tex_word_processing.py
original_tex_word_processing.py
py
3,898
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 20, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 20, "usage_type": "name" }, { "api_name": "re.search", "line_number": 30, "usage_type": "call" }, { "api_name": "re.I", ...
297366079
import sys import os import re from datetime import datetime, timedelta from pytz import timezone # This is so that below import works. Sets the pwd to home directory sys.path.append(os.path.realpath(".")) import fawkes.utils.utils as utils import fawkes.constants.constants as constants url_regex = re.compile(const...
null
fawkes/review/review.py
review.py
py
5,415
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
2309177
""" Collection of functions to apply consistent options on CSV reads """ import glob import os import re from pyspark.sql.functions import col, lit from pyspark.sql.types import StringType from .misc import compare_schema_to_header, import_pyspark_json from .fs import local_format_mount_path, dbutils_format_mount_pat...
null
databricks_util/csv_read.py
csv_read.py
py
6,309
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.utcnow", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "name" }, { "api_name": "pyspark.sql.types.StringType", "line_number": 43, "usage_type": "call" }, { "api_name"...
188711623
import os, sys import csv import agate import agatesql seperator = '\n' + '========================================' + '\n' yes = set(['yes','ye','y','']) no = set(['no','n']) openfile = 'customerOrderHistory.csv' customerFile = 'customers_real.csv' orderHistoryFile = 'orderHistory_real.csv' # column headers ship...
null
customerOrderHistory.py
customerOrderHistory.py
py
2,886
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.exit", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 60, "usa...
207586718
import os from pathlib import Path from dvc.command.common.base import CmdBase from dvc.logger import Logger from dvc.config import Config from dvc.exceptions import DvcException from dvc.path.data_item import DataItem class InitError(DvcException): def __init__(self, msg): DvcException.__init__(self, 'I...
null
dvc/command/init.py
init.py
py
3,151
python
en
code
null
code-starcoder2
66
[ { "api_name": "dvc.exceptions.DvcException", "line_number": 11, "usage_type": "name" }, { "api_name": "dvc.exceptions.DvcException.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "dvc.exceptions.DvcException", "line_number": 13, "usage_type": "name" ...
399588454
# # ⚠ Warning # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA...
null
mango/oracles/serum/serum.py
serum.py
py
4,506
python
en
code
null
code-starcoder2
66
[ { "api_name": "oracle.Oracle", "line_number": 45, "usage_type": "name" }, { "api_name": "spotmarket.SpotMarket", "line_number": 46, "usage_type": "name" }, { "api_name": "spotmarket.SpotMarket", "line_number": 49, "usage_type": "name" }, { "api_name": "oracle.Orac...
112707470
#sparkcontext is fundamemtal starting point to create RDDs. #SparkConf needed to configure and create Sparkcontext object. from pyspark import SparkConf, SparkContext import collections #We set the master to local system and good practice to give a name to the job, to lookup on Spark Web UI conf = SparkConf().se...
null
Spark RDD/ratings-counter.py
ratings-counter.py
py
1,287
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyspark.SparkConf", "line_number": 7, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 25, "usage_type": "call" } ]