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
456946864
import numpy as np import matplotlib.pyplot as plt import scipy.fftpack import obspy from obspy.signal.util import next_pow_2 from make_one_folder import smooth def whiten(data, nt, Nfft, delta, freqmin, freqmax, plot=False): """This function takes 1-dimensional *data* timeseries array, goes to frequency doma...
null
example/whiten_test/whiten.py
whiten.py
py
3,980
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 33, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 34, "usage_type": "call" }, { "api_name": "...
372072367
import pytest import pandas as pd from vivarium_public_health.risks.data_transformations import _rebin_exposure_data, _rebin_relative_risk_data @pytest.mark.parametrize('rebin_categories, rebinned_values', [({'cat1', 'cat2'}, (0.7, 0.3)), ({'cat1'}, (0.5...
null
tests/risks/test_data_transformations.py
test_data_transformations.py
py
2,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "call" }, { "api_name": "vivarium_public_health.risks.data_transformations._rebin_exposure_data", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 7, "usag...
4088557
""" opencadd.structure.pocket.subpocket Defines subpockets. """ import logging import numpy as np import pandas as pd from .utils import _format_residue_ids_and_labels _logger = logging.getLogger(__name__) class Subpocket: """ Class defining a subpocket. Attributes ---------- name : str ...
null
opencadd/structure/pocket/subpocket.py
subpocket.py
py
9,617
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 61, "usage_type": "call" }, { "api_name": "utils._format_residue_ids_and_labels", "line_number": 94, "usage_type": "call" }, { "api_name"...
95997422
import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) from Linux_Helpers.shell import baseShell from config.registers_DC import ftsw_register class ftsw_conf: ID = 00 class ftsw_conf_...
null
equipment/py_ftsw.py
py_ftsw.py
py
5,312
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 2, "usage_type": "call" }, { "api_name": "inspect.getfile", "line...
556559043
import requests from utils.address import address from utils.dict_query import DictQuery data = {'user_id': 'test-user', 'question': 'Hello there', 'session_id': 'CLI-sessionId', 'projectId': 'CA2020', 'overrides': {'BOT_LIST': ['coherence_bot', 'news_bot_v2', 'wiki_bot_mongo'], 'PRIORITY...
null
poke_alana.py
poke_alana.py
py
783
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.post", "line_number": 14, "usage_type": "call" } ]
381235240
# Copyright 2017 Catalyst IT Limited # # 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
runtimes/python2/server.py
server.py
py
5,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 34, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 46, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 46, "usage_type": "name" }, { "api_name": "requests.get", "...
132817120
from ResoFit.calibration import Calibration from ResoFit.fitresonance import FitResonance from ResoFit.experiment import Experiment import matplotlib.pyplot as plt import numpy as np import pprint from ResoFit._utilities import get_foil_density_gcm3 from ResoFit._utilities import Layer import lmfit # Global parameters...
null
ResoFit/data/IPTS_20784/ipts_20784_AgI.py
ipts_20784_AgI.py
py
6,114
python
en
code
null
code-starcoder2
83
[ { "api_name": "ResoFit._utilities.Layer", "line_number": 17, "usage_type": "call" }, { "api_name": "ResoFit.calibration.Calibration", "line_number": 46, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 89, "usage_type": "call" }, { "a...
188387801
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 26 13:50:43 2020 @author: amoth """ import lib.m_utils as mu def largest_palindrome_n_digits(number): largest_palindrome = 10**(number-1) + 1 product_one = 10**number - 1 minimum = 10**(number-1) while product_one >...
null
euler_4.py
euler_4.py
py
706
python
en
code
null
code-starcoder2
83
[ { "api_name": "lib.m_utils.is_palindrome", "line_number": 19, "usage_type": "call" }, { "api_name": "lib.m_utils", "line_number": 19, "usage_type": "name" } ]
94129637
import requests # Python 기본 모듈 - 웹 서버로 요청을 보내고 응답을 처리. from bs4 import BeautifulSoup # 접속할 사이트 주소, 요청(request)를 보낼 웹 서버 주소 url = 'https://search.daum.net/search?w=news&q=%EB%A8%B8%EC%8B%A0%20%EB%9F%AC%EB%8B%9D&DA=YZR&spacing=0' # 웹 서버로 GET 방식의 요청(request)을 보냄 # GET 요청: 웹 서버로 보내는 정보(파라미터)가 URL 주소에 노출되는 방식 # P...
null
lab-python/py10_pandas/pandas18_bs4.py
pandas18_bs4.py
py
1,187
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" } ]
498919860
# -*- coding: utf-8 -*- #################################################### ## ## ## Image Occlusion 2.0 Enhanced ## ## ## ## Copyright (c) Glutanimate 2016 ## ## (https://github.com/Gl...
null
image_occlusion_2/svgutils.py
svgutils.py
py
6,072
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "etree.ElementTree.register_...
82304714
import io import codecs import re from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from pdfminer.pdfpage import PDFPage path_0=('sample2.pdf') #입력파일 경로 설정 def convert_pdf(path): #pdf의 문자를 str로 받음 rsrcmgr = PDFRe...
null
searchpdf_duplicate.py
searchpdf_duplicate.py
py
1,643
python
en
code
null
code-starcoder2
83
[ { "api_name": "pdfminer.pdfinterp.PDFResourceManager", "line_number": 13, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 14, "usage_type": "call" }, { "api_name": "pdfminer.layout.LAParams", "line_number": 16, "usage_type": "call" }, { "api_na...
581025754
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import common.models.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Chart', fields=[ ('...
null
vsp/migrations/0001_initial.py
0001_initial.py
py
1,815
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
601045686
from typing import List from pathlib import Path import traceback import json from tqdm import tqdm from hedgedog.logging import get_logger from hedgedog.nlp.spacy.umls import UmlsCandidateGenerator from hedgedog.tf.estimator.ingredients import dataset_ingredient from el.data.text import Concept, Document, Span log = ...
null
el/data/medmentions.py
medmentions.py
py
3,890
python
en
code
null
code-starcoder2
83
[ { "api_name": "hedgedog.logging.get_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "el.data.text.Document", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "el.data...
98959284
# -*- coding: utf-8 -*- from datetime import date from urllib.parse import urlencode from odoo import models, fields, api from odoo.exceptions import UserError class CashAdvance(models.Model): _name = "cash.advance" _description = "Cash advance Request Form" _inherit = ["mail.thread", "mail.activity.mixin...
null
sunray_cash_advance/models/advance.py
advance.py
py
15,732
python
en
code
null
code-starcoder2
83
[ { "api_name": "odoo.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 8, "usage_type": "name" }, { "api_name": "odoo.api.model", "line_number": 36, "usage_type": "attribute" }, { "api_name": "odoo.api", "...
183858198
# -*- coding: utf-8 -*- """ :math:`J_zA_zB_z` Colourspace ============================= Defines the :math:`J_zA_zB_z` colourspace: - :func:`colour.XYZ_to_JzAzBz` - :func:`colour.JzAzBz_to_XYZ` References ---------- - :cite:`Safdar2017` : Safdar, M., Cui, G., Kim, Y. J., & Luo, M. R. (2017). Perceptually un...
null
colour/models/jzazbz.py
jzazbz.py
py
8,581
python
en
code
null
code-starcoder2
83
[ { "api_name": "colour.utilities.Structure", "line_number": 40, "usage_type": "call" }, { "api_name": "colour.models.rgb.transfer_functions.st_2084.CONSTANTS_ST2084", "line_number": 42, "usage_type": "argument" }, { "api_name": "numpy.array", "line_number": 56, "usage_type...
578363317
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 13 19:36:28 2021 @author: gian """ from flask import Flask, json from pymongo import MongoClient from urllib.parse import urlencode import settings from os import environ USER = environ["DB_USER"] PASS = environ["DB_PASS"] HOST = environ["DB_HOST"]...
null
Clase 13/app.py
app.py
py
3,140
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 17, ...
208454234
"""Credit serializer""" # Django REST Framework from rest_framework import serializers # Models from accounts.models import Credit class CreditModelSerializer(serializers.ModelSerializer): date = serializers.SerializerMethodField() time = serializers.SerializerMethodField() class Meta: """Meta...
null
backend/app/accounts/serializers/credits.py
credits.py
py
1,284
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": ...
208375800
from rest_framework import serializers from farmers.models import Product class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ( "id", "name", "price", "quantity", "featured", "description...
null
T53/webapp/farmers/api/serializers.py
serializers.py
py
405
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "farmers.models.Product", "line_number": 7, "usage_type": "name" ...
424231827
#coding:utf-8 """ 内置函数range的参数必须是整数。请编写一个生成器函数,以浮点数为参数(开始值,结束值,步长)生成某范围的序列 """ import itertools def frange(start,stop=None,step=1): if stop is None: stop = float(start) start = 0.0 assert step for i in itertools.count(): nxt = start + i * step if (step > 0.0 and nxt >= stop...
null
生成器生成浮点数range序列.py
生成器生成浮点数range序列.py
py
525
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.count", "line_number": 13, "usage_type": "call" } ]
2720733
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. from pathlib import Path import pytest from examples_tests.test_util import SubProcessChecker working_path = Path(__file__).parent.parent class TestIPUEstimatorFP16(SubProcessChecker): @pytest.mark.category2 @pytest.mark.ipus(1) def test_run_com...
null
tutorials/tensorflow1/half_precision_training/tests/test_ipuestimator_fp16.py
test_ipuestimator_fp16.py
py
858
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "examples_tests.test_util.SubProcessChecker", "line_number": 11, "usage_type": "name" }, { "api_name": "pytest.mark", "line_number": 13, "usage_type": "attribute" }, { "api_name"...
223703456
import os import requests from bs4 import BeautifulSoup as bs from django import setup class MyException(Exception): pass # os.environ.setdefault("DJANGO_SETTINGS_MODULE", r"D:\DjangoProjects\Engine_Resume\Engine_Resume\settings.py") # setup() base_url = 'https://github.com/MarberyUA?tab=repositories' def git...
null
Resume/parser.py
parser.py
py
1,786
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" } ]
153042619
# 程序中的datatrain.txt和datatest.txt中,要去掉rensor,否则读取文件时会报错 import torch from torch.autograd import Variable from torchvision import transforms from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F import cv2 as cv from capture import getdata root = "./image" LR = 0.001 class MyDataset(D...
null
test.py
test.py
py
5,581
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "cv2.resize", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR", ...
11840027
import scrapy, re class NormSpider(scrapy.Spider): name = 'MinisterialblattBayern' start_urls = ['https://www.verkuendung-bayern.de/amtsblatt/ausgabe/allmbl-2019-1/'] def parse(self, response): def is404(): res = "<h2>AllMBl." not in response.body_as_unicode() ...
null
scraper/spiders/AblBayern.py
AblBayern.py
py
1,439
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 3, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 22, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type": "call" }, { "api_name": "scrapy.Request", "line_number": 3...
517827230
""" This is a modified version of the scrip "run_prediction_on_abide.py" from Dadi et al. 2019. https://github.com/KamalakerDadi/benchmark_rsfMRI_prediction Modifications are (mostly) labeled with #tspisak. """ """Script which starts from timeseries extracted on ABIDE. Timeseries can be downloaded from "https://os...
null
run_prediction_on_abide.py
run_prediction_on_abide.py
py
10,985
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path", "line_number": 66, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_nu...
365652258
import json from klein import route, run from scrapy import signals from scrapy.crawler import CrawlerRunner from spiders.ListSpider import ListSpider from spiders.PositionSpider import PositionSpider from spiders.ComparisonRatingSpider import ComparisonRatingSpider class MyCrawlerRunner(CrawlerRunner): def cra...
null
app.py
app.py
py
1,554
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.crawler.CrawlerRunner", "line_number": 11, "usage_type": "name" }, { "api_name": "scrapy.signals.item_scraped", "line_number": 16, "usage_type": "attribute" }, { "api_name": "scrapy.signals", "line_number": 16, "usage_type": "name" }, { "api_...
265993804
import torch from torch.utils.data import Dataset, DataLoader import torch.nn as nn import torch.optim as optim from torchvision import transforms import time import matplotlib.pyplot as plt import datetime from small_functions import * def calculate_accuracy(predicted_labels,target_labels): equality = torch.eq(...
null
binaryclassifier.py
binaryclassifier.py
py
11,047
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.eq", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.mean", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 32, ...
618941005
from rest_framework import viewsets from rest_framework import status from rest_framework import mixins from rest_framework_xml.renderers import XMLRenderer from rest_framework.parsers import BaseParser, FileUploadParser from defusedxml import ElementTree from rest_framework.exceptions import ParseError from rest_fr...
null
cdws_api/views.py
views.py
py
35,499
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 83, "usage_type": "call" }, { "api_name": "rest_framework.mixins.RetrieveModelMixin", "line_number": 86, "usage_type": "attribute" }, { "api_name": "rest_framework.mixins", "line_number": 86, "usage_type": "name" }, { ...
78265339
from cfn_sphere.exceptions import NoConfigException from yaml.scanner import ScannerError import yaml import os class Config(object): def __init__(self, config_file=None, config_dict=None): if config_dict: self.dict = config_dict self.working_dir = None else: s...
null
src/main/python/cfn_sphere/stack_configuration/__init__.py
__init__.py
py
2,418
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 15, "usage_type": "call" }, { "api_name": "cfn_sphere.exceptions.N...
389878236
#!/usr/bin/env python3 import collections import copy import hashlib import html import itertools import math import os import pathlib import pprint import sys from datetime import datetime, timedelta import mpyq from s2protocol import versions from model import ( get_engine, get_replays_row_by_sha256, in...
null
python/populate_db.py
populate_db.py
py
20,557
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 205, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 208, "usage_type": "call" }, { "api_name": "os.path", "line_number": 208,...
439533560
from sklearn.ensemble import RandomForestClassifier from xgboost import XGBClassifier from sklearn.svm import OneClassSVM from sklearn.metrics import confusion_matrix, accuracy_score, precision_score, recall_score, f1_score from sklearn.decomposition import PCA from sklearn.model_selection import GridSearchCV, train_te...
null
smart-optimizer/models.py
models.py
py
6,359
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_score", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 15, "usage_type": "call" }, { "api_n...
584222408
# Parsing priority: command-line > config-file > defualt params import argparse import configparser from collections import OrderedDict # Default (arg, value) pairs for argparse object dflt_args = { 'target_name': 'AUC', 'target_transform': False, 'train_sources': ['ccle'], 'test_sources': ['ccle'], ...
null
utils/argparser.py
argparser.py
py
8,574
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 70, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 217, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 266, "usage_type": "call" } ]
404812716
#!/usr/bin/python3 # coding=utf-8 # Author: 王豪 # Function: 反馈神经网络 # 重新写成多个隐藏层的试一试 import math import random import copy #random.seed(0) def makeMatrix(I, J, fill=0.0): """ 创建一个矩阵(可以考虑用NumPy来加速 :param I: 行数 :param J: 列数 :param fill: 填充元素的值 :return: """ m = [] for i in range(I): ...
null
Projects/毕业设计/handler/mine.py
mine.py
py
15,336
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.uniform", "line_number": 36, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 54, "usage_type": "call" }, { "api_name": "pdb.set_trace", "line_number": 56, "usage_type": "call" }, { "api_name": "random.uniform", "line_numb...
162223785
from libraptorq import RQDecoder, RQError import base64 def RaptorQDecode(symbols, data_len, oti_common, oti_scheme): b64_decode = lambda s:\ base64.urlsafe_b64decode(bytes(s))\ if '-' in s or '_' in s else bytes(s).decode('base64') with RQDecoder(oti_common, oti_scheme) as dec: fo...
null
Core/Decoders.py
Decoders.py
py
561
python
en
code
null
code-starcoder2
83
[ { "api_name": "base64.urlsafe_b64decode", "line_number": 6, "usage_type": "call" }, { "api_name": "libraptorq.RQDecoder", "line_number": 9, "usage_type": "call" }, { "api_name": "libraptorq.RQError", "line_number": 14, "usage_type": "name" } ]
404792781
import tushare as ts from boost_tushare._passwd import TUS_TOKEN ts.set_token(TUS_TOKEN) pro = ts.pro_api() trade_date = '20191010' start_date = '20200301' end_date = '20200317' df = pro.index_weight(index_code='399300.SZ', trade_date='20191031') df = ts.pro_bar('000785.SZ', asset='E', start_date=start_date, end_d...
null
tests/test_tushare_api.py
test_tushare_api.py
py
1,430
python
en
code
null
code-starcoder2
83
[ { "api_name": "tushare.set_token", "line_number": 5, "usage_type": "call" }, { "api_name": "boost_tushare._passwd.TUS_TOKEN", "line_number": 5, "usage_type": "argument" }, { "api_name": "tushare.pro_api", "line_number": 6, "usage_type": "call" }, { "api_name": "tu...
454855173
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$',views.index,name='index'), url(r'^data$',views.data,name='data'), url(r'^bin1$',views.bin1,name='bin1'), url(r'^maps$',views.maps,name='maps'), url(r'^bin2$',views.bin2,name='bin2'), url(r'^bin3$',views.bin3,name='bi...
null
IOT_Project/IOT_app/urls.py
urls.py
py
426
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
593916609
import numpy as np import pandas as pd import src.constants as c from src.model import vggvox_model from src.preprocess import build_buckets from src.wav_reader import get_fft_spectrum from pydub import AudioSegment from scipy.spatial.distance import cdist import os model = vggvox_model() model.load_weights(c.WEIGHT...
null
test.py
test.py
py
1,842
python
en
code
null
code-starcoder2
83
[ { "api_name": "src.model.vggvox_model", "line_number": 13, "usage_type": "call" }, { "api_name": "src.constants.WEIGHTS_FILE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "src.constants", "line_number": 14, "usage_type": "name" }, { "api_name": "...
179961990
from bank_consulter_skill.models.slots import DesiredCurrencySlot, OptionIntentsSlot, NeedListDocsAndTarifsSlot, \ ClientServiceRegionSlot, ClientIsResidentRFSlot, ClientPropertyTypeSlot, ClientAgreeWithServicePackConditionsSlot, \ ClientOkToSelfServiceSlot, ClientIsReadyToGiveDocsSlot, ClientWantsNearestOffice...
null
hello_bot/components/slots/slots_manager.py
slots_manager.py
py
6,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "bank_consulter_skill.models.slots.DesiredCurrencySlot", "line_number": 25, "usage_type": "name" }, { "api_name": "bank_consulter_skill.models.slots.OptionIntentsSlot", "line_number": 26, "usage_type": "name" }, { "api_name": "bank_consulter_skill.models.slots.NeedL...
239727270
import socket import threading import struct import cv2 import io import numpy as np import traceback as tb from PIL import Image from manager import manager from convertor import Convertor from multiprocessing import Process, Pool from detector.detector import MultiPeopleDetector import gc from collections import dequ...
null
main.py
main.py
py
3,708
python
en
code
null
code-starcoder2
83
[ { "api_name": "manager.manager", "line_number": 22, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 23, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM"...
147134015
#! /usr/bin/python # Copyright 2019 Nokia # # 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 ...
null
validators/src/NetworkProfilesValidation.py
NetworkProfilesValidation.py
py
39,055
python
en
code
null
code-starcoder2
83
[ { "api_name": "cmframework.apis.cmvalidator.CMValidator", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cmframework.apis.cmvalidator", "line_number": 24, "usage_type": "name" }, { "api_name": "cmdatahandlers.api.validation.ValidationError", "line_number": 144...
235701561
# This runs the saved neural network and sends predictions to the arduino during test time # Packages from remote server import socket import time import sys import csv import cv2 as cv2 import numpy as np import threading # Packages from best net import tensorflow as tf from keras.models import model_from_yaml from ...
null
MAIN/OTHERS/SMART_CAR.py
SMART_CAR.py
py
4,730
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.models.model_from_yaml", "line_number": 33, "usage_type": "call" }, { "api_name": "tensorflow.get_default_graph", "line_number": 39, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 55, "usage_type": "call" }, { "api_na...
573192384
import logging as log import os import lciafmt import fedelemflowlist as fedefl from lciafmt.util import outputpath, store_method method = lciafmt.Method.FEDEFL_INV def main(): os.makedirs(outputpath, exist_ok=True) log.basicConfig(level=log.INFO) file = method.get_filename() log.info(fedefl.subset_l...
null
examples/fedefl_inventory_methods.py
fedefl_inventory_methods.py
py
699
python
en
code
null
code-starcoder2
83
[ { "api_name": "lciafmt.Method", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 11, "usage_type": "call" }, { "api_name": "lciafmt.util.outputpath", "line_number": 11, "usage_type": "argument" }, { "api_name": "logging.ba...
332016175
from tkinter import * import re import sys import lxml import unittest import requests from bs4 import BeautifulSoup #from beautifulsouptest import FollowThatTag #from beautifulsouptest import SoupTest ####################### # File: StackoverflowJobs.py # Author: Prince D. Vonleh # Date: Feburary 2018 class Disp...
null
project1_devSeminar/StackOverflow.py
StackOverflow.py
py
3,632
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stdout", "line_number": 33, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 70, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 88, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line...
404717695
from torch import nn import torch from torchvision import models,transforms,datasets import torch.nn.functional as F from senet import se_resnet50,se_resnext101_32x4d,se_resnext50_32x4d, se_resnext26_32x4d class multiscale_se_resnext_HR(nn.Module): def __init__(self,num_class, pretrain = True): super(multi...
null
2019BaiduXJTU/basenet/multiscale_se_resnext_HR.py
multiscale_se_resnext_HR.py
py
1,209
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "senet.se_resnext50_32x4d", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.load", ...
587160486
''' Created on Nov 13, 2017 @author: moose-home ''' import requests, json, urllib.parse, time, random, datetime, threading # Constant base_url = 'http://www.supremenewyork.com' headers = {'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_4 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/1...
null
supreme.py
supreme.py
py
8,787
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.getrandbits", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.session", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 83, "usage_type": "call" }, { "api_name": "datetime.da...
617184676
import requests, os, bs4 url= 'http://xkcd.com' os.makedirs('xkcd',exist_ok=True) while not url.endswith('#'): #donwloading the page print('Downloading page %s...' %url) res= requests.get(url) res.raise_for_status() soup =bs4.BeautifulSoup(res.text) #find all the URL of the comic image comicElem= soup.s...
null
donwloadxkcd.py
donwloadxkcd.py
py
919
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.makedirs", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
106562604
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jan 30 20:00:51 2018 @author: gabriel """ import matplotlib.pyplot as plt import pandas as pd import numpy as np import os os.curdir = ('synRT6/') list_dir = os.listdir(os.curdir) list_ = [] for f in list_dir: raw_ = pd.read_table('synRT6/'+f, hea...
null
Chap1_Introduction/fast-dm/DDMfiles/QPP_Mean.py
QPP_Mean.py
py
5,193
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.curdir", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.curdir", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.read_table", "lin...
257510194
import requests import socket def url_healthcheck(): list_of_names = input('Enter path to file containing list of domain names: ') namefile = open(list_of_names,"r") print('\nChecking list of domain names, only errors will be shown below') print('----------') for name in namefile: try: ...
null
General/url_healthcheck.py
url_healthcheck.py
py
1,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 15, "usage_type": "attribute" }, { "api_name": "socket...
577859353
#!/usr/bin/env python2.7 import os, sys import string import ngb_functions from pysam import VariantFile from pysam import FastaFile from optparse import OptionParser from collections import defaultdict from collections import namedtuple from collections import OrderedDict def run_process(opts, inputvcf): outputv...
null
pipelines/utils/ngb_addTxInfoDbNSFP.py
ngb_addTxInfoDbNSFP.py
py
3,431
python
en
code
null
code-starcoder2
83
[ { "api_name": "pysam.VariantFile", "line_number": 17, "usage_type": "call" }, { "api_name": "pysam.VariantFile", "line_number": 20, "usage_type": "call" }, { "api_name": "optparse.OptionParser", "line_number": 94, "usage_type": "call" }, { "api_name": "sys.exit", ...
312523929
# coding=utf-8 import requests import re from bs4 import BeautifulSoup import traceback import types import codecs import json import sys reload(sys) sys.setdefaultencoding('utf-8') def getHtmlText(url): try: r = requests.get(url,timeout = 30) r.raise_for_status() r.encoding = 'utf-8' ...
null
re_pro/get_stock_info.py
get_stock_info.py
py
2,487
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setdefaultencoding", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" }, { "api_name": "re.findall", ...
279354759
import numpy as np import pandas as pd from sklearn.naive_bayes import MultinomialNB from sklearn.feature_extraction.text import CountVectorizer import re import urllib.request import bs4 as bs class Cuisine_Recommendation(): def get_cuisines_from_website(self): source = urllib.request.urlopen('https://tas...
null
main.py
main.py
py
4,281
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_nam...
211466922
from django.shortcuts import render from django.db.models import Sum, Count from django.db import models from django.http import JsonResponse from django.db.models import F from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.contrib import auth from django.views.decorators.http import r...
null
app/views.py
views.py
py
7,435
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.paginator.Paginator", "line_number": 40, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 43, "usage_type": "call" }, { "api_name": "django.core.paginator.Paginator", "line_number": 46, "usage_type": "call" }, ...
552509489
import geopandas as gpd import matplotlib.pyplot as plt import seaborn as sns import numpy as np import os import folium from folium.raster_layers import ImageOverlay from folium.plugins import MarkerCluster print(folium.__version__) def get_aval_data(shp_file): dt = os.path.split(shp_file)[1].split('.')[0].split...
null
aps/test/geopandas_test.py
geopandas_test.py
py
8,836
python
en
code
null
code-starcoder2
83
[ { "api_name": "folium.__version__", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "geopandas.read_fil...
457507615
import logging import os import serial import signal import sys import time import threading import queue from functools import partial from services import DataStationHandler from services import Heartbeat from services import SerialHandler def setup_logging(): """Set up logging [Logging levels in order of seri...
null
avionics/__main__.py
__main__.py
py
3,402
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getenv", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 26, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", ...
130833708
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from .models import Refeicoe, Comida, CustomUser import re from .forms import CreateNewList from collections import Counter, OrderedDict # Create your views here. def comidaView(request): ls = Comida.objects return ...
null
mysite/mysite/main/views.py
views.py
py
6,128
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Comida.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Comida", "line_number": 11, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "mode...
485010328
import pandas as pd import numpy as np import matplotlib.pyplot as plt ipl_df = pd.read_csv('data/ipl_dataset.csv', index_col=None) def plot_runs_by_balls(): y = ipl_df.groupby(['batsman'])['runs'].sum() y1 = ipl_df.groupby(['batsman'])['delivery'].count() plt.scatter(y1,y) plt.xlabel('No. of balls pl...
null
q04_plot_runs_by_balls/build.py
build.py
py
444
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib...
209958378
import collections import itertools import random from . import ast def scope_ast(nodes, scopes=None, return_types=None): if scopes is None: # We start off with a global scope. scopes = collections.ChainMap() if return_types is None: return_types = {} scoped_nodes = [] retur...
null
weirdc/scoping.py
scoping.py
py
3,707
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.ChainMap", "line_number": 11, "usage_type": "call" }, { "api_name": "itertools.count", "line_number": 19, "usage_type": "call" } ]
422383663
from tkinter import Tk, Label, Button, DISABLED, SUNKEN, E, W from PIL import ImageTk, Image root = Tk() root.title("Simple Image Viewer by princebillygk") images = [ ImageTk.PhotoImage(Image.open('assets/img/pic_1.webp')), ImageTk.PhotoImage(Image.open('assets/img/pic_2.webp')), ImageTk.PhotoImage(Image...
null
main.py
main.py
py
2,940
python
en
code
null
code-starcoder2
83
[ { "api_name": "tkinter.Tk", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "line_number": 9, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line...
134241311
#-*- coding:utf-8 -*- import wx import wx.lib.agw.customtreectrl as CT class MyFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent, -1, "CustomTreeCtrl Demo") # Create a CustomTreeCtrl instance custom_tree = CT.CustomTreeCtrl(self, agwStyle=wx.TR_DEFAULT_STYLE) ...
null
tree.py
tree.py
py
2,060
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.Frame", "line_number": 5, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.lib.agw.customtreectrl....
151277322
import argparse import numpy as np import torch from torch.autograd import Variable from model.ASM_G import Res_Deeplab from dataset.cityscapes_dataset import cityscapesDataSet from torch.utils import data import os from PIL import Image import torch.nn as nn IMG_MEAN = np.array((104.00698793,116.66876762,1...
null
ASM/ASM_evaluate.py
ASM_evaluate.py
py
5,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 33, "usage_type": "call" }, { "api_name": "PIL.Image", "l...
331037800
############################################################################# # # VFRAME # MIT License # Copyright (c) 2020 Adam Harvey and VFRAME # https://vframe.io # ############################################################################# import click from vframe.models import types from vframe.utils impor...
null
vframe_cli/commands/pipe/save-croplets.py
save-croplets.py
py
2,148
python
en
code
null
code-starcoder2
83
[ { "api_name": "vframe.settings.app_cfg.LOG", "line_number": 46, "usage_type": "attribute" }, { "api_name": "vframe.settings.app_cfg", "line_number": 46, "usage_type": "name" }, { "api_name": "vframe.utils.file_utils.ensure_dir", "line_number": 47, "usage_type": "call" }...
20129239
# encoding: utf-8 from __future__ import unicode_literals from blog import views from django.conf.urls import url from django.contrib.auth.decorators import login_required urlpatterns = [ url(r'^$', views.PostList.as_view(), name='posts'), url( r'^post/$', login_required(views.CreatePost.as_v...
null
blog/urls.py
urls.py
py
1,009
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "blog.views.PostList.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "blog.views.PostList", "line_number": 10, "usage_type": "attribute" }, { "api_nam...
640640097
import numpy as np import matplotlib import matplotlib.pyplot as plt #Parametry N = 100 D_u = 2*10**(-5) D_v = 1*10**(-5) F = 0.032 k = 0.056 dx = 0.02 dt = 1 en = 1 t_max = 32000 odcinek = np.linspace(0,2,N) u = np.ones((N,N)) v = np.zeros((N,N)) for i in range(N/4, 3*N/4): for j in range(N/4, 3*N/4): u[...
null
reakcja2.py
reakcja2.py
py
1,160
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "lin...
362914680
# -*- coding: utf-8 -*- # Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
null
pulp_rpm/test/unit/server/test_0010_migrate.py
test_0010_migrate.py
py
5,133
python
en
code
null
code-starcoder2
83
[ { "api_name": "pulp_rpm.devel.rpm_support_base.PulpRPMTests", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pulp_rpm.devel.rpm_support_base", "line_number": 19, "usage_type": "name" }, { "api_name": "pulp_rpm.devel.rpm_support_base.PulpRPMTests.setUp", "line_...
89308793
#!/usr/bin/python # # Copyright 2017 University of Southern California # # 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 requir...
null
rbk/worker/delete_hatrac/client/rbk_delete_hatrac.py
rbk_delete_hatrac.py
py
4,164
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 41, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 42, "usage_type": "attribute" }, { "api_name": "logging.INF...
307631144
""" PCA(Principal Component Analysis) 是一种常见的数据分析方式,常用于高维数据的降维,可用于提取数据的主要特征分量。 将n维特征映射到K维上,这K维是全新的正交特征也被称为主成分,是在原有n维特征的基础上重新构造出来的k维特征 目标:降维后同一纬度的方差最大,不同维度之间的相关性为0,协方差矩阵 """ import matplotlib.pyplot as plt import numpy as np import torch # Generate datasets def generate_data(): """Generate 3 Gaussians samples with ...
null
tensor/pca.py
pca.py
py
2,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.r_", "line_...
410705175
from torch.utils.data import DataLoader import torch from rusenttokenize import ru_sent_tokenize from bpemb import BPEmb from utils import read_config, if_none from tqdm import tqdm import pandas as pd from nltk.tokenize.toktok import ToktokTokenizer import re class InputFeature(object): """A single set of featur...
null
modules/data/bpe_data.py
bpe_data.py
py
8,120
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.DataLoader", "line_number": 41, "usage_type": "name" }, { "api_name": "torch.LongTensor", "line_number": 61, "usage_type": "call" }, { "api_name": "utils.read_config", "line_number": 69, "usage_type": "call" }, { "api_name": "bpemb....
129570917
import torch from torchvision.utils import make_grid import matplotlib.pyplot as plt import numpy as np def show_test(fixed_Y, fixed_X, G_YtoX, G_XtoY, mean_=0.5, std_=0.5): device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") fake_X = G_YtoX(fixed_Y.to(device)) fake_Y = G_XtoY...
null
show_test_file.py
show_test_file.py
py
1,420
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.device", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torchvision.utils.m...
449566117
from datetime import datetime from FundNavSpiders import GGFundNavItem from FundNavSpiders import GGFundNavSpider from urllib.parse import urljoin import re import time class BaoChiInvestSpider(GGFundNavSpider): name = 'FundNav_BaoChiInvest' sitename = '宝驰投资' channel = '投顾净值' allowed_domains = ['www.h...
null
FundNavSpiders/Cookie/BaoChiInvest.py
BaoChiInvest.py
py
2,323
python
en
code
null
code-starcoder2
83
[ { "api_name": "FundNavSpiders.GGFundNavSpider", "line_number": 9, "usage_type": "name" }, { "api_name": "urllib.parse.urljoin", "line_number": 32, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 41, "usage_type": "call" }, { "api_name": "re.find...
281547399
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('Encubarte.plataforma.views', url(r'^admin/', include(admin.site.urls)), #Links publicos: url(r'^$', 'inicioControl', name='vistaPrincipal'), ...
null
Encubarte/urls.py
urls.py
py
604
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api...
311420461
# Copyright (C) 2018-2019 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and ...
null
Tools/BuildSlaveSupport/ews-app/ews/models/buildermapping.py
buildermapping.py
py
3,786
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 31, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 34, "usage_type": "name" }, { "api_name": "django...
350581341
from django import forms from .models import Question, Answer, User class QuestionForm(forms.ModelForm): tag_names = forms.CharField(label='Tags', help_text='Separate tags with a space', widget=forms.TextInput(attrs={'class': ''})) class Meta: model = Question fields = [ 'title...
null
core/forms.py
forms.py
py
895
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "django.f...
427007976
import requests from datetime import datetime def fetchAlbumIds(artist_id): """Using the Spotify API, take an artist ID and returns a list of album IDs in a list """ url = "https://api.spotify.com/v1/artists/" + artist_id + "/albums?album_type=album&market=US" req = requests.get(url) if req.ok...
null
Assignment5/fetchAlbums.py
fetchAlbums.py
py
1,330
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" } ]
54926610
import numpy as np from numpy import pi from matplotlib import pyplot as plt def make_VandermondeT(omega,time): VandermondeT = np.exp(np.outer(time,omega)) return VandermondeT def dmd(data,r,tbase): tbase = tbase[:-1] dt = 1e-6 X = data[:,0:-1] Xprime = data[:,1:] Udmd,Sdmd,Vdmd = np.linal...
null
dmd.py
dmd.py
py
1,386
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.exp", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.outer", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linalg.svd", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number"...
238034572
from unittest.mock import patch, Mock from rest_framework.exceptions import AuthenticationFailed from ms_utils.test import TestCase, get_user from ms_utils.permissions import UserTokenPermission class UserTokenPermissionTest(TestCase): def setUp(self): super().setUp() self.perm = UserTokenPermi...
null
test_app/test_app/app/tests/test_permissions.py
test_permissions.py
py
1,721
python
en
code
null
code-starcoder2
83
[ { "api_name": "ms_utils.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "ms_utils.permissions.UserTokenPermission", "line_number": 13, "usage_type": "call" }, { "api_name": "rest_framework.exceptions.AuthenticationFailed", "line_number": 18, "usage...
411640615
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 12 21:00:43 2020 @author: vld-kh """ import os import numpy as np import cv2 import matplotlib.pyplot as plt def LoadTrain(train_path, img_size): train_ids = next(os.walk(train_path))[1] X_train = np.zeros((len(train_ids), img_size, img_si...
null
code/data.py
data.py
py
1,746
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number":...
228224750
import glob import io import math import numpy as np import plotly as py import plotly.graph_objs as go import plotly.express as px import random import streamlit as st from keras.applications.xception import preprocess_input from keras.models import Model, load_model from keras.preprocessing.image import img_to_array...
null
app.py
app.py
py
4,379
python
en
code
null
code-starcoder2
83
[ { "api_name": "SessionState.get_state", "line_number": 39, "usage_type": "call" }, { "api_name": "streamlit.image", "line_number": 45, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 47, "usage_type": "call" }, { "api_name": "streamlit.butt...
511676289
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import pytest from util import APITester from kona.table.event import Event from kona.table.operation import OperationKVS from konaObject import db def test_CodeWhat_get(): t = APITester() j1 = t.ensure(200, 'Code.What.get()', dict(LANG='ko'), False) j2 =...
null
tests/test_api.py
test_api.py
py
6,774
python
en
code
null
code-starcoder2
83
[ { "api_name": "util.APITester", "line_number": 14, "usage_type": "call" }, { "api_name": "util.APITester", "line_number": 25, "usage_type": "call" }, { "api_name": "kona.table.operation.OperationKVS", "line_number": 30, "usage_type": "call" }, { "api_name": "konaO...
210973155
# https://dmoj.ca/problem/nccc5j3s1 from sys import stdin from statistics import median import itertools vInput = [x.strip() for x in stdin] #vInput=['4 1','1 1 2 2'] n=int(vInput[0].split()[0]) x=int(vInput[0].split()[1]) vList = [ int(x) for x in vInput[1].split() ] vCombination = list(itertools.combinations(vLis...
null
dmoj/cutecenter.py
cutecenter.py
py
442
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stdin", "line_number": 7, "usage_type": "name" }, { "api_name": "itertools.combinations", "line_number": 13, "usage_type": "call" }, { "api_name": "statistics.median", "line_number": 16, "usage_type": "call" } ]
631299
""" BSD 3-Clause License Copyright (c) 2017, Jesus Llorente Santos, Aalto University, Finland All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copy...
null
orchestration/lxc/cesproto_environment/ctbase/rootfs/home/ubuntu/helpers_n_wrappers/iproute2_helper3.py
iproute2_helper3.py
py
4,925
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyroute2.IPRoute", "line_number": 36, "usage_type": "call" }, { "api_name": "pyroute2.IPSet", "line_number": 37, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 45, "usage_type": "name" }, { "api_name": "socket.AF_INET", "...
570684834
# -*- coding: utf-8 -*- """ Update sku_pool.variant_record. format: { "variant_table": table_name, "channel": channel, "shop": shop, "variant_id": variant_id, "batch": batch_id, "psku_rule": psku_variant_rule, } """ import logging import json from sqlalchemy import MetaData,...
null
Python/010/manger/otherScript/variant_record_updater.py
variant_record_updater.py
py
4,905
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.MetaData", "line_number": 17, "usage_type": "call" }, { "api_name": "conf.get_sqla_connec", "line_number": 18, "usage_type": "call" }, { "api_name": "conf.get_sqla_table", "line_number": 19, "usage_type": "call" }, { "api_name": "conf.get...
596180016
import re import traceback from time import sleep from selenium import webdriver URL = "http://kontumtv.vn/category/video-clip/thoi-su/page/{}" SAVE_DIR = "data/kontumtv/thoisu.txt" driver = webdriver.Firefox() for i in range(60, 265): print('page =', i) driver.get(URL.format(str(i))) video_eles = [] ...
null
baodientu/kontumtv.py
kontumtv.py
py
911
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "re.search", "line_number": 22, "usage_type": "call" }, { "api_name": "traceback.print...
152680654
import numpy as np import json sv1 = np.random.rand(18, 1) sv2 = np.random.rand(18, 1) tv = np.random.rand(18, 1) sv0 = np.squeeze(sv1) sv3 = np.squeeze(sv2) tv0 = np.squeeze(tv) vectors = [sv0, sv3, tv0] for v in vectors: count = 0 for x in v: x = x*10 v[count] = x count = count + ...
null
svma_lin.py
svma_lin.py
py
1,431
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.rand", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", ...
467697679
""" Check the existing environment against expected values """ from __future__ import print_function import re import sys import subprocess try: import yaml from colorama import Fore, Style except ImportError: print("The PyYaml and colorama packages are required for this module. To " + "install t...
null
check_packages.py
check_packages.py
py
4,102
python
en
code
null
code-starcoder2
83
[ { "api_name": "colorama.Style.RESET_ALL", "line_number": 21, "usage_type": "attribute" }, { "api_name": "colorama.Style", "line_number": 21, "usage_type": "name" }, { "api_name": "colorama.Fore.LIGHTYELLOW_EX", "line_number": 22, "usage_type": "attribute" }, { "ap...
227576487
import json import os import dialogflow_v2 as dialogflow from flask import Flask,request,jsonify import argparse import uuid os.environ['GOOGLE_APPLICATION_CREDENTIALS']='acquired-ripple-285306-8da5f9a63c48.json' from google.protobuf.json_format import MessageToJson # [START dialogflow_detect_intent_text] def detect...
null
dlf_server/codes/testDialogflow.py
testDialogflow.py
py
3,037
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dialogflow_v2.SessionsClient", "line_number": 22, "usage_type": "call" }, { "api_name": "dialogflow_v2.types.TextInput", "line_number": 27, "usage_type": "call" }, { "api_nam...
47018907
""" Entrypoint for Streamlit server """ import base64 from datetime import datetime import django import numpy as np import streamlit as st import pandas as pd import altair as alt from django.utils import timezone from django.conf import settings from questions.models import Submission START_DATE = timezone.make_a...
null
app/reports/referrals.py
referrals.py
py
3,237
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.utils.timezone.make_aware", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "call" }, { "api_name...
68236834
import importlib import pkgutil import pystiche_papers as package_under_test def test_importability(subtests): def is_private(name): return name.rsplit(".", 1)[-1].startswith("_") def onerror(name): if is_private(name): return with subtests.test(name=name): r...
null
tests/unit/test_smoke.py
test_smoke.py
py
804
python
en
code
null
code-starcoder2
83
[ { "api_name": "pkgutil.walk_packages", "line_number": 18, "usage_type": "call" }, { "api_name": "pystiche_papers.__path__", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pystiche_papers.__name__", "line_number": 20, "usage_type": "attribute" }, { ...
562288022
from setuptools import setup, find_packages from KEGG_parser import __version__ as version from pathlib import Path this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() __author__ = 'lozuponelab' __version__ = version setup( name="KEGG-parser", version=__ve...
null
setup.py
setup.py
py
963
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "KEGG_parser.__version__", "line_number": 9, "usage_type": "name" }, { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.find_p...
528190798
from app import db from app.models import Prediction, Incident, PreCogRun from flask_sqlalchemy import SQLAlchemy import os import datetime import numpy as np from sklearn.ensemble import RandomForestRegressor from sklearn.datasets import make_regression from sqlalchemy import and_ from sqlalchemy import * from sqlalch...
null
precog/app/precogmonths.py
precogmonths.py
py
9,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.envir...
371843160
__author__ = 'user' # bits from http://stackoverflow.com/questions/15173225/how-to-calculate-cosine-similarity-given-2-sentence-strings-python # load_docs, process_docs and compute_vector by MK import math import itertools from collections import Counter vector_dict = {} #Just loads in all the documents def...
null
Similarity/u-distance.py
u-distance.py
py
3,467
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 30, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 36, "usage_type": "call" }, { "api_name": "math.log", "line_number": 48, "usage_type": "call" }, { "api_name": "math.sqrt", "lin...
138559532
# -*- coding: utf-8 -*- import ast import copy import time import numpy as np import bottle from bottle import BaseRequest, error, get, post, response, request, route, \ run, static_file from imageprocessor import ImageProcessor from logger import Logger from sessioncacher import SessionCacher from spots import...
null
server/server.py
server.py
py
8,172
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.simplefilter", "line_number": 21, "usage_type": "call" }, { "api_name": "PIL.Image.DecompressionBombWarning", "line_number": 21, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 21, "usage_type": "name" }, { "api_name"...
428542588
# -*- coding: utf-8 -*- """ Created on Mon Dec 5 15:07:30 2016 @author: felro """ #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Nov 21 23:48:16 2016 @author: Theo """ from lxml import etree tree = etree.parse('http://xml.cdn.betclic.com/odds_en.xml') class competition : def __init__(se...
null
site_aide_pari/bets_with_betclic/data.py
data.py
py
2,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "lxml.etree.parse", "line_number": 19, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 19, "usage_type": "name" } ]
452706876
import sys import os from datetime import datetime import math, copy, time import numpy as np import random import argparse import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Function import _pickle as cPickle import collections import evaluate as e...
null
DeepWMaxSAT_ELMO.py
DeepWMaxSAT_ELMO.py
py
73,559
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 51, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 51, "usage_type": "attribute" }, { "api_name": "torch...
553599700
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('profiles', '0001_initial'), ] op...
null
nutsy/repositories/migrations/0001_initial.py
0001_initial.py
py
2,328
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
589634001
import numpy as np #from pyminc.volumes.factory import * import os from sys import argv, exit from os.path import exists from os import makedirs import argparse #local modules defined in current project from make_and_run_model import * from set_images import * from predict import * from prepare_data import * # fix ra...
null
pet_brainmask_convnet.py
pet_brainmask_convnet.py
py
3,910
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
448643423
import pygame import critter import critter_utils import entities from random import randint class App(object): def __init__(self): self._running = True self._screen = None self._screen_rect = None self._background = None self._size = self._width, self._height = 800, 600 ...
null
src/simulation.py
simulation.py
py
6,987
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pygame.displa...
618038788
#!/usr/bin/env python # -*- encoding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import csv from datetime import datetime, timedelta from io import BytesIO import dateutil.parser from googleapiclient import discovery, http from googleapiclient.errors import HttpError f...
null
starslacker.py
starslacker.py
py
4,997
python
en
code
null
code-starcoder2
83
[ { "api_name": "slacker.Slacker", "line_number": 20, "usage_type": "call" }, { "api_name": "secrets.slack_token", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 21, "usage_type": "call" }, { "api_name": "dat...
527972828
#!/usr/bin/python2.7 #coding=utf-8 from common.config import * from testdata.data_login import * from action.action_login import Login import unittest import logging import time class TestEnterpriseLogin(unittest.TestCase): u''' 测试登录功能 ''' def setUp(self): self.login = Login() self.lo...
null
veeker/testsuite/olsm/test_enterprise_login.py
test_enterprise_login.py
py
3,185
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "action.action_login.Login", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 88, "usage_type": "call" }, { "api_name": "...
85795038
#!/usr/bin/env python2 import os import sys import numpy as np from PIL import Image as IMG from matplotlib import pyplot as plt from gamera.core import * from gamera.toolkits.musicstaves import musicstaves_rl_carter def a2png(arg): fn, ext = os.path.splitext(arg) rfn = "{}.png".format(fn) if not os.path.isfile...
null
gmusix/staves.py
staves.py
py
1,273
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.splitext", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
228699884
from __future__ import print_function """ Code ideas from https://github.com/Newmu/dcgan and tensorflow mnist dataset reader """ import numpy as np import scipy.misc as misc import progressbar import sys from six.moves import xrange import cv2 class BatchDatset: files = [] images = [] annotations = [] ...
null
SeqBatchDatasetReader.py
SeqBatchDatasetReader.py
py
4,503
python
en
code
null
code-starcoder2
83
[ { "api_name": "progressbar.ProgressBar", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 46, "usage_type": "call" }, { "api_name": "progressbar.ProgressBar", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.arr...
554499872
import queue from threading import Thread import socket import websocket import select import time import logging import configparser import os """ Opens up a websocket connection to the given url. Connection can be started with .connection(), disconnected with .disconnect() and messages can be sent and read with .se...
null
networking/connector.py
connector.py
py
6,891
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Thread", "line_number": 15, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 17, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 17, "usage_type": "name" }, { "api_name": "queue.Que...