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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
93846096 | import pandas as pd
import numpy as np
import sklearn
from sklearn.metrics import r2_score, mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
# Import dataset to panda data frame
dataset = pd.read_excel("data1.xlsx")
pd.set_option('displ... | null | RandomForestAlgorithmMimi.py | RandomForestAlgorithmMimi.py | py | 3,120 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 58,
"usage_type": "call"
},
{
"api_... |
319224084 | """
Implements various bag-distance metrics
"""
import numpy as np
class EMD(object):
def __init__(self):
from emd import emd
self.emd = emd
def __call__(self, B, C):
return np.array([[self.emd(X, Y) for Y in C]
for X in B])
class KernelEMD(object):
def ... | null | src/distances.py | distances.py | py | 1,163 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "emd.emd",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "emd.emd",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 27,
... |
382469520 | #!/usr/bin/env python3
"""Fetch and display canteen plans."""
import re
import requests
import sys
CANTEENS = [
('Studhaus',
'http://speiseplan.studierendenwerk-hamburg.de/de/310/2016/{}/'),
('Philturm',
'http://speiseplan.studierendenwerk-hamburg.de/de/350/2016/{}/'),
('Stellingen',
'http:/... | null | WISE 17:18/SE2/ComfyCodeSnippets/mensa_plain.py | mensa_plain.py | py | 2,669 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_nu... |
578890292 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 17:54:53 2019
@author: robert
"""
from PyQt5 import QtCore, QtGui, uic
from PyQt5.QtCore import (pyqtSlot, QThread, pyqtSignal)
from PyQt5.QtGui import (QPixmap, QImage)
from PyQt5.QtWidgets import QLabel
import numpy as np
import threading
impo... | null | windows/KA3005P.py | KA3005P.py | py | 5,027 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
585675913 | import pickle
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import defaultdict
# Custom imports
import sys
sys.path.insert(0, "../")
from models.classifier import ChainedClassifier
from attacks import GradientPerturbation, cross_entropy_loss
from... | null | scripts/sample_grad.py | sample_grad.py | py | 4,832 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.se... |
100697890 | # coding: utf-8
# ライブラリのインポート
import pandas as pd
from janome.tokenizer import Tokenizer
from collections import Counter, defaultdict
# 自作APIの読み込み
from modules import read_from_csv
from modules import exclude_keywords
from modules import frequent_words
from modules import word_count
from modules import barchart
from ... | null | modules/preprocessing.py | preprocessing.py | py | 2,024 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "modules.read_from_csv.run",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "modules.read_from_csv",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "modules.frequent_words.run",
"line_number": 52,
"usage_type": "call"
},
{
"api_na... |
647287036 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# export OCSSWROOT=/data/ocssw && source $OCSSWROOT/OCSSW_bash.env
# update_luts.py -v terra
# update_luts.py -v aqua
# update_luts.py -v viirsn
#
# ./afai_wrapper.py --sensor aqua --dateini 2018-08-10 --step download
# ./afai_wrapper.py --sensor aqua --dateini 2018-08-10 --s... | null | pysimar/afai_wrapper.py | afai_wrapper.py | py | 7,679 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 49,
"usage_type": "call"
},
{
"api_name"... |
187666983 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright 2019, GeoSolutions Sas.
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE.txt file in the root directory of this source tree.
#
#############################... | null | src/geoserver/catalog.py | catalog.py | py | 57,292 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.decoder.JSONDecodeError",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 85,
"usage_type": "argument"
},
{
"api_name": "s... |
133310635 | from django.db import models
from order.models import order
# Create your models here.
class comment(models.Model):
owner_star = models.IntegerField(verbose_name="主人评分",null=True,blank=True,default=5)
owner_text = models.TextField("主人评价内容",null=True,blank=True,default="")
order = models.OneToOneField(verbo... | null | comment/models.py | models.py | py | 902 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.IntegerField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name"... |
48934432 | import numpy as np
import itertools
regra=30
kernel=np.random.randint(2, size=(3,3))
def cellular_automaton():
global kernel
lista=[0,1]
kernel=np.pad(kernel, (1, 1), 'constant', constant_values=(0))
q12=np.array([p for p in itertools.product(lista, repeat=3)])[::-1]
uau12 = np.zeros(q12.shape[... | null | Cellular_Automata/CA_Kernel_Binary.py | CA_Kernel_Binary.py | py | 982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.randint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.pad",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
223921492 | import airflow
from airflow import DAG
from airflow.decorators import dag, task
from airflow.utils.dates import days_ago
from datetime import datetime, timedelta
import tweepy
import re
import pandas as pd
import numpy as np
from datetime import datetime
import json
import glob2
import pymongo
url = "mongodb://127.0.0... | null | dags/coleta_tt-01.py | coleta_tt-01.py | py | 3,502 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "glob2.glob",
"... |
537104923 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 1 14:58:16 2019
@author: nvthaomy
"""
"""Performing widom insertion for NVT
Output: new trajectory with inserted particle"""
from itertools import islice
import numpy as np
import argparse, os
import sys
parser = argparse.ArgumentParser()
parser... | null | widom/getWidomTraj.py | getWidomTraj.py | py | 4,206 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "mdtraj.load",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.mod",
"line... |
522034327 | import base64
from time import sleep
from unittest import TestCase
from pbx_gs_python_utils.utils.Dev import Dev
from osbot_browser.browser.sites.Web_Jira import Web_Jira
class test_Web_Jira(TestCase):
def setUp(self):
self.headless = True
self.result = None
self.png_data = None
... | null | test_QA/browser/sites/test_Web_Jira.py | test_Web_Jira.py | py | 1,468 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "osbot_browser.browser.sites.Web_Jira.Web_Jira",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pbx_gs_python_utils.utils.Dev.Dev.pprint",
"line_number": 21,
"usage_type... |
222619009 | from django.conf.urls import patterns, url
from views import *
urlpatterns = patterns('asset_portal.views',
url(r'^assets/$', AssetListView.as_view(), name='asset-list'),
url(r'^assets/add/$', AssetCreateView.as_view(), name='asset-create'),
url(r'^assets/(?P<slug>[-_\w]+)/$', AssetDetailView.as_view(), ... | null | asset_portal/urls.py | urls.py | py | 2,061 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "djan... |
373274835 | #%%
from numpy import pi, linspace, sin
from scipy import signal
import matplotlib.pyplot as plt
T = 1 #Περίοδος
f = 1 / T #Συχνότητα
t = linspace(-2, 2, 4000) #Αρχικοπο... | null | Fourier Series/tilecomunications_ex1.py | tilecomunications_ex1.py | py | 2,750 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.signal.square",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_n... |
546161749 | import os, sys, warnings, multiprocessing
from tqdm import tqdm
import scipy.io.wavfile
import soundfile as sf
import pandas as pd
import numpy as np
from scipy.stats import skew, kurtosis
import rpy2.robjects as robjects
import rpy2.robjects.numpy2ri
import rpy2.robjects.pandas2ri
rpy2.robjects.numpy2ri.activate()
rp... | null | process_input.py | process_input.py | py | 8,857 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rpy2.robjects.robjects.numpy2ri.activate",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.robjects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rpy2.robjects",
"line_number": 12,
"usage_type": "name"
},
{
... |
311536426 | from . import auth
from .forms import LoginForm, RegistrationForm, PasswordResetForm, ChangePasswordForm, ProfileForm
from flask_login import login_required,login_user,current_user,logout_user
from ..models.auth import User
from flask import redirect,render_template,flash,url_for,request
from .. import db
from ..email ... | null | app/auth/views.py | views.py | py | 3,839 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.LoginForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.auth.User.query.filter_by",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
511959235 | from django.test import TestCase
from core.forms import RITSForm
from core.models import get_rits_choices
class RITSFormTestCase(TestCase):
def test_python_prohibited(self):
test_body = {
'name': 'Test RITS',
'transformation_type': 'python',
}
form = RITSForm(test_... | null | tests/test_forms/test_rits_form.py | test_rits_form.py | py | 1,191 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "core.forms.RITSForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "core.forms.RITSForm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "core.mode... |
31386389 | #!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 1/19/15
###Function: (France data) Total estimated incidence per 100,000 vs. week number normalized by the first 'gp_normweeks' of the season.
###Import data: Documents/FRANCE_ILI_DATA_2014/inc2_inc-... | null | scripts/create_fluseverity_figs_v5/FR_incid_time_v5.py | FR_incid_time_v5.py | py | 2,436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "functions_v5.pseasons",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "functions_v5.gp_fluweeks",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "f... |
465197307 | import time
import logging
def retry(max_retries=5, delay=10):
LOGGER = logging.getLogger(__name__)
if max_retries < 1:
raise Exception("max_retries must be greater than 0")
def decorator(func):
def wrapper(*args, **kwargs):
retries = 0
last_exception = Exception(... | null | tests/ats/decorators.py | decorators.py | py | 755 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
}
] |
371125571 | """
Created on Tue Nov 10 17:41:55 2020
@author: dustin
"""
import math
from scripts.settings import screen_resolution
class Circle:
"""The Circle-class"""
def __init__(self, coord, radius, color, surface, angle, speed):
self.coord = coord
self.radius = radius
self.diameter = radius... | null | scripts/circle.py | circle.py | py | 3,136 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math.cos",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pygame.draw.draw.circle",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pygame.draw.draw",
"lin... |
274597162 | # データ生成の基礎クラス
# データ取得、データ保存
from modules.jrdb_transform_before_race import BEFORE_RACE
from modules.jrdb_transform_after_race import AFTER_RACE
from modules.jrdb_transform_after_raceuma_ml import AFTER_RACEUMA_ML
from modules.jrdb_sql import JrdbSql
class JrdbTransform(object):
def __init__(self):
self.sq... | null | modules/jrdb_transform.py | jrdb_transform.py | py | 4,277 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "modules.jrdb_sql.JrdbSql",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "modules.jrdb_transform_before_race.BEFORE_RACE",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "modules.jrdb_transform_after_race.AFTER_RACE",
"line_number": 49,
... |
484724782 | import copy
import datetime
import os
import re
import sys
import tempfile
from httpretty import HTTPretty, httprettified
from pyelastictest import IsolatedTestCase
from monolith.aggregator.exception import RunError
from monolith.aggregator.extract import extract, main
from monolith.aggregator.plugins import extract ... | null | monolith/aggregator/tests/test_extract.py | test_extract.py | py | 5,746 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.date.today",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "monolith.aggregator.plugins.Plugin",
"line_number": 24,
"usage_type": "name"
},
{
"api_nam... |
130869273 | # -*- coding: utf-8 -*-
import requests
import urllib.request
from bs4 import BeautifulSoup
import os
import re
import time
url_base = 'http://i.shipxy.com/Content/images/'
headers = {'User-Agent': 'Mozilla/5.0'}
zfiles = ''
with open('../tupan.css','r', encoding='UTF-8') as f:
for l in f:
zfiles += ... | null | codes/components/spyder1.py | spyder1.py | py | 943 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number... |
468240195 | from __future__ import absolute_import
from os import environ, urandom
from django.core.exceptions import ImproperlyConfigured
from .base import *
import dotenv
dotenv.read_dotenv()
TESTING = os.sys.argv[1:2] == ['test']
if TESTING:
raise SystemExit('Use a testing settings file')
def get_env_setting(setting... | null | settings/staging.py | staging.py | py | 2,017 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dotenv.read_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.sys",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.core.exceptions.Impr... |
96492267 | import logging
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
class PendulumEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 30
}
def __init__(self, g=10.0, max_speed=np.inf, max_torque=np... | null | MP1/lqr/envs/pendulum.py | pendulum.py | py | 4,375 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gym.Env",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_num... |
217277396 | import sys
import os
sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..')))
from ingestion.VideoInp_DataSet import VideoInp_DataSet
from os import listdir
from os.path import join, isfile
import torch
import random
import configs.folder_structure as folder_structure
from utils.data_io import read_mask, r... | null | ingestion/videoInp_DataSet_multiscale.py | videoInp_DataSet_multiscale.py | py | 6,588 | python | en | code | null | code-starcoder2 | 83 | [
{
"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... |
121518386 | import inspect
import fnmatch
import importlib
import os
import re
import sys
import copy
from dataclasses import dataclass
from typing import Any, Callable
from .utils import (dict_generator, intercept_arguments, nested_get,
nested_set, safe_nested_set)
delimiter = '/'
wildcard_list = ['*', '?', ... | null | pygears/conf/registry.py | registry.py | py | 7,572 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "inspect.signature",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "utils.intercept_arguments",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "utils.intercept_arguments",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": ... |
59689834 | """Airbrake object to handle airbrake.io reporting."""
import inspect
import json
import logging
import platform
import sys
import traceback
import urlparse
import requests
LOG = logging.getLogger(__name__)
class Airbrake(object):
"""
Class to handle exceptions that need to be sent to airbrake.io
The p... | null | airbrake/airbrake.py | airbrake.py | py | 9,575 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "platform.python_version",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "platform.platform",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "urlpars... |
569158331 | """
module for creating sqs widgets
"""
import boto3
from .lookups import sqs_queues
from .constants import positioning
def create_sqs_widgets(region, deploy_stage):
"""
Creates the list of SQS widgets.
:param region: Typically 'us-west-2'
:param deploy_stage: The deploy tier, DEV, TEST, QA, PROD-E... | null | cloudwatch_monitoring/sqs.py | sqs.py | py | 5,610 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "constants.positioning",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "constants.positioning",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "constants.positioning",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "con... |
175837021 | import csv, sqlite3, numpy
import pandas as pd
con = sqlite3.connect(":memory:")
cur = con.cursor()
#raiz = ['Spitzer','Herschel','Identity','NIR','optical','position']
raiz = ['NIR']
to_db = 'Sucanes_tst.db'
for i in raiz:
csvname = i+'_6objects.csv'
df = pd.read_csv(csvname,',')#,columns=None)
'''columns... | null | csv2sqlite.py | csv2sqlite.py | py | 1,489 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
}
] |
98037398 | import json
import urllib2
from apps.tweets.models import Tweet
class TweetFetchingService(object):
SERVICE_ENDPOINT = 'http://adaptive-test-api.herokuapp.com/tweets.json'
@classmethod
def _get(cls, url):
request = urllib2.urlopen(cls.SERVICE_ENDPOINT)
contents = request.read()
... | null | www/apps/tweets/services.py | services.py | py | 1,417 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib2.urlopen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "apps.tweets.models.Tweet",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib2.HTTPError",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "json.... |
156888477 | from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QListView, QWidget, QHBoxLayout, QVBoxLayout, QLineEdit, QComboBox, QCheckBox, QApplication
from mediaCenter_lib.gui.media_info import MediaInfo
from mediaCenter_lib.gui.menu import VideoMenu
class SearchHeader(QWidget):
... | null | mediaCenter_lib/gui/medialibrary.py | medialibrary.py | py | 5,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "name"
},
{
"a... |
75372915 | from django.utils.translation import ugettext as _
from django.db.models import SmallIntegerField
from django.db import models
DAY_OF_THE_WEEK = {
'Monday' : _(u'Monday'),
'Tuesday' : _(u'Tuesday'),
'Wednesday' : _(u'Wednesday'),
'Thursday' : _(u'Thursday'),
'Friday' : _(u'Friday'),
'Saturday' ... | null | workshop/dayfield.py | dayfield.py | py | 959 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.utils.translation.ugettext",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext",
"line_number": 8,
"usage_type": "ca... |
554059268 | import pytest
from datetime import datetime
from django.core.management import call_command
from django.utils.timezone import get_current_timezone
from fobi.models import FormElementEntry
from users.models import JustSpacesUser
from surveys.models import SurveyFormEntry
from pldp.models import Location, Agency, Study,... | null | tests/conftest.py | conftest.py | py | 5,891 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.management.call_command",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pldp.models.Agency.objects.create",
"line_number": 22,
"usage_type": "call"
},
{
... |
484873365 | import datetime
today = datetime.datetime.now().strftime('%Y-%m-%d')
file_header = """
---
layout: post
title: {title}
date: {date}
preview_img:
description:
published: false
---
"""
def validate_file_name(string):
if len(string) < 5:
print('Filename must be longer than 5 symbols')
return False
... | null | create_post.py | create_post.py | py | 805 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 3,
"usage_type": "attribute"
}
] |
343883079 | # coding: utf-8
import random
import multiprocessing
import numpy as np
from chainer import cuda
import utils
def retrieve_sequence_replay_index(d, length):
tmp_episode_end_flags = d[4].T[0].copy()
indices = [i for i in range(len(tmp_episode_end_flags)) if tmp_episode_end_flags[i]]
indices.insert(0, -1)
... | null | agent/ml/experience.py | experience.py | py | 11,463 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_n... |
566945317 | import os
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import pycountry
def get_dataset_dir():
return f"{os.path.dirname(os.path.dirname(__file__))}/dataset"
def get_raw_dataset_path():
return f"{get_dataset_dir()}/comtrade.csv"
def get_raw_dataset_df():
return pd.read_csv(get_r... | null | customscripts/utils.py | utils.py | py | 6,090 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
373460249 | """
Original EmailParser Code by Ian Lewis:
http://www.ianlewis.org/en/parsing-email-attachments-python
Licensed under MIT
"""
from datetime import datetime
import time
from StringIO import StringIO
from email.Header import decode_header
from email.Parser import Parser
from email.utils import parseaddr, parsedate_tz,... | null | froide/helper/email_utils.py | email_utils.py | py | 5,123 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "imaplib.IMAP4_SSL",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "email.Header",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "email.Header",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "StringIO.StringIO",
"... |
570335149 | # -*- coding: utf-8 -*-
import itchat, time, re
from itchat.content import *
from utilities import *
from sys import argv, exit
from GlobalTextHook import GlobalTextHook
from PaiDuiHook import PaiDuiHook
from HistoryRecorder import HistoryRecorder
from GroupTagCloud import GroupTagCloud
from ShenMeGui import ShenMeGui
... | null | main.py | main.py | py | 2,360 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "itchat.auto_login",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "HistoryRecord... |
517649311 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 9 23:43:54 2019
@author: sarahpell
"""
#following guide from:
#https://stackabuse.com/text-generation-with-python-and-tensorflow-keras/
# from keras import backend as K
# K.clear_session()
import numpy
import sys
from keras.models import Sequentia... | null | recipe_generator.py | recipe_generator.py | py | 3,620 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.asarray",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 27,
... |
24731137 | import cPickle
import logging
import multiprocessing
import os.path as osp
import numpy
from smqtk.algorithms.nn_index import NearestNeighborsIndex
from smqtk.utils.file_utils import safe_create_dir
try:
import pyflann
except ImportError:
pyflann = None
__author__ = "paul.tunison@kitware.com"
class Flann... | null | python/smqtk/algorithms/nn_index/flann.py | flann.py | py | 14,758 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "smqtk.algorithms.nn_index.NearestNeighborsIndex",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 114,
"usage_type": "name"
},
{
"api_nam... |
340097 | from vic.loss import CharbonnierLoss, GANLoss, GradientPenaltyLoss, HFENLoss, TVLoss, GradientLoss, ElasticLoss, RelativeL1, L1CosineSim, ClipL1, MaskedL1Loss, MultiscalePixelLoss, FFTloss, OFLoss, L1_regularization, ColorLoss, AverageLoss, GPLoss, CPLoss, SPL_ComputeWithTrace, SPLoss, Contextual_Loss
from vic.filters ... | null | main.py | main.py | py | 21,949 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": ... |
427912480 | #!/usr/bin/env python
# encoding:utf-8
import sys
import hmac
import json
import time
import base64
import hashlib
import requests
api_url = 'http://127.0.0.1:5006/send/'
SIGNATURE_KEY = 'YzI2NjBlOGZmYzk5MmZhYzU4YzA1MGVk'
templateId = 2007
if len(sys.argv)!=2:
print('usage: python sdk.py 18800000000')
sys.e... | null | sdk.py | sdk.py | py | 861 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": ... |
474809276 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Download script to download and cache feeds and indices.
:copyright: © 2020 by Mac Gaulin
:license: MIT, see LICENSE for more details.
"""
# Stdlib imports
import os
import re
# import tarfile
import logging
import datetime as dt
# 3rd party imports
# Module Imports... | null | pyedgar/downloader.py | downloader.py | py | 3,856 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyedgar.config.KEEP_ALL",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "pyedgar.config",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "re.comp... |
533756534 | import matplotlib.pyplot as plt
import numpy as np
from numpy import genfromtxt
#from pylab import polyfit
from scipy.stats import linregress
import pandas as pd
import sys
progress_file = sys.argv[1]
fitness_file = sys.argv[2]
epochs_file = sys.argv[3]
generated_file = sys.argv[4]
v1 = genfromtxt(progress_file)
#v2... | null | visualization/plot_progress.py | plot_progress.py | py | 2,925 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
116511140 | import main
from google.appengine.ext import ndb
class DbFable(ndb.Model):
title = ndb.StringProperty()
ready = ndb.BooleanProperty()
bought = ndb.BooleanProperty()
@staticmethod
def create(user_db, fable_title):
""" Create a new DbFable for user """
main.log('Creating NE... | null | src/db.py | db.py | py | 3,676 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 7,
"usage_type": "cal... |
565925393 | import re
import time
import requests
import itchat
class JdItem():
def __init__(self,j_id,wid):
self.j_id = j_id
self.wid = wid
self.date_price = {}
self.price_list = []
def get_title(self):
url = 'https://item.jd.com/%s.html'%(str(self.j_id))
... | null | jd_item.py | jd_item.py | py | 1,561 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": ... |
489861275 | import subprocess
import subproc_custom
from halo import Halo
from config import config_Globals as cfg
class func_Globals:
log = ()
class fragile(object):
class Break(Exception):
"""Break out of the with statement"""
def __init__(self, value):
self.value = value
def __enter__(self):
... | null | functions.py | functions.py | py | 4,050 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.config_Globals.load",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.config_Globals",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "config.config_Globals.load",
"line_number": 26,
"usage_type": "attribute"
},
{
... |
3418774 | #This game was created and developed by ---Dia Abujaber---
#copyright:-
#background song goes to https://www.youtube.com/watch?v=UwAzXBCCQrQ&t=360s
import pygame
from settings import Settings
import game_functions as gf
from ship import Ship
from pygame.sprite import Group
from game_stats import Stats
from animation ... | null | space_vikers.py | space_vikers.py | py | 2,132 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_ic... |
324255370 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 19 09:25:55 2018
@author: alejandro
"""
import signal
import sys
import argparse
import array
import time
try:
import serial
except:
print('Falta instalar pyserial')
print('Pruebe con pip3 install pyserial.')
#=========================... | null | mis_proyectos/freeRTOS2_TP/enviar_texto.py | enviar_texto.py | py | 4,048 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.exit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"... |
10635581 | import os, os.path
import json
import csv
import time
def down_load_file(photo_link, path_down_load_file):
import io
import os
try:
from urllib.request import urlretrieve # Python 3
from urllib.error import HTTPError,ContentTooShortError
except ImportError:
from urllib import ... | null | Code/load_image.py | load_image.py | py | 5,399 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urlparse.urlparse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
276897293 | """Some functions."""
import numba
import numpy
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.basemap import Basemap
from RSDttest import RSDttest
from const import Pi
import scipy.stats
class Reader():
def __init__(self, file_path, file_namels, splitt... | null | reccyclone/demo_function.py | demo_function.py | py | 53,900 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime",
"line_number": 150,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 151,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 168,
"usage_type": "call"
},
{
"api_name": "datetime.ti... |
49816199 | import numpy as np
import matplotlib.pyplot as plt
class Sigmiod():
"""
def __init__(self):
pass
"""
def sigmiod(self):
y = 1/(1+np.exp(-self))
return y
def plot_sigmoid(self,low,up,pace):
x = np.arange(low,up,pace)
y = Sigmiod.sigmiod(x)
plt.plot(x,y... | null | nn/numpy模拟神经网络/sigmiod.py | sigmiod.py | py | 405 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.exp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
489616534 | from flask import Flask, render_template, url_for, flash, redirect, request, g
from forms import RegistrationForm, LoginForm, TechScoutForm
from wtforms import TextField, IntegerField, TextAreaField, SubmitField, RadioField,SelectField
from wtforms import validators, ValidationError
from datetime import datetime
datet... | null | app.py | app.py | py | 4,310 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line... |
180772172 | import requests
import json
import re
import os
import dialogflow_v2 as dialogflow
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'medivice-lldwrl-515b16d8293e.json'
def detect_intent_texts(texts, user_name):
session_client = dialogflow.SessionsClient()
session = session_client.session_path('medivice-lldwrl'... | null | chat.py | chat.py | py | 2,556 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "dialogflow_v2.SessionsClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dialogflow_v2.types.TextInput",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
489913312 | from tkinter import *
import tkinter.ttk as ttk
from PIL import ImageTk, Image
def showImage():
lbl1.configure(image=image_tk)
btn.configure(text = "load image!", command=showImage1)
def showImage1():
lbl1.configure(image=image_tk1)
btn.configure(text = "load image!", command=show... | null | misc py files/tkinter_images.py | tkinter_images.py | py | 967 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
... |
593454682 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | null | ebcli/operations/statusops.py | statusops.py | py | 4,879 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lib.elasticbeanstalk.get_environment",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lib.elasticbeanstalk",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "lib.elasticbeanstalk.get_environment_resources",
"line_number": 29,
"usage_type... |
96088226 | # coding=ascii
"""remove identical altnames
Revision ID: 2b25a82cb061
Revises: 3be1ca59b931
Create Date: 2017-10-19 15:00:18.871000
"""
from __future__ import unicode_literals
# revision identifiers, used by Alembic.
revision = '2b25a82cb061'
down_revision = u'3be1ca59b931'
import datetime
from alembic import op
i... | null | migrations/versions/2b25a82cb061_remove_identical_altnames.py | 2b25a82cb061_remove_identical_altnames.py | py | 1,485 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.table",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.column",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.table",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.c... |
504550432 | # Copyright (c) 2016 App Annie Inc. All rights reserved.
from nose.plugins.attrib import attr
from common.markets import GooglePlayMarket, IOSMarket
from tests.qa.base import BaseSeleniumTestCase
from tests.qa.constants import constants
from tests.qa.constants.constants import NOT_READY
from tests.qa.constants.constan... | null | tests/qa/cases/intelligence/usage/pya_dashboard/test_usage_pya_localization.py | test_usage_pya_localization.py | py | 4,722 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tests.qa.base.BaseSeleniumTestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tests.qa.constants.constants.ULTIMATE_USER",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tests.qa.constants.constants",
"line_number": 21,
"usa... |
183974155 | import pytz
from datetime import datetime, timedelta
from django_extensions.management.jobs import BaseJob
from accounts.models import User
from accounts.emails import UserOnboardingDripGettingStarted, UserOnboardingDripAdventureAnatomy, \
UserOnboardingDripCommunitySpotlight, UserOnboardingDripSupport
class Jo... | null | accounts/jobs/daily/user-onboarding-drip-campaign.py | user-onboarding-drip-campaign.py | py | 3,635 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django_extensions.management.jobs.BaseJob",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
... |
458657343 | """
dump_order_book.py
Using settings from goxtool.ini this strategy will continually dump
a grouped version of the order book into a json file.
group_level_list() code adapted from goxtool.WinOrderBook()
"""
import calendar, datetime
import json
import strategy
import goxapi
import math
# global contants
CONFIG_FI... | null | strategies/dump_order_book.py | dump_order_book.py | py | 7,065 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "calendar.timegm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "json.... |
377497266 | from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from timezone_field import TimeZoneField
import fleming
import pytz
from .fields import Dura... | null | localized_recurrence/models.py | models.py | py | 10,443 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.query",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "django.db.models.Manager",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_na... |
492765634 | #!/home/TA_NET_ID/.virtualenvs/grading/bin/python
from __future__ import print_function
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from time import sleep
import gridfs
import pymongo
import shutil
import subprocess
from sshtunnel import SSHTun... | null | graders/labb/cheat_test.py | cheat_test.py | py | 2,208 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
274174006 | from LucidDynamodb import DynamoDb
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
db = DynamoDb()
delete_table_status = db.delete_table(TableName='dev_jobs')
if(delete_table_status == True):
logging.info("Table deleted successfully")
else:
logging... | null | examples/13-delete-a-table.py | 13-delete-a-table.py | py | 682 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "LucidDynamodb.DynamoDb",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.inf... |
598115633 | from http.server import BaseHTTPRequestHandler
from urllib.request import urlopen
from urllib.parse import urlparse
from xml.etree import ElementTree as ET
from datetime import date
import json
def process(func, url):
response = urlopen(url)
xml = ET.fromstring(response.read())
return func(xml)
def pars... | null | handler.py | handler.py | py | 2,169 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "xml.etree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.fromstring",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml... |
148978089 |
# coding: utf-8
# In[2]:
import json
import ast
import networkx as nx
from networkx.drawing.nx_agraph import write_dot
from networkx.readwrite import json_graph
from collections import defaultdict
import os
import argparse
def add_arguments():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDe... | null | visualization/codes/drawing_graphs/graph_properties.py | graph_properties.py | py | 1,307 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 26,
"usage_type": "call"
}... |
404682138 | import queue
from loguru import logger
import threading
import time
import enum
import collections
class Node:
"""The elementary node to build up computational graph/pipeline
"""
Pack = collections.namedtuple(
"Package", "values signal context src")
class Status(enum.Enum):
"""Operat... | null | arus/node.py | node.py | py | 5,906 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "enum.auto",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line... |
499832598 | # -*- coding: utf8 -*-
from django.db import models
from django import forms
from django.contrib.auth.models import User
from ckeditor.fields import RichTextField
from datetime import datetime
TASK = 'Task'
ERROR = 'Error'
CORRECTION = 'Correction'
CHECK ='Check'
TASK_TYPE_CHOICES = (
(TASK, 'Task'),
(ERROR, 'Error'... | null | task/models.py | models.py | py | 2,450 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 39,
"usage_type": "call"
},
{
"api_n... |
196293199 | from interactor.database.connection import Base, DatabaseConnection
from delfick_project.norms import dictobj, sb
from urllib.parse import urlparse
from sqlalchemy import pool
import shlex
import sys
import os
class database_uri_spec(sb.Spec):
def normalise_empty(self, meta):
config_root = os.getcwd()
... | null | apps/interactor/interactor/database/database.py | database.py | py | 3,327 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "delfick_project.norms.sb.Spec",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "delfick_project.norms.sb",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
51082702 | # Copyright 2020 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | null | mlrun/scheduler.py | scheduler.py | py | 2,412 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "croniter.croniter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "threading.Lock",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "concurrent.futures... |
352198140 | #Thomas Chu 18 September 2019
#Jichen Dai 26 Sept 2019
#I pledge my honor that I have abided by the Stevens Honor System
import sys
import prettytable as pt
import datetime
#create dictionary for keyword lookup
keywords = {
"0" : {
"INDI" : "Y",
"FAM" : "Y",
"HEAD" : "Y",
... | null | Project3_Base.py | Project3_Base.py | py | 6,279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "prettytable.PrettyTable",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "prettytable.PrettyTable",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 186,
"usage_type": "attribute"
}
] |
494923356 | #coding:utf-8
"""
ID: intfunc.avg-08
TITLE: AVG - NULL test
DESCRIPTION:
FBTEST: functional.intfunc.avg.08
"""
import pytest
from firebird.qa import *
init_script = """CREATE TABLE test( id INTEGER);
INSERT INTO test VALUES(NULL);"""
db = db_factory(init=init_script)
act = isql_act('db', "SELEC... | null | tests/functional/intfunc/avg/test_08.py | test_08.py | py | 575 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytest.mark.version",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 27,
"usage_type": "attribute"
}
] |
583831197 | # %load q02_confidence_interval/build.py
# Default imports
import math
import scipy.stats as stats
import pandas as pd
import numpy as np
df = pd.read_csv('data/house_pricing.csv')
sample = df['GrLivArea']
def confidence_interval(sample):
n = sample.shape[0]
mean = sample.mean()
sd = sample.std()/(math.sq... | null | q02_confidence_interval/build.py | build.py | py | 465 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.ppf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
... |
403356186 | import numpy as np #biblioteca numpy para trabalhar com matriz (img)
import cv2 #importa o opencv
from time import sleep
x=0
cap = cv2.VideoCapture(0) #acessa a camera na entrada padrao do rasp = 0
def nothing(x):
pass
readings=[]
average=0
last_vlue=0
cv2.namedWindow('frame')
cv2.createTr... | null | OpenCV_tests/segtest.py | segtest.py | py | 1,696 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.createTrackbar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.createTrackbar... |
223073442 |
import numpy as np
import pickle
import networkx as nx
import torch
from utils import *
import random
import torch.nn as nn
from model import GNN_Bet
torch.manual_seed(20)
#Loading graph data
data_path = "./data/"
#Load training data
print(f"Loading data...")
with open(data_path+"training.pickle","rb") as fopen:
... | null | main.py | main.py | py | 2,994 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.manual_seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "model.train",
"line_num... |
243604245 | import sys
import numpy as np
import json
def read_xyz(file_name, log_o):
num_atoms = 0
file_o = open(file_name, 'r')
log_text = 'The xyz file for the molecule %s has been found an opened. \n' % file_name
atoms = []
for i, current_line in enumerate(file_o):
if i == 0:
num_atoms... | null | modules/fiotio.py | fiotio.py | py | 28,600 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.random_integers",
"line_number": 196,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 196,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 215,
"usage_type": "call"
},
{
"api_name": "sys.exit",... |
110727084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import traceback
import uuid
import os
import urllib
import requests
from selenium import webdriver
THIS_PATH = os.path.abspath(os.path.dirname(__file__)) # 本文件路径
ROOT_PATH = os.path.abspath(os.path.dirname(THIS_PATH)) # 项目根路径
CHROMEDRIVER = os.path.join(R... | null | pisces/main.py | main.py | py | 6,410 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"l... |
196845361 | import pytest
from precisionlife_fastjsonschema import JsonSchemaValidationException
definition = {
'type': 'array',
'items': [
{
'type': 'number',
'maximum': 10,
'exclusiveMaximum': True,
},
{
'type': 'string',
'enum': ['hel... | null | tests/test_integration.py | test_integration.py | py | 4,822 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "precisionlife_fastjsonschema.JsonSchemaValidationException",
"line_number": 73,
"usage_type": "c... |
505917122 | """vamos a crear una tarea en celery, la tarea es la de envio de email y generacion de token"""
""" en el serializer de usuario, tenemos una funcion que envia un email para poder,
realizar un login, vamos a traer esta funcion para implementarla como una tarea de celery
"""
# Django
# importamos esta propiedas que nos... | null | cride/taskapp/tasks.py | tasks.py | py | 3,468 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "jw... |
174161718 | # Copyright 2018 Vertex.AI
import logging
import re
import subprocess
import sys
import pytest
import pytest_virtualenv
log = logging.getLogger(__name__)
@pytest.fixture(scope='function')
def benchenv(pytestconfig):
with pytest_virtualenv.VirtualEnv() as venv:
venv.run([venv.python, 'setup.py', 'develo... | null | tests/test_setup.py | test_setup.py | py | 1,790 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest_virtualenv.VirtualEnv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyte... |
610306503 | from imageai.Detection import VideoObjectDetection
import sys, getopt
import os
import operator
import time
import datetime
import json
import threading
import urllib.request
from flask import Flask, Response, request
from my_client_db import app, db, execution_path, VideoInfo, v_log
video_detector = None
parse_resul... | null | examples/my_video_detect_client.py | my_video_detect_client.py | py | 12,613 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "my_client_db.db.create_all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "my_client_db.db",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "operator.itemgetter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "my_cli... |
288315169 | from django.urls import include, path
from django.contrib import admin
admin.autodiscover()
# yapf: disable
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('auvsi_suas.views.urls', namespace="auvsi_suas")),
]
# yapf: enable
| null | server/server/urls.py | urls.py | py | 252 | 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.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
272204108 | """
给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。
请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。
你可以假设 nums1 和 nums2 不会同时为空。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/median-of-two-sorted-arrays
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
"""
from typing import List
class Solution:
def findMedianSortedArray... | null | leetcode/04findMedianSortedArrays.py | 04findMedianSortedArrays.py | py | 1,008 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
}
] |
231393164 | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def genarate_linechart(turnaround):
print(turnaround)
plt.plot(turnaround.keys(), turnaround.values(), 'ro', linestyle='-')
plt.axis([1, len(turnaround) + 1, 0, max(turnaround.values()) + 2])
plt.show()
def avg_ti... | null | Process Scheduling/test.py | test.py | py | 7,183 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axis",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotl... |
91023409 | import os
from ob_request import User
from helper import *
import multiprocessing as mp
from tqdm import *
import time
import speedtest
from datetime import datetime
TESTED = []
dsl = 'noipdefault\ndefaultroute\nreplacedefaultroute\nhide-password\nnoauth\npersist\nplugin rp-pppoe.so eth0\nuser "{}"\nusepeerdns'
def ... | null | main.py | main.py | py | 3,671 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ob_request.User",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Pool",
... |
552839037 | # coding: utf-8
# The MIT License (MIT)
# Copyright (c) 2019 Martin Bammer, mrbm74 at gmail dot com
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software - recordclass library - and associated documentation files
# (the "Software"), to deal in the Software without restrict... | null | module/zstdarchiver/lib/toc.py | toc.py | py | 17,095 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 5... |
189671478 | import torch
from torch import nn
import torchvision.datasets as dset
import numpy as np
import logging
import argparse
import time
import os
from model import EDNetV2 as EDNet
from trainer import Trainer
from data import get_ds
from utils import _logger, _set_file
from my_utils import ModelTools
from torch.utils.dat... | null | ednas/train_cifar10.py | train_cifar10.py | py | 4,024 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils._logger",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argument... |
445029688 | from scrapy import Spider,Request
from ..items import TiebaItem
class TiebaSpider(Spider):
_description = "爬取百度贴吧第一页帖子的帖子名称,发帖人,回复数量"
name = 'tieba'
# Tname = input('请输入需要查询的贴吧名称:')
Tname = '福州'
start_urls = ['https://tieba.baidu.com/f?ie=utf-8&kw={}&fr=search'.format(Tname)]
def parse(self, ... | null | Scrapy/spiders/tieba_spider.py | tieba_spider.py | py | 1,862 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "items.TiebaItem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
}
] |
624523663 | from django.conf.urls import url
from mircbin.views import artwork_form_view, artwork_detail_view, artwork_random_view, home_view
urlpatterns = [
url(r'^$', home_view, name='home'),
url(r'^upload/$', artwork_form_view, name='upload'),
url(r'^random/$', artwork_random_view, name='random'),
url(r'^deta... | null | project/mircbin/urls.py | urls.py | py | 379 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mircbin.views.home_view",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mi... |
401674133 | from dataclasses import dataclass, make_dataclass
from typing import Any, List
@dataclass
class Deck:
#Deck:一副牌。cards參數傳入列表,該列表中含有多個PlayingCard類實例。
cards: List[PlayingCard]
@dataclass
class WithoutExplicitTypes:
name: Any
value: Any = 42
@dataclass
class DataClassCard:
rank: str
suit:... | null | 008_Syntax/dataclass/test.py3 | test.py3 | py3 | 654 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_num... |
183310740 |
# Copyright 2013 University of Maryland. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE.TXT file.
import sys
import os
import time
from selenium.common.exceptions import NoAlertPresentException
import framework
class Exploit (framework.Exploit... | null | framework/Exploits/CUTEFLOW_0006.py | CUTEFLOW_0006.py | py | 1,486 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "framework.Exploit",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "framework.Exploit.__init__",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "framework.Exploit",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name... |
549741422 | import json
import os
from geopy.distance import vincenty
from geopy.geocoders import Nominatim
def load_data(filepath):
if not os.path.exists(filepath):
return None
with open(filepath,'r') as json_file:
return json.load(json_file)
def get_biggest_bar(data):
max_bar = max(dat... | null | bars.py | bars.py | py | 2,190 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "geopy.distance.vincenty",
"li... |
575436427 | from django.urls import path
from . import views
from .views import base_views, question_views, answer_views, vote_views, comment_views
app_name = 'pybo'
urlpatterns = [
# base_views
# 127.0.0.1:8000/pybo/
path('', base_views.index, name='index'),
path('board/', base_views.board, name='board'),
# ... | null | pybo/urls.py | urls.py | py | 1,271 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.base_views.index",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "views.base_views",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.... |
13406859 |
import numpy as np
import cv2
import os
from PIL import Image
from tqdm import tqdm
X = []
y = []
fnames_cig = os.listdir('../schlug_dataset/')
for file_i in tqdm(fnames_cig):
img_obj = Image.open('../schlug_dataset/' + file_i).convert('RGB')
for angle_i in range(4):
#rotating
img_obj_tmp = ... | null | python/import_and_resize_data.py | import_and_resize_data.py | py | 1,383 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14... |
464365051 | #!/usr/bin/python3
import shutil, pathlib, os
from tkinter import *
from tkinter import messagebox
from tkinter.filedialog import *
from dirsync import sync
title_bar = '同步處理工具'
window = Tk()
window.geometry("400x25")
window.title(title_bar)
#window.withdraw()
fuc_title = { '1':'目的資料夾',
'2':'目的資料夾',
... | null | UI/sync.py | sync.py | py | 1,665 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dirsync.sync",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 46,
"usage_type": "call"
}
] |
55264947 | import math, copy, random, time, string
import cv2 as cv2
import numpy as np
import pandas as pd
import sklearn as sk
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.met... | null | deprecated/face.py | face.py | py | 4,239 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.D... |
282532882 | import cv2
import numpy as np
def hisEqulColor(img): #CONTRAST colorful (histogram equ)
ycrcb = cv2.cvtColor(img, cv2.COLOR_BGR2YCR_CB)
channels = cv2.split(ycrcb)
cv2.equalizeHist(channels[0], channels[0])
cv2.merge(channels, ycrcb)
cv2.cvtColor(ycrcb, cv2.COLOR_YCR_CB2BGR, img)
re... | null | image_test/test.py | test.py | py | 1,327 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2YCR_CB",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.equalizeHist",
... |
172854092 | import pandas
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import KFold
# Sklearn imports
from sklearn.preprocessing import MinMaxScaler
from sklearn.ensemble import RandomForestRegressor
# Custom imports
from utils.dataset_loader import ParkinsonDataset
if __name__ == '__main__':
... | null | experiments/models_all_dataset/random_forest_regression.py | random_forest_regression.py | py | 4,963 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.dataset_loader.ParkinsonDataset.load_dataset",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.dataset_loader.ParkinsonDataset",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "utils.dataset_loader.ParkinsonDataset.normalize_dataset"... |
599896840 | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | null | mars/learn/contrib/pytorch/sampler.py | sampler.py | py | 4,338 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.Sampler",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.Sampler",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torch.distributed.is_available",
"line_number": 35,
"usage_type": "call"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.