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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70762116 | import logging
import core
from datetime import datetime
from core.helpers import Url
import json
import re
def base_url():
url = core.CONFIG['Indexers']['Torrent']['thepiratebay']['url']
if not url:
url = 'https://www.thepiratebay.org'
else:
url = re.sub(r'/$', '', url) + '/newapi'
ret... | null | core/providers/torrent_modules/thepiratebay.py | thepiratebay.py | py | 3,340 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.CONFIG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "core.CONFIG",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_numb... |
372304800 | from django import forms
from django.conf import settings
from captcha.fields import CaptchaField
from django.core.files.images import get_image_dimensions
class PromoImageAdminForm(forms.ModelForm):
def clean_image(self):
image = self.cleaned_data.get("image")
if not image:
raise forms.... | null | main/forms.py | forms.py | py | 1,458 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.ValidationError",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "d... |
343228539 | import time
import json
import uuid
import inspect
from core import settings
debugSettings = settings.config["debug"]
filter = ""
buffer = []
debugClients = []
class _debug():
_id = str()
buffer = list()
filter = str()
level = int()
debugExpire = int()
fullstack = bool()
def __init__(sel... | null | core/logging.py | logging.py | py | 4,624 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.settings.config",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "core.settings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"lin... |
42738162 | import copy
import dill
from compyl.__parser.finite_automaton import DFA
from compyl.__parser.rule_formatter import rules_are_valid, format_rules
from compyl.__parser.error import ParserError, ParserSyntaxError, ParserBuildError, GrammarError
__all__ = ['Parser', 'ParserError', 'ParserSyntaxError', 'ParserBuildError... | null | compyl/parser.py | parser.py | py | 2,901 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "compyl.__parser.error.ParserError",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "compyl.__parser.rule_formatter.rules_are_valid",
"line_number": 69,
"usage_type": "call"
... |
360943731 | import os
import re
import click
import json
import codecs
import shutil
from lxml import html
import cssselect
from .service import Service
CONFIRM_MESSAGE = 'It already exists. Do you want to overwrite? [y/n]\n'
TEMPLATE_SOURCE = '''#include <bits/stdc++.h>
using namespace std;
int main(void) {
... | null | atcodertools/project.py | project.py | py | 4,171 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "service.Service",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line... |
262677044 | import joblib
import numpy as np
from sklearn import metrics
clf = joblib.load("randomforest_full_8.sav")
X_test = np.load("X_test8_all_sub.npy")
y_test = np.load("y_test8_all_sub.npy")
print(y_test.shape)
print(X_test.shape)
predicted = clf.predict(X_test)
cm = metrics.confusion_matrix(y_test, predicted)
print("c... | null | scripts/metric.py | metric.py | py | 1,358 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "joblib.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
... |
115452270 | # -*- coding: utf-8 -*-
import json
import re
import codecs
'''建立索引'''
path = "C:\\Users\\dellxh\\Desktop\\信息检索\\tweets.txt"
path1 = "C:\\Users\\dellxh\\Desktop\\信息检索\\dict.txt"
f1=codecs.open(path1, 'w', encoding='utf-8')
f = open(r"C:\\Users\\dellxh\\Desktop\\信息检索\\tweets.txt", "r")
#f1=open(path1,'w')
line = f.read... | null | exp1/ex1.py | ex1.py | py | 3,599 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "codecs.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 68,
"usa... |
59491510 |
#需要安装pycrypto: pip install pycryptodome
#网易云音乐加密过程
"""
function a(a=16) {#随机的16位字符串
var d, e, b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", c = "";
for (d = 0; a > d; d += 1)#循环16次
e = Math.random() * b.length,#随机数
e = Math.floor(e),#取整
... | null | 网易云音乐爬取.py | 网易云音乐爬取.py | py | 5,739 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.MODE_CBC",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name"... |
81758288 | from torch.nn._functions.rnn import *
from torch.autograd import Function
class StepFunctionStraightThrough(Function):
# The cutoff here is at x=0
@staticmethod
def forward(ctx, input, slope=1., shift=.5):
ctx.save_for_backward(input)
ctx.min = 0.
ctx.max = 1.
ctx.slope = s... | null | model/rnn_functions.py | rnn_functions.py | py | 8,644 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.autograd.Function",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn._functions.rnn.cat",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "torch.nn._functions.rnn",
"line_number": 140,
"usage_type": "name"
},
{
"api_... |
407643822 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 30 15:10:44 2017
@author: lukaskemmer
"""
from load_data import *
from data_visualization import *
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import feature_selection, decomposition
from sklearn.model_selecti... | null | 03_Submission/MOKA/02_Code/01_PSSDD/xgb.py | xgb.py | py | 9,453 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 172,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifie... |
614453296 | import datetime
from kinko.app_settings import TYPE_MAP
from kinko.models import Kinko
from package.models import Package, connection
from dvutils.replica_set import get_replica_set
from kinko.utils import kinko_map_reduce
class KinkoHandler( object ):
"""
The base class for Handling all the requests for gener... | null | kinko/kinkohandler.py | kinkohandler.py | py | 7,170 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "backend.models.Client.objects.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "backend.models.Client.objects",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "backend.models.Client",
"line_number": 46,
"usage_type": "name"
},... |
197784633 | '''
Justin Chen
5.20.17
main.py
Script for scraping the Commons and Lords Hansard, the Official Report of debates in Parliament website
Note: Must be run with Python3 to avoid character encoding issues.
Boston University
Hariri Institute for Computing and Computational Science & Engineeri... | null | parsing/parliament/parliament.py | parliament.py | py | 15,702 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "codecs.getreader",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.timedel... |
501539858 | import os
from itertools import product
from os import listdir
from os.path import join, isfile
import numpy as np
import pandas as pd
from natsort import natsorted
from tensorflow.keras import Input
from tensorflow.keras.applications.resnet import ResNet50
from tensorflow.keras.applications.resnet50 import preprocess... | null | src/model/image_classifier.py | image_classifier.py | py | 4,999 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "src.config.N_SAMPLES",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.Input",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.applications.vgg16.VGG16",
"line_number": 33,
"usage_type": "call"
},
{
... |
8735781 | """"
This is the code for main window which cross-reference Joback_Hand_Pick.py and Joback_Smiles.py
The code is written by Chenyang Shi at AbbVie.
Send him an email at chenyang.shi@abbvie.com for questions and suggestions.
"""
from tkinter import *
from tkinter import ttk
from math import exp
import tki... | null | conda_build_recipe/JRgui_macOS/jrgui/cli.py | cli.py | py | 142,194 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.ttk.Style",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "os.path.realpath",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
143052658 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests, json, pyprind, sys, shutil
from bs4 import BeautifulSoup
json_arr = []
def savePict(url, restaurant):
img = requests.get(url,stream=True)
with open(restaurant+'.jpg', 'wb') as f:
shutil.copyfileobj(img.raw, f)
def dump(fileName):
with op... | null | Ch2/crawler.py | crawler.py | py | 1,712 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "shutil.copyfileobj",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
496260102 | #!/usr/bin/python3
"""script to export data in the JSON format"""
if __name__ == "__main__":
import requests
from sys import argv
import json
url = "https://jsonplaceholder.typicode.com/"
user_id = argv[1]
user = requests.get(url + "users/{}".format(user_id)).json()
tasks = requests.get(ur... | null | 0x15-api/2-export_to_JSON.py | 2-export_to_JSON.py | py | 732 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 23... |
38871025 | import numpy as np
import string
import os
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from skimage.util.noise import random_noise
from matplotlib.image import imsave
template = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns... | null | alphanum_data/generate.py | generate.py | py | 3,990 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "skimage.util.noise.random_noise"... |
576617137 | from django.urls import path
from .views import *
urlpatterns = [
path('preview/<str:tourId>',preview,name='preview'),
path('advanced-search',AdvancedSearching.as_view(),name='advancedSearching'),
path('search',SearchTour.as_view(),name='searchTour'),
path('all-tours',AllToursView.as_view(),name='allTo... | null | touring/urls.py | urls.py | py | 938 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
268702467 | from odoo import api, fields, models, _
from odoo.http import request
from datetime import date
class HealthBusinessType(models.Model):
_name = "health.manage.zoneaudit"
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = "Health Manage zoneaudit"
unit_id = fields.Many2one('health.unit.... | null | health_portal/models/zone_audit.py | zone_audit.py | py | 2,028 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "odoo.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2one",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
382492726 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
__title__ = ''
__author__ = 'mi'
__mtime__ = '2020/3/1'
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ☃ ┃
┃ ┳┛ ┗┳ ┃
┃ ... | null | vpnConnect/start.py | start.py | py | 4,501 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vpnConnect.login_vpn.JTBVpn",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "vpnConnect.check_heart.CheckVpn",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 45,
"usage_type": "call"
},
{
"... |
133463882 | import anndata
import csv
input_id = '38e2af3a115f13e7d90d33c4e5ca4e9e'
h5ad_file_path = rf"G:\kidney\slideseq-cell-type-annotated\slideseq-cell-type-annotated\{input_id}\expr_labeled.h5ad"
d = anndata.read_h5ad(h5ad_file_path)
# print(d.obs)
# print(d.obsm)
# print(d.obsm['X_spatial'])
celltypes = d.obs["cell_... | null | utils/h5ad2csv.py | h5ad2csv.py | py | 884 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "anndata.read_h5ad",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 32,
"usage_type": "call"
}
] |
55874151 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tasks', '0009_auto_20150825_1158'),
('itinerary', '0001_initial'),
('delays', '0002_delayats... | null | form/migrations/0001_initial.py | 0001_initial.py | py | 4,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"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.CreateModel",
"line_number": 17,
"usage_type": "call"
},
... |
343120260 | ##############################################################################
# Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
##############################################################################
"""
Class to parse .yaml file to generate a rep... | null | report-tools/adaptors/sql/yaml_parser.py | yaml_parser.py | py | 4,235 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "adaptors.sql.sqlite.Database",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "adaptors.sql.sqlite",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 48,
"usage_type": "call"
}
] |
441443409 | import copy
import numpy as np
import torch.nn as nn
import torch.nn.functional as f
import torch as torch
import torch.optim as optim
import time
class Net(nn.Module):
def __init__(self, num_inputs=38, num_actions=10):
super(Net, self).__init__()
self.fc1 = nn.Linear(num_inputs, 50)
self... | null | tank.py | tank.py | py | 14,147 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
14967602 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url("", include('django_socketio.urls')),
url(r'^games/$', 'game.views.lobby', name='lobby'),
url(r'^games/(?P<game_id>\d+)/$', 'game.views.game', name='games')... | null | politically_correct/politically_correct/urls.py | urls.py | py | 943 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
338819363 |
from sklearn.linear_model import LinearRegression
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
raw_data = pd.read_csv("./simple_regression/Salary_Data.csv")
# df_data = raw_data.copy()
# copy data
df_data = np.copy(raw_data)
# get features and output
x_data = df_data[:, :1]
y_data = df_dat... | null | simple_regression/simple_regression.py | simple_regression.py | py | 765 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matpl... |
421395171 | from django.db import IntegrityError
from django.shortcuts import render
from django.views.generic import View
from .models import Mail
class Home(View):
template_name = 'dashboard/index.html'
message = 'Your Email has been saved successfully. Thank you for your subscription.'
def get(self, request, *arg... | null | dashboard/views.py | views.py | py | 772 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.generic.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Mail.objects.create",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
134147280 | # Copyright (c) 2016 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | null | IPSec_Enforcer/ipsec_enforcer/registration/prepare_vpn_configurations.py | prepare_vpn_configurations.py | py | 13,837 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.product",
"line_number": 290,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 297,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 325,
"usage_type": "call"
},
{
"api_name": "itertools.pr... |
241258269 | import logging
import sys
def get_logger(name, level=logging.NOTSET, file=None):
try:
if isinstance(level, str):
level = getattr(logging, level.upper())
app_log = logging.getLogger(name)
# 必须设置,否则无法输出
app_log.setLevel(level)
# no handler, a new logger, set up ... | null | utils.py | utils.py | py | 1,268 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.NOTSET",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.Stream... |
349590768 | from reactor import component
from reactor import utils
from reactor.models.plugin import Plugin
from reactor.event import Event
import os
import logging
logger = logging.getLogger("EchoPlugin")
class EchoPlugin(Plugin):
def __init__(self):
Plugin.__init__(self, "@echo")
def ... | null | plugins/echo/echo.py | echo.py | py | 1,696 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "reactor.models.plugin.Plugin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "reactor.models.plugin.Plugin.__init__",
"line_number": 14,
"usage_type": "call"
},
{
... |
444925134 | """ Builds the time series cards and trend data for each company.
Time series card and trend card are dicts with tickr as keys and dataframes
as the value"""
import pandas as pd
import numpy as np
import pickle
import sys
sys.path.append("..")
import matplotlib.pyplot as plt
import seaborn as sns
... | null | EDA/build_time_trend_cards.py | build_time_trend_cards.py | py | 5,822 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.poly1d",
"line_numb... |
127535575 | import argparse, os
import torch
import math, random
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from loss import GeneratorLoss
from srgan import GeneratorMM,DiscriminatorMM
from torchvision ... | null | ours/super_resolution/SRResNet/scripts/eval_srresnet.py | eval_srresnet.py | py | 5,054 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.au... |
65757043 | import os
import glob
import tqdm
import random
import pandas as pd
path = "clear_threads/"
files = glob.glob(path+"*_*.tsv")
random.seed(42)
random.shuffle(files)
frames = []
counter = 0
for filein in tqdm.tqdm(files[:100000]):
counter += 1
df = pd.read_csv(filein, delimiter='\t', quoting=3, header=None,
... | null | preprocess.py | preprocess.py | py | 998 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 16... |
444800812 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
R = int('123')
R = int('123', base=8)
R = int('123', base=16)
R = int('123',16)
R = int('1000',2)
# --------------------
# def int2(x, base=2):
# return int(x,base)
# R = int2('111')
import functools
# 创建一个偏函数
# functools.partial
# 把一个函数的某些参数给固定住(也就是设置默认值),返回一个新的函数... | null | 4.函数式编程/偏函数.py | 偏函数.py | py | 547 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functools.partial",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 23,
"usage_type": "call"
}
] |
117834647 | """
Need to solve for equation 7 of Crossing Classified and Corrected Fewest Switches Surface Hopping paper.
H = E(ax[orbital]) ([orbital]+ E(-t[orbaital](k) (k+1 + k +1 [orbital)] + E((1/2)K(x^2)+m(v^2))
molecule is k
x is a vibrational degree of freedom
v is velocity
K is force constant amu/Pa*s^2
m is mass amu
t is... | null | MitchellStry/Homework/homework7.py | homework7.py | py | 3,050 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 45,... |
281880636 | from PyQt5.QtWidgets import QPushButton, QGroupBox, QVBoxLayout, QHBoxLayout, QStyle, QPlainTextEdit, QMessageBox, QCheckBox
from PyQt5.QtCore import QThread, pyqtSignal
from ultimatelabeling.models.tracker import SiamMaskTracker, KCFTracker
from ultimatelabeling.models import Detection, FrameMode
from ultimatelabeling... | null | ultimatelabeling/views/tracking_manager.py | tracking_manager.py | py | 6,491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtCore.QThread",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ultimatelabeling.models.FrameMode.CONTROLLED",
"line_number": 34,
"usage_type": "attribute"
... |
563438312 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 1 15:02:12 2018
@author: yumcyawiz
"""
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
#load digits dataset
digits = datasets.load_digits()
#average images
averages = []
aver... | null | 20180501kadai.py | 20180501kadai.py | py | 1,577 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
475806517 | # -*- coding:utf-8 -*-
"""
@project = 0526-1
@file = 9_1
@author = Liangjisheng
@create_time = 2018/5/26 0026 下午 15:37
"""
from bs4 import BeautifulSoup
import requests
url = 'https://www.safaribooksonline.com/topics/analytics?sortby=Date+Added&page=1'
# url = "http://shop.oreilly.com/category/browse-subjects/data.do?... | null | mycode/chapter9/9_1.py | 9_1.py | py | 689 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
567308063 | """
Example 08a: Create a classifier AInalysis
==========================================
Apart from being able to read and use AInalyses, PhenoAI also implements a module
to create new AInalyses from an existing estimator or to alter an existing
AInalysis. This module, the maker module, is used in this example to crea... | null | examples/ex08a_ainalysismaker_classifier.py | ex08a_ainalysismaker_classifier.py | py | 3,166 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.around",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 29,
"usage_type": "call"
},... |
604494758 |
from Bennu import Bennu
import numpy as np
import matplotlib.pyplot as plt
def Interal_verify():
lambda_0 = np.random.rand(1)
lambda_n = np.random.rand(Object.lambda_dim) * 2 - 1
costate_0 = np.hstack([lambda_0, lambda_n])
observation, ceq, done, info = Object.Fun_GetTraFromCostate(costate_0)
pr... | null | 10 Scipy/2 Integrate/1 Odeint/main.py | main.py | py | 1,257 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.rand",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
628631035 | import torch
import torch.nn as nn
class PositionEmbeddingLayer(nn.Module):
r"""Layer class of Position Embedding
Position Embedding was used in Personalized Re-ranking Model :title:`Changhua Pei et al, 2019`[1],
which is to add a trainable tensors per position to the session-based embedding features
... | null | torecsys/layers/ctr/position_embedding.py | position_embedding.py | py | 1,727 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
61933071 | import randomUs as ru
import sys
import pickle
import toricCode
import tensornetwork as tn
import numpy as np
import basicOperations as bops
import os
d = 2
M = int(sys.argv[1])
l = int(sys.argv[2])
option = sys.argv[3]
n = int(sys.argv[4])
if len(sys.argv) == 6:
dirname = sys.argv[5]
else:
dirname = 'results... | null | localVectors.py | localVectors.py | py | 1,290 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
648307140 | #!/usr/bin/env python3
# Copyright 2019 Andreas Traber
# Licensed under MIT (https://github.com/atraber/escapemgmt/LICENSE)
import datetime
from absl import app
from absl import flags
from backend import Backend
from booking import Booking
from word_press import WordPress
FLAGS = flags.FLAGS
flags.DEFINE_boolean('s... | null | bookings-import/app/import.py | import.py | py | 2,516 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_boolean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "absl.flags... |
385858316 | from torchvision import transforms
from torch.utils.data import Dataset, DataLoader
from PIL import Image
import glob
import torchvision
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
data_transfo... | null | mask_detect/NN_train.py | NN_train.py | py | 5,229 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": ... |
574094630 | from django import template
register = template.Library()
@register.assignment_tag
def voucher(voucher, with_cod):
def getVoucherNumber(vlist, n):
if n > 2:
# Suc / Num
return str(int(voucher[1])) + '-' + str(int(voucher[2]))
else:
# Num
return str(int(voucher[1]))
voucher = voucher.split(' ')
co... | null | website/templatetags/voucher.py | voucher.py | py | 464 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
}
] |
539111926 | import pygame
pygame.init()
windowX = 800
windowY = 600
win = pygame.display.set_mode((windowX,windowY))
pygame.display.set_caption("First Game")
tickRate = 10
trueTime = tickRate / 1000
black=(255,0,0)
x = 50
y = 50
xP = 0
yP = 0
meter = 60
mass = 2
width = 40
height = 60
dist = 5
tnr = pygame.font.SysFont('Tim... | null | mainGame.py | mainGame.py | py | 2,032 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
296833831 | # Author: Tomas Hodan (hodantom@cmp.felk.cvut.cz)
# Center for Machine Perception, Czech Technical University in Prague
# Calculates performance scores for the 6D localization task.
# For evaluation of the SIXD Challenge 2017 task (6D localization of a single
# instance of a single object), use this setting (TENTATIV... | null | tools/eval_loc.py | eval_loc.py | py | 10,978 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
237563756 | import poplib
from email import parser
from flufl.bounce import scan_message
from flufl.bounce import all_failures
import codecs
pop_conn = poplib.POP3_SSL('directservices.bg')
pop_conn.user("bnp_statements")
pop_conn.pass_("kajimida123")
#Get messages from server:
print (len(pop_conn.list()[1]) + 1)
messages = [pop_... | null | bnp statements/1 bnp ereports bounce checker 160331 start.py | 1 bnp ereports bounce checker 160331 start.py | py | 996 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "poplib.POP3_SSL",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "email.parser.Parser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "email.parser",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flufl.bounce.all_fail... |
15326987 | from __future__ import unicode_literals
from django.db import models
from django.dispatch import receiver
from gargoyle.signals import *
from ums.models import Profile
from ums.signals import *
from ocr.signals import *
from django.utils import timezone
from ipware.ip import get_ip
import json
import pickle
# Creat... | null | polaris/models.py | models.py | py | 4,517 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 19,
"usage_type": "call"
},
{
"api_n... |
613553306 | from django.conf import settings
from django.shortcuts import get_object_or_404
from app.models import Dish, Recipe
from app.mixins import CommonMixin
class DishMixin(CommonMixin):
def to_dict(self, row):
info = {
'description': row.description,
'image': settings.BASE_URL + row.im... | null | src/app/mixins/dish.py | dish.py | py | 1,512 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.mixins.CommonMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.BASE_URL",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usage_type": "name"
},
{
"api... |
378277118 | import networkit as nk
import numpy as np
from sklearn.metrics import pairwise_distances
from copy import deepcopy
def MST(ICT, position, centers):
new_ICT = deepcopy(ICT)
new_ICT.indexEdges()
dist = pairwise_distances(position)
####################
#new
####################
bc ... | null | BSc-thesis/External/ICT/reduce_to_mst.py | reduce_to_mst.py | py | 1,989 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "copy.deepcopy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise_distances",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkit.centrality.Betweenness",
"line_number": 17,
"usage_type": "call"
},
{
"... |
651101006 | #!/usr/bin/env python
# Author: John Hawkins (jsh) [really@gmail.com]
import itertools
import logging
import colorcet as cc
import matplotlib.pyplot as plt
import numpy as np
import os.path
import pandas as pd
import re
import seaborn as sns
import scipy.stats as st
import sys
from sklearn import decomposition
from s... | null | docs/20171205_lib2_ind/code/20180311.subspace_chem_nonbinary.py | 20180311.subspace_chem_nonbinary.py | py | 6,265 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.... |
441669892 | from . import SrcReader
import csv
import logging
class CSV(SrcReader):
def __init__(self, config):
super().__init__()
self.config = config['csv']
self.logger = logging.getLogger(__name__)
def __iter__(self):
self.csviter = iter(self._get_csvreader())
next(self.csviter... | null | migrator/src_readers/CSV.py | CSV.py | py | 1,164 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 40,
"usage_type": "call"
}
] |
603242218 | import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import models
from fairseq.models import register_model, register_model_architecture
from fairseq.models import BaseFairseqModel, roberta
from models.encoder.roberta import RobertaWrapper, base_architecture, large_architecture, small_arch... | null | models/composite_models/encoder_kbp37.py | encoder_kbp37.py | py | 1,836 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fairseq.models.BaseFairseqModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Lin... |
132395576 | from flask import Flask, jsonify, render_template
app = Flask(__name__)
@app.route('/')
def homepage():
return 'Hello World! 🌎'
@app.route('/greeting')
def greeting():
return render_template('index.html', value='Jamo')
pies = [
{
'flavor': 'Chocolate',
'type': 'Cream'
},
{
... | null | app.py | app.py | py | 713 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"l... |
590925156 | # Day 15 Part 2
from typing import List
def number_suffix(n: int) -> str:
""" Returns proper suffix (ex: 1 -> 1st, 2 -> 2nd)"""
dig = n % 10
if dig == 1:
return "st"
elif dig == 2:
return "nd"
elif dig == 3:
return "rd"
else:
return "th"
def play(arr: List[int]... | null | day-15/part-2.py | part-2.py | py | 1,692 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
}
] |
581326784 | from flask import render_template, flash, redirect, url_for, request, session
from ta_adoption import application
# from application import db
from .settings import app
from .models import *
from .my_functions import *
@application.route('/')
def index():
session['user'] = ''
return render_template('index.htm... | null | ta_adoption/views.py | views.py | py | 4,283 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.session",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ta_adoption.application.route",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ta_a... |
487644980 | from pathlib import Path
from typing import Optional
from fastapi import FastAPI
from fairseq.models.transformer import TransformerModel
import os
if "NS_NMT_MODEL_DIR" in os.environ:
models_dir = Path(os.environ["NS_NMT_MODEL_DIR"])
model = TransformerModel.from_pretrained(
str(models_dir),
chec... | null | main.py | main.py | py | 640 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "fairseq.models.transforme... |
88852469 | import sqlalchemy as sa
from psycopg2.errorcodes import UNIQUE_VIOLATION
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql.functions import now
from src.common.database import Database
from s... | null | src/common/base_model.py | base_model.py | py | 1,523 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.Column",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateTime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.sql.functions.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
309169045 | import numpy as np
import matplotlib.pyplot as plt
import random
import math
#S1 creacion de RNA --> kr
#S2 destroy de RNA --> (gr)*r
#S3 creacion de Proteina --> (kp)*r
#S4 destroy de Proteina --> (gp)*p
#Constantes RNA
kr = 1.0
gr = 1.0/5.0
#Constantes Proteina
kp = 70.0
gp = 1.0/30.0
#Numero de iteraciones
n ... | null | 2a.py | 2a.py | py | 1,352 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 42,... |
52375383 | import bottle
import model
result = 0
kolicina = ''
stevilo = 0
osnovna = ''
zelena = ''
@bottle.get('/')
def osnovna_stran():
return bottle.template('osnovna_stran.tpl')
@bottle.get('/pretvarjanje_mase/')
def pretvarjanje_mase():
global kolicina
kolicina = 'masa'
return bottle.templ... | null | pretvornik_enot.py | pretvornik_enot.py | py | 1,351 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bottle.template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bottle.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bottle.template",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bottle.get",
"line_num... |
547807859 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from builtins import range
from past.utils import old_div
import sys, os, glob
import logging
import numpy as np
import pylab as plt
from asamba import star, sampler
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... | null | asamba/plot_sampler.py | plot_sampler.py | py | 4,330 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pylab.subplots",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pylab.subplots_adjust",
... |
476612209 | # -*- coding: us-ascii -*-
"""Unit and regression tests for pyAirviro.edb's vehdb module."""
from __future__ import unicode_literals
from collections import OrderedDict
from pkg_resources import resource_stream
from pyAirviro.edb.vehdb import (
Vehicle,
VehicleSubstance,
VehicleStream
)
import pyAirviro.... | null | pyAirviro/tests/edb/test_vehdb.py | test_vehdb.py | py | 4,847 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyAirviro.tests.edb.ModelMixin",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pyAirviro.edb.vehdb.Vehicle",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyAirviro.edb.vehdb.Vehicle",
"line_number": 26,
"usage_type": "call"
},
{... |
159225258 | from __future__ import generators
from airflow import DAG
import logging
from presidio.builders.retention.retention_dag_builder import RetentionDagBuilder
from presidio.factories.abstract_dag_factory import AbstractDagFactory
from presidio.utils.decorators.ueba_flow_decorator import ueba_flow_decorator_wrapper
class... | null | presidio-core/presidio-workflows/presidio/factories/retention_dag_factory.py | retention_dag_factory.py | py | 1,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "presidio.factories.abstract_dag_factory.AbstractDagFactory",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "presidio.builders.retention.retention_dag_builder.RetentionDagBuilder",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.debug",
... |
333352833 | from collections import deque
from typing import Iterable, List, Set, Tuple
Position = Tuple[int, int]
def rev(t: tuple) -> tuple:
return tuple(reversed(t))
class Unit(object):
def __init__(self,
team: str,
position: Position,
hp: int=200, attack_power: int=3):
s... | null | 2018/15.py | 15.py | py | 5,270 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Tuple",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "typing.Set",
"line_number": 56,... |
166806929 | from . import web
from flask import render_template, abort
from aslo.persistence.activity import Activity
from aslo.service import activity as activity_service
@web.route('/')
def index():
activities = Activity.get_all()
return render_template('index.html', activities=activities)
@web.route('/<bundle_id>/<a... | null | aslo/web/views.py | views.py | py | 841 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "aslo.persistence.activity.Activity.get_all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aslo.persistence.activity.Activity",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "cal... |
384148892 | # Author: kk.Fang(fkfkbill@gmail.com)
__all__ = [
"OracleOnlineObjectIssueSequence"
]
from typing import Optional, Tuple
from collections import defaultdict
from mongoengine import StringField, EmbeddedDocumentField
import rule.const
from ... import const
from models.mongoengine import *
from .object import *
f... | null | oracle_cmdb/issue/object/sequence.py | sequence.py | py | 2,786 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "issue.issue.OnlineIssueOutputParams",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "mongoengine.StringField",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mongoengine.EmbeddedDocumentField",
"line_number": 30,
"usage_type": "call"
... |
588100669 | import os
import cv2
import time
import json
import threading
from os import walk
from PIL import Image
from flask_pymongo import PyMongo
from pymongo import MongoClient
from bson.objectid import ObjectId
from flask import (
Flask,
jsonify,
request,
redirect,
Response,
render_template,
u... | null | ProjectV4/app.py | app.py | py | 12,384 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "flask.render_template... |
325653745 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('MyANSRSource', '0099_projecttype_active'),
]
operations = [
migrations.AlterField(
model_name='projectteammember... | null | MyANSRSource/migrations/0101_auto_20151124_1137.py | 0101_auto_20151124_1137.py | py | 536 | python | en | code | null | code-starcoder2 | 83 | [
{
"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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
92826470 | import threading
import logging
import random
import time
from regionCondicional import *
logging.basicConfig(format='%(asctime)s.%(msecs)03d [%(threadName)s] - %(message)s', datefmt='%H:%M:%S', level=logging.INFO)
class miRecurso (Recurso):
dato1 = 0
numLectores = 0
informacion = miRecurso()
def condicio... | null | Ejercicio1-MyVersion.py | Ejercicio1-MyVersion.py | py | 1,491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
537490671 | from __future__ import unicode_literals
from decimal import Decimal
import glob
import os
import re
import sys
import json
if sys.version_info[:2] < (2, 7): # pragma: no cover
import unittest2 as unittest
else:
import unittest
try:
from unittest import mock
except ImportError:
import mock
from jsons... | null | tests.py | tests.py | py | 18,336 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.version_info",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "jsonschema.validate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "jsonschema.ValidationError",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name"... |
581183142 | import requests
import time
import sys
import json
headers = {"User-Agent": "MyMusicalHistory/0.0.1 ( goktugercegurel@gmail.com )"}
pause_duration = 1.1
pause_exceeded = 2
def make_request(url, headers=headers):
time.sleep(pause_duration)
try:
response = requests.get(url, headers=headers)
except ... | null | geolocations/request_utils.py | request_utils.py | py | 1,125 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
... |
279850770 | ##
## Requirements:
## VBox => Core Audio ICH AC97
## Ubuntu Text To Speech:
## apt-get install gnustep-gui-runtime
##
## $ source venv/bin/activate
##
import os
import json
import requests
import time
from datetime import datetime
convert = 'USD'
listings_url = 'https://api.coinmarketcap.com/v2/listings/?co... | null | coincap_p2.py | coincap_p2.py | py | 1,739 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",... |
244855813 | import sys
sys.path.insert(0, '..')
sys.path.insert(0, '.')
import auxiliarymethods.datasets as dp
import preprocessing as pre
import os.path as osp
import numpy as np
import torch
from torch.nn import Sequential, Linear, ReLU
from torch_geometric.nn import GINConv, Set2Set
from torch_geometric.data import InMemoryD... | null | neural_higher_order/Alchemy/malkin_2_10K.py | malkin_2_10K.py | py | 15,287 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
520122386 | from django.shortcuts import render
from rest_framework import serializers
from events.models import Events
class EventListSerializer(serializers.ModelSerializer):
class Meta:
model = Events
fields = [
'id',
'title',
'description',
'location',
'datetime'... | null | api/serializers.py | serializers.py | py | 351 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "events.models.Events",
"line_number": 7,
"usage_type": "name"
... |
414678779 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
migrations.swappable_dependency(settings.AU... | null | profiles/migrations/0001_initial.py | 0001_initial.py | py | 3,111 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 13,
"usage_type": "call... |
69275435 | from setuptools import setup
dependencies = [
"blspy==1.0.5", # Signature library
"chiavdf==1.0.2", # timelord and vdf verification
"chiabip158==1.0", # bip158-style wallet filters
"chiapos==1.0.4", # proof of space
"clvm==0.9.7",
"clvm_rs==0.1.10",
"clvm_tools==0.4.3",
"aiohttp==3.... | null | setup.py | setup.py | py | 4,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 122,
"usage_type": "call"
}
] |
491133942 | import json
from pprint import pprint
class CmdLoader():
def __init__(self):
pass
def getCommands(self, file, path):
cmds = self.registerCommands(file)
commands = {}
for cmd in cmds:
commands = self.addJSONCommand(path + "\\" + cmd + ".json", commands)
return commands
def getParams(self, file, path... | null | CommandRegistrar.py | CommandRegistrar.py | py | 1,009 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 39,
"usage_type": "call"
}
] |
48590820 | #!/usr/bin/python
#
# -------- Covariance.py ---------------------------------------
# Description: repeatedly fill a histogram with 10000 uniformly
# distributed random numbers and study distributions
# and correlations of bin contents.
# Author: G. Quast Nov. 2013
# dependencie... | null | PycharmProjects/CGDA/Blatt 5/Nr.2.py | Nr.2.py | py | 2,841 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.around",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.special.binom",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.special",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.around",
"li... |
228141575 | '''V4壁球小游戏伸缩版_图标版_最小化感知版
添加Esc按键响应 line 51
添加窗体更改事件响应实现窗体调节 line 57
添加窗体小图标 line 28
感知最小化,最小化后暂停移动 line 70
按F1实现全屏
'''
# 框架---1.引入pygame库及sys库
import pygame, sys
# 框架---2.初始化initial()及设置
pygame.init()
vInfo = pygame.display.Info()#获取当前屏幕分辨率返回值中vInfo.current_w, vInfo.current_h分别表示当前窗口的宽和高
size = width, ... | null | WallBall_Game/WallBall_V4.py | WallBall_V4.py | py | 4,559 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display.Info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.se... |
373280287 | import os
from decouple import config
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
... | null | project/risset/settings.py | settings.py | py | 5,191 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line... |
555469858 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/symath/factor.py
# Compiled at: 2015-08-21 11:58:24
import symath, memoize
@memoize.Memoize
def is_factor(x, y):
"""
return T... | null | pycfiles/symath-0.1.25-py2.7/factor.py | factor.py | py | 1,503 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "symath.wilds",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "symath.WildResults",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "symath.Number",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "memoize.Memoize",
... |
528151379 | import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import pickle
def addvalue(dict,key,value,epoch):
if not key in dict.keys():
dict[key]=[[value]]
else:
if epoch > len(dict[key])-1:
dict[key].append([value])
else:
... | null | core.py | core.py | py | 1,872 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_nam... |
24580187 | import re
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
from email_validator import validate_email, EmailNotValidError
# Check username
def validate_username_check(username):
username = username.lower().strip(... | null | id/validators.py | validators.py | py | 1,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.search",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 17,
"usage_type": "call"
},
{... |
211590859 | import numpy as np
import math
import cosmolopy.distance as cd
import cosmolopy.perturbation as cp
import scipy.integrate as integrate
import matplotlib.pyplot as plt
from cosmolopy.perturbation import fgrowth
from scipy import interpolate
def angpowspec_without_k(i,redshift):
return integrate.quad(lambda x: np.... | null | For_thesis/err-comp-gaussian-poisson-both/Trash/Full_plot/Trash/backup_integration_with_error_plot_k_upto_1_l_upto_5000_N4.py | backup_integration_with_error_plot_k_upto_1_l_upto_5000_N4.py | py | 4,823 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.integrate.quad",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.integrate",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.power",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.interp",
"... |
194679781 | import numpy as np
import time
import argparse
import pyflow
import cv2
def flow(im1, im2, write_path_rgb=None, write_path_npy=None):
im1 = im1.astype(float) / 255.
im2 = im2.astype(float) / 255.
# Flow Options:
alpha = 0.012
ratio = 0.5
minWidth = 20
nOuterFPIterations = 5
nInnerFPIterations = 1
nSORIter... | null | calcFlow.py | calcFlow.py | py | 1,029 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyflow.coarse2fine_flow",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
... |
426003456 | # ratings GUI
# by a-colabella & havoc17
from openpyxl import worksheet
from openpyxl import load_workbook
# Weights for duel/gf scores
duel_weight = .05
gf_weight = 1 - duel_weight
# a Player
class Player:
username = ''
duel = 0
gf = 0
w_av = 0
pred_rank = 0
real_rank = 0
def __init_... | null | ratings.py | ratings.py | py | 1,071 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 26,
"usage_type": "call"
}
] |
205907425 | from django.conf.urls import url
from .views import HomePageView, EvaluationPageView, ImageEvaluation, EmailCollectView, EvaluationSaveView, \
EmailAPIView, ReadyView, SorryView
urlpatterns = [
url(r'^$', HomePageView.as_view()),
url(r'^evaluation/(?P<eval>\w+)$', EvaluationPageView.as_view()),
url(r'... | null | evaluator/urls.py | urls.py | py | 655 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.HomePageView.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.HomePageView",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "djang... |
146067891 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
def fix_countries(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version... | null | addressbook/migrations/0003_auto_20150903_2241.py | 0003_auto_20150903_2241.py | py | 1,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 28,
"usage_type": "call"
},
... |
555670916 | import requests, bs4, webbrowser
def getLink(url):
p='http://'
link = p + url
return link
#webbrowser.open(link)
page = 'www.fundamentus.com.br'
res = requests.get(getLink(page))
type(res)
print (res.status_code)
print (res.text)
| null | using-request.py | using-request.py | py | 239 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
503367936 | #!/usr/bin/env python3
import socket
import sys
import os
import json
import time
import serial
import availablePorts
import argparse
DATA_AMOUNT = 1024
MAXLINE = 40
def getArgs():
parser = argparse.ArgumentParser(prog=sys.argv[0])
parser.add_argument('-p','--port',type=int,default=10000,dest='port',help... | null | software/GIS_Project/server.py | server.py | py | 8,495 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"li... |
393981335 | import numpy as np
import pandas as pd
import lmfit
import json
with open("config.json") as config_file:
config = json.load(config_file)
def linear(t, c, m):
return(c + m * t)
def single_exponential(t, c, a, tau, m):
return(c - a * (np.exp(-t/tau)) + m*t)
def double_exponential(t, c, a, tauA, b, tauB... | null | y_position/generalYPosition/yPerCalo.py | yPerCalo.py | py | 5,702 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lmfit.Model",
"line_number": 28,
... |
601271971 | import requests
from bs4 import BeautifulSoup
import re
import pickle
def main():
url = 'https://www.businesswire.com/portal/site/home/template.PAGE/news/'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
divs = soup.find_all('div', {'itemtype':'http://schema.org/NewsArticle'})
# finds... | null | newssearch.py | newssearch.py | py | 1,943 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
}
] |
13718058 | import pygame
pygame.init() # 초기화
# 화면크기 설정
screen_width = 480 # 가로
screen_hight = 640 # 세로
screen = pygame.display.set_mode((screen_width, screen_hight))
# 화면 타이틀
pygame.display.set_caption("GS game")
# 배경이미지 불러오기
background = pygame.image.load("C:\\pythonWorkspace\\pygame_basic\\background.png") # \ 하나는 탈출문자 (개행... | null | pygame_basic/2_background.py | 2_background.py | py | 955 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
56830039 | #==============================================================================
#
# This module is designed to contain functions useful for generating plots
# from the PyReshaper timing JSON files. The JSON data file is assumed to
# be structured in the nested order:
#
# { DATASET: { ...,
# 'results':... | null | tests/yellowstone/utilities/plottools.py | plottools.py | py | 21,750 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rc",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.switch_backend",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "date... |
201881279 | from typing import Tuple
import numpy as np
from batchgenerators.utilities.file_and_folder_operations import *
from nnunetv2.evaluation.evaluate_predictions import load_summary_json
from nnunetv2.paths import nnUNet_results
from nnunetv2.utilities.dataset_name_id_conversion import maybe_convert_to_dataset_name, conve... | null | nnunetv2/batch_running/release_trainings/nnunetv2_v1/collect_results.py | collect_results.py | py | 5,680 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nnunetv2.paths.nnUNet_results",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "nnunetv2.utilities.dataset_name_id_conversion.maybe_convert_to_dataset_name",
"line_number": 16,
... |
581735392 | import unittest
from google.appengine.ext import db
from google.appengine.ext import testbed
from greeting import Greeting
class MyTestCase(unittest.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
def tearDown... | null | test/testGreeting.py | testGreeting.py | py | 1,093 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.testbed.Testbed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.testbed",
"line_number": 10,
"usage_type": "name"
},
... |
477006713 | #Visualization
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from sklearn.decomposition import PCA
import matplotlib; matplotlib.use("TkAgg")
from sklearn import cluster
import plotly
import plotly.graph_objects as go
fr... | null | group3-NBA-player-analysis-master/src/visualization/grapher.py | grapher.py | py | 4,048 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",... |
600393658 | #-*- encoding:UTF-8 -*-
__author__ = 'kejun'
# create Datetime: 15-7-24 下午4:13
import wx
def log_error(self, message):
dlg = wx.MessageDialog(self, message.decode("utf-8"), '错误'.decode("utf-8"), wx.ICON_WARNING)
dlg.ShowModal()
dlg.Destroy()
def log_question(self,message):
dlg = wx.MessageDialog(None,... | null | AssessTool/Modules/WXHelper.py | WXHelper.py | py | 848 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "wx.MessageDialog",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wx.ICON_WARNING",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wx.MessageDialog",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wx.YES_NO",
... |
282242091 | ## Import Modules
import os, pygame, random, math
## put commonly used in global namespace
from pygame.locals import *
from general import *
from localdata import *
class Drone(pygame.sprite.Sprite):
def __init__(self,x_offset,y_offset,side,ptr):
pygame.sprite.Sprite.__init__(self)
self.image, sel... | null | drones.py | drones.py | py | 5,213 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.