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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
538527039 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2022 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | null | odps/tunnel/io/reader.py | reader.py | py | 15,085 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.options.force_py",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "config.options",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "reader_c.TunnelRecordReader",
"line_number": 52,
"usage_type": "name"
},
{
"api_name"... |
165457739 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^central-dogma/', include(admin.site.urls)),
url(r'^api/', include('kawaz.api.urls')),
url(r'^announcements/', include('kawaz.apps.a... | null | src/kawaz/urls.py | urls.py | py | 1,125 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 9,
"usage_type": "call"
},
{
"api... |
367135670 | """PIL's image resize manipulation(includes thumbnail function) loses JPEG's.
Helps to transplant Exif data into another JPEG.
Tested on Python 2.7 and 3.4
"""
import io
from ._common import *
def transplant(exif_src, image, new_file=""):
"""Transplants exif to another JPEG
transplant(exif_src, image, new_f... | null | pyxif/_transplant.py | _transplant.py | py | 1,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "io.BytesIO",
"line_number": 42,
"usage_type": "attribute"
}
] |
275922536 | #! /usr/bin/python
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
import sys
from pylab import rcParams
rcParams['figure.figsize'] = 10, 8
plt.rc('font',family='Times New Roman')
plt.rc('font', size=16)
colors=['#FF0000','#FF7F00','#FFFF00','#00FF00','#0000FF','#4B0082','#9400D3']
sheep... | null | plot_tolerance_comparison.py | plot_tolerance_comparison.py | py | 2,735 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pylab.rcParams",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
132786227 | def stock_data(begin_time, end_time, symbol = 0, write_pickle = False, read_pickle = False, include_returns = False):
'''
Provides Stock Data for each company based on a given time period and orders
the data in a DataFrame. Excludes unavailable company data (i.e. private company)
and has the optio... | null | FundamentalAnalysis/stock_data.py | stock_data.py | py | 3,774 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_pickle",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "lxml.html",
... |
45654236 | import random
from PyQt5 import QtWidgets
from wgpu.gui.qt import WgpuCanvas
import visvis2 as vv
class Main(QtWidgets.QWidget):
def __init__(self):
super().__init__(None)
self.resize(640, 480)
# Creat button and hook it up
self._button = QtWidgets.QPushButton("Add a line", self... | null | examples/integration_qt.py | integration_qt.py | py | 1,424 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
229331098 | import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
# read image with color
# img = cv2.imread('image2.jpg')
# read image with grey
img = cv2.imread('image2.jpg', 0)
# edge detection
filter1 = np.array([[1, 0, -1],
[0, 0, 0],
[-1, 0, 1]])
filter2 = np.a... | null | try/vFilterHist1.py | vFilterHist1.py | py | 949 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 2... |
445367906 | import math
from tempfile import NamedTemporaryFile
from typing import List
from bitarray import bitarray
from hypothesis import given, strategies as st
from bigsi.cmds.merge_blooms import merge_blooms
@given(num_rows=st.integers(min_value=1, max_value=8),
byte_values1=st.lists(min_size=1, max_size=100, eleme... | null | bigsi/tests/cmds/test_merge_blooms_cmd.py | test_merge_blooms_cmd.py | py | 2,189 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bitarray.bitarray",
"line_numbe... |
613404587 | # _*_ coding: utf-8 _*_
__author__ = 'Ruis'
__date__ = '2018/10/15 下午5:16'
import json
str = """
[{
"name": "大白菜",
"gender": "male",
"birthday": "1992-19-18"
},{
"name": "Selina",
"gender": "female",
"birthday": "1995-10-18"
}]
"""
print(type(str))
data = json.loads(str)
print(data)
print(typ... | null | 5.1/5.1.2json.py | 5.1.2json.py | py | 568 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 28,
"usage_type": "call"
}
] |
565790409 | from sqlite3 import OperationalError
__author__ = 'dan'
import logging
log = logging.getLogger(__name__)
def scrap_nasdaq():
try:
import selenium
except ImportError:
log.error('\nThere is no such module installed')
import sys
sys.exit(-1)
from selenium.webdriver import C... | null | utils.py | utils.py | py | 2,031 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.strptime",
... |
287346095 | import argparse
import time
from lunarlander_2d import LunarLander
import math, random
from collections import defaultdict, deque
import pdb
import matplotlib.pyplot as plt
from precision.to_precision import to_precision
import pickle
import numpy as np
STATE_SIZE = 8
NUM_PAST_STATE = 2
HOW_FAR = 10
startExplore = 1.0... | null | gym/envs/box2d/qlearning_heuristic.py | qlearning_heuristic.py | py | 13,147 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.cos",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 64,
"usa... |
126248416 | import itertools as it
import numpy as np
from heuristic_programming.grid.grid_summary import get_grid_summary
from heuristic_programming.state import State
from settings import *
import random
from copy import deepcopy
# For a given state (grid and his extractions points) it will generate all the optional final stat... | null | heuristic_programming/states/generate_states.py | generate_states.py | py | 3,034 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.combinations",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
... |
191702936 | """
BNF
BROADCAST ::= '{' FORMULA '}' FORMULA
| FORMULA
FORMULA ::= SYMBOL
| FORMULA '->' FORMULA # right associative
| FORMULA '|' FORMULA # left associative
| FORMULA '&' FORMULA # left associative
... | null | parserfiles/parser.py | parser.py | py | 2,755 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ply.lex.lex",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "ply.yacc.yacc",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "ply.yacc",
"line_number": 110,... |
63577027 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Usage: normalizeTranscriptsNames.py <id_series> [-s SEASON] [-e EPISODE]
Arguments:
id_series Id of the series
Options:
-s SEASON Season number to iterate on (all seasons if not specified)
-e EPISODE Episode number (all episodes of the season if n... | null | scripts/normalizeTranscriptsNames.py | normalizeTranscriptsNames.py | py | 7,542 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"lin... |
459341250 | """General functions"""
import fnmatch
import importlib
import os
import shutil
import stat
import subprocess
import sys
from distutils.dir_util import copy_tree
from subprocess import PIPE
from ezored import constants as const
from ezored import logging as log
# ----------------------------------------------------... | null | ezored/functions.py | functions.py | py | 11,270 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "shutil.rmtree",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_numbe... |
507598472 | #!/usr/bin/env python
import shlex
import subprocess
import sys
from setuptools import find_packages
from setuptools import setup
version = '6.4.8'
if sys.argv[-1] == 'release':
commands = [
'git tag v{}'.format(version),
'git push origin master --tag',
'python setup.py sdist upload',
... | null | setup.py | setup.py | py | 1,332 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "subprocess.call",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number... |
369078124 | from django.shortcuts import render, redirect
from django.http import JsonResponse,HttpResponse
from web import models
# 分页
from web.pager import Pagination, PaginationNew
from web.tests import change_info
def home(request):
change_info(request)
return render(request, 'home.html')
def profiles(request):
... | null | web/views.py | views.py | py | 11,230 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "web.tests.change_info",
"line_number": 10,
"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": ... |
83372522 | import tkinter as tk
from PIL import ImageTk, Image
#To start this program we have used the program GUIAddingJPG.py
#to setup the image for clicking.
def clicked1(event):
print("Clicked - 1")
def clicked2(event):
print("Clicked - 2")
#This creates the main window of an application
window = tk.Tk()
window.title("... | null | GUI Demo Files/GUIInteractiveClickDemo1.py | GUIInteractiveClickDemo1.py | py | 927 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tkinter.Tk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"l... |
137277403 | '''
Phase 2 berry project
- Detect the PCB outline.
~ Find the corners of the outer outline.
~ Draw straight lines using the points to get cleans edges.
~
- Find all markers and replace them with sensor models.
~ Replace tags with a model of the sensor in a preview
~ Draw symbol on the PCB layout f... | null | BerrySniffer.py | BerrySniffer.py | py | 3,108 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.aruco.getPredefinedDictionary",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "cv2.aruco",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.cElementTree.Element",
"line_number": 36,
"usage_type": "call"
},
{
"a... |
259565722 | from django.shortcuts import render,render_to_response,HttpResponse,HttpResponseRedirect
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.core.mail import EmailMessage
from django.contrib.auth.models import User,Group
def send_mandrill_email(self,mandrill_template_... | null | portal/utils.py | utils.py | py | 1,169 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.mail.EmailMessage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.all",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 22,
"u... |
341757440 | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 13 14:14:05 2016
@author: doarni
"""
import os
from colorama import Fore, Back, Style
from colorama import init
init(autoreset=True)
init(convert=True)
init(wrap=True)
os.system('cls')
lb = Fore.LIGHTGREEN_EX + '['
rb = Fore.LIGHTGREEN_EX + ']'
btxt = Fore.LIGHTWHITE_EX ... | null | Scripts/Console.py | Console.py | py | 2,757 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "colorama.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "colorama.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "colorama.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_numbe... |
226640895 | import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits import mplot3d
from matplotlib import cm
import seaborn as sns
u = np.loadtxt('Data/u11')
v = np.loadtxt('Data/v11')
P = np.loadtxt('Data/p11')
param = np.loadtxt('Parameters/input11')
exp_count = int(np.loadtxt('Parameters/counter')) - 1
dx = param... | null | plot11.py | plot11.py | py | 1,304 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.loadtxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_numb... |
232178732 | import random
from typing import Optional
from state import State, Context
from utils.ui import Singleton
import scenes.adventuring.adventuring as adventuring
ui = Singleton()
class _Choice:
def __init__(self, ctx: Context,
want_fmt: str, want_amt: int,
give_fmt: str, give_amt... | null | scenes/adventuring/traveller.py | traveller.py | py | 4,600 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.ui.Singleton",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "state.Context",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "state.Context",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "state.Context",
"li... |
620544466 | #
# 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
# "License"); you may not... | null | tests/python/proton_tests/sasl.py | sasl.py | py | 4,975 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.Test",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "common.pump",
"line_number": 36,
"usage_type": "call"
}
] |
649497116 | from . import config
import datetime
from datetime import timedelta
import requests
def sub_end_date(sub_type='free'):
if sub_type == "free":
return datetime.datetime.now() + timedelta(days=config.TRAIL_PERIOD)
else:
return datetime.datetime.now() + timedelta(days=config.SUBSCRIPTION_PERIOD)
def invitation_e... | null | rabbitmq_django_dialog-manager_node_posgres_mongo/django-apis/faq/utils.py | utils.py | py | 3,160 | 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": "datetime.timedelta",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime... |
545756378 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
S_new #futur similarity matrix
For each point:
find neighborhood
fit line
update elements of S_new
"""
import numpy as np
from sklearn.decomposition import PCA
from scipy import sparse as sp
def compute_distances(embedding, sim_mat):
# (n, dim) = np.s... | null | mdso/new_sim_from_embedding_test_.py | new_sim_from_embedding_test_.py | py | 8,791 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.sparse.find",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.sum",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_numb... |
388512606 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 2 15:47:25 2019
File:Model.py
@author: WZX
"""
import os
import tensorflow as tf
import numpy as np
import random
import matplotlib.pyplot as plt
from PIL import Image
from data_generator import dataset_split,generator
from sklearn.metrics import confusion_matrix
... | null | Inception/Model.py | Model.py | py | 27,384 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": ... |
42131010 | import datetime
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import os
from ChatHandler import PostbackIntent
SECRET = "/BloombergLineBot/Crawler/secret.json" if os.uname()[
0] != "Darwin" else "/Users/warrencheng/BloombergLineBot/secret.json"
class Database:
... | null | Database.py | Database.py | py | 3,416 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.uname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
446417907 | from allimports import *
from models import *
from middleware import *
import datetime
import uuid
from flask import Flask, request, render_template, session, logging, flash, redirect, url_for, jsonify, json
from flask_mail import Mail, Message
app = Flask(__name__)
app.config.from_object('settings')
#app.config.from_... | null | landifo.py | landifo.py | py | 4,631 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_mail.Mail",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime"... |
457126846 | import telebot
bot = telebot.TeleBot('1891179593:AAEbSzhgSbDZKYhtecatsWRpVgqQKmtd3iA')
#по команде meet нам возвращается ссылка
@bot.message_handler(commands=['meet'])
def open_website(message):
bot.send_message(message.chat.id, "ГО! ГО! ГО!: <a href='https://meet.google.com/bxq-nsek-ept'>Митинг</a>", parse_mode=... | null | Azamat.py | Azamat.py | py | 805 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "telebot.TeleBot",
"line_number": 3,
"usage_type": "call"
}
] |
334478610 | import collections
class Solution:
def isIsomorphic(self, S: str, T: str) -> bool:
if len(S) != len(T):
return False
s2t = collections.defaultdict()
t2s = collections.defaultdict()
for s, t in zip(S, T):
if s in s2t and s2t[s] == t and t in ... | null | leetcode/205-Isomorphic-Strings.py | 205-Isomorphic-Strings.py | py | 546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
}
] |
555161703 | from flask import render_template, redirect, url_for, request, abort
from models.Roles import Roles
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS, cross_origin
db = SQLAlchemy()
# cors = CORS(app)
@cross_origin()
def create_roles():
print(request.json)
roles_descripcion = request.json['... | null | backend_V2/src/controllers/rolesController.py | rolesController.py | py | 606 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flas... |
629010100 | # coding: utf-8
# Elimina una pelicula
import webapp2
from google.appengine.ext import ndb
from webapp2_extras import jinja2
from model.pelicula import Pelicula
from webapp2_extras.users import users
import time
class EliminarPeliculaHandler(webapp2.RequestHandler):
def get(self):
usuario = users.get_cur... | null | handlers/peliculas/eliminar.py | eliminar.py | py | 888 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "webapp2_extras.users.users.get_current_user",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "webapp2_extras.users.users",
"line_number": 14,
"usage_type": "na... |
564560978 | #!/usr/bin/env python
"""
This script downloads a resource into the specified output file.
"""
import json
from argparse import ArgumentParser
import requests
# Parse arguments
parser = ArgumentParser()
parser.add_argument("--url", type=str, required=True)
parser.add_argument("--output", type=str, required=True)
par... | null | src/cache/commands/curl_fetch.py | curl_fetch.py | py | 729 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
}
] |
630946251 | from psana import *
import numpy as np
from mpidata import mpidata
from mpi4py import MPI
comm = MPI.COMM_WORLD
comm_rank = comm.Get_rank()
comm_size = comm.Get_size()
def runclient(args):
ds = DataSource(args.exprun+':idx')
run = ds.runs().next()
det1 = Detector(args.detInfo)
times = run.times()
eventTotal = l... | null | Testing_v03/automation/fpclient.py | fpclient.py | py | 1,249 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.maximum",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "mpidata.mpidata",
... |
100724443 | from numpy import arange
from matplotlib import pyplot as p
def fi(x, h = 0):
res = 0
if x == 1:
res = 10
elif x < 1:
res = 10 * (1 + x)
else:
res = 0
return res
c_arr = [0.1, 0.5, 0.6, 1.0, 2.5]
h = 0.01
tau = 0.01
x_arr = arange(0, 50, h)
t_arr_print = [0.0, 0.1, 0.... | null | python/univer/shapoch/numerical_methods/lab2/nasya/tochnoe.py | tochnoe.py | py | 688 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
504493165 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | null | pychron/envisage/browser/find_references_config.py | find_references_config.py | py | 3,189 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "traits.api.HasTraits",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pychron.persistence_loggable.PersistenceMixin",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "traits.api.List",
"line_number": 33,
"usage_type": "name"
},
{
... |
189448407 | from flask_restful import Resource, reqparse, abort
from flask import jsonify
from models.message import MessageModel, MessageSchema
from database import db
import json
class MessageListAPI(Resource):
def __init__(self):
self.reqparse = reqparse.RequestParser()
self.reqparse.add_argument('sentence... | null | server/apis/message.py | message.py | py | 2,228 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask_restful.Resource",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 10,
"usage_type": "name"
},
{
... |
610958920 | import pika,sys
credentials = pika.PlainCredentials('zx2005', 'redhat')
# 使用上面定义的用户名密码,连接远程的队列服务器
connection = pika.BlockingConnection(pika.ConnectionParameters(
"10.1.1.128",
credentials=credentials
))
# 在tcp连接基础上,建立rabbit协议连接
channel = connection.channel()
# 发送端只需要申明交换器
channel.exchange_declare(exchange='... | null | rabbitmq/fanout_send.py | fanout_send.py | py | 707 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pika.PlainCredentials",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
136768086 | """ Convenience functions for working with mercurial.
Requires the hg binary on the path"""
from paver.easy import sh
def clone(url, dest):
""" Clones a mercurial repository """
sh("hg clone %(url)s %(dest)s" % dict(url=url, dest=dest))
def pull(dest):
""" Performs a hg pull on the specified repository... | null | paver/hg.py | hg.py | py | 1,373 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "paver.easy.sh",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "paver.easy.sh",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "paver.easy.sh",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "paver.easy.sh",
"line_nu... |
51602965 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 03 12:53:22 2015
@author: dvalovcin
"""
import numpy as np
import scipy.integrate as spi
from scipy.interpolate import interp1d
from PyQt5 import QtCore, QtGui, QtWidgets
import threading
import json
import glob
import time
import datetime
import copy
try:
from InstsA... | null | __main__.py | __main__.py | py | 62,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "InstsAndQt.Instruments.Instruments",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "InstsAndQt.Instruments",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pyqtgraph.setConfigOption",
"line_number": 34,
"usage_type": "call"
},
... |
347795916 | from flask import Blueprint, render_template,redirect,url_for
from myproject.index.forms import PostForm
from myproject.models import Post,Gamer
from flask_login import current_user,logout_user
from myproject import db
index_blueprint = Blueprint("index",__name__,template_folder="templates/index")
@index_blueprint.ro... | null | myproject/index/views.py | views.py | py | 825 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "myproject.index.forms.PostForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "myproject.models.Gamer.query.filter_by",
"line_number": 16,
"usage_type": "call"
},
{
... |
265703777 | from __future__ import unicode_literals
from django.db import migrations
contact_types = ('Person', 'Company', 'Department')
def _add_data(ContactType):
for name in contact_types:
ContactType.objects.get_or_create(name=name)
def add_data(apps, schema_editor):
ContactType = apps.get_model('identiti... | null | anaf/identities/migrations/0002_initial_data.py | 0002_initial_data.py | py | 541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 25,
"usage_type": "call"
},
... |
613777977 | import cv2
import json
import os
import numpy as np
from keras.models import load_model
from sklearn.model_selection import cross_val_score, ShuffleSplit, KFold
from sklearn.neighbors import KNeighborsClassifier
import joblib
# import matplotlib.pyplot as plt
from getdata import base_path
image_path = base_path
def ... | null | train_knn.py | train_knn.py | py | 3,679 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "getdata.base_path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
498192848 | from odoo import api, fields, models, _
import time
import csv
from odoo.modules import get_modules, get_module_path
from odoo.exceptions import UserError
import copy
import logging
from io import StringIO
import base64
_logger = logging.getLogger(__name__)
class efaktur_pk_wizard(models.TransientModel):
_name = ... | null | vit_efaktur/wizard/pk.py | pk.py | py | 11,621 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "odoo.models.TransientModel",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "odoo.fi... |
19427074 | import cv2
# Cargar la cascada
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# Video de la webcam.
cap = cv2.VideoCapture(0)
# Para usar un video
# cap = cv2.VideoCapture('filename.mp4')
while True:
# Leer framexframe
_, img = cap.read()
# Convertir a escala de grises
g... | null | face_video.py | face_video.py | py | 751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
172034215 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file contains the code to initial popullated MondoDB Database with
Rates
@author: esssfff
"""
# Load Libraries
from requests import get
import pandas as pd
import matplotlib.pyplot as plt
# Link
url = "https://api.bcb.gov.br/dados/serie/bcdata.sgs.11/dados?forma... | null | 98_Notebook/Juros_Futuros_Notebook.py | Juros_Futuros_Notebook.py | py | 3,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
650109500 | #!/usr/bin/env python3
from io import IncrementalNewlineDecoder
import sys
import collections
import itertools
import numpy
import math
import aoc
infilename = 'input.txt'
if len(sys.argv) > 2 and sys.argv[1] == '-i':
infilename = sys.argv[2]
print('Using input file: %s' % infilename)
f = open(infilename, 'r')... | null | 2021/21/puzzle21.py | puzzle21.py | py | 2,074 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "itertools.product",
"line_number": 68,
"usage_type": "call"
}
] |
304292088 | import praw
import configparser
import pandas as pd
import pprint
#set options
pd.set_option('display.max_columns', None)
#read config
config = configparser.ConfigParser()
config.read('../config.ini')
reddit = praw.Reddit(client_id=config['default']['client_id'],
client_secret=config['default']['client_secret'],
pa... | null | code/func.py | func.py | py | 5,641 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "praw.Reddit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFra... |
379438059 | import argparse
import json
def add_arguments(parser):
parser.add_argument("--input_file", help="path to input file", required=True)
parser.add_argument("--output_file", help="path to output file", required=True)
def convert_squad(input_file,
output_file):
with open(input_file, "r") as f... | null | tool/convert_squad_v1.py | convert_squad_v1.py | py | 814 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
}
] |
202656381 | import pandas as pd
import numpy as np
import math
import glob
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import torch
import torch.nn.functional as F
import torch.nn as nn
from sklearn.model_selection import train_test_split
def f(path,x):
all_files = glob.glob(path +... | null | Method1.py | Method1.py | py | 2,893 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
... |
332808293 | import datetime
def us01_date_b4_now(ind, family):
for key, values in ind.items():
if (values.__contains__("BIRT_DATE") and ind[key]["BIRT_DATE"] != "NA"):
isB4Now = us01_tsk01_is_b4_now(ind[key]["BIRT_DATE"][0])
if (isB4Now == False):
print('Error US01 in line', ind... | null | us01_ny.py | us01_ny.py | py | 2,191 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
311909224 | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from router import product, user, authentication
from db import models
from db.database import engine
app = FastAPI(
title="Shopping Cart API",
description="This API was developed for teaching Fast API",
version=... | null | app.py | app.py | py | 807 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "router.authentication.router",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "router.authentication",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
181597156 | # Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""
.. module:: quantumflow.xforest
Interface to pyQuil and the Rigetti Forest.
.. autofunction:: circuit_to_pyquil
.. autofunctio... | null | quantumflow/xforest.py | xforest.py | py | 2,920 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "circuits.Circuit",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "pyquil.quil.Program",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "ops.Gate",
"line_number": 73,
"usage_type": "argument"
},
{
"api_name": "pyquil.quil.Program... |
436189421 | import SpeechRecognition.AutoSpeechRecognition as asr
import numpy as np
source_folder = "sourcefiles"
destination_folder = "destfiles"
def run():
pass
# test_num()
# speechpyrun()
wav_plot("left.wav", noise=200)
# test_frequency()
# dir_abstract()
# test_outer_line()
# test_left()
... | null | src/App.py | App.py | py | 5,224 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "librosa.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "librosa.feature.melspectrogram",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "librosa.feature",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "nump... |
329505145 | import os
import pathlib
import re
import urllib
from abc import ABCMeta
from fsspec.registry import (
get_filesystem_class,
known_implementations,
registry,
)
from fsspec.utils import stringify_path
from upath.errors import NotDirectoryError
class _FSSpecAccessor:
def __init__(self, parsed_url, *ar... | null | upath/core.py | core.py | py | 10,413 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fsspec.registry.get_filesystem_class",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlunparse",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 22,
"usage_type": "attribute"
},
{
"ap... |
349591291 | import unittest
import nose
import numpy as np
from pandas import tslib
from datetime import datetime
from pandas.core.api import Timestamp
from pandas.tslib import period_asfreq
from pandas.tseries.frequencies import get_freq
from pandas import _np_version_under1p7
class TestDatetimeParsingWrappers(unittest.Te... | null | pandas/tseries/tests/test_tslib.py | test_tslib.py | py | 7,336 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.tslib.verify_datetime_bounds",
"line_number": 24,
"usage_type": "attribute"
},
{
... |
503282856 | import crcmod
from opendbc.can.packer import CANPacker
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf)
dbc_name = 'hyundai_kia_generic'
packer = CANPacker(dbc_name)
values = {
"CF_Spas_Stat": 5,
"CF_Spas_TestMode": 0,
"CR_Spas_StrAngCmd": 18.5,
"CF_Spas_BeepAlarm": 0,
"CF_Sp... | null | testop.py | testop.py | py | 1,314 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "crcmod.mkCrcFun",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "opendbc.can.packer.CANPacker",
"line_number": 8,
"usage_type": "call"
}
] |
372769087 | import logging
from common import errfunctions
from common import osfunctions
import pathlib
import random
import shutil
from PyQt5 import QtCore
from PyQt5.QtGui import QTextCursor
from PyQt5.QtPrintSupport import QPrinter
from common.constants import Paths
from common.textdocumentfunctions import JTextDocument
fro... | null | common/filesystemfunctions.py | filesystemfunctions.py | py | 12,274 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "widgets.messageboxes.AreYouSureDialog",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_nam... |
579002837 | """Efrain Duarte Lopez"""
print("You will give us floating numbers, and it will show you average and standard deviation of those numbers.")
import statistics
numbers=[]
r="yes"
while r=="yes":
while True:
try:
x=float(input("please enter a number: "))
numbers.append(x)
... | null | wsq10.1.py | wsq10.1.py | py | 779 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "statistics.mean",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",
"line_number": 23,
"usage_type": "call"
}
] |
392245214 | from tensorflow.python.keras.utils import to_categorical
import pandas as pd
import numpy as np
import datetime
model_data_root = 'data/learning/models/'
learning_data_root = 'data/learning/'
# for model.fit function -> keras description
# class_weight: Optional dictionary mapping class indices (integers) to a weight... | null | utility.py | utility.py | py | 2,864 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "da... |
453861695 | from contextlib import contextmanager
import functools
import sys
import threading
from .base import Logger
from .helpers import string_types
from logbook import debug as logbook_debug
class _SlowContextNotifier(object):
def __init__(self, threshold, logger_func, args, kwargs):
self.logger_func = logger... | null | lib/python3.5/site-packages/logbook/utils.py | utils.py | py | 5,382 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Event",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logbook.debug",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "threading.local",
... |
464657060 | # logger.py - Return a logger for this app.
"""
Create a logger for this ap.
Copyright (c) 2020 by Thomas J. Daley, J.D.
"""
import logging
import os
import dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
dotenv.load_dotenv(dotenv_path)
class Logger(object):
"""
Encapsulates our standar... | null | app/util/logger.py | logger.py | py | 2,023 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"l... |
186434611 | from django import template
from parsifal.reviews.models import Article, ArticleEvaluation
register = template.Library()
@register.assignment_tag
def get_user_article_evaluation(article, user_id):
status = Article.objects \
.get(id=article.id) \
.get_user_evaluation(user_id=user_id... | null | parsifal/reviews/templatetags/get_user_article_evaluation.py | get_user_article_evaluation.py | py | 341 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "parsifal.reviews.models.Article.objects.get",
"line_number": 8,
"usage_type": "call"
},
{
"... |
135987914 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('activity', '0017_auto_20161010_1130'),
]
operations = [
migrations.AlterField(
model_name='activity',
... | null | activity/migrations/0018_auto_20161103_2138.py | 0018_auto_20161103_2138.py | py | 481 | 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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
386884983 | from django.conf.urls import url
from .views import *
app_name = 'accounts'
urlpatterns = [
url(r'^register/', RegisterView.as_view(), name='register'),
url(r'^login/', LoginView.as_view(), name='login'),
url(r'^logout/', LogoutView.as_view(), name='logout'),
url(r'^edit-profile/', EditProfileView.as... | null | accounts/urls.py | urls.py | py | 558 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
314116386 | from django.conf.urls import include, url
from django.conf import settings
from django.urls import path
from django.contrib import admin
admin.autodiscover()
import hello.views
# Examples:
# url(r'^$', 'gettingstarted.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
urlpatterns = [
path('admin/',... | null | gettingstarted/urls.py | urls.py | py | 4,321 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
306425975 | #!/usr/bin/env python
"""
Test mapping y = f(X) using symbolic expression from sympy
"""
from synthetic_data.synthetic_data import make_tabular_data
from sympy import cos, sin, symbols
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from math import pi
import pickle
impor... | null | examples/3d_cont_with_binom/01_example_3d_data.py | 01_example_3d_data.py | py | 3,535 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "synthetic_data.utils.resolve_output_path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sympy.symbols",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "s... |
536374208 | import typing as t
import sys
import os
import audio_tools
import config
from airpixel import client as air_client
import profiler
from effects import CircularFourierEffect
if config.MOCK_RING:
from PyQt5.QtWidgets import QApplication
from airpixel import qt5_client
if config.MOCK_AUDIO:
import mock_audi... | null | ring/ring/run.py | run.py | py | 1,445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.MOCK_RING",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "config.MOCK_AUDIO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
436726456 | import util
from mechanize import Browser
from bs4 import BeautifulSoup
import re
import logging
import urllib
from enum import Enum
class Galaxy:
def __init__(self, browser, universe):
self.url_provider = util.UrlProvider(universe)
self.logger = logging.getLogger('ogame-bot')
self.browser ... | null | ogbot/scraping/galaxy.py | galaxy.py | py | 2,425 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "util.UrlProvider",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup... |
7009311 | #!/usr/bin/python
"""
WARNING: This script is defunct and broken, but could be revived
if the need arose, though makes more sense to just run
DownsampleTasks.
This script will download an entire layer at a given resolution,
execute downsampling, and upload the results. It generally creates
multiple mip levels from a ... | null | python/neuroglancer/pipeline/scripts/super_downsample.py | super_downsample.py | py | 6,880 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lib.Vec3",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "lib.min2",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "lib.xyzrange",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "lib.min2",
"line_number": 38,
... |
305514171 | """Parse PFB avro, write sqlite, summarize."""
from fastavro import reader
import json
from datetime import date, datetime
import sqlite3
import logging
def json_serial(obj):
"""JSON serializer for objects not serializable by default json code."""
if isinstance(obj, (datetime, date)):
return obj.isofo... | null | pyAnVIL/anvil/gen3/entities.py | entities.py | py | 6,802 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
202840879 | import numpy as np
from scipy.stats import multivariate_normal
import cv2
from util.util import transform_img_5_dim
THRESHOLD = 1e-7
MAX_ITERATION = 100
class GMM:
def __init__(self, X, C):
"""
:param X: image in RGB format
:param C: number of classes in GMM, here default as 2, to discri... | null | BIOCV_hw2/algorithms/gmm.py | gmm.py | py | 4,433 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.rand",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.cov",
"line... |
578059137 | """
Tool to print workout routine to latex document.
Code plan:
1. Start with calculating a table of weights given a workout number and 1rm.
2. Have a list of exercise names and 1rm - convert to 90% of one rep max.
3. Function to generate workout
- Main exercise name, sets, reps and Weights
- List of accessory... | null | workout.py | workout.py | py | 8,746 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pylatex.Tabular",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "pylatex.Tabular",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "pylatex.VerticalSpace",
... |
351687428 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 11:46:31 2017
@author: lansford
"""
from __future__ import division
import os
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
from jl_spectra_2_structure import HREEL_2_scaledIR
from jl_spectra_2_structure.plotting_tools impor... | null | scripts/Predict_Experiment.py | Predict_Experiment.py | py | 7,432 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jl_spectra_2_structure.plotting_tools.set_figure_settings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jl_spectra_2_structure.cross_validation.LOAD_CROSS_VALIDATION",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_... |
383454729 | from collections.abc import MutableMapping
import json
import operator
import re
from .utils import (
ExtractorError,
remove_quotes,
)
_OPERATORS = [
('|', operator.or_),
('^', operator.xor),
('&', operator.and_),
('>>', operator.rshift),
('<<', operator.lshift),
('-', operator.sub),
... | null | .venv/Lib/site-packages/yt_dlp/jsinterp.py | jsinterp.py | py | 21,658 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "operator.or_",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "operator.xor",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "operator.and_",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "operator.rshif... |
622845635 | ############################################################################
# #
# Copyright 2015 Prelert Ltd #
# #
# Licensed u... | null | prelert/engineApiClient/EngineApiClient.py | EngineApiClient.py | py | 26,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.info",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "httplib.HTTPConnection",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "logging.error",
"l... |
641528871 |
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome('chromedriver')
driver.get("https://www.youtube.com/")
#driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
# driver.implicitly_wait(5)
sleep(5)
searchbox = driver.find_element_by_xpath('/html/body/ytd-app/div/app-dr... | null | Jaskirat_Singh_Sudan/WebAutomation.py | WebAutomation.py | py | 612 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
}
] |
522868099 | import scrapy
class PopulationOfDistrict(scrapy.Spider):
name = "districtPop"
def start_requests(self):
urls = [
"https://www.citypopulation.de/en/india/admin/",
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
def parse(self, respons... | null | IGTProjectData/IGTProjectData/spiders/PopByDistrict.py | PopByDistrict.py | py | 1,221 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 13,
"usage_type": "call"
}
] |
447192671 | from apscheduler.schedulers.background import BlockingScheduler
from customer_apps import json_ingest, yaml_ingest
import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler, FileCreatedEvent, LoggingEventHandler
import threading
class CustomerHandl... | null | assignment-2-784627/code/batchingest-manager/code/main.py | main.py | py | 1,353 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "watchdog.events.LoggingEventHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "customer_apps.yaml_ingest",
"line_number": 15,
"usage_type": "name"
},
{
"ap... |
95443349 |
"""
CONSENSUS ALGORITHM FOR SOLVING LINEAR ALGEBRAIC EQUATION Ax=b
"""
import numpy as np
import matplotlib.pyplot as plt
"""
creating random matrix A and random vector b
for the system Ax=b
"""
A=np.random.rand(1000,1000)
b=np.random.rand(1000,1)
#dividing A into 250x4 submatrices
A_split=np.split(A,4)
#similar... | null | Consensus_Algorithm.py | Consensus_Algorithm.py | py | 5,655 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.rand",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
175212648 | from collections import deque
n,k = map(int,input().split())
d = [False]*500001
d[n] = True
q = deque()
q.append((n,0))
ans = -1
it = 0
while q:
now,cnt = q.popleft()
if cnt>=11:break
if now == k + (cnt * (cnt + 1)) // 2:
ans = cnt
break
if now+1<= 500000:
q.append((now+1,cnt+1)... | null | Silver4/두 수의 합.py | 두 수의 합.py | py | 436 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
559909435 | import sqlite3
import codecs # for using '한글'
import os
# 타이틀 정보 읽어오기
f = codecs.open("com_info_title.txt", "r")
title_list = []
while True:
line = f.readline() # 한 줄씩 읽
if not line: break # break the loop when it's End Of File
title_list.append(line) # split the line and append it to... | null | testpro1/DB_handler_com.py | DB_handler_com.py | py | 2,233 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "codecs.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 3... |
425454200 | # Copyright(c) 2016 Nippon Telegraph and Telephone Corporation
#
# 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 | masakarimonitors/tests/unit/processmonitor/process_handler/test_handle_process.py | test_handle_process.py | py | 4,563 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "eventlet.monkey_patch",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "testtools.TestCase",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "masakarimonitors.processmonitor.process_handler.handle_process.HandleProcess",
"line_number": 6... |
108358343 | # Copyright (C) 2020,2021 Red Hat, Inc.
#
# SPDX-License-Identifier: MIT
#
r"""
Lint rule class to test if there are YAML files have no data.
This implementation assumes target files are under <playbook_dir>/ with '.yml'
extensions by default. Users can change this with the environment variable
_ANSIBLE_LINT_RULE_CUST... | null | rules/NoEmptyDataFilesRule.py | NoEmptyDataFilesRule.py | py | 2,927 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
... |
56913275 | from django.db import models
from django.dispatch import receiver
from django.db.models.signals import post_save
from pyuploadcare.dj.models import ImageField
# Create your models here.
class User(models.Model):
'''
Method to create users profile
'''
is_authenticated = True
username = models.Char... | null | clone/models.py | models.py | py | 2,089 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
290879513 | # -*- coding:utf-8 -*-
import time
import keras
import numpy as np
import pandas as pd
from keras import models
from keras import layers
from keras.regularizers import l2
from keras.optimizers import SGD, RMSprop
from keras.callbacks import EarlyStopping, ReduceLROnPlateau
from keras.layers import Dense, Dropout, Batc... | null | keras/a_fail_keras_dnn_trial.py | a_fail_keras_dnn_trial.py | py | 5,414 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pandas.r... |
63058102 | from django.shortcuts import render
from .models import Post, Profile, Hvac, Door, Equipment, Metal
from django.views.generic import ListView, DetailView
from django.core.paginator import Paginator
def home(request):
profile = Profile
template = 'home.html'
return render(request, template, { 'profile': Pro... | null | intellect/views.py | views.py | py | 1,813 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Profile",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Profile",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.views.gener... |
274429309 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import logging
import telegram
from time import sleep
import sys
import datetime
try:
from urllib.error import URLError
except ImportError:
from urllib2 import URLError # python 2
with open("token.key") as f:
TOKEN = f.readline().strip()
logger = logging... | null | walle.py | walle.py | py | 2,444 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.stdout... |
587647208 | # Copyright 2019 IBM Corporation All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable=redefined-outer-name, unused-argument, invalid-name
import os
import pytest
import responses
from qpylib import qpylib
@pytest.fixture(scope='module', autouse=True)
def pre_testing_setup():
os.environ... | null | test/test_rest_sdk.py | test_rest_sdk.py | py | 3,130 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
138979959 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from .forms import NewPresentationForm, MySimpleForm
from .models import Presentation
from django.template.response import TemplateResponse
from django.views import generic
from django.contrib.auth.decorato... | null | u2/views.py | views.py | py | 4,056 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Presentation",
"line_number": 21,
"usage_type": "argument"
},
{
... |
58454746 | import numpy as np
import cv2
from PIL import Image
import os
import re
def read_rgb(image_path,rows,cols):
with open(image_path,'rb') as f:
data = f.read()
data = [int(x) for x in data]
# 图像尺寸是需要预先知道的
data = np.array(data).reshape((rows,cols, 3)).astype(np.uint8)
b,g,r=cv2.split(data)
... | null | job/yuv422和rgb图片格式转换/yuv422 rgb格式读取.py | yuv422 rgb格式读取.py | py | 4,268 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.merge",
"line_number":... |
283194417 | import numpy as np
values = []
"""
np.random.seed(1)
for _ in range(10000000):
values.append(np.random.randint(0,4))
print('{:.13f}'.format(np.var(values)))
"""
classes=[]
np.random.seed(1)
for _ in range(10000000):
values.append(np.random.uniform())
classes.append(int(values[-1] * 10)/10)
print('{:.13... | null | utils/test/random_test.py | random_test.py | py | 445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uniform",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
466444859 | import os
import re
import setuptools
# thanks colorama
def read_file(path):
with open(os.path.join(os.path.dirname(__file__), path)) as f:
return f.read()
# thanks colorama
def _get_version_match(content):
# Search for lines of the form: # __version__ = 'ver'
regex = r"^__version__ = ['\"]([^'... | null | setup.py | setup.py | py | 1,570 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number":... |
273235285 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Aluno',
fields=[
('id', models.AutoField(primar... | null | frequencia/migrations/0001_initial.py | 0001_initial.py | py | 1,410 | 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"
},
... |
528555322 | import numpy as np
import sonnet as snt
import tensorflow as tf
import math
from tqdm import tqdm
def reparameterize(mu, log_sigma):
"""Draw sample from Gaussian with given shape, subject to random noise epsilon"""
with tf.name_scope("sample_z"):
# reparameterization trick
epsilon = tf.random_... | null | utils.py | utils.py | py | 2,577 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.name_scope",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.random_normal",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.shape",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tenso... |
30122326 | # -*- coding: utf-8 -*-
import json
from db import get_queries, get_measurements, data_to_points
def read_data(c, pattern=None):
"""Get data from the database, return an `influxdb.ResultSet`
:param c: an influxdb client instance
:type c: InfluxDBClient
:param measurements: a list of measurements to ... | null | influxdump/data.py | data.py | py | 1,151 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "db.get_measurements",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "db.get_queries",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "db.data_to_points",
... |
51574386 | from bs4 import BeautifulSoup
import requests
def get_match_possessions(link):
r = requests.get("https://fbref.com"+link)
all_teams = ["Arsenal","Aston Villa","Brighton & Hove Albion","Burnley","Chelsea","Crystal Palace","Everton","Fulham","Leeds United","Leicester City","Liverpool","Manchester City","Manchester... | null | backend/web_scrap/match_detail.py | match_detail.py | py | 831 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
423073710 | # -*- coding: utf-8 -*-
import json
from odoo import http
class PersonInfo(http.Controller):
@http.route('/ajax/search_teacher', auth='public', type='json', methods=['POST'], csrf=False, cors='*')
def AjaxSearchTeacher(self, query=''):
objects = http.request.env['scheduler.teachers'].sudo().search([
... | null | addons/scheduler/controllers/controllers.py | controllers.py | py | 529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "odoo.http.Controller",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "odoo.http",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "odoo.http.request",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "odoo.http",
... |
442162651 | from django.shortcuts import render
from donations.models import Donation
from rooms_page.models import Room
from member.models import Member
from staff.models import Staff
from rentables.models import Rentable
def do_reports(request):
total_donations = 0
num_donations = 0
for d in Donation.objects.all():
... | null | reports/views.py | views.py | py | 1,836 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "donations.models.Donation.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "donations.models.Donation.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "donations.models.Donation",
"line_number": 11,
"usage_type":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.