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
586994983
import re import json import tweepy import datetime import time # Reading secure info from secret_file access_keys = None with open('access_keys.json') as json_data: access_keys = json.load(json_data) # Authentication using access tokens authentication = tweepy.OAuthHandler(access_keys["consumer_key"], access_key...
null
Spanish/spanish_tweet_retriever.py
spanish_tweet_retriever.py
py
6,878
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 16, "usage_type": "call" }, { "api_name": "re.compile", "line_numbe...
118768664
import glob import os import random import nltk.data import nltk.tokenize import utils import csv import xml.etree.ElementTree import re data_paths = {'lambada': '/home/u148187/datasets/LAMBADA', 'personabank': '/home/u148187/datasets/personaBank-v1/original', 'rocstories': '/home/u148187/datasets/R...
null
extract_dialogues.py
extract_dialogues.py
py
21,786
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.choice", "line_number": 56, "usage_type": "call" }, { "api_name": "re.finditer", "line_number": 81, "usage_type": "call" }, { "api_name": "re.finditer", "line_number": 124, "usage_type": "call" }, { "api_name": "re.search", "line_number":...
578441661
# encoding = utf-8 from locust import HttpLocust, TaskSet, task import urllib3 class LeadsCloud(TaskSet): urllib3.disable_warnings() @task def open_leads_cloud(self): header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/53...
null
LeadsCloud/Leadscloud.py
Leadscloud.py
py
1,066
python
en
code
null
code-starcoder2
66
[ { "api_name": "locust.TaskSet", "line_number": 6, "usage_type": "name" }, { "api_name": "urllib3.disable_warnings", "line_number": 8, "usage_type": "call" }, { "api_name": "locust.task", "line_number": 9, "usage_type": "name" }, { "api_name": "locust.task", "l...
436468827
from spb.defaults import cfg from spb.backends.base_backend import Plot from spb.utils import get_seeds_points import plotly.graph_objects as go from plotly.figure_factory import create_quiver, create_streamline from mergedeep import merge import itertools import matplotlib.cm as cm from spb.backends.utils import conve...
null
spb/backends/plotly.py
plotly.py
py
37,550
python
en
code
null
code-starcoder2
66
[ { "api_name": "spb.backends.base_backend.Plot", "line_number": 21, "usage_type": "name" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 234, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 234, "usage_type": "name" }, { ...
83336273
import numpy as np from imbDRL.data import load_csv from imbDRL.metrics import classification_metrics from sklearn.dummy import DummyClassifier _, _, X_test, y_test = load_csv("./data/aki0.csv", "./data/aki1.csv", "aki", ["hadm_id"], normalization=True) def uniform_baseline(X, y): uniform_clf = DummyClassifier(s...
null
experiments/aki/baselines.py
baselines.py
py
1,082
python
en
code
null
code-starcoder2
66
[ { "api_name": "imbDRL.data.load_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.dummy.DummyClassifier", "line_number": 10, "usage_type": "call" }, { "api_name": "imbDRL.metrics.classification_metrics", "line_number": 13, "usage_type": "call" }, ...
356748106
import asyncio import time import uuid import elasticsearch import pytest from docker import from_env as docker_from_env from aioelasticsearch import Elasticsearch @pytest.fixture def loop(request): asyncio.set_event_loop(None) loop = asyncio.new_event_loop() loop.set_debug(True) yield loop ...
null
tests/conftest.py
conftest.py
py
4,427
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.set_event_loop", "line_number": 14, "usage_type": "call" }, { "api_name": "asyncio.new_event_loop", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "attribute" }, { "api_name": "uui...
90232098
# Time:2020-02-29 8:16 # Author:TSL # driver.tap(x,y) # 使用场景:当某个元素定位不到 # 解决方法:模拟坐标点击 # 优点:可以暂时解决问题 # 缺点:不能适用不同分辨率的屏幕 #导包 import time from appium import webdriver #准备自动化配置信息 desired_caps={ #移动设备平台 'platformName':'Android', #平台OS版本号 'plathformVersion':'8', #设备的名称--值可以随便写 'deviceName':'test01...
null
app/day3/3坐标操作.py
3坐标操作.py
py
1,395
python
en
code
null
code-starcoder2
66
[ { "api_name": "appium.webdriver.Remote", "line_number": 38, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 38, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 42, "usage_type": "call" }, { "api_name": "time.sleep", ...
174515944
import coinmarketcap import pandas as pd from datetime import datetime __version__ = '0.1' __author__ = 'Anthony Palermo' def coin_data(coin_name=None): market_info = coinmarketcap.Market() if coin_name: ticker = market_info.ticker(coin_name) coin_df = pd.DataFrame(ticker) else: ...
null
deprecated/coin.py
coin.py
py
671
python
en
code
null
code-starcoder2
66
[ { "api_name": "coinmarketcap.Market", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datet...
208366416
"""My_Task URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cla...
null
urls.py
urls.py
py
1,712
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name": "...
320457113
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE import operator import numpy import numba from .._numba import util class ContentType(numba.types.Type): @property def shortname(self): return self.name[:self.name.index("Type")] @numba.typing.templates.infer_g...
null
awkward1/_numba/content.py
content.py
py
6,249
python
en
code
null
code-starcoder2
66
[ { "api_name": "numba.types", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numba.typing", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numba.typing.templates.signature", "line_number": 21, "usage_type": "call" }, { "api_name": "n...
216990656
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('account', '0022_auto_20150624_1236'), ] operations = [ migrations.AlterField( mode...
null
account/migrations/0023_auto_20160427_1046.py
0023_auto_20160427_1046.py
py
765
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 15, "usage_type": "call" }, {...
106820262
import sys from functools import reduce from itertools import groupby def get_sum_of_digits(number): """Calculates sum of digits in a given number""" return sum(map(int, str(number))) def get_num_of_lucky_tickets(num): """Get the number of 'lucky' tickets with MapReduce flavor. Get the count of 2N ...
null
iteration_and_recursion/lucky_tickets/lucky_tickets.py
lucky_tickets.py
py
1,450
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.reduce", "line_number": 40, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 41, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 49, "usage_type": "attribute" }, { "api_name": "sys.argv", "line...
71506731
import os import uuid from enum import IntEnum from django.db import models from deepdiff import DeepDiff from django.conf import settings from django.contrib.postgres.fields import JSONField, ArrayField from django.template.defaultfilters import slugify from django.contrib.auth.models import User from django.contrib.p...
null
file_system/models.py
models.py
py
18,131
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.IntEnum", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 20, "usage_type": "name" }, { "api_name": "django.db.m...
516184069
import torch from torch import nn import torch.nn.functional as F import numpy as np import argparse from SubLayers import MultiHeadAttention, PositionwiseFeedForward from SubLayers import MultiHeadAttentionMemory parser = argparse.ArgumentParser() parser.add_argument('-epoch', type=int, default=10) parser.add_argu...
null
transformer/unit_test.py
unit_test.py
py
3,399
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 30, "usage_type": "call" }, { "api_name": "SubLayers.MultiHeadAttentionMemory", "line_number": 33, "usage_type": "call" }, { "api_name"...
312059684
#!/home/ml/anaconda3/bin/python3 import sys import signal import os import subprocess import cv2 def extractFrames(filename,pathIn, pathOut): cap = cv2.VideoCapture(pathIn) count = 0 while (cap.isOpened()): # Capture frame-by-frame ret, frame = cap.read() if ret == True: ...
null
extract_frame.py
extract_frame.py
py
670
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
390322308
from hdfs3 import HDFileSystem, lib from hdfs3.core import conf_to_dict from hdfs3.compatibility import FileNotFoundError, PermissionError import pytest import ctypes import os import tempfile @pytest.yield_fixture def hdfs(): hdfs = HDFileSystem(host='localhost', port=8020) if hdfs.exists('/tmp/test'): ...
null
hdfs3/tests/test_hdfs3.py
test_hdfs3.py
py
7,615
python
en
code
null
code-starcoder2
66
[ { "api_name": "hdfs3.HDFileSystem", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.yield_fixture", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pickle.loads", "line_number": 63, "usage_type": "call" }, { "api_name": "pickle.dumps...
140694828
import os import sys from unittest import TestCase from faker import Faker import pandas as pd import numpy as np PROJECT_PATH = os.path.abspath( os.path.join(os.path.dirname(__file__), '../../../') ) if PROJECT_PATH not in sys.path: sys.path.append(PROJECT_PATH) from server.data_processors import TeamDataSt...
null
server/tests/unit/data_processors/test_team_data_stacker.py
test_team_data_stacker.py
py
2,441
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9...
449779681
try: import fortnitepy, fortnitepy.errors, BenBotAsync, asyncio import aiohttp import getpass import time as delay import datetime import json import logging import sys from colorama import init init(autoreset=True) from colorama import Fore, Back, Style except ModuleNotFound...
null
fortnite.py
fortnite.py
py
17,128
python
en
code
null
code-starcoder2
66
[ { "api_name": "colorama.init", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.ge...
480706101
from sklearn.svm import SVC from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap def plot_decision_regions(X, y, classifier, te...
null
Chapter3-使用scikit-learn巡覽機系學習分類器/linearSVM.py
linearSVM.py
py
2,298
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.colors.ListedColormap", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.ar...
574385557
""" Copyright (c) 2019 10x Genomics, Inc. All rights reserved. Produces a websummary output as a single html page with embedded plots. """ from __future__ import division import matplotlib matplotlib.use("Agg") matplotlib.rcParams['figure.figsize'] = (9.0, 6.0) matplotlib.rcParams.update({'font.size': 12}) matplotl...
null
mro/atac/stages/validate/create_validation_plots/__init__.py
__init__.py
py
9,063
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams.update", "line_number": 13, "usage_type": "call" }, { "api_name": "ma...
648546029
import os import tensorflow as tf from matplotlib import pyplot as plt from PIL import Image import tensorflow as tf import tensorflow.contrib.slim as slim slim.learning.train slim.separable_conv2d import numpy as np PATH_TO_TEST_IMAGES_DIR = 'D:\Images' TEST_IMAGE_PATHS = [os.path.join(PATH_TO_TEST_IMAGES_DIR, 'image{...
null
Demo/test1.py
test1.py
py
2,776
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.contrib.slim.learning", "line_number": 7, "usage_type": "attribute" }, { "api_name": "tensorflow.contrib.slim", "line_number": 7, "usage_type": "name" }, { "api_name": "tensorflow.contrib.slim.separable_conv2d", "line_number": 8, "usage_type": "a...
233201135
import argparse import logging import os import random import numpy as np import torch import torch.backends.cudnn as cudnn from torch.nn import CrossEntropyLoss from torch import optim from nnunet.TransUNet.utils import DiceLoss from nnunet.TransUNet.vit_seg_modeling import VisionTransformer as ViT_seg from nnunet.Tr...
null
nnunet/nn-TransUNet/train.py
train.py
py
7,667
python
en
code
null
code-starcoder2
66
[ { "api_name": "nnunet.TransUNet.vit_seg_modeling.CONFIGS", "line_number": 25, "usage_type": "name" }, { "api_name": "nnunet.TransUNet.vit_seg_modeling.VisionTransformer", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 29, "usage_type...
345536121
import datetime import os import json from tv_project.settings import BASE_DIR import datetime path = os.path.join(BASE_DIR, 'show_app/manage_db/json_files_update/') def _get_db_data() -> dict: from show_app.models import Show return {str(i['id_tvmaze']): i['updated'] for i in Show.objects.all()...
null
show_app/manage_db/get_updated.py
get_updated.py
py
1,649
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "tv_project.settings.BASE_DIR", "line_number": 8, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "show_app.mode...
254417093
""" Script plots polar cap heights in all model simulations Notes ----- Author : Zachary Labe Date : 23 February 2020 """ ### Import modules import datetime import numpy as np import matplotlib.pyplot as plt import cmocean import calc_Utilities as UT import scipy.stats as sts import read_CTLNQ as CONT import...
null
Scripts/plot_Monthly_ZCAP.py
plot_Monthly_ZCAP.py
py
13,652
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "attribute" }, { "api_name": "read_ExpMonthly.readExperi", "line_number": 56, "usage_type": "call" }, { "api_name"...
300743502
""" .. module: s3.models :platform: Unix :copyright: (c) 2017 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. author:: Mike Grima <mgrima@netflix.com> """ from marshmallow import Schema, fields from marshmallow.fields import Field from datetime import datetime from ...
null
s3-report/s3/models.py
models.py
py
1,781
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.date...
115715957
# _*_ coding:utf-8 _*_ # 文件作者: ZHMing123 # 开发时间:2020/5/11 19:50 # 文件名称:multiproccessing_test.py # 开发工具:PyCharm import os import time from concurrent.futures import ProcessPoolExecutor import multiprocessing # ProcessPoolExecutor是对multiproccessing的封装 # 多进程编程 def get_html(seconds): time.sleep(seconds) print("s...
null
chapter11/multiproccessing_test.py
multiproccessing_test.py
py
3,078
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 20, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "multiprocessing.Po...
20013063
from django.shortcuts import get_object_or_404, render from django.http import Http404 from django.http import HttpResponse from django.http import JsonResponse from django.core.mail import send_mail from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from django.template.loader impor...
null
registration/views.py
views.py
py
13,335
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.CourseEvent.objects.order_by", "line_number": 32, "usage_type": "call" }, { "api_name": "models.CourseEvent.objects", "line_number": 32, "usage_type": "attribute" }, { "api_name": "models.CourseEvent", "line_number": 32, "usage_type": "name" }, {...
639844107
# -*- coding: utf-8 -*- # @Time : 2019/3/26 14:38 # @Author : Edrain import random import datetime from util.use_json import UseJson from util.addr import addr class CommonTool: def is_contain(self, str_one, str_two): """判断一个字符串是否在另一个字符串中。str_one:查找的字符串,str_two:被查找的字符串""" return str_two == st...
null
interface-demo02/util/common_tool.py
common_tool.py
py
4,219
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 27, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 28, "usage_type": "call" }, { "api_name": "random.randint", "li...
615030552
# -*- coding: utf-8 -*- """ Created on Tue Feb 2 16:20:56 2016 File Name: Description: This program retrieves the NIH data for NIHM institute. Inputs: Last Name, First Name Output: Data available for the given name. Author: Subhash C Thakur """ import requests import lxml.ht...
null
Python/getnihdata.py
getnihdata.py
py
949
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 26, "usage_type": "call" }, { "api_name": "lxml.html.document_fromstring", "line_number": 29, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 29, "usage_type": "name" } ]
99664258
import time import zmq import sys import os import sched sys.path.append(os.getcwd()) if not __package__: path = os.path.join(os.path.dirname(__file__), os.pardir) sys.path.insert(0, path) from threading import Thread from Common.tinyrpc.transports.zmq import ZmqServerTransport from Common.publisher import Z...
null
Prm.app/Contents/MacOS/prmtester/AynsLock/LockServer.py
LockServer.py
py
3,799
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
158696969
"""Class holding survey properties.""" import math import numpy as np import os import pandas as pd from scipy.special import j1 import frbpoppy.galacticops as go from frbpoppy.log import pprint from frbpoppy.paths import paths class Survey: """ Method containing survey parameters and functions. Args: ...
null
frbpoppy/survey.py
survey.py
py
19,057
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path", "line_number": 66, "usage_type": "attribute" }, { "api_name": "frbpoppy.paths.paths.surveys", "line_number": 66, "usage_type": "call" }, { "api_name": "frbpoppy.paths...
218095662
import torch import torch.nn as nn import time import numpy as np import random from torch.autograd import Variable from math import ceil from functools import reduce device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class MatMatMul: def generate_data(self): #Generating random sizes of data...
null
dump/gpumm/tutorial.py
tutorial.py
py
3,579
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.random.ran...
493174596
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None import collections class Solution(object): def minDepth(self, root): """ :type root: TreeNode :rtype: int """ ...
null
practice/solution/0111_minimum_depth_of_binary_tree.py
0111_minimum_depth_of_binary_tree.py
py
1,089
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
94579650
from datetime import datetime import random import pickle import json import os from .news import get_current_news from .swear_words import has_swear_words import tensorflow as tf import numpy as np import tflearn import nltk from nltk.stem.lancaster import LancasterStemmer # ----------------------------------------...
null
bototo/main.py
main.py
py
5,742
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.stem.lancaster.LancasterStemmer", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os....
25220151
"""Version tools set.""" import os import subprocess import click import json import urllib.request from typing import Callable, Optional, Union from setuptools_scm import get_version def get_version_from_scm_tag( *, root: str = '.', relative_to: Optional[str] = None, local_scheme: ...
null
create_aio_app/utils/versiontools.py
versiontools.py
py
2,153
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 17, "usage_type": "name" }, { "api_name": "setuptools_scm.get_versi...
144114376
import sys import re import os import matplotlib.pyplot as plt import numpy as np from scipy import signal from scipy.signal import argrelextrema from numpy import matlib as mb sys.path.append("/Users/YKK/Documents/GitHub/LMBTrain/btkmac") import btk # Data conversion from .c3d to csv # Directory settings Input_Dir ...
null
dataread.py
dataread.py
py
3,982
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.append", "line_number": 22, "usage_type": "call" }, { "api_name": "scipy.signal.butter", ...
336832070
#!/usr/bin/env python # Imports import pandas as pd import pycamhd as camhd from datetime import datetime import yaml from azure.storage.blob import BlobServiceClient import fsspec # constants repodir = '/home/tjc/github/ooicloud/ooi-opendata/' # Open current dbcamhd.json file dbcamhd_url = 'https://ooiopendata.blob...
null
scripts/update_dbcamhd.py
update_dbcamhd.py
py
3,254
python
en
code
null
code-starcoder2
66
[ { "api_name": "fsspec.open", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 17, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 22, "usage_type": "call" }, { "api_name": "azure.storage.blob.BlobSe...
235425724
import torch import torch.nn as nn import nltk from tqdm import tqdm def validate(BOS, EOS, encoder, decoder, valid_loader, valid_word_data, dictionary, max_len, device): encoder.eval() decoder.eval() pbar = tqdm(valid_loader, ascii=True) output_sentences = [] for batch in pbar: ...
null
validate.py
validate.py
py
2,405
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.t", "line_number": 28, ...
90942880
import cv2 import numpy as np import math import sys import struct #takes a png file with an alpha channel and plots it to a ply file scaled to the subject's known height. def cudaPlotSilhouette(png): #4 channel RGBA image represented as a numpy array #img[r,c] = [b, g, r, a], img[r,c,3] = alpha channel i...
null
findborder/cudareadsilhouette_test_graph_4directions.py
cudareadsilhouette_test_graph_4directions.py
py
4,377
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 80, "usage_type": "call" } ]
15248556
from flask import Flask, render_template, request import requests, csv app = Flask(__name__) response = requests.get("http://api.nbp.pl/api/exchangerates/tables/C?format=json") data = response.json() rates = data[0]['rates'] with open('currency.csv', 'w') as csvfile: currencywriter = csv.writer(csvfile, delimiter...
null
currency.py
currency.py
py
1,061
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_nu...
642992699
from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings warnings.filterwarnings('ignore') import os import re import logging from typing import List, Dict, Any import spacy import fitz import pysbd import time PUNCTS = (".", "!", "?", "\"") def i...
null
PdfParser.py
PdfParser.py
py
15,394
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "re.match", "line_number": 38, "usage_type": "call" }, { "api_name": "re.match", "line_number": 68, "usage_type": "call" }, { "api_name": "re.match", "line_number"...
223105893
#============================================================================== # @@-COPYRIGHT-START-@@ # # Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condi...
null
TrainingExtensions/tensorflow/src/python/setup.py
setup.py
py
4,639
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 48, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 61, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 61, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_...
456465028
# coding:utf-8 from django.shortcuts import render from django.http import JsonResponse from django.shortcuts import render_to_response from models import Servers from django.views.decorators.csrf import csrf_exempt from MyCmdb.views import loginValid from Users.models import Users import paramiko @csrf_exempt # 接口...
null
MyCmdb/Server/views.py
views.py
py
5,869
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Servers.objects.get", "line_number": 23, "usage_type": "call" }, { "api_name": "models.Servers.objects", "line_number": 23, "usage_type": "attribute" }, { "api_name": "models.Servers", "line_number": 23, "usage_type": "name" }, { "api_name": ...
399872410
from ovito.io import import_file import numpy as np import matplotlib.pyplot as plt # Load input simulation file. node = import_file('/Users/eason/Downloads/drive-download-20190123T185018Z-001/post.*') my_var = {} M1list = [] M2list = [] M3list = [] M4list = [] M5list = [] M6list = [] M7list = [] M8list = [] M9list = ...
null
draw.py
draw.py
py
3,859
python
en
code
null
code-starcoder2
66
[ { "api_name": "ovito.io.import_file", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 75, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 84, "usage_type": "call" }, { "api_name": "matplotlib....
29376361
import pygame, itertools, os class Board(): def __init__(self): self.screen = pygame.display.set_mode((BOARD_SIZE, BOARD_SIZE)) pygame.display.set_caption('Chess') self.background = self.make_background() self.text_box = self.add_text_box(150, 30) def add_text_box(self, w, h): ...
null
chess_main-pg16.py
chess_main-pg16.py
py
5,848
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.set_mode", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 6, "usage_type": "call" }, { "api_name": "p...
122943337
# flake8: noqa from django.urls import reverse from rest_framework import status from rest_framework.test import APITestCase from rest_framework.authtoken.models import Token from ..models import CustomUser class UserTests(APITestCase): @classmethod def setUpTestData(cls): cls.user = CustomUser.obje...
null
recipe-api/users/tests/test_views.py
test_views.py
py
3,094
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "models.CustomUser.objects.create", "line_number": 14, "usage_type": "call" }, { "api_name": "models.CustomUser.objects", "line_number": 14, "usage_type": "attribute"...
381252274
import numpy as np import mdtraj as md import glob a1 = np.append(np.arange(71,515), np.arange(668,1005)) a2 = np.append(a1, np.arange(1141,1744)) a3 = np.append(a2, np.arange(1860,2121)) a4 = np.append(a3, np.arange(2714,3113)) a5 = np.append(a4, np.arange(3383,3819)) a6 = np.append(a5, np.arange(4022,4382)) TM = a6 ...
null
featurization_RMSD.py
featurization_RMSD.py
py
627
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.append", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number":...
483746021
#!/usr/bin/env python import os import sys import motor if 'OPENSHIFT_REPO_DIR' in os.environ: virtenv = os.environ['OPENSHIFT_DIY_DIR'] + '/virtenv/venv' os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python3.3/site-packages') virtualenv = os.path.join(virtenv, 'bin/activate_this.py') ...
null
diy/app.py
app.py
py
1,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
566510144
import psycopg2 import collections import simplejson as json connection = psycopg2.connect(user="quikbot", password="1Minus0123", host="database-1.cfzq7u8p3cto.us-west-2.rds.amazonaws.com", port="5432", ...
null
py_sql_code/sql_connection.py
sql_connection.py
py
1,303
python
en
code
null
code-starcoder2
66
[ { "api_name": "psycopg2.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 26, "usage_type": "call" }, { "api_name": "simplejson.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "simplejson.d...
623253299
import py.test from mock import patch, Mock from ceph_deploy.util import pkg_managers class TestRPM(object): def setup(self): self.to_patch = 'ceph_deploy.util.pkg_managers.wrappers' @py.test.mark.skipif(reason='failing due to removal of pushy') def test_extend_flags(self): fake_check_ca...
null
ceph_deploy/tests/unit/util/test_pkg_managers.py
test_pkg_managers.py
py
623
python
en
code
null
code-starcoder2
66
[ { "api_name": "mock.Mock", "line_number": 13, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 14, "usage_type": "call" }, { "api_name": "ceph_deploy.util.pkg_managers.rpm", "line_number": 15, "usage_type": "call" }, { "api_name": "ceph_deploy.ut...
6363056
import django_filters from django.db.models import Q from django.utils.timezone import now from rest_framework import filters, serializers, viewsets from rest_framework.pagination import LimitOffsetPagination from democracy.enums import Commenting, InitialSectionType from democracy.models import Hearing, Section, Sect...
null
democracy/views/section.py
section.py
py
4,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "democracy.views.base.BaseImageSerializer", "line_number": 14, "usage_type": "name" }, { "api_name": "democracy.models.SectionImage", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 20, "u...
539233384
from __future__ import print_function import sys import argparse import logging from jwst.associations.lib.log_config import log_config, DMS_config from jwst.associations.association import AssociationRegistry from jwst.associations.generate import generate from jwst.associations.pool import AssociationPool # Config...
null
jwst/associations/main.py
main.py
py
5,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "jwst.associations.lib.log_config.log_config", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { ...
19044578
import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import reference_database as rdb from matplotlib import rc rc('font',**{'family':'serif','serif':['Palatino']}) rc('text', usetex=True) plt.style.use('seaborn-white') # from defaut plt.rcParams.update({'font.size': 20}) plt.rcParams['savefig....
null
Analysis/Tools/timeSeries_returnOuterVariables/cut1_new_static.py
cut1_new_static.py
py
2,737
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use",...
252015763
#!/usr/bin/env python3 """Kickstart Alarm. Kickstart 2019 practice round. OMG OMG! Alvaro Leal <AlvaroLeal@AlvaroLeal.net>, 2019 """ # import pytest import sys from datetime import datetime def get_subarray_sum(subarray, K): sum = 0 for k in range(1, K + 1): tmp_sum = 0 index = 0 for ...
null
2019/practice_round/kickstart_alarm/main.py
main.py
py
2,695
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 67, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 78, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 79, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
396668407
# -*- coding: utf-8 -*- import os import re import json import time import random import requests import cairosvg from lxml import etree from login.chaojiying import Chaojiying_Client from tor_spider.settings import proxy_table,cookie_table,mysql_conn,proxy_mysql_conn from login.mylog import logger logger = logger() c...
null
login/xbtpp.py
xbtpp.py
py
7,007
python
en
code
null
code-starcoder2
66
[ { "api_name": "login.mylog.logger", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.session", "line_number": 26, "usage_type": "call" }, { "api_name": "login.mylog.logger.info", "line_number": 29, "usage_type": "call" }, { "api_name": "login.myl...
603988876
import time, pygame, sys, random pygame.init() width, height = 700, 700 backgroundColor = 255, 255, 255 dvdLogoSpeed = [1, 1] white = 255, 255, 255 black = 0, 0, 0 screen = pygame. display.set_mode((width, height)) despourRelancer = [0, 0, 0, 0, 0] listedeDes = [1, 1, 1, 1, 1] contrat = [] queue1 = False queue2 ...
null
Pygame/Yams.bck/Célian_Yams_anime.py
Célian_Yams_anime.py
py
38,660
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
123006639
# -*- coding: utf-8 -*- """Movies views.""" from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView from django.contrib import messages from django.contrib.messages.views import SuccessMessageMixin from django.shortcuts import redirect from django.http import Http404 from django.urls...
null
moviesapp/movies/views.py
views.py
py
3,188
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.ListView", "line_number": 15, "usage_type": "name" }, { "api_name": "models.Movie", "line_number": 18, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 31, "usage_type": "name" }, { "api_na...
14585415
# coding:utf8 import numpy as np import codecs import torch import torch.utils.data as D from torch.autograd import Variable from collections import deque import pandas as pd word2id = {} # word2id的字典 id2relation = {} # id转关系的字典 max_len = 50 # 字向量的长度 word2id_file = './data/people-relation/word2id.txt' id2re...
null
test_api.py
test_api.py
py
6,063
python
en
code
null
code-starcoder2
66
[ { "api_name": "codecs.open", "line_number": 26, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 32, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 92, "usage_type": "call" }, { "api_name": "collections.deque", "line_num...
577277651
import pya # import python module import os # needed to find the script directory (in the second last line) def adjustOriginCenter(frame): """ adjust the cell origin to the center of the design """ trans = pya.Trans.new(-frame.center()) for inst in layout.top_cell().each_inst(): layout.top_cell().transfo...
null
python/210423-myoshi.py
210423-myoshi.py
py
3,503
python
en
code
null
code-starcoder2
66
[ { "api_name": "pya.Trans.new", "line_number": 8, "usage_type": "call" }, { "api_name": "pya.Trans", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pya.Layout", "line_number": 19, "usage_type": "call" }, { "api_name": "pya.LayerInfo", "line_numbe...
642417556
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import collections import os from pex.common import filter_pyc_dirs, filter_pyc_files, touch from pex.compatibility import urlparse from pex.tracer...
null
pex/vendor/__init__.py
__init__.py
py
9,049
python
en
code
null
code-starcoder2
66
[ { "api_name": "pex.typing.TYPE_CHECKING", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.abspath...
205737880
from dataclasses import dataclass, field from typing import List, Optional from .annotation import ( AdminData, Annotation, DocumentationBlock, ) from .category_string import CategoryString from .identifier import Identifier from .multi_language_overview_paragraph import MultiLanguageOverviewParagraph from ...
null
autosar/models/alive_supervision.py
alive_supervision.py
py
9,797
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Optional", "line_number": 97, "usage_type": "name" }, { "api_name": "identifier.Identifier", "line_number": 97, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 97, "usage_type": "call" }, { "api_name": "typing.Option...
138542727
import numpy as np from typing import Tuple, Optional from tqdm import tqdm from ..util import online_variance, is_power_of_ten from ..density import Distribution from ..sampling import Sample class ImportanceMC(object): """ Importance sampling Monte Carlo integration. Importance sampling replaces the unifo...
null
src/hepmc/core/integration/importance.py
importance.py
py
13,509
python
en
code
null
code-starcoder2
66
[ { "api_name": "density.Distribution", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 95, "usage_type": "name" }, { "api_name": "numpy.empty", "line_number": 110, "usage_type": "call" }, { "api_name": "numpy.empty", "...
617155889
# -*- coding: UTF-8 -*- import simplejson as json import time import os import requests from django.contrib.auth.decorators import permission_required from django.http import HttpResponse from common.utils.extend_json_encoder import ExtendJSONEncoder from .models import Instance, TcloudCdbConfig, Config, Reso...
null
sql/backup.py
backup.py
py
6,930
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Instance.objects.get", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Instance.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Instance", "line_number": 17, "usage_type": "name" }, { "api_name...
366610547
from ._compat import filename_to_ui from ._compat import get_text_stderr from ._compat import PY2 from .utils import echo def _join_param_hints(param_hint): if isinstance(param_hint, (tuple, list)): return " / ".join(repr(x) for x in param_hint) return param_hint class ClickException(Exception): ...
null
metaflow/_vendor/click/exceptions.py
exceptions.py
py
8,118
python
en
code
null
code-starcoder2
66
[ { "api_name": "_compat.PY2", "line_number": 21, "usage_type": "name" }, { "api_name": "_compat.PY2", "line_number": 33, "usage_type": "name" }, { "api_name": "_compat.get_text_stderr", "line_number": 41, "usage_type": "call" }, { "api_name": "utils.echo", "lin...
394434159
import os import math import numpy as np import matplotlib.pyplot as plt import networkx as nx import pandas as pd import os from .. import path as path from collections import Counter import plotly as p import plotly.graph_objs as go from plotly.offline import plot #import realnetwork.path as path from ..plot_util im...
null
ns/home/utils/random_network/random_network_analyzer.py
random_network_analyzer.py
py
5,378
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.log", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.random.poisson", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.random.binomial...
369623233
import networkx as nx from networkx.readwrite import json_graph import json import numpy as np NUMBER = 2000 EACH = 1000 FILENAME = 'data1/ex3' def createG(n, label, val, test): m = n / 1000 n = n / m #G = nx.grid_2d_graph(m, n) G = nx.complete_graph(n) #G = nx.path_graph(n) l...
null
generate_graph.py
generate_graph.py
py
3,039
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.complete_graph", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 20, "usage_type": "call" }, { "api_name": "networkx.set_node_attributes", "line_number": 22, "usage_type": "call" }, { "api_name": "netwo...
295071283
from .datasets import MOMENTS import torch import torch.nn as nn from .datasets import save_batch_image, save_epoch_image device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') class Robust: def __init__(self, model, transformer, dataset_name, epsilon, test_dataset): self.model = model ...
null
umbreon/robust.py
robust.py
py
4,258
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": "datasets.MOMENTS", ...
322714568
import random import Draw import itertools class Grid: def probabilistic_blocks(self): b = set() for y in range(self.rows): for x in range(self.cols): if (y, x) == self.finish or (y,x) == self.start: continue count = 1.2 total = 0 ...
null
Maze.py
Maze.py
py
4,799
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 52, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 58, "usage_type": "call" }, { "api_name": "itertools.product", "...
554164723
from rest_framework import serializers from apps.movies import models class MovieCreateSerializer(serializers.Serializer): title = serializers.CharField(required=True) class MovieSerializer(serializers.ModelSerializer): id = serializers.CharField(read_only=True) title = serializers.CharField(max_length...
null
apps/movies/serializers.py
serializers.py
py
1,904
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 7, "usage_type"...
290471041
from datetime import datetime from itertools import chain from django.db.models import Prefetch from upday.models import Conclusion, CommunityAdministrator, Achievement, Answer from upday.modules.channel.service.channel_service import ChannelService from upday.modules.common.service.achievement_service import Achieve...
null
upday/modules/community/service/conclusion_service.py
conclusion_service.py
py
15,546
python
en
code
null
code-starcoder2
66
[ { "api_name": "upday.models.Conclusion.objects.filter", "line_number": 26, "usage_type": "call" }, { "api_name": "upday.models.Conclusion.objects", "line_number": 26, "usage_type": "attribute" }, { "api_name": "upday.models.Conclusion", "line_number": 26, "usage_type": "n...
594819401
# This file is Copyright (c) 2020 Franck Jullien <franck.jullien@gmail.com> # License: BSD from enum import IntEnum def K(x, y): """K code generator ex: K(28, 5) is COM Symbol""" return (y << 5) | x def D(x, y): """D code generator""" return (y << 5) | x # Symbols (6.3.5) ---------------------------...
null
pcie_analyzer/common.py
common.py
py
2,187
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.IntEnum", "line_number": 36, "usage_type": "name" } ]
380391750
import wmi class VM(): crt = wmi.WMI(namespace="root/virtualization/v2", find_classes=False) system_man = crt.Msvm_VirtualSystemManagementService()[0] def __init__(self,name): self.name = name def create_vm(self,vmname,cpu_number,mem_quantity): vcpu = self.crt.Msvm_ProcessorSettingDa...
null
create_virtual_machine_wmi.py
create_virtual_machine_wmi.py
py
1,608
python
en
code
null
code-starcoder2
66
[ { "api_name": "wmi.WMI", "line_number": 5, "usage_type": "call" } ]
232170363
''' This program is free software; you can redistribute it and/or modify it under the terms of the Revised BSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE....
null
upcean/barcodes/prepil.py
prepil.py
py
1,837
python
en
code
null
code-starcoder2
66
[ { "api_name": "upcean.fonts.fonts", "line_number": 26, "usage_type": "attribute" }, { "api_name": "upcean.fonts", "line_number": 26, "usage_type": "name" }, { "api_name": "upcean.fonts.fonts", "line_number": 27, "usage_type": "attribute" }, { "api_name": "upcean.f...
456417887
#!/usr/bin/env python3 """Reads all .edm files in a sub folder and saves data to a dump file. Usage: read_all [<start> [<end>]] """ from io_EDM.edm import EDMFile import itertools import glob import sys, os import pickle from docopt import docopt args = docopt(__doc__) all_files = sorted([x for x in glob.glob("al...
null
utils/read_all.py
read_all.py
py
1,189
python
en
code
null
code-starcoder2
66
[ { "api_name": "docopt.docopt", "line_number": 15, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "io_EDM.edm.EDMFile", "line_number": 32, "usage_type": "call" }, { "api_name": "itertools.chain", "lin...
31828737
""" Our modification of Ian Danforth's modification: https://gist.github.com/iandanforth/e3ffb67cf3623153e968f2afdfb01dc8 of the OpenAI Gym (Discrete) Cartpole: https://github.com/openai/gym/blob/master/gym/envs/classic_control/cartpole.py which was itself based on Sutton's implementation: http://incompleteideas.net/...
null
pilco/environments/custom/continuous_cartpole.py
continuous_cartpole.py
py
6,228
python
en
code
null
code-starcoder2
66
[ { "api_name": "gym.Env", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 47, "usage_type": "attribute" }, { "api_name": "gym.spaces.Box", "line_number": 51, "usage_type": "call" }, { "api_name": "gym.spaces", "line_numb...
103202859
from PyQt5.QtCore import QRegExp, Qt from PyQt5.QtGui import QFont, QSyntaxHighlighter, QTextCharFormat class RustHighlighter(QSyntaxHighlighter): def __init__(self, parent=None): super(RustHighlighter, self).__init__(parent) keyword_format = QTextCharFormat() keyword_format.setForeground...
null
src/syntax.py
syntax.py
py
2,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtGui.QSyntaxHighlighter", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QTextCharFormat", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.darkBlue", "line_number": 10, "usage_type": "attribute" }, {...
515603246
from flask import Flask from views import index app = Flask(__name__) app.register_blueprint(index.blueprint, url_prefix='/') if __name__ == '__main__': app.secret_key = 'secret_key' app.run(host='0.0.0.0')
null
app.py
app.py
py
218
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "views.index.blueprint", "line_number": 6, "usage_type": "attribute" }, { "api_name": "views.index", "line_number": 6, "usage_type": "name" } ]
481835513
# uncompyle6 version 3.7.4 # Python bytecode 2.4 (62061) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.darwin-8.8.2-i386/egg/worldcookery/tests/test_size.py # Compiled at: 2006-09-21 05:27:35 import unittest from zope.i18n import translate from worldco...
null
pycfiles/worldcookery-2.0.1-py2.4/test_size.py
test_size.py
py
1,202
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "worldcookery.recipe.Recipe", "line_number": 16, "usage_type": "call" }, { "api_name": "worldcookery.size.RecipeSize", "line_number": 20, "usage_type": "call" }, { "ap...
640802571
from flask import Flask, render_template, session '''from OpenSSL import SSL context = SSL.Context(SSL.SSLv23_METHOD) context.use_privatekey('server.key') context.use_certificate('server.crt')''' from src.common.database import Database from src.model.users.users import User app = Flask(__name__) app.config.from_obj...
null
src/app.py
app.py
py
1,314
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "src.model.users.views.user_blueprint", "line_number": 21, "usage_type": "argument" }, { "api_name": "src.model.staffs.views.staffs_blueprint", "line_number": 22, "usage_type": "argument...
367396906
import numpy as np import matplotlib.pyplot as plt import sys import os import matplotlib.patches as mpatches font = { 'size' : 15} plt.rc('font', **font) filename = 'plot_' + sys.argv[1].replace('.','_') markersize = 10 colors = ['b','g','r','c','m','y'] styles = ['o','s','v','^','D',">","<","*","h","H","+","1","2"...
null
Plotting/plot_roofline.py
plot_roofline.py
py
5,197
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "lin...
262498417
from functools import wraps import importlib import logging import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from core.config import cfg from model.roi_pooling.functions.roi_pool import RoIPoolFunction from model.roi_crop.functions.roi_crop import RoICropFunction ...
null
lib/modeling/CE3D_model_builder.py
CE3D_model_builder.py
py
6,056
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "modeling.model_builder.Generalized_RCNN", "line_number": 25, "usage_type": "name" }, { "api_name": "core.config.cfg.LESION", "line_number": 29, "usage_type": "attribute" }, { ...
184197435
from test import Test from itertools import product from client import Client import pickle name_hash = {'win7': b'win7 ', 'win10': b'win10', 'suse': b'suse '} if __name__ == '__main__': #format = machine delay loss filename=name duration=time machines = ['win7', 'win10', 'suse'] delays ...
null
cetin/TCP benchmark/testmaker2.py
testmaker2.py
py
1,013
python
en
code
null
code-starcoder2
66
[ { "api_name": "client.Client", "line_number": 20, "usage_type": "call" }, { "api_name": "client.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 23, "usage_type": "call" }, { "api_name": "test.Test", "line_...
370323862
import os import time from django.shortcuts import render, redirect from django.urls import reverse from django.views.generic import ListView from rest_framework.decorators import api_view, renderer_classes from rest_framework.renderers import TemplateHTMLRenderer from rest_framework.response import Response ...
null
classifier/views.py
views.py
py
5,270
python
en
code
null
code-starcoder2
66
[ { "api_name": "user.views", "line_number": 20, "usage_type": "name" }, { "api_name": "user.views.validate_n_get_user", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 22, "usage_type": "call" }, { "api_name": "m...
500641120
"""gameGeek URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
null
gameGeek/urls.py
urls.py
py
2,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 23, "usage_type": "name" }, { "api_name": "...
577972477
#Ne pas oublier de changer le module à importer module="Maths/random_exo_1" import sys import io from importlib import reload #Pour réimporter plusieurs fois #On récupère les données de l'utilisateur sauvegarde_stdout=sys.stdout sys.stdout=io.StringIO() # On va simuler beaucoup de lancer pour vérifier que la répartitio...
null
python-project/Maths/random_exo_1_Test.py
random_exo_1_Test.py
py
2,187
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdout", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 8, "usage_type": "call" }, { "api_name": "importlib.reload", "line...
518770597
# !/usr/bin/env python # coding: utf-8 import threading from lib import db from smzdm_case import TitleCase, CommentCase, CatesstrCase, ArticleMallCase, RmbPriceSmallCase, RmbPriceBigCase, \ ArticleWorthyCase, ArticleUnworthyCase, WorthyPrecentageCase, ArticleCollectionCase, ArticlePriceCase from smzdm_filter impor...
null
core/smzdm_search.py
smzdm_search.py
py
2,930
python
en
code
null
code-starcoder2
66
[ { "api_name": "smzdm_logger.UsualLogging", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 16, "usage_type": "attribute" }, { "api_name": "smzdm_case.TitleCase", "line_number": 17, "usage_type": "call" }, { "api_name": "...
547574911
from django.urls import path from django.urls.conf import re_path from .api import ( MyQuizListAPI, QuizDetailAPI, QuizListAPI, SaveUsersAnswer, SubmitQuizAPI, ) urlpatterns = [ path("my-quizs/", MyQuizListAPI.as_view()), path("quizs/", QuizListAPI.as_view()), path("save-answer/", Save...
null
quiz/urls.py
urls.py
py
489
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "api.MyQuizListAPI.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": "api.MyQuizListAPI", "line_number": 13, "usage_type": "name" }, { "api_name": "django.u...
43639594
import pandas as pd import matplotlib.pyplot as plt def get_categorical_variables(df): result = [] for i in df.columns: if df.loc[:,i].nunique() < 20: result.append(i) return result def get_numerical_variables(df): cols = df._get_numeric_data().columns res=list(cols) retur...
null
build.py
build.py
py
1,492
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib...
312232236
""" Custom argument parser. """ import argparse class ArgumentParser(argparse.ArgumentParser): def __init__(self, *args, **kwargs): """A custom argument parser.""" kwargs['add_help'] = False # use a custom help message (see below) kwargs['formatter_class'] = argparse.RawTextHelpFormatter...
null
msl/network/cli_argparse.py
cli_argparse.py
py
567
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "attribute" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 12, "usage_type": "attribute" }, { "api_name": "argparse.SUPPRESS", "line_number": 19, "usage_type": "attribute" } ]
242325308
from django import template from django.template.defaultfilters import stringfilter import re register = template.Library() @register.filter @stringfilter def dropptag(value): """Removes opening / closing tags from beginning and end. Use before safe.""" new_value = re.sub(r'^<p>', '', value) # opening ...
null
home/templatetags/home_extras.py
home_extras.py
py
419
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 5, "usage_type": "call" }, { "api_name": "django.template", "line_number": 5, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_numbe...
590526410
import pdb import time import argparse import os import datasets_skimage as datasets from PIL import Image import numpy as np import json import torch import torchvision import torchvision.transforms as transforms import torch.optim as optim import torch.nn as nn import torch.nn.functional as F from torch.utils.data i...
null
write_txt_free.py
write_txt_free.py
py
11,515
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 43, "usage_type": "attribute" }, { "api_name": "os.cp...
36775514
#!/usr/bin/env python3 #ar_analysis.py #Nick Florek #This script scrubs the output of several AR resistance databases searches into 1 output. import argparse import os import csv def check_cov(hit): cov = float(hit[8]) ide = float(hit[9]) if cov and ide > 98: return True else: return...
null
scripts/ar_analysis.py
ar_analysis.py
py
3,133
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "csv.reader", ...
267510022
import pygame from pygame.sprite import Group from src.settings import Settings from src.game_stats import GameStats from src.scoreboard import Scoreboard from src.button import Button from src.ship import Ship from src.alien import Alien from src import game_functions as gf def run_game(): # Initialize pygame, set...
null
src/giorgio_invasion.py
giorgio_invasion.py
py
1,603
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 15, "usage_type": "call" }, { "api_name": "src.settings.Settings", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.disp...
355684849
#!/usr/bin/env python # coding: utf-8 import pandas as pd import psycopg2 import os import logging import time import seaborn as sns; sns.set(color_codes=True) import matplotlib.pyplot as plt from sqlalchemy import text from sqlalchemy import create_engine # Get environment variables host = os.environ['IMS_HOSTNAME'...
null
Python/ims24/oldfolders/module/visualize.py
visualize.py
py
3,799
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.environ", "line_num...
299156842
#------------------------------------------------------------------------------- # Name: RDF parser # Purpose: Loads RDF XMLs from zip and xml files to pandas DataFrame in a triplestore manner # # Author: kristjan.vilgo # # Created: 13.12.2018 # Copyright: (c) kristjan.vilgo 2018 # Licence: GP...
null
Tools/RDF_PARSER/RDF_parser.py
RDF_parser.py
py
26,248
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.set_option", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.dateti...
341668034
import sys import os sys.path.append(os.path.abspath("../")) import argparse from enum import Enum import io from gcloud import storage from google.cloud import vision from google.cloud.vision import types from PIL import Image, ImageDraw import os import tempfile from pdf2image import convert_from_path, convert_from_...
null
sag_sheet_src/main.py
main.py
py
3,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number...
91663949
import argparse import datetime import requests def get_trending_repositories(top_size, days_count): """ Finds %top_size% repositories with the largest amount of stars created in the last %days_number% days. :returns (username, repo_name, repo_link) generator """ delay = datetime.timedelta(day...
null
github_trending.py
github_trending.py
py
3,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.ge...
607427581
#!/usr/bin/env python # -*- coding: utf-8 -*- from ray import tune from ray.rllib.agents.impala import ImpalaTrainer from ray.rllib.agents.a3c import A3CTrainer from ray.tune import grid_search from gym import spaces #space include observation_space and action_space import numpy as np import hfo_py import torch from...
null
base_IMPALA_multi_agent.py
base_IMPALA_multi_agent.py
py
2,731
python
en
code
null
code-starcoder2
66
[ { "api_name": "hfo_py.LOW_LEVEL_FEATURE_SET", "line_number": 22, "usage_type": "attribute" }, { "api_name": "hfo_py.GOAL", "line_number": 30, "usage_type": "attribute" }, { "api_name": "gym.spaces.Box", "line_number": 35, "usage_type": "call" }, { "api_name": "gym...
616340864
#!/usr/bin/env python # -*- coding: utf-8 -*- # 环境模型:env_0_obstacle .py # launch文件:one_jackal_image_add_sensor.launch # world文件:obstacle_sensor.world import os import datetime import time import random import math from collections import deque import numpy as np import matplotlib.pyplot as plt import mxnet as mx f...
null
10_static_obstacle/mxnet_dqn_10_static_obstacle.py
mxnet_dqn_10_static_obstacle.py
py
18,269
python
en
code
null
code-starcoder2
66
[ { "api_name": "my_env.envmodel", "line_number": 27, "usage_type": "call" }, { "api_name": "mxnet.gpu", "line_number": 28, "usage_type": "call" }, { "api_name": "mxnet.gluon.nn", "line_number": 38, "usage_type": "attribute" }, { "api_name": "mxnet.gluon", "line...
78616336
import json import requests import quart from .errors import * class Dashboard: def __init__(self, bot, key, url, *args, **kwargs): """Initialize the dashboard""" self.bot = bot self.key = key self.url = url self.routes = {} def route(self, func): if func.__name__ in self.routes.keys(): raise...
null
discord/ext/dashboard/dashboard.py
dashboard.py
py
944
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 41, "usage_type": "call" } ]