id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
28937 | <gh_stars>10-100
#!/usr/bin/env python
# Copyright 2016-2021 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | StarcoderdataPython |
4834213 | from typing import Optional
def foo() -> Optional[int]<caret>:
return 42 | StarcoderdataPython |
1605316 | <reponame>omides248/cinema-django<filename>customers/models.py
import jdatetime
from phonenumber_field.modelfields import PhoneNumberField
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django_jalali.db import models as jmodels
from django.db import models
from ... | StarcoderdataPython |
1700559 | pkgname = "python-babel"
pkgver = "2.9.1"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools"]
checkdepends = ["python-pytz"]
depends = ["python-setuptools", "python-pytz"]
pkgdesc = "Tools for internationalizing Python applications"
maintainer = "q66 <<EMAIL>>"
license = "BSD-3-Clause"
url ... | StarcoderdataPython |
1738087 | #!/usr/bin/env python3
"""The setup script."""
from setuptools import find_packages, setup
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
with open("requirements.txt", "r") as f:
requirements = list(map(str.str... | StarcoderdataPython |
3338162 | <reponame>seanrsinclair/ORSuite
from or_suite.agents.agent import *
import or_suite.agents.rl
import or_suite.agents.ambulance
import or_suite.agents.resource_allocation | StarcoderdataPython |
19485 | from __future__ import annotations
__all__ = ("executor",)
import inspect
import sys
from asyncio import get_running_loop
from concurrent.futures import Executor
from functools import partial, wraps
from typing import Awaitable, Callable, TypeVar, overload
from asphalt.core import Context
if sys.version_info >= (3,... | StarcoderdataPython |
1749335 | <reponame>BradleyKirton/gpug-graphql<filename>meetup/views/template.py
from django.views import View
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render, redirect
import meetup.models
class Task(View):
def get(self, request: HttpRequest) -> HttpResponse:
"""Render the t... | StarcoderdataPython |
4809962 | import uvicorn
import aiohttp
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def helloworld():
async with aiohttp.ClientSession() as sess:
async with sess.get("https://postman-echo.com/get?foo1=bar1&foo2=bar2") as resp:
return await resp.text()
if __name__ == "__main__":
... | StarcoderdataPython |
1628421 | <reponame>jamesgleave/Deep-Docking-NonAutomated<gh_stars>10-100
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-sfp','--smile_folder_path',required=True,help='Path to SMILES directory')
parser.add_argument('-fp','--folder_path',required=True,help='Desired path to Morgan directory, without Morg... | StarcoderdataPython |
4837832 | import matplotlib.pyplot as plt
import numpy as np
def linijas():
ypoints = np.array(np.random.randint(100, size=(10)))
ypoints2 = np.array(np.random.randint(100, size=(10)))
plt.plot(ypoints, 'o-.')
plt.plot(ypoints2, '+:r')
plt.show()
linijas()
| StarcoderdataPython |
3376354 | <filename>tutorial/settings.py
../prepare/settings.py | StarcoderdataPython |
1711664 | <reponame>xiciliu/ncov2019
# -*- coding: utf-8 -*-
"""
Created on Wed May 30 17:54:35 2018
@author: xici
"""
import requests
import re
import json,os,shutil
from hyper.contrib import HTTP20Adapter
from bs4 import BeautifulSoup
import js2xml
from lxml import etree
from DB.Mysql import Mysql
import ti... | StarcoderdataPython |
4829631 | <reponame>shiaoyao/Facebook-Page-Crawler<filename>setup.py
from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
import os
requirements_path = os.path.join(os.path.dirname(o... | StarcoderdataPython |
1746561 | import os
import logging
import tempfile
import Bcfg2.Server.Plugin
from subprocess import Popen, PIPE
from Bcfg2.Server.Plugins.Cfg import CfgFilter
logger = logging.getLogger(__name__)
class CfgDiffFilter(CfgFilter):
__extensions__ = ['diff']
def modify_data(self, entry, metadata, data):
basehandle... | StarcoderdataPython |
61913 | import numpy as np
import porespy as ps
import matplotlib.pyplot as plt
import openpnm as op
np.random.seed(0)
def test_snow_example_script():
plot = False
im1 = ps.generators.blobs(shape=[600, 400], porosity=None, blobiness=1) < 0.4
im2 = ps.generators.blobs(shape=[600, 400], porosity=None, blobiness=1)... | StarcoderdataPython |
160846 | __author__ = "<NAME>"
__license__ = 'MIT'
# -------------------------------------------------------------------------------------------------------------------- #
# IMPORTS
# Modules
# RiBuild Modules
from delphin_6_automation.database_interactions.db_templates import sample_entry
from delphin_6_automation.database_... | StarcoderdataPython |
110416 | import logging
import platform
import sys
import time
def add_http_prefix(url):
return url if url.startswith("http://") or url.startswith("https://") else "http://" + url
# def mqtt_broker_info(val):
# # Broker hostname can be either "localhost" or "localhost:999"
# return (val[:val.index(":")], int(val[v... | StarcoderdataPython |
113124 | def arithmetic_arranger(problems, solutions = False):
if len(problems) > 5:
return 'Error: Too many problems.'
problem_list = []
for prob in problems:
output = ''
arr = prob.split(' ')
if arr[1] != '+' or arr[1] != '+':
return "Error: Operator must be '+' or '-'."
if arr[0].isdig... | StarcoderdataPython |
3327376 | import re
from babel.numbers import get_currency_name, get_currency_precision, get_currency_symbol
from money.exceptions import InvalidCurrencyFormat
CURRENCY_REGEX = re.compile('^[A-Z]{3}$')
class Currency:
"""
Represents a currency identified by its ISO 4217 code.
Parameters
----------
curre... | StarcoderdataPython |
199971 | <filename>setup.py<gh_stars>0
from setuptools import setup
setup(name='Security',
version='1.1.15',
description='A simple security library wrapping various well known primitives.',
url='https://www.github.com/pmp47/Security',
author='pmp47',
author_email='<EMAIL>',
license='MIT',
packages=['security'],
install_... | StarcoderdataPython |
18297 | <filename>Python_do_zero_Guanabara/04_CondiçõesEmPython/aula/aula15.py
# modelo anterior - Enquanto cont até 10 for verdade, será repetido
cont = 1
while cont <= 10:
print(cont, ' ...', end='')
cont += 1
print('FIM')
# Usando o Enquanto VERDADE ele vai repetir para sempre, temos que colocar uma condição PARA=... | StarcoderdataPython |
1657439 | # Most of this is lifted from Seaborn (https://stanford.edu/~mwaskom/software/seaborn/)
#
# Copyright (c) 2012-2013, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of s... | StarcoderdataPython |
1701405 | <reponame>dphillips97/tilehuria<gh_stars>0
#!/usr/bin/python3
"""
Various utilities for MBTile creation, math and string manipulation related to tiles.
"""
import sys, os
import argparse
import math
import re
import random
def lat_long_zoom_to_pixel_coords(lat, lon, zoom):
"""Create pixel coordinates from lat-lon... | StarcoderdataPython |
1601401 | from VEEParser import read_string, send_record
from VEEParser import send_string, PYTHON_TO_VEE_TYPES, read_script, R_TO_PYTHON_TYPES
import socket
import argparse
import subprocess
import threading
import os
import uuid
from bridgescripts import BRIDGE_SCRIPTS
import tempfile
from client import Client
PROTOCOLS = set(... | StarcoderdataPython |
3347356 | <gh_stars>10-100
import datetime
import os
import shutil
import sys
import tempfile
import unittest
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth.models import Permission, User
from django.test import TestCase
from django.urls import reverse
from .models import Album, AlbumAcc... | StarcoderdataPython |
1661745 | #This file plots the positivity rate (=true positives) and the frequency in each class in a boxplot and a histogram after platt scaling.
import sparsechem as sc
import numpy as np
import argparse
import scipy
import pandas as pd
import matplotlib.pyplot as plt
import math
import scipy.stats as sci
import matplotlib.gr... | StarcoderdataPython |
3239541 | from attr import attrib, attrs
class AdmError(Exception):
"""Base class for ADM parsing exceptions."""
class AdmMissingRequiredElement(AdmError):
"""Exception raised for missing required elements."""
class AdmIDError(AdmError):
"""Exception raised when errors relating to IDs are identified."""
@attr... | StarcoderdataPython |
27376 | <reponame>alisterburt/yet-another-imod-wrapper
from pathlib import Path
import numpy as np
from yet_another_imod_wrapper.fiducials import run_fiducial_based_alignment
TEST_DATA_DIR = Path(__file__).parent.parent / 'tilt_series'
run_fiducial_based_alignment(
tilt_series_file=TEST_DATA_DIR / 'my_prefix_TS_01.mrc'... | StarcoderdataPython |
3395895 | <gh_stars>1-10
# script to test spatial joins between gnaf and select psma admin bdys - ~40 mins
import glob
import logging
import os
import psycopg2
import sys
from datetime import datetime
from itertools import repeat
from multiprocessing import cpu_count, Pool
from psycopg2 import pool
from pyspark.sql import fu... | StarcoderdataPython |
3290599 | from django.urls import path
from . import views
app_name = 'post_app'
urlpatterns = [
path('post-list/',views.ArticleList.as_view(),name='list'),
path('post-detail/<slug>/',views.ArticleDetailView.as_view(),name='detail')
] | StarcoderdataPython |
1714515 | class Constants(object):
class ConfigSection:
hyperparameters = "HYPERPARAMETERS"
model = "MODEL"
datasetParameters = "DATASET_PARAMETERS"
class DatasetParams:
datasetName = "datasetName"
validationPercentage = "validationPercentage"
imageEncoding = "imageEnco... | StarcoderdataPython |
3207764 | <reponame>pikhovkin/yametrikapy
from .core import Metrika
__version__ = '2.0'
__author__ = '<NAME> <<EMAIL>>'
| StarcoderdataPython |
124274 | <filename>test/UDLI.py
# -*- coding: utf-8 -*-
from src.DLMDL.DLNetwork import DLNetwork
from src.Serializer.serializer import JsonSerialize
import importlib
import argparse
from src.util.signal_handler import signal_handler
class UDLI:
def __init__(self):
self.args = arg_parser().parse_args()
se... | StarcoderdataPython |
3260571 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking various utils functions.
"""
import logging
import unittest
from gensim import utils
from six import iteritems
class TestIsCorpus(unittest.TestCase):
def t... | StarcoderdataPython |
158799 | <filename>tests/__init__.py
"""Unit test package for logist."""
| StarcoderdataPython |
1665738 | import glob
def read_annotations():
path = "/home/user/Action_Recog/OTHER/CrossTask/crosstask_release/annotations/"
list_csv = glob.glob(path + "*.csv")
for video in list_csv:
print(video.split(".csv")[0].split("/")[-1])
task = video.split(".csv")[0].split("/")[-1].split("_")[0]
vi... | StarcoderdataPython |
3319274 | from django.conf.urls import patterns, url, include
from django.contrib import admin
from . import views
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', views.index, name='public-index'),
)
| StarcoderdataPython |
27729 | import multiprocessing
from time import sleep
from datetime import datetime, time
from logging import INFO
from vnpy.event import EventEngine
from vnpy.trader.setting import SETTINGS
from vnpy.trader.engine import MainEngine
from vnpy.gateway.hbdm import HbdmGateway
from vnpy.gateway.hbsdm import HbsdmGateway
from vn... | StarcoderdataPython |
4808374 | <gh_stars>1-10
import unittest
import numpy as np
class CustomAssertions(unittest.TestCase):
def assertArrayIsSorted(self, array, reverse=False):
if not array:
raise ValueError("Array is empty.")
sorted_array = sorted(array, reverse=reverse)
self.assertSequenceEqual(array, sor... | StarcoderdataPython |
4841826 | <gh_stars>1-10
import sys
def prt(out=sys.stdout):
out.write('Just a simple print\n')
| StarcoderdataPython |
143566 | <reponame>BloomAutist47/bloom-bo
from .Base import *
from discord.ext import commands
from pprint import pprint
from requests import get as requests_get
class GoogleSearchCog(commands.Cog, BaseTools):
def __init__(self, Bot):
self.setup()
self.bot = Bot
async def search(self, term, num_result... | StarcoderdataPython |
3254850 | <gh_stars>1-10
import os
# pip install snakeviz
# run game and create a profile
os.system("py -3.7 -m cProfile -o profile.prof Main.py")
# watch it in snakeviz
os.system("snakeviz profile.prof")
| StarcoderdataPython |
3397615 | genius_key = '' | StarcoderdataPython |
123964 | import sys
import os
from PIL import Image, ImageDraw, ImageFont, ImageColor
from matrixdemos.scripts.get_file import get_file
font_cache = {}
def apply_alpha(image, background):
try:
if isinstance(image.getpixel((0, 0)), int):
return image
if len(image.getpixel((0, 0))) != 4:
... | StarcoderdataPython |
1616160 | import sys
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import animation
class WingPlot3d:
def __init__(self):
self.xyz_to_yzx = True
self.elem_step = 4
filename = sys.argv[1]
h5f= h5py.File(filename,'r')... | StarcoderdataPython |
1667090 | <gh_stars>0
import os
from .assetDataRequest import AssetDataRequest
def download_asset_data(symbol, sdate, edate, interval, data_directory):
download_status = {
'status':1,
'file_location':''
}
# if data directory does not exist raise error
if not os.path.isdir(data_directory):
... | StarcoderdataPython |
3392783 | <gh_stars>1-10
"""Tests for the weather_app main module."""
from datetime import datetime
import numpy as np
from random import randint
from weather_app.api import lookup_location, SMHIForecast
from weather_app import get_temperature_forecast
def test_temperature_forecast():
"""
Ensure that forecast is corre... | StarcoderdataPython |
1689325 | """
Load ligand datasets.
"""
import logging
from pathlib import Path
import pandas as pd
from rdkit.Chem import PandasTools
logger = logging.getLogger(__name__)
DATA_PATH = Path(__file__).parent / "../../data/external/ligands"
PKIDB_PATH = DATA_PATH / "PKIDB/pkidb_2021-04-19.sdf"
def pkidb(pkidb_path=PKIDB_PATH,... | StarcoderdataPython |
12059 | #!/usr/bin/env python2
import paho.mqtt.client as mqtt
import time
import Adafruit_DHT
from configparser import ConfigParser
import json
config = ConfigParser(delimiters=('=', ))
config.read('config.ini')
sensor_type = config['sensor'].get('type', 'dht22').lower()
if sensor_type == 'dht22':
sensor = Adafruit_DH... | StarcoderdataPython |
1610301 | <reponame>pierky/exabgp
# encoding: utf-8
"""
Copyright (c) 2016 <NAME> <<EMAIL>>
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import json
import binascii
import itertools
from struct import unpack
from exabgp.bgp.message.notification import Notify
fro... | StarcoderdataPython |
172282 | # Copyright 2017 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | StarcoderdataPython |
3258631 | # Copyright 2017 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | StarcoderdataPython |
171407 | <gh_stars>1-10
from django.http import HttpResponse
from django.template.response import TemplateResponse
from saleor.dashboard.views import staff_member_required
from django.core.paginator import Paginator, EmptyPage, InvalidPage, PageNotAnInteger
from django.shortcuts import get_object_or_404
from .models import Sale... | StarcoderdataPython |
1762232 | import launch
import launch_ros
import os
from ament_index_python.packages import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, ExecuteProcess
from launch_ros.actions import... | StarcoderdataPython |
16259 | <filename>Financely/basic_app/models.py
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Client(models.Model):
user = models.OneToOneField(User,null=True,blank= True,on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=True)
# def _... | StarcoderdataPython |
1718267 | <gh_stars>1-10
N = int(input())
p = 1
for i in range(2, N+1):
p = p * i % (10**9+7)
print(p)
| StarcoderdataPython |
32529 | <filename>02_sequences/0201_listcomp/020103_cartesian/__main__.py
colors = ['black', 'white']
sizes = ['S', 'M', 'L']
tshirts = [
(color, size)
for color in colors
for size in sizes
]
print(f"Cartesian products from {colors} and {sizes}: {tshirts}")
| StarcoderdataPython |
20700 | <filename>python/paddle/v2/fluid/tests/book/test_understand_sentiment_conv.py
import numpy as np
import paddle.v2 as paddle
import paddle.v2.fluid.core as core
import paddle.v2.fluid.evaluator as evaluator
import paddle.v2.fluid.framework as framework
import paddle.v2.fluid.layers as layers
import paddle.v2.fluid.nets ... | StarcoderdataPython |
47140 | <filename>label_maker/utils.py
"""Provide utility functions"""
import numpy as np
def url(tile, imagery):
"""Return a tile url provided an imagery template and a tile"""
return imagery.replace('{x}', tile[0]).replace('{y}', tile[1]).replace('{z}', tile[2])
def class_match(ml_type, label, i):
"""Determine ... | StarcoderdataPython |
3391546 | """
Django settings for cybercamp_backoffice project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
... | StarcoderdataPython |
1682427 | <filename>main.py
#! /usr/bin/python
import sys
import argparse
VERSION="1.0"
def ShowVersion(output=''):
print("Version: %s" % (VERSION))
def main():
parser = argparse.ArgumentParser(description='Template python appliction')
parser.add_argument('--version', action='store_true', help='Displays the ap... | StarcoderdataPython |
158914 | <filename>AutoClean/AutoClean.py
import os
import sys
import pandas as pd
from loguru import logger
from AutoClean.Modules import *
class AutoClean:
def __init__(self, input_data, missing_num='auto', missing_categ='auto', encode_categ=['auto'], extract_datetime='s', outliers='winz', outlier_param=1.5, logfile=Tru... | StarcoderdataPython |
106753 | <filename>plugwise/connections/serial.py
"""
Use of this source code is governed by the MIT license found in the LICENSE file.
Serial USB connection
"""
import time
import threading
import logging
from queue import Queue
import serial
import serial.threaded
from plugwise.constants import (
BAUD_RATE,
BYTE_SIZE... | StarcoderdataPython |
3298620 | from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
class DMAutomate(App):
def build(self):
self.is_recording = False
self.window = BoxLayout(o... | StarcoderdataPython |
72283 | <filename>memcached_stats.py
#!/usr/bin/env python
"""
Rackspace Cloud Monitoring plugin to provide memcached statistics.
Copyright 2013 <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the Licens... | StarcoderdataPython |
1708216 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
connection = sqlite3.connect("lagerverwaltung.db")
cursor = connection.cursor()
cursor.execute("""CREATE TABLE lager (
fachnummer INTEGER, seriennummer INTEGER,
komponente TEXT, lieferant TEXT, reserviert INTEGER
)""")
cursor.execute("""CREATE TA... | StarcoderdataPython |
3294557 | import tensorflow as tf
# ===============================================
# Previously was snippets.py of: 3_2_RNNs
# ===============================================
# i = input_gate, j = new_input, f = forget_gate, o = output_gate
# Get 4 copies of feeding [inputs, m_prev] through the "Sigma" diagram.
# Note that ea... | StarcoderdataPython |
49236 | <reponame>SAVE-POlNT/Flask_shared_auth
from flask import Flask, redirect, url_for, render_template, request, session, url_for, flash
from captchacreater import create_image_captcha
from sendmail_func import sendMail, validMail
from TokenGenerator import getTokenUser, setToken, ChangeTokenUser
from mysqlhostedwithpy... | StarcoderdataPython |
3331537 | import os
import re
import argparse
import numpy as np
from sklearn.metrics import confusion_matrix
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.neural_network import MLPClassifier
import matplotlib.pyplot as plt
feature_list = []
feature_dict = {}
def confusion(true, pr... | StarcoderdataPython |
4818946 | from os import remove
from os.path import isfile
from platform import python_version
from random import random
from subprocess import run
from ezazure import Azure
def safe_remove(fname: str):
if isfile(fname):
remove(fname)
def test_api_download():
fname = 'test0.file'
try:
safe_rem... | StarcoderdataPython |
3327750 | <filename>src/openfermion/hamiltonians/__init__.py
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | StarcoderdataPython |
3336183 | import scrapy
from datetime import datetime
from scrapy_splash import SplashRequest
from resource_library.items import JdBookItem
class JingDongSpider(scrapy.Spider):
name = 'jingdong'
allowed_domains = ['s-e.jd.com', 'e.jd.com', 'dx.3.cn']
start_urls = ['https://s-e.jd.com/Search']
offset = 1
bas... | StarcoderdataPython |
1734092 | from nltk.corpus import brown
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
import ch8util
from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
import pandas as pd
import pickle
import dautil as dl
stemmer = PorterStemmer()
lemm... | StarcoderdataPython |
162370 | # python3
# pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | StarcoderdataPython |
3316122 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Repository'
db.create_table('repositories_repository', (
('id', self.gf('djang... | StarcoderdataPython |
1760084 | '''
Created on January 30, 2018
@author: khoi.ngo
All SDK users can change their own verkey.
(https://docs.google.com/spreadsheets/d/1TWXF7NtBjSOaUIBeIH77SyZnawfo91cJ_ns4TR-wsq4/edit#gid=0)
This script will setup an environment with a pool (from genesis_txn file),
a wallet inside that pool and get the default Steward... | StarcoderdataPython |
1611399 | # -*- coding: utf-8 -*-
from web_app.auth.license.handlers import LicenseHandler
license_api_urls = [(r"/license/?", LicenseHandler)]
| StarcoderdataPython |
64289 |
from app import Application
if __name__ == '__main__':
Application.run()
| StarcoderdataPython |
1713880 | <gh_stars>0
#===============================================================================
# Write Code Here
#===============================================================================
url = 'https://raw.githubusercontent.com/HyechurnJang/pylon/master/README.md'
resp = requests.get(url)
if resp.status_cod... | StarcoderdataPython |
3263298 | <filename>Curso/File Objects/01CriarArquivoDeTexto.py<gh_stars>0
with open('test.txt', 'w') as f:
content = f.write('start')
print(content)
| StarcoderdataPython |
3247760 | <reponame>fritzo/funsor
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import math
from collections import OrderedDict
from functools import reduce
from typing import Tuple, Union
from multipledispatch import dispatch
import funsor.ops as ops
from funsor.cnf import Contraction, G... | StarcoderdataPython |
4818578 | <reponame>Rizalgente/upkoding
# Generated by Django 3.1.6 on 2021-03-26 13:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
... | StarcoderdataPython |
1722921 | <reponame>malyvsen/face-attractor
import attractiveness
import util
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Reshape
import tkinter as tk
from tkinter import filedialog as fd
import cv2
model = Sequential()
# This trainable layer represents an im... | StarcoderdataPython |
92944 | <filename>evaluation_rtpdd.py
# Copyright 2017 Tensorflow. All Rights Reserved.
# Modifications copyright 2018 <NAME>/<NAME> & <NAME>
# We follow the object detection API of Tensorflow
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | StarcoderdataPython |
3340087 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 19:24:10 2017
@author: misaka-wa
"""
import numpy as np
def make_gram(numpy_arr:np.ndarray, N:int, step = 1):
"""window sliding method
x = np.array([1,2,3,4])
make_gram(x, 2, 1)
>> array([[1, 2],
[2, 3],
[3, 4]])
make_gram(x, 2, ... | StarcoderdataPython |
197839 | # -*- coding: utf-8 -*-
"""cerberus_ac plugins module."""
try:
from archan import Provider, Argument, DesignStructureMatrix
class Privileges(Provider):
"""Cerberus AC provider for Archan."""
identifier = 'cerberus_ac.Privileges'
name = 'Privileges'
description = 'Provide matr... | StarcoderdataPython |
4824862 | from invoke import task
@task
def _update_tags(c, version=''):
msg = "Added tag v{0}".format(version)
print('')
print('Adding Files to Stage...')
print('')
c.run("git add .")
print('')
print('Commiting Staged Files...')
print('')
c.run("git commit -m \"Created Tag\"")
print('')
print('Creating Ta... | StarcoderdataPython |
1769106 | <filename>cla_backend/apps/cla_provider/tests/mommy_recipes.py
from model_mommy.recipe import Recipe, seq, foreign_key
from ..models import Provider, ProviderAllocation, OutOfHoursRota, Staff, Feedback, CSVUpload
provider = Recipe(Provider, name=seq("Name"))
staff = Recipe(Staff)
outofhoursrota = Recipe(OutOfHoursR... | StarcoderdataPython |
182137 | """Module containing functions used to trace API calls
end to end. All functions in the module use OpenTracing
framework in conjuction with a Jaeger server to provide
comprehensice API Tracing Capabilites"""
import logging
import json
import datetime
import sys
import opentracing
import requests
import bottle
import... | StarcoderdataPython |
3381775 | class GeneralError(Exception):
pass
| StarcoderdataPython |
52641 | # Answer 1 and 4. | StarcoderdataPython |
3229143 | # -*- coding: utf-8 -*-
from _tempmom import TemporalMoments
import numpy as np
import unittest
class TemporalMomentsTestCase(unittest.TestCase):
"""Class for test of all temporal moments."""
def setUp(self):
"""Test case using an exponential function as a signal.
See reference for informat... | StarcoderdataPython |
3236771 | <gh_stars>1-10
from line.messaging import Channel
webhook = Channel(
channel_secret='test',
channel_access_token=None
).get_webhook()
@webhook.event_handler
def test_handler(event):
pass
app = webhook.get_wsgi_application()
def test_request(obj):
import json
from webob impor... | StarcoderdataPython |
3231840 | <gh_stars>10-100
#! /usr/bin/env python
import BaseHTTPServer
import cookielib
import errno
import os
import urllib2
import subprocess
import threading
import time
httpd = None
base_url = 'http://httpd.atlassian.test:8080'
def assert_exits(process):
timeout = 5
while process.poll() is None:
assert ti... | StarcoderdataPython |
1745003 | import numpy as np
import tensorflow as tf
from model.baseline import Baseline
class CNNBaseline(Baseline):
"""CapsNet model."""
def __init__(self, hps, images, labels):
"""CapsNet constructor"""
"""
Args:
hps: Hyperparameters.
images: Batches of images. [batch_si... | StarcoderdataPython |
1657299 | import torch
import torch.nn as nn
import torch.nn.functional as F
class conv_block(nn.Module):
def __init__(self,in_channels,out_channels):
super(conv_block,self).__init__()
self.one_stage=nn.Sequential(
nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=3,stride=1... | StarcoderdataPython |
3330982 | <gh_stars>10-100
# Copyright 2019 <NAME>
#
# This file is part of RfPy.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | StarcoderdataPython |
1616737 | <reponame>rxn4chemistry/smiles2actions
"""
Minimal setup.py to allow for local installation in the development environment
with `pip install -e .`
"""
import io
import re
from os import path
from setuptools import setup, find_packages
# Get the version from rxn_actions/__init__.py
# Adapted from https://stackoverflow... | StarcoderdataPython |
1795520 | import json
from pathlib import Path
import pytest
from bs4 import BeautifulSoup
from app.api.business.respirator import RespiratorExtractor
from app.model.respirator import ApprovalCertificate, Respirator
def mocked_extract_approval_certificate(self: RespiratorExtractor, ac_real: int, ac_candidate: str, _: str = N... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.