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
371385870
# gensim modules from gensim import utils from gensim.models.doc2vec import LabeledSentence from gensim.models import Doc2Vec # classifier from sklearn.externals import joblib from sklearn.linear_model import LogisticRegression import os class Sentiment: model=None lr=None def __init__(self, do...
null
src/util/model_sentiment.py
model_sentiment.py
py
2,263
python
en
code
null
code-starcoder2
66
[ { "api_name": "gensim.models.Doc2Vec.load", "line_number": 18, "usage_type": "call" }, { "api_name": "gensim.models.Doc2Vec", "line_number": 18, "usage_type": "name" }, { "api_name": "sklearn.externals.joblib.load", "line_number": 19, "usage_type": "call" }, { "ap...
150718733
from shapely.geometry import LineString, Point from numpy import linalg as la class fold_geometry: def __init__(self): return def is_dynamic(self, pt, fold_line): x0, y0 = fold_line[0] x1, y1 = fold_line[1] x2, y2 = pt val = (x1 - x0)*(y2 - y0) - (x2 - x0)*(y1 - y0) ...
null
python_folding/fold_geometry.py
fold_geometry.py
py
1,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "shapely.geometry.LineString", "line_number": 37, "usage_type": "call" }, { "api_name": "shapely.geometry.LineString", "line_number": 41, "usage_type": "call" }, { "api_name": "shapely.geometry.LineString", "line_number": 43, "usage_type": "call" }, { ...
628874626
""" main for discrete """ # pylint: disable=unused-variable # pylint: disable=line-too-long # pylint: disable=duplicate-code import argparse import pandas as pd from mlxtend.frequent_patterns import apriori from mlxtend.frequent_patterns import association_rules def parse_command_line(): """ reads the comman...
null
axn/ml/transform/__main__.py
__main__.py
py
4,057
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 49, "usage_type": "call" } ]
402281493
from __future__ import unicode_literals import json import re from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.http import JsonResponse from django.conf import settings from .models import Log from .utils import...
null
sms/views.py
views.py
py
2,357
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 29, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 38, "usage_type": "call" }, { "api_name": "django.h...
523945591
from django.core.mail import EmailMultiAlternatives from oscar.apps.customer.models import CommunicationEventType import threading from oscar.core.loading import get_model WishList = get_model('wishlists', 'WishList') WishLine = get_model('wishlists', 'Line') class EmailSender(): def __init__(self,EventType,toE...
null
api/pasalxapi/utils.py
utils.py
py
1,807
python
en
code
null
code-starcoder2
66
[ { "api_name": "oscar.core.loading.get_model", "line_number": 7, "usage_type": "call" }, { "api_name": "oscar.core.loading.get_model", "line_number": 8, "usage_type": "call" }, { "api_name": "oscar.apps.customer.models.CommunicationEventType.objects.get", "line_number": 27, ...
378745365
import csv from datetime import datetime from matplotlib import pyplot as pl def main(): filenames='beijing.csv' with open(filenames) as fl: reader= csv.reader(fl) head_row=next(reader) for index,column in enumerate(head_row): print(index,column) dates...
null
章16/16.1/beijing_0.py
beijing_0.py
py
1,263
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.reader", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
271617865
import opt_einsum import pytest import torch import pyro import pyro.distributions as dist from pyro.distributions.hmm import _sequential_logmatmulexp from pyro.distributions.util import broadcast_shape from pyro.infer import TraceEnum_ELBO, config_enumerate from pyro.ops.indexing import Vindex from tests.common impor...
null
tests/distributions/test_hmm.py
test_hmm.py
py
6,765
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.randn", "line_number": 18, "usage_type": "call" }, { "api_name": "pyro.distributions.hmm._sequential_logmatmulexp", "line_number": 19, "usage_type": "call" }, { "api_name": "opt_einsum.get_symbol", "line_number": 24, "usage_type": "call" }, { ...
53892803
# # Copyright (c) 2016 Stefan Seefeld # All rights reserved. # # This file is part of Faber. It is made available under the # Boost Software License, Version 1.0. # (Consult LICENSE or http://www.boost.org/LICENSE_1_0.txt) from .check import check from ..artefact import intermediate, always from ..tools.compiler impor...
null
src/faber/config/try_link.py
try_link.py
py
1,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "check.check", "line_number": 16, "usage_type": "name" }, { "api_name": "check.check.__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "check.check", "line_number": 21, "usage_type": "name" }, { "api_name": "tools.compiler.compiler....
339314081
from wand.image import Image class StdCharts(object): def __init__(self): pass def save(obj,filename): svg = b'%b' % obj.encode('utf8') with Image(blob=svg,format="svg") as image: png_image = image.make_blob("png") image.save(filename=filename) def Line(d...
null
pyrecharts/StdCharts.py
StdCharts.py
py
6,716
python
en
code
null
code-starcoder2
66
[ { "api_name": "wand.image.Image", "line_number": 11, "usage_type": "call" } ]
134318185
import contextlib import json import os import unittest from alerta.app import create_app, db @contextlib.contextmanager def mod_env(*remove, **update): """ See https://stackoverflow.com/questions/2059482#34333710 Temporarily updates the ``os.environ`` dictionary in-place. The ``os.environ`` dictio...
null
tests/test_config.py
test_config.py
py
3,131
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "contextlib.contextmanager", "line_number": 9, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 42, "usage_type": "attribute" }, { "api_name": "...
316091343
# -*- coding: utf-8 -*- # Copyright 2014 Mirantis, Inc. # # 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 requi...
null
nailgun/nailgun/orchestrator/deployment_graph.py
deployment_graph.py
py
17,091
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.DiGraph", "line_number": 34, "usage_type": "attribute" }, { "api_name": "ordereddict.OrderedDict", "line_number": 54, "usage_type": "name" }, { "api_name": "ordereddict.OrderedDict", "line_number": 55, "usage_type": "name" }, { "api_name": ...
347557271
from flask import Flask from flask import render_template import socket import random import os import argparse app = Flask(__name__) ROCKET_PORT = os.environ.get('ROCKET_PORT') or '8080' THIS_FOLDER = os.path.dirname(os.path.abspath(__file__)) VERSION_ENV = os.environ.get('VERSION') or 'v0.1' rockets = { "small...
null
app.py
app.py
py
2,702
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line...
196785249
import random from flask import redirect, render_template, url_for from app import app from .request import fetch_news_articles, fetch_news_sources categories = app.config["NEWS_CATEGORIES"] @app.route("/") @app.route("/news-sources/<category>") def news_sources(category=None): """ """ title = "News Sour...
null
app/views.py
views.py
py
986
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.app.config", "line_number": 9, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 9, "usage_type": "name" }, { "api_name": "request.fetch_news_sources", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.render_tem...
619787446
# uncompyle6 version 3.6.7 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] # Embedded file name: /Users/bogdankyryliuk/src/oss/incubator-superset/superset/migrations/versions/d8bc074f7aad_add_new_field_is_restricted_to_.py # Compiled ...
null
pycfiles/apache-superset-johan078-0.35.2-patch8277.tar/d8bc074f7aad_add_new_field_is_restricted_to_.cpython-37.py
d8bc074f7aad_add_new_field_is_restricted_to_.cpython-37.py
py
1,901
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 20, "usage_type": "argument" }, { ...
443409544
# coding=utf-8 from django.urls import path from accounts.views import ( create_salesman, save_salesman, list_salesman,update_salesman, update_salesman_save,delete_salesman ) app_name = 'accounts' urlpatterns = [ path('vendedores/', list_salesman, name='list_salesman'), path('cadastrar-vendedor/', cr...
null
accounts/urls.py
urls.py
py
678
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "accounts.views.list_salesman", "line_number": 11, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "ac...
83288872
import os from PyPDF2 import PdfFileReader, PdfFileWriter def PDFWatermark(source_file, watermark): template = PdfFileReader(open(source_file, 'rb')) watermark = PdfFileReader(open(watermark, 'rb')) output = PdfFileWriter() for i in range(template.getNumPages()): page = template.getPage(i) ...
null
PDF/Watermark.py
Watermark.py
py
460
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyPDF2.PdfFileReader", "line_number": 5, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileReader", "line_number": 6, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileWriter", "line_number": 7, "usage_type": "call" } ]
393725308
from __future__ import print_function import os import glob import sys import numpy as np import pandas as pd import pickle from sklearn import metrics import itertools import matplotlib.pyplot as plt import pydot import scipy import sklearn from sklearn.model_selection import train_test_split from sklear...
null
Scripts/serialNo_class.py
serialNo_class.py
py
37,927
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
252445723
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='editor_log', fields=[ ('id', models.IntegerFiel...
null
msaequery/migrations/0001_initial.py
0001_initial.py
py
1,718
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 13, "usage_type": "call" }, ...
369102413
from bokeh.plotting import hplot, vplot, gridplot, figure, output_file, show from bokeh.models import LinearAxis , Range1d import numpy as np x = np.arange(-2*np.pi , 2*np.pi , 0.2) y = np.sin(x) y2 = np.linspace(0,100, len(y)) output_file("twin_axes.html") plot = figure(x_range = (-7,7) , y_range = (-1.5, 1.5) , t...
null
apps/twin_axes.py
twin_axes.py
py
558
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.arange", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number":...
158771956
from __future__ import unicode_literals, division, absolute_import from flexget import options from flexget.db_schema import reset_schema, plugin_schemas from flexget.event import event from flexget.logger import console from flexget.manager import Base, Session def do_cli(manager, options): with manager.acquire...
null
flexget/plugins/cli/database.py
database.py
py
3,613
python
en
code
null
code-starcoder2
66
[ { "api_name": "flexget.options.db_action", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flexget.options", "line_number": 12, "usage_type": "name" }, { "api_name": "flexget.options.db_action", "line_number": 14, "usage_type": "attribute" }, { "api...
452673031
""" Methods to perform decomposition with dynamic programming """ import itertools from .multitree import Tree FOUTSIDE=0 FROOT=1 FINTERNAL=2 FSINGLE=3 FOREST='ORIS' INFTY=1e100 def decompose(gt, st, weights=(1, 1000)): """ :param gt: str or multitree.Tree object :param st: str or multitree.Tree object...
null
src/dynamic.py
dynamic.py
py
7,394
python
en
code
null
code-starcoder2
66
[ { "api_name": "multitree.Tree", "line_number": 24, "usage_type": "argument" }, { "api_name": "multitree.Tree", "line_number": 26, "usage_type": "call" }, { "api_name": "multitree.Tree", "line_number": 29, "usage_type": "argument" }, { "api_name": "multitree.Tree",...
322277655
#!/usr/bin/env python3 import sys import argparse import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation parser = argparse.ArgumentParser(description="Visualize 1d data") parser.add_argument("input", type=argparse.FileType('rb'), help="IN binary file") parser.add_argument("nx", t...
null
python/tools/visualize_3d.py
visualize_3d.py
py
845
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.exit", ...
599888966
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Vincent<vincent8280@outlook.com> # http://blog.vincentzhong.cn # Created on 2017/3/28 13:29 import os import aiofiles from pyquery import PyQuery from catty.parser import BaseParser from catty.spider imp...
null
tests/spider/test_spider.py
test_spider.py
py
2,627
python
en
code
null
code-starcoder2
66
[ { "api_name": "aiofiles.open", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "catty.libs.utils.md5string", ...
275840943
from django.shortcuts import resolve_url as r from model_bakery import baker def test_unauthorized(api_client): data = {'summary': 'test', 'description': 'test description'} resp = api_client.post(r('api:task_list')) assert resp.status_code == 401 def test_post(api_client_logged_in): data = {'summar...
null
todo_api/api/tests/test_view_task_create.py
test_view_task_create.py
py
1,988
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.resolve_url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.shortcuts.resolve_url", "line_number": 13, "usage_type": "call" } ]
7780889
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from yellowbrick.regressor import ResidualsPlot ''' OBS¹: Todos os 193 países foram selecionados, inclusive aqueles que são abstinentes, em todas as bebidas alcoólicas ''' '''OBS²: O consumo ...
null
consumo mundial bebida alcoolica(regressão linear simples).py
consumo mundial bebida alcoolica(regressão linear simples).py
py
5,231
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.corrcoef", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 22, "usage_type": "call" }, { "api_name": "...
62673953
from django.core.management.base import NoArgsCommand from ...models import EventBase class Command(NoArgsCommand): help = 'Create missing repeat event occurrences' def handle_noargs(self, *args, **options): verbosity = int(options.get('verbosity')) # Get all events with generators e...
null
icekit_events/management/commands/create_event_occurrences.py
create_event_occurrences.py
py
785
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.NoArgsCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "models.EventBase.objects.exclude", "line_number": 12, "usage_type": "call" }, { "api_name": "models.EventBase.objects", "line_number": 12, "usage_type": "at...
570059606
import argparse import datetime import hashlib import os import requests import gevent import redis start = datetime.datetime.now() e = os.environ.get redis_client = None def check_response(response): return response.status_code == 200 def parse_response(data): return dict( id=data.get('id'), ...
null
src/main.py
main.py
py
3,821
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "hashlib.sh...
108770081
# importing pandas package import pandas as pd from sklearn import datasets import re iris=datasets.load_iris() #print(iris.keys()) df=pd.DataFrame(iris.data) colnames = iris.feature_names colnames =list(map(lambda x: re.sub(r"[\s()]", "", x), colnames)) df.columns = colnames print(df.head(10)) df.drop(columns="") p...
null
iris.py
iris.py
py
579
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", ...
487106028
import xmlParser import xml.sax import sys import KWayMerge import os from time import time def main(wikiDumpPath,indexPath,indexStatsPath): handler = xmlParser.MyHandler(indexPath,indexStatsPath) parser = xml.sax.make_parser() parser.setContentHandler(handler) ts = time() for filename in os.listdi...
null
main.py
main.py
py
1,092
python
en
code
null
code-starcoder2
66
[ { "api_name": "xmlParser.MyHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "xml.sax.sax.make_parser", "line_number": 10, "usage_type": "call" }, { "api_name": "xml.sax.sax", "line_number": 10, "usage_type": "attribute" }, { "api_name": "xml.sax",...
252247040
#!/usr/bin/env python # coding: utf-8 # In[51]: get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt plt.style.use('ggplot') import numpy as np import pandas as pd import re import seaborn as sns from scipy import stats import matplotlib.pyplot as plt plt.style.use('d...
null
EDA.py
EDA.py
py
5,897
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name"...
307370002
# -*- coding: utf-8 -*- """ Created on Wed Apr 17 17:31:41 2019 @author: Administrator """ from model import Languagemodel from utils import SaveloadHP, Vocab import torch import numpy as np PAD = u"<PAD>" UNK = u"<UNK>" SOS = u"<s>" EOS = u"</s>" class Predict(object): def __init__(self,model_args='./results/lm...
null
predict.py
predict.py
py
2,486
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.SaveloadHP.load", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.SaveloadHP", "line_number": 19, "usage_type": "name" }, { "api_name": "model.Languagemodel", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.load...
167209027
import os import argparse import glob from os.path import dirname, abspath, expanduser from matplotlib import pyplot as plt #plt.style.use('classic') #plt.style.use('seaborn-ticks') def read(path): with open(path) as f: data = [parse_line(line) for line in f] return data def parse_line(line): str...
null
figures/results/plot_depths.py
plot_depths.py
py
1,271
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotli...
519441308
''' Created on Feb 5, 2020 @author: duolu ''' import numpy as np import threading import time import serial class ClientGlove(object): def __init__(self, version=3): self.stop_flag = False self.client_stop = False if version < 1 or version > 3: raise V...
null
code/client/client_glovev3.py
client_glovev3.py
py
5,851
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Semaphore", "line_number": 44, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.float32", "li...
252946780
import fetch_plays as fp import requests import pickle import subprocess import sys import io # ew global verbosity=1 """ Verbosity levels: 0 - errors only, 1 - minimum info, 2 - maximum info """ def auth_official(): """ Log in with credentials stored in creds/payload (pickled) and return session. Leave ...
null
beatmap_link.py
beatmap_link.py
py
6,080
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.session", "line_number": 20, "usage_type": "call" }, { "api_name": "pickle.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 57, "usage_type": "call" }, { "api_name": "fetch_plays.get_subred...
402254027
#!/usr/bin/env python import roslib import sys import rospy import cv2 from std_msgs.msg import String from sensor_msgs.msg import Image, CameraInfo from cv_bridge import CvBridge, CvBridgeError import yaml class image_converter: def __init__(self, topic_root): yaml_fname = rospy.get_param('~pathToYAMLCamCalF...
null
scripts/miro_camera.py
miro_camera.py
py
2,553
python
en
code
null
code-starcoder2
66
[ { "api_name": "rospy.get_param", "line_number": 16, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 20, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.CameraInfo", "line_number": 23, "usage_type": "call" }, { "api_name": "rospy.Publisher"...
456304151
import json import os def load_config_file(file_name): current_path = os.path.dirname(os.path.realpath(__file__)) config_file = os.path.join(current_path, '..', "configs", file_name) try: with open(config_file, 'r') as f: try: return json.load(f) except Valu...
null
data_acquisition_framework/services/loader_util.py
loader_util.py
py
493
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
413198471
############# # # # Bot # # # ############# # Written badly by ShiftyWizard and 2 other punks ololol #Importing Requirements import discord import asyncio import random import os import traceback from hyphenate import hyphenate_word import nltk from nltk.corpus import wordnet...
null
discordbot.py
discordbot.py
py
8,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
496354380
# -*- coding: utf-8 -*- """ Created on Thu Nov 8 10:43:48 2018 @author: sofyan.fadli """ import cv2 img1 = cv2.imread('kucing.jpg') img2 = cv2.imread('opencv_logo.png') height, width = img1.shape[:2] resized_image = cv2.resize(img2, (width, height)) dst = cv2.addWeighted(img1,0.7,resized_image,0.3,0) cv2.imshow(...
null
Open CV/img_proc/img_blending.py
img_blending.py
py
351
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.addWeighted", "line_number":...
216884791
from unittest import TestCase from app import app import flask from forex_python.converter import CurrencyRates, CurrencyCodes codes = CurrencyCodes() c = CurrencyRates() class TestApp(TestCase): def setUp(self): self.client = app.test_client() app.config["TESTING"] = True def test_main_page...
null
test.py
test.py
py
1,165
python
en
code
null
code-starcoder2
66
[ { "api_name": "forex_python.converter.CurrencyCodes", "line_number": 5, "usage_type": "call" }, { "api_name": "forex_python.converter.CurrencyRates", "line_number": 6, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "name" }, ...
427764783
from . import static_value from logging.handlers import RotatingFileHandler import logging, inspect, os class LogManager: def __init__(self): logger = logging.getLogger("api-server") logger.setLevel(logging.DEBUG) handler = RotatingFileHandler( static_value.LOG_FILE, maxBytes ...
null
gse_infra_configuration/common/logs.py
logs.py
py
1,544
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 11, "usage_type": "call" }, { "api_name"...
180484214
import os, sys import pandas as pd from collections import defaultdict import itertools#, simplejson from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider from snakemake.remote.dropbox import RemoteProvider as DropboxRemoteProvider HTTP = HTTPRemoteProvider() SECRETS = '/mnt/isilon/cbmi/variome/perry/....
null
src/rules/const.py
const.py
py
6,043
python
en
code
null
code-starcoder2
66
[ { "api_name": "snakemake.remote.HTTP.RemoteProvider", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "snake...
598692337
from lxml import etree import MySqlConnection class Html_Parser(object): def __init__(self): values = MySqlConnection.MySqlConnection().getRtreeList() self.targetKeywords = list() for value in values: self.targetKeywords.append(value[0]) self.targetKeywords.append(v...
null
src/Html_Parser.py
Html_Parser.py
py
5,172
python
en
code
null
code-starcoder2
66
[ { "api_name": "MySqlConnection.MySqlConnection", "line_number": 7, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 21, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 21, "usage_type": "name" }, { "api_name": "lxml.etree....
252383338
import ConfigSpace import hpbandster import hpbandster.core.worker import hpbandster.core.nameserver import hpbandster.optimizers from ztune.common import * import ztune #import logging #logging.basicConfig(level=logging.WARNING) #######################################################################################...
null
ztune/hpbandster.py
hpbandster.py
py
5,556
python
en
code
null
code-starcoder2
66
[ { "api_name": "hpbandster.core", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ConfigSpace.ConfigurationSpace", "line_number": 29, "usage_type": "attribute" }, { "api_name": "ztune.parameter", "line_number": 66, "usage_type": "attribute" }, { "api...
555314431
# -*- coding: utf-8 -*- """This file is a Radware spider created on top of the ATSSpider scrapy crawl radware -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.radware.com/Careers/" sample url: http://www.radware.com/Careers/ """ from zlib import crc32 from urlparse import urljoin from scrapy.h...
null
brightcorp/brightcorp/spiders/radware.py
radware.py
py
2,266
python
en
code
null
code-starcoder2
66
[ { "api_name": "brightcorp.base.atsspiders.ATSSpider", "line_number": 18, "usage_type": "name" }, { "api_name": "scrapy.selector.Selector", "line_number": 23, "usage_type": "call" }, { "api_name": "scrapy.http.Request", "line_number": 33, "usage_type": "call" }, { ...
98188455
from Graph import UndirectedGraph from ASMCode import AsmInstruction class Variable(object): def __init__(self, value): self.value = value self.is_pointer = False def __str__(self): return self.value def __eq__(self, other): return self.value == other.value def __has...
null
HW6/IntermediateCode.py
IntermediateCode.py
py
56,512
python
en
code
null
code-starcoder2
66
[ { "api_name": "ASMCode.AsmInstruction", "line_number": 141, "usage_type": "call" }, { "api_name": "ASMCode.AsmInstruction", "line_number": 145, "usage_type": "call" }, { "api_name": "ASMCode.AsmInstruction", "line_number": 147, "usage_type": "call" }, { "api_name"...
351003702
from decouple import config API_BASE_URL = config('API_BASE_URL') BOT_TOKEN = config('BOT_TOKEN') PREFIX = config('PREFIX') CATEGORY = config('CATEGORY') STEAM_CHANNEL = config('STEAM_CHANNEL') STEAM_AAA_CHANNEL = config('STEAM_AAA_CHANNEL') STEAM_DEALS_AMOUNT = int(config('STEAM_DEALS_AMOUNT')) GOG_CHANNEL = config(...
null
settings.py
settings.py
py
506
python
en
code
null
code-starcoder2
66
[ { "api_name": "decouple.config", "line_number": 3, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 4, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 5, "usage_type": "call" }, { "api_name": "decouple.config", "l...
70511774
from flask import Flask,request import cv2 import demjson import numpy as np import os import re import requests ######################################################################## # use Flask app = Flask(__name__) # global variables keep_ratio = 1 lst_candidate = [] lst_query = [] lst_predict = [] # path load...
null
20180403_flask_test/flask_interface_test.py
flask_interface_test.py
py
4,258
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flask.request.args.get", "line_number": 50, "usage_type": "call" }, { "api_name": "flask.request.args...
88203745
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django_fsm import nodeconductor.core.models import django.db.models.deletion from django.conf import settings import django.utils.timezone import nodeconductor.logging.loggers import uuidfield.fields import ...
null
src/nodeconductor_jira/migrations/0001_initial.py
0001_initial.py
py
8,582
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 17, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 21, "usage_type": "ca...
227081944
#coding:utf-8 import mpl_finance #import tushare as ts import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import pymysql from matplotlib import ticker from matplotlib.pylab import date2num import numpy as np import datetime import logging import re from multiprocessing import Pool import json imp...
null
find_zhuang.py
find_zhuang.py
py
12,006
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.set_option...
171517850
import time import sys import nibabel as nib from skimage.registration import optical_flow_tvl1 import numpy as np script_start_time = time.time() ref_img = nib.load(sys.argv[1]) ref_d = ref_img.get_fdata() warp_d = nib.load(sys.argv[2]).get_fdata() # Common normalization to between 0 and 1, assuming no negative val...
null
of-tvl1.py
of-tvl1.py
py
786
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "nibabel.load", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "nibabel.load", "line_number": 1...
217376190
from docutils.parsers import rst import docutils import sphinx import yaml import requests, json link_to_aws_json='https://d68hl49wbnanq.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json' class CfnExporter: def from_yaml(self, yml): reslis = [] for key, val in yml['Resources'].i...
null
cfnsphinx/cfnsphinx.py
cfnsphinx.py
py
4,213
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.dump", "line_number": 22, "usage_type": "call" }, { "api_name": "docutils.parsers.rst.Parser", "line_number": 28, "usage_type": "attribute" }, { "api_name": "docutils.parsers.rst", "line_number": 28, "usage_type": "name" }, { "api_name": "yaml....
599908495
# %load q03_t_test/build.py # Default imports import scipy.stats as stats import pandas as pd df = pd.read_csv('data/house_pricing.csv') def t_statistic(df): x = df[df['Neighborhood'] == 'OldTown']['GrLivArea'] stat, pvalue = stats.ttest_1samp(a=x, popmean=df['GrLivArea'].mean()) endpt = stats.t.ppf(q=0.0...
null
q03_t_test/build.py
build.py
py
363
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.stats.ttest_1samp", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 10, "usage_type": "name" }, { "api_name": "scipy.stats.t.ppf"...
522370631
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns #导入数据 df=pd.read_csv(".\cs-training.csv") print(df.head(5)) print(df.columns) # columns转化为中文 states={"Unnamed: 0":"用户ID", "SeriousDlqin2yrs":"好坏客户", "RevolvingUtilizationOfUnsecuredLines":"可用额度比值", "a...
null
数据清洗.py
数据清洗.py
py
9,407
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib....
489269865
# -*- coding: utf-8 -*- # pylint: disable=import-outside-toplevel,unbalanced-tuple-unpacking """Utility functions for pyIEM package This module contains utility functions used by various parts of the codebase. """ import os import sys import time import random import logging from datetime import timezone, datetime imp...
null
src/pyiem/util.py
util.py
py
17,447
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.Formatter", ...
504431502
import requests import datetime from twilio.rest import Client class SMS(object): def __init__(self, account_sid, auth_token): self.__account_sid = account_sid self.__auth_token = auth_token def send(self, from_, to, message): client = Client(self.__account_sid, self.__auth_token) ...
null
sms.py
sms.py
py
557
python
en
code
null
code-starcoder2
66
[ { "api_name": "twilio.rest.Client", "line_number": 12, "usage_type": "call" } ]
588550774
from typing import List class Solution: @staticmethod def game(guess: List[int], answer: List[int]) -> int: # solution 1 ans = 0 for i in range(3): if guess[i] == answer[i]: ans += 1 return ans # solution 2 # ans = 0 # if gue...
null
easy/lcp_1_guess_numbers.py
lcp_1_guess_numbers.py
py
633
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
361551962
#from django.db import models from common.mongodb import Mongo from common.error import MishangError from bson import ObjectId # Create your models here. class User(Mongo): _attrdict={} def __init__(self,_id=None,**kwargs): Mongo.__init__(self) if _id is not None: self._id=_id if isinstance(_id,ObjectId)...
null
projectd/project/user/models.py
models.py
py
3,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.mongodb.Mongo", "line_number": 7, "usage_type": "name" }, { "api_name": "common.mongodb.Mongo.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "common.mongodb.Mongo", "line_number": 12, "usage_type": "name" }, { "api_name":...
467219767
import pandas as pd from . import data_preparation import os from config.settings import BASE_DIR data = pd.read_csv(os.path.join(BASE_DIR, 'news', 'emotion_counter', 'emotions_without_duplicates.csv')) def list_of_synonyms(text): remove_special_characters_except_commas = text.replace("[", "").replace("]", "").re...
null
news/emotion_counter/emotion_counter.py
emotion_counter.py
py
1,106
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "config.settings.BASE_DIR", "line_number": 6, "usage_type": "argument" }, { "api_name": "os.path", ...
218321966
#!/usr/bin/python3 """Convert arguments.""" import re from typing import List import itertools from helper import utils from converter.argument import argument project_name = 'python_audio_book_info_changer' def get_clean_argument_value(args: List[str], argument: argument) -> str: """ Combination of `get_ar...
null
converter/argument_converter.py
argument_converter.py
py
4,492
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "converter.argument.argument", "line_number": 13, "usage_type": "name" }, { "api_name": "converter.argument.argument", "line_number": 24, "usage_type": "argument" }, { "api_name"...
574636211
# Copyright 2020-2021 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
null
tests/test_metadata.py
test_metadata.py
py
2,219
python
en
code
null
code-starcoder2
66
[ { "api_name": "charmcraft.metadata.parse_metadata_yaml", "line_number": 37, "usage_type": "call" }, { "api_name": "charmcraft.metadata.parse_metadata_yaml", "line_number": 49, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 44, "usage_type"...
544509744
import asyncio import socket import struct # CAN flags CAN_EFF_FLAG = 0x80000000 # BCM opcodes CAN_BCM_TX_SETUP = 1 CAN_BCM_TX_DELETE = 2 CAN_BCM_TX_SEND = 4 CAN_BCM_RX_SETUP = 5 CAN_BCM_RX_DELETE = 6 CAN_BCM_RX_CHANGED = 12 # struct bcm_msg_head BCM_MSG_HEAD_FMT = "@3I4l2I0q" # BCM flags SETTIMER = 0x0001 START...
null
rover_common/src/aiocan.py
aiocan.py
py
5,588
python
en
code
null
code-starcoder2
66
[ { "api_name": "struct.pack", "line_number": 67, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 71, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 82, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "l...
188772955
import datetime from django.shortcuts import render from rest_framework import viewsets from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from .objects import Home, Auto, Profile from .serializers import OutputSerializer current_year = datetime.d...
null
api/risk_profile/views.py
views.py
py
6,072
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.views.APIView", "line_number": 16, "usage_type": "name" }, { "api_nam...
309160873
# -*- encoding: utf-8 -*- from config.settings import APPTITLE, TEXTTITLE, GOOGLE_KEY, SITE_ID from .models import * import datetime from django.contrib.sites.models import Site from datetime import timedelta def globalvar(request): user = request.user apptitle = APPTITLE texttitle = TEXTTITLE today = datetime.d...
null
project/app/context_processors.py
context_processors.py
py
817
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.settings.APPTITLE", "line_number": 11, "usage_type": "name" }, { "api_name": "config.settings.TEXTTITLE", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.today", "line_number": 13, "usage_type": "call" }, { "api_na...
53554910
from setuptools import setup, Extension SRC_DIR = "stl_tools" PACKAGES = [SRC_DIR] setup(name='stl_tools', version='0.3.0', install_requires=['numpy', 'scipy', 'matplotlib'], description="Generate STL files from numpy arrays and text", author='Tristan Hearn', author_email='tristanhearn@g...
null
setup.py
setup.py
py
558
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" } ]
463231287
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
null
src/zope/app/dependable/__init__.py
__init__.py
py
3,914
python
en
code
null
code-starcoder2
66
[ { "api_name": "zope.traversing.api.getParent", "line_number": 40, "usage_type": "call" }, { "api_name": "zope.traversing.api.getPath", "line_number": 46, "usage_type": "call" }, { "api_name": "zope.annotation.interfaces.IAnnotations", "line_number": 58, "usage_type": "cal...
460822532
import re from typing import List def apigee_apps_to_product_map(apps_list: List[dict], product_filter: str = None): result = dict() not_matched = [] for app in apps_list: credentials = app.get('credentials', []) for cred in credentials: api_products = cred.get('apiProduc...
null
ansible/filter_plugins/apigee_helpers.py
apigee_helpers.py
py
4,425
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "re.match", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 42, "usage_type": "name" }, { "api_name": "re.match", "line_number": 54, ...
629903481
import os from celery import Celery import json from dataclasses import dataclass import pyrebase app = Celery('db_message_broker') app.conf.task_routes = { 'openaq_stream.*': {'queue': 'openaq_stream_queue'}, 'db_message_broker.*': {'queue': 'db_message_broker_queue'}, 'http_interface.*': {'queue': 'http_...
null
src/db_message_broker/db_message_broker.py
db_message_broker.py
py
1,873
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" }, { "api_name": "pyrebase.initialize_app", "line_number": 25, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 28, "usage_type": "name" }, { "api_name": "json.loads...
151892652
from django.contrib.auth import authenticate, login, logout from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.shortcuts import render, get_object_or_404 from django.urls import reverse from django.core.serializers import serialize from django.forms...
null
network/views.py
views.py
py
7,404
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.http.HttpResponseRedirect", "line_number": 20, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_...
186046432
from django.conf.urls import url from . import views #if someone requests the blog directory serve them the post_list view page urlpatterns = [ url(r'^$', views.post_list, name='post_list'), #if someone requests a specific post (as defined in the post_detail function in views.py) serve them the post_detail view page...
null
blog/urls.py
urls.py
py
592
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
357051616
from __future__ import annotations from pathlib import Path, PurePosixPath import sys from typing import (Any, BinaryIO, Callable, Dict, List, Literal, NewType, Optional, ...
null
clustertools/shared/typing.py
typing.py
py
2,651
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Union", "line_number": 25, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "name" }, { "api_name": "pathlib.PurePosixPath", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.TypeVar", ...
128167693
from coreapp import app from flask import render_template import re from bs4 import BeautifulSoup def get_chap_links(page): soup = BeautifulSoup(page) links = [str(link.get('href'))[1:] for link in soup.find_all('a') if link.get('href')] return links def parse_wizofoz(): page = render_temp...
null
Homework/Flask&Deployment/GoogleAppEngine/hw4p4f15/jinjaapp/coreapp/views.py
views.py
py
2,710
python
en
code
null
code-starcoder2
66
[ { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "re.search", "line_number": 22, "usage_type": "call" }, { "api_name": "re.MULTILINE", "...
114091862
import os import time import datetime import pytz import pyrogram user_session_string = os.environ.get("user_session_string") bots = [i.strip() for i in os.environ.get("bots").split(' ')] bot_owner = os.environ.get("bot_owner") update_channel = os.environ.get("update_channel") status_message_id = int(os.environ.get("s...
null
main.py
main.py
py
2,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
413347187
from django.urls import path,include from django.contrib import admin from.import views urlpatterns=[ path('',views.home,name='home'), path('about',views.about,name='about'), path('contact',views.contact,name='contact'), path('home',views.home,name='home'), path('form',views.form,name='form'...
null
weblisto/demoapp/newapp/urls.py
urls.py
py
368
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
170725598
from django.shortcuts import render import collections from datetime import date,datetime,timedelta from django.db import connection from cryptography.fernet import Fernet as frt from supervisor.views import main from operator import itemgetter from django.db.models import Q from itertools import groupby # Create your ...
null
dgm/views.py
views.py
py
10,667
python
en
code
null
code-starcoder2
66
[ { "api_name": "login.models.Dgm.objects.all", "line_number": 22, "usage_type": "call" }, { "api_name": "login.models.Dgm", "line_number": 22, "usage_type": "attribute" }, { "api_name": "login.models", "line_number": 22, "usage_type": "name" }, { "api_name": "login...
54024375
import pandas as pd import numpy as np from collections import Counter import hashlib from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split from chainer.datasets import tuple_dataset from collections import defaultdict class Feat...
null
feature_extractor.py
feature_extractor.py
py
3,021
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line...
56438742
#My main file for code from flask import Flask, render_template, request app=Flask(__name__) @app.route('/greet', methods=['POST']) def greet(): inputName = request.form['myName'] #split password given into list, separated by commas, and set var for password score inputName.split(",") stre...
null
Password-Strength-Tester.py
Password-Strength-Tester.py
py
1,816
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.render_template"...
436533130
#crie um programa que leia o ano de nascimento de sete pessoas. no final, mostre quantas pessoas ainda nao atingiram a maioridade e quantas ja sao maiores. from datetime import date atual = date.today().year totmaior = 0 totmenor = 0 for pessoa in range(1,8): nasc = int(input('Digite a data de nascimento: ')) i...
null
ex075.py
ex075.py
py
523
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date.today", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 3, "usage_type": "name" } ]
574319675
import logging import apache_beam as beam from apache_beam.io import WriteToText class SplitCharactersFn(beam.DoFn): def process(self, element): castmemb_record = element characters = castmemb_record.get('characters') characters = characters.get('characters') name = castmemb_record.get('nConst') ...
null
Characters_beam.py
Characters_beam.py
py
3,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "apache_beam.DoFn", "line_number": 5, "usage_type": "attribute" }, { "api_name": "apache_beam.pipeline.PipelineOptions", "line_number": 35, "usage_type": "call" }, { "api_name": "apache_beam.pipeline", "line_number": 35, "usage_type": "attribute" }, { ...
444733815
# Import pandas for data handling import pandas as pd # Load the data df = pd.read_csv("/data_scientist_test/house_sales.csv") # Check the data print(df.describe()) # Check the size of print(df.shape) # Check the column tyoes print(df.dtypes) # Check if there is a null values print(df.isnull().sum()) # Analysing...
null
Nextel/Code.py
Code.py
py
7,762
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "matplotlib.py...
230182347
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.md'), encoding='utf-8') as ...
null
pypi_install_script/usbusiness-0.2.1.tar/setup.py
setup.py
py
2,531
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
599369025
import matplotlib.pyplot as plt import numpy as np #agora com pontos #valores no eixo y já calculada a média das cinco execuções y50k_axis = [0.474, 0.277, 0.468] y100k_axis = [0.820, 0.415, 0.504] y250k_axis = [1.134, 0.639, 0.772] y500k_axis = [1.508, 0.692, 0.927] y1M_axis = [1.275, 0.669, 0.799] y2_5M_axis = [1...
null
resultados/goodputXtamanho.py
goodputXtamanho.py
py
1,786
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
49141771
import sys import re import os import pylab as plt import math import numpy as np import argparse #import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar import diffusio...
null
overlay_amplitudes.py
overlay_amplitudes.py
py
1,510
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "pylab.subplots", "line_number": 29, "usage_type": "call" }, { "api_name": "re.match", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.load", "lin...
264143052
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static from django.views.generic import TemplateView from django.contrib import admin from pronos_WC.apps.football.views import JoueurClassementView, MatchView, MatchOldView, MyPronosticsView, add_pr...
null
pronos_WC-master/pronos_WC/urls.py
urls.py
py
1,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "ap...
610782890
import torch import torch.nn as nn import sparseconvnet as scn reps = 2 # Conv block repetition factor m = 16 # Unet number of features nPlanes = [m, 2*m, 4*m, 8*m, 16*m] # UNet number of features per level class DeepVtx(nn.Module): ''' spatialSize seems need to be 2^n ''' def __init__(self, dimensi...
null
model/DeepVtx.py
DeepVtx.py
py
1,090
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Module.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.Modul...
594088688
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import settings from models import Base from static_data_api import get_counties, get_voivodeships, load_counties_csv engine = create_engine(settings.DB_CONNECTION_URI) DBSession = sessionmaker(bind=engine) def recreate_schema(): Base....
null
flask-app/database.py
database.py
py
744
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 8, "usage_type": "call" }, { "api_name": "settings.DB_CONNECTION_URI", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 9, "usage_type": "call" }, { ...
170115730
import pandas as pd import json import re import xlsxwriter import time import string import numpy as np import os # digits_kanji = '零一二三四五六七八九' # magnitudes_kanji = '十百千万億兆京垓𥝱' # num_kanji = digits_kanji + magnitudes_kanji class Marker(): def __init__(self, index=[], mark_type=0, text='', alts={}): sel...
null
markers.py
markers.py
py
20,364
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ndarray", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_number": 219, "usage_type": "call" }, { "api_name": "os.path", "line_number": 219, "usage_type": "attribute" }, { "api_name": "json.load", "l...
606319299
# The main goal is to find the screen of Game and highlight it, # iIport the necessary packages # The image_utils contains convenience methods to handle basic image processing techniques # resizing, rotating, and translating. import imutils import numpy as np #import argparse import cv2 #from skimage import exposure...
null
old/find_triangle.py
find_triangle.py
py
4,095
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 34, "usage_type": "call" }, { "api_name": "imutils.resize", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 48, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number...
99831149
from django.conf import settings from django.core.exceptions import ValidationError from django.utils.encoding import smart_str from django.contrib.gis.geos import Point import pytz import re def localtime_for_timezone(value, timezone): """ Given a ``datetime.datetime`` object in UTC and a timezone represent...
null
timezones/utils.py
utils.py
py
2,748
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.settings.TIME_ZONE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 24, "usage_type": "name" }, { "api_name": "pytz.timezone", "line_number": 27, "usage_type": "call" }, { "api_name":...
243130210
import string import itertools import collections import dill # #notused # def dictionaryproduct(dictlists): # #convert dictionary to lists of tuples # pools=[] # for key in dictlists: # pools.append([(key,value) for value in dictlists[key]]) # tupleproduct=itertools.product(*pools) # #convert tuple lists to...
null
hyperparams.py
hyperparams.py
py
7,781
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 24, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 106, "usage_type": "call" }, { "api_name": "dill.dump", "line_number": 245, "usage_type": "call" }, { "api_name": "dill.HIGHEST_PRO...
337199208
from sklearn import datasets from sklearn.metrics import confusion_matrix from sklearn.model_selection import train_test_split from sklearn.svm import SVC import numpy as np from matplotlib import pyplot as plt # from mlxtend.plotting import plot_decision_regions class SVM: def __init__(self, X_train, y_train, ke...
null
task1/src/svm_method.py
svm_method.py
py
2,904
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.svm.SVC", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 30, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 35, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", ...
6493223
# -*- coding: utf-8 -*- """ Created on Tue Sep 10 18:56:40 2019 @author: truthless """ import json import torch import os import zipfile import pickle from convlab.modules.word_policy.multiwoz.hdsa.transformer.Transformer import TableSemanticDecoder from convlab.modules.word_policy.multiwoz.hdsa.transformer import Con...
null
convlab/modules/word_policy/multiwoz/hdsa/generator.py
generator.py
py
5,158
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "convlab.modules.word_policy.multiwoz.hdsa.transformer.Constants.UNK_WORD", "line_number": 43, "usage_type": "attribute" }, { "api_name": "convlab.modules.word_policy.multiwoz.hdsa.transformer.Con...
367678781
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from coverage.data import CoverageData from testing.fix_coverage import merge_coverage def test_fix_coverage(tmpdir): base_file = tmpdir.join('foo.py') base_file.ensure() sub_file = tmpdi...
null
tests/unit/fix_coverage_test.py
fix_coverage_test.py
py
1,248
python
en
code
null
code-starcoder2
66
[ { "api_name": "coverage.data.CoverageData", "line_number": 18, "usage_type": "call" }, { "api_name": "testing.fix_coverage.merge_coverage", "line_number": 29, "usage_type": "call" } ]
541155611
import requests from datetime import datetime def subtract(a, b): return str(datetime.strptime(a, '%H:%M:%S.%f') - datetime.strptime(b, '%H:%M:%S.%f')) urlall = "http://18.204.216.188:8000/" storage = {} while True: getall = requests.get(url = urlall) keys = getall.text.strip().split() if len(keys)...
null
secondserver/app.py
app.py
py
1,216
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 4, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get"...
367737581
import cv2 import numpy as np import ipdb import json pdb = ipdb.set_trace def get_data(input_path, cache=False): if cache: print('直接加载cache from cache_train.json ...') data = json.load(open('cache_train.json')) all_data = data['all_data'] classes_count = data['classes_count'] ...
null
keras_frcnn/simple_parser.py
simple_parser.py
py
3,011
python
en
code
null
code-starcoder2
66
[ { "api_name": "ipdb.set_trace", "line_number": 5, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.random.randint", "l...
158028326
# coding:utf-8 """爬取知乎专栏关注人数, 并且写入excel""" import requests import json import pandas as pd url = 'https://www.zhihu.com/api/v4/columns/donglaoshi/followers' headers = { 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', ...
null
zhihu/follow.py
follow.py
py
891
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" } ]
20279003
from django.utils import six from rest_framework.exceptions import ValidationError from rest_framework.mixins import CreateModelMixin, UpdateModelMixin from tunga.settings import UPLOAD_SIZE_LIMIT_MBS from tunga_utils.models import Upload class GetCurrentUserAnnotatedSerializerMixin(object): """ Get current ...
null
tunga_utils/mixins.py
mixins.py
py
2,163
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.mixins.CreateModelMixin", "line_number": 23, "usage_type": "name" }, { "api_name": "rest_framework.mixins.UpdateModelMixin", "line_number": 23, "usage_type": "name" }, { "api_name": "django.utils.six.itervalues", "line_number": 44, "usage_typ...
642072463
#!/usr/bin/env python import sys sys.path.insert(0, '/usr/local/lib/python2.7/dist-packages/perls/lcmtypes') import lcm import rospy from acfrlcm import relay_command_t, relay_status_t from rowbot_lcm_ros_bridge.srv import RelayCommand from rowbot_lcm_ros_bridge.msg import RelayStatus lc = lcm.LCM() def sendRelayComman...
null
scripts/relay_bridge.py
relay_bridge.py
py
1,986
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "lcm.LCM", "line_number": 9, "usage_type": "call" }, { "api_name": "rospy.logdebug", "line_number"...
185591406
''' Created on 22 Nov 2011 @author: jon THIS COMES AFTER PROCESSING THE DATA WITH SOUP AND INSERTING INTO MONGO THIS WILL INSERT THE CLEAN DATA INTO POSTGRES (AUCTIONBASE) ''' import query import re import pymongo from pymongo import Connection from datetime import date, datetime from datetime import timedelta from m...
null
auctionbase/PostgresInserter.py
PostgresInserter.py
py
4,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "query.SearchStatOps", "line_number": 22, "usage_type": "call" }, { "api_name": "query.DayTotalOps", "line_number": 24, "usage_type": "call" }, { "api_name": "query.PrintSearchSessionTotals", "line_number": 26, "usage_type": "call" }, { "api_name": "...
492785637
# Snafu: Snake Functions - Web Connector from flask import Flask, abort, send_file import json import zipfile import threading import os import configparser app = Flask("snafu") gcb = None @app.route('/invoke/<function>/<args>') def invoke(function, args): function = function response = gcb(function, web=Tr...
null
snafulib/connectors/web.py
web.py
py
3,097
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.abort", "line_number": 28, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 36...
47844225
#!/usr/bin/python # -*- coding: UTF-8 -*- from __future__ import division import os import numpy as np import pandas as pd import pymysql import matplotlib.pyplot as plt import seaborn as sns from numpy import median sns.set_theme(style="whitegrid") sns.set_palette("husl") path = os.path.abspath('/Users/Yuxia/Desktop...
null
code/RQ1.py
RQ1.py
py
8,053
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set_theme", "line_number": 12, "usage_type": "call" }, { "api_name": "seaborn.set_palette", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "...