id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
1735456 | <gh_stars>0
from fastapi import APIRouter, Depends, HTTPException, status
from db import get_db
from websocket_manager import get_manager
from config import MAX_CHUNK_SIZE
from objects.tile import Tile
from objects.player import Player
from utils import coordinates_to_chunk
router = APIRouter()
@router.get("/map")
... | StarcoderdataPython |
50080 | <filename>astr-119-hw-2/useful_modules.py
import test_module as tm
tm.hello_world() #imported module that we made, this is what numby does
| StarcoderdataPython |
3280454 | from SciDataTool.Functions import AxisError
def get_length(self, is_oneperiod=False, is_antiperiod=False, is_smallestperiod=False):
"""Returns the length of the axis taking symmetries into account.
Parameters
----------
self: DataLinspace
a DataLinspace object
is_oneperiod: bool
re... | StarcoderdataPython |
1716323 | import rospy
from sensor_msgs.msg import CompressedImage
import numpy as np
import cv2
def img_publisher(img):
publisher = rospy.Publisher("image",CompressedImage, queue_size=10)
img_msg = CompressedImage()
img_msg.header.stamp = rospy.Time().now()
img_msg.format = 'jpeg'
# img_msg.data = np.array(img,dtype = np.... | StarcoderdataPython |
1656692 | from torch import nn
from mmdet.core import (bbox2result, bbox_mapping)
from mmdet.core import (bbox2roi, merge_aug_masks, merge_aug_bboxes, multiclass_nms, merge_aug_proposals)
from mmdet.models.detectors import BaseDetector
#if sys.version_info >= (3, 7):
# from mmdet.utils.contextmanagers import completed
class... | StarcoderdataPython |
1317 | from .bbItem import bbItem
from ...bbConfig import bbData
class bbTurret(bbItem):
dps = 0.0
def __init__(self, name, aliases, dps=0.0, value=0, wiki="", manufacturer="", icon="", emoji=""):
super(bbTurret, self).__init__(name, aliases, value=value, wiki=wiki, manufacturer=manufacturer, icon=icon, emoj... | StarcoderdataPython |
1766385 | <reponame>TheCheapestPixels/panda3d-simplepbr
import os
import panda3d.core as p3d
from direct.filter.FilterManager import FilterManager
from .version import __version__
__all__ = [
'init',
]
def _add_shader_defines(shaderstr, defines):
shaderlines = shaderstr.split('\n')
for line in shaderlines:
... | StarcoderdataPython |
3270081 | # Generated by Django 2.2.4 on 2020-04-10 03:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0002_auto_20200409_2152'),
]
operations = [
migrations.AlterField(
model_name='station',
name='last_rep... | StarcoderdataPython |
1797437 | <reponame>Db2-DTE-POC/db2shift
#
# Set up Jupyter MAGIC commands "sql".
# %sql will return results from a DB2 select statement or execute a DB2 command
#
# IBM 2019: <NAME>
# Version 2019-10-03
#
from __future__ import print_function
from IPython.display import HTML as pHTML, Image as pImage, display as pdisplay, Jav... | StarcoderdataPython |
94938 | """Scalene: a scripting-language aware profiler for Python.
https://github.com/plasma-umass/scalene
See the paper "docs/scalene-paper.pdf" in this repository for technical
details on an earlier version of Scalene's design; note that a
number of these details have changed.
by <NAME>
https://em... | StarcoderdataPython |
23629 | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | StarcoderdataPython |
3301891 | <filename>examples/raspberrypi/SHT13.py
from akilib import AKI_I2C_SHT31
import time
SHT31 = AKI_I2C_SHT31()
SHT31.I2C_ADDR = 0x44
SHT31.SoftReset()
time.sleep(1)
print SHT31.ReadStatus()
while 1:
print "-" *10
print "%f %%" % SHT31.Humidity()
print "%f 'C" % SHT31.Temperature()
time.sleep(1)
| StarcoderdataPython |
1705507 | import re
from datetime import timedelta, datetime
from telegram import Update
from telegram.ext import CallbackContext
from src.server import Deadlines
from src import keyboard, time_management as tm, database as db, common_functions as cf
from src.text import get_text
from static import consts
SERVER = Deadlines.... | StarcoderdataPython |
1654215 | <reponame>erezsh/tartiflette<filename>tests/functional/test_tartiflette.py
from unittest.mock import Mock
import pytest
from tartiflette.resolver import Resolver
from tartiflette.tartiflette import Tartiflette
@pytest.mark.asyncio
async def test_tartiflette_execute_basic():
schema_sdl = """
schema {
... | StarcoderdataPython |
184483 | <reponame>mickael-grima/optimizedGPS<gh_stars>0
from utils import tools
from optimizedGPS.data.data_generator import generate_random_drivers, generate_grid_data
from optimizedGPS.problems.Models import TEGModel
from optimizedGPS.problems.Solver import Solver
def compare_rows_and_columns_number(graph, drivers_numbers... | StarcoderdataPython |
178358 | # -*- coding: utf-8 -*-
from .context import FetchPublicBlacklists # noqa
from FetchPublicBlacklists import FetchPublicBlacklists # noqa
from FetchPublicBlacklists import helpers # noqa
import unittest
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_absolute_truth_and_meaning(s... | StarcoderdataPython |
1725876 | <reponame>heitorchang/students<filename>records/migrations/0002_auto_20191008_1254.py<gh_stars>0
# Generated by Django 2.2.6 on 2019-10-08 15:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('records', '0001_initial'),
]
operations = [
... | StarcoderdataPython |
1763723 | import os
import posixpath
import shutil
from unittest import mock
import pytest
from dvc.data.stage import stage
from dvc.fs.repo import RepoFileSystem
from dvc.hash_info import HashInfo
from tests.utils import clean_staging
def test_exists(tmp_dir, dvc):
tmp_dir.gen("foo", "foo")
dvc.add("foo")
(tmp_d... | StarcoderdataPython |
3391261 | from sys import exc_info
from os import walk, path
from OpenSSL import crypto
certs_path = path.realpath('../certs/')
crls_path = path.realpath('../crls/')
def validIndex(x):
try:
certLen = len(x) - 1
retVal = int(input('Input index # (Max:{}): '.format(certLen)))
if retVal > certLen:
... | StarcoderdataPython |
57052 | <reponame>YungTimAllen/NetworkxLeafSpineGen
import networkx as nx
import matplotlib.pyplot as plt
class LeafSpine:
def __init__(self, n: int, m: int):
self.nx_g = nx.Graph()
self.build_leaf_spine_nx(n, m)
def build_leaf_spine_nx(self, n: int, m: int):
self.nx_g.add_edges_from(
... | StarcoderdataPython |
1616522 | <reponame>JIC-CSB/jicagile<filename>tests/git_integration_tests.py<gh_stars>1-10
"""Git integration tests."""
import unittest
import os
import os.path
import shutil
from subprocess import Popen, PIPE
import tempfile
import mock
CUR_DIR = os.getcwd()
class GitIntegrationTests(unittest.TestCase):
def setUp(self... | StarcoderdataPython |
3212300 | ############################################################
# -*- coding: utf-8 -*-
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 for python
# Python v3.5
#
# <NAME>
# (c) 2016, 2017, 2018
#
# Licence APL2.0
#
############################################################
import loggin... | StarcoderdataPython |
3324166 | import numpy as np
from matplotlib import cm
def colorize_1d_depth_map(X, coloring_mode='jet'):
"""
Function colorizes a depth map given a certain function
:param X: ndarray descibring the 1-D depth image, which is already converted to a depth map 0-255
:param coloring_mode: descirbes the default mode... | StarcoderdataPython |
3290040 | from argparse import ArgumentParser
from math import log10
from pathlib import Path
import pandas as pd
import pytorch_ssim
import torch
import torchvision.utils as utils
from lpips import lpips
from torch.utils.data import DataLoader, ConcatDataset
from torch_fidelity import calculate_metrics
from tqdm import tqdm
f... | StarcoderdataPython |
3220710 | from .apis import *
from .models import *
from .test_commands import * | StarcoderdataPython |
3201324 | # Copyright (c) 2015-2017 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0, which is in the LICENSE file.
"""
Defines model components to force discrete builds for generation technologies
that have gen_unit_size specified.
"""
from pyomo.environ import *
dependencies = 'switc... | StarcoderdataPython |
1721520 | <gh_stars>1-10
from pathlib import Path
import pytest
import yaml
from azure.ai.ml._schema import ModelSchema
from azure.ai.ml.constants import BASE_PATH_CONTEXT_KEY, AssetTypes
from marshmallow.exceptions import ValidationError
from azure.ai.ml.entities._util import load_from_dict
from azure.ai.ml.entities._assets im... | StarcoderdataPython |
1751099 | from endpoint import endpoint_app
endpoint_app.run(host='localhost', port=5001, threaded=True, debug=True)
| StarcoderdataPython |
98730 | from flatdata.generator.tree.nodes.node import Node
from flatdata.generator.tree.nodes.references import ResourceReference, FieldReference, StructureReference
class ExplicitReference(Node):
def __init__(self, name, properties=None):
super().__init__(name=name, properties=properties)
@staticmethod
... | StarcoderdataPython |
3259602 | class GameState():
def __init__(self):
self.board = [
["bR", "bN", "bB", "bQ", "bK", "bB", "bN", "bR"],
["bp", "bp", "bp", "bp", "bp", "bp", "bp", "bp"],
["--", "--", "--", "--", "--", "--", "--", "--"],
["--", "--", "--", "--", "--", "--", "--", "--"],
... | StarcoderdataPython |
1687058 | <reponame>2DU/openNAMU-PYnamu
from .tool.func import *
def main_func_setting():
li_list = [
['main', load_lang('main_setting')],
['phrase', load_lang('text_setting')],
['robot', 'robots.txt'],
['external', load_lang('ext_api_req_set')],
['head', load_lang('main_head')],
... | StarcoderdataPython |
1627201 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | StarcoderdataPython |
199048 | import time
from Tkinter import *
master = Tk()
WW = Canvas(master, width=500, height=500)
WW.pack()
#TEST_rect# w.create_rectangle(0,0,55,55,fill='red')
w, h = 10, 10
Ma = [[0 for x in range(w)] for y in range(h)]
Ma[5][5] = 1
listN = [-1, 0, 1]
for x in Ma:
print(x)
print
for x in range(10):
new = []
... | StarcoderdataPython |
1748287 | async def is_correct_channel(ctx):
return ctx.channel.name in ctx.bot.gen_channels
| StarcoderdataPython |
3390710 | <reponame>franzmandl/rcpicar<filename>tests/case/integration/expire/test_overflow1.py
from rcpicar.expire.ExpireMessage import ExpireMessage, valid_message_number_range
from rcpicar.expire.ExpireReceiveService import ExpireReceiveService
from tests.mock.receive import MockReceiveService
def test() -> None:
mock_r... | StarcoderdataPython |
91865 | <reponame>bp15046/iot-access-network-interface-sdk-python3
from abc import ABCMeta, abstractmethod
class AccessNetworkInterface(metaclass=ABCMeta):
def __init__(self, addr, port):
self._addr = addr
self._port = port
self._file = None
self._data = None
def open(self, fi... | StarcoderdataPython |
26292 | """
Demonstrate the type 1 NUFFT using cuFINUFFT
"""
import numpy as np
import pycuda.autoinit
from pycuda.gpuarray import GPUArray, to_gpu
from cufinufft import cufinufft
# Set up parameters for problem.
N1, N2 = 59, 61 # Size of uniform grid
M = 100 # Number of nonuniform p... | StarcoderdataPython |
1643539 | <filename>exp5/exp5a-b/exp5a_windowEval.py<gh_stars>0
import numpy as np
import tensorflow as tf
import h5py
from sklearn.preprocessing import OneHotEncoder
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
# Download data from .mat file into numpy array
print('==> Experimen... | StarcoderdataPython |
197808 | <reponame>guilleCoro/django-autocomplete<filename>autocomplete/views.py
import operator
from django.db import models
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse, HttpResponseForbidden
import json
from django.utils.encoding import smart_str
class AlreadyRegistered(Except... | StarcoderdataPython |
1769008 | palavras = ('aprender', 'programar', 'liguagem', 'python',
'curso', 'grátis', 'estudar', 'praticar',
'trabalhar', 'mercado', 'programador', 'futuro')
for i in palavras:
print(f'\nNa palavra {i.upper()} temos as vogais', end=' ')
for letra in i:
if letra.lower() in 'aáêeéêiíoóu': ... | StarcoderdataPython |
191659 | <gh_stars>0
from typing import *
import sys
import os
sys.path.append(os.getcwd())
from Codon import *
class Rna:
rna_pairs = {'A':'U', 'U':'A', 'G':'C', 'C':'G'}
RNA_NUCLEOTIDES = ('A', 'U', 'G', 'C')
def __init__(self, sequence : str, rna_base_options = RNA_NUCLEOTIDES) -> None:
c... | StarcoderdataPython |
1732422 | <filename>sentimentanalysis/SentimentAnalysis.py
# Imports the Google Cloud client library
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
class SentimentAnalysis:
ROBOT_LIBRARY_SCORE = 'TEST CASE'
def analyze_sentiment_of_list(self, list):
... | StarcoderdataPython |
4842686 | import os
import os.path
import click
import jinja2
import webbrowser
import tmt
HTML_TEMPLATE = """
<!DOCTYPE html>
<head>
<title>Test results of {{ plan.name }}</title>
<style>
td.pass {
background: green;
}
td.fail{
background: red;
}
td.inf... | StarcoderdataPython |
3338527 | import math
import numpy as np
class DWAAgent():
def __init__(self,
max_speed=0.55,
min_speed=.1,
max_yawrate=1.0,
max_accel=1.6,
max_dyawrate=3.2,
v_reso=0.15,
yawrate_reso=0.05,
dt=0.1... | StarcoderdataPython |
1620428 | import RPi.GPIO as GPIO
from sensorlib.hx711 import HX711
from config.config import Config
from numpy import median
import time
class Scale:
def __init__(self):
self.config = Config() # config init
self.config_data = self.config.get_config_data()
self.hx = HX711(5, 6) # initialize scale
... | StarcoderdataPython |
3364090 | import pexpect
from threading import Thread
mpg_outs = [
{
"mpg_code": "@P 0",
"action": "user_stop",
"description": "Music has been stopped by the user."
},
{
"mpg_code": "@P 1",
"action": "user_pause",
"description": "Music has been paused by the user."
... | StarcoderdataPython |
4820957 | import bpy
from .ui import SprayPanel
from .operators import AddIsoCamera, AlignCamera, RenderSprites
bl_info = {
'name': 'Spray',
'author': '<NAME>',
'location': '3D View > Tools Panel > Spray',
'version': (0, 1, 0),
'description': 'Helps to render sprite images',
'wiki_url': 'https://github.... | StarcoderdataPython |
4822076 | <reponame>GiulianaPola/select_repeats<filename>venv/lib/python3.8/site-packages/poetry/core/_vendor/tomlkit/__init__.py
/home/runner/.cache/pip/pool/08/ad/d4/020e17fbbc3b0b01a2b5c142e8bcaf1c100aa9d966028812c574a267fd | StarcoderdataPython |
3273668 | default_app_config = 'saas.apps.SaasConfig'
| StarcoderdataPython |
3263429 | <filename>app/core/manager.py
from app import manager
@manager.command
def load_dummies():
pass
| StarcoderdataPython |
68128 | from git_changelog.build import Commit
from git_changelog.style import AngularStyle
def test_angular_style_breaking_change():
subject = "feat: this is a new breaking feature"
body = ["BREAKING CHANGE: there is a breaking feature in this code"]
commit = Commit(hash="aaaaaaa", subject=subject, body=body, au... | StarcoderdataPython |
43838 | <reponame>Miso-K/DDCW<gh_stars>1-10
import pickle
"""Run visualization of internal metrics of DDCW model after evaluation (read saved evaluation object)"""
evaluator = pickle.load(open("evaluatorobject", "rb"))
# Plotting internal model metrics (for DDCW model)
from utils import plot_custom_model_metrics as pc
pc.plot... | StarcoderdataPython |
3229979 | <reponame>EwaldvanGeffen/neutron
# Copyright (c) 2014 OpenStack Foundation.
# 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/l... | StarcoderdataPython |
1629170 | from datetime import datetime, timedelta
import json
import logging
import random
import time
import uuid
from urllib.parse import urlencode, urljoin
from defusedxml.ElementTree import fromstring, ParseError
from django.utils.functional import cached_property
from django.utils.text import slugify
from django.utils.time... | StarcoderdataPython |
1734665 | """
Django settings for rss_temple project.
"""
import os
import datetime
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com... | StarcoderdataPython |
158666 | import tensorflow as tf
class Stats:
def __init__(self, config, run_name, is_eval):
self.is_eval = is_eval
self.reward = 0
self.step_count = 0
self.loss = 0.0
self.loss_count = 0
self.episodes = 0
self.current_score = 0
self.max_score = None
... | StarcoderdataPython |
3253483 | from unittest.mock import Mock
import pandas
from src.engine.company_tax_regime import CompanyTaxRegime
from .fixtures import mock_load_dicts_code_to_name
data_mock = [
['2020', '00.055.699/0001-97', 'LUCRO ARBITRADO', 'GOIANIA', 'GO'],
['2020', '00.091.639/0001-20', 'LUCRO PRESUMIDO', 'GOIANIA', 'G... | StarcoderdataPython |
3201497 | <gh_stars>0
import pytest
from acondbs.db.sa import sa
from acondbs.models import GitHubToken, GitHubUser
##__________________________________________________________________||
@pytest.fixture
def app(app_empty):
y = app_empty
#
# +-------+ +--------+
# | user1 | --+--> | token1 |
# +... | StarcoderdataPython |
3271466 | <filename>capstone/animalproject/animalapp/views.py
from django.shortcuts import render, redirect, HttpResponseRedirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth import authenticate, login, logout
from .models import Animal, Cat, Dog, Image
from .forms import AnimalForm, DogForm, ... | StarcoderdataPython |
3298437 | <reponame>theatlasroom/nanotune
# Copyright (c) 2021 <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import copy
import datetime
import json
import logging
import time
from contextlib import contextmanager
from sqlite3 import OperationalError
from string import Template... | StarcoderdataPython |
3216296 | <reponame>mitsuhiko/zine
"""
zine.utils.mail
~~~~~~~~~~~~~~~
This module implements some email-related functions and classes.
:copyright: (c) 2010 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import re
try:
from email.mime.text impo... | StarcoderdataPython |
1740616 | <reponame>blackpan2/step2save<gh_stars>0
#!/usr/bin/env python3
import os
import sys
import connexion
from .encoder import JSONEncoder
from .util import deserialize_date, deserialize_datetime
lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'database/'))
sys.path.append(lib_path)
lib_path = os.path.a... | StarcoderdataPython |
101278 | <filename>tests/test_util.py
# -*- coding: utf-8 -*-
"""Test out the utility functions."""
from malt import json
def test_json():
resp = json({'greeting': 'Hello World!'})
assert resp.headers['Content-Type'] == 'application/json; charset=utf-8'
assert list(resp) == [b'{"greeting":"Hello World!"}\n']
d... | StarcoderdataPython |
1609632 | import numpy as np
from skipi.function import Function, Integral
from ..helper import assert_equal, randspace
def test_integration():
x_domain = np.linspace(0, 10, 100)
f = Function(x_domain, lambda x: 6 * x)
F = Integral.from_function(f)
F2 = Function(x_domain, lambda x: 3 * x ** 2)
assert_equa... | StarcoderdataPython |
1638136 | <reponame>janelia-idf/elf
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import matplotlib.pyplot as plot
import numpy
from numpy.polynomial.polynomial import polyfit,polyadd,Polynomial
import argparse
INCHES_PER_ML = 0.078
VOLTS_PER_ADC_UNIT = 0.0049
def load_numpy_data(path):
with open(... | StarcoderdataPython |
171838 | <gh_stars>0
"""
A Requests Session with a base URL.
"""
from .requests_base import BaseUrlSession # noqa
| StarcoderdataPython |
46150 | from pandas import DataFrame
from weaverbird.backends.pandas_executor.types import DomainRetriever, PipelineExecutor
from weaverbird.pipeline.steps import UnpivotStep
def execute_unpivot(
step: UnpivotStep,
df: DataFrame,
domain_retriever: DomainRetriever = None,
execute_pipeline: PipelineExecutor = ... | StarcoderdataPython |
102248 | <reponame>sozercan/tensorflow-server
import numpy as np
import json
class Server:
model = None
def set_model(self, model):
self.model = model
def server_running(self):
return 'Server is running.'
def predict(self):
x = np.random.rand(1,784)
prediction = self.model.predict(x)
return json.... | StarcoderdataPython |
1628226 | <reponame>numankh/HypeBeastDashboard<gh_stars>0
from ntpath import join
import requests
from bs4 import BeautifulSoup
import re
import os
import urllib.request
from utils.cleaning import cleanString
from nlp.readabilityIndex import flesch_reading_ease_score
from nlp.readabilityIndex import average_grade_score
from date... | StarcoderdataPython |
3325076 | from flask import render_template, request, redirect
from flask import url_for, abort, jsonify
from flask import session as login_session
from catalog import app, login_required
import models
@app.route('/item/<int:category_id>/new', methods=["GET", "POST"])
@login_required
def newItem(category_id):
"""Add a new... | StarcoderdataPython |
1685834 | <reponame>vanam/clustering
#!/usr/bin/env python3
import argparse
import logging
import os
from enum import Enum
from multiprocessing.pool import Pool
import itertools
from gensim.corpora import Dictionary, MmCorpus
from clustering_system.corpus.LineCorpus import LineCorpus
from clustering_system.model.Doc2vec impo... | StarcoderdataPython |
1620065 | <gh_stars>0
import syft
if syft.dependency_check.tensorflow_available:
from syft_tensorflow.hook import TensorFlowHook
from syft_tensorflow.tensor import TensorFlowTensor
setattr(syft, "TensorFlowHook", TensorFlowHook)
| StarcoderdataPython |
1696998 | from lib.http import render_json
from common.keys import VCODE_PREFIX
from django.core.cache import cache
from social import settings
# Create your views here.
from lib.sms import send_sms
from user.logics import upload_qiniu
from user.models import User
import logging
inf_log = logging.getLogger('inf')
# 先经过 Sessi... | StarcoderdataPython |
3318140 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | StarcoderdataPython |
1766091 | # -*- coding: utf-8 -*-
"""
Module to process export
"""
def export_info(cfg, data, category, measure_type):
"""
Export data to service
:param cfg: Config file
:type cfg: TwinDBBackupConfig
:param data: Data
:param category: Category of data
:param measure_type: Type of measure
:param... | StarcoderdataPython |
115800 | import os
from django.conf import settings
from django.db import models
from django.utils import timezone
from datetime import datetime, timedelta
from uuid import uuid4
def get_image_path(instance, filename):
ymd_path = datetime.now().strftime('%Y/%m/%d')
uuid_name = uuid4().hex
return '/'.join(['image_f... | StarcoderdataPython |
165642 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import pandas as pd
metadata = pd.read_csv('pcawg_download/WGS.metadata.tsv', sep='\t')
histo_data = pd.read_excel('pcawg_download/pcawg_specimen_histology_August2016_v9.xlsx')
match_cohort = pd.read_excel('pcawg_download/tumour_subtype_consolidation_map.tsv.xlsx', sheet_na... | StarcoderdataPython |
147409 | <gh_stars>10-100
# -*- coding: utf-8 -*-
__title__ = 'pmdp'
__version__ = '0.3'
__author__ = '<NAME>'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 <NAME>'
from . import parser
from . import writer
from . import parse_elb_log_local
from . import parse_elb_log_lambda
| StarcoderdataPython |
1743408 | <gh_stars>100-1000
'''
From PyTorch:
Copyright (c) 2016- Facebook, Inc (<NAME>)
Copyright (c) 2014- Facebook, Inc (<NAME>)
Copyright (c) 2011-2014 Idiap Research Institute (<NAME>)
Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
Copyright (c) 2011-2012 NEC Laboratorie... | StarcoderdataPython |
33742 | print
print 21
print 3
| StarcoderdataPython |
106607 | <reponame>NEU-CSYE6225-SEC03/webservice<gh_stars>0
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Add path of cwd to sys
import json
import asyncio
from io import BytesIO
import time
import statsd
import tornado.web
import tornado.ioloop
import tornado.httpserve... | StarcoderdataPython |
3250690 | <reponame>peter-stoyanov/Python
hello = "Hello World!"
print(hello)
| StarcoderdataPython |
84877 | from django.shortcuts import render
from rest_framework import viewsets
from . import models, serializers
class SpectroscopyViewSet(viewsets.ModelViewSet):
queryset = models.Spectroscopy.objects.all()
serializer_class = serializers.SpectroscopySerializer
class AtomicAbsorptionViewSet(viewsets.ModelViewSet):... | StarcoderdataPython |
1681877 | from django.contrib import admin
from symposion.reviews.models import NotificationTemplate
admin.site.register(NotificationTemplate)
| StarcoderdataPython |
3219463 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import csv
import io
import logging
import re
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Opti... | StarcoderdataPython |
3390429 | <filename>S4/S4 Library/simulation/rewards/reward_commands.py
import server_commands.argument_helpers
import services
import sims4.commands
from server_commands.argument_helpers import TunableInstanceParam
logger = sims4.log.Logger('Rewards')
@sims4.commands.Command('rewards.give_reward')
def give_reward(reward_type:T... | StarcoderdataPython |
1776957 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# Laboratoire Parole et Langage
#
# Copyright (C) 2017-2018 <NAME>
#
# Use of this software is governed by the GPL, v3
# This banner notice must not be removed
# ---------... | StarcoderdataPython |
199690 | <filename>datasets/synthetic.py
import os
import sys
import numpy as np
from scipy.stats import norm
from PIL import Image
import torch
import torchvision
ROOT_DIR = os.path.dirname(os.getcwd())
if ROOT_DIR not in sys.path: sys.path.append(ROOT_DIR)
import DeepSparseCoding.utils.data_processing as dp
class Syntheti... | StarcoderdataPython |
3311654 | <filename>processing/load_mixedcitations.py
# coding: utf-8
"""
This scripts loads the mixed citations of a given article.
"""
import re
import os
import argparse
import logging
import codecs
import json
import unicodedata
from articlemeta import controller
from xylose.scielodocument import Article
logger = logging.g... | StarcoderdataPython |
139537 | import serial #Serial imported for Serial communication
import time #Required to use delay functions
import pyautogui
ArduinoSerial = serial.Serial('COM11',9600) #Create Serial port object called arduinoSerialData
time.sleep(2) #wait for 2 seconds for the communication to get established
# a(2) | ... | StarcoderdataPython |
3262282 | <filename>Conditions if, then, else/18BishopMoves.py
#In chess, the bishop moves diagonally, any number of squares.
# Given two different squares of the chessboard, determine whether a bishop can go from the first to the second in one move.
r = int(input())
if r >8 or r < 1 :
print("Invalid")
exit()
c = int(i... | StarcoderdataPython |
1686109 | ################################################################################
## Copyright (c) 2019, <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:
##
## 1. Redistributions of s... | StarcoderdataPython |
1637811 | <reponame>minyiky/xSACdb
from xSACdb.roles.functions import *
from .trip_state import *
class TripPermissionMixin:
def _is_modifier(self, user):
return is_trips(user) or self.owner == user.get_profile()
def can_view(self, user):
if self.is_public:
return is_verified(user)
... | StarcoderdataPython |
62123 |
import sys
import os
# Add basedir to path
script_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(script_dir + "/../")
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
from data.utils import read_pickle_from_file
from dscribe.descriptors import ACSF
... | StarcoderdataPython |
3351453 | <gh_stars>1-10
# Copyright 2015 Google Inc. 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
# Unless required by applica... | StarcoderdataPython |
3254615 | <filename>dataPipelines/scripts/es_export.py<gh_stars>10-100
import subprocess as sub
from pathlib import Path
import typing as t
import argparse
import os
import shutil
import json
from collections import defaultdict
import datetime as dt
import hashlib
import tempfile
import logging
PACKAGE_PATH: str = os.path.dirna... | StarcoderdataPython |
1795740 | <filename>desertbot/user.py<gh_stars>1-10
from typing import Optional
class IRCUser(object):
def __init__(self, nick: str, ident: Optional[str] = None, host: Optional[str] = None):
self.nick = nick
self.ident = ident
self.host = host
self.gecos = None
self.server = None
... | StarcoderdataPython |
4835242 | <reponame>nnzhan/AutoGCN
"""
Utility file to select GraphNN model as
selected by the user
"""
from nets.CitationGraphs_node_classification.gcn_net import GCNNet
from nets.CitationGraphs_node_classification.gat_net import GATNet
from nets.CitationGraphs_node_classification.graphsage_net import GraphSageNet
from... | StarcoderdataPython |
10188 | from spaceone.inventory.libs.manager import AWSManager
# todo: __init__에서 한번에 명세 할수 있게 바꾸기
# 지금은 로케이터에서 글로벌에서 값을 가져오는 로직 때문에 별도 파일이 없으면 에러 발생
class RDSConnectorManager(AWSManager):
connector_name = 'RDSConnector'
| StarcoderdataPython |
1736387 | from .host import MyHost
from .topo import WebserverAttacker, Simple
from .myswitch import MySwitch
| StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.