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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34119520293 | import textdistance
from sklearn.feature_extraction.text import TfidfVectorizer
import spacy
import numpy as np
import tensorflow_hub as hub
def check_similarity_levenshtein(failure_final_text, requirement_final_text):
# Calculate levenshtein similarity
similarity_by_levenshtein = textdistance.levenshtein.nor... | xunih/consistency-of-safety-artifacts | check_similarity.py | check_similarity.py | py | 3,528 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "textdistance.levenshtein.normalized_similarity",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "textdistance.levenshtein",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "textdistance.jaccard.normalized_similarity",
"line_number": 17,
... |
40662826995 | import json
import pprint
import random
import os
import sympy
my_name = "Leader"
def client(data_to_send: dict or bytes, port):
result = b""
package_blocks = fragmentation(data_to_send)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect(("localhost", port))
... | FoxOfDeserts/Cript_prot | lab20/main.py | main.py | py | 3,200 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.random",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "sympy.isprime",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
38985141179 | import datetime
import warnings
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader.data as web
from sklearn.preprocessing import MinMaxScaler
from keras.layers import LSTM
from keras.models import Sequential
from keras.layers import Dense
import keras.backend as K
from keras.callbacks import... | parksy0109/assessingstockvaluewithpython | src/main/multiplelinearregression/LinearRegression.py | LinearRegression.py | py | 4,134 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotli... |
27447833398 | import sqlite3
def test_db_conn(conn):
try:
conn.cursor()
conn.close()
return True
except (Exception, ):
return False
class Database:
connection = None
cursor = None
def __init__(self):
self.connection = sqlite3.connect('todolist.db')
self.cursor ... | tianqizhao-louis/changing-room-coding-challenge | src/todo/db.py | db.py | py | 2,178 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 26,
"usage_type": "call"
}
] |
33429616100 | from typing import Dict, Optional
from polyaxon.polyaxonfile import CompiledOperationSpecification
from polyaxon.polyflow import V1CompiledOperation, V1RunKind
from polyaxon.polypod.compiler.resolvers.base import BaseResolver
class CoreResolver(BaseResolver):
KINDS = {
V1RunKind.JOB,
V1RunKind.SE... | gregmbi/polyaxon | core/polyaxon/polypod/compiler/resolvers/core.py | core.py | py | 1,396 | python | en | code | null | github-code | 6 | [
{
"api_name": "polyaxon.polypod.compiler.resolvers.base.BaseResolver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "polyaxon.polyflow.V1RunKind.JOB",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "polyaxon.polyflow.V1RunKind",
"line_number": 10,
... |
16908044868 | import numpy as np
from .polyFeatures import polyFeatures
import matplotlib.pyplot as plt
def plotFit(min_x, max_x, mu, sigma, theta, p):
x = np.arange(min_x -15, max_x+25, .05).reshape(-1, 1)
# 特征缩放
X_ploy = polyFeatures(x, p)# 特征映射
X_ploy = (X_ploy -mu)/sigma
# 拼1矩阵
m = X_ploy.shape[0] # 取行
... | 2332256766/python_test | MachineL_The_5_week_practise/plotFit.py | plotFit.py | py | 534 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "polyFeatures.polyFeatures",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"l... |
39706903151 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 12:54:16 2020
@author: Owner
"""
# =============================================================================
# packages
# =============================================================================
import pandas as pd
import numpy as np
import math
im... | shakedAB/AI-_Search_Algorithms | AI Search Algo.py | AI Search Algo.py | py | 25,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
... |
72536668347 | from typing import Any, Iterable, List
def list_chunk(
arr: List[Any],
n: int,
) -> List[List[Any]]:
return [arr[i : i + n] for i in range(0, len(arr), n)]
def list_chunk_generator(
arr: List[Any],
chunk_size: int,
) -> Iterable[List[Any]]:
for i in range(0, len(arr), chunk_size):
yi... | ksh24865/cryptocurrency-data-pipeline | Airflow/dags/utils/list.py | list.py | py | 348 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 7,
... |
27400938631 | """empty message
Revision ID: e4fe344ac399
Revises:
Create Date: 2023-05-11 08:12:11.995818
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e4fe344ac399'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
... | Ponyoverkill/FastApi_FaceApp | FacePusPlus/migrations/versions/e4fe344ac399_.py | e4fe344ac399_.py | py | 814 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
42428015759 | import RPi.GPIO as GPIO
from wheel import Wheel
class AlphaBot2:
"""
Classe AlphaBot2-base.
Déplacement du robot, contrôle des moteurs.
Notes:
Reférence de pins GPIO en mode BCM (Broadcom SOC channel).
Pour créer la classe je me suis aidé des scripts proposés par WaveShare:
h... | RoyEnzo/BotCleaner | AlphaBot2/alphabot2.py | alphabot2.py | py | 4,681 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 85,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 85,
"usage_type": "attribute"
},
{
"api_name": "RPi.GPIO.setwarnings",
... |
10640657026 | from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
from rest_framework_simplejwt.views import TokenObtainPairView
urlpatterns = [
path('register/', views.register, name="register"),
# path('img/<int:pk>/', views.ProductViews.as_view()),
... | haimskira/django-custom-userProfile | base/urls.py | urls.py | py | 943 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
22744688512 | import os
from fpdf import FPDF
import requests
class PDF(FPDF):
# CURR_COL = 0 # This is for "static" variables
def __init__(self, orientation, unit, format,
default_label="Informe_Guatemala.png",
secondary_label="Market_Trends.png",
title_color... | UFM-Market-Trends/UFM-Market-Trends-SDK | ufmtrends_sdk/pdf.py | pdf.py | py | 18,419 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "fpdf.FPDF",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.makedirs",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 32,
... |
26977217896 | # Written by Zoie Rast and Vedant Patel
# 18 November, 2022
# Interface GUI
#Import the proper libraries
import tkinter as tk
from tkinter import *
from HelperFile import *
from CurrentWeatherAPI import getWeatherAPI
from ForecastWeatherAPI import forecastWeatherAPI
from ForecastWindow import openWindow
... | ZoutKoning/W.A.A. | CPSC 3720/InterfaceGUI.py | InterfaceGUI.py | py | 9,263 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tkinter.Tk",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tkinter.BOTH",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
"line_... |
27487648089 | import oss2
import crcmod._crcfunext
from itertools import islice
auth = oss2.Auth('','')
bucket = oss2.Bucket(auth,'oss-cn-hongkong-internal.aliyuncs.com','jf87')
#upload
bucket.put_object_from_file('222.txt','/root/PycharmProjects/mytest/mytest/oss/222.txt')
#download
bucket.get_object_to_file('222.txt','/root/Py... | zenwuyuan/mytest | mytest/ oss/test.py | test.py | py | 598 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "oss2.Auth",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "oss2.Bucket",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "oss2.ObjectIterator",
"line_... |
42928525274 | from collections import deque
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def levelOrder(self, root):
if not root:
return []
queue, ans = deque([root]), []
... | shwetakumari14/Leetcode-Solutions | Blind75/Trees/102. Binary Tree Level Order Traversal.py | 102. Binary Tree Level Order Traversal.py | py | 907 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
42891884784 | """
Use the ``TransitionModel`` class with the different transitioners to
add or remove agents based on growth rates or target totals.
"""
from __future__ import division
import logging
import numpy as np
import pandas as pd
from . import util
from ..utils.logutil import log_start_finish
from ..utils.sampling impor... | UDST/urbansim | urbansim/models/transition.py | transition.py | py | 17,258 | python | en | code | 451 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.Index",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.sampling.sample_rows",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pandas.Inde... |
33429831186 | # コードを記載
# コードを記載
import io
import sys
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
# 下記に標準入力を記載
_INPUT = """\
2048 2
"""
sys.stdin = io.StringIO(_INPUT)
X, K = map(int, input().split())
for i in range(K):
if (X % pow(10, i + 1)) >= 5:
print(X)
print(X)
| shun198/algorithm | atcoder/abc273/b/main.py | main.py | py | 329 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 12,
"usage_type": "call"
}
] |
73021061629 | from __future__ import unicode_literals
from django.db import models
class RecipeIngredient(models.Model):
recipe = models.ForeignKey('Recipe')
ingredient = models.ForeignKey('Ingredient')
quantity = models.IntegerField()
class Recipe(models.Model):
name = models.CharField(max_length=32)
catego... | dsanders11/django-migrate-project | test_project/cookbook/models.py | models.py | py | 840 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": ... |
12056527715 | import redis
r = redis.StrictRedis(host='localhost', port=6379, charset="utf-8", decode_responses=True, db=0)
r.set('A', 'candidato1')
r.set('B', 'candidato1')
r.set('C', 'candidato2')
r.set('D', 'candidato1')
r.set('E', 'candidato2')
r.set('F', 'candidato2')
r.set('G', 'candidato1')
r.set('H', 'candidato1')
r.set('I... | karenyov/redisPythonPUC | Atividade/exercicio-eleicao.py | exercicio-eleicao.py | py | 859 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "redis.StrictRedis",
"line_number": 3,
"usage_type": "call"
}
] |
27646594810 | #!/usr/bin/python3
# For more extensions use the folowing -> https://github.com/ptoomey3/evilarc
# This script focuses mainly on tar.gz
"""
This code creates a tar.gz file that can be used for a zipslip attack
For more info => https://github.com/snyk/zip-slip-vulnerability
"""
import tarfile
import io
import time
Fil... | zAbuQasem/Misc | zipslip.py | zipslip.py | py | 907 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "io.BytesIO",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tarfile.open",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tarfile.TarInfo",
"line_number... |
19392531624 | from pydantic import BaseSettings
class Settings(BaseSettings):
AWS_BUCKET_NAME:str
AWS_ACCESS_ID:str
SQLALCHEMY_DATABASE_URI:str
AWS_SECRET_ACCESS_KEY:str
class Config:
env_file = ".env"
settings = Settings(_env_file='.env') | paularah/cpd-s3-file-uploader | settings.py | settings.py | py | 257 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pydantic.BaseSettings",
"line_number": 3,
"usage_type": "name"
}
] |
42064217514 | import casadi as ca
class VehicleModel():
def __init__(self, initial_state=[0, 0, 0]):
# state vector
a = ca.SX.sym('a') # acceleration
v = ca.SX.sym('v') # velocity
x = ca.SX.sym('x') # position
dt = ca.SX.sym('dt') # sampling time
a_previous = ca.SX.sym('a_pre... | Mafumaful/SYDE-655-project | vehicle_model.py | vehicle_model.py | py | 1,406 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "casadi.SX.sym",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "casadi.SX",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "casadi.SX.sym",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "casadi.SX",
"line_number"... |
40199197474 | from django_unicorn.components import UnicornView
from core.models import Article, ArticleComment, ArticleVote
from django.shortcuts import get_object_or_404
from django_unicorn.db import DbModel
from django.contrib.auth import get_user_model
User = get_user_model()
class ArticleDetailView(UnicornView):
comment_... | Koffi-Cobbin/ACES-WEB | unicorn/components/article_detail.py | article_detail.py | py | 1,580 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django_unicorn.components.UnicornView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django_unicorn.db.DbModel",
"line_number": 17,
"usage_type": "cal... |
24200653704 | import logging
import time
import threading
import traceback
from hashlib import sha256
import goTenna
from termcolor import colored
import config
import events
import messages
import utilities
logger = logging.getLogger("MESH")
# For SPI connection only, set SPI_CONNECTION to true with proper SPI settings
SPI_CONN... | willcl-ark/lightningtenna | lightningtenna/connection.py | connection.py | py | 18,078 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "goTenna.settings.GoTennaSettings",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "goTenna.settings",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name... |
33247282474 | import requests
import re
apikey = '76ed9d69f0e44f2b0cc173c8b1eeb59c'
root_url = 'https://api.musixmatch.com/ws/1.1/'
###### Genres to analyze
analysis_genres = ['Hip Hop/Rap', 'Rock', 'Pop', 'Heavy Metal', 'Country']
def get_genre_track_ids(genre_id):
'''
'''
genre_tracks = []
# for p... | Beau-Smit/lyrics-machine | get_lyrics.py | get_lyrics.py | py | 3,191 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 46... |
70564964669 | from rest_framework import serializers
from rest_framework.validators import ValidationError
from rest_framework import status
from django.contrib.sessions.models import Session
from users.models import User
from character_list.models import CharacterList, CharacterClass, CharacterCharacteristics, CharacterItem, Char... | ShulaevIvan/dnd_django | api/serializers.py | serializers.py | py | 10,685 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "character_list.models.CharacterClass",
"line_number": 19,
"usa... |
17177397324 | """
Kaming Yip
CS677 A1 Data Science with Python
Mar 28, 2020
Assignment 8.2: Naive Bayesian using sklearn
"""
from pandas_datareader import data as web
import os
import pandas as pd
import numpy as np
from tabulate import tabulate
import matplotlib.pyplot as plt
from sklearn.naive_bayes import GaussianNB
from sklearn... | KamingYip/Trading_Strategies_with_Stock_Data | Naive Bayesian.py | Naive Bayesian.py | py | 25,045 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pandas_datareader.data.get_data_yahoo",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pandas.to_datetime",
"line_number": 32,
"usage_type": "call"
},
{
"a... |
21379465093 | import wx, os, sys, codecs, traceback
import meta, persistence
from i18n import _
from domain import task
class IOController(object):
''' IOController is responsible for opening, closing, loading,
saving, and exporting files. It also presents the necessary dialogs
to let the user specify what file to load... | HieronymusCH/TaskCoach | branches/Release0_62_Branch/taskcoach/taskcoachlib/gui/iocontroller.py | iocontroller.py | py | 7,333 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "i18n._",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "meta.name",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 19,
... |
70147485949 | import json
import plotly
import numpy as np
import pandas as pd
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, RegexpTokenizer
from nltk.corpus import stopwords
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
... | tylerwatkins101/Disaster_Response_Project | app/run.py | run.py | py | 4,020 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
73123393467 | import re
import simplejson as json
import os
import os.path
import logging
from tempfile import TemporaryFile, NamedTemporaryFile
from cStringIO import StringIO
import itertools
from collections import defaultdict
from utils.odict import odict
from MembraneProtein.AndreanTools import contact
from MembraneProtein.Andr... | hildilab/server | app/v4rna_dead/app/lib/biobench/data.py | data.py | py | 10,509 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
74382388348 | import argparse
import os
import random
import math
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torch.distributions as dist
from torch.utils.data import Dataset, DataLoader
from torchdiffeq import odeint
import numpy as np
from utils.util... | BigKNorman/RecurrentParametrizer | src/train_general.py | train_general.py | py | 33,904 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
1888475667 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python import debug as tf_debug
import cifar10_input
import json
from datetime import datetime
import time
import tensorflow as tf
from tensorflow.python.client import timeline
import CoL_layer... | orhir/DeepCoOccurence | Co-occurrence-Neural-Network/CoNN CIFAR10/CoN_Input_Output.py | CoN_Input_Output.py | py | 12,025 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.app",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.app.flags.DEFINE_string",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.app",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_na... |
38036117322 | import logging
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Dict, Tuple
import numpy as np
from pymatgen.electronic_structure.core import Spin
from tabulate import tabulate
from amset.constants import (
boltzmann_au,
coulomb_to_au,
ev_to_hartree,
gpa_to_au,
... | hackingmaterials/amset | amset/scattering/elastic.py | elastic.py | py | 15,921 | python | en | code | 110 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "abc.ABC",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number... |
43590878547 | import spotipy
sp= spotipy.Spotify()
results= sp.search(q='3OH!', limit= 20)
for i, t in enumerate(results['tracks']['items']):
print(' ',i+1,t['name'])
user= sp.user("amusciano")
print(user)
| needmorecowbell/RandomPythonScripts | spotipyFun.py | spotipyFun.py | py | 219 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "spotipy.Spotify",
"line_number": 3,
"usage_type": "call"
}
] |
71741068669 | import configparser
import toml
import pandas as pd
import numpy as np
import nltk
nltk.download('vader_lexicon')
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from google.cloud import bigquery
from g... | galenhew/fin-indi | dashboard.py | dashboard.py | py | 13,053 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "toml.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tweepy.Client",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.Response",
"line_nu... |
19399842979 | # 寻找旋转排序数组中的最小值
# https://leetcode-cn.com/leetbook/read/array-and-string/c3ki5/
from typing import List
class Solution:
def findMin(self, nums: List[int]) -> int:
for i in range(1, len(nums)):
if nums[i] < nums[i-1]:
return nums[i]
return nums[0]
r = Solution().findMin... | Yigang0622/LeetCode | findMin.py | findMin.py | py | 373 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
7947934740 | import cv2 as cv
import numpy as np
roi = cv.imread('lenna.png')
output = np.zeros((roi.shape[0]//2,roi.shape[1]//2,roi.shape[2]),dtype=np.uint8)
for j in range(output.shape[0]):
for i in range(output.shape[1]):
for k in range(3):
sum = 0
for r in range(-2,3):
for ... | donghunhan/ComputerVision | 영상처리_다해상도&모폴로지_7/multi-resolution-Mean.py | multi-resolution-Mean.py | py | 687 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_number": ... |
11775463070 | from elasticsearch import Elasticsearch, helpers
import ujson as json
import logging
files = ['s2-corpus-00',
's2-corpus-01',
's2-corpus-02',
's2-corpus-03',
's2-corpus-04',
's2-corpus-05',
's2-corpus-06',
's2-corpus-07',
's2-corpus-08',
... | TimRepke/modir3 | data_preparation/semenatic_scholar2solr.py | semenatic_scholar2solr.py | py | 4,440 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "ujson... |
20674421581 | ##############################################################
### This file containts the script virtual stack machine.
##############################################################
from . import dispatch_map
from collections import deque
class Stack(deque):
push = deque.append
@property
def top(self)... | dachrillz/blockchain-implementation | src/scriptmachine/scriptmachine.py | scriptmachine.py | py | 2,201 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "collections.deque.append",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "name"
}
] |
43969197456 | #!/usr/bin/env python
import argparse
from Bio import SeqIO
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(name="charges")
HTML_HEADER = "<html><head><title>Charges Report</title></head><body>"
HTML_FOOTER = "</body></html>"
SVG_HEADER = '<svg width="%i" height="%i" xmlns="http://www.... | TAMU-CPT/galaxy-tools | tools/fasta/fasta_charges.py | fasta_charges.py | py | 10,840 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse"... |
1537613524 | from Trie import Trie
import itertools
def word_freq(word):
"""
Returns frequency of all alphabets in `word`
"""
freq = [0]*26
for ch in word:
freq[ord(ch)-ord('a')]+=1
return freq
def word_possible(word_freq, digram_freq):
for w_f, d_f in zip(word_freq, digram_freq):
if w_... | KartikWatts/shabd-sharda | Game_Data_Script_Python/CreateGameWithSolution.py | CreateGameWithSolution.py | py | 3,265 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "Trie.Trie",
"line_number": 88,
"usage_type": "call"
}
] |
1526576514 | """PROPERTYSALE URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | Jafar5797/banks | PROPERTYSALE/PROPERTYSALE/urls.py | urls.py | py | 2,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "... |
30703024035 | """
Code for sequence generation
"""
import os
import numpy
import copy
import pickle
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from decoder.talker import Decoder
from skipthoughts import UniSkip
import decoder.config as decoder_config
class GenSample(obje... | ShaneTsui/image2story | decoder/beam_search.py | beam_search.py | py | 6,528 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "decoder.talker",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_num... |
35776363992 | import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
def map_graph(simulation_map: np.ndarray) -> None:
"""Plot the board"""
figure, ax = plt.subplots(figsize=(8,6))
colors= ["green","orange","white","white","red","red"]
cmap = LinearSeg... | MioPoortvliet/COP-Population-Dynamics | src/visualization.py | visualization.py | py | 2,712 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotl... |
74845430266 | """
Definition of views.
"""
import json
from django.shortcuts import render
from django.http import HttpRequest,JsonResponse
from django.template import RequestContext
from django.views.decorators.csrf import csrf_protect
from datetime import datetime
from django.contrib.auth.decorators import login_required
from king... | LoneKingCode/kingWeb | kingWeb/kingWeb/apps/adm/views/control.py | control.py | py | 2,127 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.http.HttpRequest",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 42,
"usage_type": "call"
},
{
"api_name":... |
26113125455 | __authors__ = ["T. Rueter", "T. Vincent"]
__license__ = "MIT"
__date__ = "15/05/2017"
import logging
from silx.gui import qt
from silx.gui.utils.testutils import TestCaseQt
from silx.gui.plot import LegendSelector
_logger = logging.getLogger(__name__)
class TestLegendSelector(TestCaseQt):
"""Basic test for L... | silx-kit/silx | src/silx/gui/plot/test/testLegendSelector.py | testLegendSelector.py | py | 3,400 | python | en | code | 106 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "silx.gui.utils.testutils.TestCaseQt",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "silx.gui.qt.QObject",
"line_number": 21,
"usage_type": "attribute"
},
{
"ap... |
35307572305 | #!/usr/bin/env python
# _*_ coding:utf-8 _*_
import datetime
import decimal
from typing import Optional
import pymysql
from dbutils.pooled_db import PooledDB
from jsonpath import findall
from httpfpt.common.env_handler import write_env_vars
from httpfpt.common.errors import SQLSyntaxError, JsonPathFindError, Variable... | wu-clan/httpfpt | httpfpt/db/mysql_db.py | mysql_db.py | py | 5,639 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "dbutils.pooled_db.PooledDB",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "httpfpt.core.get_conf.MysqlDB_HOST",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "httpfpt.core.get_conf",
"line_number": 28,
"usage_type": "name"
},
... |
4929466804 | # -*- coding: utf-8 -*-
"""
Main
"""
import pickle
import torch
import torch.nn as torch_nn
from torch.autograd import Variable
import numpy as np
from model.network import train, test
from data_process import load_dataset
import evaluation
from model import xgb_model
from output import output_result
from product_anal... | wondervictor/PurchasePrediction | main.py | main.py | py | 4,379 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "torch.nn.Embedding",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor"... |
19710753291 | from bokeh.core.enums import SizingMode
import numpy as np
from bokeh.io import curdoc
from bokeh.layouts import column, row
from bokeh.models import ColumnDataSource, Slider, Toggle, Button, tools
from bokeh.transform import linear_cmap
from bokeh.plotting import figure
""" Note button types are default, primary, su... | karlberggren/QuantumCircuitsClass | web_app/bokeh_measurement_and_diffusion/diffusion1.py | diffusion1.py | py | 4,898 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number"... |
27711975262 | import matplotlib.pyplot
import pandas as pd
from matplotlib import pyplot as plt
from pygame import mixer
athletes = "/home/leandro/Documentos/trilha-Python/case/final/Athletes.xlsx"
coaches = "/home/leandro/Documentos/trilha-Python/case/final/Coaches.xlsx"
entries_gender = "/home/leandro/Documentos/trilha-Python/cas... | leandroESS/DESAFIO-AFRODEV | Leandro_afrodev.py | Leandro_afrodev.py | py | 8,218 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_excel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_exc... |
28156161624 | import argparse
import sys
from pathlib import Path
from typing import List, Optional, Tuple
import imageio
import numpy as np
import torch
from torch import Tensor
from thre3d_atom.rendering.volumetric.voxels import GridLocation
from torch.backends import cudnn
from torchvision.utils import make_grid
from projects.... | akanimax/3inGAN | projects/thre3ingan/demo_thre3d_singan_360.py | demo_thre3d_singan_360.py | py | 10,859 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "torch.backends.cudnn.benchmark",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.cudnn",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": ... |
36126203863 | from django.db.models import (
Model,
PositiveIntegerField,
CharField,
FloatField,
ForeignKey,
ManyToManyField,
TimeField,
)
class Catalog(Model):
name = CharField(max_length=50, help_text='Name of catalog', unique=True)
abbreviation = CharField(max_length=5, unique=True,
... | l-laborie/starmap | starmap/celestial/models.py | models.py | py | 7,186 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.db.models.CharField",
"line_number": 14,
"usage_type": "call"
},
{
"api_... |
44092808265 | import gym
import os
import numpy as np
import pickle
import tensorflow as tf
import tensorflow.keras as keras
from matplotlib import pyplot as plt
from gym_compete_rllib.layers import DiagonalNormalSamplingLayer, ValuePostprocessingLayer
from gym_compete_rllib.layers import ObservationPreprocessingLayer, UnconnectedV... | HumanCompatibleAI/better-adversarial-defenses | gym_compete_rllib/load_gym_compete_policy.py | load_gym_compete_policy.py | py | 13,327 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "gym_compete.__file__",
... |
29402029626 | import cv2
import numpy as np
from tqdm import tqdm
from scipy import misc
import os
def dirlist(path, allfile):
filelist = os.listdir(path)
for filename in filelist:
filepath = os.path.join(path, filename)
if os.path.isdir(filepath):
dirlist(filepath, allfile)
... | xuyanging/vae | labelz_binary.py | labelz_binary.py | py | 1,107 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number"... |
12025337164 | from abc import ABCMeta
from copy import deepcopy
import logging
import six
from pickyoptions import settings
from pickyoptions.lib.utils import (
ensure_iterable, merge_dicts, merge_lists, extends_or_instance_of,
space_join)
logger = logging.getLogger(settings.PACKAGE_NAME)
def make_bold(value):
retur... | nickmflorin/pickyoptions | src/pickyoptions/core/exceptions.py | exceptions.py | py | 12,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickyoptions.settings.PACKAGE_NAME",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pickyoptions.settings",
"line_number": 12,
"usage_type": "name"
},
{
"a... |
42106380460 | import itertools, math
from collections import defaultdict
def minimum(products_nodes, products_edges, edges):
ans = math.inf
graph = defaultdict(lambda:set())
for edge in edges:
graph[edge[0]].add(edge[1])
graph[edge[1]].add(edge[0])
for A,B in edges: #O(N)
cur = 0
... | mbarajas/interview-questions | amazon-shopping-patterns/main.py | main.py | py | 679 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.inf",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
}
] |
34238127841 | # -*- coding: utf-8 -*-
import torch
import torch.optim as optim
import torch.nn.functional as F
from .textcnn import TextCNN
class DLModel:
def __init__(self, opts, tgt_num, embedding=None, padding_idx=0):
self.opts = opts
if opts.model == 'textcnn':
self.network = TextCNN(... | MRKINKI/tc | main/dl/dlmodel.py | dlmodel.py | py | 1,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "textcnn.TextCNN",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.optim.Adamax",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.LongTensor"... |
38502786634 | from bs4 import BeautifulSoup
import os
import sys
def _get_app_name(input_message="Enter an app name: "):
try:
app_name = sys.argv[1]
except IndexError:
app_name = input(input_message)
# Validate app name
allowed_app_names = []
for item in os.listdir("."):
if os.path.isd... | briefmnews/python-package-server | bump.py | bump.py | py | 1,961 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16... |
36461875562 | import os
import json
def datafold_read(datalist, basedir, fold=0, key='training'):
'''
:param datalist: json file (filename only) with the list of data
:param basedir: directory of json file
:param fold: which fold to use (0..1 if in training set)
:param key: usually 'training' , but can try 'va... | MrGiovanni/SyntheticTumors | datafolds/datafold_read.py | datafold_read.py | py | 1,014 | python | en | code | 213 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
74532681467 | import requests
import logging
class sendRequest:
def __init__(self, url, serviceKey, logging_level=logging.INFO):
self.url = url
self.serviceKey = serviceKey
self.logging = logging.getLogger(__name__)
self.logging.setLevel(logging_level)
def setURL(self, url):
self.url... | andy0124/realEstateInformationCollector | sendRequest.py | sendRequest.py | py | 1,453 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
... |
20914253870 | #!/usr/bin/env python3
# Standard library imports
from random import randint, choice as rc
# Remote library imports
from faker import Faker
# Local imports
from app import app
from models import db, User, Trip, Comment, Place, friendship_table, FriendRequest
from sqlalchemy import delete
STATUSES = ["completed", "s... | choihalim/halfway | server/seed.py | seed.py | py | 2,827 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "faker.Faker",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.app.app_context",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.User.query.delete",
... |
23987551971 | import CauctusNet
import numpy as np
from keras.models import load_model
from PIL import Image
import os
import tensorflow as tf
import pandas as pd
from tqdm import tqdm
from keras.preprocessing.image import ImageDataGenerator
import keras.backend.tensorflow_backend as KTF
config = tf.ConfigProto()
config.gpu_optio... | sylarchen1389/Simple-cnn-node-for-barrel-colour-classification | scripts/predict.py | predict.py | py | 1,683 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.backend.tensorflow_backend.set_session",
"line_number": 17,
"usage_type": "call"
},
{... |
12308462294 | # app.py
import sys
import json
import argparse
from flask import (
Flask, make_response, render_template, jsonify, request
)
from unipath import Path
TEMPLATE_DIR = Path(__file__).ancestor(1).child("templates")
app = Flask(__name__, template_folder=TEMPLATE_DIR)
def leap(year=0):
if year % 400 == 0:
... | Ogreman/isitaleapyear | leap.py | leap.py | py | 941 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unipath.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get... |
2358198087 | #!/usr/bin/env python3
# coding: utf-8
# https://fragments.turtlemeat.com/pythonwebserver.php
# some compatibility with Python 3 (see #7)
from __future__ import print_function
from __future__ import unicode_literals
import cgi
import logging
import os
import socket
import json
import sys
from io import open # compati... | chaosdorf/labello | labelprinterServe.py | labelprinterServe.py | py | 8,175 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "labelprinterServeConf.SENTRY_DSN",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sentry_sdk.init",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "labelprinterServeConf.SENTRY_DSN",
"line_number": 29,
"usage_type": "attribute"
}... |
5147461774 | import csv
import sys
import operator
import argparse
import numpy as np
import matplotlib
import matplotlib.pyplot as plot
parser = argparse.ArgumentParser(description="Create the plots")
parser.add_argument("filename")
args = parser.parse_args()
count = {}
with open(args.filename, mode='r') as csv_file... | NJT2100/Twitter-Network-Show-Sentiment-Analysis | show_mention_plot.py | show_mention_plot.py | py | 1,730 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subp... |
5985063150 | import sys
import os
import traceback
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from awsglue import DynamicFrame
from pyspark.conf import SparkConf
from pyspark.sql import Dat... | baotr0401/Cryptor-ETL-pipeline | etl/glue-script/layer-2/KafkastreamETL_layer_2.py | KafkastreamETL_layer_2.py | py | 3,066 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "awsglue.utils.getResolvedOptions",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "awsglue.utils.getResolvedOptions",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
35843589824 | import glob
import os
import zipfile
from Utils.validator import validate_solution_zip
from os.path import basename
import time
INSTANCES_PATH = "../instances/instances-zip/instances.zip"
SOLUTIONS_PATH = "../Solutions/"
SOLUTION_ZIP_NAME = "../solutions.zip"
SOLUTION_ZIP_NAME_WO_SUFFIX = "../solutions"
SOLUTIONS_ZI... | Ysommer/SoGC2021_tech | Utils/compress_solutions_and_validate.py | compress_solutions_and_validate.py | py | 2,959 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 30,
... |
73027932349 | from xml.etree import ElementTree as ET
import pandas as pd
def write_table(in_path, top_anchor,bottom_anchor,year,image):
tree = ET.parse(in_path)
root = tree.getroot()
NSMAP = {
'mw': 'http://www.loc.gov/standards/alto/v3/alto.xsd'
}
pass
all_name_elements = tree.findall('... | jgoman99/British-Bengal-Weekly-Crop-Reports | Python Code/extract_tables_from_xml.py | extract_tables_from_xml.py | py | 4,378 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pand... |
43342873926 | import logging
from telegram.ext import CommandHandler, CallbackQueryHandler, ConversationHandler, MessageHandler, \
Filters
from bot import updater
from bot.monitor import start_monitor, stop_monitor, monitor_status, resume_all_monitor
from bot.query import query, query_button, detail_button, detail_item_button
... | peng1999/nwpu-grade | launch_bot.py | launch_bot.py | py | 2,104 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "bot.updater.dispatcher",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "bot... |
10357932601 | #!/usr/bin/env python3
import scipy.interpolate as interpolate
import sys
from moviepy.video.io.bindings import PIL_to_npimage
import matplotlib.pyplot as plt
import moviepy.editor as edit
import numpy as np
import argparse
import PIL
from PIL import ImageFont, ImageDraw
import subprocess
import pdb
import tempfile
imp... | malcx95/rc-telemetry-composer | src/main.py | main.py | py | 11,745 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.ImageFont.FreeTypeFont",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFont.FreeTypeFont",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "P... |
4940051951 | from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, OneHotEncoder
import numpy as np
class DataPreparation:
"""
Pipeline for data preparation (numerical and categorical)
"""
@sta... | luisdhm92/ml-pipeline | pipeline_core/data_preparation.py | data_preparation.py | py | 1,544 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.impute.SimpleImputer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 17,
"usage_type": "call"
}... |
22759343632 | import random
import math
from tabnanny import check
from time import time
from tokenize import Double
from matplotlib.pyplot import step
import numpy as np
from typing import Dict, Iterable, List, Union
class BVNS:
def __init__(self, func, lower_bound, upper_bound, step=0.001, k=3) -> None:
self.func = ... | ufv-ciencia-da-computacao/tp01-CCF480 | vns.py | vns.py | py | 3,846 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.uniform",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.step",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Iterable"... |
38905199875 | import streamlit as st
import numpy as np
import pandas as pd
import plotly.express as px
from pycaret.regression import *
# Data preparation 23
@st.cache()
def load_data1():
lat_long = pd.read_csv('Melbourne_housing_FULL.csv', usecols=['latitude','longitude'])
lat_long = lat_long.dropna()
retur... | aigatdula/melby-house-price-prediction-app | app.py | app.py | py | 1,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.cache",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.cache",
... |
810286006 | '''Given a string, what is the minimum number of adjacent swaps required to
convert a string into a palindrome. If not possible, return -1.'''
from collections import Counter
def minSwapToMakePalindrome(s):
def isPalindrome(s):
s_count = Counter(s)
oddCount = 0
for char, freq in s_count.it... | Saima-Chaity/Leetcode | Array_String/Minimum Adjacent Swap to Make Palindrome.py | Minimum Adjacent Swap to Make Palindrome.py | py | 1,359 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 8,
"usage_type": "call"
}
] |
18760787749 | """
. - Any Character Except New Line
\d - Digit (0-9)
\D - Not a Digit (0-9)
\w - Word Character (a-z, A-Z, 0-9, _)
\W - Not a Word Character
\s - Whitespace (space, tab, newline)
\S - Not Whitespace (space, tab, newline)
\b - Word Boundary
\B - Not a Word Bounda... | Albedo-Discord/ext | environment/setup.py | setup.py | py | 3,914 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "re.Pattern",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number... |
14592802292 | import cv2
cap = cv2.VideoCapture('sora.mp4')
out = cv2.VideoWriter(
'out.avi',
cv2.VideoWriter_fourcc(*'MJPG'),
int(cap.get(cv2.CAP_PROP_FPS)),
(
int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)),
int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
)
)
if not cap.isOpened():
print('fail open video')... | wivj4zm4fpg0/yolopy | save_video.py | save_video.py | py | 477 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS... |
4293233444 | import pyodbc
cnxn = pyodbc.connect("Driver={SQL Server};"
"Server=QUOCBAODANG;"
"Database=student;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor()
cursor.execute('SELECT * FROM Info')
for row in cursor:
print('row = %r' % (row,)) | quocbaodang/REPOSITORY---VNPT-IT3 | Python_MySQL/py_Mysql.py | py_Mysql.py | py | 310 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyodbc.connect",
"line_number": 2,
"usage_type": "call"
}
] |
9065863770 | # %%
import tensorflow as tf
import tensorflow_hub as hub
import numpy as np
import logging
import math
import statistics
import sys
from scipy.io import wavfile
from pydub import AudioSegment
import matplotlib.pyplot as plt
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
#print("tensorflow: %s" % tf.__v... | s095339/MIR-FINAL | Pitch_detection_model/SPICE.py | SPICE.py | py | 3,170 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pydub.AudioSegment.from_file",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pyd... |
5212366141 | # -*- coding: utf-8 -*-
import scrapy
import time
import json
import re
from junyang_spider.items import GkcxCollegeEntryScoreItem
class GkcxEntryScoreSpider(scrapy.Spider):
name = "gkcx_school_entry_score"
allowed_domains = ["gkcx.eol.cn", "data-gkcx.eol.cn"]
start_urls = [
'https://data-gkcx.eol... | endForYou/spider | junyang_spider/spiders/gkcx_school_entry_score.py | gkcx_school_entry_score.py | py | 2,184 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "scrapy.FormRequest",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_... |
36620980880 | """
Schema to describe which object-relational mappings should be used
for each FreeSWITCH XML configuration "section".
"""
import time
import logging
from .orms import (
TagMap, ElemMap, SpecialAttrsMap, AttrMap, ElemList
)
log = logging.getLogger('sandswitches')
_models = []
def model(**kwargs):
"""Deco... | sangoma/sandswitches | sandswitches/schema.py | schema.py | py | 7,066 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "orms.TagMap",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "orms.TagMap",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "orms.SpecialAttrsMap",
... |
23267013876 | import os
import praw
import time
import pandas as pd
from datetime import datetime
#### Todays Date ####
date = str(datetime.today().date())
png = str(".jpg")
filename = date + png
foldername = str("Redditbot/")
# print(filename)
# print(date)
#### Keys and Login Info ####
redditbot = praw.Reddit(
... | Caesar1222/Reddit-art-bot | pyredditbot.py | pyredditbot.py | py | 961 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.today",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "praw.Reddit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
... |
19200608133 | from flask import Flask, request, make_response, render_template
from flask_socketio import SocketIO, emit
import bcrypt
import random
import html
import json
import os
from pymongo import MongoClient
import uuid
import datetime
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.disco... | SantarinX/404-BrainNotFound | server.py | server.py | py | 15,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.headers.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flas... |
26038916306 | from __future__ import annotations
from dataclasses import dataclass
from pants.backend.codegen.thrift.apache.python import subsystem
from pants.backend.codegen.thrift.apache.python.additional_fields import ThriftPythonResolveField
from pants.backend.codegen.thrift.apache.python.subsystem import ThriftPythonSubsystem... | pantsbuild/pants | src/python/pants/backend/codegen/thrift/apache/python/rules.py | rules.py | py | 4,680 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "pants.engine.target.GenerateSourcesRequest",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pants.backend.codegen.thrift.target_types.ThriftSourceField",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pants.backend.python.target_types.PythonSo... |
24024945661 | from dataset.google_dataset import *
import torch
from util.general_util import pickle_save
from tqdm import tqdm
which_dataset = int(input("Koji dataset -> 1, 2 ili 3: "))
if which_dataset == 1:
glove_dataset = GoogleDatasetGlove.from_pickle(pickle_path=GoogleDataset.TRAIN_DATA, glove_path=GoogleDatasetGlove.GLOV... | marinsokol5/Fact-checking | glove_extract_features.py | glove_extract_features.py | py | 1,004 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "util.general_util.pickle_save",
"line_number": 22,
"usage_type": "call"
}
] |
24998394716 | # In[1]:
import numpy as np
import perfplot
from functools import reduce
def compare(n):
compareL = np.full(np.shape(n), np.inf)
for i in range(4):
for index in range(len(n)):
if n[index] < compareL[index]:
compareL[index] = n[index]
def compare_num(n):
reduce(np.mini... | Voltage-x/CG_Final | compare2.py | compare2.py | py | 608 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.full",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "functools.reduce",
"line_numbe... |
70303660028 | # 标准化数据模块
from sklearn import preprocessing
import numpy as np
# 将资料分割成train与test的模块
from sklearn.model_selection import train_test_split
# 生成适合做classification资料的模块
from sklearn.datasets.samples_generator import make_classification
# Support Vector Machine中的Support Vector Classifier
from sklearn.svm import SVC
#... | bugfan/mytools | ai/莫凡/demo正规化.py | demo正规化.py | py | 1,045 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "sklearn.datasets.samples_generator.make_classification",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 29,
"usa... |
42077446891 | import time
from functools import wraps
def time_call(func):
@wraps(func)
def wrapper(*args):
start_time = time.time()
res = func(*args)
time_taken = time.time() - start_time
print(f"time taken: {time_taken:.13f}")
return res
return wrapper
@time_call
def prime_nu... | Andrewwxo/Otus | Task_2.py | Task_2.py | py | 941 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 6,
"usage_type": "call"
}
] |
28246650488 | from xml.dom import minidom
import numpy as np
import ll_to_xy
import matplotlib.pyplot as plt
import smoothing
def get_axes(items):
minlat = float(items[0].attributes['minlat'].value)
minlon = float(items[0].attributes['minlon'].value)
maxlat = float(items[0].attributes['maxlat'].value)
maxlon = floa... | delican001/diploma | dip.py | dip.py | py | 2,777 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "numpy.random.randint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.r... |
35069308246 | """
This module takes care of starting the API Server, Loading the DB and Adding the endpoints
"""
from email import message
from turtle import home
from flask import Flask, request, jsonify, url_for, Blueprint
from api.models import ContactForm, db, Home
from api.utils import generate_sitemap, APIException
api = Blue... | jgustavoj/midwestern-project | src/api/routes.py | routes.py | py | 1,215 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "api.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
21998579416 | import requests
import argparse
import csv
from datetime import datetime
from termcolor import colored
def get_merged_prs_without_approved_reviews(repo_name, token, start_date):
url = f'https://api.github.com/repos/{repo_name}/pulls'
headers = {
'Authorization': f'Bearer {token}',
'Accept': 'ap... | radioactivetobi/pr_auditor | pr_audit.py | pr_audit.py | py | 6,236 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "termcolor.colored",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromisoformat",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "dateti... |
2057200582 | from __future__ import print_function
import argparse
from dataset import CustomDataset
from densenet import densenet
import torch.multiprocessing as mp
import torch.nn as nn
import torchvision.transforms as T
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
impor... | luisrui/AIexperiment | Horovod/custom_horovod.py | custom_horovod.py | py | 8,192 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.multiprocessing.float32",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": ... |
33831270765 | import sys
from datetime import timedelta, datetime
import mariadb
from PyQt5 import QtCore, QtWidgets
from src.RUPaid.DatabaseConnection import DBConnection
from src.RUPaid.Crypt import Hashing
from src.employer.EmployerView import EmployerView
import copy
class EmployerController:
def __init__(self, employer_... | hasnain1230/RUPaid | src/employer/EmployerController.py | EmployerController.py | py | 9,150 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "src.RUPaid.DatabaseConnection.DBConnection",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "src.employer.EmployerView.EmployerView",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMessageBox.critical",
"line_number": 63,
... |
43969705866 | #!/usr/bin/env python
import BIO_FIX_TOPO # NOQA
import argparse
import svgwrite
from Bio import SeqIO
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
def get_boxes(features):
boxes = []
for feature in features:
if "color" in feature.qualifiers:
boxes.ap... | TAMU-CPT/galaxy-tools | tools/gbk/featuresvg.py | featuresvg.py | py | 3,095 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse... |
7408315247 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 18 17:45:47 2021
@author: Punith Gowda
"""
#Library
#VIZ AND DATA MANIPULATION LIBRARY
import pandas as pd
import numpy as np
#import seaborn as sns
#import matplotlib.pyplot as plt
#import math
#numpy
#from numpy import array
#warnings
import warnings
... | punithmadaiahkumar/Forecast-Exchange-Rates | dep.py | dep.py | py | 4,624 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pandas.read_c... |
17535264212 | # -*- coding: utf-8 -*-
import gettext
import json
import os
import uipath
from urlparse import parse_qs
def handler(event, context):
params = parse_qs(event["body"])
token = params["token"][0]
if token != os.environ["verification_token"]:
message = _("Request token does not match")
respo... | miyaichi/uipath-webhook-receiver-on-aws | handlers/slack.py | slack.py | py | 960 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "urlparse.parse_qs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "uipath.start_jobs",... |
19239077932 | # dfs 효율적인 해킹
# pypy3 써야함
import sys
from collections import deque
input = sys.stdin.readline
def bfs(start):
q = deque()
cnt = 0
q.append(start)
visited[start] = 1
while q:
v = q.popleft()
for w in d_list[v]:
if not visited[w]:
visited[w] = 1
... | sdh98429/dj2_alg_study | BAEKJOON/dfs/b1325.py | b1325.py | py | 810 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
25033940448 | from django import forms
from django.forms import ModelForm
from .models import Post
class PostForm(ModelForm):
def __init__(self, *args, **kwargs):
super(PostForm, self).__init__(*args, **kwargs)
self.fields['text'].label = ""
class Meta:
model = Post
fields = ["text"]
... | csloan29/HES-e-33a-web-django | network/network/forms.py | forms.py | py | 567 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.Post",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.Textarea",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
38932242397 | #!/usr/bin/env python
# coding=utf-8
# 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 https://mozilla.org/MPL/2.0/.
"""Grizzly setup"""
from os.path import dirname, join as pathjoin
from itertools im... | jschwartzentruber/grizzly | setup.py | setup.py | py | 3,365 | python | en | code | null | github-code | 6 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.di... |
10143625723 | import ast
import codecs
import os
import re
import sys
import py
import tox
from .config import DepConfig
from .config import hookimpl
class CreationConfig:
def __init__(self, md5, python, version, sitepackages,
usedevelop, deps, alwayscopy):
self.md5 = md5
self.python = python... | adithyabsk/loanchain | loanchain/lib/python2.7/site-packages/tox/venv.py | venv.py | py | 17,243 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "os.path.isabs",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
73499989627 | import numpy as np
from context import lpt
import matplotlib.pylab as plt
import datetime as dt
objdir='/home/orca/bkerns/public_html/realtime_mjo_tracking/lpt/data/tmpa/objects'
obj1 = 20190327000002
obj2 = 20190328000001
overlapping_points = lpt.helpers.calc_overlapping_points(obj1, obj2, objdir)
print(ov... | brandonwkerns/lpt-python | tests/test_lpo_overlap.py | test_lpo_overlap.py | py | 779 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "context.lpt.helpers.calc_overlapping_points",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "context.lpt.helpers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "context.lpt",
"line_number": 10,
"usage_type": "name"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.