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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74209993502 | from __future__ import print_function
from builtins import map
from pdb import pm
from future.utils import viewitems
from miasm.core.utils import decode_hex
from miasm.analysis.machine import Machine
from miasm.analysis.binary import Container
from miasm.core.asmblock import AsmCFG, AsmConstraint, AsmBlock, \
Asm... | cea-sec/miasm | test/core/asmblock.py | asmblock.py | py | 12,823 | python | en | code | 3,204 | github-code | 7 | [
{
"api_name": "miasm.core.utils.decode_hex",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "miasm.core.locationdb.LocationDB",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "miasm.analysis.binary.Container.from_string",
"line_number": 20,
"usage_type... |
22756336529 | import os
import matplotlib.pyplot as plt
def plot_result(df, scenario_id):
plt.figure()
plt.title(f"Scenario {scenario_id}")
plt.plot(df.s0, label='not_infected')
plt.plot(df.s1, label="infected")
plt.plot(df.s2, label="recovered")
plt.plot(df.s3, label="dead")
plt.xlabel("Step")
plt... | ABM4ALL/ABMFrameworkComparison | source_mesa/analyzer.py | analyzer.py | py | 598 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matpl... |
31315959627 | import fractions
#Project Euler question 5
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
#gets the solution very slowly (brute force)
def pEQuestion5():
isDivisible = False
num = 2
while isDivisible is False:
for i in range(1,21):
i... | Kion-Smith/PracticeProblems | Project Euler/p5.py | p5.py | py | 1,013 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fractions.gcd",
"line_number": 35,
"usage_type": "call"
}
] |
28600606380 | from google.protobuf import message
from recipe_engine import recipe_api, recipe_test_api
from recipe_engine import util as recipe_util
from . import proto_codec
class ProtoOutputPlaceholder(recipe_util.OutputPlaceholder):
def __init__(self, api, msg_class, codec, add_json_log, name,
leak_to, decodi... | luci/recipes-py | recipe_modules/proto/api.py | api.py | py | 6,757 | python | en | code | 22 | github-code | 7 | [
{
"api_name": "recipe_engine.util.OutputPlaceholder",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "recipe_engine.util",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "google.protobuf.message.Message",
"line_number": 31,
"usage_type": "attribute"... |
25529557210 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013-present, Anoop Kunchukuttan
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
#Program to transliterate acronyms from one Latin script to Indic languages ... | anoopkunchukuttan/indic_nlp_library | indicnlp/transliterate/acronym_transliterator.py | acronym_transliterator.py | py | 2,337 | python | en | code | 505 | github-code | 7 | [
{
"api_name": "indicnlp.transliterate.unicode_transliterate.UnicodeIndicTransliterator.transliterate",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "indicnlp.transliterate.unicode_transliterate.UnicodeIndicTransliterator",
"line_number": 60,
"usage_type": "name"
},
{
... |
14142171046 | import discord
import os
import random
import youtube_module
import pyshorteners as sh
import harvester
import insta_follower
from django.core.validators import URLValidator
from dotenv import load_dotenv
from discord.ext.commands import Bot
from discord.ext import commands
load_dotenv()
TOKEN = os.getenv("DISCORD_TOK... | samuelarjasbi/Discord-bot | Main.py | Main.py | py | 2,216 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.core.validators.URLVali... |
21874802069 | import torch
import numpy as np
import time
from THHyperIBLT import THHyperIBLT
from fedIBLT import HyperIBLT
def _get_prime(n: int):
def _is_prime(x):
for i in range(2, int(np.sqrt(x)) + 1):
if x % i == 0:
return False
return True
while not _is_prime(n):
... | ZiruiOu/FedIBLT | test.py | test.py | py | 1,981 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.randn",
... |
7610945199 | from collections import deque
d = deque()
for i in range(int(input())):
s = input().split()
if s[0] == 'append':
d.append(s[1])
elif s[0] == 'appendleft':
d.appendleft(s[1])
elif s[0] == 'pop':
d.pop()
elif s[0] == 'popleft':
d.popleft()
for j in d:
print(j,end=... | H-Shen/Collection_of_my_coding_practice | Hackerrank/Python/Collections_deque.py3 | Collections_deque.py3 | py3 | 325 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 3,
"usage_type": "call"
}
] |
8295854172 | from django.urls import path, include
from . import views
from rest_framework import routers
app_name = 'blog'
router = routers.DefaultRouter()
router.register('post', views.PostViewSet)
router.register('category', views.PostCategoryViewSet)
router.register('author', views.AuthorViewSet)
urlpatterns = [
path('',... | AlekseiChirkov/neolabs | apps/blog/urls.py | urls.py | py | 345 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_na... |
1003132364 | import sys
import time
import subprocess
import progressbar
BAR = progressbar.ProgressBar(max_value=progressbar.UnknownLength, redirect_stdout=False)
def usage():
message = "Usage: " \
+ sys.argv[0] \
+ " radius_users_file radius_ip radius_port radius_secret" \
+ "radius... | JulieDaligaud/Radius_check_migration | src/radius_check_migration.py | radius_check_migration.py | py | 6,916 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "progressbar.ProgressBar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "progressbar.UnknownLength",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sy... |
108895661 | import turtle
from PIL import Image
from turtle import Screen, Turtle
import cv2
polygon = Turtle()
forw = .001
turt = turtle. Turtle(visible=False)
turt.pencolor((0, 0, 100))
turt.pensize(.1)
turt.speed(0)
screen = turtle.Screen()
screen.bgcolor('black')
# turt.begin_fill()
# time.sleep(5)
# turtle.done()
while Tr... | Shaxpy/Computer-Vision | Dynamic_image_js/turt.py | turt.py | py | 606 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "turtle.Turtle",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "turtle.Turtle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "turtle.Screen",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
72870478622 | from metric.recall_at_k import RecallAtK
from dataloader.mamo_dataset import MamoDataset
from validator import Validator
from torch.utils.data import DataLoader
from tests.integration.mocks.mock_models import MockAllZeros
from tests.integration.mocks.mock_models import MockNoChange
from tests.integration.mocks.mock_mod... | Ascend/ModelZoo-PyTorch | PyTorch/dev/others/Multi-Gradient_Descent_ID0349_for_PyTorch/tests/integration/test_integration_validator.py | test_integration_validator.py | py | 4,265 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dataloader.mamo_dataset.MamoDataset",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 33,
"usage_type": "call"
},
{
"api_n... |
23438908038 | import os
import validator
import datetime
time = datetime.datetime.now()
data_path = 'C:/Users/Niki/Documents/Programming Projects/Data/user_record/'
auth_path = 'C:/Users/Niki/Documents/Programming Projects/Data/auth_session/'
def create(accountNumber, first_name, last_name, email, password):
user_da... | nikziondr/nikziondr | Database.py | Database.py | py | 3,886 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
24561264807 | import pytest
from langchain_community.document_loaders.confluence import ConfluenceLoader
try:
from atlassian import Confluence # noqa: F401
confluence_installed = True
except ImportError:
confluence_installed = False
@pytest.mark.skipif(not confluence_installed, reason="Atlassian package not install... | langchain-ai/langchain | libs/community/tests/integration_tests/document_loaders/test_confluence.py | test_confluence.py | py | 1,919 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain_community.document_loaders.confluence.ConfluenceLoader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.mark.skipif",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 13,
"usage_type": "attri... |
13079551261 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/25 9:24
# @Author : Jun
# @Site :
# @File : urls.py
# @Software: PyCharm
from django.urls import path
from . import views
app_name = 'user'
urlpatterns = [
path('loginPage',views.loginPage,name = 'loginPage'), #登录页面
path('loginLo... | nebulae1987/spiderteam-web | user_app/urls.py | urls.py | py | 1,028 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
6725978239 | import os
import pandas as pd
import numpy as np
import warnings
warnings.filterwarnings('ignore')
import math
import matplotlib
#指定默认字体
matplotlib.rcParams['font.sans-serif'] = ['SimHei']
matplotlib.rcParams['font.family']='sans-serif' #解决负号'-'显示为方块的问题
matplotlib.rcParams['axes.unicode_minus'] = False
class backtest... | ECNU-CILAB/AStock_dataset | backtest/backtest.py | backtest.py | py | 8,504 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name"... |
15895674598 | from django.urls import path, include
from .views import EventDelete
from . import views
urlpatterns = [
path('events/', views.eventList, name='events'),
path('event-detail/<int:pk>', views.eventPage, name='event-detail'),
path('event-create/', views.createEvent, name='event-create'),
path('event-delet... | TeamSpartansSheBuild/smallbusinesses | FierceLadies/events/urls.py | urls.py | py | 537 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.eventList",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "views.eventPage",... |
2785453791 | import torch
import torch.nn.functional as F
import torch.nn as nn
def metric_rmse(output,label):
# this is our MSE loss function
return torch.sqrt(torch.mean(torch.square(torch.sub(output,label)))) #MSE as loss
# Write a method called `train_one_epoch` that runs one step using the optimizer.
def train_one_... | mehulfollytobevice/Galaxy-Morphology-Classification | code/trainer.py | trainer.py | py | 2,158 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.sqrt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.mean",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.square",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.sub",
"line_number": 7,
... |
35764565895 | from google.appengine.ext.webapp import template
import webapp2
import os
from google.appengine.ext import ndb
import json
class DemoDayVisitor(ndb.Model):
email = ndb.StringProperty(indexed=True, required=True)
company = ndb.StringProperty(indexed=True)
def to_dict(self):
return {
'email': self... | HunterLarco/venom-website | default/app.py | app.py | py | 1,989 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 10,
"usage_type": "ca... |
14595616429 | import argparse
import json
import os
from collections import Counter
import numpy as np
from pandas.io.json import to_json
from sklearn.cluster import DBSCAN
from utils.dataset_utils import get_train_list, get_test_list
from utils.graph_similarity_utils import convert_graph_to_vector, get_feature_vector
from utils.g... | hungpthanh/oep-detection-based-on-graph-similarity | clustering_mixed_packer.py | clustering_mixed_packer.py | py | 9,792 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.dataset_utils.get_train_list",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "utils.dataset_utils.get_test_list",
"line_number": 26,
"usage_type": "call"
... |
177248617 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 13 10:14:29 2023
@author: patricksweeney
"""
#%% Import
def import_data():
import pandas as pd
file_path = '/Users/patricksweeney/growth/02_Pricing/06_Migration/Migration.xlsx'
data = pd.read_excel(file_path)
return data
data = im... | patricesweeney/growth | 02_Pricing/06_Migration/Migration_Product.py | Migration_Product.py | py | 33,974 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_excel",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.to_numeric",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
40916098877 | # This code is for experimental purpose.
# DO NOT USE THIS IN PRODUCTION.
# pylint: disable=C0103
import sys
import math
from Crypto.Util import number
def xy_to_zw(mo: int, point: tuple[int, int]) -> tuple[int, int]:
(x, y) = point
w = number.inverse(-y, mo)
z = x * w % mo
return (z, w)
class ECZW:
... | koba-e964/code-reading | algorithm/smart-attack/smart_attack.py | smart_attack.py | py | 6,653 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "Crypto.Util.number.inverse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Crypto.Util.number",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Crypto.Util.number.inverse",
"line_number": 77,
"usage_type": "call"
},
{
"api_name... |
37193606879 | from collections import Iterable
class WavFile:
def __init__(self, name, rate, data):
self.name = name
self.rate = rate
self.frames = len(data)
self.data = data
if isinstance(data[0], Iterable):
self.channels = len(data[0])
else:
self.channel... | LeonJelsma/BirdSongFiltering | src/wavfile.py | wavfile.py | py | 326 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.Iterable",
"line_number": 10,
"usage_type": "argument"
}
] |
24107649959 | # ###############################################################
# #
# Dean Johnson #
# ECE351 #
# Lab 3 ... | CDJohnson279/ECE351_Code | Johnson_Dean_ECE351_Lab3.py | Johnson_Dean_ECE351_Lab3.py | py | 4,724 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number... |
14624310512 | # import required libraries
import spacy
# load the language model
nlp = spacy.load('en_core_web_md')
# example description to be used for testing the function instead of the user input
example ="""Will he save their world or destroy it? When the Hulk becomes too dangerous for the
Earth, the Illuminati trick Hulk in... | radu-a1091/SpaCy-Movie-Recommendation | watch_next.py | watch_next.py | py | 2,059 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "spacy.load",
"line_number": 5,
"usage_type": "call"
}
] |
20948105137 | import serial
from serial import SerialException
import time
import datetime
import io
import psycopg2
import threading
import os
import aiocoap.resource as resource
import aiocoap
import asyncio
import logging
import rest
conn = psycopg2.connect(dbname="postgres", user="postgres", password=os.environ["POSTGRES_PASS"]... | knock-in/roody | roody_backend/app.py | app.py | py | 3,765 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "psycopg2.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "threading.Thre... |
1688436759 | #!/usr/bin/env pypy3
from collections import namedtuple
OUTPUTS = []
class Halt(Exception):
pass
class IllegalOperationError(Exception):
pass
def op_add(prog, pc, modes):
prog[prog[pc + 3]] = mem_read(prog, pc + 1, modes[0]) + mem_read(prog, pc + 2, modes[1])
return pc + 4
def op_mult(prog, pc... | cnorthwood/adventofcode | 2019/05/challenge.py | challenge.py | py | 3,070 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 63,
"usage_type": "call"
}
] |
70610977183 | import json
import hashlib
import requests
class api:
id = None
secret = None
service = None
path = None
def __init__(self, api_name):
with open('config/api.json') as json_file:
data = json.load(json_file)[api_name]
self.id = data['id']
self.secret = da... | speisekatze/atroweb | cp/api.py | api.py | py | 1,202 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 40,... |
40065709269 | #
# 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 option) any later version.
#
# This program is distributed in the hope that it will be useful,
# ... | user-cont/colin | colin/core/result.py | result.py | py | 7,494 | python | en | code | 52 | github-code | 7 | [
{
"api_name": "constant.PASSED",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "constant.FAILED",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "utils.caching_iterable.CachingIterable",
"line_number": 59,
"usage_type": "call"
},
{
"api_name":... |
29638300773 | #!/usr/local/bin/python
#-*- coding:utf8 -*-
#http://docs.python.org/library/operator.html
def div(x, y):
return x / y
def main():
x = 6
import pdb; pdb.set_trace()
for i in [3, 2, 1, 0]:
x = div(x, i)
return x
if __name__ == '__main__':
main()
#python -m pdb pdbtest.py
#step s ... | tell-k/code-snippets | python/snippets/pdbtest.py | pdbtest.py | py | 811 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "pdb.set_trace",
"line_number": 11,
"usage_type": "call"
}
] |
24603790929 | import cv2
import matplotlib.pyplot as plt
import numpy as np
from keras import Sequential
from keras.layers import AveragePooling2D, BatchNormalization, ZeroPadding2D, Dense, Dropout, Conv2D, MaxPooling2D, \
Flatten
model = Sequential()
# input: 100x100 images with 3 channels -> (100, 100, 3) tensors.
# this appl... | hequn/keras-transfer-learning | tools/keras_layers_kernals_visualization.py | keras_layers_kernals_visualization.py | py | 4,933 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "keras.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "keras.layers.ZeroPadding2D",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.... |
39740332245 | import datetime
import io
import logging
import sys
import aiogram.types
import pytz
from create import web_dav_client, bot, upload_chat_id
import project.projects as projects
import asyncio
from io import BytesIO, BufferedReader
async def add_dir(dir_name):
try:
loop = asyncio.get_event_loop()
await loop.run_... | koshakkkq/pool_bot_public | project/web_dav_projects.py | web_dav_projects.py | py | 2,462 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "create.web_dav_client.mkdir",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "create.web_dav_client",
"line_number": 18,
"usage_type": "name"
},
{
"api... |
29714570439 | from flask import (
Blueprint, request, g, redirect, url_for, flash, render_template, session
)
from werkzeug.exceptions import abort
from app.db import get_db
from app.util import get_item_by_id, generate_bill, pay_bill, save_message
bp = Blueprint('cart', __name__)
@bp.route('/view_cart')
def view_cart():
i... | dankoff/droms | app/cart.py | cart.py | py | 5,559 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.g.user",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.session.get",
"lin... |
17612970446 | import requests
import tensorflow as tf
from google.cloud import storage
import numpy as np
import pandas as pd
import os
import glob
from sklearn.compose import make_column_transformer
from sklearn.preprocessing import MinMaxScaler, OneHotEncoder
from sklearn.model_selection import train_test_split
de... | B21-CAP0134/cloud-function-deployment | main.py | main.py | py | 2,940 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "requests.get_json",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "google.cloud.storage.Client",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "google.clou... |
35415094601 | # -*- coding: utf-8 -*-
'''
Created on 3/5/2015
@author: abrahan
'''
from py.una.pol.tava.model.mboxplot import BoxPlotModel as bpm
class BoxPlotFilterPresenter:
def __init__(self, iview, test):
self.iview = iview
self.test = test
self.InitUI()
def InitUI(self):
# inicializ... | abrahanfretes/tava_antes | py/una/pol/tava/presenter/pboxplot/pfilterboxplot.py | pfilterboxplot.py | py | 2,941 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "py.una.pol.tava.model.mboxplot.BoxPlotModel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "py.una.pol.tava.model.mboxplot.BoxPlotModel",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "py.una.pol.tava.model.mboxplot.BoxPlotModel",
"line_n... |
72575243424 | #!/usr/bin/env python
"""
Created on Thu Dec 3 13:40:51 2020
@author: andrei
"""
import numpy as np
import os
import time
from multiprocessing import Pool
import step_length_moduled
from jobs_module import job_submitted
from read_write_module import read_srf_source, read_stat_name, write_par_source_i
def mkdir_p(dir... | Andrei1412/Emod3d_FWI | Master_INV_pool_moduled.py | Master_INV_pool_moduled.py | py | 8,715 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 2... |
36314348152 | import requests
import re
import random
import configparser
from bs4 import BeautifulSoup
from flask import Flask, request, abort
from imgurpython import ImgurClient
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import *
app = F... | twtrubiks/line-bot-tutorial | app.py | app.py | py | 22,604 | python | en | code | 287 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "linebot.LineBotApi",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "linebot.Webh... |
16972000086 | import os
import time
import logging
import random
import numpy as np
import tensorflow as tf
import math
from tensorflow.python.ops import variable_scope as vs
from matplotlib import pyplot as plt
from nets_classification import *
class DistrSystem(object):
def __init__(self, FLAGS, labels, institutions):
logging.... | jinguluninja/distHeterogeneity | model.py | model.py | py | 10,657 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
72900505822 | """
https://leetcode.com/problems/course-schedule/
"""
from typing import List
from collections import deque, defaultdict
class Solution:
def canFinish(
self, numCourses: int, prerequisites: List[List[int]]) -> bool:
"""
Use BFS to perform topological sort.
"""
todo, ... | eronekogin/leetcode | 2020/course_schedule.py | course_schedule.py | py | 959 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
}
] |
72869100062 | import torch
import numpy as np
from torchvision import datasets, transforms
from base import BaseDataLoader
class MnistDataLoader(BaseDataLoader):
"""
MNIST data loading demo using BaseDataLoader
"""
def __init__(self, config):
super(MnistDataLoader, self).__init__(config)
self.data_d... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/MTCNN_ID0435_for_PyTorch/data_loader/data_loaders.py | data_loaders.py | py | 1,513 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "base.BaseDataLoader",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.utils",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch... |
72850812062 | import os
import time
import torch
from tqdm import tqdm
from experiment import Experiment
from data.data_loader import DistributedSampler
from apex import amp
from torch_npu.utils.profiler import Profile
def seed_everything(seed):
os.environ['PYTHONHASHSEED'] = str(seed)
torch.manual_seed(seed)
torch.cu... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/cv/detection/DB_ID0706_for_PyTorch/trainer.py | trainer.py | py | 9,734 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",... |
45158118528 | #!/usr/bin/env pypy3
import re
import sys
import time
from typing import List, Match, Optional
from copy import copy, deepcopy
from collections import defaultdict
from itertools import repeat
from functools import partial
from advent import sirange, srange, nddict
import pprint
import math
if type(__builtins__) is not... | Princemachiavelli/advent-of-code | 2021/06.py | 06.py | py | 3,139 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "re.fullmatch",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
... |
7867041325 | import requests
from os import listdir
class YaUploader:
def __init__(self, token: str):
self.token = token
def get_headers(self):
return {
'Authorization': f'OAuth {self.token}'
}
def _get_upload_url(self, file_path):
upload_url = "https://cloud-api.yandex.ne... | Alsemva/HW-requests | Task#2.py | Task#2.py | py | 1,566 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 43,
"usage_type": "call"
}
] |
43355684033 | import numpy as np
import cv2
from matplotlib import pyplot as plt
## File path
## os.chdir("C:/Users/Sebastian/Documents/GitHub/Computer-Vision-and-Pattern-Recognition_Lab-Assignments/A0101856J_SebastianWong_Lab2/pic/pic")
# read an image in greyscale
img = cv2.imread("pic1.jpg", cv2.CV_LOAD_IMAGE_GRAYSCALE)
# Compu... | sebastian-wong/Computer-Vision-and-Pattern-Recognition_Lab-Assignments | A0101856J_SebastianWong_Lab2/Notes/Practice.py | Practice.py | py | 1,381 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.CV_LOAD_IMAGE_GRAYSCALE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.histogram",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
14282925358 | # 残差网络(ResNet)
# 适用于粒子分辨 train_type=particle
import torch
import torch.nn as nn
from torch.nn import functional as F
class Residual(nn.Module):
def __init__(self,input_channels,num_channels,use_1x1conv=False,strides=1):
super().__init__()
self.conv1 = nn.Conv2d(input_channels, num_channels, kernel... | caihao/gpLearn | model/ResNet_old.py | ResNet_old.py | py | 3,094 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
42642430678 | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..models.codat_assess_data_contracts_financials_metrics_metric_data_set_error_type import (
CodatAssessDataContractsFinancialsMetricsMetricDataSetErrorType,
)
from ..types import UNSET, Unset
T = TypeVar("T", bound="CodatAssessDataContractsFinan... | levrofin/levro-codat | codat_api_client/models/codat_assess_data_contracts_financials_metrics_metric_data_set_error.py | codat_assess_data_contracts_financials_metrics_metric_data_set_error.py | py | 1,877 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "models.codat_assess_data_cont... |
407047249 | import time
import requests
from HTMLParser import HTMLParser
from collectors.lib.collectorbase import CollectorBase
SPARK_STANDALONE_MODE = 'spark_standalone_mode'
SPARK_YARN_MODE = 'spark_yarn_mode'
SPARK_MESOS_MODE = 'spark_mesos_mode'
REST_API = {
"YARN_APPS_PATH": "ws/v1/cluster/apps",
"SPARK_APPS_PATH":... | sxc562586657/tcollector | collectors/builtin/spark.py | spark.py | py | 13,982 | python | en | code | null | github-code | 7 | [
{
"api_name": "collectors.lib.collectorbase.CollectorBase",
"line_number": 156,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 172,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "tim... |
16480421270 | import pandas as pd
import streamlit as st
import numpy as np
st.title('Q-Week Results')
df = pd.read_csv('https://docs.google.com/spreadsheets/d/1UCrSZrIX45MlKz6EQfEVJ-9dHjLw7xeTpg77lujknEw/export?format=csv&gid=1779447167')
df = df[[col for col in df.columns if 'Unnamed' not in col and col != '1']]
df = ... | sauhaardac/Q-Week-Tracker | app.py | app.py | py | 2,717 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.title",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.multiselect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame"... |
2554541435 | # %%
from __future__ import annotations
from pathlib import Path
from typing import Any
import geopandas as gpd
import topojson as tp
from traffic.data import aixm_airspaces
import numpy as np
import pandas as pd
from shapely.geometry import Polygon, mapping, shape
from shapely.ops import transform, unary_union
# %... | xoolive/traffic | scripts/export_worldfirs.py | export_worldfirs.py | py | 4,435 | python | en | code | 325 | github-code | 7 | [
{
"api_name": "traffic.data.aixm_airspaces.data",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "traffic.data.aixm_airspaces",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "traffic.data.aixm_airspaces.data",
"line_number": 19,
"usage_type": "at... |
7320694199 |
import requests
from bs4 import BeautifulSoup
import studente
import mioTelegram
from ischedule import schedule, run_loop
import sys
URLS = ["https://docs.google.com/spreadsheets/d/e/2PACX-1vSxa-l5fqDBv5hOuNQ5q0kW19YOpPHAMe-kITWnBR567PIBhYkklOzpbjz-td77hY-jBw5_KGyz1fX7/pubhtml?gid=6878166&&range=A1:H&widget=false&chr... | fmanto01/gostudentadvisor | src/main.py | main.py | py | 3,106 | python | it | code | 0 | github-code | 7 | [
{
"api_name": "studente.student",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "mioTelegram.inviaMessaggio",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "bs4.Beautifu... |
21873882032 | # 0815.py
import cv2
import numpy as np
#1
src = cv2.imread('./data/hand.jpg')
hsv = cv2.cvtColor(src, cv2.COLOR_BGR2HSV)
lowerb = (0, 40, 0)
upperb = (20, 180, 255)
bImage = cv2.inRange(hsv, lowerb, upperb)
mode = cv2.RETR_EXTERNAL
method = cv2.CHAIN_APPROX_SIMPLE
image, contours, hierarchy = cv2.findContours(bIma... | leekyungjin333/LinuxGUIex | opencv_python/0815.py | 0815.py | py | 1,293 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.inRange",
"line_n... |
13434337960 | import sys
from PyQt5 import QtWidgets, Qt
import tweepy
import pyperclip
from search_util import initalize, strip_id
from target_list import target_list
class MainLayout(QtWidgets.QWidget):
def __init__(self, parent=None):
# setup
super().__init__(parent=parent)
layout = QtWidgets.QVBoxLa... | kuma127/gbf-twi | pyqt_rescue.py | pyqt_rescue.py | py | 1,953 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QVBoxLayout",
"line_number": 13,
"usage_type": "call"
},
{
"api_name":... |
38195817489 | '''This program create a suitable timeseries data for calculating cross-correlation(xcorr() function in matplotlib)
and plots Window lag cross correlation on heat map'''
def WTLC_plot(file_x,file_y):
from netCDF4 import Dataset as nc
from WTLC_Correlation import WTLC_Corr
import numpy as np
import pan... | dislu/oceanography | time-series-analysis/WTCorr_e.py | WTCorr_e.py | py | 1,568 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"li... |
41065084471 | import json
import pandas as pd
import os
import sys
from urllib.parse import urlparse
def save2csv(con_list, fname):
pf = pd.DataFrame(con_list,
columns=["ID", "URL", "Port", "IPs", "Title", "Status", "Banner", "Host", "Type", "Other"])
pf.to_csv(fname, index=False, encoding="utf-8")
... | YzaSoLong/pentest_toolkit | aquatone/aq_json_parse.py | aq_json_parse.py | py | 1,949 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line... |
2093973086 | """Prometheus middleware."""
import time
from typing import Tuple
from opentelemetry import trace
from prometheus_client import Counter, Gauge, Histogram
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request
from starlette.responses import Response
fr... | AlanLatte/Python | app/internal/pkg/middlewares/prometheus.py | prometheus.py | py | 4,819 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "starlette.middleware.base.BaseHTTPMiddleware",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "app.internal.pkg.middlewares.handle_http_exceptions",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "app.pkg.models.types.fastapi.FastAPITypes.FastAP... |
23873668527 | #-*-coding:utf-8-*-
import pytest
from apis.calc import Calc
class TestCalc:
def setup(self):
self.calc = Calc()
@pytest.mark.parametrize("a,b,expected", [
(5, 5, 10),
(-1, 0, -1),
(0.5, 0.1, 0.6),
(123456, 9455, 222222),
("a", 1, 'can only concatenate str (not ... | JicaiFan/Tencent12proTesting | testing/test_calc.py | test_calc.py | py | 1,597 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "apis.calc.Calc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
... |
73714144863 | """
A simple Python script to send messages to a sever over Bluetooth
using PyBluez (with Python 2).
"""
import bluetooth
import random
import time
import smbus
bus = smbus.SMBus(1)
ADC_ADDRESS = 0x4b
serverMACAddress = 'D8:3A:DD:3C:D9:91'
port = 4
s = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
s.connect((serverMA... | Abudoo99/Pulse-Monitoring-System | sender.py | sender.py | py | 519 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "smbus.SMBus",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bluetooth.BluetoothSocket",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bluetooth.RFCOMM",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.slee... |
10210370210 | """
This file defines the LIF class along with associated functionality.
"""
from typing import List, NamedTuple
import numpy as np
class LIFParams(NamedTuple):
dt: float = 0.05 # msec
c_m: float = 58.72 # pF
g_l: float = 9.43 # 1/GOhm (nS)
v_l: float = -78.85 # mV
v_th: float = -51.68 # mV
... | chloewin/lif-variability | core/lif.py | lif.py | py | 2,139 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.NamedTuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
... |
28869687071 | """
This module provides classes for working with expectation values.
The relevant classes are:
* :class:`ExpectationValueTrajectory`
* :class:`ExpectationValueCollection`
The :class:`ExpectationValueTrajectory` stores **one** expectation value at
different points of time while the :class:`ExpectationValueCol... | vukics/cppqed | cpypyqed/tools/expvalues.py | expvalues.py | py | 4,826 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "numpy.ndarray",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
... |
24483410731 | import unittest2 as unittest
from scrapers import *
class TestCBScraper(unittest.TestCase):
def setUp(self):
self.scraper = MockCBScraper()
def test_topvcs_pickled_correctly(self):
self.scraper.pickle_grams()
top_vcs = None
with open(os.path.join(os.path.dirname(__file__), \
... | wigginslab/vc-matcher | tests/test_crunchbase_scraper.py | test_crunchbase_scraper.py | py | 1,054 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "unittest2.TestCase",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "unittest2.main",
"line_number": 31,
"usage_type": "call"
}
] |
40310743964 | # pylint: disable=broad-except
"""Update Company"""
import time
from flask import request
from library.common import Common
from library.postgresql_queries import PostgreSQL
from library.couch_database import CouchDatabase
from library.couch_queries import Queries
from library.log import Log
class UpdateC... | gbf-labs/rh-api | controllers/company/update_company.py | update_company.py | py | 9,526 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "library.common.Common",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "library.postgresql_queries.PostgreSQL",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "library.couch_database.CouchDatabase",
"line_number": 19,
"usage_type": "call... |
41706437106 | import argparse
from pathlib import Path
import names.tools.train
import names.tools.predict
parser = argparse.ArgumentParser(prog="names")
subcmd = parser.add_subparsers(dest="command")
subcmd.required = True
Formatter = argparse.ArgumentDefaultsHelpFormatter
train = subcmd.add_parser("train", help="Train model",... | sowmyay/us_names | names/tools/__main__.py | __main__.py | py | 1,928 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"a... |
31264860478 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import psycopg2
import sys
import csv
with open('books.csv') as csvfile:
reader = csv.DictReader(csvfile)
con = None
try:
con = psycopg2.connect("host='ec2-54-204-18-53.compute-1.amazonaws.com' dbname='d76ovoqurvj86c' user='etuzviajytaszz' password='2f9b8... | Valeriy08/lecture0 | project1/import.py | import.py | py | 1,063 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "csv.DictReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "psycopg2.DatabaseError",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",... |
3327303176 | import re
import time
import redis
import uvloop
import asyncio
from blinker import signal
from collections import deque
from elasticsearch.helpers import bulk
from elasticsearch import Elasticsearch
from concurrent.futures import ThreadPoolExecutor
from utils import log
from config import QUEUE_MAX
from config impor... | hugoren/socket_uvloop | service_tcp_handler.py | service_tcp_handler.py | py | 3,488 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "blinker.signal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line... |
37272988776 | from nltk.corpus import wordnet as wn
from nltk.corpus import wordnet_ic
from decimal import Decimal
class Compare:
def __init__(self, file1, file2):
#Initialized using file names (String Format)
self.file1 = file1
self.file2 = file2
def compare(self):
f = open(self.file1, 'r')... | sumukhshiv/nltk-wordnet | file_comparison.py | file_comparison.py | py | 2,676 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nltk.corpus.wordnet_ic.ic",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet_ic",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.wordnet_ic.ic",
"line_number": 21,
"usage_type": "call"
},
{
"api_na... |
32623818794 | from flask import Flask, render_template, redirect, request
import mysql.connector
app = Flask(__name__)
## CONNECTION TO MYSQL
# app.config['MYSQL_HOST'] = 'localhost'
# app.config['MYSQL_USER'] = 'root'
# app.config['MYSQL_PASSWORD'] = 'zany'
# app.config['MYSQL_DB'] = 'movie'
# app.config['MYSQL_CURSORCLASS'] = 'D... | sujan-kharel/Movie-Ticket-Management | main.py | main.py | py | 6,005 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_n... |
15803566308 | import time
import netaddr
import logging
from threading import Thread
from web_service import ws_event
from ryu.lib import ofctl_v1_3
from ryu.lib.dpid import dpid_to_str
from ryu.ofproto import ether
from base.parameters import BusinessType, DefaultBusinessType
from base.parameters import server_tcp_port, ROUTE_TAS... | BokalaQuan/SD-Route | route_manage/route_task.py | route_task.py | py | 29,465 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "base.paramete... |
15349168820 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 8 16:24:16 2018
@author: Amit Jaiswal @ Elekta Oy (Helsinki)
=============================================>>
Master code for Source localization for Multimodal data (Vectorview system at BioMag)
datadir= /data/beamformer_data/Beamformer_share/mult... | neurosignal/beamformer_work | EN_SL_multimodal_data_Biomag_Vectorview.py | EN_SL_multimodal_data_Biomag_Vectorview.py | py | 79,357 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "mne.set_log_level",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "warnings.... |
14195597285 | # from pudb import set_trace; set_trace()
from typing import List
from functools import lru_cache
import math
class Solution1:
def get_possible_vals_from_last_row(self, grid):
"""Get all possible values from any pair of elements in the last row"""
col_n = len(grid[0])
row_idx = len(grid) -... | FanchenBao/leetcode | 2020_12_challenge/12_19_2020.py | 12_19_2020.py | py | 6,241 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 78,
"usage_type": "name"
},
{
"api_name": "math.inf",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_name": "functools.lru_cache",
"line... |
41986500931 | import json
from http import HTTPStatus
import requests
import secrets_app
def _get_country_page(content):
return int(content['postback']['payload'].split('_')[-1])
def _write_message(payload, message):
payload['message'] = message
def _get_timezone(countryCode):
req_point = 'http://localhost:8000/a... | ArtemisDicoTiar/covid_data_blog | covid_api_django/Apps/FacebookChat/scenarios/scenario_action.py | scenario_action.py | py | 1,555 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "secrets_app.FACEBOOK_CHAT_ACCESS_TOKEN",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": ... |
4229951506 | from base64 import encode
from fastapi import FastAPI, Depends, HTTPException, Request, Response, status
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
from utils.Auth import UserAuth
from utils.helper import generate_hash_from, generate_jwt
from core.database import DB_OPS
from u... | ajit1411/fast-api | app.py | app.py | py | 7,883 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "core.models.Base.metadata.create_all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "core.models.Base",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "core.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name":... |
30603706896 | import os
import numpy as np
import paddle.fluid as fluid
from ..model import ModelBase
from . import resnet_video
from .nonlocal_utils import load_params_from_file
import logging
logger = logging.getLogger(__name__)
__all__ = ["NonLocal"]
# To add new models, import them, add them to this map and models/TARGETS
... | PaddleToturial-v2/DeepLearningAndPaddleTutorial-v2 | lesson8/Non-local/nonlocal_model.py | nonlocal_model.py | py | 3,429 | python | en | code | 23 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "paddle.fluid.layers.mean",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "paddle.fluid.layers",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "p... |
22195363990 | from tensorflow.examples.tutorials.mnist import input_data
import model_helper
import tensorflow as tf
import vae_model
import numpy as np
import scipy
import random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def plot_images(outputs, xs, hparams, output_infer):
for i in r... | efikarra/vae | inference.py | inference.py | py | 2,772 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.misc.imsave",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.misc",
"line_... |
74343771742 | import scrapy
from scrapy.loader import ItemLoader
from itemloaders.processors import TakeFirst
from datetime import datetime
from banquethaler.items import Article
class BanquethalerSpider(scrapy.Spider):
name = 'banquethaler'
start_urls = ['http://www.banquethaler.ch/investment-letters']
def parse(self... | daniel-kanchev/banquethaler | banquethaler/spiders/banquethaler.py | banquethaler.py | py | 1,238 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scrapy.loader.ItemLoader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "banquethaler.items.Article",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": ... |
11252683340 | import tkinter as tk
from tkinter import ttk
import serial
from serial.tools import list_ports
root = tk.Tk()
msg = tk.StringVar()
def greet():
print(msg.get())
serial.Serial()
def main():
root.title("Autodrone Configurator")
# frames
mainframe = tk.Frame(root)
mainframe.pack()
tk.E... | jpwolfe9912/Autodrone-Configurator | demo.py | demo.py | py | 738 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_nu... |
34753241715 | import gst_streamer as gs
import cv2
#import time
indices =[0,-1,-1]
#manager = gs.Manager(indexes)
#manager.start()
peg = gs.Streamer(indices[0])
while 1:
peg.stream()
frame = peg.frame
cv2.imshow("peg", frame)
cv2.waitKey(1)
| Team1559/IMP | imp/streamTest.py | streamTest.py | py | 247 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gst_streamer.Streamer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 16,
"usage_type": "call"
}
] |
71894122463 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
from setuptools import setup, find_packages
name = 'log'
package = 'log'
description = 'because you deserve better than log4j'
url = 'https://github.com/vforgione/log'
author = 'Vince Forgione'
author_email = 'vince.4gione@icloud.com'
licen... | KarrLab/log | setup.py | setup.py | py | 1,767 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.version_info",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line... |
43461557200 | from pymongo import MongoClient
from time import strftime
import re
from django.http import JsonResponse
from pandas import Series
def main(mydb):
'''
获取各种类型下的邮件
'''
time_list = []
myThemeRiver = mydb.theme_river
myInnerCollection = mydb.inner_email
myOuterCollection = mydb.outer_email
... | niubanjin/visual | foots/themeriver.py | themeriver.py | py | 2,130 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.strftime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_n... |
70306555742 | import pandas as pd
import numpy as np
from sklearn import neural_network
from sklearn import preprocessing
df_ip=pd.read_csv('onset_ip.csv')
df_op=pd.read_csv('onset_op.csv')
print(df_ip.T.head())
print(df_op.head())
print(len(df_op))
print(len(df_ip))
print(len(df_ip.T))
ip_frame=[]
##### Step 1 : Data Preprocessin... | astvd3/Monsoon-Prediction-Model | onset.py | onset.py | py | 1,489 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_n... |
8885488715 | import sys,os,pytest,filecmp,shutil,pytest
main_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(main_dir,'..'))
import model
import itertools
import numpy as np
def test_linearExpansionModel():
"""This function tests that linearExpansion connects is working properly."""
#This p... | SoftwareDevEngResearch/pyplume | pyplume/tests/testModel.py | testModel.py | py | 2,480 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line... |
70864860064 | from django.contrib import admin
from django.urls import path
from .views import (
home,
content_view ,
login_view,
logout_view,
register_view
)
from django.conf import settings
urlpatterns = [
path("", home , name='home' ),
path("content/<int:id>/", content_view , name='content' ),
... | josehermosillaa/blogpequenocurso0031 | core/urls.py | urls.py | py | 625 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "views.home",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "views.content_view",... |
24017190641 | import numpy as np
import pytest
from spatial_image import SpatialImage
from spatialdata._core.operations.rasterize import rasterize
from spatialdata._io._utils import _iter_multiscale
from spatialdata.models import get_axes_names
from spatialdata.models._utils import get_spatial_axes
from tests.conftest import _get_i... | scverse/spatialdata | tests/core/operations/test_rasterize.py | test_rasterize.py | py | 3,441 | python | en | code | 113 | github-code | 7 | [
{
"api_name": "spatial_image.SpatialImage",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "spatialdata._io._utils._iter_multiscale",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spatialdata.models.get_axes_names",
"line_number": 23,
"usage_type... |
21898764531 | # Imports the Google Cloud client library
from google.cloud import language_v1
import os
import pickle
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/Users/jennyromero/Desktop/code/STOCKS/moodFinder-2d03c34a57da.json"
# Instantiates a client
client = language_v1.LanguageServiceClient()
titles = []
tickers = []
time =... | jaromero3rd/SentimentStocks_onlycode | moodFinder.py | moodFinder.py | py | 1,733 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.language_v1.LanguageServiceClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "google.cloud.language_v1",
"line_number": 8,
"usage_type": "name"
},
{
... |
40481451311 |
import numpy as np
import logging
from .UserTrip import UserTrip
from .Location import Location
class UserAutonomous:
id_count = -1
def __init__(
self, env, graph, ui, config, results, origin, destination, departure_time, target_time,
):
self.next_id()
self.id = UserAutonomous.id_... | NaroaCS/AutonomousBicycleSimulation | src/UserAutonomous.py | UserAutonomous.py | py | 5,809 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "UserTrip.UserTrip",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Location.Location",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "logging.info",
"... |
41775187982 | from cx_Freeze import setup,Executable
includefiles = ['1.txt','2.txt','3.txt','4.txt','5.txt','6.txt','7.txt','Comic.ttf','dog1.jpeg','Papyrus.ttc','boardre.py','Tetris.ogg']
includes = []
excludes = ['Tkinter']
packages = ['pygame']
setup(
name = 'myapp',
version = '0.1',
description = 'A general enhan... | Jackywathy/Tetris | setup.py | setup.py | py | 542 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cx_Freeze.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 16,
"usage_type": "call"
}
] |
45173836344 | from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView
from .views import (IndexView, CreateUserReplyView, CreatePostView,
EditPostView, UserProfileView, accept_reply,
DeleteUserReplyView, UserSignupView, UserConfirmCodeView)
urlpatterns = [
... | basergee/django-rpgboard | rpgboard/board/urls.py | urls.py | py | 1,098 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.IndexView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.IndexView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.urls.... |
24109783130 | from django.shortcuts import render
from .models import Plants
from .filters import plantsFilter
from .forms import SearchForm
# Create your views here.
def home(request):
plantsByFamily = None
# 請求方法為POST(使用者查詢)時,依據請求傳入的查詢條件篩選資料
if request.method == "POST":
form = SearchForm(request.PO... | r06625030/search_plants | mainsite/views.py | views.py | py | 662 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "forms.SearchForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "filters.plantsFilter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.SearchForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.shortcu... |
42211952579 | import time
import threading
import allure
import pytest
from selenium import webdriver
from datetime import datetime
from test_Task04_MultiThreading import Testa
masters = "//a[@id='iMenuID_1']"
link = "http://localhost:8080/QuaLISWeb/index.html"
un="it"
pswd="123"
class Testabc():
# In pytest data can't be pas... | ATE188-Reshma/Pycharm | Automation/test_Task04b_MultiThreadingatReqTym.py | test_Task04b_MultiThreadingatReqTym.py | py | 1,500 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "test_Task04_MultiThreading.Testa",
"line_number": 24,
"usage_type": "call"
},
{
"api... |
1973826986 | from audioop import reverse
from platform import release
from turtle import title
from django.http import JsonResponse
from django.shortcuts import render, HttpResponse, redirect
from django.urls import reverse
from .models import Tvshow, Network
from datetime import datetime
def redirigir(request):
return redire... | YashinCA/tv_shows_DJANGO | app/views.py | views.py | py | 3,031 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Tvshow.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Tvshow.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"ap... |
6696347944 | from __future__ import absolute_import
import logging
import globals.globals as g
from globals.six import text_type
import globals.constants as c
if c.PYQT5notPYQT4:
from PyQt5.QtWidgets import QGraphicsView, QMenu
from PyQt5 import QtCore
else:
from PyQt4.QtGui import QGraphicsView, QMenu
from PyQt4... | cnc-club/dxf2gcode | source/gui/canvas.py | canvas.py | py | 8,685 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "globals.constants.PYQT5notPYQT4",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "globals.constants",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name":... |
41662810595 | from flask.ext import restful
from flask import request
from flask import jsonify
from flask import Response
from tools.info import Info
from conf import httpserver, httpport
from tools.crossdomain import allow_cross_domain
from orml.visitororml import Visitororml
class OpenLink(restful.Resource):
@allow_cross_do... | CreweMin/questionnaire-research | backend/dwsl/visitorservice.py | visitorservice.py | py | 2,162 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.ext.restful.Resource",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.ext.restful",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.args.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name... |
33213579864 | """
Linear Least-Squares Inversion
==============================
Here we demonstrate the basics of inverting data with SimPEG by considering a
linear inverse problem. We formulate the inverse problem as a least-squares
optimization problem. For this tutorial, we focus on the following:
- Defining the forward pro... | simpeg/simpeg | tutorials/02-linear_inversion/plot_inv_1_inversion_lsq.py | plot_inv_1_inversion_lsq.py | py | 6,268 | python | en | code | 438 | github-code | 7 | [
{
"api_name": "discretize.TensorMesh",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "SimPEG.maps.IdentityMap",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "SimPEG.maps... |
18469784014 | # -*- coding:utf-8 -*-
from typing import List
class Solution:
def nextGreaterElements(self, nums: List[int]) -> List[int]:
if not nums: return []
nums = nums + nums
nums_len = len(nums)
stack = []
tmp = []
for i in range(len(nums)):
while stack and num... | weizhixiaoyi/leetcode | stack/503.下一个更大元素II.py | 503.下一个更大元素II.py | py | 819 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
10798633008 |
# ------------------------------------------------------
# Rigging Toolbox
# -- Method Rigger(Maya)
#
# By: Audrey Deschamps-Brower
# audreydb23@gmail.com
# ------------------------------------------------------
#-----------------------------------
# IMPORT CUSTOM MODULES
#-----------------------------------
impo... | adbrower/maya_script | Adbrower/audrey_toolbox_V03.py | audrey_toolbox_V03.py | py | 96,353 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "adbrower.Adbrower",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "maya_script.Adbrower.ICONS_FOLDER_INIT",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "maya_script.Adbrower",
"line_number": 44,
"usage_type": "name"
},
{
... |
25471660246 | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | Autodesk/molecular-design-toolkit | moldesign/orbitals/atomic_basis_fn.py | atomic_basis_fn.py | py | 4,085 | python | en | code | 161 | github-code | 7 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 4,
"usage_type": "name"
}
] |
29056152435 | from shogi import Shogi, Rook, Lance, Pawn
class Interface():
def __init__(self):
self.game = Shogi()
self.turn_count = 0
# Inicia el loop del juego
def start_playing(self):
while self.game.is_playing:
self.turn_count += 1
self.input_origin_coordinates()
... | fedeh7/Shogi | interface_shogi.py | interface_shogi.py | py | 2,832 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "shogi.Shogi",
"line_number": 7,
"usage_type": "call"
}
] |
24846068470 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import sklearn.preprocessing
class FocalLoss(nn.Module):
def __init__(self, gamma=0, alpha=None, size_average=True):
super(FocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
... | nguyenphan99/Metric_Learning_Pipeline | losses/loss.py | loss.py | py | 6,576 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_num... |
37188237700 | import base64
import cPickle as pickle
import codecs
import zlib
def create_names():
with codecs.open("allCountries.txt", encoding="ascii", errors="replace") as f_in:
with open("names.txt", "w") as f_out:
for line in f_in:
elems = line.split(u'\t')
try:
... | asimihsan/challenges | hackerrank/codesprint5/a_story_of_people_and_places.py | a_story_of_people_and_places.py | py | 1,198 | python | en | code | 35 | github-code | 7 | [
{
"api_name": "codecs.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "base64.encodestring",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "zlib.compress",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cPickle.dumps",
"lin... |
35821359867 | import flwr as fl
from strategies.FedAvg import FedAvg
from strategies.FedOpt import FedOpt
from typing import Callable, Dict, List, Optional, Tuple
import uploads.model as ICU
import json
import torch
import os.path, requests
from app import contract, job_contract_address
import numpy as np
from collections import Ord... | ImperialAI-Blockchain-Team/group-project-decentralised | reactapp/FlowerBackend/server.py | server.py | py | 8,084 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "web3.Web3",
... |
26053854203 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from user.models import MusicUser
from .models import Playlist, Song
from django.forms.models import model_to_dict
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.shortcuts import render
fr... | AKAGB/DjangoMusic | DjangoMusic/music/views.py | views.py | py | 20,196 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.JSONEncoder",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.JSONEncoder.default",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.JSONEncoder",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.