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
357630622
#!/usr/bin/env python3 # This file is part of the Soletta Project # # Copyright (C) 2015 Intel Corporation. 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 ...
null
data/scripts/suite.py
suite.py
py
5,657
python
en
code
null
code-starcoder2
76
[ { "api_name": "queue.Empty", "line_number": 55, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 59, "usage_type": "call" }, { "api_name": "subprocess.STDOUT", "line_number": 59, "usage_type": "attribute" }, { "api_name": "subpr...
245297219
import sys import os, os.path from pyquery import PyQuery as pq import re import importlib # I hope I won't modify this, I don't understand anything class Tequilla(object): templates = {} # folder :str - path to templates folder # compiled :str - path to compiled templates folder, where python functions...
null
tequilla/__init__.py
__init__.py
py
5,595
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 2...
18993892
from django.shortcuts import render from extra.models import * from django.contrib.auth.models import * from django.shortcuts import render, render_to_response, HttpResponseRedirect from django.template import RequestContext, loader from django.http import HttpResponse from datetime import * from extra.forms import Use...
null
practice/views.py
views.py
py
35,743
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.HttpResponseRedirect", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 19, "usage_type": "call" }, { "api_name": "django.template.loader.get_template", "line_number": 29, "usage...
351909107
#!/usr/bin/env python # coding: utf-8 # print("hello world!") # In[2]: import numpy as np # In[3]: import pandas as pd # ## California Housing Prices # In[4]: import os import tarfile from six.moves import urllib # In[5]: DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml/master/" HO...
null
Housing...py
Housing...py
py
22,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
152722217
import pika #创立连接 connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) #建立通道 channel = connection.channel() #声明queue #事实上,如果生产者运行并创建了队列,此处可以不用声明,但是有可能消费者先运行, #下面的basic_consume久会因为没有队列而报错 channel.queue_declare(queue='HELLO') def callback(ch,method,properties,body): print('[x] received %r'%bo...
null
rabbitMQ/simple_consumer.py
simple_consumer.py
py
666
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.BlockingConnection", "line_number": 3, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 3, "usage_type": "call" } ]
589944311
"""check.py: Check saved reminders for any the need to be sent. This is the file that cron runs automatically and shouldn't need to be called manually. When a reminder's time has passed it will be sent via Twilio and reminders.json updated with the reminder removed. If there are no more reminders left the cron job i...
null
check.py
check.py
py
1,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 19, "usage_type": "call" }, { "api_name": "crontab.CronTab", "...
232081648
import math import sys import pygame import tensorflow as tf import random import numpy as np #this file contains classes for a game, for a map, and for a player #Fun fact: walls are actually very thin rectangles in order to make collision detection easy #The game instance should handle most interaction with maps and...
null
SimpleGame.py
SimpleGame.py
py
7,729
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.time.Clock", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.font.init", ...
17368364
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0002_auto_20161120_0732'), ] operations = [ migrations.AlterField( model_name='app', ...
null
cartoview/app_manager/migrations/0003_auto_20161123_1134.py
0003_auto_20161123_1134.py
py
462
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
193301609
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib.pyplot as plt # In[5]: rev_m = 170 rev_stdev = 20 iterations = 1000 # In[6]: rev = np.random.normal(rev_m,rev_stdev,iterations) rev # In[7]: plt.figure(figsize=(15,6)) plt.plot(rev) plt.show() # In[8]: COGS = - (rev*n...
null
LucBrutoMontCarlo.py
LucBrutoMontCarlo.py
py
918
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.normal", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 29, "usage_type": "call" }, { "api_name": "matplo...
560793136
import re import logging class element_has_css_class(object): """An expectation for checking that an element has a particular css class. locator - used to find the element returns the WebElement once it has the particular css class """ def __init__(self, locator, css_class): self.log = l...
null
tests/frontend/custom_expected_conditions.py
custom_expected_conditions.py
py
2,816
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 48, "usage_type": "call" }, { "api_name": "re.compile", ...
264149225
#!/usr/bin/env # -*- coding: utf-8 -*- # filename = protected # author=KGerring # date = 10/1/17 """ filename = startups.integrations.protected""" from __future__ import absolute_import, unicode_literals from pathlib import Path import os import sys import regex import re import base64 import rsa from operator import ...
null
startups/integrations/protected.py
protected.py
py
12,207
python
en
code
null
code-starcoder2
76
[ { "api_name": "regex.compile", "line_number": 34, "usage_type": "call" }, { "api_name": "regex.M", "line_number": 35, "usage_type": "attribute" }, { "api_name": "regex.UNICODE", "line_number": 35, "usage_type": "attribute" }, { "api_name": "startups.integrations.b...
221878273
import pandas as pd import numpy as np import pytest from sklearn.base import clone from sklearn.pipeline import Pipeline from sklearn.model_selection import GridSearchCV from sklearn.linear_model import LogisticRegression from pandas_transformers.transformers import PandasOneHotEncoder, PandasTfidfVectorizer class ...
null
tests/pandas_transformers/test_transformers.py
test_transformers.py
py
11,264
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "pytest.fixture"...
447605442
# -*- coding: utf-8 -*- ''' encoding: utf-8 Author : tom_tao626@163.com > Datetime : 2019/9/12 0:03 User : Administrator Product : PyCharm Project : chatroom_project File : views_playchat.py ''' import tornado.web class PlayChatHandler(tornado.web.RequestHandler): def get(self, *args, **kwargs): dat...
null
py_tools/subprocess/async_demo/test/views_playchat.py
views_playchat.py
py
419
python
en
code
null
code-starcoder2
76
[ { "api_name": "tornado.web.web", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 13, "usage_type": "name" } ]
247217485
import matplotlib.pyplot as plt import math import random class City: list = [] count = -1 def __init__(self, coords=None): if coords is None: coords = City.newCoords() self.x = coords[0] self.y = coords[1] @staticmethod def newCoords(amp=None, theta=None): ...
null
genetic algorithm/travelling-salesman-oop.py
travelling-salesman-oop.py
py
6,691
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.random", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 24, "usage_type": "call" }, { "api_name": "math.cos", "line_number...
58362724
from pyspark.sql import SparkSession from pyspark.sql.functions import * if __name__ == "__main__": print("Application Started ...") spark = SparkSession \ .builder \ .appName("Socket Streaming Demo") \ .master("local[*]") \ .getOrCreate() stream_df = spark...
null
part2/socket_streaming/socket_streaming_word_count_trigger_demo.py
socket_streaming_word_count_trigger_demo.py
py
1,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 7, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 7, "usage_type": "...
423267845
import os from django.http import HttpResponse, Http404 from django.shortcuts import render # Create your views here. from ecommerce.settings import BASE_DIR from products.models import Product, ProductImage def index(request): template = 'products/index.html' products = Product.objects.all() context =...
null
products/views.py
views.py
py
2,145
python
en
code
null
code-starcoder2
76
[ { "api_name": "products.models", "line_number": 13, "usage_type": "name" }, { "api_name": "products.models.Product.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "products.models.Product.objects", "line_number": 13, "usage_type": "attribute" }, ...
202164781
import telegram as tel from telegram.ext import (Updater, ConversationHandler, CommandHandler, MessageHandler, Filters) import Commands as Com import DayCalc import one_day as OD users = {} messages = { 'gender...
null
DaySurvey.py
DaySurvey.py
py
10,789
python
en
code
null
code-starcoder2
76
[ { "api_name": "telegram.Bot", "line_number": 52, "usage_type": "attribute" }, { "api_name": "telegram.Update", "line_number": 52, "usage_type": "attribute" }, { "api_name": "DayCalc.MALE", "line_number": 60, "usage_type": "attribute" }, { "api_name": "DayCalc.FEMA...
249371949
#!/usr/bin/python from myconfig import myconfig from Dir_Info_GAIL import trpo import critic from environment import environment from sklearn.utils import shuffle import seaborn as sns import matplotlib.pyplot as plt import numpy as np import argparse from statistics import mean import pandas as pd from tensorflow.pyth...
null
Diplwmatikh projects/AircraftTrajectories_D_Info_GAIL/Dir_Info_GAIL/NOA/3modes/preprocess.py
preprocess.py
py
36,542
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.test.gpu_device_name", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.test", "line_number": 21, "usage_type": "attribute" }, { "api_name": "tensorflow.test.gpu_device_name", "line_number": 22, "usage_type": "call" }, { ...
581637831
# -*- encoding: utf-8 -*- import platform import logging __author__ = 'barycenter' VERSION = '1.0.0' try: from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass UserAgent = "aliyun-opensearch-python-sdk /%s /%s %s/%s" % ( ...
null
opensearchsdk/__init__.py
__init__.py
py
838
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Handler", "line_number": 12, "usage_type": "attribute" }, { "api_name": "platform.python_version", "line_number": 18, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 19, "usage_type": "call" }, { "api_name": "platform...
105582242
from flask import Flask, request from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////home/yarka/Documents/PycharmProjects/books/example19.db' db = SQLAlchemy(app) from models import * db.create_all() @app.route("/books") def books(): books = Books....
null
app.py
app.py
py
924
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.re...
628891431
from PyQt4 import QtGui, Qt, QtCore from TestDialog.TestDialog import Ui_Form from scipy.stats import norm, laplace, expon from tests import ktest, chisquare, ttest import numpy as np from scipy import stats import pandas as pd from tests import ktest, chisquare, ttest, K class TestDialog(Ui_Form): def currentInde...
null
TestDialog/__init__.py
__init__.py
py
6,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "TestDialog.TestDialog.Ui_Form", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.mean", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.std", "...
542403343
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 applica...
null
searchlight-2.0.0/searchlight/tests/functional/test_api.py
test_api.py
py
45,774
python
en
code
null
code-starcoder2
76
[ { "api_name": "oslo_utils.uuidutils.generate_uuid", "line_number": 28, "usage_type": "call" }, { "api_name": "oslo_utils.uuidutils", "line_number": 28, "usage_type": "name" }, { "api_name": "oslo_utils.uuidutils.generate_uuid", "line_number": 29, "usage_type": "call" },...
176972895
import os import re import io import sys import subprocess import branch import json import requests branchFileList = {} users_list = { "zyh_bug_master" : "sy0209" ,"hzf_master" : "sy0097" ,"zyh_master" : "sy0209" ,"xja_master" : "sy0729" ,"zln_master" : "sy0671" ,"cq_master" : "sy0238" ,"s...
null
GitMerge/gitcmd.py
gitcmd.py
py
4,408
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.Popen", "line_number": 24, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "subprocess.PIPE", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.system"...
595377003
from kawaiibot import config from kawaiibot.bot import kawaiibot from imgurpython import ImgurClient import logging import random sub_blacklist = ['traps'] try: imgur_client = ImgurClient(config['imgur']['id'], config['imgur']['secret']) except KeyError as e: logging.error('Missing imgur[{}] in configuration ...
null
kawaiibot/commands/imgur.py
imgur.py
py
1,430
python
en
code
null
code-starcoder2
76
[ { "api_name": "imgurpython.ImgurClient", "line_number": 10, "usage_type": "call" }, { "api_name": "kawaiibot.config", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 12, "usage_type": "call" }, { "api_name": "random.choice"...
102197737
import torch import os import logging import datetime import numpy as np import torch from tqdm import tqdm from typing import Any, Dict, List, Tuple, Union class Record(object): def __init__(self, percentage=False): super().__init__() self.value = 0. self.num = 0. self.percentage =...
null
utils/worker.py
worker.py
py
8,202
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.zeros", "line_number": 60, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 66, "usage_type": "call" }, { "api_name": "os.path.split", "line_number": 96, "usage_type": "call" }, { "api_name": "os.path", "line_number": 96...
363752629
#!/usr/bin/python import argparse import simplejson from hackbeil.hgutils import progressui ui = progressui() parser = argparse.ArgumentParser() parser.add_argument('svndir') parser.add_argument('dump', type=argparse.FileType('w')) options = parser.parse_args() items = [] import subvertpy.ra from hackbeil.branchrep...
null
bin/svn_log_to_jsonreplay.py
svn_log_to_jsonreplay.py
py
1,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "hackbeil.hgutils.progressui", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 9, "usage_type": "call" }, { "api_name": "ha...
458293450
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
null
test/legacy_test/parallel_dygraph_unused_variables.py
parallel_dygraph_unused_variables.py
py
4,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "paddle.nn.Layer", "line_number": 30, "usage_type": "name" }, { "api_name": "paddle.nn.Embedding", ...
177768773
import datetime DOW = { 'Monday': 0, 'Tuesday': 1, 'Wednesday': 2, 'Thursday': 3, 'Friday': 4, 'Saturday': 5, 'Sunday': 6, } STRATEGY = { '1st': 1, '2nd': 8, '3rd': 13, '4th': 22, '5th': 29, 'teenth': 13, } def meetup_day(year, month, dow, specification): if sp...
null
python/meetup/meetup.py
meetup.py
py
929
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.date", ...
21012866
from django.http import HttpResponse from django.shortcuts import render_to_response from django.shortcuts import render from django.core.context_processors import csrf from django.template import RequestContext from recruitments import forms,models from django.forms.models import model_to_dict from django.contrib.auth...
null
recruitments/views.py
views.py
py
2,687
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "recruitments.forms.FillResumeForm", "line_number": 17, "usage_type": "call" }, { "api_name": "recruitments.forms", "line_number": 17, "usage_type": "name" }, { "api_...
605000175
import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "" os.environ['PYTHONHASHSEED'] = '0' import sys import numpy as np import pandas import math import tensorflow as tf import random import matplotlib.pylab as plt #import talib seed = [4395,3129,277,9871,51...
null
mlp_variacoes.py
mlp_variacoes.py
py
9,060
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", ...
89904375
__author__ = 'MatthewRowe' import sqlite3 from src.Classes.Classes import * class DatabaseModel: dbName = "encyclopedia.db" def __init__(self): self.conn = sqlite3.connect(self.dbName, timeout=10) self.conn.text_factory = str self.cursor = self.conn.cursor() def setupTables(self...
null
src/Database/DatabaseModel.py
DatabaseModel.py
py
4,960
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" } ]
31541511
import os import pytest from .utils import upgrade_charms, upgrade_snaps from .validation import validate_all from .base import UseModel test_charm_channel = os.environ.get('TEST_CHARM_CHANNEL', 'edge') test_snap_channel = os.environ.get('TEST_SNAP_CHANNEL') @pytest.mark.asyncio async def test_validate(log_dir): ...
null
jobs/integration/test_cdk.py
test_cdk.py
py
757
python
en
code
null
code-starcoder2
76
[ { "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...
473687849
from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier import xgboost as xgb from sklearn.metrics import classification_report import json import pandas as pd from collections import Counter from sklearn.externals import joblib from sklearn.svm import SVC import sys from...
null
risk/model_limit/model/creat_model/get_final_model/get_tradmodel.py
get_tradmodel.py
py
3,067
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sklearn.ensemble.RandomFor...
547546292
import numpy as np import pandas as pd from recommender.similarity_recommender.combinedSimilarity import CombinedSimilarity from recommender.recommenderABC import RecommenderABC import os.path #preprocessing and training logic is described in notebooks/2_similarity_recommender.ipynb class SimilarityRecommender(Recomme...
null
app/recommender/similarity_recommender/similarityRecommender.py
similarityRecommender.py
py
3,279
python
en
code
null
code-starcoder2
76
[ { "api_name": "recommender.recommenderABC.RecommenderABC", "line_number": 8, "usage_type": "name" }, { "api_name": "recommender.similarity_recommender.combinedSimilarity.CombinedSimilarity", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.path.dirname", "lin...
62698634
from pprint import pprint from eveapimongo import MongoProvider from pymongo.errors import BulkWriteError POS_DAY_FEE = 2000000 def lambda_handler(event, context): message = event['Records'][0]['Sns']['Message'] print("SNS Message: " + message) if message == "deposits-built": BalanceJournalBuild...
null
functions/balanceJournalBuilder/balanceJournalBuilder.py
balanceJournalBuilder.py
py
4,256
python
en
code
null
code-starcoder2
76
[ { "api_name": "eveapimongo.MongoProvider", "line_number": 56, "usage_type": "call" }, { "api_name": "pymongo.errors.BulkWriteError", "line_number": 127, "usage_type": "name" }, { "api_name": "pprint.pprint", "line_number": 128, "usage_type": "call" } ]
254001894
# -*- coding:utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lice...
null
demo.py
demo.py
py
8,012
python
en
code
null
code-starcoder2
76
[ { "api_name": "ops.date_str_to_timestamp", "line_number": 70, "usage_type": "call" }, { "api_name": "ops.d.get_gap_time", "line_number": 71, "usage_type": "call" }, { "api_name": "ops.d", "line_number": 71, "usage_type": "name" }, { "api_name": "collections.Counte...
546296543
import gym env = gym.make('LunarLanderContinuous-v2') env.reset() for _ in range(1000): env.render() s, r, done, info = env.step(env.action_space.sample()) # take a random if done == True: break import gym env = gym.make('LunarLanderContinuous-v2') env.reset() import numpy as np a = np.array([0,...
null
lib/tmp/test_lander_continuous.py
test_lander_continuous.py
py
476
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 2, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" } ]
296010664
"""more testing (mostly minimax)""" # save a copy of the game # - so if we try to test different moves, doesn't affect the actual game # collect all the moves in the next move # - need to create an empty dictionary of moves # - calculate the scores of each move # calculating the score # - if player m...
null
a2/a2stuff/anothertest.py
anothertest.py
py
2,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Union", "line_number": 25, "usage_type": "name" }, { "api_name": "stonehenge_game.StonehengeGame", "line_number": 25, "usage_type": "name" }, { "api_name": "subtract_square_game.SubtractSquareGame", "line_number": 25, "usage_type": "name" }, { ...
571990817
import subprocess import os import time from datetime import datetime import schedule import atexit import signal import sys import shlex import argparse # perf-attack path ROOT = '/home/arnet/perf-attack/' # Data collection tools DIR_PERF_TOOLS = ROOT + 'perf-tools/bin' DIR_LOGS = ROOT + 'logs' IOSTAT = "iostat -d ...
null
src/logger.py
logger.py
py
9,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
68438718
import mongoExtensionsAST as mongo import difflib import logging import sys def specialLCS(X, Y, hid1, hid2, nameBoth1, nameBoth2): # log = logging.StreamHandler(sys.stdout) # log.setLevel(logging.DEBUG) logging.basicConfig(stream=sys.stdout, level=logging.INFO) # logging.basicConfig(level=logging.DEBU...
null
src/app/my_function.py
my_function.py
py
6,497
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.info", ...
551364571
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/Dani/Documents/Projects/Golismero_2.0/src_github/plugins/testing/scan/openvas.py # Compiled at: 2014-01-13 19:15:58 __license__ = '\nGoLismero 2.0 - The w...
null
pycfiles/golismero-2.0.3-1.tar/openvas.py
openvas.py
py
16,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.split", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.path.abspath", ...
140831315
import argparse, glob, os, cv2, sys, pickle import numpy as np import tensorflow as tf from models.stgru import STGRU from models.flownet2 import Flownet2 from tensorflow.python.framework import ops from constants import * import segmentation_models as sm from grfp_utils import * from collections import OrderedDict b...
null
smooth_test.py
smooth_test.py
py
5,214
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.load_op_library", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.python.framework.ops.RegisterGradient", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.python.framework.ops", "line_number": 14, "usage_t...
61313267
from __future__ import absolute_import import sys import time from graphql.execution.base import ResolveInfo from dagster import check from dagster.core.definitions.schedule import ScheduleExecutionContext from dagster.core.errors import ScheduleExecutionError, user_code_error_boundary from dagster.core.scheduler im...
null
python_modules/dagster-graphql/dagster_graphql/implementation/execution/scheduled_execution.py
scheduled_execution.py
py
3,590
python
en
code
null
code-starcoder2
76
[ { "api_name": "dagster.check.inst_param", "line_number": 24, "usage_type": "call" }, { "api_name": "graphql.execution.base.ResolveInfo", "line_number": 24, "usage_type": "argument" }, { "api_name": "dagster.check", "line_number": 24, "usage_type": "name" }, { "api...
191252307
import sqlite3 conn=sqlite3.connect('database1.db') # conn.execute("create table emp_det\ # ( emp_id int primary key,\ # emp_name varchar(50) not null,\ # emp_no int not null,\ # emp_add varchar(100) not null,\ # emp_dob varchar(50),\ # emp_email varchar(50),\ # emp_password varchar(50)\ # )\ # ") # conn....
null
emp_det.py
emp_det.py
py
750
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
315422079
#!/usr/bin/env python3 import os import time import psycopg2 from psycopg2.extras import NamedTupleCursor DBNAME = os.environ.get('DBNAME', 'nc') DBHOST = os.environ.get('DBHOST', None) DBUSER = os.environ.get('DBUSER', 'postgres') DBPARAMS = {'dbname': DBNAME, 'user': DBUSER} if DBHOST is not None: DBPARAMS['h...
null
examples/eta.py
eta.py
py
1,029
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
266889975
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime, timezone, timedelta from pathlib import Path import warnings import pandas as pd from covsirphy.util.argument import find_args from covsirphy.util.error import deprecate, DBLockedError, NotDBLockedError, UnExpectedValueError from covsirphy.ut...
null
covsirphy/loading/dataloader.py
dataloader.py
py
28,618
python
en
code
null
code-starcoder2
76
[ { "api_name": "covsirphy.util.term.Term", "line_number": 26, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 55, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 79, "usage_type": "call" }, { "api_name": "pandas.DataFra...
639447701
from filterpy.kalman import KalmanFilter import numpy as np from filterpy.common import Q_discrete_white_noise import matplotlib.pyplot as plt from kf_book.book_plots import plot_measurements from kf_book.book_plots import plot_filter from scipy.linalg import block_diag dt = 1.0 R = 3 kf = KalmanFilter(dim_x...
null
Kalman_test2.py
Kalman_test2.py
py
729
python
en
code
null
code-starcoder2
76
[ { "api_name": "filterpy.kalman.KalmanFilter", "line_number": 11, "usage_type": "call" }, { "api_name": "filterpy.common.Q_discrete_white_noise", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "a...
51837754
#Nancy Cao & Shariar Kabir #HW 6 - All about that database #Period 9 import sqlite3 #enable control of an sqlite database import csv #facilitates CSV I/O f="discobandit.db" db = sqlite3.connect(f) #open if f exists, otherwise create c = db.cursor() #facilitate db ops #====================================...
null
db_builder.py
db_builder.py
py
1,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 24, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 32, "usage_type": "call" } ]
527156955
from __future__ import division, absolute_import __copyright__ = "Copyright (C) 2013 Andreas Kloeckner" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, incl...
null
pytential/symbolic/execution.py
execution.py
py
16,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymbolic.mapper.evaluator.EvaluationMapper", "line_number": 41, "usage_type": "name" }, { "api_name": "pymbolic.mapper.evaluator.EvaluationMapper.__init__", "line_number": 45, "usage_type": "call" }, { "api_name": "pymbolic.mapper.evaluator.EvaluationMapper", "...
274750159
from fast import * from model import * from extra_utils import * from engine import train_one_epoch, evaluate import utils if __name__ == '__main__': train_files_dir = 'WIDER_train/images' train_annotate_dir = 'WIDER_train_annotations' valid_files_dir = 'WIDER_val/images' valid_annotate_dir...
null
train.py
train.py
py
2,596
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.collate_fn", "line_number": 32, "usage_type": "attribute" }, { "api_name": "utils.collate_fn", "line_number": 36, "usage_type": "attribute" }, { "api_name": "model.to", "line_number": 50, "usage_type": "call" }, { "api_name": "model.parameters...
264884342
import pytest from kibitzr.app import Application from ..compat import mock from ..helpers import SettingsMock @pytest.fixture(scope="function") def settings(request): """Override native settings singleton with empty one""" instance = SettingsMock.instance() request.addfinalizer(SettingsMock.dispose) ...
null
tests/unit/test_app.py
test_app.py
py
2,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "helpers.SettingsMock.instance", "line_number": 10, "usage_type": "call" }, { "api_name": "helpers.SettingsMock", "line_number": 10, "usage_type": "name" }, { "api_name": "helpers.SettingsMock.dispose", "line_number": 11, "usage_type": "attribute" }, { ...
428418104
#!/usr/bin/python # # Copyright (C) 2011 Mirantis Inc. # # Authors: Vladimir Kozhukalov <vkozhukalov@mirantis.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of t...
null
deployment/puppet/cobbler/templates/scripts/late_command.py
late_command.py
py
3,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "cStringIO.StringIO", "line_number": 55, "usage_type": "call" }, { "api_name": "gzip.GzipFile", "line_number": 56, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 62, "usage_type": "call" } ]
145209923
import pygame import froggerlib class Frogger: def __init__( self, width, height ,size): self.mSize = size self.mWidth = width self.mHeight = height self.mReducedSize = 0.8 * size column = self.mWidth / self.mSize row = self.mHeight / self.mSize ...
null
Frogger/frogger.py
frogger.py
py
11,461
python
en
code
null
code-starcoder2
76
[ { "api_name": "froggerlib.Frog", "line_number": 17, "usage_type": "call" }, { "api_name": "froggerlib.Stage", "line_number": 21, "usage_type": "call" }, { "api_name": "froggerlib.Stage", "line_number": 25, "usage_type": "call" }, { "api_name": "froggerlib.Road", ...
543695437
""" Auxiliary functions """ import os import json import joblib import numpy as np from itertools import permutations from numba import njit, prange from tqdm import tqdm from subprocess import Popen, PIPE from datetime import datetime import warnings warnings.filterwarnings("ignore") def get_actual_parametrizat...
null
scripts/functions.py
functions.py
py
5,412
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_n...
84416303
#!/usr/bin/env python2.7 # Import the Client from ambf_client package from ambf_client import Client import time import math import rospy import tf import numpy as np #import matplotlib.pyplot as plt import matplotlib matplotlib.use('TkAgg') from matplotlib import pyplot as plt import numpy as np from numpy import asar...
null
ambf_ros_modules/ambf_comm/scripts/tests_ambf/01NewCode/DATA_test_plots/test_sin/plots_new_rb_bp.py
plots_new_rb_bp.py
py
5,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_...
379117741
from setuptools import setup from os.path import join, dirname requirements = [ 'jsonpickle==0.7.1', 'requests==2.11.1', 'Jinja2==2.9.6', 'requests-unixsocket==0.1.5' ] version = open(join(dirname(__file__), 'version')).read().strip() setup( name='syncloud-lib', version=version, install_r...
null
pypi_install_script/syncloud-lib-176.tar/setup.py
setup.py
py
742
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 13, "usage_type": "call" } ]
125000163
from src import utils from MCFS import MCFS from datetime import datetime import time def main(): data_set_list = ['MNIST', 'lung_small', 'warpPIE10P', 'Yale', 'digits'] n_clusters_list = [10, 7, 10, 15, 10] meth = ['MCFS-I'] for i in range(len(data_set_list)): print('dataset: {}'.format(da...
null
src/test_neighbor.py
test_neighbor.py
py
2,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.utils.read_data", "line_number": 16, "usage_type": "call" }, { "api_name": "src.utils", "line_number": 16, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 27, "usage_type": "call" }, { "api_name": "time.localtime", "lin...
547416255
''' MARS Blender Tools - a Blender Add-On to work with MARS robot models File mtmaterials.py Created on 7 Jan 2014 @author: Kai von Szadkowski Copy this add-on to your Blender add-on folder and activate it in your preferences to gain instant (virtual) world domination. You may use the provided install shell script....
null
scripts/blender/marstools/mtmaterials.py
mtmaterials.py
py
2,465
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.data.materials.new", "line_number": 19, "usage_type": "call" }, { "api_name": "bpy.data", "line_number": 19, "usage_type": "attribute" }, { "api_name": "bpy.data.materials.keys", "line_number": 32, "usage_type": "call" }, { "api_name": "bpy.data...
611944158
import torch from torch import nn import torch.nn.functional as F import torchvision import clip device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class Encoder(nn.Module): """ Encoder. """ def __init__(self, encoded_image_size=14): super(Encoder, self).__init__() ...
null
models.py
models.py
py
13,705
python
en
code
null
code-starcoder2
76
[ { "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": "torch.nn.Module", ...
286576945
# -*- coding: utf-8 -*- from tasks import db from sqlalchemy.dialects.postgresql import JSON class GooglePlace(db.Model): __tablename__ = 'googleplace' id = db.Column(db.Integer, primary_key = True) place_id = db.Column(db.String()) data = db.Column(JSON) def __init__(self, place_id, data): self.place...
null
models.py
models.py
py
518
python
en
code
null
code-starcoder2
76
[ { "api_name": "tasks.db.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tasks.db", "line_number": 6, "usage_type": "name" }, { "api_name": "tasks.db.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "tasks.db", "line_number...
213099133
#-*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt import pandas as pd import time, ipdb, re import nltk from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager # Set up a browser to crawl from dynamic web pages from selenium import webdriver from selenium.webdri...
null
Conference_keyWord.py
Conference_keyWord.py
py
7,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.download", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 28, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 28, "usage_type": "name" }, { "api_name": "sel...
148260665
n = int(input()) grid = [list(map(int,input().split())) for i in range(n)] from collections import deque def LR(L, d): # -1 R, 1 L new = [] Q = deque() for row in L: for i in filter(None, row[::d]): Q.append(i) newrow = [] while Q: i = Q.popleft() if Q an...
null
Algorithm and Data Structure/Baekjoon/12000번대/12100번대/12100번 2048(easy)/boj12100_jh05013.py
boj12100_jh05013.py
py
796
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
143101893
import torch from torch import nn from torch import functional as F from .gated_graph_conv import GatedGraphConv class GGCN(nn.Module): def __init__(self, decoder, vocabulary, num_agg_steps, node_type_embed_dim = 10, ...
null
src/models/tgeometric/ggcn.py
ggcn.py
py
4,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
510806276
#!/usr/bin/env python import os import sys import bootstrap3 from setuptools import setup VERSION = bootstrap3.__version__ with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read().replace(".. :changelog:", "") setup( ...
null
setup.py
setup.py
py
1,358
python
en
code
null
code-starcoder2
76
[ { "api_name": "bootstrap3.__version__", "line_number": 11, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 19, "usage_type": "call" } ]
652314778
from django.forms import ModelForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django import forms from .models import * class StaffForm(ModelForm): class Meta: model = Staff fields = '__all__' exclude = ['user', 'employee_role', 'emp...
null
forms.py
forms.py
py
997
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 11, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 19, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 26, "usage_type": "name" }, { "api_name": "...
635477265
# !/usr/bin/env python # coding:utf-8 import os import json class FetchRealLevel(): def __init__(self): self.allow_db_list = ["oncokb", "civic", "cgi"] self.func_list = ["self.check_oncokb", "self.check_civic", "self.check_cgi"] def level(self, db_name, level, origin_descr, base_descr): ...
null
report_doc/get_real_level.py
get_real_level.py
py
3,544
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 78, "usage_type": "call" }, { "api_name": "os.path", "line_number": 78, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 84, "usage_type": "call" } ]
270357830
import time from bot_res import csv_beautifier, bot_c, msg_handler from configparser import ConfigParser bot = bot_c.telegram_chatbot("cfg/token_config.cfg") # init Strings from cfg file cfgParser = ConfigParser() cfgParser.read('cfg/b_bot_strings.cfg') tableName = cfgParser.get('tableManager', 'readTable') sleepDa...
null
bot_res/printer.py
printer.py
py
615
python
en
code
null
code-starcoder2
76
[ { "api_name": "bot_res.bot_c.telegram_chatbot", "line_number": 5, "usage_type": "call" }, { "api_name": "bot_res.bot_c", "line_number": 5, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "t...
100649682
import nltk from nltk.corpus import stopwords from nltk.corpus import senseval as se from nltk. corpus import wordnet as wn from nltk.stem import * # Creating stemmer stemmer = SnowballStemmer("english") # Removing standart stopwords and your customed list def remove_nltk_stop_words(tokens): new_list = [i for...
null
hw.py
hw.py
py
5,349
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.corpus.senseval.instances", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.senseval", "line_number": 19, "usage_type": "name" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 22, "usage_type": "call" }, { "a...
107345104
import unittest from chain.block import Block from transaction.transaction import CommitRandomTransaction, Type from crypto.enc_random import enc_part_random from Crypto.Hash import SHA256 class TestBlock(unittest.TestCase): def test_pack_parse(self): original_block = Block() original_block.timest...
null
tests/block.py
block.py
py
826
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "chain.block.Block", "line_number": 10, "usage_type": "call" }, { "api_name": "Crypto.Hash.SHA256.new", "line_number": 12, "usage_type": "call" }, { "api_name": "Crypto...
495247743
# 엔트리 포인트 -> 여기서부터 경로를 따진다. # 1. 모듈가져오기 from flask import Flask, render_template, request, jsonify, redirect from ml import detect_lang # 2. flask 객체 생성 app = Flask(__name__) # 3. 라우팅 # ~/ 요청하면 home() 함수가 응답(return) @app.route('/') def home(): return redirect('/kfqgo') # restful api # 기본 라우트는 get방식만 허용 @app.route('...
null
ml/service/run.py
run.py
py
1,258
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request", ...
569213898
#!/usr/bin/env python # -*- coding: utf-8 -*- ##################################################################### # Cada handler maneja las diferentes páginas y funcionalidades # # de la app. # # En la parte del final, verán que handlers se relacionan ...
null
main.py
main.py
py
20,014
python
en
code
null
code-starcoder2
76
[ { "api_name": "jinja2.Environment", "line_number": 37, "usage_type": "call" }, { "api_name": "google.appengine.ext.ndb.Key", "line_number": 49, "usage_type": "call" }, { "api_name": "google.appengine.ext.ndb", "line_number": 49, "usage_type": "name" }, { "api_name...
67138301
#------------------------------------------------------------------------------- # # Project: EOxServer <http://eoxserver.org> # Authors: Fabian Schindler <fabian.schindler@eox.at> # #------------------------------------------------------------------------------- # Copyright (C) 2014 EOX IT Services GmbH # # Permission...
null
eoxserver/resources/coverages/management/commands/eoxs_collection_synchronize.py
eoxs_collection_synchronize.py
py
3,618
python
en
code
null
code-starcoder2
76
[ { "api_name": "eoxserver.resources.coverages.management.commands.CommandOutputMixIn", "line_number": 39, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 39, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseComm...
609551061
from datetime import datetime from django.shortcuts import render from django.views import View def main(request): return render(request, 'main.html') def tickets(request): return render(request, 'tickets.html') def hello(request): return render(request, 'hello.html') def concerts(req...
null
Лаба 5/MyApp/app/views.py
views.py
py
1,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name":...
382776961
import sys import pkg_resources def convert_onnx2tf_pb(onnx_file="chest.onnx", pb_file="chest.pb"): for package in ["onnx","onnx_tf", "tensorflow"]: print(pkg_resources.get_distribution(package)) import onnx, onnx.optimizer import tensorflow as tf import onnx_tf # load onnx model ...
null
scripts/webdl_utils.py
webdl_utils.py
py
2,876
python
en
code
null
code-starcoder2
76
[ { "api_name": "pkg_resources.get_distribution", "line_number": 8, "usage_type": "call" }, { "api_name": "onnx.load", "line_number": 14, "usage_type": "call" }, { "api_name": "onnx.checker.check_model", "line_number": 16, "usage_type": "call" }, { "api_name": "onnx...
100879306
from setuptools import setup from os.path import join import sys import versioneer install_requires = ['menpo>=0.9', 'Flask>=0.10.1', 'Flask-RESTful>=0.2.12', 'CherryPy>=3.8.0', 'joblib>=0.8.4', 'PyYaml>=3.11'] if sys....
null
setup.py
setup.py
py
1,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 13, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "versioneer.get_version", "line_number": 17, "usage_type": "call" }, { "api_name": "version...
346604560
"""coBib's Git command. This command is a simple pass through to the `git` executable, running inside the folder of coBib's database (i.e. it is equivalent to running `git -C <path/to/cobib/database> <whatever arguments>`). It exists solely for convenience since the above can be cumbersome to type out and specifying a...
null
src/cobib/commands/git.py
git.py
py
2,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 63, "usage_type": "call" }, { "api_name": "base_command.Command", "line_number": 67, "usage_type": "name" }, { "api_name": "base_command.ArgumentParser", "line_number": 79, "usage_type": "call" }, { "api_name": "ar...
151643561
# Copyright 2013-2014 Massachusetts Open Cloud Contributors # # 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 applicab...
null
tests/unit/ext/obm/ipmi.py
ipmi.py
py
2,547
python
en
code
null
code-starcoder2
76
[ { "api_name": "haas.test_common.config_testsuite", "line_number": 25, "usage_type": "call" }, { "api_name": "haas.test_common.config_merge", "line_number": 26, "usage_type": "call" }, { "api_name": "haas.test_common.config.load_extensions", "line_number": 34, "usage_type"...
164232426
import scrapy import json import datetime import pprint class GolukSpider(scrapy.Spider): name = "goluk" def start_requests(self): now = datetime.datetime.now() formats = "%Y%m%d%H%M%S%f" for i in range(30000): now = now - datetime.timedelta(hours=.5) url = 'h...
null
ruki_spider/spiders/goluk.py
goluk.py
py
961
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "dateti...
47673402
#!/usr/bin/python2.7 import sys import requests import time from pprint import pprint import numpy import sys import pickle import gzip import datetime import utility_3 as ut import functions_financial as fn import os def run_optimizer(length, minutes, minutes_until_sale): if length == '1m': data_length_...
null
Development/utility.py
utility.py
py
13,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "utility_3.pickle_read", "line_number": 43, "usage_type": "call" }, { "api_name": "time.time", "line_number": 69, "usage_type": "call" }, { "api_name": "utility_3.pickle_write", "line_number": 76, "usage_type": "call" }, { "api_name": "utility_3.pick...
565978785
import pickle import os import numpy as np import torch import scipy.sparse as sp import time from utils import spmx_1_normalize, spmx2torch_sparse_tensor, spmx_sym_normalize # PATH = '/mnt/lizechao/10218_yanzhao/datasets/baseline_lastfm' PATH = '/home/wuwu/datasets/baseline_lastfm' class LastfmData(object): de...
null
SGNCF_CNN_PAIR/datasets_object/last_fm.py
last_fm.py
py
4,934
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
130594147
#!/usr/bin/python3 # -*- coding:utf-8 -*- import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import time import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt """ 初始化卷积核变量的初始值。 从截断的正态分布中输出随机值。生成的值服从具有指定 平均值和标准偏差的正态分布,如果生成的值大于平均值 2个标准偏差的值则丢弃重新选择。这里正太分布的标准差为0.1。 """...
null
LeNet/LeNet3.py
LeNet3.py
py
4,146
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.truncated_normal", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.Variable", "line_number": 20, "usage_type": "call" }, { "api_name": "tensorf...
144643192
from Button import Button import paho.mqtt.client as mqtt import tkinter as tk from Paddle import Paddle from Ball import Ball from Label import Label import random from time import sleep import json def subscribes(): global client #Al de topics waarop we moeten luisteren client.subscribe("/player1/server...
null
PongUpload/ClientSide/GameConsole.py
GameConsole.py
py
2,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" }, { "api_name": "Ball.Ball.move", "line_number": 35, "usage_type": "call" }, { "api_name": "Ball.Ball", "line_number": 3...
290801078
""" Copyright 2017-2018 cgratie (https://github.com/cgratie/) 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 ag...
null
keras_retinanet/models/inception.py
inception.py
py
4,324
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras_applications.inception_resnet_v2", "line_number": 39, "usage_type": "attribute" }, { "api_name": "keras_applications.inception_v3", "line_number": 42, "usage_type": "attribute" }, { "api_name": "keras.utils.get_file", "line_number": 47, "usage_type": ...
153497464
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
null
PaddleAudio/test/unit_test/test_transform.py
test_transform.py
py
5,644
python
en
code
null
code-starcoder2
76
[ { "api_name": "paddle.set_device", "line_number": 22, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 42, "usage_type": "call" }, { "api_name": "utils.load_example_audio1", "line_number": 81, "usage_type": "call" }, { "api_name": "numpy.r...
325141684
import json import logging import os import smtplib import sys import time from email.header import Header from email.mime.text import MIMEText from email.utils import parseaddr, formataddr from deploy.deploy import AutoDeployPlaton from common import log from common.load_file import get_node_list from common.connect ...
null
monitor.py
monitor.py
py
4,119
python
en
code
null
code-starcoder2
76
[ { "api_name": "email.utils.parseaddr", "line_number": 28, "usage_type": "call" }, { "api_name": "email.utils.formataddr", "line_number": 29, "usage_type": "call" }, { "api_name": "email.header.Header", "line_number": 29, "usage_type": "call" }, { "api_name": "emai...
347050853
import scipy.io as sio import numpy as np from keras.models import Sequential from keras.layers import Dense, Dropout mat_contents = sio.loadmat('g8data2.mat') mat_data = mat_contents['signalArr'] mat_labels = mat_contents['signalLabel'] print("No. of data: {}, No. of labels: {}".format(str(mat_data.shape), str(mat...
null
ML/phone_model.py
phone_model.py
py
1,560
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.loadmat", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 8, "usage_type": "name" }, { "api_name": "keras.models.Sequential", "line_number": 34, "usage_type": "call" }, { "api_name": "keras.layers.Dense", ...
164197341
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 7 00:43:40 2019 @author: luisalonsomurillorojas """ import numpy as np import json import cv2 from skimage.segmentation import felzenszwalb cap = cv2.VideoCapture(0) # Capture frame-by-frame ret, frame = cap.read() # Get serialized data filenam...
null
tarea02/felzenszwalb/felzenszwalb.py
felzenszwalb.py
py
811
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "skimage.segmentation.felzenszwalb", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.imsh...
109198683
# -*- coding: utf-8 -*- """ Created on Thu Aug 1 11:47:04 2019 @author: STEM """ import pandas as pd dir(pd) import plotly from plotly.offline import plot dir(plotly) import plotly.graph_objs as go wceodf = pd.read_excel("GISdata.xlsx", sheet_name = "womenCEOs") womenceos = go.Bar(x= wceodf["Year...
null
FinalProject.py
FinalProject.py
py
789
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 15, "usage_type": "call" }, { "api_name": "plotly.graph_objs.Bar", "line_number": 18, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 18, "usage_type": "name" }, { "api_name": "plotly.grap...
44913746
import numpy as np import math from typing import Tuple, Optional import pandas as pd from .callback import Callback from ..models.abs_model import AbsModel from ...plotting.plot_settings import PlotSettings import seaborn as sns import matplotlib.pyplot as plt __all__ = ['LRFinder'] class LRFinder(Callback): ...
null
lumin/nn/callbacks/opt_callbacks.py
opt_callbacks.py
py
4,440
python
en
code
null
code-starcoder2
76
[ { "api_name": "callback.Callback", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "models.abs_model.AbsMo...
464546922
#!/usr/bin/env python ''' Created on Jul 24, 2012 @author: shun ''' import subprocess import optparse import os import logging import sys # initializing logging.basicConfig(filename='fakeproject.log', level=logging.DEBUG, format='%(threadName)s %(levelname)-5s %(asctime)s %(name)s %(message)s') ...
null
myserver/openstack/tools/fakeproject.py
fakeproject.py
py
2,666
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.Stre...
8889725
import numpy as np import matplotlib.pyplot as plt import nltk from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn.decomposition import LatentDirichletAllocation from sklearn.cluster import KMeans, DBSCAN from sklearn.metrics import silhouette_scor...
null
Lab8_helper.py
Lab8_helper.py
py
4,563
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.data", "line_number": 22, "usage_type": "attribute" }, {...
247736190
from PyQt5.QtWidgets import QWidget, QLabel, QPushButton, QGridLayout, QLineEdit, QComboBox, QFrame from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtGui import QFont # 编辑用户信息 from SuperAdminisOperation import Edit_user class Edit_user_win(QFrame): def __init__(self,number): super(Edit_user_win, self...
null
low7/SuperAdminisInterface/Edit_user_win.py
Edit_user_win.py
py
5,260
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QFrame.StyledPanel", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QFrame", "line_number": 13, "usage_type": "name" }, { ...
634114355
from config import * import pathlib import torch import torch.nn as nn import torch.nn.functional as F FIELD_ELEMENTS = [ CELL_EMPTY, CELL_SHEEP_1, CELL_SHEEP_1_d, CELL_WOLF_1, CELL_SHEEP_2, CELL_SHEEP_2_d, CELL_WOLF_2, CELL_GRASS, CELL_RHUBARB, CELL_FENCE, ] FIELD_ELEMENTS_MA...
null
testing/joschwa_A3.py
joschwa_A3.py
py
16,609
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 28, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
503677122
# -*- coding: utf-8 -*- # © 2017-2019, ETH Zurich, Institut für Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ Defines the workflow that runs first-principles calculations and creates a tight-binding model, without running the window optimization. """ try: from collections import ChainMap excep...
null
aiida_tbextraction/fp_tb.py
fp_tb.py
py
7,838
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiida.work.workchain.WorkChain", "line_number": 33, "usage_type": "name" }, { "api_name": "fp_run.FirstPrinciplesRunBase", "line_number": 43, "usage_type": "argument" }, { "api_name": "aiida_tools.workchain_inputs.WORKCHAIN_INPUT_KWARGS", "line_number": 53, ...
329290890
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mysite', '0005_auto_20160819_0940'), ] operations = [ migrations.CreateModel( name='Category', field...
null
Python新手使用Django架站的16堂课-光盘内容/mshop/mysite/migrations/0006_category_product.py
0006_category_product.py
py
1,266
python
en
code
null
code-starcoder2
76
[ { "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": 14, "usage_type": "call" }, ...
245741656
from xlrd import open_workbook import psycopg2 conn = psycopg2.connect("dbname=hack user=jaakko") cur = conn.cursor() book = open_workbook('inversiones.xls', on_demand=True) for name in book.sheet_names(): sheet = book.sheet_by_name(name) num_rows = sheet.nrows -1 curr_row = 0 while curr_row < num_rows...
null
inversiones.py
inversiones.py
py
930
python
en
code
null
code-starcoder2
76
[ { "api_name": "psycopg2.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 6, "usage_type": "call" } ]
577280393
"""Provides REST-API and kubeseal-cli specific functionality.""" import json import logging import subprocess from flask import abort from flask_restful import Resource LOGGER = logging.getLogger("kubeseal-webgui") class AppConfigEndpoint(Resource): """Provide REST-API for retrieving api config information.""" ...
null
api/app/config.py
config.py
py
1,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.abort", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.Popen"...
623615966
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from create_db import Adjectives, Base, Positive engine = create_engine('sqlite:///happiness.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) adjectives = ['kind', 'loving', 'funny', 'happy', 'affectionate', 'ambitiou...
null
db/populate_db.py
populate_db.py
py
841
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "create_db.Base.metadata", "line_number": 7, "usage_type": "attribute" }, { "api_name": "create_db.Base", "line_number": 7, "usage_type": "name" }, { "api_name": "sql...
351969939
import jmespath import requests from requests.auth import HTTPBasicAuth from django.conf import settings import json import logging logger = logging.getLogger(__name__) class BibsonomyEntry: def __init__(self, bib_hash=None, bib_entry=None, entry_attrib=None, base_set=None): if entry_attrib is None: ...
null
apis_bibsonomy/utils.py
utils.py
py
3,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.auth.HTTPBasicAuth", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "jmespath.se...
601861523
# -*- coding: utf-8 -*- import os import urllib import hashlib import datetime, time import json from django import forms from django.conf import settings from django.db import transaction from apps.demandstory.models import DemandCase, DemandReach, DemandPublish, UserDemandLabel, DemandLabelCount, DemandReply, Demand...
null
sample/wsw/apps/demandstory/logics.py
logics.py
py
26,737
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.demandstory.models.DemandCase.objects.filter", "line_number": 47, "usage_type": "call" }, { "api_name": "apps.demandstory.models.DemandCase.objects", "line_number": 47, "usage_type": "attribute" }, { "api_name": "apps.demandstory.models.DemandCase", "line_...