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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19153093382 | from django.db import models
class AudioTourModel(models.Model):
title = models.CharField(max_length=200, blank=False, help_text='Title for audio tour area')
soundcloud_id = models.IntegerField(
blank=False,
help_text='Specific Id from SoundCloud service to embed')
index = models.DecimalFi... | imagreenplant/beacon-food-forest | tours/models.py | models.py | py | 546 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
42014569567 | import config
from datetime import timedelta, datetime
import covid_data
import plot
import spain_data
AGE_GROUPS = {
"0-9": ["0-9"],
"10-19": ["10-19"],
"20-39": ["20-29", "30-39"],
"40-59": ["40-49", "50-59"],
"60-69": ["60-69"],
"70+": ["70-79", "80+"],
}
AGE_GROUP_COLORS = {
"0-9": "... | JoseBlanca/covid_situation_spain | src/plot_evolution_per_age_group.py | plot_evolution_per_age_group.py | py | 4,899 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.ORIG_CASES_COL",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "config.ORIG_CASES_COL",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "config.ORIG_COUNT_COLS",
"line_number": 46,
"usage_type": "attribute"
},
{
... |
25959933939 | #-*- coding: utf-8 -*-
from datetime import date, timedelta
from django.db import connection, models
from django.utils.translation import ugettext_lazy as _
from twa.utils import DEFAULT_MAX_LENGTH, AbstractModel
class RequestManager( models.Manager ):
def get_query_set( self ):
return super( RequestManag... | marcusti/mti-twa | requests/models.py | models.py | py | 1,769 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Manager",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "date... |
3689179156 | """feedback 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-base... | da5tan93/feedback | feedback/urls.py | urls.py | py | 1,866 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "... |
23934877636 | from django_cron import CronJobBase, Schedule
from django.db.models import Q
from .models import Device
class UpdateDeviceStatuses(CronJobBase):
devices = []
RUN_EVERY_MINS = 1
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
code = 'ARM.update_device_statuses'
def do(self):
devices =... | tayotoki/arm-kip | ARM/cron.py | cron.py | py | 684 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django_cron.CronJobBase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django_cron.Schedule",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Device.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name... |
39899914837 | from UI.editEmployeeWin import Ui_Dialog
from PyQt5.QtWidgets import QDialog, QLineEdit
from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtCore import QRegExp
class EditEmployeeWin(QDialog, Ui_Dialog):
def __init__(self, parent, roles, empData = None) -> None:
super().__init__(parent)
Ui_D... | Vittallya/MlApp | Views/editEmpWin.py | editEmpWin.py | py | 3,278 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "UI.editEmployeeWin.Ui_Dialog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "UI.editEmployeeWin.Ui_Dialog.__init__",
"line_number": 11,
"usage_type": "call"
},
... |
11040292875 | from common.FrontendTexts import FrontendTexts
view_texts = FrontendTexts('quotes')
labels = view_texts.getComponent()['selector']['choices']
ACTION_CHOICES = (
(1, labels['edit']),
(2, labels['edit_materials'])
)
PROVIDER_CHOICES = (
(1, "MP100001 - Conpancol Ingenieros"),
(2, "MP100002 - Maasteel U... | Conpancol/PyHeroku | CPFrontend/quotes/choices.py | choices.py | py | 328 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "common.FrontendTexts.FrontendTexts",
"line_number": 2,
"usage_type": "call"
}
] |
33493058365 | import logging
import numpy as np
from sklearn.metrics import pairwise_distances
class PointCorresponder():
def point_correspond_3d_to_2d(self, projected_pts, visible_indces, keypoints, top_closest=1):
"""
Args:
projected_pts:
visible_indces:
keypoints:
... | Mikhail-Klochkov/face3dmorphablemodel | morphable_model/point_correspond.py | point_correspond.py | py | 1,436 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.pairwise_distances",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.e... |
11559234229 | #!/usr/bin/env python
# encoding: utf-8
"""
@version: v1.0
@author: xag
@license: Apache Licence
@contact: xinganguo@gmail.com
@site: http://www.xingag.top
@software: PyCharm
@file: js2py_demo.py
@time: 2020-07-22 17:49
@description:js2py
"""
# 依赖
# pip3 install js2py
import js2py
from js_code import ... | xingag/tools_python | Python执行JS总结/js2py_demo.py | js2py_demo.py | py | 1,012 | python | en | code | 148 | github-code | 1 | [
{
"api_name": "js2py.eval_js",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "js2py.EvalJs",
"line_number": 48,
"usage_type": "call"
}
] |
28949575640 | import json
import os
from bs4 import BeautifulSoup
import requests
import time
from typing import List,Dict
import socket
def extract_urls(path_to_urls_json):
with open(path_to_urls_json) as f :
json_list = json.load(f)
return json_list
def download_url(url:str):
try:
x = reques... | fwallyn1/SimpleIndex | index/utils.py | utils.py | py | 1,263 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_numb... |
30005077930 | import torch
from torch.nn import Module, Linear, LayerNorm
class LSTMCellLayerNorm(Module):
"""
A lstm cell that layer norms the cell state
https://github.com/seba-1511/lstms.pth/blob/master/lstms/lstm.py for reference.
Original License Apache 2.0
"""
def __init__(self, input_size, hidden_si... | heronsystems/adeptRL | adept/modules/sequence.py | sequence.py | py | 1,770 | python | en | code | 202 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.LayerNorm",
... |
31226951252 | # Flask utils
from flask import Flask, request, render_template
from werkzeug.utils import secure_filename
import os
from model_file import *
from whale_title import *
model.load_state_dict(torch.load('./model/VGG-whaleFin_ImageClassification_model.pt',map_location ='cpu'))
model.eval()
# Define a flask app
app = Fla... | sclee0724/Whale_Fin_Image_Classification_Project | app.py | app.py | py | 1,852 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.req... |
18082080648 | import torch
import pandas as pd
import numpy as np
import tensorflow as tf
from tensorflow import keras
import zipfile
import math
import geopandas
from shapely import geometry
import os
import torch
import sys
from sklearn.preprocessing import MinMaxScaler
# load some default Python modules
import numpy as np
import... | ipmLessing/Taxi-Demand-and-Fare-Prediction | demand_prediction/Model_M=40_n1=100_n2=100sigmoid.py | Model_M=40_n1=100_n2=100sigmoid.py | py | 17,686 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_na... |
39164509106 | from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel
import sys
from PyQt5.QtGui import QIcon, QFont
from PyQt5.QtCore import QRect, QSize
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.create_ui()
def create_ui(self):
self.setWindowTitle... | BjornChrisnach/Pinterest_course_GUI | Mywindow.py/Mywindow.py | Mywindow.py | py | 1,315 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 24,
"usage_type": "call"
},
{
"api_name... |
20831591596 | from flask import Flask, render_template, url_for, jsonify, request
from http import HTTPStatus
from jinja2 import Template
import pymysql.cursors
import json
import os
app = Flask(__name__)
def get_connection():
connection = pymysql.connect(
host='localhost',
user=os.environ['dbuser'],
... | pdmarc7/analytica | app.py | app.py | py | 3,312 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.environ",
"... |
39745820789 | import nose
import subprocess
import os
_epochdir = os.path.dirname(os.path.abspath(__file__))
_epochdir = os.path.join(_epochdir, '..')
_subdir = None
def setcwd(relative=None):
'''
resets the current working directiory to the path
of this file.
'''
os.chdir(_epochdir)
os.chdir(_subdir)
... | Warwick-Plasma/epoch | scripts/run-tests.py | run-tests.py | py | 2,754 | python | en | code | 143 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
9528154926 | from PyQt5.QtWidgets import *
from PyQt5 import uic
from crawler.web_crawler import WebCrawler
from crawler.popup_window import PopupWindowClass
from crawler.qthread_worker import QThreadWorker
from bs4 import BeautifulSoup
from PyQt5.QtCore import QCoreApplication, QMutex, QThread, QWaitCondition, pyqtSignal
import... | chunppo/WebCrawler | main.py | main.py | py | 3,166 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "crawler.qthread_worker.QThreadWorker",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "crawl... |
185739374 | import pyarrow as pa
from petastorm.local_disk_cache import LocalDiskCache
class LocalDiskArrowTableCache(LocalDiskCache):
"""A disk cache implementation """
def __init__(self, *args, **kwargs):
super(LocalDiskArrowTableCache, self).__init__(*args, **kwargs)
# Workaround for https://issues.ap... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/chaitanya_kaul@petastorm/petastorm/local_disk_arrow_table_cache.py | local_disk_arrow_table_cache.py | py | 1,022 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "petastorm.local_disk_cache.LocalDiskCache",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pyarrow.serialize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyarrow.serialize",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
74825614112 | """
HikerDataToCSV.py
Aggregates the data contained in the 'ValidatedHikers' directory. This script reads in every hiker in the directory and modifies each data structure in memory by
adding and calculating the fields required for hiker distance prediciton. The updated data structures are then written in CSV form a... | campellcl/APMAT | Program/DataManipulation/HikerDataToCSV.py | HikerDataToCSV.py | py | 14,187 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict"... |
17928255590 | """empty message
Revision ID: b2a4b30fdece
Revises: 0a6d3d1508a5
Create Date: 2021-03-04 18:52:11.795274
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b2a4b30fdece'
down_revision = '0a6d3d1508a5'
branch_labels = None
depends_on = None
def upgrade():
# ... | amankumar4real/ticketing | backend/migrations/versions/b2a4b30fdece_.py | b2a4b30fdece_.py | py | 1,526 | python | en | code | 0 | github-code | 1 | [
{
"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... |
26426713407 | #어른상어 2시
from collections import defaultdict,deque
global n,m,k,g,shark,sdir,smell
# INITIALIZE
shark = defaultdict(list)
dir = [(-1,0), (1,0), (0,-1), (0,1)] # 위, 아래, 왼쪽, 오른쪽
n,m,k = map(int ,input().split())
gg = [[*map(int,input().split())] for _ in range(n)]
g = [[[0,0] for _ in range(n)] for _ in range(n)]
init... | dohui-son/Python-Algorithms | simulation_samsung/b19237_어른상어.py | b19237_어른상어.py | py | 2,283 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "coll... |
28418502484 | #link - https://www.hackerrank.com/challenges/iterables-and-iterators/problem?isFullScreen=true
from itertools import combinations
n = int(input())
arr = [x for x in input().split()]
k = int(input())
combi = list(combinations(arr, k))
total = len(combi)
count = [1 for each in combi if 'a' in each]
pri... | prince001996/Hackerrank | Python/iterables_and_iterators.py | iterables_and_iterators.py | py | 340 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
}
] |
34577004526 | #!/usr/bin/python
import sys, os, argparse
import asyncio
import traceback
import rulebook
from .util import *
from .libnetconf import NetworkState
import rulebook.runtime
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
try:
from IPython.kernel.zmq.kernelapp import I... | regnarg/networksecretary | networksecretary/daemon.py | daemon.py | py | 6,292 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "IPython.kern... |
7790807669 | import csv
import string
import chess
import chess.pgn
import random
import json
from random import randint
import pandas as pd
# Flask and WSGI
import flask
from flask import Flask, Blueprint, jsonify
from flask import request
from flask_cors import CORS, cross_origin
app = Flask(__name__)
CORS(app)
... | kapilpownikar/QCRI-Chess-Project | backend.py | backend.py | py | 3,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_cors.cross_origin",... |
13103595331 | import numpy as np
import pathlib, os, time
class Neuron:
def __init__(self, numofinputs, weights=[-999], layerName="undefined"):
""" initialises neuron class type. weights MUST be list, not integer. If only 1 weighting of n then pass [n] """
self.activation = tanh
self.layerName = layerN... | lloydarnold/a-level-coursework | old_neural_network.py | old_neural_network.py | py | 6,296 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
12921162394 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 13 20:23:59 2019
@author: de-sinnett
"""
# Import random, operator and plotting modules
import random
import operator
import matplotlib.pyplot
# Create a new empty list
agents = []
# Set up variables to start at random coordinates in a 100x100 grid (agent 1)
agents.appe... | DanielleSinnett/AgentBasedModellingTest | model2.py | model2.py | py | 1,432 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line... |
33608410850 | import shutil
import string
import torch
import torch.nn.functional as F
import torch.utils.data as data
import tqdm
import numpy as np
import json
from collections import Counter
class SQuAD():
def __init__(self):
self.contexts = []
self.questions = []
def loadSquad(self, data_p... | Onepierre/Context-detection | dataloader.py | dataloader.py | py | 1,113 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
}
] |
22025109541 | import boto3
import json
import logging
import os
import cv2
import ast
from botocore.exceptions import ClientError
s3 = boto3.client('s3')
s3inputbucket = 'inputvideobucket2022'
sourcefile = 'source.mp4'
sourceoutputfile = 'source.mp4'
labelidentifier = 'Human'
labelconfidence = 80
jsonsource = '0data.json'
def S3Ex... | sidraj2002/RekognitionSid | HumanVideoDetect/FrameExtracter.py | FrameExtracter.py | py | 3,090 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "cv2.VideoCap... |
26067512419 | import importlib.resources
from pathlib import Path
import numpy as np
import scipy.linalg as sla
from hivpy.sex_behaviour_data import SexualBehaviourData
def test_probability_loading():
# Load example file
data_path = Path(__file__).parent / "test_data" / "sbd_testing.yaml"
SBD = SexualBehaviourData(da... | UCL/hivpy | src/tests/test_sex_behaviour_data.py | test_sex_behaviour_data.py | py | 2,640 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "hivpy.sex_behaviour_data.SexualBehaviourData",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "importlib.resources.resources.path",
"line_number": 53,
"usage_type": "call"
... |
26827467096 | import os
import pandas as pd
import numpy as np
from numpy.linalg import inv
import matplotlib.pyplot as plt
# root mean square error metric between predictions and the ground truth
def rmse(pred, true):
assert pred.shape == true.shape
n, = true.shape
return np.sqrt(np.sum((pred - true) ** 2) / n)
def pr... | JianhuanZeng/Machine-Learning-NLP | NLP-Lab2-MovieRecomendation/FM.py | FM.py | py | 4,720 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 48,... |
1443274025 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Author : alex
Created : 2020-09-11 15:18:05
Comments :
"""
# %% IMPORTS
# -- global
import logging
import time
from PyQt5 import QtWidgets
from PyQt5.QtGui import QFont, QIcon
from PyQt5.QtWidgets import QShortcut, QMessageBox, QAction, QMenu
from pathlib import Pat... | adareau/HAL | HAL/gui/main.py | main.py | py | 25,565 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "functools.wraps",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 227,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 227,
"usage_type": "name"
},
{
"api_name": "Ma... |
72143444195 | import datetime
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="PatchedApplication")
@attr.s(auto_attribs=True)
class PatchedApplication:
"""Dynamically removes fields from seriali... | caltechads/brigid-api-client | brigid_api_client/models/patched_application.py | patched_application.py | py | 5,315 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
31637375221 | # coding=utf-8
import copy
import os
import glob
import shutil
import unittest
from mock import patch
from testfixtures import TempDirectory
from ddt import ddt, data
from provider import cleaner
import activity.activity_AcceptedSubmissionStrikingImages as activity_module
from activity.activity_AcceptedSubmissionStrik... | elifesciences/elife-bot | tests/activity/test_activity_accepted_submission_striking_images.py | test_activity_accepted_submission_striking_images.py | py | 8,187 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "tests.test_data.ingest_accepted_submission_data",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "tests.test_data",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 32,
"usage_type": "attribute"
}... |
18021165672 | import Pyro4
import Pyro4.naming
from xbmcjson import XBMC
import _thread as thread
from subprocess import run, PIPE
from evdev import UInput, InputEvent, ecodes as e
from time import sleep
import logging as log
from pulse_mute import Pulse
@Pyro4.expose
class RemoteServer(object):
def __init__(self):
sel... | zteifel/raspberry_remote | htpc/server_pyro.py | server_pyro.py | py | 3,311 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "evdev.UInput",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "evdev.ecodes.EV_REL",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "evdev.ecodes",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "evdev.ecodes.REL_X... |
18805300498 | ##################################################### Import system libraries ######################################################
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc'))
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants as c... | Jean1995/Praktikum | V501/PythonSkript.py | PythonSkript.py | py | 21,644 | python | de | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.rcdefaults",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams.update",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name":... |
7972926046 | # Author: Leandro Cruz Hermida <hermidal@cs.umd.edu>
"""
sksurv_extensions is a library of custom extensions and core improvements to
scikit-survival
"""
from sklearn.utils.metaestimators import if_delegate_has_method
from sklearn_extensions.pipeline import ExtendedPipeline
@if_delegate_has_method(delegate='_final_... | ruppinlab/tcga-microbiome-prediction | sksurv_extensions/__init__.py | __init__.py | py | 2,183 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "sklearn.utils.metaestimators.if_delegate_has_method",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.metaestimators.if_delegate_has_method",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sklearn_extensions.pipeline.ExtendedPipel... |
70662958755 | from collections import deque
d = [deque() for _ in range(0, 5)]
d[3].appendleft(1)
d[3].appendleft(2)
d[3].appendleft(3)
d[3].append(1)
print(d[1].maxlen)
print(d)
e = [deque() for _ in range(0, 5)]
e[2].appendleft('world')
e[2].appendleft('hello')
def write_chain(chain):
print(' '.join(chain))
write_chain(e... | ashrielbrian/coursera-algorithms-specialization | 02 Data Structures/03 Week 3/test.py | test.py | py | 475 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
}
] |
28138890438 | import json
import inspect
import urllib.parse
from longitude.core.data_sources.base import DataSource
class DisabledCache:
data_source = None
def __init__(self, ds):
if ds and not isinstance(ds, DataSource):
raise TypeError('DisabledCache can only be applied to DataSource subclasses.')
... | GeographicaGS/Longitude | longitude/core/common/helpers.py | helpers.py | py | 2,596 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "longitude.core.data_sources.base.DataSource",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "inspect.stack",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.unquote",
"line_number": 45,
"usage_type": "call"
},
... |
6235823673 | """Client to interface with Rito API."""
import os
from typing import Any, Dict, Optional
from absl import logging
import requests
def call(endpoint: str,
api_key: str,
params: Optional[Dict[str, Any]] = None,
data: Optional[Any] = None,
platform_id: str = 'americas'):
"""Helpe... | vilhelm/icl-bot | server/riot_client.py | riot_client.py | py | 1,458 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_nu... |
34564509479 | # Path generator by Team Griffin
from __future__ import print_function
import pyvisgraph as vg
import itertools
import time
import sys
if (len(sys.argv) > 1):
instance_number = int(sys.argv[1])
# Import instance information
execfile("instance_%d.py" % instance_number)
# Calculate shortest paths... | tsuiwwwayne/move-and-tag-competition | py/loadgraph.py | loadgraph.py | py | 2,120 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pyvisgraph.VisGraph",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.clock",
"lin... |
71317076194 | import os
import numpy as np
from scipy import signal
from scipy.io import loadmat
import torch
from torch import nn
import torch.nn.functional as F
import conv
from layers.modules import *
from layers.functions import ConvMotionFunction
class Pooling(nn.Module):
def __init__(self, n_in):
super(Pooling... | teboli/CPCR | networks.py | networks.py | py | 8,025 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
73111178914 | # -*- coding: utf-8 -*-
import scrapy
import json
import time
from scrapy.http import FormRequest
from loguru import logger
from SafetyInformation.items import SafeInfoItem
from SafetyInformation.settings import SLEEP_TIME, TOTAL_PAGES
class NosecSpider(scrapy.Spider):
name = 'nosec'
allowed_domains = ['nose... | Silentsoul04/SafetyInformation | SafetyInformation/spiders/nosec.py | nosec.py | py | 2,793 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "scrapy.http.FormRequest",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "loguru.... |
70342931234 | import json
import logging
import os
import shutil
import sys
# pylint: disable=no-name-in-module
# No name 'tar' in module 'sh'
from sh import tar
try:
from tempfile import TemporaryDirectory
except ImportError:
from s2e_env.utils.tempdir import TemporaryDirectory
from s2e_env import CONSTANTS
from s2e_env.... | S2E/s2e-env | s2e_env/commands/export_project.py | export_project.py | py | 5,889 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "s2e_env.command.ProjectCommand",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "s2e_env.utils.tempdir.TemporaryDirectory",
"line_number": 57,
"usage_type": "call"
},
... |
31014597352 | #!usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Created by sublime_text at home on 2018/2/28—20:12!
@Gnome: Live and learn!
@Author: 葛绪涛
@Nickname: wordGe
@QQ: 690815818
@Filename: web.py
@Blog: http://higexutao.blog.163.com
"""
import os.path
from tornado import httpserver, web, ioloop
# 功能模块 实现具体的功能
cla... | tagxt/WenZiShiBie_tornado | web.py | web.py | py | 1,860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tornado.web.RequestHandler",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path... |
34724927724 | from fastapi import HTTPException
from pydantic import BaseModel, EmailStr, constr
from datetime import date, timedelta
from db_mysql.Connection_mysql import conecction_mysql
class UserRegister(BaseModel):
sexo: constr(max_length=10)
fecha_de_nacimiento: date
nombre: constr(max_length=100)
apellido: c... | Warriors2021/FormUserCRUD | Dependencies/Register.py | Register.py | py | 2,323 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pydantic.constr",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pydantic.constr",
"... |
2715999025 | # start
# find highly selected genes in one species across populations and donors
import os
import glob
import copy
from Bio import SeqIO
from Bio.Seq import Seq
import argparse
############################################ Arguments and declarations ##############################################
parser = argparse.Argum... | caozhichongchong/snp_finder | snp_finder/scripts/oldscripts/parallel_evolution.py | parallel_evolution.py | py | 24,817 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 75,
"usage_type": "call"
},
{
"ap... |
42292075170 | import logging
from typing import Any, Dict, Hashable, TypeVar, Union
logger = logging.getLogger(__name__)
D = TypeVar("D")
def get_by_path(d: Dict, *path: Hashable, default: D = None) -> Union[Any, D]:
"""
Given a nested dict of dicts, traverse a given path and return the result or the default if it is not... | abn/cafeteria | cafeteria/patterns/dict.py | dict.py | py | 878 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Hashable",
"line... |
12657959262 | """Dataset Handler."""
import os
import torch
from datasets import cifar_handler
from datasets import tinyimagenet_handler
from datasets import imagenet2012_handler
from datasets import stl10_handler
import numpy as np
class DataHandler:
"""Handler for datasets."""
def __init__(
self,
dataset_name,
... | ajaysub110/satbench | cnet/datasets/dataset_handler.py | dataset_handler.py | py | 7,854 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
31415576748 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('promotions_app', '0002_promotionmanager')... | mvpgomes/shopit-app | promotions_app/migrations/0003_auto_20150223_2016.py | 0003_auto_20150223_2016.py | py | 1,029 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
27406796251 | from typing import Optional, List
from fastapi import Body, Depends, HTTPException, status, Query
from pydantic import EmailStr
from .app_helper import (
create_student,
get_student,
update_student,
delete_student,
)
from .models import (
Student,
StudentDelete,
StudentUpdate,
StudentRet... | Ajinkya7poppyi/DeepManager | app/modules/studentmanager/app.py | app.py | py | 4,792 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Student",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "fastapi.Body",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "app_helper.create_stude... |
34953688010 | # -*- coding: utf-8 -*-
"""Common test case for all message based resources.
"""
import ctypes
import gc
import logging
import time
from types import ModuleType
from typing import Optional
import pytest
from pyvisa import constants, errors
from pyvisa.constants import EventType, ResourceAttribute
from pyvisa.resourc... | pyvisa/pyvisa | pyvisa/testsuite/keysight_assisted_tests/messagebased_resource_utils.py | messagebased_resource_utils.py | py | 34,742 | python | en | code | 721 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "types.ModuleType",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pyvisa.constants.EventType.service_request",
"line_number": 51,
"usage_type": "attribute"
},
{
"... |
38639297269 | #!/usr/bin/env python
from setuptools import find_packages, setup
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = ['scitools-iris', 'numpy', 'scipy', 'matplotlib', 'metpy']
setup_requirements = []
test_requirements = []
setup(
author="Leo Saffin",
author_email='str... | leosaffin/scripts | setup.py | setup.py | py | 1,150 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 34,
"usage_type": "call"
}
] |
9893919789 | from typing import Any, List, Dict
import xlwt
import xlrd2
import openpyxl
from ..basic.exClass import CommonException
from ..exFunc import *
from .fileFunc import readLines, isExist, createFile, deleteFile, writeAppend
class XlsWriter():
def __init__(self, path: str) -> None:
self.path = path
... | Logic-Orz/logicFun | logicFun/common/excelFunc.py | excelFunc.py | py | 4,595 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "xlwt.Workbook",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "basic.exClass.CommonException",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.... |
1588805635 | import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import cartopy.crs as ccrs
import cartopy.io.shapereader as shpreader
from mask_shape_border import mask_shape_border
DS_y=xr.open_dataset("yield_soy_1979-2012.nc",decode_times=False).sel(lon=slice(-61,-44),lat=slice(-5,-33))
... | dumontgoulart/agr_cli | model_data_yield.py | model_data_yield.py | py | 5,932 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "xarray.open_dataset",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cartopy.io.shapereader.Reader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "c... |
43467543395 | import time
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.options import Options
from fake_useragent import UserAgent
from undetected_chromedriver import Chrome, ChromeOptions
from getCar... | Sankhay/Estudos | Python/selenium/app4.py | app4.py | py | 7,174 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.proxy.Proxy",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.proxy.ProxyType.MANUAL",
"line_number": 39,
"usa... |
15141641723 | import requests
import json
import sys
import urllib.parse
import os.path
import hashlib
import argparse
# import sqlite3
# from tplib3 import *
# import datetime
# import time
import platform
from sqlite3 import Error
# updategroupconfig
#
# Fetches siteconfig from config file
# fetches groupconf... | bios62/ha_hytta | python-scripts/updategroupconfig.py | updategroupconfig.py | py | 5,476 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "platform.system",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_numb... |
43073520173 | import sys
from PyQt4.QtGui import (QApplication, QWidget, QFont, QListWidget,
QHBoxLayout, QVBoxLayout, QShortcut, QKeySequence)
import numpy as np
from spyderlib.widgets.sourcecode.codeeditor import CodeEditor
from spyderlib.widgets.internalshell import InternalShell
from spyderlib.widgets.dicteditor import DictE... | UpSea/midProjects | BasicOperations/11_Spyder/useOfSpyderShell.py | useOfSpyderShell.py | py | 2,085 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PyQt4.QtGui.QWidget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "spyderlib.widgets.sourcecode.codeeditor.CodeEditor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt4.QtGui.QFont",
"line_number": 15,
"usage_type": "call"
},
... |
40319161924 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from src.ui.winsWidgetView import WinsWidgetView
logging.basicConfig(level=logging.DEBUG) # change to 'DEBUG' to see more
from PyQt5 import QtWidgets, QtGui
def setFontFamily(font):
allFamillies = QtGui.QFontDatabase().families()
familyName = ... | winsomexiao/PyDemo | src/ui/mainView.py | mainView.py | py | 792 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtGui.QFontDatabase",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt... |
43719343533 | #
# This is an example script to plot seconday chemical shifts.
# by Woonghee Lee, Ph.D. (woonghee.lee@ucdenver.edu)
#
# To run this script:
# In Poky Notepad,
# File -> Run Python Module
print('\n\n\n------------------------------------------------------')
print('POKY Secondary Shift Plot')
print('by Woonghee L... | pokynmr/POKY | User_Modules/plot_secondary_shift_script.py | plot_secondary_shift_script.py | py | 3,395 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "__main__.main_session",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "sputil.name_to_condition",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "ma... |
12086094939 | import sys
sys.path.append("../")
import pymysql
import math
import pandas as pd
import numpy as np
from scipy.spatial import distance
import csv
from InsertDataBase.CreateTables import *
from DBtools.init_db import init_DB
def GetMinDistanceLane(local_x, local_y):
radius = 5
node_list = list()
... | THU-changc17/MetaScenario | InsertDataBase/Argoverse_MIA_InsertTrafficParticipant.py | Argoverse_MIA_InsertTrafficParticipant.py | py | 6,690 | python | en | code | 13 | 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": "numpy.array",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number"... |
71632601315 | #!/usr/bin/env python
import argparse
import glob
import os
import re
import cv2
import numpy as np
import pandas as pd
from skimage import transform as tf
from utils import create_dictionary_lang
CHROME_PATH = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
lang_code_dict = create_dictionary_lang(... | facebookresearch/flores | ocr/data_collection/augment_data.py | augment_data.py | py | 10,099 | python | en | code | 623 | github-code | 1 | [
{
"api_name": "utils.create_dictionary_lang",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "os.path"... |
5856668077 | import logging
import sys
import os
LOG_CONFIG = {
'name': 'event-tracker',
'level': logging.DEBUG,
'stream_handler': logging.StreamHandler(sys.stdout),
'format': '%(asctime)s: %(module)s: %(levelname)s: %(message)s'
}
TWITTER_CONFIG = {
'api_key': os.environ["TWITTER_API_KEY"],
'api_secret':... | TheGBG/pic_sender | src/config/config.py | config.py | py | 666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
20275789174 | from config import TG_KEY, GPT_KEY
from keybrds import kb
from redis_client import redis_client
import openai
from aiogram import Bot, Dispatcher, executor, types
openai.api_key = GPT_KEY
bot = Bot(token=TG_KEY)
dispatcher = Dispatcher(bot)
@dispatcher.message_handler(commands=["start"])
async def start_func(mess... | EgorShabalin/chat_bot | main.py | main.py | py | 2,315 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openai.api_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.GPT_KEY",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "aiogram.Bot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "config.TG_KEY",
"lin... |
412075890 | # pylint: disable=W0621,C0114,C0116,W0212,W0613
import pathlib
import textwrap
import pytest
import numpy as np
from dae.genomic_resources.testing import build_inmemory_test_repository
from dae.genomic_resources.repository import GR_CONF_FILE_NAME, \
GenomicResourceRepo
from dae.gene.gene_scores import build_gene_... | iossifovlab/gpf | dae/dae/gene/tests/test_gene_score.py | test_gene_score.py | py | 8,621 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "dae.genomic_resources.testing.build_inmemory_test_repository",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dae.genomic_resources.repository.GR_CONF_FILE_NAME",
"line_num... |
32205094518 | import os
import torch
import argparse
import numpy as np
import PIL.Image as Image
from matplotlib import pyplot as plt
from torch.utils.data import DataLoader
from torch import nn, optim, autograd
from torchvision.transforms import transforms
from dataset import Train_Dataset, Validation_Dataset, Test_Datase... | Jichao-Wang/MDOAU2-net | wjc_core.py | wjc_core.py | py | 16,861 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "stable_seed.setup_seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.cud... |
14889123182 | import re
import os
def readFile():
path = os.path.join(os.path.expanduser('~'), 'listaSadow', 'listaSadow.txt')
with open(path,"r") as file:
for line in file.readlines():
yield line
def writeMongoCommand(listaCommand):
path = os.path.join(os.path.expanduser('~'), 'listaSadow', 'dbPopu... | tomektarabasz/courtApi | app/excel_to_db/dbparser.py | dbparser.py | py | 3,812 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
4415210155 | import numpy as np
import _pickle as pickle
import copy
from collections import OrderedDict
from ConstantVariables import *
from pathlib import Path
class Network:
def __init__(self, name='', inputs=0, outputs=0):
self.name = name
self.inputs = inputs
self.outputs = outputs
self.l... | Robinamixan/Goblins-pygame | Networks/Network.py | Network.py | py | 5,303 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.OrderedDict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.r... |
2714834337 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView
from django.shortcuts import get_object_or_404
from rest_framework.authentication import BasicAuthentication, SessionAuthentication
from rest_framework.decorators import api_view, permission_classes, authentication... | artemovaka22pv191/back_movie | views.py | views.py | py | 7,622 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_201_CREATED",
"line_number": 28,
"usage_type... |
18480733171 | from typing import List
class UserCard():
gCardIds = []
def __init__(self, tPackage: tuple=()) -> None:
"""
Parameters
----------
tPackage : tuple
(id, userId, cardCode, level, bond, userTags, moves, skills)
+ id : str
+ userId : str
+ code... | kaleidocli/gachaSim | model/user/UserCard.py | UserCard.py | py | 1,776 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 43,
"usage_type": "name"
}
] |
30045234159 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | openstack/senlin | senlin/api/common/serializers.py | serializers.py | py | 2,897 | python | en | code | 44 | github-code | 1 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "oslo_config.cfg.CONF",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "oslo_co... |
17287949508 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 29 13:12:03 2021
@author: thuang
Plots the sensitivity delta = master_branch - my_branch
for 1e3 and 1e4.
"""
from matplotlib import pyplot as plt
import numpy as np
class delta_bars:
def __init__(self, data_dict, tolerance):
"""
Parameters
... | thuang-work/txrx_sync_rssi | plot_ber_delta.py | plot_ber_delta.py | py | 2,778 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.ceil",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
23870021739 | """
This script is meant to be iterated many times to replicate the spawning of many error popups.
"""
from PySide2 import QtWidgets
import random
from PySide2.QtWidgets import QMainWindow, QApplication
from PySide2.QtGui import QIcon
from configparser import ConfigParser
import sys
app = QApplication(sys.argv)
appcfg... | blitpxl/nk-popup-generator | src/iterable_popup.py | iterable_popup.py | py | 1,783 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySide2.QtWidgets.QApplication",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
11087451085 | # Import the libraries
import nltk
from nltk.chat.util import Chat, reflections
import tkinter as tk
from tkinter import *
# Define the responses
pairs = [
['hi', ['Hello!', 'Hi there!']],
['what is your name', ['My name is Chatbot', 'I am Chatbot']],
['how are you', ['I am doing well', 'I am fine, thanks'... | Beimnet27/Simple-Python-Chatbot | SimpleChat_Bot.py | SimpleChat_Bot.py | py | 1,647 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "nltk.chat.util.Chat",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.chat.util.reflections",
"line_number": 16,
"usage_type": "argument"
}
] |
11806840571 |
import json
import requests
from config.const import SPOTIFY_HEADERS, SPOTIFY_URLS
from config.tokens import SPOTIFY_OAUTH_TOKEN, SPOTIFY_USER_ID
class SpotifyAPI:
name = 'spotify'
@staticmethod
def __get_request_headers():
headers = SPOTIFY_HEADERS
headers["Authorizatio... | simbi0nts/local-music-to-Spotify-transfer | api/spotify.py | spotify.py | py | 2,218 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "config.const.SPOTIFY_HEADERS",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "config.tokens.SPOTIFY_OAUTH_TOKEN",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "config.const.SPOTIFY_URLS",
"line_number": 21,
"usage_type": "name"
},
... |
25650890509 | from django.urls import path
from repairshop import views
urlpatterns = [
path("", views.home, name="home"),
path("categories/<slug:sub_category>/", views.sub_category, name="sub_category"),
path("about/", views.about, name="about"),
path("categories/", views.categories, name="categories"),
path("... | bmyronov/eremont | repairshop/urls.py | urls.py | py | 441 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "repairshop.views.home",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "repairshop.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls... |
27821623666 | from flask import Flask, request
import json
from datetime import datetime
import requests
from lights import light
from constants import Tables, Params, PHUE
from sqlite import sqlite
app = Flask(__name__)
Light1 = light.Light(1)
Light2 = light.Light(3)
@app.route("/listener")
def generate_refresh_token():
c... | Shak-codes/Smart-Home-Routines | database/api/app.py | app.py | py | 2,648 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lights.light.Light",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lights.light",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lights.light.Light",
... |
39156041068 | # BFG Forge
# Based on Level Buddy by Matt Lucas
# https://matt-lucas.itch.io/level-buddy
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | jpcy/bfg_forge | core.py | core.py | py | 71,093 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "bpy.context",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
45184258436 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michael Liao (askxuefeng@gmail.com)'
DEPRECATED = True
from google.appengine.ext import db
DEFAULT_GROUP = 'default'
def get_instance_settings_as_dict(widget_instance):
'''
get widget instance settings as dict which contains key-value... | Albertnnn/express-me | src/widget/store.py | store.py | py | 1,446 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.db.delete",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 40,
"usage_type": "name"
}
] |
15956813860 | import os
import numpy as np
import pickle
import open3d as o3d
from absl import app
from absl import flags
flags.DEFINE_string('task', 'stack-block-pyramid', '')
flags.DEFINE_string('data_dir', './training_datasets/voxel_grids', '')
flags.DEFINE_string('data_source', './training_datasets/rgbd', '')
flags.DEFINE_integ... | tinwech/subgoal_success_detection | trans_rgbd_to_voxel.py | trans_rgbd_to_voxel.py | py | 5,622 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "absl.flags"... |
32107199860 | from zlib import adler32
from functools import wraps
from flask_restful import Resource as DefaultResurce, ResponseBase, OrderedDict, request, unpack, marshal
VALIDATION_ERROR_MESSAGE = 'Fields validation error'
class marshal_with(object):
"""A decorator that apply marshalling to the return values of your metho... | annacorobco/flask-formula | v01/dockerfiles/backend/app/libs/controllers.py | controllers.py | py | 4,630 | python | en | code | null | github-code | 1 | [
{
"api_name": "flask_restful.unpack",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "flask_restful.marshal",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "flask_restful.marshal",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "func... |
73948599075 | import pickle as pkl
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.ticker import FixedLocator, FixedFormatter
def log_histogram(data, name):
"""
Create ridgeline plots, where each individual plot is a
log-y scaled histogram.
data: 2D Numpy arr... | brohrer/scs-gallery | log_y_histograms.py | log_y_histograms.py | py | 3,565 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.maximum",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.floor"... |
37338983645 | import server
import os
import config
import time
import threading
class Chord:
def __init__(self):
self.qnt_key = None
self.qnt_nodes = None
self.cfg = config.Config()
self.host = self.cfg.getHost().strip("\n")
self.portaInicial = int(self.cfg.getMinPort().strip... | ruehara/SdPython | chord.py | chord.py | py | 2,378 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.Config",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 47,
"usage_type": "call"
}
] |
37117203904 | from flask import Flask, render_template, request
#import requests
import pickle
#import numpy as np
import sklearn
from sklearn.preprocessing import StandardScaler
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/',methods=['GET'])
def index():
return render_template('ind... | Swathikrishnatu/ibm-attrition--Final-project | web.py | web.py | py | 5,528 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Sta... |
34521429221 | import matplotlib.pyplot as plt
import seaborn as sns; sns.set() # for plot styling
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
from numpy import genfromtxt
#humm, encontre este codigo en un servidor remoto
#estaba junto con el "traffic.pcap"
# que podria ser?, like some sample code
... | p4-team/ctf | 2018-09-15-trendmicro/misc_constellation/proc.py | proc.py | py | 1,156 | python | en | code | 1,716 | github-code | 1 | [
{
"api_name": "seaborn.set",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.cm.Spe... |
33093318888 | import solution
class Solution(solution.Solution):
def solve(self, test_input=None):
logs, k = test_input
return self.findingUsersActiveMinutes([x[:] for x in logs], k)
def findingUsersActiveMinutes(self, logs, k):
"""
:type logs: List[List[int]]
:type k: int
:... | QuBenhao/LeetCode | problems/1817/solution.py | solution.py | py | 572 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "solution.Solution",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
}
] |
16074380398 | import tkinter as tk
from PIL import ImageTk, Image
class Caption:
""" """
text = ''
lastx = None
lasty = None
speech_bubble = 'imgs/spb-300x165.png'
thought_bubble = 'imgs/thought.png'
long_sample = ("I am the hope of the universe. I am the answer to all living things "
... | brianteachman/comic-dialog-builder | ui/caption.py | caption.py | py | 2,077 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
20581596447 | """
热力图
"""
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.globals import GeoType, ThemeType
from pyecharts.faker import Faker
import random, os
map = (
Geo(init_opts=opts.InitOpts(width="1000px", height="800px", renderer="canvas",
theme=Theme... | qugemingzizhemefeijin/python-study | ylspideraction/chapter15/_002charts_geo.py | _002charts_geo.py | py | 1,471 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyecharts.charts.Geo",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyecharts.options.InitOpts",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyecharts.options",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pye... |
32390876497 | from django.test import TestCase, Client
from shortener_url.models import Url
from rest_framework import status
import json
class TestShortenerUrl(TestCase):
def setUp(self):
Url.objects.create(original_url="https://web.whatsapp.com/", custom_alias="whatsapp", shortened_url="http://shortener/u/whatsapp")... | karolGuimaraes/hire.me | tests.py | tests.py | py | 2,457 | python | en | code | null | github-code | 1 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "shortener_url.models.Url.objects.create",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "shortener_url.models.Url.objects",
"line_number": 10,
"usage_type": "attribut... |
28925820348 | import requests
from bs4 import BeautifulSoup
def strip_string(string1):
for i in string1:
if i=='<':
var1 = string1[string1.index(i):string1.index(">")+1]
string1 = string1.replace(var1, "")
return string1
def scrape_meaning(a):
URL = f"https://www.dictionary.com/browse/{a}"... | priyanshusingh509/AashaEd | webscrape.py | webscrape.py | py | 1,199 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
37282786931 | from typing import List, Dict
from fastapi import WebSocket
from fastapi import HTTPException, status
from sqlalchemy import exc
from sqlalchemy.ext.asyncio import AsyncSession
from database.models.chat_models.chat_model import Chat
from database.models.chat_models.members_model import ChatMember
from database.model... | Whitev2/WebsocketChatExample | app/src/crud/chat_crud.py | chat_crud.py | py | 4,420 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "database.models.chat_models.chat_model.Chat",
"line_number": 24,
... |
9673124412 | import jc
from connectors.core.connector import get_logger, ConnectorError
from .constants import LOGGER_NAME
logger = get_logger(LOGGER_NAME)
def convert(config, params):
parser = params.get('parser')
cmd_output = params.get('command_output')
raw = params.get('raw', False)
if not parser or not cmd_... | fortinet-fortisoar/connector-json-convert | json-convert/convert.py | convert.py | py | 1,045 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "connectors.core.connector.get_logger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "constants.LOGGER_NAME",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "connectors.core.connector.ConnectorError",
"line_number": 15,
"usage_type": ... |
74418312994 | from __future__ import annotations
from typing import TypedDict
from movielog.reviews import serializer
from movielog.utils import export_tools, list_tools
from movielog.utils.logging import logger
StatGroup = TypedDict("StatGroup", {"reviewYear": str, "reviewsCreated": int})
def export() -> None: # noqa: WPS210
... | fshowalter/movielog | movielog/reviews/exports/review_stats.py | review_stats.py | py | 1,081 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.TypedDict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "movielog.utils.logging.logger.log",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "movielog.utils.logging.logger",
"line_number": 13,
"usage_type": "name"
},
{
"a... |
19076092035 | from __future__ import print_function, division # requires Python >= 2.6
# numpy and scipy imports
import numpy as np
import math
from scipy.sparse import kron, identity
from scipy.sparse.linalg import eigsh # Lanczos routine from ARPACK
from collections import namedtuple
####Initial parameter
#physical parameter
... | liuzhsunshine/tensor-network-practice | 3M-01-infinite-dmrg-1D-XXZ.py | 3M-01-infinite-dmrg-1D-XXZ.py | py | 4,911 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.log",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
23466392621 | #!/usr/bin/python3
from brownie import web3, Attack
from scripts.deploy import deploy
from scripts.helpful_scripts import get_account
from colorama import Fore
from time import time
# * colours
green = Fore.GREEN
red = Fore.RED
blue = Fore.BLUE
magenta = Fore.MAGENTA
reset = Fore.RESET
def print_colour(solved):
... | Aviksaikat/Blockchain-CTF-Solutions | capturetheether/lotteries/GuessTheNewNumber_DONE/scripts/hack.py | hack.py | py | 1,700 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "colorama.Fore.GREEN",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "colorama.... |
3259518810 | import art
import subprocess
clear = lambda: subprocess.call('cls||clear', shell=True)
print(art.logo)
list = []
def add_list(name,bid):
new_dic = {
"name": name,
"bid": bid
}
list.append(new_dic)
def declare_winner(list):
max_bid = 0
for dic in list:
if max_bid < int(di... | idris-bahce/Blind-Auction | Auction.py | Auction.py | py | 938 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "subprocess.call",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "art.logo",
"line_number": 6,
"usage_type": "attribute"
}
] |
8702134035 | import streamlit as st
import altair as alt
import inspect
from vega_datasets import data
@st.experimental_memo
def get_chart_99637(use_container_width: bool):
import altair as alt
from vega_datasets import data
airports = data.airports()
states = alt.topo_feature(data.us_10m.url, feature='states'... | streamlit/release-demos | 1.16.0/demo_app_altair/pages/115_Airports.py | 115_Airports.py | py | 1,260 | python | en | code | 78 | github-code | 1 | [
{
"api_name": "vega_datasets.data.airports",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vega_datasets.data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "altair.topo_feature",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ve... |
27401206260 | from __future__ import annotations
from typing import Literal, Optional
from cognite.client import data_modeling as dm
from pydantic import Field
from ._core import DomainModel, DomainModelApply, TypeList, TypeApplyList
__all__ = ["CogPool", "CogPoolApply", "CogPoolList", "CogPoolApplyList", "CogPoolFields", "CogPo... | cognitedata/pygen | examples-pydantic-v1/markets_pydantic_v1/client/data_classes/_cog_pool.py | _cog_pool.py | py | 3,336 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.Literal",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "_core.DomainModel",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
22508709753 | import math
from enum import Enum
from numbers import Number
from typing import Tuple
import torch
import torch.nn.functional as F
import torch.distributed as dist
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR
from accelerate import init_empty_weights
from transformers import (
AutoModelForCau... | microsoft/LMOps | minillm/minillm/utils.py | utils.py | py | 6,065 | python | en | code | 2,623 | github-code | 1 | [
{
"api_name": "transformers.ParallelOPTForCausalLM",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "transformers.ParallelGPT2LMHeadModel",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "transformers.ParallelGPTJForCausalLM",
"line_number": 25,
"usage... |
18259114828 | import json
import boto3
from datetime import datetime
# get ec2 metrics
def get_metric_ec2(namespace, metricname, client):
response = client.get_metric_statistics(
Namespace=namespace,
MetricName=metricname,
Dimensions=[
{
'Name': 'InstanceI... | BrunosBastos/ES_TDG | MetricsService/lambda_function.py | lambda_function.py | py | 2,499 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "datetime.da... |
73767645472 | import time
from datetime import datetime
from models.cancel_queue import CancelQueue
from models.last_updated_tracker import LastUpdatedTracker
from sqlalchemy import insert, update, select
from .get_orders import get_orders
from .get_orders_items import get_orders_items
from ... import my_logger, SP_EXCEPTIONS, pacif... | aman-saleem-qbatch/dagster-cloud-dev | ops/apis/helpers/orders_processor.py | orders_processor.py | py | 5,474 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "helpers.db_config.db_conn",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.