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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19670935871 | from konlpy.tag import Kkma, Okt
from pandas import DataFrame as df
from gensim.models.word2vec import Word2Vec
import pandas as pd
import logging
import time
import re
import os
import matplotlib as mpl
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.cl... | gusals6804/TopicModelling | Word2Vec.py | Word2Vec.py | py | 6,481 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "konlpy.tag.Kkma",
... |
16132746633 | '''
mobile monkey
'''
import time
from typing import List
from threading import Thread
import config_reader as config
import emulator_manager
import api_commands
from telnet_connector import TelnetAdb
from telnet_connector import GsmProfile
from telnet_connector import NetworkDelay
from telnet_connector import NetworkS... | LordAmit/mobile-monkey | mobile_monkey.py | mobile_monkey.py | py | 8,654 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "config_reader.EMULATOR_NAME",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "config_reader.EMULATOR_PORT",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "emulator_manager.adb_instances_manager",
"line_number": 37,
"usage_type... |
21884337737 | """
Series of galactic operations (doesn't that sound cool?!).
...as in converting coordinates, calculating DM etc.
"""
from datetime import timedelta
import ctypes as C
import math
import numpy as np
import os
import pandas as pd
import random
from frbpoppy.paths import paths
# Import fortran libraries
uni_mods = o... | TRASAL/frbpoppy | frbpoppy/galacticops.py | galacticops.py | py | 22,052 | python | en | code | 26 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "frbpoppy.paths.paths.models",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "frbpoppy.paths.... |
33371549713 | #---!/usr/bin/env python
#--- -*- coding: utf-8 -*-
# Librerias
import re
import sys
import json
import string
import random
import operator
import unicodedata
sys.stdout.encoding
'UTF-8'
# Libreria NLTK
import nltk
nltk.download('punkt')
nltk.download('stopwords')
from nltk.tokenize.toktok import ToktokTokenizer
f... | SoraGefroren/Practicas_relacionadas_al_NLP_utilizando_Python | Práctica_04-Wiki/relaciones.py | relaciones.py | py | 6,622 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdout",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "nltk.download",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nltk.stem.snowball.Snowba... |
5035337247 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('authentication_module', '0004_auto_20160801_2318'),
]
operations = [
migrations.AddField(
model_name='customuser... | DirectorioTurismoComercio/BackEnd | authentication_module/migrations/0005_customuser_tipo_cuenta.py | 0005_customuser_tipo_cuenta.py | py | 492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
2732586952 | #-_- coding: utf-8 -_-
from signature import settings
from control.middleware.config import RET_DATA, apple_url
from control.middleware.common import get_random_s
import re
import json
import logging
import datetime
import requests
import random
import time
import jwt
logger = logging.getLogger('djang... | lessknownisland/signature | apple/middleware/api.py | api.py | py | 10,781 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "control.middleware.config.RET_DATA.copy",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "control.middleware.config.RET_DATA",
"line_number": 29,
"usage_type": "name"
... |
35912386575 | #coding=utf-8
"""
imgcv
"""
from setuptools import setup
from setuptools import find_packages
install_requires = [
]
setup(
name = "imgcv",
version = "1.0.0",
description = 'image computer visior',
author='Hyxbiao',
author_email="hyxbiao@gmail.com",
packages = find_packages(),
entry_point... | hyxbiao/imgcv | setup.py | setup.py | py | 537 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
16701006334 | import os
import sys
from xml.etree import ElementTree
def isPlaylistUpdated(cmusPlaylistFile, jellyfinMusicPathArray) :
cmusMusicPathArray = open(cmusPlaylistFile, 'r').read().splitlines()
if len(cmusMusicPathArray) != len(jellyfinMusicPathArray) :
return True
length = len(cmusMusicPathArray)
... | nate-1/playlist-jellyfin-cmus-interface | main.py | main.py | py | 1,427 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
28377193501 | import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Flatten
from keras.datasets import mnist
from keras.utils import to_categorical
import matplotlib.pyplot as plt
# 载入MNIST数据集
(x_train, y_train), (x_test, y_test) = mnist.load_data()
# 将像素值标准化到 0 到 1 之间
x_train, x_test = ... | Ldh88/112-LiDingHui-ShangHai | 112-李鼎辉-上海/第八周作业/cv_tensorflow_keras.py | cv_tensorflow_keras.py | py | 1,333 | python | en | code | null | github-code | 6 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "keras.utils.to_categorical",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
43344834943 | import unittest
import mock
import time
from copy import deepcopy
from gorynych.common.domain import events
from gorynych.common.exceptions import DomainError
from gorynych.info.domain.test.helpers import create_contest
from gorynych.info.domain import contest, person, race
from gorynych.common.domain.types import Ad... | DmitryLoki/gorynych | gorynych/info/domain/test/test_contest.py | test_contest.py | py | 10,466 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "mock.Mock",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "gorynych.info.domain.person",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "mock.Mock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "gorynych.info.do... |
72739113148 | from reportlab.lib import colors
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.platypus import Paragraph
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.enums import TA_JUSTIFY
def generate_prescription(patient_name, doctor_name, medicine_list, logo_p... | kothawleprem/MedConnect | templates/main.py | main.py | py | 4,423 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "reportlab.pdfgen.canvas.Canvas",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "reportlab.lib.pagesizes.A4",
"line_number": 11,
"usage_type": "name"
},
{
... |
27264200550 | """
Plot.py
Created 21/12/2021
"""
from juzzyPython.generic.Tuple import Tuple
from juzzyPython.generalType2zSlices.sets.GenT2MF_Interface import GenT2MF_Interface
from juzzyPython.type1.sets.T1MF_Interface import T1MF_Interface
from juzzyPython.generalType2zSlices.sets.GenT2MF_Triangular import GenT2MF_Triangular
fro... | LUCIDresearch/JuzzyPython | juzzyPython/generic/Plot.py | Plot.py | py | 12,826 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
... |
14810439425 | import os, sys
from os.path import join as ospj
import torch
import numpy as np
from PIL import Image
import torch.utils.data as data
import kornia
import argparse
from logger import Logger
class PairedImageDataset(data.Dataset):
def __init__(self, lr_img_path, lr_filelist_path, hr_img_path, hr_filelist_path, args... | mengyuest/satellite2aerial | learn_crop.py | learn_crop.py | py | 5,572 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.Ima... |
27146623453 | from UserSimulator.User import User
from UserSimulator.user_behavior import calculate_session_length, Devices, load_spotify, playback_decision
from datetime import datetime
from datetime import timedelta
import random
import time
from json import load
import pickle
import json
import csv
import requests
from DataPrepro... | dyllew3/Timing-Attacks-Against-Opennym | MillionSongDataset/simulate_user.py | simulate_user.py | py | 12,732 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
7811594670 | from qiskit import *
from qiskit.visualization import plot_histogram
from qiskit.visualization import plot_state_city, plot_bloch_multivector
from qiskit.visualization import plot_state_paulivec, plot_state_hinton
from qiskit.visualization import plot_state_qsphere
# quantum circuit to make a Bell state
bell = ... | xhaeng06x/quantum_computing | codingproject/whatsyoureta/ETA_3Qiskit 시각화하기/ETA-3 여러가지 시각화 도구main.py | ETA-3 여러가지 시각화 도구main.py | py | 1,705 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "qiskit.visualization.plot_histogram",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "qiskit.visualization.plot_histogram",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "qiskit.visualization.plot_state_city",
"line_number": 38,
"usage_... |
2028366431 | #Aiswarya Sankar
#8/5/2015
import webapp2
import jinja2
import os
import logging
import hashlib
import hmac
import re
import string
import random
import time
import math
import urllib2
import json
from google.appengine.ext import db
from google.appengine.api import urlfetch
from google.appengine.api import memcache
... | aiswaryasankar/mock2 | main.py | main.py | py | 17,647 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"l... |
35396164763 | import codecs
import unittest
from asyncssh.asn1 import der_encode, der_decode
from asyncssh.asn1 import ASN1EncodeError, ASN1DecodeError
from asyncssh.asn1 import BitString, IA5String, ObjectIdentifier
from asyncssh.asn1 import RawDERObject, TaggedDERObject, PRIVATE
class _TestASN1(unittest.TestCase):
"""Unit te... | ronf/asyncssh | tests/test_asn1.py | test_asn1.py | py | 7,788 | python | en | code | 1,408 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "asyncssh.asn1.BitString",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "asyncssh.asn1.BitString",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": ... |
20634168426 | from .utils import get_colors
def show_help_mess(error: bool = False) -> None:
"""Usage: pytrash <param> [param[, param ...]]
{0}-h, --help{1}
Print this help message and exit.
{0}-d, --del <path> [path[ path ...]]{1}
Move files/dirs to trash (~/.local/share/Trash/).
{0}-f, --find <... | MyRequiem/pytrash | src/helpmess.py | helpmess.py | py | 1,128 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "utils.get_colors",
"line_number": 28,
"usage_type": "call"
}
] |
33042404005 | """Helpers for tests."""
import json
import pytest
from .common import MQTTMessage
from tests.async_mock import patch
from tests.common import load_fixture
@pytest.fixture(name="generic_data", scope="session")
def generic_data_fixture():
"""Load generic MQTT data and return it."""
return load_fixture("ozw/... | 84KaliPleXon3/home-assistant-core | tests/components/ozw/conftest.py | conftest.py | py | 2,850 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tests.common.load_fixture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tests.common.load_fixture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "py... |
3919536002 | # standard python libs
import os
import re
import html
import json
import random
import hashlib
import lxml.html
import lxml.etree
import unicodedata
import urllib.request
from datetime import datetime
from urllib.parse import urlparse
from urllib.parse import urlsplit
# non-standard libs which must be installed
from ... | thezedwards/webXray | webxray/OutputStore.py | OutputStore.py | py | 43,016 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "webxray.Utilities.Utilities",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "webxray.ParseURL.ParseURL",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "webxray.SQLiteDriver.SQLiteDriver",
"line_number": 36,
"usage_type": "call"
},
... |
26625288006 | from decimal import Decimal
from django import template
from livesettings import config_value
from product.utils import calc_discounted_by_percentage, find_best_auto_discount
from tax.templatetags import satchmo_tax
register = template.Library()
def sale_price(product):
"""Returns the sale price, including tax if... | dokterbob/satchmo | satchmo/apps/product/templatetags/satchmo_discounts.py | satchmo_discounts.py | py | 6,222 | python | en | code | 30 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "livesettings.config_value",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "produ... |
45636612723 | import pytest
from page_objects.sign_in_page_object import SignInPage
from utils.read_excel import ExcelReader
@pytest.mark.usefixtures("setup")
class TestRegistration():
@pytest.mark.parametrize("reg_data", ExcelReader.get_reg_data())
def test_registration_initial_form(self, reg_data):
sign_in_pa... | mcwilk/Selenium_automation | tests/registration_test.py | registration_test.py | py | 544 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "page_objects.sign_in_page_object.SignInPage",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
16294942824 | import functools
import os
import re
import requests
import csv
import sys
from datetime import time, timedelta
import argparse
#print(response.json())
class event_type:
GOAL = 0
PENALTY = 1
ASSIST = 2
class game_event:
def toPeriod(self, int_period):
int_period = int(int_period)
if... | SolidSnackDrive/hockepy_viaha | hockey.py | hockey.py | py | 8,307 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "datetime.time",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "datetime.timede... |
20859673703 | import pymunk
import pymunk.pygame_util
import pygame
from classes.ammo.ammo_box import AmmoBox
from classes.coin.coin import Coin
import os
import random
import math
from functions.math import get_xys, get_distance
class Enemy:
def __init__(self, game, space, radius, pos):
self.game = game
... | matej-kotrba/python-survival-game | classes/enemies/basic.py | basic.py | py | 5,383 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pymunk.Body",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.transform.scale",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pymunk.Circl... |
35987738740 | import torch
from tsf_baselines.modeling import build_network
ALGORITHMS = [
'BasicTransformerEncoderDecoder'
]
def get_algorithm_class(algorithm_name):
"""Return the algorithm class with the given name."""
if algorithm_name not in globals():
raise NotImplementedError("Algorithm not found: {}".fo... | zhaoyang10/time-series-forecasting-baselines | tsf_baselines/algorithm/build.py | build.py | py | 3,942 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tsf_baselines.modeling.build_... |
69894678589 | import configparser
from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf, col, monotonically_increasing_id
from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format
from pyspark.sql import types as t
# reading in the AWS confi... | greggwilliams58/data-lake | etl.py | etl.py | py | 8,843 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ"... |
44137255205 | #pip3 install wikiepdia-api
#pip3 install elasticsearch
#pip3 install nltk
#pip3 install gensim
#pip3 install pandas
#pip3 install tabulate
import pickle
import wikipediaapi
from model.WikiPage import WikiPage
from elasticsearch import Elasticsearch
import json
from time import sleep
import gensim
from gensim import co... | rAlvaPrincipe/wikipedia-search-engine | Wiki.py | Wiki.py | py | 8,334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nltk.download",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "wikipediaapi.Wikipedia",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "wikipediaapi.Extra... |
38520392642 | #!/usr/bin/python
"""
This is the code to accompany the Lesson 1 (Naive Bayes) mini-project.
Use a Naive Bayes Classifier to identify emails by their authors
authors and labels:
Sara has label 0
Chris has label 1
"""
import sys
import time
sys.path.append("../tools/")
from email_prepr... | Vkadel/machineLearningNB | nb_author_id.py | nb_author_id.py | py | 1,524 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "email_preprocess.preprocess",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sklearn.nai... |
18132721237 | from flask import Flask, redirect, render_template, request, url_for, session, flash
from datetime import timedelta
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.secret_key = "hello"
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.sqlite3' # Things you have to set up before creating a dat... | JayChen1060920909/Projects | Login-Logout.py | Login-Logout.py | py | 3,056 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.rende... |
42940796937 | from typing import List, Tuple
import networkx as nx
import numpy as np
from matplotlib import pyplot as plt
import time
import copy
from node import Node
def get_graph(node: Node) -> Tuple[nx.Graph, List, List]:
board_size = node.state.shape[0]
G = nx.grid_2d_graph(board_size, board_size)
diagonals = []
... | Mathipe98/IT3105-Projects | Project 2/visualizer.py | visualizer.py | py | 1,707 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "node.Node",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "node.state",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "networkx.grid_2d_graph",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line... |
70835728188 | import json
fs = open("G:\python\Analysis"+"\\"+'score.json', encoding='utf-8')
ft = open("G:\python\Analysis"+"\\"+'template.json', encoding='utf-8')
res1 = fs.read()
data = json.loads(res1)
res2 = ft.read()
template = json.loads(res2)
scoreKey = []
templateKey = template.keys()
goal = {}
for key in data:
user... | nju161250023/Analysis | createFlag.py | createFlag.py | py | 803 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 33,
"usage_type": "call"
}
] |
6056862050 | from datetime import datetime
import csv
def logReceivedGossip(file,gossipID,spreader,audience,awardedSP,targetCitizensSP,receivingAudienceKnownRumours,citizen_list,rumourTarget,sentiment):
now = datetime.now()
date_time = now.strftime("%m/%d/%Y %H:%M:%S:%f")
# get total rumour count
for key in citizen_list: kt... | murchie85/gossipSimulator | game/functions/logging.py | logging.py | py | 822 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "csv.writer",
"line_number": 15,
"usage_type": "call"
}
] |
33062234730 | #!/usr/local/bin/python
# -*- coding: utf-8 -*
import requests
class MetrikaAPI(object):
def __init__(self, counter_id, token, host='https://api-metrika.yandex.ru'):
self.counter_id = counter_id
self.token = token
self.host = host
def _get_url(self, url='/stat/v1/data', params=None,... | swetlanka/py3 | 3-5/3-5.py | 3-5.py | py | 1,824 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.request",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 24,
"usage_type": "attribute"
}
] |
17953524197 | # -*- coding: utf-8 -*-
import numpy as np
import torch
import torch.nn as nn
from lichee import plugin
from lichee import config
@plugin.register_plugin(plugin.PluginType.MODULE_LOSS, 'mse_loss')
class MSELoss:
@classmethod
def build(cls, cfg):
return nn.MSELoss()
@plugin.register_plugin(plugin.P... | Tencent/Lichee | lichee/module/torch/loss/loss.py | loss.py | py | 8,023 | python | en | code | 295 | github-code | 6 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lichee.plugin.register_plugin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lichee.plugin... |
28400031595 | import os
import time
from datetime import datetime
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
import torch.nn.functional as F
from torch.autograd import Variable
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import random
import numpy as np
import utils.... | houhsein/Spleen_injury_detection | classification/utils/training_torch_utils.py | training_torch_utils.py | py | 19,509 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.expand_di... |
25760579432 | from opencage.geocoder import OpenCageGeocode
import xlrd
import xlwt
from xlwt import Workbook
import pandas as pd
key ="fd4f682cf2014f3fbd321ab141454138"
# get api key from: https://opencagedata.com
geocoder = OpenCageGeocode(key)
loc = ("/Users/ashwinisriram/Documents/Lat long/corrected.xlsx")
wb = xl... | Ashwini-Sriram/Latlong | alter.py | alter.py | py | 2,116 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "opencage.geocoder.OpenCageGeocode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xlwt.Workbook",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pa... |
22525757483 | """
Author: Matthew Smith (45326242)
Date: 15/04/2021
Title: AERO4450 Design Report Progress Check
"""
import numpy as np
import matplotlib.pyplot as plt
import math
import scipy.sparse as sps
import scipy.sparse.linalg as splinalg
# Parameters
M_N2 = 28 # g/mol
M_F2 = 44 # g/mol
M_O2 = 32 # g/mol
mdo... | msmit677/AERO4450 | AERO4450_Combustion_Modelling.py | AERO4450_Combustion_Modelling.py | py | 9,866 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "mat... |
14188272016 | from fastapi import FastAPI
app = FastAPI()
COLUMN_NAME = "name"
COLUMN_ID = "id"
FAKE_DB = [
{"id": 1, "name": "Vladimir"},
{"id": 2, "name": "Polina"},
{"id": 3, "name": "Aleksander"}
]
def find_friend_name(friend_id, db_name):
for row in db_name:
if row.get(COLUMN_ID) == friend_id:
... | DanilaLabydin/Python-tasks-solving-practice | app/main.py | main.py | py | 715 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 4,
"usage_type": "call"
}
] |
74281365627 | from __future__ import annotations
import re
from dataclasses import asdict, dataclass
from typing import Optional, Sized, TypeVar
import torch
import torchinfo
from accelerate.utils.random import set_seed
from torch.utils.data import DataLoader
from simpletrainer.utils.common import pretty_repr
T = TypeVar('T')
se... | Moka-AI/simpletrainer | simpletrainer/utils/torch.py | torch.py | py | 4,653 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "accelerate.utils.random.set_seed",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typin... |
34214358930 | import json
# Set file paths
basePath = 'D:\\NTCIR-12_MathIR_arXiv_Corpus\\'
inputPath = basePath + "output_FeatAna\\"
index_file = 'inverse_semantic_index_formula_catalog(physics_all).json'
#basePath = 'D:\\NTCIR-12_MathIR_Wikipedia_Corpus\\'
#inputPath = basePath + "output_RE\\"
#index_file = 'inverse_semantic_index... | pratyushshukla19/Minor-Project-2 | semanticsearch/modes13-15/evaluate_inverse_formula_index.py | evaluate_inverse_formula_index.py | py | 2,411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
}
] |
41149275833 | """ Internet Validators
- ValidateEmail
- ValidateIP
- ValidateURL
"""
import socket
import re
from email_validator import validate_email, EmailNotValidError
from flask_validator import Validator
class ValidateEmail(Validator):
""" Validate Email type.
Check if the new value is a valid e-mail.
Using t... | xeBuz/Flask-Validator | flask_validator/constraints/internet.py | internet.py | py | 3,190 | python | en | code | 28 | github-code | 6 | [
{
"api_name": "flask_validator.Validator",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask_validator.Validator.__init__",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "flask_validator.Validator",
"line_number": 43,
"usage_type": "name"
},
{... |
5005445920 | from __future__ import annotations
from pathlib import Path
from typing import Any, cast
import _testutils
import pytest
from lxml.html import (
HtmlElement as HtmlElement,
find_class,
find_rel_links,
iterlinks,
make_links_absolute,
parse,
resolve_base_href,
rewrite_links,
)
reveal_ty... | abelcheung/types-lxml | test-rt/test_html_link_funcs.py | test_html_link_funcs.py | py | 3,706 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "lxml.html.parse",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.html.find_rel_links",... |
77938817 | """
file structure:
flip_labels_and_scans.py
scan_directrory - raw scans folder
label_directrory - labels folder
save_dir_scan - flipped scans folder (where they will be saved)
save_dir_labels - flipped labels folder (where they will be saved)
This script flips nii (nifti) labels and scans along the sagittal ... | kylerioux/python_ML_scripts | 3d_image_preprocessing/flip_scans_and_labels.py | flip_scans_and_labels.py | py | 4,139 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.ceil",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "SimpleITK.AffineTransform",
"lin... |
73083659707 | import numpy as np
from scipy.spatial.distance import cdist
import matplotlib.pyplot as plt
def has_converged(centers, new_centers):
return set([tuple(a) for a in centers]) == set([tuple(a) for a in new_centers])
def kmeans(X, K):
# centroids = X[np.random.choice(X.shape[0], K, replace=False)]
centroids... | cuongdd2/cs582 | lab6/prob4.py | prob4.py | py | 1,807 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.distance.cdist",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
74732381948 | import numpy as np
import tensorflow as tf
import cv2
def colormap_jet(img):
color_image = cv2.applyColorMap(np.uint8(img), cv2.COLORMAP_JET)
return color_image
def color_disparity(disparity):
with tf.variable_scope('color_disparity'):
batch_size = disparity.shape[0]
color_maps = []
... | fabiotosi92/monoResMatch-Tensorflow | utils.py | utils.py | py | 677 | python | en | code | 117 | github-code | 6 | [
{
"api_name": "cv2.applyColorMap",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLORMAP_JET",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.variable_... |
14098998919 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
===================================
Timer --- Create a timer decorator.
===================================
Largely this module was simply practice on writing decorators.
Might need to review logging best practices. I don't want the logger from
this module to emit any... | farisachugthai/dynamic_ipython | default_profile/util/timer.py | timer.py | py | 5,023 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "time.perf_counter",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "time.perf_cou... |
26436839942 | from PIL import Image
imgx = 512
imgy = 512
image = Image.new("RGB",(imgx,imgy))
for x in range(imgx):
for y in range(imgy):
if ((x//64)%2 == 1) or ((x//64)%2 == 2) and (y//64)%2 == 1 or ((y//64)%2 == 2):
image.putpixel ((x,y), (0,0,0) )
else:
image.putpixel ((x,y), (250,0,0) )
image.save("demo_image... | gbroady19/CS550 | intropil.py | intropil.py | py | 334 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.new",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 6,
"usage_type": "name"
}
] |
13563263971 | import requests
import time
import json
from hoshino import aiorequests
apiroot = 'https://help.tencentbot.top'
async def getprofile(viewer_id: int, interval: int = 1, full: bool = False) -> dict:
reqid = json.loads(await aiorequests.get(f'{apiroot}/enqueue?full={full}&target_viewer_id={viewer_id}').content.decod... | pcrbot/arena_query_push | queryapi.py | queryapi.py | py | 933 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hoshino.aiorequests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hoshino.aiorequests",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
... |
12646834769 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
df = pd.read_csv('dividedsamples/training.csv')
dfval = pd.read_csv('dividedsamples/testing.csv')
train_features = df.copy()
test_features = d... | WayneFerrao/autofocus | linreg.py | linreg.py | py | 717 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "p... |
40527670685 | from django import forms
from django.forms import TextInput, SplitDateTimeWidget
class NumberInput(TextInput):
"""
HTML5 Number input
Left for backwards compatibility
"""
input_type = 'number'
class AdminDateWidget(forms.DateInput):
@property
def media(self):
js = ["calendar.js... | ricardochaves/django-adminlte | adminlte/widgets.py | widgets.py | py | 1,631 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.forms.TextInput",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.DateInput",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django... |
4041441314 | __author__ = 'yueli'
import numpy as np
import matplotlib.pyplot as plt
from config.config import *
mrList = np.linspace(1, 13, 13)
negativeList = [-1, -1, -10, -10, -1, -1, -1, -10 ,-1, -1, -1, -10, -10]
noMapReplyList = np.linspace(0, 0, 13)
rlocSet1 = [-10, 1, 1, 1, -10, -10, 1, 1, 1, -10, 1, 1, 1]
rlocSet2 = [-10,... | hansomesong/TracesAnalyzer | Plot/Plot_variable_MR/Plot_variable_MR.py | Plot_variable_MR.py | py | 1,248 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlim",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
14400394656 | #!/usr/bin/env python3.8
def missing_element(arr1, arr2):
arr1.sort()
arr2.sort()
for num1, num2 in zip(arr1, arr2):
if num1 != num2:
return num1
return -1
def missing_element1(arr1, arr2):
count = {}
output = []
for i in arr1:
if i in count:
count[i] += 1
else:
count[i] = 1
for i in arr2:
... | dnootana/Python | concepts/arrays/find_missing_element.py | find_missing_element.py | py | 950 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
}
] |
32644908087 | """Guide Eye 01 module"""
from functools import partial
from mgear.shifter.component import guide
from mgear.core import transform, pyqt
from mgear.vendor.Qt import QtWidgets, QtCore
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
from maya.app.general.mayaMixin import MayaQDockWidget
from . import s... | mgear-dev/mgear4 | release/scripts/mgear/shifter_classic_components/eye_01/guide.py | guide.py | py | 5,095 | python | en | code | 209 | github-code | 6 | [
{
"api_name": "mgear.shifter.component.guide.ComponentGuide",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "mgear.shifter.component.guide",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "mgear.core.transform.getOffsetPosition",
"line_number": 49,
... |
3344378919 | import logging
import sys
from loguru import logger
from starlette.config import Config
from starlette.datastructures import Secret
from app.core.logger import InterceptHandler
config = Config(".env")
API_PREFIX = "/api"
VERSION = "0.1.0"
DEBUG: bool = config("DEBUG", cast=bool, default=False)
MAX_CONNECTIONS_COUN... | hieunt2501/text-augmentation | app/core/config.py | config.py | py | 1,648 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "starlette.config.Config",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "starlette.datastructures.Secret",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "logging.DEBUG",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_na... |
14712079581 | from typing import List, Optional
from fastapi import APIRouter, Header
from fastapi.exceptions import HTTPException
from server.models.subscription import (
ExchangeKlineSubscriptionRequest,
ExchangeSubscription,
ExchangeSubscriptionType,
)
router = APIRouter()
@router.get("/")
async def list(x_connec... | masked-trader/raccoon-exchange-service | src/server/routes/subscription/kline.py | kline.py | py | 3,263 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fastapi.Header",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "server.models.subscription.ExchangeSubscription.find",
"line_number": 17,
"usage_type": "call"
},
{
... |
74866931066 | import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
import os
class HobsHeader(object):
sim_head = '"SIMULATED EQUIVALENT"'
obs_head = '"OBSERVED VALUE"'
obs_name = '"OBSERVATION NAME"'
date = 'DATE'
dyear = 'DECIMAL_YEAR'
header = {sim_head: None,
... | jlarsen-usgs/HydrographTools | hobs_output.py | hobs_output.py | py | 22,180 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 143,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 143,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": ... |
18660136090 | import os
import sys
try:
from dreamberd import interprete
except ModuleNotFoundError:
sys.exit("Use -m keyword.")
from argparse import ArgumentParser
parser = ArgumentParser(
prog="DreamBerd Interpreter (Python)",
description="The perfect programming language.",
)
parser.add_argument("content", help... | AWeirdScratcher/dreamberd-interpreter | dreamberd/__main__.py | __main__.py | py | 559 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.exit",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
10233608865 | from __future__ import annotations
import re
from typing import TYPE_CHECKING
from twitchio import User, PartialUser, Chatter, PartialChatter, Channel, Clip
from .errors import BadArgument
if TYPE_CHECKING:
from .core import Context
__all__ = (
"convert_Chatter",
"convert_Clip",
"convert_Channel",
... | PythonistaGuild/TwitchIO | twitchio/ext/commands/builtin_converter.py | builtin_converter.py | py | 2,755 | python | en | code | 714 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "core.Context",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "errors.BadArgument",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "twitchio.Chatter"... |
27094902824 | from typing import Any, Callable, Dict
from torchvision import transforms as T
from rikai.types.vision import Image
"""
Adapted from https://github.com/pytorch/pytorch.github.io/blob/site/assets/hub/pytorch_vision_resnet.ipynb
""" # noqa E501
def pre_processing(options: Dict[str, Any]) -> Callable:
"""
Al... | World-shi/rikai | python/rikai/contrib/torchhub/pytorch/vision/resnet.py | resnet.py | py | 1,166 | python | en | code | null | github-code | 6 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torchvision.tra... |
3574016217 | """Python module for common workflows and library methods.
Authors: Prasad Hegde
"""
import os
import json
import pathlib
import inspect
import random
import string
class Workflows():
"""
Common Workflows and library methods
"""
def get_config_data(self, test_method):
"""
This routin... | prasadhegde60/showoff.ie | workflows/workflows.py | workflows.py | py | 3,021 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
23515271400 | # First Solution: 58476KB / 200ms / 674B
def BS(array,start,end):
while start<=end:
mid = (start+end)//2
if array[mid][1] == 1 and array[mid-1][1]==2: return mid
elif array[mid][1] == 2: start = mid+1
else: end = mid-1
return None
def Solution(data):
data = sorted(data.items... | Soohee410/Algorithm-in-Python | BOJ/Silver/1764.py | 1764.py | py | 1,094 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "sys.stdin.readline",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",... |
38703775254 | import json
def getAdminAccount():
with open("./Data/admins.json", "r") as file:
JSON = file.read()
accounts = json.loads(JSON)
return accounts
def getAccount():
with open("./Data/accounts.json", "r") as file:
JSON = file.read()
accounts = json.loads(JSON)
return... | Coincoin008/DrawPlz-localhost-version- | getAccounts.py | getAccounts.py | py | 333 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
}
] |
72067617789 | import math as ma
import multiprocessing as mp
import time
def first_test(n):
""" test naïf de primalité
retourne True si l'entier est premier, et inversement
n : un entier naturel
"""
for a in range(2, int(ma.sqrt(n) + 1)):
if n % a == 0:
return False
return True
def pi(... | BasileLewan/ProjetCOMPLEX | Ex2.py | Ex2.py | py | 3,830 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "math.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "math.gcd",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number":... |
650432757 | import os
import luigi
import json
import z5py
import numpy as np
from ..cluster_tasks import WorkflowBase
from ..relabel import RelabelWorkflow
from ..relabel import find_uniques as unique_tasks
from ..node_labels import NodeLabelWorkflow
from ..features import RegionFeaturesWorkflow
from .. import write as write_tas... | constantinpape/cluster_tools | cluster_tools/postprocess/postprocess_workflow.py | postprocess_workflow.py | py | 19,543 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "cluster_tasks.WorkflowBase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "luigi.Parameter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "luigi.Parameter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "luigi.Para... |
24698015874 | ##
# The model uses elements from both the Transformer Encoder as introduced in
# “Attention is All You Need” (https://arxiv.org/pdf/1706.03762.pdf) and the
# Message Passing Neural Network (MPNN) as described in "Neural Message Passing
# for Quantum Chemistry" paper (https://arxiv.org/pdf/1704.01212.pdf) .
#
# T... | robinniesert/kaggle-champs | model.py | model.py | py | 17,738 | python | en | code | 48 | github-code | 6 | [
{
"api_name": "torch.nn.ModuleList",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
... |
4755956537 | import argparse
import os
import sys
import time
import json
import pickle
from nltk.corpus import wordnet as wn
import numpy as np
import torch
import random
from aligner import Aligner
import log
logger = log.get_logger('root')
logger.propagate = False
def get_print_result(sample_group: dict, sample_result: dict... | lksenel/CoDA21 | Evaluation/evaluate_PLMs.py | evaluate_PLMs.py | py | 4,847 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "log.get_logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet.synset",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.wordnet",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "argpars... |
29528497286 | #!/usr/bin/python3
import html
import re
import random
import json
import requests
from bs4 import BeautifulSoup
PATTERN = re.compile(r'/video(\d+)/.*')
def _fetch_page(page_number):
url = 'https://www.xvideos.com/porn/portugues/' + str(page_number)
res = requests.get(url)
if res.status_code != 200:
... | marquesgabriel/bot-xvideos-telegram | xvideos.py | xvideos.py | py | 2,846 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_n... |
71455581947 | import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score, roc_auc_score, roc_curve
import matplotlib.pyplot as plt
from pathl... | anmol6536/binder_project | hw6_comparing_models.py | hw6_comparing_models.py | py | 4,387 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.RobustScaler",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": ... |
21881567037 | # app.py
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from fastapi.middleware.cors import CORSMiddleware
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
import pandas as pd
import uvicorn
app = FastAPI()
# This middleware is requir... | pnavab/tweet-sentiment-NLP | app.py | app.py | py | 2,079 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "fastapi.middleware.cors.CORSMiddleware",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_na... |
33837428124 | import array
import struct
import sys
from collections import namedtuple
import plotly.express as px
import numpy as np
from scipy.ndimage import uniform_filter1d
from statsmodels.nonparametric.smoothers_lowess import lowess
import matplotlib.pyplot as plt
from math import degrees, atan
import scipy.signal
TYPE_DIGIT... | nkelly1322/analog_analysis | AnalogAnalysis.py | AnalogAnalysis.py | py | 4,559 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "array.array",
... |
5569399042 | """Display image captured from image sensor"""
import numpy as np
import cv2
import socket
import tkinter
import pandas as pd
import datetime
import time
import os
class ImageGUI(object):
def __init__(self):
#self.buffer_size = 128 * 128 * 3 # picture size
self.buffer_size = (16384 * 2 + 2048 * 2... | yg99992/Image_transfer_open_source | python_code/Image_show.py | Image_show.py | py | 10,237 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
12746754821 | import requests
from bs4 import BeautifulSoup as bs
import smtplib
URL = "https://www.amazon.in/9500-15-6-inch-i7-10750H-NVIDIA1650-Graphics/dp/B08BZPRWR5/ref=sr_1_4?dchild=1&keywords=Dell+XPS+15&qid=1602254565&sr=8-4"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (K... | Programmer-X31/PythonProjects | Project Amazon Scraper/main.py | main.py | py | 1,679 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP",
"line_number": 30,
"usage_type": "call"
}
] |
6018276646 | # https://pypi.org/project/emoji/
from PIL import Image, ImageDraw, ImageFont
import emoji
print(emoji.demojize('Python 👍'))
print(emoji.emojize("Python :thumbs_up:"))
# 创建一个空白的RGBA模式图像
img = Image.new('RGBA', (200, 200), color='white')
# 获取Emoji字符的Unicode字符串
emoji_unicode = emoji.emojize(':thumbs_up:'... | Yuelioi/Program-Learning | Python/modules/utils/_emoji.py | _emoji.py | py | 1,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "emoji.demojize",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "emoji.emojize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number... |
30502016476 | from django.urls import path
from . import views
app_name = 'home'
urlpatterns = [
path('', views.index, name='index'),
path('login/', views.login_view, name='login'),
path('registration/', views.registration, name='registration'),
path('logout/', views.logout_view, name='logout'),
path('profile/'... | Arctik124/tekken_league | home/urls.py | urls.py | py | 434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
39485139620 | #!/usr/bin/env python3
"""lc3_achi.py -- achivements module"""
import time
import dataset
from flask import session
lc3_achivements = [{'id': 0, 'hidden': False, 'title': 'Sleepless', 'desc': 'Submit a correct flag at night'},
{'id': 3, 'hidden': False, 'title': 'CTF Initiate', 'desc': 'Solve one ... | Himanshukr000/CTF-DOCKERS | lc3ctf/examples/lc3achi/lc3achi.py | lc3achi.py | py | 922 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "dataset.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 22,
"usage_type": "name"
}
] |
6018330446 | from playwright.sync_api import sync_playwright
def test_props():
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto("https://image.baidu.com/")
# 上传文件
file_path = r"C:/Users/yl/Desktop/1.png"
pag... | Yuelioi/Program-Learning | Python/modules/web/Playwright/元素操作.py | 元素操作.py | py | 987 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "playwright.sync_api.sync_playwright",
"line_number": 5,
"usage_type": "call"
}
] |
21833663632 | from flask import Flask, render_template, request
from werkzeug.utils import redirect
from scrapper import weather_search
app = Flask("Weather Scrapper")
@app.route("/")
def home():
area = request.args.get('area')
if area:
weather_element = weather_search(area)
print(weather_eleme... | Sunggjinn/weather-closet | app.py | app.py | py | 509 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
35940096218 | import pygame
import random
from typing import Callable
from pygame import Vector2, Rect, Color, Surface
pygame.init()
class Signal:
def __init__(self):
self.handlers = []
def connect(self, handler: callable) -> None:
self.handlers.append(handler)
def disconnect(self, handler:... | cliegc/simple-roguelike-game | main.py | main.py | py | 32,075 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.Vector2",
"line_number": 130,
"usage_type": "name"
},
{
"api_name": "pygame.Rect",
"line_number": 134,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_nu... |
2794147606 | #ENTRENAMIENTO DE RED CONVOLUCIONAL 2D - CLASIFICACION HSI
#Se utiliza PCA para reduccion dimensional y estraccion de caracteristicas espectrales. A la red convolucional se introduce
#una ventana sxs de la imagen original para la generacion de caracteristicas espaciales a partir de la convolucion.
#Se utiliza como ca... | davidruizhidalgo/unsupervisedRemoteSensing | 2_Redes Supervisadas/hsi_CNN2D.py | hsi_CNN2D.py | py | 4,213 | python | es | code | 13 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "package.cargarHsi.CargarHsi",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "package.dataLogger.DataLogger",
"line_number": 33,
"usage_type": "call"
},
{
"... |
26053689790 | from itertools import permutations
vowels = ["о", "а"]
consonants = ["в", "т", "р"]
result = set()
for index, i in enumerate(permutations("авторота")):
correct = True
for symbol_index in range(0, len(i) - 1):
if (i[symbol_index] in vowels and i[symbol_index + 1] in vowels) or \
(i[symb... | Woolfer0097/UGE_IT | 8 task/236.py | 236.py | py | 501 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.permutations",
"line_number": 7,
"usage_type": "call"
}
] |
30297740447 | # Seq2Seq model with attention
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
from copy import copy
def init_weights(m):
for name, param in m.named_parameters():
if 'weight' in name:
nn.init.normal_(param.data, mean=0, std=0.01)
else:
nn.ini... | three0-s/KT-ETRI | model.py | model.py | py | 7,755 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.init.normal_",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn.init",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.const... |
31698964136 | import pytorch_lightning as pl
import torch
from src.training_class import CFG, BertModule
if __name__ == "__main__":
torch.cuda.empty_cache()
model = BertModule()
trainer = pl.Trainer(
accelerator="gpu",
devices=1,
max_epochs=CFG.epochs,
precision=32,
gradient_cli... | ArturYasnov/Quora-Insincere-Questions-using-BERT | train.py | train.py | py | 500 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.cuda.empty_cache",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "src.training_class.BertModule",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyt... |
6907369998 | from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse
from firebase import firebase
# from flask_cors import CORS
from twilio.rest import Client
import pyrebase
config = {
"apiKey": "AIzaSyAEEO1frXfzyL6MCkRvgGz7qURfsTLajRc",
"authDomain" : "covid-19-fake-news-... | mayankchauhan96/Fake-news-detector | app.py | app.py | py | 2,112 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyrebase.initialize_app",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "firebase.firebase",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "firebase.fireba... |
28509751362 | # coding: utf-8
"""
Messente API
[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure yo... | messente/messente-api-python | messente_api/models/delivery_report_response.py | delivery_report_response.py | py | 6,393 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "messente_api.configuration.Configuration",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "inspect.getargspec",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 152,
"usage_type": "call"
},
{
"api_n... |
71889450427 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.views.generic import CreateView
from levangersundet.forms import DeltagerForm
from post_office import mail
class TestCreateView(CreateView):
form_class = DeltagerForm
template_name = 'test.html'
def get_success_url(self):
return... | fivethreeo/jsdev | mainapp/views.py | views.py | py | 1,070 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.CreateView",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "levangersundet.forms.DeltagerForm",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "post_office.mail.send",
"line_number": 17,
"usage_type": "call"
},
{
... |
14018247881 | import cv2
import numpy as np
def motion_detector(videofile):
window_raw = "Raw video"
window_preprocessed = "Preprocessed video"
window_motion = "Video motion"
window_finished = "Thermal Video"
window_test1 = "Test1"
cv2.namedWindow(window_raw)
cv2.namedWindow(window_preprocessed)
c... | Christdej/gas-analysis | src/gas_analysis/gas_detection.py | gas_detection.py | py | 4,763 | python | en | code | null | github-code | 6 | [
{
"api_name": "cv2.namedWindow",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
... |
28220979750 | #Import Necessary Packages
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import seaborn as sns
import ruptures as rpt
from statistics import stdev
import pandas as pd
def load_rms(path, sect, ref):
raw_string = open('../../' + path + '/rmsd_' + sect + '_ref_' + ref + '.txt').readlines(... | ajfriedman22/PTP1B | compare_mutant_scripts/rmsd_mut_compare.py | rmsd_mut_compare.py | py | 30,484 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
8266532966 | import logging
import shutil
import sys
import click
from cekit.cache.artifact import ArtifactCache
from cekit.config import Config
from cekit.crypto import SUPPORTED_HASH_ALGORITHMS
from cekit.descriptor.resource import create_resource
from cekit.log import setup_logging
from cekit.tools import Map
from cekit.versio... | cekit/cekit | cekit/cache/cli.py | cli.py | py | 5,730 | python | en | code | 70 | github-code | 6 | [
{
"api_name": "cekit.log.setup_logging",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cekit.config.Config",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "click.g... |
25549591929 | import logging
import os
import sys
def configLogger():
root = logging.getLogger()
root.setLevel(logging.DEBUG)
file_handler = logging.FileHandler(_get_logfile_name())
file_handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fil... | cipriantruica/news_diffusion | news-spreading-master/logger/logger.py | logger.py | py | 529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",... |
1918587531 | import sys
import datetime
import csv
from os import path
""""
This section describes all functions called when the program is started.
"""
def startup():
create_date_file()
create_bought_file()
create_sold_file()
def create_date_file():
"""Check if there is already a file present contai... | YorrickvB/SuperpyV2 | startup.py | startup.py | py | 1,282 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_... |
10176346880 | import requests
import re
import warnings
import json
class NHGIS:
'''API wrapper for the IPUMS NHGIS API.
API Documentation: https://developer.ipums.org/docs/get-started/
Arguments:
api_key: Authorization key required for use of the IPUMS API. *Required*
API keys can be obta... | joelsewhere/ipumspy | ipumspy.py | ipumspy.py | py | 18,512 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_numb... |
73996523069 | import torch
from torch import nn, optim
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import random
import os
import glob
import sys
import wandb
import gru_models
import build_vocab
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# TODO: Get rid of these, just pass t... | JayOrten/controllableRNN | scripts/train_gru.py | train_gru.py | py | 11,462 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
... |
14177953222 | """Holds environmental variables, sets up custom logger."""
import logging
import os
log = logging.getLogger(name="log")
# declare environment constants
COSMOSDB_CONNECTION_STRING: str = os.environ["COSMOSDB_CONNECTION_STRING"]
COSMOSDB_DATABASE_ID: str = os.environ["COSMOSDB_DATABASE_ID"]
COSMOSDB_CONTAINER_ID: str... | wieczorekgrzegorz/ksef-krportal-communication | utilities/setup.py | setup.py | py | 1,194 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
16413370006 | import json
import os
import pygame
from pprint import pformat
from pyggui.core import TRANSPARENT
pygame.font.init()
_DEFAULT_THEME_PATH = 'assets/themes/default_theme.json'
_DEFAULT_THEME_PATH = os.path.join(os.path.dirname(__file__), _DEFAULT_THEME_PATH)
NULL_THEME_DEFAULTS = {
"col": TRANSPARENT,
"width... | sam57719/PygGUI | pyggui/theme.py | theme.py | py | 2,672 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.font.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
41685726399 | import boto3
import sys
import time
# input value 'ansible-controller' while running the instance
#import json
ec2_client = boto3.client('ec2', region_name = "us-east-1")
instances = ec2_client.describe_instances()
for reservation in instances['Reservations']:
for instance in reservation["Instances"]:
if i... | sudhann92/project-repo | aws-python/aws-boto-start-instance.py | aws-boto-start-instance.py | py | 979 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20... |
72137353787 | import logging
import json
from discord import Interaction, app_commands, Role
from discord.app_commands import Choice
from discord.ext.commands import Bot, Cog
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
with open("config.json") as cfg_json:
cfg = json.loads(cfg_json.read())
... | tenacious210/dgg-relay | cogs.py | cogs.py | py | 14,701 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.Interaction",
... |
12300903394 | import numpy as np
from sklearn.datasets import make_classification
import pytest
from pygbm.binning import BinMapper
from pygbm.grower import TreeGrower
from pygbm import GradientBoostingRegressor
from pygbm import GradientBoostingClassifier
X, y = make_classification(n_samples=150, n_classes=2, n_features=5,
... | ogrisel/pygbm | tests/test_plotting.py | test_plotting.py | py | 2,201 | python | en | code | 175 | github-code | 6 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.importorskip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygbm.binning.BinMapper",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
38958617780 | from unittest import mock
from django.test import TestCase
from django.urls import resolve, reverse
from nltk import word_tokenize
from .models import ScrapeHistory
from .views import WordCountView
class ScrapeTest(TestCase):
def _mock_response(
self,
status=200,
content="CO... | iqbalalo/word_counter | src/scrape/tests.py | tests.py | py | 3,441 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "unittest.mock.M... |
7661449629 | import numpy as np
import netCDF4
from datetime import datetime, timedelta
from glob import glob
import os, sys
"""
This program is used to read input data.
"""
#******************************************
# Edit here (input file directories)
#------------------------------------------
slpbasedir = "/mnt/nas02/data/... | nbykutsumi/wsd | dataloader_CMIP6.py | dataloader_CMIP6.py | py | 5,339 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.load",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number":... |
18266500320 | """This is Slate's Linear Algebra Compiler. This module is
responsible for generating C++ kernel functions representing
symbolic linear algebra expressions written in Slate.
This linear algebra compiler uses both Firedrake's form compiler,
the Two-Stage Form Compiler (TSFC) and COFFEE's kernel abstract
syntax tree (AS... | hixio-mh/firedrake | firedrake/slate/slac/compiler.py | compiler.py | py | 22,060 | python | en | code | null | github-code | 6 | [
{
"api_name": "pyop2.utils.get_petsc_dir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.dtype",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.int8",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "firedrake.slate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.