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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34547350066 | #library imports
import re
import json
#my script imports
import website_parser
import textual_feature_extracter
import information_retrieval_feature_extractor
import textual_feature_transformer
import link_feature_transformer
def main(url):
#Check if the inputted Url is valid using Regex
i... | colm-brandon-ul/IVS_Code | scripts/pipeline.py | pipeline.py | py | 2,103 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "website_parser.WebsiteParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "textual_feature_extracter.TextualFeatureExtractor",
"line_number": 39,
"usage_type": "call"
},
... |
73654168993 | from audioop import mul
import math
import os
import json
import re
from tokenize import Double
from urllib import response
from qgis.PyQt import QtWidgets, uic
from qgis.PyQt.QtCore import pyqtSignal, Qt
from qgis.utils import iface
from qgis.core import QgsRectangle
from qgis.core import (
QgsProject,
)
from q... | danylaksono/GeoKKP-GIS | modules/download_persil_sekitarnya.py | download_persil_sekitarnya.py | py | 10,423 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "qgis.PyQt.uic.loadUiType",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
72856098274 | from boto.ec2.ec2object import TaggedEC2Object
from boto.resultset import ResultSet
from boto.ec2.group import Group
class Attachment(object):
"""
:ivar id: The ID of the attachment.
:ivar instance_id: The ID of the instance.
:ivar device_index: The index of this device.
:ivar status: The status o... | heathkh/iwct | snap/boto/ec2/networkinterface.py | networkinterface.py | py | 8,639 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "boto.ec2.ec2object.TaggedEC2Object",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "boto.ec2.ec2object.TaggedEC2Object.__init__",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "boto.ec2.ec2object.TaggedEC2Object",
"line_number": 74,
"u... |
24919761960 | import requests
import json
import re
from xml.dom.minidom import parse
import xmltodict
from fontTools.ttLib import TTFont
from bs4 import BeautifulSoup
heard={
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36',
}
def mapping... | smilemilk1992/myPspider | autoHome/main.py | main.py | py | 4,894 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "xml.dom.minidom.parse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "xmltodict.parse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"li... |
73551679072 | from io import BytesIO
from io import TextIOWrapper
from pathlib import Path
from trimesh import load
from trimesh.exchange.gltf import export_glb
from trimesh.resolvers import FilePathResolver
from viktor import File
from viktor import UserException
from viktor.core import Storage
from viktor.core import ViktorContro... | y-macken/sample-grasshopper | app/grasshopper/controller.py | controller.py | py | 4,515 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "viktor.core.ViktorController",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "parametrization.GrasshopperParametrization",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
... |
73199008034 | #!/usr/bin/env python
# importing the required library
from confluent_kafka import Producer
from confluent_kafka.serialization import StringSerializer
import confluent_kafka
import requests
import os, sys, time
import argparse
import json
import socket
import datetime
import random
def gen_custom_data(namespace, us... | yanshanlangren/python-test | src/cloudsat/kafka_sender.py | kafka_sender.py | py | 2,841 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number... |
35745723621 | import re
import abc
import inspect
from pysnooper.third_party.six.moves import zip_longest
from python_toolbox import caching
import pysnooper.pycompat
def get_function_arguments(function, exclude=()):
try:
getfullargspec = inspect.getfullargspec
except AttributeError:
result = inspect.geta... | SpyderKong/PySnooper | tests/utils.py | utils.py | py | 7,369 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "inspect.getfullargspec",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "inspect.getargspec",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pysnooper.third_party.six.moves.pycompat",
"line_number": 23,
"usage_type": "attribute"
... |
69860095714 | #!/usr/bin/python3
import json
import os
class FileStorage:
__file_path = '../../file.json'
__objects = {}
def all(self):
return FileStorage.__objects
def new(self, obj):
key = "{}.{}".format(type(obj).__name__, obj.id)
FileStorage.__objects[key] = obj
'''
... | Tboy54321/trials | hbnb/models/engine/file_storage.py | file_storage.py | py | 1,754 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": ... |
18272016245 | # -*- coding: utf-8 -*-
import os
import time
import logging
import numpy as np
import jieba
from gensim.models import KeyedVectors
import sys
file_root = os.path.dirname(__file__)
sys.path.append(file_root)
from get_file import get_file
pwd_path = os.path.abspath(os.path.dirname(__file__))
USER_DATA_DIR = pwd_path
... | Hanscal/unlp | unlp/unsupervised/Word2Vec/word2vec.py | word2vec.py | py | 6,268 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
14740379632 | # -*- coding: utf-8 -*-
# @Time : 2022/3/5 12:14
# @Author: Shelly Tang
# @File: data.py
# @Function: data.py, deal with the dataset
import glob
import pandas as pd
import random
import csv
import os
import numpy as np
from sklearn.metrics import confusion_matrix
KeyContentLen = 512
SplitDataN = 2
PAR... | SleepingMonster/Chinese-text-classification-pytorch-bert | data.py | data.py | py | 22,136 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_numb... |
4258636095 | from __future__ import division
import os
import numpy as np
from scipy import stats
from osgeo import gdal,ogr
import configparser
import inspect
import sys
import pandas as pd
from GeoFlood_Filename_Finder import cfg_finder
from time import perf_counter
from scipy.stats import gmean,theilslopes
def r... | passaH2O/GeoFlood | GeoFlood/River_Attribute_Estimation.py | River_Attribute_Estimation.py | py | 9,320 | python | en | code | 29 | github-code | 1 | [
{
"api_name": "osgeo.ogr.GetDriverByName",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "osgeo.ogr",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "osgeo.gdal.Open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "osgeo.gdal",
... |
30468013567 | #!/usr/bin/env python
# coding: utf-8
# %%
# %%
import os
import pickle
import sys
import pandas as pd
from RASLPhysio import Features
from datetime import datetime, timedelta, date
# %%
# %%
def nearest(items, pivot):
return min(items, key=lambda x: abs(x - pivot))
# %%
subjects = [ "S" + str(i) for i... | nibraaska/CHIL2022 | ExtractFeatures.py | ExtractFeatures.py | py | 1,972 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_num... |
82002215 | import time
from urlparse import urlparse
import boto
from scrapy.exceptions import NotConfigured
from twisted.internet.threads import deferToThread
class S3Pipeline(object):
@classmethod
def from_crawler(cls, crawler):
return cls(crawler.settings)
def __init__(self, settings):
self.tim... | TeamHG-Memex/scrash-pageuploader | pageuploader/__init__.py | __init__.py | py | 1,341 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "time.strftime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "twisted.internet.threads.deferToThread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urlparse.urlparse",
"line_number": 31,
"usage_type": "call"
},
{
"api_name":... |
18653183685 | from django.db.models import Sum
import math
from rest_framework import serializers
from rest_framework.reverse import reverse as api_reverse
from tickets.models import Ticket, Visit
from customerorders.api.serializers import CustomerOrderSerializer
from customerprojects.api.serializers import CustomerProjectSerializ... | KUSH23/bkend | tickets/api/serializers.py | serializers.py | py | 2,495 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tickets.models.Ticket",
"line_number": 16,
"usage_type": "name... |
7730906922 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def plot_tree(tree):
ax = plt.gca()
ax.set_axis_off()
build_tree(tree, 0.25, 0.25)
ax.set_xlim(-1, 2)
ax.set_ylim(-2, 1)
plt.show()
def build_tree(tree, left, bottom, depth=0, ax=plt.gca()):
hei... | nas-w/Techniques-Avancees-IA-ift7025-tp4 | utils/graphics.py | graphics.py | py | 4,032 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotl... |
32674362326 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('fantaapp', '0015_auto_20150807_1532'),
]
operations = [
migrations.RemoveField(
model_name='incontrocalendario',... | abenassen/holyfootball | fanta/fantaapp/migrations/0016_auto_20150807_1908.py | 0016_auto_20150807_1908.py | py | 1,365 | python | en | code | 0 | github-code | 1 | [
{
"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.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
138298365 | from django.db import models
from datetime import datetime
class ShowManager(models.Manager):
def basic_validator(self, postData):
errors = {}
if len(postData['title']) < 3:
errors['title'] = 'Title should be at least 2 characters.'
if Show.objects.filter(title=postData['title']... | yuzuha48/Bootcamp-Public | back-end/django/tv_shows/tv_shows_app/models.py | models.py | py | 1,253 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Manager",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
45291578592 | # -*- coding: utf-8 -*-
import enum
from django.utils.translation import ugettext_lazy as _
class NotifyLevel(enum.IntEnum):
involved = 1
all = 2
none = 3
NOTIFY_LEVEL_CHOICES = (
(NotifyLevel.involved, _("Involved")),
(NotifyLevel.all, _("All")),
(NotifyLevel.none, _("None")),
)
class We... | phamhongnhung2501/Taiga.Tina | fwork-backend/tina/projects/notifications/choices.py | choices.py | py | 880 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.IntEnum",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 15,
"usage_type": "call"
... |
36363288443 | import os
import sys
import argparse
import datetime
import pandas as pd
import dxchange.reader as dxreader
from pathlib import Path
from tomolog import log
def show_tomolog(args):
fname = args.h5_name
if os.path.isfile(fname):
all_tomolog = dxreader.read_dx_meta(fname)
log.info('All tomo... | decarlof/tomolog | tomolog/tomolog.py | tomolog.py | py | 6,637 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.isfile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dxchange.reader.read_dx_meta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dxchange.rea... |
2769505723 | #!/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
### /usr/bin/python
### /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
### #!/usr/bin/python -mtimeit
"""
This Python script is written by Zhiyang Ong to incrementally
test features for performing data analytics operations with
my Bib... | eda-ricercatore/bibtex-analytics | incremental_test.py | incremental_test.py | py | 9,365 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "warnings.warn",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "utilities.queue_ip_arguments.queue_ip_args.BibTeX_entry_types",
"line_number": 156,
"usage_type": "attribute"
... |
70577593634 | import os
import time
import base64
from PIL import Image
from io import BytesIO
import torch
from torch.autograd import Variable
from torchvision.utils import save_image
from models import TransformerNet
from utils import *
from flask import *
from flask_cors import CORS
app = Flask(__name__, )
# r'/*' 是通配符,让本服务器所... | bugstop/fast-neural-style-transfer | docs/source/server/server.py | server.py | py | 2,655 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "flask_cors.CORS",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"lin... |
27825438086 | from collections import OrderedDict
from rest_framework import serializers
from products.serializers import ProductSerializer
from .models import Sales
class SalesSerializer(serializers.ModelSerializer):
active = serializers.BooleanField(default=True)
product = ProductSerializer()
class Meta:
model... | SarvarbekUzDev/amway-workers | sales/serializers.py | serializers.py | py | 563 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.BooleanField",
"line_number": 9,
"usa... |
14751067098 | """
The core idea of the data interface is to separate the PRM model from the relational data soucre. The module :mod:`.datainterface` contains a collection of methods to access the relational data that are used by different algorithms (e.g. CPD learners, inference methods, EM algorithm). Another advantage of this appr... | declerambaul/ProbReM | src/data/datainterface.py | datainterface.py | py | 4,902 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "data.sqliteinterface.SQLiteDI",
"line_number": 100,
"usage_type": "call"
}
] |
20076303982 | # -*- coding: utf-8 -*-
import re
import scrapy
from ..custom_setting import inspect_settings
from ..items import InspectItem
class InspectSpider(scrapy.Spider):
custom_settings = inspect_settings
name = 'inspect'
allowed_domains = ['jib.xywy.com']
start_urls = []
base_url = 'http://jib.xywy.c... | wxy000/MHKG | Data_Manipulation/Crawler/illness/illness/spiders/inspect.py | inspect.py | py | 2,284 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "custom_setting.inspect_settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scrapy.Requ... |
39997325034 | import tensorflow as tf
import json
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif
from tensorflow.python.keras import models
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.lay... | cbernecker/THINK2019 | trainmodels/MLP/createMLP.py | createMLP.py | py | 8,169 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_selection.SelectKBest",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_selection.f_classif",
"line_number": 61... |
23648933427 | from keras.models import load_model
from tkinter import *
import tkinter as tk
import win32gui
from PIL import ImageOps, ImageGrab
import numpy as np
model = load_model('mnist.h5')
def predict_digit(img):
#resize image to 28x28 pixels
img = img.resize((28,28))
#convert rgb to grayscale
im... | phambrya/digitRecognition | gui_digit_recognizer.py | gui_digit_recognizer.py | py | 2,653 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.models.load_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.ImageOps.invert",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.ImageOps",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.array",... |
15121945465 | import json
import math
from itertools import groupby
import pygal
# 将数据加载到一个列表中
filename = 'btc_close_2017_requests.json'
with open(filename) as f:
btc_data = json.load(f)
# 创建5个列表,分别存储日期和收盘价
dates = []
months = []
weeks = []
weekdays = []
close = []
# 每一天信息
for btc_dict in btc_data:
dates.... | wangming-0215/python-start | chapt_16/btc_close_2017.py | btc_close_2017.py | py | 2,978 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygal.Line",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygal.Line",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 39,
... |
72858496994 | import requests
import os
from twilio.rest import Client
from dotenv import load_dotenv
load_dotenv()
account_sid = os.getenv("ACCOUNT_SID")
auth_token = os.getenv("AUTH_TOKEN")
twilio_phone = os.getenv("TWILIO_PHONE")
my_phone = os.getenv("MY_PHONE")
# "lat": -36.848461,
# "lon": 174.763336,
parameters = {
"la... | Developer122436/MyScrips | My Projects on Data Science, Web and more/Section 34 - API Weather/RainUpdatedEveryDay.py | RainUpdatedEveryDay.py | py | 1,074 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10... |
13656565356 | import sys
import whois
def check_whois():
for line in open(sys.argv[1], "r", encoding="utf8"):
if line[0]== '#':
pass
else:
try:
w = whois.whois(line[:-1])
print("""
=============== Domain: {} ==============
Na... | HorusTeknoloji/TR-PhishingList | Araclar/whois_check.py | whois_check.py | py | 723 | python | en | code | 69 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "whois.whois",
"line_number": 10,
"usage_type": "call"
}
] |
7757279605 | import matplotlib.pyplot as plt
from randomwalk import RandomWalk
while True:
rw=RandomWalk(90000)
rw.fill_walk()
#绘制所有的点
plt.scatter(rw.x_values,rw.y_values,c=rw.y_values,cmap=plt.cm.Blues,s=15,edgecolor='none')
#绘制起点
plt.scatter(0,0,c='green',edgecolor='none',s=100)
#绘制终点
plt.scatter(... | zXin1112/Python-Practice | DataVisualization/DataVisualization/RandomWalkData/rw_visual.py | rw_visual.py | py | 633 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "randomwalk.RandomWalk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "matplo... |
14923646817 | #!/usr/bin/env python
# Convert TelcoData file to easier to parse CSV
import csv
import sqlite3
import os
input_file = 'sms-email-ocn.csv'
output_file = 'database.sqlite'
os.remove(output_file)
# open datafile and create database
c = csv.reader(open(input_file, 'r'), delimiter=',', quotechar='"')
db = sqlite3.conne... | Evidlo/nanpa_lookup | build_database.py | build_database.py | py | 697 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.remove",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
}
] |
2542432153 |
import colors as c
from utils import ask
intro = c.pink + '''
Welcome to the pink fluffy
unicorns quiz game!!!!!!
''' + c.reset
def q1():
fur = ask(c.orange + 'What is the color of a pink fluffy unicorns fur?' + c.reset)
if fur == 'pink':
return True
return False
def q2():
dance = ask(c... | gorroth1/python-1 | fluffy.py | fluffy.py | py | 669 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "colors.pink",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "colors.reset",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "utils.ask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "colors.orange",
"line_... |
16371574110 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
import os
import versioneer
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, "README.md"), "r", encoding="utf8") as fh:
README = fh.read()
with open(os.path.join(HERE, ... | opsdroid/opsdroid-homeassistant | setup.py | setup.py | py | 1,467 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"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": "os.path.join",
"line... |
32685999266 | #Importing Libraries
from __future__ import print_function
import pyaudio
import wave
import numpy as np
import csv
import os
import shutil
from time import sleep
import datetime
import librosa
from PyQt5.QtCore import *
class Thread(QObject):
finished = pyqtSignal()
def __init__(self):
QThread.__init... | Utkarsh07/Rhapsody | AA/Rhapsody_module1_input.py | Rhapsody_module1_input.py | py | 6,085 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
41086325709 | """Utilities to manipulate GW data and rational filters.
"""
__all__ = ['Data', 'Filter']
import astropy.constants as c
import qnm
import pandas as pd
import numpy as np
import scipy.signal as ss
T_MSUN = c.M_sun.value * c.G.value / c.c.value**3
class Filter:
"""Container for rational filters.
Attributes
... | GeraintPratten/qnm_filter | qnm_filter/gw_data.py | gw_data.py | py | 6,452 | python | en | code | null | github-code | 1 | [
{
"api_name": "astropy.constants.M_sun",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "astropy.constants",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "astropy.constants.G",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name"... |
39309163763 | import os
import json
def processDict(k,D):
'''Doc string: process top level TTP Dictionary member'''
Dkeys = list(D.keys())
print (k, Dkeys)
def processList(k,L):
'''Doc string: process top level TTP List member'''
print (k, 'len=', len(L), "names:\n ")
for j in L[:]:
if isinstance... | opendaylight/ttp | parser/TTPvalid.py | TTPvalid.py | py | 11,779 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 204,
"usage_type": "call"
}
] |
18746480958 | from domain.flightEntity import Flight, FlightException
import datetime
class FlightService:
def __init__(self, flightFileRepo):
self._flightRepo = flightFileRepo
@property
def getAll(self):
return self._flightRepo.getAll
def add(self, identifier, departure_city, departure_... | pauladam2001/Sem1_FundamentalsOfProgramming | RaisesExam/service/flightService.py | flightService.py | py | 6,335 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "domain.flightEntity.Flight",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "domain.flightEntity.FlightException",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "domain.flightEntity.FlightException",
"line_number": 49,
"usage_type": "ca... |
36953321116 | from flask import Flask,Blueprint,render_template,request,Response
from dal.dbconnhelper import get_db_connection
from dal.dml import insert_data,authenticate,get_data
import json
doctor_object = Blueprint("doctor_object",__name__,url_prefix="/doctor_module")
@doctor_object.route('/login')
def doctor_login():
r... | 867477075/Hospital | doctor_module/Doctor_Module.py | Doctor_Module.py | py | 1,663 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.requ... |
13011382304 | import datetime
import time
import asyncio
import pandas as pd
from ib_insync import *
from sqlalchemy import create_engine, update, TIMESTAMP
from sqlalchemy.orm import sessionmaker
from sqlalchemy.schema import MetaData
import random
import os
IB_PORT = os.environ.get('IB_PORT')
if not IB_PORT:
IB_PORT = '4002'... | yakneens/hacking-sandbox | get_first_trade_date.py | get_first_trade_date.py | py | 7,503 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.or... |
9289498129 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import os
from pymongo import MongoClient
path = os.path.dirname(os.path.abspath(__file__))
config = configparser.ConfigParser()
config.read(path + '''/../config/configuration.cfg''')
def connect_to_mongodb():
client = MongoClient(
'mon... | dantunescost/antunedo | python-crons/lib/mongoConnector.py | mongoConnector.py | py | 2,930 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",... |
32673762456 | #!/usr/bin/python3
from splinter import Browser
from selenium.common.exceptions import StaleElementReferenceException
from splinter.exceptions import ElementDoesNotExist
import requests
import json
def leggivotilive(browser, url):
# Visit URL
browser.visit(url)
elems = browser.find_by_css(".btn.... | abenassen/holyfootball | downloadvotilive.py | downloadvotilive.py | py | 3,128 | python | it | code | 0 | github-code | 1 | [
{
"api_name": "selenium.common.exceptions.StaleElementReferenceException",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 85,
"usage_type": "call"
},
{
... |
896520587 | import os
import requests
import json
from typing import Union, List, Any, Optional
from concurrent.futures import ThreadPoolExecutor
class Base(object):
HEADERS = {"User-Agent": "user@domain.com"}
DATA_DIRECTORY_NAME = 'Data'
CIKS_FILE_NAME = 'entities.json'
CWD = os.path.dirname(__file__)
DA... | Arman-Mojaver/SEC-filing-CLI | classes.py | classes.py | py | 5,648 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
43208324315 | import dash
import plotly.express as px
import pandas as pd
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Output, Input
#Eksplorasi data dengan python
#________________________________________________
df = pd.read_csv("vgsales.csv")
#print(df[:5])
#... | takdirzd/Dash-Python | dashcoba.py | dashcoba.py | py | 2,002 | python | ms | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "dash_html_componen... |
25787644908 | import random
import time
from abc import ABC
from collections import Sequence
from pathlib import Path
from typing import Optional, Union, List
from lang_tool.languages.functional import FunctionalLanguage
from lang_tool.common.exceptions import NotEnoughTokensError
from lang_tool.languages.object_oriented import Obj... | Sarvar17/computer-system-architecture | task-3/lang_tool/container.py | container.py | py | 4,292 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "collections.Sequence",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_... |
22932217800 | # Authors:
## Alexandre Santos 80106
## Leonardo Costa 80162
import csv
import re
import Stemmer
from collections import defaultdict
# Class used to read and store document data such as title and abstract
# Files with no title or abstract are ignored
# All data is stored in a list with a format like
# [(doi , "titl... | tuxPT/RI_Assignment1 | ass1_classes.py | ass1_classes.py | py | 3,952 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "Stemmer.Stemmer",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number":... |
5130260481 | # !/usr/bin/env python.
# -*- coding: utf-8 -*-
"""
Look at pairs of stations (NetAtmo-DWD)
Select nearest stations, for one DWD station, aggregate to daily
and disaggregate according to relative values of NetAtmo station
Check if this gives reasonable Temporal structure or not
Save the daily DWD and... | AbbasElHachem/extremes | _17_construct_and_compare_daily_netatmo_dwd_dfs.py | _17_construct_and_compare_daily_netatmo_dwd_dfs.py | py | 18,021 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.ioff",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
25883535336 | import pdb
import pyasn1.codec.der.encoder
import pyasn1.type.univ
import base64
def pempriv(n, e, d, p, q):
dP = d % p
dQ = d % q
qInv = pow(q, p - 2, p)
template = '-----BEGIN RSA PRIVATE KEY-----\n{}-----END RSA PRIVATE KEY-----\n'
seq = pyasn1.type.univ.Sequence()
for x in [0, n, e, d, p... | team41434142/cctf-16 | mining-p-q/mining_p_q.py | mining_p_q.py | py | 2,018 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyasn1.codec.der.encoder.type.univ.Sequence",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyasn1.codec.der.encoder.type",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pyasn1.codec.der.encoder",
"line_number": 13,
"usage_type"... |
28988193277 | import tempfile
import pandas as pd
from libcbm.model.cbm_exn import cbm_exn_model
from libcbm.model.cbm_exn.parameters import parameter_extraction
from libcbm.model.model_definition.model_variables import ModelVariables
from libcbm import resources
def test_cbm_exn_integration():
with tempfile.TemporaryDirectory... | cat-cfs/libcbm_py | test/model/cbm_exn/integration_test.py | integration_test.py | py | 1,767 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "libcbm.model.cbm_exn.parameters.parameter_extraction.extract",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "libcbm.model.cbm_exn.parameters.parameter_extraction",
... |
23206016857 | import dgl
import matplotlib.pyplot as plt
import networkx as nx
import torch
from dgl.nn.pytorch.factory import KNNGraph
kg = KNNGraph(1)
x = torch.tensor([[0,1],
[1,2]])
g = kg(x)
print(g.edges())
options = {
'node_color': 'black',
'node_size': 20,
'width': 1,
}
G = dgl.to_networkx(g)
# plt.figure(figsiz... | taotianli/gin_model.py | examples/pytorch/vgae/visulization.py | visulization.py | py | 362 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "dgl.nn.pytorch.factory.KNNGraph",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dgl.to_networkx",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "networkx.d... |
33769466704 | import pytest
from pathlib import Path
from carg_io.abstracts import Parameter, ParameterSet, units, NaN
from carg_io.implementations import MyContainer, Box, BoxResults
from carg_io.postprocessing import Analyze
from random import randint
import numpy as np
import itertools
__author__ = "eelco van Vliet"
__copyright_... | eelcovanvliet/carg-io | tests/test_postprocessing.py | test_postprocessing.py | py | 2,195 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "carg_io.abstracts.ParameterSet",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "carg_io.abstracts.Parameter",
"line_number": 23,
"usage_type": "name"
},
{
"api_name"... |
30714640656 | import yt
import trident
import h5py as h5
import sys
import yt_functions as ytf
import ion_plot_definitions as ipd
import romulus_analysis_helper as rom_help
output = int(sys.argv[1])
#output =
ion_list = ['H I']
ds = ytf.load_romulusC(output, ions = ion_list)
cen = rom_help.get_romulus_yt_center('romulusC', ou... | ibutsky/romulusC_analysis | plot_cooling_phase.py | plot_cooling_phase.py | py | 2,093 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "yt_functions.load_romulusC",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "romulus_analysis_helper.get_romulus_yt_center",
"line_number": 17,
"usage_type": "call"
},
{... |
37676974073 | from . import S3Private, MinioPrivate
from ..helper import config
from ..logging import logger
env = config('APP_ENV')
class PrivateBackend:
backend = None
instance = None
def __init__(self):
if(env == 'local'):
self.backend = MinioPrivate
else:
self.backend = S3P... | goldnetonline/django-rest-api-test | support/storages/private_backend.py | private_backend.py | py | 703 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "helper.config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.logger.exception",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.logger",
"line_number": 28,
"usage_type": "name"
}
] |
30715888816 | import random
from http import HTTPStatus
from typing import Union, List
from flask_restful import abort
from sqlalchemy import and_
from backend.flaskr.model import Question, M_ID, M_QUESTION, M_ANSWER, M_CATEGORY, M_DIFFICULTY, M_TYPE
from backend.flaskr.util import MIN_DIFFICULTY, MAX_DIFFICULTY
from .base_servi... | ibuttimer/full-stack-trivia | backend/flaskr/service/question_service.py | question_service.py | py | 7,129 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base_service.get_by_id",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "backend.flaskr.model.Question",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "backend.flaskr.model.Question",
"line_number": 17,
"usage_type": "name"
},
{... |
25329129022 | import cv2
import os
import face_recognition
import pyaudio
import speech_recognition as sr
from playsound import playsound
import time
import pyttsx3
# --------------------------------Declaring Variables ------------------------
engine = pyttsx3.init()
engine.setProperty('rate',145)
knownfaces_names =... | Joanna314/Python-Exploratorium | AI_Security_Sysystem.py | AI_Security_Sysystem.py | py | 5,428 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyttsx3.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_... |
12158934756 | from typing import List
from unittest import TestCase
from src.chinese_checkers.game.Move import Move
from src.chinese_checkers.geometry.Hexagram import Hexagram
from src.chinese_checkers.game.GameRuleEngine import GameRuleEngine
from src.chinese_checkers.game.Position import Position
from src.chinese_checkers.game.Pl... | dakotacolorado/ChineseCheckersGameEngine | tests/chinese_checkers/game/test_GameRuleEngine.py | test_GameRuleEngine.py | py | 6,802 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "src.chinese_checkers.game.Position.Position",
"line_number": 15,
"usage_type": "name"
},
{
"api_nam... |
74539416352 | """repo2docker: convert git repositories into jupyter-suitable docker images
Images produced by repo2docker can be used with Jupyter notebooks standalone
or with BinderHub.
Usage:
python -m repo2docker https://github.com/you/your-repo
"""
import getpass
import json
import logging
import os
import shutil
import s... | jupyterhub/repo2docker | repo2docker/app.py | app.py | py | 29,605 | python | en | code | 1,542 | github-code | 1 | [
{
"api_name": "traitlets.config.Application",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "traitlets.default",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "trai... |
24710652293 | from typing import List, Tuple
LEFT = 1
RIGHT = -1
def get_pointed_length(pointed_segments: List[Tuple[int, int]]) -> int:
"""
Функция которая вычисляет длину окрашенной части прямой.
:param pointed_segments: список с точками начала и конца окрашенных сегментов
:type pointed_segments: List[Tuple[int... | OkhotnikovFN/Yandex-Algorithms | trainings_2.0/division_b/hw_7/task_a/a.py | a.py | py | 1,424 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 7,
"usage_type": "name"
}
] |
72111347874 | import unittest
import pdb
import random
from fixtures import big_people_fixture, big_tables_fixture, test_table, test_grouping
from ..table_utils import Grouping, Table, make_table_and_grouping_objects, get_table, get_grouping
class SeatingTestCase(unittest.TestCase):
#noinspection PyPep8Naming
def setUp(sel... | akaptur/seating | test/test_table_utils.py | test_table_utils.py | py | 4,424 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "table_utils.make_table_and_grouping_objects",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fixtures.big_tables_fixture.tables",
"line_number": 23,
"usage_type": "... |
6792882327 | import geocoder
import threading
import datetime
def get_geolocations():
try:
g = geocoder.ip('me')
my_string=g.latlng
longitude=my_string[0]
latitude=my_string[1]
return longitude,latitude
except:
print('Could Not Get the Co-ordinates!')
def get_time():
... | abuzneid/IoT-Lab---Spring-2019 | miscellaneous/Raspberry-Pi/Location Latitude and Longitude/test.py | test.py | py | 706 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "geocoder.ip",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "threading.Tim... |
6923815467 | import copy
import json
import sys
from os.path import join
from generators import ecs_helpers
from schema.cleaner import field_or_multi_field_datatype_defaults
from schema.oss import TYPE_FALLBACKS
# Composable Template
def generate(ecs_nested, ecs_version, out_dir, mapping_settings_file):
"""This generates a... | NybbleHub/opensearch-ecs | scripts/generators/es_template.py | es_template.py | py | 9,907 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "generators.ecs_helpers.make_dirs",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "generators... |
7732908289 | import random
import datetime
from .utils.date import timedeltastr, total_seconds
class RandomDatetime(object):
def __init__(self, pre_days=30, post_days=30, hour_min=6, hour_max=21):
self.pre_days = pre_days
self.post_days = post_days
self.hour_min = hour_min
self.hour_max = hou... | tkf/orgviz | orgviz/randomnodes.py | randomnodes.py | py | 4,449 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dateti... |
4722007249 | """AdventOfCode 2020 Day23."""
from typing import List
import collections
test_input_1 = "389125467"
puzzle_input = "925176834"
def playing(cups: List[int], move: int):
"""Playing."""
max_cup = max(cups)
min_cup = min(cups)
q = collections.deque(cups, maxlen=len(cups))
for round in range(1, move... | jneo8/AdventOfCode | 2020/day23.py | day23.py | py | 2,292 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
28964755311 | from flask import Flask, flash, get_flashed_messages
app = Flask(__name__)
app.secret_key = 'jerry'
@app.route('/login')
def login():
flash('welcome to back!', category='login')
flash('admin', category='user')
return {'msg': 'ok'}
@app.route('/get')
def get():
msg = get_flashed_messages(with_categor... | jerry117/sample_test | python_flash.py | python_flash.py | py | 432 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.flash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.get_flashed_messages",
"l... |
34577550604 | __author__ = "Antonie Vietor"
__copyright__ = "Copyright 2020, Antonie Vietor"
__email__ = "antonie.v@gmx.de"
__license__ = "MIT"
from snakemake.shell import shell
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
extra = snakemake.params.get("extra", "")
# optional input files and directories
fasta = snakemak... | leonqli/snakemake-wrappers | bio/subread/featurecounts/wrapper.py | wrapper.py | py | 894 | python | en | code | null | github-code | 1 | [
{
"api_name": "snakemake.shell.log_fmt_shell",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "snakemake.shell",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "snakemake.shell.params.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
43063758249 | from collections.abc import AsyncGenerator
from typing import Optional
from nonebot import logger
from nonebot_plugin_access_control_api.context import context
from nonebot_plugin_access_control_api.event_bus import (
EventType,
T_Listener,
on_event,
fire_event,
)
from nonebot_plugin_access_control_api... | bot-ssttkkl/nonebot-plugin-access-control | src/nonebot_plugin_access_control/service/_impl/permission.py | permission.py | py | 5,726 | python | en | code | 30 | github-code | 1 | [
{
"api_name": "nonebot_plugin_access_control_api.service.interface.permission.IServicePermission",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "nonebot_plugin_access_control_api.context.context.require",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "repos... |
20513469419 | import sympy as sym
from sympy import symbols
from sympy.plotting import plot
f1 = "10-x" #x2 + x1 <= 10
f2 = "1+x" #x1 - x2 <= 1
f3 = "4" #x2 <= 4
Z1 = "16-x"
Z2 = "14-x"
Z3 = "13-x"
x = symbols('x')
plot(f1, f2, f3, Z1, Z2, Z3, (x, -1, 15))
# Sol: Z=9 x1=5 x2=4 Solución única
#La suma tiene que ser máximo 10, pero si... | AnaLopezP/InvestigacionOperativa | Ejercicio2/ejercicio2v1.py | ejercicio2v1.py | py | 374 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "sympy.symbols",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sympy.plotting.plot",
"line_number": 11,
"usage_type": "call"
}
] |
14599197842 | import pygame
from pygame.locals import *
from sys import exit
import enum
pygame.init()
class Board:
def __init__(self, color, point):
self.color = color
self.collision = False
self.point = point
class COLOR(enum.Enum):
GREEN = (0, 165, 0)
RED = (153, 0, 0)
YELLOW = (220, 2... | pepes7/breakout-lpc-2021 | main.py | main.py | py | 4,050 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.Sound",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line... |
10489838090 | import configparser
import logging
import time
import dt_util
import sys
from pymongo import MongoClient
class ProgramConfig(object):
def __init__(self, logfileName, environment=None, loglevel = logging.INFO, show_log = False):
#Logging
today = time.strftime("%Y-%m-%d")
log_filename = "Lo... | oelegeirnaert/DzjinTonik | config.py | config.py | py | 6,343 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.Formatter... |
10461259533 | from django.template.loader import render_to_string
from django.core.signing import Signer
from website.settings import ALLOWED_HOSTS, DEFAULT_FROM_EMAIL
from .tasks import task_send_mail
signer = Signer() # Используем для создания цифровой подписи
def send_activation_notification(user):
"""
Отправляе... | darkus007/FlatsWebsite | website/members/utilities.py | utilities.py | py | 1,487 | python | ru | code | 1 | github-code | 1 | [
{
"api_name": "django.core.signing.Signer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "website.settings.ALLOWED_HOSTS",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "website.settings.ALLOWED_HOSTS",
"line_number": 16,
"usage_type": "name"
},
... |
19327548033 | import os
from hashlib import md5
from time import time
from os import path as op
from PIL import Image
# Возвращает массив в 2СС из 10СС
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
def convert_base(num):
if num == 0:
return [0]
res = [int(x) for x in list('{0:b}'.format... | dimnik97/events_all | events_all/helper.py | helper.py | py | 3,449 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_nu... |
72512667555 | from discord.ext import tasks
from discord.ext.commands import Cog, command ,cooldown ,BucketType
from discord.ext import commands
from random import choice
import discord
import requests
from discord import Spotify
import pendulum
# aiohttp should be installed if discord.py is
import aiohttp
from discord import Webho... | LazyBuds/tommy-discord | lib/cogs/image.py | image.py | py | 33,691 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "db.db.field",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "db.... |
22291691142 | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.transaction_record import TransactionRecord
from ..types import UNSET, Unset
T = TypeVar("T", bound="TxnOrRegisterLedgerNymResponse")
@attr.s(auto_attribs=True)
class TxnOrRegisterLedgerNymResponse:
"""
Attributes:
s... | Indicio-tech/acapy-client | acapy_client/models/txn_or_register_ledger_nym_response.py | txn_or_register_ledger_nym_response.py | py | 2,214 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
44441363739 | from django.core.management.base import BaseCommand, CommandError
from comics.models import Comic, ComicFile, UploadedComicFile
from django.utils.dateparse import parse_date
from datetime import datetime
from django.conf import settings
from twython import Twython, TwythonError
class Command(BaseCommand):
help = "... | lizwalsh/lah | comics/management/commands/publish.py | publish.py | py | 1,062 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"... |
36905508880 | import os
import torch
import numpy as np
import torch.utils.data as tud
from PIL import Image
from torchvision import transforms
class ImageClusteringDataset(tud.Dataset):
def __init__(self, pos_dir, neg_dir):
super(ImageClusteringDataset, self).__init__()
self.positive_samples = [os.path.join(po... | RickyDoge/WFGN | dataset/imageClusteringDataset.py | imageClusteringDataset.py | py | 1,634 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
10551759287 | import os
import torch
from torch.utils.data import random_split, DataLoader
from torchvision import datasets
from torchvision.transforms import transforms
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter()
def get_loaders(data_dir, batch_size, split=0.9):
transform = transforms.Compose... | xandernewton/Future-Malware-Prediction-Through-Generative-Modelling | PyTorch-GAN/implementations/utils.py | utils.py | py | 3,526 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.transforms.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.transforms",
"line_number": 14,
"u... |
30714984976 | import yt
from yt import YTArray
from yt import YTQuantity
import sys
import os
import numpy as np
import matplotlib.pylab as plt
import palettable
import seaborn as sns
import plotting_tools as pt
def plot_density_fluctuation(output, sim, compare, tctf, beta, cr, diff = 0, stream = 0, heat = 0,
... | ibutsky/thermal_instabilities | analysis/plot_creta_tctf.py | plot_creta_tctf.py | py | 6,367 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "plotting_tools.generate_lists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.subplots",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 32,
"usage_type": "name"
},
{
"api_name... |
72178040354 | import os
import sys
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import Client, TestCase, TransactionTestCase, tag
from django.urls import reverse
from unicodex.models import *
client = Client()
emoji_data = {"name": "Unicorn", "codepoint": "1F984", "... | GoogleCloudPlatform/django-demo-app-unicodex | unicodex/tests.py | tests.py | py | 2,774 | python | en | code | 88 | github-code | 1 | [
{
"api_name": "django.test.Client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.te... |
37845755339 | from customtkinter import *
import customtkinter
from tkPDFViewer import tkPDFViewer as pdf
app = customtkinter.CTk()
app.geometry('1360x720')
app.title("PDF Viewer")
customtkinter.set_default_color_theme("dark-blue")
customtkinter.set_appearance_mode('dark')
def newwin(s):
variable1 = pdf.ShowPdf()
... | bishalregmi105B/pdfviewer2 | main.py | main.py | py | 1,039 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "customtkinter.CTk",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 9,
"usage_type": "call"
},
{... |
32655890013 | """User can have multiple SSH keys
Revision ID: 8eeae2cf5e84
Revises: 4fdf4258598e
Create Date: 2021-06-25 11:33:42.648848
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy import text
# revision identifiers, used by Alembic.
revision = '8eeae2cf5e84'
down_revision = '4fdf4258598e'
branch_labels = N... | SURFscz/SBS | server/migrations/versions/8eeae2cf5e84_user_can_have_multiple_ssh_keys.py | 8eeae2cf5e84_user_can_have_multiple_ssh_keys.py | py | 1,582 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
74496271713 | # ================================
# Image Object Detection with YOLO
# ================================
# RUN WITH EXAMPLE COMMAND BELOW:
# python YOLO_img.py -i img_IO/work_table.jpg -o img_IO/work_table_processed.jpg -y yolov3 -d 10" into command prompt
import numpy as np
import argparse
import time
import cv2
im... | Jacklu0831/Real-Time-Object-Detection | 1_YOLO/YOLO_img.py | YOLO_img.py | py | 4,904 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.readNetFromDarknet",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.pa... |
25427881611 | #!/usr/bin/env python
import os, sys
import pprint
from cgi import parse_qs, escape, FieldStorage
from stat import *
def application(env, start_response):
status_code = "500 ERROR"
output = ["Chart upload request received"]
# descerialize the post
post = FieldStorage(
fp=env['wsg... | hickey/helm_container | upload.py | upload.py | py | 1,562 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cgi.FieldStorage",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.stat",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 36,
"usage_type": "call"
}
] |
22379118825 | import pandas as pd
from urllib.request import urlopen
from bs4 import BeautifulSoup
import requests
def constroi_url(url, query, url_pagina, tema):
url = url
query = query
url_pagina = url_pagina
tema_buscado = tema
link = url+url_pagina+query+tema_buscado
return link
def beatiful_s... | Insper-Data/Data_BCG_News | Scraping/aux_funcs/funcoes_scrap.py | funcoes_scrap.py | py | 2,501 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 58,
"usage_type": "call"
}
] |
32821265912 | # python imports
from datetime import datetime, timedelta, timezone
from urllib import request
from urllib.error import HTTPError, URLError
from urllib.parse import urlparse, urlencode
import ssl
import json
import time
from collections import OrderedDict
import re
from enum import Enum
import sys
# 3rd-party imports
... | SCECcode/pycsep | csep/utils/comcat.py | comcat.py | py | 51,244 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "sys.stderr.write",
"line_number": 217,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 217,
"usage_type": "attribute"
},
{
"api_name": "csep.utils.time_utils.Hi... |
8362739333 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
#importing libraries
import requests
import pandas as pd
import numpy as np
import random
get_ipython().system('conda install -c conda-forge geopy --yes ')
from geopy.geocoders import Nominatim
from IPython.display import Image
from IPython.core.display import HTM... | Georgiakon/Assignments | Assignment4.py | Assignment4.py | py | 4,930 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pandas.io.json.json_normalize",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.io.jso... |
16957308335 |
from openerp import models, fields, api
from datetime import datetime
from openerp.exceptions import Warning
class HrEmployeeCapacity(models.Model):
_name = "hr.employee.capacity"
_description = "hr_employee_capacity"
_order = "starting_date DESC, employee_id DESC"
_rec_name = 'employee_id'
@ap... | TinPlusIT05/tms | project/tms_modules/model/hr/hr_employee_capacity.py | hr_employee_capacity.py | py | 4,879 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openerp.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "dat... |
1585660929 | from typing import Optional
from decimal import Decimal
from validator_collection import validators
from highcharts_core import constants, errors
from highcharts_core.decorators import class_sensitive, validate_types
from highcharts_core.metaclasses import HighchartsMeta
from highcharts_core.options.legend.accessibil... | highcharts-for-python/highcharts-core | highcharts_core/options/legend/__init__.py | __init__.py | py | 36,376 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "highcharts_core.metaclasses.HighchartsMeta",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 115,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 123,
"usage_type": "name"
},
{
"api_... |
38132471774 | #!/usr/bin/python3
"""This module manages all the products of provisionspall"""
from api.v1.views import app_views
from flask import jsonify, request, make_response
from models.model import User, Store, Store_Address
from api.v1 import db
from provisionspall_web import UPLOAD_FOLDER, allowed_file
import os
from werkze... | dominic-source/ProvisionsPall | api/v1/views/store.py | store.py | py | 5,720 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.method",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "api.v1.db.session.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.... |
40553740855 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
"""Utility functions to handle test chunking."... | spider055/browser | mozilla-release/taskcluster/taskgraph/util/chunking.py | chunking.py | py | 8,784 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "moztest.resolve.TestReso... |
34841399248 | #coding=utf-8
import itertools
import logging
import os.path as osp
import tempfile
import torch
import copy
import random
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from torch.utils.d... | mightyzau/Instant-Teaching | projects/InstantTeaching/datasets/ssl_coco.py | ssl_coco.py | py | 15,239 | python | en | code | 36 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pycocotools.coco.COCO",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "pycocotools.coco.COCO",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "... |
39430835150 | #Here we import all the necessary libraries, pandas, sklearn and numpy for data pre-processing, keras for neural networks
# and matplotlib in order to plot the obtained data
import pandas as pd
pd.set_option('display.float_format', lambda x: '%.4f' % x)
from keras.models import Sequential
from keras.layers import *
fr... | reinisirmejs/LVGMC | RNNAllInputs.py | RNNAllInputs.py | py | 7,988 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.set_option",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"lin... |
20517999286 | # import libraries
import sys; sys.path.append('/usr/local/python'); sys.path.append('/usr/local/python')
import numpy as np
import cv2
import os
import yaml
from openpose import pyopenpose as op
import time # for measuring elapsted time in YOLO computation
import argparse # check if image path is provided
#setup and... | westpoint-robotics/threat_detection | pose_detection/threat_pipeline_single_image.py | threat_pipeline_single_image.py | py | 12,802 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
39497259321 | from collections import deque
from sys import stdin
INF = 1000000000000000000000000
#경로 path의 유량을 찾는 함수
#경로 path에서 흐를 수 있는 유량은 각 경로를 구성하는 간선이 가지는 잔여 용량들 중 최솟값
def make_flow(s,t,path):
c = INF #잔여 용량의 최솟값
#끝점 t부터 시작해서 역으로 돌아가면서
#경로 path의 흐를 수 있는 최소 용량을 찾는다
#즉, 경로 path를 구성하는 간선들의 잔여 용량중 최솟값을 찾는다.
... | yundaehyuck/Python_Algorithm_Note | theory_source_code/network_flow/edmonds_karp.py | edmonds_karp.py | py | 3,384 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 87,
"usage_type": "name"
},
{
"api_name": "sys.stdin.readline",
... |
10054278675 | # -*- coding: utf-8 -*-
# import sqlite3
# conn = sqlite3.connect("./test.db", check_same_thread=False)
# print(dir(conn))
# cur = conn.cursor() # db ni boshqarish uchun kursor
# sql = """CREATE TABLE students( \
# id INTEGER,
# name TEXT,
# age INTEGER,
# country TEXT
# );"""
# sql = """INSERT I... | Rashidov21/python-basic-tutorial | work_with_sql.py | work_with_sql.py | py | 1,315 | python | en | code | 31 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
}
] |
14238769949 | import re
import os
import json
import boto3
def limpieza(ticket):
ticket = re.sub(r'[^A-Za-z0-9]+',' ',ticket)
tokens = ticket.split()
tokens = [token for token in tokens if token.isalpha()]
lista_nombres=[]
lista_apellidos=[]
for token in tokens:
if token in lista_nombres:... | sMendezMejia/proyecto_integrador | AWS/Lambdas/lambda_limpieza.py | lambda_limpieza.py | py | 1,039 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 25,
"usage_type": "call"
}
] |
33300825490 | #!/usr/bin/python2
import time
import BaseHTTPServer
import os
import random
import string
import requests
from urlparse import parse_qs, urlparse
HOST_NAME = '0.0.0.0'
PORT_NUMBER = 9999
# A variável MP3_DIR será construida tendo como base o diretório HOME do usuário + Music/Campainha
# (e.g: /home/usuario/Music/C... | EstevesDouglas/UNICAMP-FEEC-IA369Z | scr/servidor.py | servidor.py | py | 2,434 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_... |
21925614419 | # @Author: Manuel Rodriguez <valle>
# @Date: 27-Jun-2018
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 29-Jun-2018
# @License: Apache license vesion 2.0
import websocket
import json
from datetime import datetime
from django.db.models import Q, Count, Sum, F
from django.db.models.... | vallemrv/tpv-php-to-django | django-valletpv/ventas/views/controlimpresion.py | controlimpresion.py | py | 8,703 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "gestion.models.Pedidos.objects.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "gestion.models.Pedidos.objects",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "gestion.models.Pedidos",
"line_number": 24,
"usage_type": "name"
... |
5007510575 | import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
import functions
# scope = ["https://spreadsheets.google.com/feeds",'https://https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive"]
s... | mayankdaruka/Omelia | server/sheets.py | sheets.py | py | 1,345 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gspread.auth... |
23212182418 | #!/usr/bin/env python3
"""
Smart wrapper around pmstat
Usage:
smart-pmstat JOBID [ADDITIONAL ARGUMENTS]
Where JOBID is the SLURM id of a running job.
The script will first recover the corresponding nodes using `squeue`, and will
then start a continuous monitoring of the corresponding nodes with `pmstat`.
Additional... | bwvdnbro/documentation | ScalingTests/smart_pmstat.py | smart_pmstat.py | py | 1,566 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.REMAINDER",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "subpro... |
39510725458 | from collections import deque
# 방향 배열
direction = [(-1,-1), (-1,0), (-1,1), (0,-1), (0,1), (1,-1), (1,0), (1,1)]
def BFS(start):
global max_value
# 덱생성
q = deque([start])
while q:
check = q.popleft()
# 방향배열 순회
for k in range(8):
ny = check[0] + direction[k][0]
... | choikeunyoung/algorithm | 백준/Silver 2/17086.py | 17086.py | py | 1,722 | python | ko | code | 1 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
4490898762 | # Variational AutoEncoder
from tensorflow.keras.layers import Input, Dense, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras import backend as K
from tensorflow.keras import metrics
from tensorflow.keras.datasets import mnist
import numpy as np
# Hyperparameter 설정
batch_size = 100
original_dim =... | Taerimmm/ML | project/team/GAN/00_vae.py | 00_vae.py | py | 2,879 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "tensorflow.keras.backend.random_normal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.backend.shape",
"line_number": 21,
"usage_type": "call"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.