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
498662479
#!/usr/bin/env python # Copyright: (c) 2019, Tanner Dowhy <tanner.dowhy@usask.ca> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1'} ...
null
biolighthouse/modules/Conda/conda_install.py
conda_install.py
py
5,087
python
en
code
null
code-starcoder2
83
[ { "api_name": "ansible.module_utils.basic.AnsibleModule", "line_number": 74, "usage_type": "call" } ]
91127038
from symtype import KT, SymType from scanner import Scanner import stmts from copy import copy import traceback import typez import sys import pygame pygame.init() window = pygame.display.set_mode((640, 480)) class Parser(object): def __init__(self, program): super(Parser, self).__init__() self.scanner = S...
null
parser.py
parser.py
py
7,664
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scanner.Scann...
283272705
import attr from pandas.core.util.hashing import hash_pandas_object from dbnd._core.utils import json_utils from dbnd._vendor import fast_hasher from targets.value_meta import ValueMeta, ValueMetaConf from targets.values.pandas_values import DataFrameValueType class TestDataFrameValueType(object): def test_df_v...
null
modules/dbnd/test_dbnd/targets_tests/values/test_dataframe_value_type.py
test_dataframe_value_type.py
py
2,039
python
en
code
null
code-starcoder2
83
[ { "api_name": "targets.values.pandas_values.DataFrameValueType.type_str", "line_number": 14, "usage_type": "attribute" }, { "api_name": "targets.values.pandas_values.DataFrameValueType", "line_number": 14, "usage_type": "name" }, { "api_name": "targets.value_meta.ValueMetaConf.en...
292873195
import os import sys import json import argparse from allennlp.commands.subcommand import Subcommand from allennlp.common.util import JsonDict class ConvertTREC(Subcommand): def add_subparser(self, name: str, parser: argparse._SubParsersAction) -> argparse.ArgumentParser: # pylint: disable=protected-acce...
null
neuclir/commands/convert_trec.py
convert_trec.py
py
2,147
python
en
code
null
code-starcoder2
83
[ { "api_name": "allennlp.commands.subcommand.Subcommand", "line_number": 10, "usage_type": "name" }, { "api_name": "argparse._SubParsersAction", "line_number": 11, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "attri...
111808028
# coding: utf-8 # In[1]: import preprocess as read_files import glob import numpy as np # # read file # In[2]: ucf = read_files.UCF() fea = glob.glob('ucf101_fea_video/*.mat') ucf.fill(fea) ucf.dump('fea.ucf') ucf_test = read_files.UCF() ucf_test.svd_data = list() feaval = glob.glob('ucf101_fea_val_video/*.m...
null
svd_method.py
svd_method.py
py
4,629
python
en
code
null
code-starcoder2
83
[ { "api_name": "preprocess.UCF", "line_number": 17, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 19, "usage_type": "call" }, { "api_name": "preprocess.UCF", "line_number": 23, "usage_type": "call" }, { "api_name": "glob.glob", "line_number"...
79197329
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
null
packages/google-cloud-domains/google/cloud/domains_v1/types/domains.py
domains.py
py
53,578
python
en
code
null
code-starcoder2
83
[ { "api_name": "proto.module", "line_number": 26, "usage_type": "call" }, { "api_name": "proto.Enum", "line_number": 64, "usage_type": "attribute" }, { "api_name": "proto.Enum", "line_number": 100, "usage_type": "attribute" }, { "api_name": "proto.Enum", "line_...
240641241
import logging logging.basicConfig(format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt = '%m/%d/%Y %H:%M:%S', level = logging.INFO) logger = logging.getLogger(__name__) ss="This is a test sentence." sss="The same to last one." logger.info("111 %s" % ss)...
null
examples/ttt.py
ttt.py
py
339
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" } ]
490664792
from circuitbreaker import CircuitBreaker from cache_driver import CacheDriver import logging from logstash_async.handler import AsynchronousLogstashHandler from time import sleep from sanic import response # Setup elk stack # host_logger = 'localhost' host_logger = 'logstash' # host_logger = 'elk' port_logger = 50...
null
gateway2/loadbalancer.py
loadbalancer.py
py
3,930
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logstash_async.handler.AsynchronousLogstashHandler", "line_number": 21, "usage_type": "call" }, ...
485164192
from __future__ import annotations import climetlab as cml import xarray as xr from climetlab.normalize import normalize_args from . import DATA, OBSERVATIONS_DATA_VERSION, URL, S2sDataset from .extra import cf_conventions from .s2s_mergers import S2sMerger PATTERN_OBS = "{url}/{data}/{dataset}/{version}/{parameter}...
null
climetlab_s2s_ai_challenge/observations.py
observations.py
py
3,421
python
en
code
null
code-starcoder2
83
[ { "api_name": "extra.cf_conventions", "line_number": 43, "usage_type": "call" }, { "api_name": "climetlab.load_source", "line_number": 54, "usage_type": "call" }, { "api_name": "climetlab.normalize.normalize_args", "line_number": 37, "usage_type": "call" }, { "api...
322465304
from pandas import read_csv import numpy as np import matplotlib.pyplot as plt import ConfigParser import argparse import seaborn as sns WARMUP_SECS = 30 COOLDOWN_SECS = 0 def cleandf(df): start_time = np.min(df['epoch']) end_time = np.max(df['epoch']) new_start_time = start_time + (WARMUP_SECS) n...
null
MessagingSystemScripts/harware_metrics.py
harware_metrics.py
py
2,066
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.min", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "li...
407529485
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # @Author : Administrator # @File : DatabaseUtil.py # @Version: 1.0.0 # @Time : 2019/8/16 13:02 # @Project: reptile-python # @Package: # @Software: PyCharm import os import sqlite3 import sys import pandas import pymysql def select(connect, sql): """ 游标对象执行SQL...
null
utils/DatabaseUtil.py
DatabaseUtil.py
py
5,462
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.OperationalError", "line_number": 34, "usage_type": "attribute" }, { "api_name": "sqlite3.OperationalError", "line_number": 63, "usage_type": "attribute" }, { "api_name": "pymysql.connect", "line_number": 110, "usage_type": "call" }, { "api_...
620830208
# Create your views here. from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from arartekomaps.settings import STATIC_URL from arartekomaps.locations.models import Location from arartekomaps.places.models import Place from arartekomaps.categories.models import ...
null
arartekomaps/locations/views.py
views.py
py
2,537
python
en
code
null
code-starcoder2
83
[ { "api_name": "arartekomaps.locations.models.Location.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "arartekomaps.locations.models.Location.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "arartekomaps.locations.models.Location", ...
490515688
import os from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ucheshi.settings') app = Celery('ucheshi') app.config_from_object('django.conf:settings', namespace='CELERY') app.conf.beat_schedule = { 'get_joke_3s': { 'task': 'cheshi.tasks.get_joke', 'schedule': 3.0 } ...
null
Realtime-Broadcasting-API/ucheshi/ucheshi/celery.py
celery.py
py
347
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.setdefault", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" } ]
161653145
import os import wave import random import tempfile from subprocess import Popen, DEVNULL import threading from concurrent.futures import ThreadPoolExecutor, wait from typing import List, Text MIDI_PATH = './clean_midi' SAVE_PATH = './dataset' FREQ_TABLE_PATH = './freq_table' SAMPLES = 100 * 3 # must be multiple of 3...
null
python/gen_wav.py
gen_wav.py
py
3,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number...
108482689
#!/usr/bin/env python # coding: utf-8 """Export des ingrédients et des processes du builder""" from bw2data.project import projects from food.impacts import impacts as impacts_definition import bw2calc import bw2data import functools import hashlib import json import uuid # Input PROJECT = "Food" DBNAME = "Agribalys...
null
data/food/export_builder.py
export_builder.py
py
11,011
python
en
code
null
code-starcoder2
83
[ { "api_name": "bw2data.project.projects.create_project", "line_number": 26, "usage_type": "call" }, { "api_name": "bw2data.project.projects", "line_number": 26, "usage_type": "name" }, { "api_name": "bw2data.config", "line_number": 27, "usage_type": "attribute" }, { ...
175381617
# coding:utf-8 from copy import deepcopy from typing import List, Dict class SingerInfoGetter: """ 获取歌手信息的类 """ def __init__(self, albumInfo_list: list) -> None: self.albumInfo_list = deepcopy(albumInfo_list) # type:List[dict] self.singerInfos = self.getSingerInfos(self.albumInfo_list) ...
null
app/common/meta_data_getter/get_singer_info.py
get_singer_info.py
py
1,711
python
en
code
null
code-starcoder2
83
[ { "api_name": "copy.deepcopy", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 14, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 49, "usage_type": "call" } ]
382450608
# -*- coding: utf-8 -*- """ @author: Olav Milian Gran """ import datetime import multiprocessing as mp import sys from time import perf_counter import matplotlib.pyplot as plt import numpy as np import sympy as sym from matplotlib.ticker import MaxNLocator from linear_elasticity_2d_solver import LinearElasticity2DPro...
null
code_use_for_report/Example_2_Gravity_in_2D/reduced_order_error_rel_info_singular_values.py
reduced_order_error_rel_info_singular_values.py
py
8,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "sympy.init_printing", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 26, "usage_type": "attribute" }, { ...
387664372
import psycopg2 class WorkWithDataBase: def __init__(self, dbname, user, password, host): self.dbname = dbname self.user = user self.password = password self.host = host self.connection, self.cursor = self.get_connection() # создает подключение def get_connection(s...
null
postgresql.py
postgresql.py
py
5,966
python
en
code
null
code-starcoder2
83
[ { "api_name": "psycopg2.connect", "line_number": 14, "usage_type": "call" } ]
435359009
import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt plt.switch_backend('agg') import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim from mpl_toolkits.mplot3d import Axes3D INPUT_SIZE = 3 HIDDEN_SIZE = 64 OUTPUT_SIZE = 3 LR = 0.01 # Create d...
null
lorenz_gru.py
lorenz_gru.py
py
3,051
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 24, "usage_type": "call" }, { "api_name": "scipy.i...
74839682
#!/usr/bin/python3 """ Review objects that will handles all default RestFul API actions """ from api.v1.views import app_views from models import storage from models.review import Review from flask import jsonify, abort, request, make_response from werkzeug.exceptions import BadRequest @app_views.route('/places/<plac...
null
api/v1/views/places_reviews.py
places_reviews.py
py
2,407
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.storage.get", "line_number": 18, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.abort", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.method", ...
105182208
import requests from django.db import transaction from django.http import HttpResponse from django.http import HttpResponseRedirect from django.http import JsonResponse from django.template.loader import render_to_string from django.urls import reverse from django.views import generic from collections import defaultdic...
null
pipeline/views.py
views.py
py
13,718
python
en
code
null
code-starcoder2
83
[ { "api_name": "pipeline.models", "line_number": 21, "usage_type": "name" }, { "api_name": "pipeline.models.Pipeline.objects.get", "line_number": 21, "usage_type": "call" }, { "api_name": "pipeline.models.Pipeline.objects", "line_number": 21, "usage_type": "attribute" },...
316336639
#!/usr/bin/env python import sys import argparse import os import warnings import json import prism import transformers import bert_score from scipy import stats import matplotlib.pyplot as plt import pandas as pd import statistics import csv import seaborn as sns import numpy as np import datasets __models__ = ['pri...
null
chateval_db_scores.py
chateval_db_scores.py
py
7,668
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "prism.Prism", "line_number": 50, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 50, "usage_type": "attribute" }, { "api_name": "datasets.load_met...
200532619
import requests from sys import exit class Finance: indicat = [ 'Bid', 'Open', 'Ask', 'Volume','All','Exit' ] url = "https://finance.yahoo.com/quote/AAPL?p=AAPL" def __init__(self): self.ShowScreen(1) param = input("\nSelect value from the list above: ") if(param.capi...
null
Finance_web_scraping_Exmaple.py
Finance_web_scraping_Exmaple.py
py
2,258
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 39, "usa...
299817752
# -*- coding: utf-8 -*- """ Created on Mon Jul 11 11:26:12 2016 @author: SRINIVAS """ from bs4 import BeautifulSoup as bs import urllib.request t=[] we=0 url='https://projecteuler.net/problem=' meep=input('Problem #') url=url+meep page = urllib.request.urlopen(url) soup = bs(page.read()) tea=soup.findAl...
null
E find.py
E find.py
py
380
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.request.urlopen", "line_number": 14, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 14, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 14, "usage_type": "name" }, { "api_nam...
551556376
import os, pickle import pandas as pd import numpy as np import xml.etree.ElementTree as ET TEST_ROOT = 'validate_results/py-faster-rcnn2_15000_iters100000test53107_12_10/Main/' # 模型测试结果根目录 ANNOTATIONS_ROOT = 'data/validate_annotations/Annotations/' # 标注根目录 CLASS_IDS = ['0001', '0002', '0003', '0004', '0005', '0...
null
deadline_code_results/code/calculate_rcnn2_mAP.py
calculate_rcnn2_mAP.py
py
8,778
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.walk", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "os.walk", "line_number":...
300185574
# -*- coding: utf-8 -*- # Author: Ke Wang # Contact: wangke17[AT]pku.edu.cn ###################################################################################### # Packages ###################################################################################### # Basic Packages import os import time import argparse im...
null
Basic_framework/main.py
main.py
py
2,397
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 25, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.exists", ...
535290133
# Simple script to create region file from catalog import numpy as np from astropy.io import fits import sys wd='/Users/alberto/Downloads/' input = 'bootes_LOFAR_lba_retana-montenegro18.fit' output = 'bootes_LOFAR_lba_retana-montenegro18.reg' size = '8' color='yellow' # Open the catalog cat=fits.open(wd+input) ra=...
null
create_regfile_from_catalog.py
create_regfile_from_catalog.py
py
531
python
en
code
null
code-starcoder2
83
[ { "api_name": "astropy.io.fits.open", "line_number": 15, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 15, "usage_type": "name" } ]
309860680
import numpy as np from keras.datasets import mnist from keras.models import Model from keras.layers import Dense,Input import matplotlib.pyplot as plt #process data (X_train,_),(X_test,Y_test)=mnist.load_data() X_train=X_train.astype("float32")/255-0.5 X_test=X_test.astype("float32")/255-0.5 X_train=X_train.reshape...
null
Autoencoder.py
Autoencoder.py
py
1,361
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 9, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 9, "usage_type": "name" }, { "api_name": "keras.layers.Input", "line_number": 21, "usage_type": "call" }, { "api_name": "...
566560367
#! /usr/bin/python3 import numpy as np import matplotlib.pyplot as plt origin_data = [] processed_data = [] sample_rate = 44100 with open("fft_output.txt", 'r') as f: origin_data = [float(x) for x in f.readline().split()] processed_data = [float(x) for x in f.readline().split()] y1 = np.array(origin_data) y...
null
plot_data.py
plot_data.py
py
625
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
275761709
import numpy as np import sys if '../' not in sys.path: sys.path.append('../') from lib.envs.gridworld import GridworldEnv def policy_eval(policy, env, gamma=1.0, theta=0.00001): V = np.zeros(env.nS) nS = env.nS P = env.P while True: delta = 0 for s in range(env.nS): v =...
null
policy_eval.py
policy_eval.py
py
812
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_numb...
37423887
import sys, os import argparse import pandas as pd from itertools import product from multiprocessing import Pool import subprocess ''' This script joins the bias files per eta-rings intervals. ''' parser = argparse.ArgumentParser() parser.add_argument("-d", "--dof", type=str, help="DOF file", required=True) parser...
null
PileupMC_v2/joinFilesByEtaRing.py
joinFilesByEtaRing.py
py
2,082
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.makedirs", ...
512214684
from unittest.mock import Mock import IPython.display from solara.server import app, kernel def test_shell(no_app_context): ws1 = Mock() ws2 = Mock() kernel1 = kernel.Kernel() kernel2 = kernel.Kernel() kernel1.session.websockets.add(ws1) kernel2.session.websockets.add(ws2) context1 = app...
null
tests/unit/shell_test.py
shell_test.py
py
691
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.mock.Mock", "line_number": 9, "usage_type": "call" }, { "api_name": "unittest.mock.Mock", "line_number": 10, "usage_type": "call" }, { "api_name": "solara.server.kernel.Kernel", "line_number": 11, "usage_type": "call" }, { "api_name": "sola...
361876175
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import model_utils.fields import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Vacancy', ...
null
apps/vacancies/migrations/0001_initial.py
0001_initial.py
py
2,510
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.CreateModel", "line_number": 15, "usage_type": "call" }, ...
464058095
import re from nltk.tokenize import sent_tokenize def detect_dependency(text): """Attempts to determine if the claim set out in text is dependent - if it is dependency is returned - if claim is deemed independent 0 is returned as dependency """ p = re.compile('(of|to|with|in)?\s(C|c)laims?\s\d+((\sto\s\d+)|(\s...
null
app/mod_nlp/claim_processing.py
claim_processing.py
py
2,560
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 25, ...
16827393
# coding=utf-8 import os import sys import psutil mProc = 'desktop.exe' mProcs = 'desktop' mFile = '..\\RX\Record.txt' mOutFile = '..\\PY_RXX\\ROut.txt' replay = "test?r=replay&file={_file}&outfile={_outfile}" def existsProc(processname): pl = psutil.pids() for pid in pl: if psutil.Process(pid).name(...
null
Notes/Python/Process/UITest.py
UITest.py
py
1,958
python
en
code
null
code-starcoder2
83
[ { "api_name": "psutil.pids", "line_number": 14, "usage_type": "call" }, { "api_name": "psutil.Process", "line_number": 16, "usage_type": "call" }, { "api_name": "psutil.pids", "line_number": 24, "usage_type": "call" }, { "api_name": "psutil.Process", "line_num...
370492354
__author__ = "Pruthvi Kumar, pruthvikumar.123@gmail.com" __copyright__ = "Copyright (C) 2018 Pruthvi Kumar | http://www.apricity.co.in" __license__ = "Public Domain" __version__ = "1.0" import os from jinja2 import Environment, FileSystemLoader from nucleus.db.cache_manager import CacheManager class MetaGen(CacheMan...
null
nucleus/metagen.py
metagen.py
py
2,668
python
en
code
null
code-starcoder2
83
[ { "api_name": "nucleus.db.cache_manager.CacheManager", "line_number": 11, "usage_type": "name" }, { "api_name": "jinja2.Environment", "line_number": 20, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 20, "usage_type": "call" }, { "...
261047640
import torch from torch import nn from torch.utils.data import Dataset class Engine: def __init__(self, model, optimizer, device): self.model = model self.optimizer = optimizer self.device = device @staticmethod def loss_fn(targets, outputs): return nn.BCEWithLogitsLoss()(o...
null
utils_timeLSTM.py
utils_timeLSTM.py
py
1,926
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.BCEWithLogitsLoss", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.utils.data.Da...
574940043
from memoize import memoized def is_complete(csp, assignment): w, h, horiz_constr, vert_constr = csp return len(assignment) == h @memoized def order_domain_values(csp, var): w, h, horiz_constr, vert_constr = csp # calculate the possible lengths and movements # generate the numbers by moving sequ...
null
level_32/csp_tuple.py
csp_tuple.py
py
3,288
python
en
code
null
code-starcoder2
83
[ { "api_name": "memoize.memoized", "line_number": 9, "usage_type": "name" } ]
392093911
# Code provided under the BSD License from xml.dom import minidom import urllib.request import series import teevee_conf import re import time import sys import pickle import tweepy DEBUG = True PROD = True # _________________________________________________________ # Finds a node that matches the given attributes wi...
null
pyvee.py
pyvee.py
py
13,963
python
en
code
null
code-starcoder2
83
[ { "api_name": "teevee_conf.newzbin_user", "line_number": 42, "usage_type": "attribute" }, { "api_name": "teevee_conf.newzbin_pwd", "line_number": 43, "usage_type": "attribute" }, { "api_name": "urllib.request.parse.urlencode", "line_number": 48, "usage_type": "call" }, ...
544688601
import vcf import sys import os import json from collections import Counter, defaultdict import pysam import sqlite3 import cStringIO as StringIO from threadpool import ProducerConsumer from utils import removeFiles def consumer(con, returndata): cur = con.cursor() for dat in returndata: if not dat: ...
null
scripts/utils/vcfmod.py
vcfmod.py
py
3,580
python
en
code
null
code-starcoder2
83
[ { "api_name": "vcf.Reader", "line_number": 28, "usage_type": "call" }, { "api_name": "cStringIO.StringIO", "line_number": 28, "usage_type": "call" }, { "api_name": "vcf.Reader", "line_number": 47, "usage_type": "call" }, { "api_name": "cStringIO.StringIO", "li...
372412912
import numpy as np import random import matplotlib.pyplot as plt import pickle infile = open('maze_examples\maze4x6.pckl', 'rb') data = pickle.load(infile) infile.close() print(data) nr, nc = data.shape # number of rows and columns in array pc = [] # will contain open points along the boarder pr = [] for i, m in ...
null
maze_runner.py
maze_runner.py
py
2,655
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 61, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 64, "usage_type": "call" }, { "api_name": "matplotlib.pyplot",...
379337612
# -*- coding: utf-8 -*- """ Created on Fri Feb 26 14:04:02 2021 @author: tfahry """ import pandas as pd ldf = pd.read_csv('Lateness.csv', index_col='Date') locset = list(set(ldf['Geography'])) loclist = [] temploc = [] for loc in ldf['Geography']: if ';Terminate' in loc: temploc.append(loc) loc...
null
path-variance-preprocessing.py
path-variance-preprocessing.py
py
2,812
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "functools.cmp_to_key", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "functools.cmp_to_...
43143127
# -*- coding: utf-8 -*- import numpy as np import cv2 # Função para gerar a peleta de cores com um início e fim de cor definida pelo usuário def palette( b1, g1, r1, b2, g2, r2): b = np.linspace(b1, b2, 256) g = np.linspace(g1, g2, 256) r = np.linspace(r1, r2, 256) p1 = np.tile( b.reshape(256...
null
photoshop/gimp/colorization-image.py
colorization-image.py
py
1,128
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.tile", "line_num...
567903868
from copy import deepcopy from typing import List, Dict, Tuple from cv2 import data from vqa_benchmarking_backend.datasets.dataset import DataSample, DatasetModelAdapter, DiagnosticDataset import torch from skimage.util import noise, random_noise from collections import defaultdict @torch.no_grad() def inputs_for_ima...
null
backend/vqa_benchmarking_backend/metrics/robustness.py
robustness.py
py
5,721
python
en
code
null
code-starcoder2
83
[ { "api_name": "vqa_benchmarking_backend.datasets.dataset.DataSample", "line_number": 11, "usage_type": "name" }, { "api_name": "skimage.util.random_noise", "line_number": 40, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 41, "usage_type": "call" ...
323254757
#!/usr/bin/python import networkx as nx import random import math # INDEPENDENT CASCADE MODEL # Let S_0 is the set of seeds, i.e., nodes active at step 0, # and more in general S_t is the set of nodes activated at step t. # Moreover, we denote with S_<t the set of nodes activated before step t, i.e., S_<t is the uni...
null
utils/lesson3.py
lesson3.py
py
11,467
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.random", "line_number": 27, "usage_type": "call" }, { "api_name": "networkx.get_node_attributes", "line_number": 42, "usage_type": "call" }, { "api_name": "random.random", "line_number": 45, "usage_type": "call" }, { "api_name": "random.choic...
81805111
#!/home/kjeong23/softwares/bin/python3.4 # program to calculate hoppingless MSD of surfactants # v04 renovation: imported mdtraj to process xtc file. Also, xtc file is truncated with 1 atomtype. # definition of non-hopping: until it is detected in 'other' micelle. # in migevent scheme, until the arrival time for the de...
null
py_development/data_process/micelles/nohopmsd_v04.py
nohopmsd_v04.py
py
6,484
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 61...
215633734
#!usr/bin/env python # encoding: utf-8 """ @author: tommars00 @softwawre: PyCharm Community Edition @file: run.py @time: 8:37 PM """ from scrapy import cmdline name = 'book' cmd = 'scrapy crawl {0}'.format(name) cmdline.execute(cmd.split())
null
dangdang/run.py
run.py
py
246
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.cmdline.execute", "line_number": 17, "usage_type": "call" }, { "api_name": "scrapy.cmdline", "line_number": 17, "usage_type": "name" } ]
573482198
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm import os, glob, json import config as cfg from module.cluster import VAE_Cluster from module.vmt import VMT, TemplateD, QHead from module.vae import GaussianKLLoss from dataset import KKDayUser, seq_co...
null
cli/vae_info_gan_trainer.py
vae_info_gan_trainer.py
py
31,779
python
en
code
null
code-starcoder2
83
[ { "api_name": "dataset.KKDayUser", "line_number": 37, "usage_type": "call" }, { "api_name": "dataset.KKDayUser", "line_number": 41, "usage_type": "call" }, { "api_name": "dataset.KKDayUser", "line_number": 45, "usage_type": "call" }, { "api_name": "module.vmt.VMT"...
30709289
import discord from discord.ext import commands import asyncio import random import re from urllib.parse import quote as uriquote import sqlite3 FACES = [" ͡° ͜ʖ ͡°", " ͡° ʖ̯ ͡°", " ͠° ͟ʖ ͡°", " ͡ᵔ ͜ʖ ͡ᵔ", " . •́ _ʖ •̀ .", " ఠ ͟ʖ ఠ", " ͡ಠ ʖ̯ ͡ಠ", " ಠ ʖ̯ ಠ", " ಠ ͜ʖ ಠ", " ͡• ͜ʖ ͡• ", " ・ิ ͜ʖ ・ิ", " ͡ ͜ʖ ͡ ", "...
null
modules/chat.py
chat.py
py
6,517
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 20, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 20, "usage_type": "name" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "di...
554537136
# coding: utf-8 from __future__ import unicode_literals from sqlalchemy.orm import joinedload, joinedload_all from clld.db.meta import DBSession from clld.db.util import get_distinct_values from clld.db.models.common import Value, Contribution, ValueSet, Parameter, Language from clld.web.util.helpers import external_...
null
lexibank/datatables.py
datatables.py
py
8,987
python
en
code
null
code-starcoder2
83
[ { "api_name": "clld.web.datatables.source.Sources", "line_number": 27, "usage_type": "name" }, { "api_name": "clld.web.datatables.source.Sources.base_query", "line_number": 29, "usage_type": "call" }, { "api_name": "clld.web.datatables.source.Sources", "line_number": 29, ...
650696173
from django.db.models.signals import post_save, pre_delete from django.dispatch import receiver from rest_framework.authtoken.models import Token from application import settings from core.models import WatchableModel, User from event.models import add_event_for_object from .models import ModelWithAuthor, Like from .t...
null
core/signals.py
signals.py
py
2,005
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.dispatch.receiver", "line_number": 21, "usage_type": "call" }, { "api_name": "django.db.models.signals.post_save", "line_number": 21, "usage_type": "argument" }, { "api_name": "models.Like", "line_number": 21, "usage_type": "name" }, { "api_n...
499609773
# ------------------------------------------------------- # Merge Sorted Array - https://leetcode.com/problems/merge-sorted-array/ # ------------------------------------------------------- # Author: Arshad Mehmood # Github: https://github.com/arshad115 # Blog: https://arshadmehmood.com # LinkedIn: https://www.linkedin....
null
codes/2020-07-22-merge-sorted-array.py
2020-07-22-merge-sorted-array.py
py
1,908
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" } ]
535961985
""" Python Makefile System """ import os import sys import argparse from functools import wraps, partial from distutils import log from pake.config import PAKEFILE_NAME from pake.globals import app, context from pake.exceptions import PakeError class Task(object): """ A decorator make a function be a sub-command ...
null
lib/pake/pake/core.py
core.py
py
1,963
python
en
code
null
code-starcoder2
83
[ { "api_name": "pake.globals.app.subparser.add_parser", "line_number": 41, "usage_type": "call" }, { "api_name": "pake.globals.app.subparser", "line_number": 41, "usage_type": "attribute" }, { "api_name": "pake.globals.app", "line_number": 41, "usage_type": "name" }, {...
437741559
""" sqlite3 context manager and try-except error handling """ import sqlite3 def create_table(db): try: with db: cur = db.cursor() cur.execute('create table phones (brand text, version int)') except sqlite3.Error as e: print(f'error creating table because {e}') def ...
null
sqlite/db_context_manager_error_handling.py
db_context_manager_error_handling.py
py
1,673
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.Error", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sqlite3.Error", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sqlite3.Error", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sqlite3.Erro...
104167045
import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets, transforms import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import cv2 import shy import os import os.path as osp from train import Net shy.err_hook() CUR_DIR = osp.dirnam...
null
grad-CAM/vis-simple.py
vis-simple.py
py
2,369
python
en
code
null
code-starcoder2
83
[ { "api_name": "shy.err_hook", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.join", "line_number"...
506219078
"""Code snippets vol-44-snip-220 220-Difference between two dates stevepython.wordpress.com Download all snippets so far: https://wp.me/Pa5TU8-1yg Requirements: None source: https://gist.github.com/amalgjose/c767a4846d6ecaa3b6d7 """ from datetime import datetime from dateutil import relativedelta ...
null
Python-code-snippets-201-300/220-Difference between two dates.py
220-Difference between two dates.py
py
856
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "call" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 25, "usage_type": "call" }, { "api_name...
97397963
from django.http import HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render, get_object_or_404 # Create your views here. from django.urls import reverse from django.utils import timezone from characters.forms import CreateCharacterForm from characters.models import Character, BasicStats f...
null
hgapp/characters/views.py
views.py
py
6,043
python
en
code
null
code-starcoder2
83
[ { "api_name": "characters.forms.CreateCharacterForm", "line_number": 18, "usage_type": "call" }, { "api_name": "characters.models.BasicStats", "line_number": 20, "usage_type": "call" }, { "api_name": "characters.models.Character", "line_number": 22, "usage_type": "call" ...
222253029
import cv2 import numpy as np num = input("Type 0 or 1 to show image \n") print(num) path = "images/sample{}.jpg" img = cv2.imread(path.format(num)) kernelSize = 5 kernel = np.ones((5,5),np.uint8) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV) blur_gray = cv2.GaussianBlur(gray,...
null
source.py
source.py
py
1,039
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number":...
95312101
from collections import namedtuple from statistics import mean from functools import wraps from util import count_syllables from tagging import AnnotatedDocument, AnnotatedSentence, AnnotatedParagraph Metric = namedtuple( 'Metric', ('code', 'name', 'description'), ) class MetricRegistry: def __init__(sel...
null
writerlint/metrics.py
metrics.py
py
2,943
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 39, "usage_type": "call" }, { "api_name": "tagging.AnnotatedDocument", "line_number": 66, "usage_type": "argument" }, { "api_name": "t...
172920357
#!/usr/bin/env python # coding: utf-8 # In[1]: ### GT ID: cchen376 ### Assignment #1 CS7641 Fall 2019 import pandas as pd import numpy as np import time from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA,FastICA from sklearn.cluster import KMeans import matplotlib.pyplot as plt ...
null
ICA_cchen376.py
ICA_cchen376.py
py
7,747
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 41, "usage_type": "call" }, { "api_name": "sklearn.preproces...
550014964
import cv2 import numpy as np class SlidingWindowLocalization: """ Uses sliding window localization to localize the human's centroid using a Haar Cascade model """ def __init__(self, images): images = np.array(images) images = images.reshape(images.shape[0], 240, 320) height = ...
null
versions/swl2/slidingwindow.py
slidingwindow.py
py
2,941
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 66, "usage_type": "attribute" }, { "api_name": "versions.swl1.main...
202600481
import sys import csv from csv import reader import numpy as np from sklearn.naive_bayes import GaussianNB from sklearn.metrics import roc_auc_score, precision_score from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import GradientBoostingClassifier from sklearn.svm import SVC from sklearn.linear_m...
null
src/model/core.py
core.py
py
6,765
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 36, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 41, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 52, "usage_type": "call" }, { "api_name": "sklearn.mo...
472183572
# run with # python test_dask_proc.py import yt import os from dask.distributed import Client from profiler import ProfileManager, test_info from timeit import default_timer as timer if __name__ == "__main__": c = Client(n_workers = 4, threads_per_worker=1) ds = yt.load_sample("snapshot_033") ttype = ...
null
code/test_dask_proc.py
test_dask_proc.py
py
1,121
python
en
code
null
code-starcoder2
83
[ { "api_name": "dask.distributed.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "yt.load_sample", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "li...
518548683
#!/usr/bin/python #_*_ encoding:utf-8_*_ """ 日志管理模块 """ import logging """创建日志""" logger = logging.getLogger(__name__) logger.setLevel(level = logging.INFO) handler = logging.FileHandler("Scraping_log2.txt") handler.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(messag...
null
Scraping/practice/Douyu/log.py
log.py
py
404
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO",...
628111448
import numpy as np import cv2 import time confThreshold = 0.5 nmsThreshold = 0.2 inpWidth = 416 inpHeight = 416 def get_coods(img, outs): frameHeight, frameWidth = img.shape[0], img.shape[1] classIds, confidences, boxes = [], [], [] for out in outs: for detection in out: ...
null
programs/background_change.py
background_change.py
py
2,506
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.argmax", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.dnn.NMSBoxes", "line_number": 33, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 33, "usage_type": "attribute" }, { "api_name": "time.time", "line_numb...
215217540
#!/usr/bin/env python3 ''' This is a set of functions used by pymm scripts This file is organized into 4 main sections: * CONFIG CHECK STUFF * PYMM ADMIN / LOGGING STUFF * FILE CHECK STUFF * SYSTEM / ENVIRONMENT STUFF ''' import configparser from datetime import date import glob import hashlib import json import ...
null
pymmFunctions.py
pymmFunctions.py
py
27,072
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.join", "line...
360756884
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (C) 2007-2012 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Django modules from django.db import models # Third-party modules from south.db i...
null
sa/migrations/0004_no_task.py
0004_no_task.py
py
1,302
python
en
code
null
code-starcoder2
83
[ { "api_name": "south.db.db.delete_table", "line_number": 16, "usage_type": "call" }, { "api_name": "south.db.db", "line_number": 16, "usage_type": "name" }, { "api_name": "south.db.db.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "south.d...
141517354
# -*- coding: utf-8 -*- from time import sleep import sys import random import cloud4rpi import psutil import rpi import os import re from statistics import mean pattern = re.compile("^cpu[0-9]?\-thermal$") #import RPi.GPIO as GPIO # pylint: disable=F0401 # Put your device token here. To get the token, # sign up at...
null
cloud4rpi_monitor.py
cloud4rpi_monitor.py
py
3,774
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "psutil.cpu_percent", "line_number": 38, "usage_type": "call" }, { "api_name": "psutil.cpu_freq", "...
444973323
#libraries from PIL import Image import numpy as np import matplotlib.pyplot as plt from matplotlib import rc #import pandas as pd def plot_stacked_bar(bars1, bars2, names, file_name): # y-axis in bold rc('font', weight='bold') # Values of each group # bars1 = [12, 28, 1, 8, 22] # bars2 = [28, 7...
null
Zoom/graph.py
graph.py
py
1,449
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.rc", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.add", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
130524939
''' Copyright (C) 2018 Busacca Davide This file is part of PV. PV is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation (FSF), either version 3 of the License, or (at your option) any later version. ...
null
spectrogram/ISTFT.py
ISTFT.py
py
4,546
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number...
372976317
# 主要作用是载入数据集,处理npz文件,因为keras自带的访问不能获取,只能本地完成了 # (X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=max_features)input_file = "D:\用户目录\Desktop\郭磊\keras\imdb.npz" from __future__ import absolute_import from six.moves import zip import numpy as np import json import warnings # 下面的函数是keras的sequence的自带函数,但是我导入不...
null
imdb.py
imdb.py
py
4,179
python
en
code
null
code-starcoder2
83
[ { "api_name": "six.moves.zip", "line_number": 22, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_...
89472880
from pytorch_rrt import UniformActionSpace, ActionDescription, \ UniformStateSpace, State, StateDescription, \ KinodynamicRRT, Visualizer from typing import Iterable import torch # from window_recorder.recorder import WindowRecorder import matplotlib.pyplot as plt class TwoDActionSpace(UniformActionSpace): ...
null
tests/twod.py
twod.py
py
2,845
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytorch_rrt.UniformActionSpace", "line_number": 11, "usage_type": "name" }, { "api_name": "pytorch_rrt.ActionDescription", "line_number": 16, "usage_type": "call" }, { "api_name": "pytorch_rrt.ActionDescription", "line_number": 17, "usage_type": "call" },...
282892793
# vi: set shiftwidth=4 tabstop=4 expandtab: import datetime import re import itertools def get_program_from_file(file_path="day14_input.txt"): with open(file_path) as f: return [l.strip() for l in f] # mask = X100110110X011000101000101XX11001X11 mask_re = re.compile(r"^mask = (?P<mask>[01X]+)$") # mem[5...
null
day14.py
day14.py
py
3,513
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
175701350
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Fred Callaway # Copyright (c) 2015 Fred Callaway # Copyright (c) 2017 FichteFoll <fichtefoll2@googlemail.com> # # License: MIT # """This module exports the Mypy plugin class.""" import logging import os import re im...
null
linter.py
linter.py
py
4,822
python
en
code
null
code-starcoder2
83
[ { "api_name": "getpass.getuser", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "SublimeLinter.lint.PythonLinter", "line_number": 35, "usage_type": "name" }, { "api_name": "Sub...
146572208
import asyncio from contextlib import suppress from copy import copy from io import BytesIO import discord from redbot.core import commands, checks, Config from redbot.core.utils import common_filters, mod from redbot.core.utils.chat_formatting import pagify, humanize_list from redbot.core.i18n import Trans...
null
cogs/CogManager/cogs/rift/rift.py
rift.py
py
15,090
python
en
code
null
code-starcoder2
83
[ { "api_name": "redbot.core.utils.mod", "line_number": 13, "usage_type": "argument" }, { "api_name": "redbot.core.checks.check_permissions", "line_number": 13, "usage_type": "attribute" }, { "api_name": "redbot.core.checks", "line_number": 13, "usage_type": "name" }, {...
359906849
import pyglet from game import star, bulk_load, player, meteorite game_window = pyglet.window.Window(800, 600) #pyglet的批量绘制 main_batch = pyglet.graphics.Batch() #设置文字标签,需要将batch对象传递给物体的构造函数(使用关键字 batch) level_label = pyglet.text.Label(text="It's a star Game ^。^!", x=400, y=575, anchor_x='center', batch=main_batch) ...
null
python_game2/version/stars.py
stars.py
py
5,108
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyglet.window.Window", "line_number": 4, "usage_type": "call" }, { "api_name": "pyglet.window", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pyglet.graphics.Batch", "line_number": 7, "usage_type": "call" }, { "api_name": "pyglet.gra...
579106880
from django.shortcuts import render from django.http import HttpResponse from django.http import response , request from listings.models import Listings from listings.models import Realtor from listings.choices import price_choices, bedroom_choices, state_choices # Create your views here. def index(request): listi...
null
pages/views.py
views.py
py
895
python
en
code
null
code-starcoder2
83
[ { "api_name": "listings.models", "line_number": 10, "usage_type": "name" }, { "api_name": "listings.models.Listings.objects.order_by", "line_number": 10, "usage_type": "call" }, { "api_name": "listings.models.Listings.objects", "line_number": 10, "usage_type": "attribute"...
91458234
import gym from gym import error, spaces, utils import numpy as np import os from .agent import Agent import matplotlib.pyplot as plt ACTIONS = {'MOVE_LEFT': [0, -1], # Move left 'MOVE_RIGHT': [0, 1], # Move right 'MOVE_UP': [-1, 0], # Move up 'MOVE_DOWN': [1, 0], # Move down ...
null
pettingzoo/mappo_ssd/utils/grid_world.py
grid_world.py
py
48,912
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.random.RandomState", "line_number": 74, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 74, "usage_type": "attribute" }, { "api_name": "agent.action_s...
508639267
from osgeo import gdal, gdalnumeric, ogr, gdal_array import sys sys.path.append(r'C:\Program Files\GDAL') # import ogr # import gdal_array from skimage import measure import numpy as np import json import os import datetime from shapely.geometry import Polygon # get all the fillpath in the directory include sub-di...
null
czhUtils.py
czhUtils.py
py
10,600
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.isfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number...
453111214
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import os, re import markdown as md from constants import places from utilities import indent, renderDate class Post(object): ''' Object that holds information about a post. Can render itself into HTML. ''' def __init__(self, filename, title, tags, kin...
null
engine/post.py
post.py
py
4,478
python
en
code
null
code-starcoder2
83
[ { "api_name": "markdown.markdown", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.exists", "lin...
338598408
import os import re import time import numpy as np from subprocess import Popen, PIPE from ipyparallel import Client from ram.aws.stream_reader import NonBlockingStreamReader as NBSR aws_data = os.path.join(os.getenv('DATA'), 'ram', 'aws') class ClusterController(object): configured_regions = ['us-west-1a', 'us...
null
ram/aws/cluster.py
cluster.py
py
12,464
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15...
128409060
from functools import lru_cache import boto3 import itertools from collections import defaultdict from operator import itemgetter from typing import List, MutableMapping from django.conf import settings from rest_framework.fields import ( BooleanField, CharField, ChoiceField, DateField, DecimalField, EmailField, ...
null
core/utils.py
utils.py
py
7,467
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.MutableMapping", "line_number": 25, "usage_type": "name" }, { "api_name": "operator.itemgetter", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.def...
429678554
import random import json """ 1. Создать программно файл в текстовом формате, записать в него построчно данные, вводимые пользователем. Об окончании ввода данных свидетельствует пустая строка. """ print("*" * 50 + " 1 " + "*" * 50) with open('5_1.txt', 'w') as file: name = input('Введите свое имя: ') file.wri...
null
lesson_5.py
lesson_5.py
py
7,956
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.random", "line_number": 95, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 167, "usage_type": "call" } ]
502123428
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import paho.mqtt.client as mqtt import subprocess import time import re import configparser as ConfigParser import threading import os # Default configuration config = { 'mqtt': { 'broker': 'localhost', 'port': 1883, 'prefix': 'media', ...
null
bridge.py
bridge.py
py
4,700
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_...
288915456
import sys import os import time import datetime import redis import json # Smykowski takes the specifications from the customers and brings them down to # the software engineers. # XXX: maybe these should be to stdout instead of stderr, I dunno def debug(msg, force_debug=False): if DEBUG or force_debug: msg_ou...
null
smykowski/smykowski.py
smykowski.py
py
6,287
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stderr.write", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.stderr.flush", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
19777276
import pytest import numpy as np from os import path from astropy.io import fits from astropy import wcs from astropy.coordinates import SkyCoord import astropy.units as u from .utils_for_test import create_test_ffis from ..make_cube import CubeFactory from ..cube_cut import CutoutFactory from ..exceptions import Inv...
null
astrocut/tests/test_cube_cut.py
test_cube_cut.py
py
12,764
python
en
code
null
code-starcoder2
83
[ { "api_name": "astropy.io.fits.open", "line_number": 38, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 38, "usage_type": "name" }, { "api_name": "astropy.coordinates.SkyCoord", "line_number": 41, "usage_type": "call" }, { "api_name": "ast...
511985183
from threading import Thread import numpy as np import pandas as pd from flask import Flask, jsonify, request from clf import run, load_model from flask_swagger_ui import get_swaggerui_blueprint app = Flask(__name__) ### swagger specific ### SWAGGER_URL = '/swagger' API_URL = '/static/swagger.json' SWAGGERUI_BLUEPRIN...
null
routes.py
routes.py
py
1,950
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_swagger_ui.get_swaggerui_blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 33, "usage_type": "call" }, { "api_name": "...
348820320
import json from io import BytesIO from unittest import mock import boto3 import numpy as np import pytest from PIL import Image from ..conftest import AWS_ENDPOINT_URI from ..fixtures.payloads import umd_glad_alerts_payload, umd_tree_cover_loss_payload @pytest.mark.e2e @pytest.mark.parametrize("x, y, multiplier", ...
null
tests/routes/test_raster_tiles.py
test_raster_tiles.py
py
5,700
python
en
code
null
code-starcoder2
83
[ { "api_name": "io.BytesIO", "line_number": 38, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 39, "usage_type": "call" }, { "api_name": "conftest.AWS_ENDPOINT_URI", "line_number": 39, "usage_type": "name" }, { "api_name": "pytest.mark", "...
48830805
#!/usr/bin/env python import os import pytest from gluon.contrib.webclient import WebClient import copy """ These tests run based on webclient and need web2py server running. """ new_innovation_data = dict(name='This is an innovation generated from automated tests', overview='This is an in...
null
tests/controllers/test_default_controller_webclient.py
test_default_controller_webclient.py
py
4,962
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.skip", "line_number": 47, "usage_type": "call" }, { "api_name": "pytest.skip", "line_number": 58, "usage_type": "call" }, { "api_name": "gluon.contrib.webclient.WebClient", "line_number": 59, "usage_type": "argument" }, { "api_name": "os.envi...
304140543
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from ctypes import c_double, c_int from mpi4py import MPI import numpy as np import sys from lammps import lammps from p...
null
pylammpsmpi/mpi/lmpmpi.py
lmpmpi.py
py
13,911
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 63, "usage_type": "call" }, { "api_name": "mpi4py.MPI.COMM_WORLD", "line...
227304193
import os from unittest import mock import pytest from django.conf import settings from django.test import TestCase from metaci.build.management.commands.run_build import Command from metaci.build.models import Build from metaci.conftest import ( BranchFactory, OrgFactory, PlanFactory, PlanRepositoryF...
null
metaci/build/management/commands/tests/test_run_build.py
test_run_build.py
py
2,683
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 25, "usage_type": "name" }, { "api_name": "metaci.conftest.RepositoryFactory", "line_number": 33, "usage_type": "call" }, { "api_name": "metaci.conftest.BranchFactory", "line_number": 34, "usage_type": "call" }, { ...
117448425
# Name: Renacin Matadeen # Date: 04/20/2020 # Title Open CV Research # # -------------------------------------------------------------------------------------------------------------------...
null
Misc/OpenCv_Research.py
OpenCv_Research.py
py
1,952
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", ...
442793660
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.urls import reverse from . models import * from django.template.loader import render_to_string from json import loads, dumps from django.core.paginator import Paginator from django.db.models import F...
null
store/comented_view.py
comented_view.py
py
30,668
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.loader.render_to_string", "line_number": 19, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 23, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 26, ...
308327852
import scrapy from scrapy.http import HtmlResponse from leroyparser.items import LeroyparserItem from scrapy.loader import ItemLoader class LeroymerlinSpider(scrapy.Spider): name = 'leroymerlin' allowed_domains = ['leroymerlin.ru'] def __init__(self, text): self.start_urls = [f'https://leroymerli...
null
Lesson 7/leroyparser/spiders/leroymerlin.py
leroymerlin.py
py
1,386
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "scrapy.http.HtmlResponse", "line_number": 14, "usage_type": "name" }, { "api_name": "scrapy.http.HtmlResponse", "line_number": 23, "usage_type": "name" }, { "api_name": "s...
96833340
from django.db import models import os import graphene from modelcluster.fields import ParentalKey from modelcluster.models import ClusterableModel from wagtail.utils.decorators import cached_classmethod from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel, ObjectList, StreamFieldPanel, Ta...
null
joplin/base/models.py
models.py
py
24,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "wagtail.images.models.AbstractImage", "line_number": 29, "usage_type": "name" }, { "api_name": "wagtail.images.models.Image.admin_form_fields", "line_number": 30, "usage_type": "attribute" }, { "api_name": "wagtail.images.models.Image", "line_number": 30, "...
163490273
from src.platform.tomcat.authenticate import checkAuth from src.platform.tomcat.interfaces import TINTERFACES from requests import exceptions from cprint import FingerPrint from re import findall from log import LOG import utility class FPrint(FingerPrint): def __init__(self): self.platform = "tomcat" ...
null
src/platform/tomcat/fingerprints/Tomcat4.py
Tomcat4.py
py
1,402
python
en
code
null
code-starcoder2
83
[ { "api_name": "cprint.FingerPrint", "line_number": 9, "usage_type": "name" }, { "api_name": "src.platform.tomcat.interfaces.TINTERFACES.APP", "line_number": 14, "usage_type": "attribute" }, { "api_name": "src.platform.tomcat.interfaces.TINTERFACES", "line_number": 14, "us...
333349377
from pathlib import Path import os import os.path as osp import logging # set up directories HOME = str(Path.home()) CACHE = osp.join(HOME, '.dbinspector') LOGS = osp.join(CACHE, 'logs') # parsed UNIPROT = osp.join(CACHE, 'uniprot') REFSEQ = osp.join(CACHE, 'refseq') # downloads DATA = osp.join(CACHE, 'data') REFSEQ_F...
null
dbi_pkg/dbinspector/startup.py
startup.py
py
777
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path.home", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
471852386
import os import socket import unittest import subprocess import dbma.checkings as checkings from datetime import datetime class CheckingsTeestCase(unittest.TestCase): """ """ @classmethod def setUpClass(cls): super().setUpClass() # create a socket server cls.ip = '127.0.0.1' ...
null
tests/test_checkings.py
test_checkings.py
py
3,126
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "name" }, { "api_name": "socket...
387581399
# -*- coding: utf-8 -*- import pytz from pytest import raises, approx import astral.geocoder def location_count(name, locations): return len(list(filter(lambda item: item.name == name, locations))) class TestDatabase: """Test database access functions""" def test_all_locations(self, test_database): ...
null
src/test/test_geocoder.py
test_geocoder.py
py
4,330
python
en
code
null
code-starcoder2
83
[ { "api_name": "astral.geocoder.geocoder.all_locations", "line_number": 16, "usage_type": "call" }, { "api_name": "astral.geocoder.geocoder", "line_number": 16, "usage_type": "attribute" }, { "api_name": "astral.geocoder", "line_number": 16, "usage_type": "name" }, { ...
194736369
import re from pylatex import (Alignat, Center, Document, LargeText, LineBreak, Math, MediumText, PageStyle, Section, Subsection) from pylatex.utils import NoEscape, bold, italic class EquationsGenerator: def __init__(self, equations): geometry_options = { "head": "2.5cm"...
null
SIRModel/EquationsGenerator.py
EquationsGenerator.py
py
1,510
python
en
code
null
code-starcoder2
83
[ { "api_name": "pylatex.Document", "line_number": 16, "usage_type": "call" }, { "api_name": "pylatex.Center", "line_number": 31, "usage_type": "call" }, { "api_name": "pylatex.Section", "line_number": 32, "usage_type": "call" }, { "api_name": "pylatex.LargeText", ...